<mvc:View xmlns:rowmodes='sap.ui.table.rowmodes' xmlns:mvc='sap.ui.core.mvc' xmlns='sap.m' xmlns:core='sap.ui.core' xmlns:t='sap.ui.table' xmlns:l='sap.ui.layout' xmlns:f='sap.ui.layout.form' xmlns:mc='sap.mcsuite.controls' xmlns:dnd='sap.ui.core.dnd' controllerName='sap.mcsuite.modules.users.tasks.detail_add.controller.Task' xmlns:utils='sap.mcsuite.model.utils' xmlns:cssgrid='sap.ui.layout.cssgrid' xmlns:tcm='sap.m.table.columnmenu' core:require="{
    format: 'sap/mcsuite/model/Format', 
    translate: 'sap/mcsuite/model/Translate', 
    utils: 'sap/mcsuite/model/Utils'
  }" >
<cssgrid:CSSGrid id='header' class='header-container' width='100%' gridTemplateColumns='1fr 1fr 1fr'>
<HBox id='breadcrumb' class='breadcrumb-container' alignItems='Start' justifyContent='Start'>
  <Breadcrumbs class='breadcrumb' separatorStyle='Slash' currentLocationText='{parts: [{value:"BREADCRUMB"}, {value:"7002"}, {value:"Add details"}], formatter: "translate.Label.get"}'>
    <Link id='homeLink' press='goHome' text='Home' icon='sap-icon://home'/>
    <Link id='moduleLink' press='taskNav' text='{parts: [{value:"FOLDER"}, {value:"USERS"}, {value:""}], formatter: "translate.Label.get"}'>
      <customData>
        <core:CustomData key='module' value='users'/>
        <core:CustomData key='task' value='index'/>
      </customData>
    </Link>
    </Breadcrumbs>
    </HBox>
<HBox id='title' class='title-container' alignItems='Center' justifyContent='Center'>
    <Title text='{query>/name}'  level='H1'/>
</HBox>
<HBox id='quicksearch' class='quicksearch-container' alignItems='Center' justifyContent='Center'>
</HBox>
  </cssgrid:CSSGrid>
<VBox id='content' class='content-container' alignItems='Start' justifyContent='Start' width='100%' wrap='Wrap'>
  <HBox class='options hidden-if-empty' width='100%'>
  </HBox>
  <HBox class='aside-main-container' width='100%'>
  <VBox class='aside hidden-if-empty'>
  </VBox>
  <VBox class='main'>
