﻿<?xml version="1.0" encoding="utf-8"?>
<ReportsExport>
  <Reports>
    <Report id="50945abc-07a1-40ea-9f95-02a9ec1c304d" codekey="ADAC_UserExport" categoryCodekey="SpecialPurpose" name="Export Benutzer" description="Benutzerliste pro Mandant">
      <MetaData created="2009-06-17T11:25:37" createdBy="Marcus Renowitsch" createdBy_user_id="12" modified="2012-02-01T18:54:26" modifiedBy="Administrator Zentrale" />
      <ExecutionDetails format="TableResult" commandType="SqlCommandOrQuery" exportHandler="" adminControl="" exportMultipleTablesToSheets="False" datesWithTime="False" extraParams="" />
      <Mandators mandatorMode="OnlyOwner" mandator_id="b48b7d89-7501-429c-abcd-457cecce34a5" mandatorName="ADAC" isStandard="False" isUsedByMenu="False" />
      <Parameters>
        <Parameter id="a785aecc-668a-4609-9613-394bd4d708c2" isRequired="False" name="Mandant" contextName="Mandant" defaultValue="" renderHint="Undefined" disableParameter="DontDisable" />
      </Parameters>
      <Roles>
        <Role id="90" />
      </Roles>
      <command>CREATE TABLE #tmpRoles (
    role_id INT, 
    title NVARCHAR(256)
)

INSERT INTO #tmpRoles (role_id, title) VALUES (10, 'Lerner')
INSERT INTO #tmpRoles (role_id, title) VALUES (20, 'Content Manager')
INSERT INTO #tmpRoles (role_id, title) VALUES (30, 'Trainer')
INSERT INTO #tmpRoles (role_id, title) VALUES (40, 'TAS Manager')
INSERT INTO #tmpRoles (role_id, title) VALUES (50, 'Tutor')
INSERT INTO #tmpRoles (role_id, title) VALUES (60, 'Fachbereich-Koordinator')
INSERT INTO #tmpRoles (role_id, title) VALUES (70, 'ZGV')
INSERT INTO #tmpRoles (role_id, title) VALUES (80, 'Koordinator')
INSERT INTO #tmpRoles (role_id, title) VALUES (90, 'Administrator')
INSERT INTO #tmpRoles (role_id, title) VALUES (100, 'Plattform-Verwaltung')

SELECT v_Users.descUserCn AS 'Kennung', 
       v_Users.Nachname AS 'Nachname', 
       v_Users.vorname AS 'Vorname', 
       #tmpRoles.title AS 'Rolle', 
       v_Users.blocked AS 'Gesperrt'
  FROM v_Users
       INNER JOIN #tmpRoles ON #tmpRoles.role_id = v_Users.SecurityId
       INNER JOIN tblMandators ON tblMandators.id = v_Users.mandator_id AND tblMandators.isTemplate = 0
 WHERE (v_Users.mandator_id = @mandator_id OR @mandator_id IS NULL)
 ORDER BY v_Users.descUserCn ASC

DROP TABLE #tmpRoles
      </command>
    </Report>
  </Reports>
  <Parameters>
    <Parameter id="a785aecc-668a-4609-9613-394bd4d708c2" isSystem="True" name="Mandant" reportParameterType_id="6b8fa242-5449-45b3-a81a-65a7e5e3b51d" queryParameterName="@mandator_id" />
  </Parameters>
  <ParameterTypes>
    <ParameterType id="6b8fa242-5449-45b3-a81a-65a7e5e3b51d" isSystem="True" name="Mandator" datatype="Mandator" dataValueField="" dataTextField="" />
  </ParameterTypes>
</ReportsExport>