<VBox
                    class='mc-form' 
                    backgroundDesign='Solid'
                    alignContent='SpaceAround'
                    id='subtask26795'
                >
                    <Title
                        text='{parts: [{value:"SUBTITLE"}, {value:"26795"}, {value:"Add detail"}], formatter: "translate.Label.get"}'
                        level='H2'
                    />
                    <f:Form editable='true'>
                        <f:layout>
                            <f:ResponsiveGridLayout
                                labelSpanXL='2'
                                labelSpanL='2'
                                labelSpanM='2'
                                labelSpanS='2'
                                adjustLabelSpan='true'
                                emptySpanXL='0'
                                emptySpanL='4'
                                emptySpanM='0'
                                emptySpanS='0'
                                columnsXL='1'
                                columnsL='1'
                                columnsM='1'
                                singleContainerFullSize='true'
                            />
                        </f:layout>
                        <f:formContainers>
                            <f:FormContainer>
                            		<f:FormElement
                                    label='{parts: [{value:"cfr_users_dt"}, {value:"user_id"}], formatter: "translate.Field.get"}'
                                    visible="{= !!${newEntity>/client_id} || !!${newEntity>/shop_id} }"
                                >
                                    <f:fields>
                                        <Input
                                        	visible="{= !!${newEntity>/client_id} || !!${newEntity>/shop_id} }"
                                            id='users-details-user-select'
                                            showValueHelp='true'
                                            selectedKey="{path: 'newEntity>/user_id', targetType: 'string', type: 'sap.ui.model.type.Integer', formatOptions: { groupingEnabled: false }}"
                                            suggestionItems="{path: '/authuser'}"
                                            valueHelpRequest='onValueHelpRequest'
                                            class='mc-add-select'
                                            editable='true'
                                            valueHelpIconSrc='sap-icon://fa-solid/chevron-down'
                                        >
                                            <customData>
                                                <core:CustomData key='mandatory' value='true' />
                                                <core:CustomData key='table' value='authuser' />
                                                <core:CustomData key='title' value='User' />
                                                <core:CustomData key='filter' value="status eq 'Active' and hidden ne 'true'" />
                                                <core:CustomData key='orderby' value='name' />
                                            </customData>
                                            <core:Item
                                                key="{path: 'id', type: 'sap.ui.model.type.Integer', formatOptions: { groupingEnabled: false }}"
                                                text="{name}"
                                            />
                                        </Input>
                                    </f:fields>
                                </f:FormElement>
                                <f:FormElement
                                    label='{parts: [{value:"cfr_users_dt"}, {value:"role_id"}], formatter: "translate.Field.get"}'
                                    visible="{= !${newEntity>/client_id} ? !${newEntity>/shop_id} : false }"
                                >
                                    <f:fields>
                                        <Input
                                            visible="{= !${newEntity>/client_id} ? !${newEntity>/shop_id} : false }"
                                            id='users-details-role-select'
                                            showValueHelp='true'
                                            selectedKey="{path: 'newEntity>/role_id', targetType: 'string', type: 'sap.ui.model.type.Integer', formatOptions: { groupingEnabled: false }}"
                                            suggestionItems="{path: '/cfr_roles_bs'}"
                                            valueHelpRequest='onValueHelpRequest'
                                            class='mc-add-select'
                                            editable='true'
                                            valueHelpIconSrc='sap-icon://fa-solid/chevron-down'
                                            change="utils.UsersDetails.onChangeRole"
                                        >
                                            <customData>
                                                <core:CustomData key='mandatory' value='true' />
                                                <core:CustomData key='table' value='cfr_roles_bs' />
                                                <core:CustomData key='title' value='Rolle' />
                                                <core:CustomData key='filter' value='status lt 90' />
                                                <core:CustomData key='orderby' value='name' />
                                            </customData>
                                            <core:Item
                                                key="{path: 'id', type: 'sap.ui.model.type.Integer', formatOptions: { groupingEnabled: false }}"
                                                text="{= ${name} + ' - ' + ${_cat_id/name}}"
                                            />
                                        </Input>
                                    </f:fields>
                                </f:FormElement>
                                <f:FormElement
                                    label='{parts: [{value:"cfr_users_dt"}, {value:"role_id"}], formatter: "translate.Field.get"}'
                                    visible="{= !!${newEntity>/client_id} }"
                                >
                                    <f:fields>
                                        <Input
                                            visible="{= !!${newEntity>/client_id} }"
                                            id='users-details-role-select-client'
                                            showValueHelp='true'
                                            selectedKey="{path: 'newEntity>/role_id', targetType: 'string', type: 'sap.ui.model.type.Integer', formatOptions: { groupingEnabled: false }}"
                                            suggestionItems="{path: '/cfr_roles_bs'}"
                                            valueHelpRequest='onValueHelpRequest'
                                            class='mc-add-select'
                                            editable='true'
                                            valueHelpIconSrc='sap-icon://fa-solid/chevron-down'
                                            change="utils.UsersDetails.onChangeRole"
                                        >
                                            <customData>
                                                <core:CustomData key='mandatory' value='true' />
                                                <core:CustomData key='table' value='cfr_roles_bs' />
                                                <core:CustomData key='title' value='Rolle' />
                                                <core:CustomData key='filter' value="status lt 90 and type eq 'CLIENT'" />
                                                <core:CustomData key='orderby' value='name' />
                                            </customData>
                                            <core:Item
                                                key="{path: 'id', type: 'sap.ui.model.type.Integer', formatOptions: { groupingEnabled: false }}"
                                                text="{= ${name} + ' - ' + ${_cat_id/name}}"
                                            />
                                        </Input>
                                    </f:fields>
                                </f:FormElement>
                                <f:FormElement
                                    label='{parts: [{value:"cfr_users_dt"}, {value:"role_id"}], formatter: "translate.Field.get"}'
                                    visible="{= !!${newEntity>/shop_id} }"
                                >
                                    <f:fields>
                                        <Input
                                            visible="{= !!${newEntity>/shop_id} }"
                                            id='users-details-role-select-shop'
                                            showValueHelp='true'
                                            selectedKey="{path: 'newEntity>/role_id', targetType: 'string', type: 'sap.ui.model.type.Integer', formatOptions: { groupingEnabled: false }}"
                                            suggestionItems="{path: '/cfr_roles_bs'}"
                                            valueHelpRequest='onValueHelpRequest'
                                            class='mc-add-select'
                                            editable='true'
                                            valueHelpIconSrc='sap-icon://fa-solid/chevron-down'
                                            change="utils.UsersDetails.onChangeRole"
                                        >
                                            <customData>
                                                <core:CustomData key='mandatory' value='true' />
                                                <core:CustomData key='table' value='cfr_roles_bs' />
                                                <core:CustomData key='title' value='Rolle' />
                                                <core:CustomData key='filter' value="status lt 90 and type eq 'SHOP'" />
                                                <core:CustomData key='orderby' value='name' />
                                            </customData>
                                            <core:Item
                                                key="{path: 'id', type: 'sap.ui.model.type.Integer', formatOptions: { groupingEnabled: false }}"
                                                text="{= ${name} + ' - ' + ${_cat_id/name}}"
                                            />
                                        </Input>
                                    </f:fields>
                                </f:FormElement>
                                <f:FormElement
                                    label='{parts: [{value:"cfr_users_dt"}, {value:"type"}], formatter: "translate.Field.get"}'
                                >
                                    <f:fields>
                                        <Select
                                            enabled="false"
                                            id='users-details-type-select'
                                            selectedKey="{path: 'newEntity>/type', targetType: 'string'}"
                                            class='mc-add-select'
                                            editable='true'
                                            forceSelection='false'
                                            change="utils.UsersDetails.onChangeType"
                                        >
                                            <customData>
                                                <core:CustomData
                                                    key='mandatory'
                                                    value='true'
                                                />
                                                <core:CustomData
                                                    key='useSelectedKey'
                                                    value='true'
                                                />
                                            </customData>
                                            <core:Item
                                                key='CLIENT'
                                                text='{parts: [{value:"LABEL"}, {value:"CLIENT"}, {value:"Organisationseinheit"}], formatter: "translate.Label.get"}'
                                            />
                                            <core:Item
                                                key='SHOP'
                                                text='{parts: [{value:"LABEL"}, {value:"SHOP"}, {value:"Objekt"}], formatter: "translate.Label.get"}'
                                            />
                                            <core:Item
                                                key='ROSTER'
                                                text='{parts: [{value:"LABEL"}, {value:"ROSTER"}, {value:"Sicherheitsdienst"}], formatter: "translate.Label.get"}'
                                            />
                                            <core:Item
                                                id="users-details-type-select-general"
                                                enabled="false"
                                                key='ALL'
                                                text='{parts: [{value:"LABEL"}, {value:"GENERAL"}, {value:"Allgemein"}], formatter: "translate.Label.get"}'
                                            />
                                        </Select>
                                    </f:fields>
                                </f:FormElement>
                                <f:FormElement
                                    label='{parts: [{value:"cfr_users_dt"}, {value:"client_id"}], formatter: "translate.Field.get"}'
                                    visible="{= ${newEntity>/type} === 'CLIENT' ? !${newEntity>/client_id} : false }"
                                >
                                    <f:fields>
                                        <MultiInput
                                            visible="{= ${newEntity>/type} === 'CLIENT' ? !${newEntity>/client_id} : false }"
                                            id='users-details-client-MultiInput'
                                            showValueHelp='true'
                                            selectedKey="{path: 'newEntity>/client_id', targetType: 'string', type: 'sap.ui.model.type.Integer', formatOptions: { groupingEnabled: false }}"
                                            suggestionItems="{path: '/crm_clients_bs'}"
                                            valueHelpRequest='onValueHelpRequest'
                                            class='mc-add-select'
                                            editable='true'
                                            valueHelpIconSrc='sap-icon://fa-solid/chevron-down'
                                        >
                                            <customData>
                                                <core:CustomData key='mandatory' value='true' />
                                                <core:CustomData key='title' value='Org-Einheit' />
                                                <core:CustomData key='table' value='crm_clients_bs' />
                                                <core:CustomData key='fields' value='name, _parent_id/name' />
                                                <core:CustomData key='filter' value='status lt 90' />
                                                <core:CustomData key='orderby' value='name' />
                                            </customData>
                                            <core:Item
                                                key="{path: 'id', type: 'sap.ui.model.type.Integer', formatOptions: { groupingEnabled: false }}"
                                                text='{name}'
                                            />
                                        </MultiInput>
                                    </f:fields>
                                </f:FormElement>
                                <f:FormElement
                                    label='{parts: [{value:"cfr_users_dt"}, {value:"roster_id"}], formatter: "translate.Field.get"}'
                                    visible="{= ${newEntity>/type} === 'ROSTER' }"
                                >
                                    <f:fields>
                                        <MultiInput
                                            visible="{= ${newEntity>/type} === 'ROSTER' }"
                                            id='users-details-roster-input'
                                            showValueHelp='true'
                                            selectedKey="{path: 'newEntity>/roster_id', targetType: 'string', type: 'sap.ui.model.type.Integer', formatOptions: { groupingEnabled: false }}"
                                            suggestionItems="{path: '/gpv_rosters_bs', parameters: {$filter: 'status lt 90'}}"
                                            valueHelpRequest='onValueHelpRequest'
                                            class='mc-add-select'
                                            editable='true'
                                            valueHelpIconSrc='sap-icon://fa-solid/chevron-down'
                                        >
                                            <customData>
                                                <core:CustomData key='mandatory' value='true' />
                                                <core:CustomData key='title' value='Sicherheitsdienste' />
                                                <core:CustomData key='table' value='gpv_rosters_bs' />
                                                <core:CustomData key='filter' value='status lt 90' />
                                                <core:CustomData key='orderby' value='name' />
                                            </customData>
                                            <core:Item
                                                key="{path: 'id', type: 'sap.ui.model.type.Integer', formatOptions: { groupingEnabled: false }}"
                                                text='{name}'
                                            />
                                        </MultiInput>
                                    </f:fields>
                                </f:FormElement>
                                <f:FormElement
                                    label='{parts: [{value:"cfr_users_dt"}, {value:"shop_id"}], formatter: "translate.Field.get"}'
                                    visible="{= ${newEntity>/type} === 'SHOP' ? !${newEntity>/shop_id} : false }"
                                >
                                    <f:fields>
                                        <MultiInput
                                            visible="{= ${newEntity>/type} === 'SHOP' ? !${newEntity>/shop_id} : false }"
                                            id='users-details-shop-MultiInput'
                                            showValueHelp='true'
                                            selectedKey="{path: 'newEntity>/shop_id', targetType: 'string', type: 'sap.ui.model.type.Integer', formatOptions: { groupingEnabled: false }}"
                                            suggestionItems="{path: '/crm_shops_bs'}"
                                            valueHelpRequest='onValueHelpRequest'
                                            class='mc-add-select'
                                            editable='true'
                                            valueHelpIconSrc='sap-icon://fa-solid/chevron-down'
                                        >
                                            <customData>
                                                <core:CustomData key='mandatory' value='true'/>
                                                <core:CustomData key='table' value='crm_shops_bs' />
                                                <core:CustomData key='fields' value='sap_number, name' />
                                                <core:CustomData key='filter' value='status lt 90' />
                                                <core:CustomData key='orderby' value='sap_number, name' />
                                            </customData>
                                            <core:Item
                                                key="{path: 'id', type: 'sap.ui.model.type.Integer', formatOptions: { groupingEnabled: false }}"
                                                text='{name}'
                                            />
                                        </MultiInput>
                                    </f:fields>
                                </f:FormElement>
                            </f:FormContainer>
                        </f:formContainers>
                    </f:Form>
                    <HBox
                        width='100%'
                        alignItems='Center'
                        justifyContent='Center'
                    >
                        <Button
                            text='{parts: [{value:"BUTTON"}, {value:"26795"}, {value:"Save"}], formatter: "translate.Label.get"}'
                            id='subtask26795-submitButton'
                        >
                            <customData>
                                <core:CustomData
                                    key='module'
                                    value='users'
                                />
                                <core:CustomData
                                    key='task'
                                    value='users_show'
                                />
                                <core:CustomData
                                    key='field'
                                    value='id'
                                />
                                <core:CustomData
                                    key='value'
                                    value='{query>/id}'
                                />
                            </customData>
                        </Button>
                    </HBox>
                </VBox>
  </VBox>
  </HBox>
</VBox>
</mvc:View>