<?xml version="1.0" encoding="UTF-8"?>
<module_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="itop-portal" xsi:type="portal" _altered_in="itop-portal">
  <properties>
    <name>portal:itop-portal</name>
    <!-- Can be either a fileref or a relative path to the file (To be tested). Takes over env-xxx/branding/portal-logo.png -->
    <!-- Priority order is <logo> from xml > env-xxx/branding/portal-logo.png > /images/logo-itop-dark-bg.svg -->
    <!--<fileref ref="brt_6a2be154b2a62659d3332c513bdad715"  />-->
    <!--<logo>../images/itop-logo.png</logo>-->
    <!-- Can be either a fileref or a relative path to the file from /env-xxx (eg. itop-portal-base/mystyle.css) -->
    <!-- Available themes must have a unique id. Some ids are loaded in a specific order : bootstrap/portal/custom. Other ids are loaded after them, but their order cannot be predicted -->
    <themes/>
    <!-- Can be either a fileref or a relative path to the file from /env-xxx (eg. itop-portal-base/mytemplate.html.twig) -->
    <!-- Available templates are id="layout|home" -->
    <templates/>
    <!-- Class used for generating objects view/edit urls (eg. in linked sets). -->
    <!-- Note: Notification placeholders are NOT using this but the "DBObject::RegisterURLMakerClass(<PORTAL_ID>, <CLASS_NAME>)" declarations. -->
    <urlmaker_class>iTopPortalViewUrlMaker</urlmaker_class>
    <!-- An OQL query to determine which TriggerOnPortalUpdate to use within THIS instance of the portal. This is mostly needed to enable different triggers on several portal instances -->
    <!-- Note : ":parent_classes" parameter is a reserved name that will be used for the current object class name (and its ancestors) -->
    <triggers_query><![CDATA[SELECT TriggerOnPortalUpdate AS t WHERE t.target_class IN (:parent_classes)]]></triggers_query>
    <attachments>
      <allow_delete>true</allow_delete>
    </attachments>
    <allowed_portals>
      <!-- Defines how other portals -allowed for the current user- will be opened. "tab" for a new tab, "self" for the current window -->
      <opening_mode>tab</opening_mode>
    </allowed_portals>
  </properties>
  <classes>
    <class id="User">
      <!-- Allow <allowed_profile>s to apply the <transition>s below. Flags on <field>s will be merged with those from datamodel -->
      <!-- See example in UserRequest class -->
      <!--<lifecycle/>-->
      <scopes>
        <!-- Note : Silos apply to those scope queries -->
        <scope id="all">
          <oql_view><![CDATA[SELECT User AS U JOIN Person AS P ON U.contactid=P.id WHERE P.id = :current_contact_id]]></oql_view>
          <!-- No object of this class can be edited -->
          <!--<oql_edit />-->
          <!-- Everybody -->
          <!--<allowed_profiles />-->
        </scope>
      </scopes>
    </class>
    <class id="Organization">
      <scopes>
        <scope id="all">
          <oql_view><![CDATA[SELECT Organization WHERE id = :current_contact->org_id]]></oql_view>
        </scope>
      </scopes>
    </class>
    <class id="Location">
      <scopes>
        <scope id="all">
          <oql_view><![CDATA[SELECT Location WHERE org_id = :current_contact->org_id]]></oql_view>
        </scope>
      </scopes>
    </class>
    <class id="Contact">
      <scopes>
        <scope id="all">
          <oql_view><![CDATA[SELECT Contact WHERE org_id = :current_contact->org_id]]></oql_view>
        </scope>
        <scope id="admin">
          <oql_view><![CDATA[SELECT Contact]]></oql_view>
          <allowed_profiles>
            <allowed_profile id="Administrator"/>
          </allowed_profiles>
        </scope>
      </scopes>
      <lists>
        <list id="default">
          <items>
            <item id="status">
              <rank>10</rank>
            </item>
            <item id="org_id">
              <rank>20</rank>
            </item>
            <item id="function">
              <rank>50</rank>
            </item>
          </items>
        </list>
      </lists>
    </class>
    <class id="ServiceFamily" _altered_in="itop-tickets">
      <scopes>
        <scope id="all">
          <oql_view><![CDATA[SELECT ServiceFamily AS sf JOIN Service AS s ON s.servicefamily_id = sf.id JOIN lnkCustomerContractToService AS l1 ON l1.service_id=s.id JOIN CustomerContract AS cc ON l1.customercontract_id=cc.id WHERE cc.org_id = :current_contact->org_id]]></oql_view>
          <ignore_silos>true</ignore_silos>
        </scope>
      </scopes>
    </class>
    <class id="Service" _altered_in="itop-tickets">
      <scopes>
        <scope id="all">
          <oql_view><![CDATA[SELECT Service AS s JOIN lnkCustomerContractToService AS l1 ON l1.service_id=s.id JOIN CustomerContract AS cc ON l1.customercontract_id=cc.id WHERE cc.org_id = :current_contact->org_id AND s.status != 'obsolete']]></oql_view>
          <ignore_silos>true</ignore_silos>
        </scope>
      </scopes>
    </class>
    <class id="ServiceSubcategory" _altered_in="itop-tickets">
      <scopes>
        <scope id="all">
          <oql_view _altered_in="itop-full-itil"><![CDATA[SELECT ServiceSubcategory WHERE status != 'obsolete']]></oql_view>
          <ignore_silos>true</ignore_silos>
        </scope>
      </scopes>
    </class>
    <class id="Ticket" _altered_in="itop-tickets">
      <scopes>
        <scope id="all">
          <oql_view><![CDATA[SELECT Ticket AS T WHERE T.caller_id = :current_contact_id AND T.finalclass IN ('UserRequest', 'Incident')]]></oql_view>
          <oql_edit><![CDATA[SELECT Ticket AS T]]></oql_edit>
        </scope>
        <scope id="portal-power-user">
          <oql_view><![CDATA[SELECT Ticket AS T WHERE T.org_id = :current_contact->org_id AND T.finalclass IN ('UserRequest', 'Incident')]]></oql_view>
          <oql_edit><![CDATA[SELECT Ticket AS T]]></oql_edit>
          <allowed_profiles>
            <allowed_profile id="Portal power user"/>
          </allowed_profiles>
        </scope>
      </scopes>
    </class>
    <class id="lnkContactToTicket" _altered_in="itop-tickets">
      <lists>
        <!-- Note: since 3.1.0, many to many attributes are displayed automatically, an empty list avoid this -->
        <list id="list">
          <items>
              </items>
        </list>
      </lists>
    </class>
    <class id="FAQCategory" _altered_in="itop-faq-light">
      <scopes>
        <scope id="all">
          <oql_view><![CDATA[SELECT FAQCategory]]></oql_view>
        </scope>
      </scopes>
    </class>
    <class id="FAQ" _altered_in="itop-faq-light">
      <scopes>
        <scope id="all">
          <oql_view><![CDATA[SELECT FAQ]]></oql_view>
        </scope>
      </scopes>
    </class>
  </classes>
  <bricks>
    <brick id="user-profile" xsi:type="Combodo\iTop\Portal\Brick\UserProfileBrick">
      <rank>
        <!-- Can be either a <default> tag for both home page and navigation menu or distinct <home> or/and <navigation_menu> tags-->
        <default>1</default>
      </rank>
      <title>
        <!-- Can be either a <default> tag for both home page and navigation menu or distinct <home> or/and <navigation_menu> tags-->
        <default>Brick:Portal:UserProfile:Navigation:Dropdown:MyProfil</default>
      </title>
      <decoration_class>
        <default>fas fa-user fa-2x</default>
      </decoration_class>
      <!-- Show / hide some of the user profile forms by setting the tag value to true|false -->
      <!--<show_picture_form>true</show_picture_form>-->
      <!--<show_preferences_form>true</show_preferences_form>-->
      <!--<show_password_form>true</show_password_form>-->
      <form>
        <!-- Optional tag to list the fields. If empty only fields from <twig> tag will be displayed, if omitted fields from zlist details will. -->
        <fields/>
        <!-- Optional tag to specify the form layout. Fields that are not positioned in the layout will be placed at the end of the form -->
        <twig>
          <!-- data-field-id attribute must be an attribute code of the class -->
          <!-- data-field-flags attribute contains flags among read_only/hidden/mandatory/must_prompt/must_change -->
          <div class="form_field" data-field-id="first_name" data-field-flags="read_only">
					</div>
          <div class="form_field" data-field-id="name" data-field-flags="read_only">
					</div>
          <div class="form_field" data-field-id="org_id" data-field-flags="read_only">
					</div>
          <div class="form_field" data-field-id="email" data-field-flags="read_only">
					</div>
          <div class="form_field" data-field-id="phone">
					</div>
          <div class="form_field" data-field-id="location_id">
					</div>
          <div class="form_field" data-field-id="function">
					</div>
          <div class="form_field" data-field-id="manager_id" data-field-flags="read_only">
					</div>
        </twig>
      </form>
    </brick>
    <brick id="services" xsi:type="Combodo\iTop\Portal\Brick\BrowseBrick" _altered_in="itop-tickets">
      <active>true</active>
      <width>6</width>
      <rank>
        <default>10</default>
      </rank>
      <title>
        <default>Brick:Portal:NewRequest:Title</default>
      </title>
      <description>Brick:Portal:NewRequest:Title+</description>
      <decoration_class>
        <default>fc fc-new-request fc-2x</default>
      </decoration_class>
      <!-- <fields  /> Optional tag to add attributes to the table by their code, can be specified for each level -->
      <levels>
        <level id="1">
          <class>ServiceFamily</class>
          <image_att>icon</image_att>
          <levels>
            <!-- Level IDs must be numeric -->
            <level id="1">
              <!-- Can be either a class tag with the class name or an oql tag with the query -->
              <class>Service</class>
              <!-- Attribute code of the above class [from the OQL] that point to the upper level class -->
              <parent_att>servicefamily_id</parent_att>
              <!-- Attribute code of the above class [from the OQL] used to display the object name, default is 'name'. -->
              <name_att/>
              <!-- Attribute code of the above class [from the OQL] used to display in a tooltip when mouse is over the object -->
              <tooltip_att>description</tooltip_att>
              <!-- Attribute code of the above class [from the OQL] used to display a small text beside the object's name -->
              <!-- Note: This is not used in "list" mode -->
              <description_att>description</description_att>
              <!-- Attribute code of the above class [from the OQL] used to display a image beside the object's name -->
              <!-- Note: This is used in "mosaic" mode only for now -->
              <image_att>icon</image_att>
              <!-- Title of the level, will be display in lists and others browse modes -->
              <title>Class:Service</title>
              <!-- Optional tag to add attributes to the table by their code, can be specified for each level -->
              <!-- Note: Fields will only be displayed in "list" mode but will still be used for filter in other modes -->
              <!-- <fields  /> -->
              <!-- Can be empty on intermediate levels, default is drilldown -->
              <actions>
                <action id="drilldown" xsi:type="drilldown"/>
              </actions>
              <levels>
                <level id="1">
                  <!-- Note : We could have used just a class tag and put the OQL in the scope for everybody -->
                  <oql><![CDATA[SELECT ServiceSubcategory WHERE ServiceSubcategory.status != 'obsolete']]></oql>
                  <parent_att>service_id</parent_att>
                  <name_att/>
                  <tooltip_att>description</tooltip_att>
                  <description_att>description</description_att>
                  <title>Class:ServiceSubcategory</title>
                  <actions>
                    <action id="create_from_this" xsi:type="create_from_this">
                      <!-- Can be either a class tag containing the class of the object to create, or a static method taking the origin object as a parameter and that will return a object of the desired class -->
                      <!-- (eg. \Ticket::FromServiceSubcategory($oOrigin) that should return either a UserRequest or Incident regarding the request type) -->
                      <!-- Optional tag that can be used on any action type -->
                      <!--<title>Create a ticket</title>-->
                      <!-- Optional tag to define if the action should be done in a modal window ("modal"), a new window ("new") or the current window ("self") -->
                      <!--<opening_target>modal</opening_target>-->
                      <icon_class>fc fc-new-request fc-1-6x fc-flip-horizontal</icon_class>
                      <!-- Optional tag to order actions -->
                      <!--<rank>1</rank>-->
                      <rules>
                        <rule id="contact-to-userrequest"/>
                        <rule id="servicesubcategory-to-userrequest"/>
                        <rule id="go-to-open-request-on-submit"/>
                      </rules>
                      <factory_method _altered_in="itop-full-itil"><![CDATA[\Ticket::CreateFromServiceSubcategory]]></factory_method>
                    </action>
                    <action id="view" xsi:type="view"/>
                  </actions>
                  <levels/>
                </level>
              </levels>
            </level>
          </levels>
        </level>
      </levels>
      <browse_modes>
        <availables>
          <mode id="list"/>
          <mode id="tree"/>
          <mode id="mosaic"/>
        </availables>
        <default _altered_in="molkobain-portal-mosaic-service-catalog">mosaic</default>
      </browse_modes>
      <!-- Optional. Set the default number of item lists will display. -->
      <!-- <default_list_length>20</default_list_length> -->
      <data_loading>auto</data_loading>
      <!-- lazy|full|auto. Let the consultant choose if the list/tree data are load progressively at each page/level or in one-shot or if it is up to the system regarding the "lazy_loading_threshold" parameter -->
    </brick>
    <brick id="ongoing-tickets-for-portal-user" xsi:type="Combodo\iTop\Portal\Brick\ManageBrick" _altered_in="itop-tickets">
      <active>true</active>
      <rank>
        <default>20</default>
      </rank>
      <width>6</width>
      <title>
        <default>Brick:Portal:OngoingRequests:Title</default>
      </title>
      <!-- Optional tag to define which display modes can be used in the brick's page and the brick's tile -->
      <!--<display_modes>-->
      <!-- Optional tag that must contain at least 1 <mode> tag. -->
      <!--<availables>-->
      <!--<mode id="list"/>-->
      <!--<mode id="pie-chart"/>-->
      <!--<mode id="bar-chart"/>-->
      <!--</availables>-->
      <!-- Optional tag to define which display mode will be used by default when opening the brick -->
      <!--<default>list</default>-->
      <!-- Optional tag to define which display mode will be used to render the brick's tile -->
      <!--<tile>text</tile>-->
      <!--</display_modes>-->
      <description>Brick:Portal:OngoingRequests:Title+</description>
      <decoration_class>
        <default>fc fc-ongoing-request fc-2x</default>
      </decoration_class>
      <oql><![CDATA[SELECT Ticket]]></oql>
      <!-- Optional tag to define if the action should be done in a modal window ("modal"), a new window ("new") or the current window ("self") -->
      <!--<opening_target>modal</opening_target>-->
      <!-- Optional tag to define the how the objects should be opened. Values can be edit|view. Note that even if this is set to edit, objects not allowed in edition mode for the user (cf. scopes and security layers) will open in view mode -->
      <!-- <opening_mode>edit</opening_mode> -->
      <!-- Can be either a class tag with the class name or an oql tag with the query -->
      <!-- <class>Ticket</class> -->
      <fields>
        <field id="title"/>
        <field id="start_date"/>
        <field id="status"/>
        <field id="service_id"/>
        <field id="servicesubcategory_id"/>
        <field id="priority"/>
        <field id="caller_id"/>
      </fields>
      <!-- Optional tag to add attributes to the table by their code -->
      <grouping>
        <!-- Mandatory -->
        <tabs>
          <!-- Optional. Show object count for each tabs. Available values are true|false. Default is false. -->
          <show_tab_counts>true</show_tab_counts>
          <!-- Mandatory. Grouping by tabs -->
          <!--<attribute>operational_status</attribute>-->
          <!-- attribute xor groups tag -->
          <groups>
            <!-- Can be used only with ../oql tag, not ../class tag. Reason is that we can't know the class alias to apply to the condition's fields. We might have an exception saying that the field in ambiguous for the generated query. -->
            <group id="opened">
              <rank>1</rank>
              <title>Brick:Portal:OngoingRequests:Tab:OnGoing</title>
              <!-- Optional. A string or dictionary entry to display under the page title for this tab -->
              <!-- <description>Brick:Portal:OngoingRequests:Tab:OnGoing+</description> -->
              <condition><![CDATA[SELECT Ticket AS T WHERE operational_status NOT IN ('closed', 'resolved')]]></condition>
            </group>
            <group id="resolved">
              <rank>2</rank>
              <title>Brick:Portal:OngoingRequests:Tab:Resolved</title>
              <condition><![CDATA[SELECT Ticket AS T WHERE operational_status = 'resolved']]></condition>
            </group>
          </groups>
        </tabs>
        <!-- Implicit grouping on y axis by finalclass -->
      </grouping>
      <!-- Optional. Set the default number of item lists will display. -->
      <!-- <default_list_length>20</default_list_length> -->
      <data_loading>full</data_loading>
      <export>
        <export_default_fields>true</export_default_fields>
      </export>
    </brick>
    <brick id="closed-tickets-for-portal-user" xsi:type="Combodo\iTop\Portal\Brick\ManageBrick" _altered_in="itop-tickets">
      <active>true</active>
      <rank>
        <navigation_menu>50</navigation_menu>
      </rank>
      <visible>
        <home>false</home>
      </visible>
      <width>12</width>
      <title>
        <default>Brick:Portal:ClosedRequests:Title</default>
      </title>
      <description/>
      <decoration_class>
        <default>fc fc-closed-request fc-2x</default>
      </decoration_class>
      <oql><![CDATA[SELECT Ticket WHERE operational_status = 'closed']]></oql>
      <!-- Can be either a class tag with the class name or an oql tag with the query -->
      <!-- <class>Ticket</class> -->
      <fields>
        <field id="finalclass"/>
        <field id="title"/>
        <field id="start_date"/>
        <field id="status"/>
        <field id="servicesubcategory_id"/>
        <field id="priority"/>
        <field id="caller_id"/>
      </fields>
      <grouping>
        <tabs>
          <!-- Optional. Show object count for each tabs. Available values are true|false. Default is false. -->
          <!--<show_tab_counts>false</show_tab_counts>-->
          <groups>
            <group id="all">
              <rank>1</rank>
              <title>Brick:Portal:ClosedRequests:Title</title>
              <condition><![CDATA[SELECT Ticket]]></condition>
            </group>
          </groups>
        </tabs>
        <!-- Implicit grouping on y axis by finalclass -->
      </grouping>
      <data_loading>auto</data_loading>
      <export>
        <export_default_fields>true</export_default_fields>
      </export>
    </brick>
    <brick id="manage-all-tickets-for-portal-user" xsi:type="Combodo\iTop\Portal\Brick\ManageBrick" _altered_in="itop-tickets">
      <active>true</active>
      <rank>
        <default>120</default>
      </rank>
      <visible>
        <home>false</home>
        <navigation_menu>false</navigation_menu>
      </visible>
      <width>6</width>
      <title>
        <default>Brick:Portal:ListAllRequests:Title</default>
      </title>
      <!-- Optional tag to define which display modes can be used in the brick's page and the brick's tile -->
      <!--<display_modes>-->
      <!-- Optional tag that must contain at least 1 <mode> tag. -->
      <!--<availables>-->
      <!--<mode id="list"/>-->
      <!--<mode id="pie-chart"/>-->
      <!--<mode id="bar-chart"/>-->
      <!--</availables>-->
      <!-- Optional tag to define which display mode will be used by default when opening the brick -->
      <!--<default>list</default>-->
      <!-- Optional tag to define which display mode will be used to render the brick's tile -->
      <!--<tile>text</tile>-->
      <!--</display_modes>-->
      <description>Brick:Portal:ListAllRequests:Title+</description>
      <decoration_class>
        <default>fc fc-ongoing-request fc-2x</default>
      </decoration_class>
      <oql><![CDATA[SELECT Ticket]]></oql>
      <!-- Optional tag to define if the action should be done in a modal window ("modal"), a new window ("new") or the current window ("self") -->
      <!--<opening_target>modal</opening_target>-->
      <!-- Optional tag to define the how the objects should be opened. Values can be edit|view. Note that even if this is set to edit, objects not allowed in edition mode for the user (cf. scopes and security layers) will open in view mode -->
      <!-- <opening_mode>edit</opening_mode> -->
      <!-- Can be either a class tag with the class name or an oql tag with the query -->
      <!-- <class>Ticket</class> -->
      <fields>
        <field id="title"/>
        <field id="description"/>
        <field id="status"/>
      </fields>
      <!-- Optional tag to add attributes to the table by their code -->
      <grouping>
        <!-- Mandatory -->
        <tabs>
          <!-- Optional. Show object count for each tabs. Available values are true|false. Default is false. -->
          <show_tab_counts>true</show_tab_counts>
          <!-- Mandatory. Grouping by tabs -->
          <groups>
            <group id="all">
              <rank>1</rank>
              <title>Brick:Portal:ListAllRequests:Tab</title>
              <condition><![CDATA[SELECT Ticket]]></condition>
            </group>
          </groups>
        </tabs>
        <!-- Implicit grouping on y axis by finalclass -->
      </grouping>
      <!-- Optional. Set the default number of item lists will display. -->
      <!-- <default_list_length>20</default_list_length> -->
      <data_loading>auto</data_loading>
      <export>
        <export_default_fields>true</export_default_fields>
      </export>
    </brick>
    <brick id="search-within-tickets-for-portal-user" xsi:type="Combodo\iTop\Portal\Brick\FilterBrick" _altered_in="itop-tickets">
      <active>true</active>
      <rank>
        <default>30</default>
      </rank>
      <visible>
        <home>true</home>
        <navigation_menu>false</navigation_menu>
      </visible>
      <width>6</width>
      <title>
        <default>Brick:Portal:SearchInAllRequests:Title</default>
      </title>
      <description>Brick:Portal:SearchInAllRequests:Title+</description>
      <!-- <search_submit_class/> -->
      <target_brick>
        <id>manage-all-tickets-for-portal-user</id>
        <type>Combodo\iTop\Portal\Brick\ManageBrick</type>
      </target_brick>
    </brick>
    <brick id="faq" xsi:type="Combodo\iTop\Portal\Brick\BrowseBrick" _altered_in="itop-faq-light">
      <active>true</active>
      <rank>
        <default>40</default>
      </rank>
      <width>6</width>
      <title>
        <navigation_menu>Brick:Portal:FAQ:Menu</navigation_menu>
        <home>Brick:Portal:FAQ:Title</home>
      </title>
      <description>Brick:Portal:FAQ:Title+</description>
      <decoration_class>
        <default>fc fc-life-saver fc-2x</default>
      </decoration_class>
      <levels>
        <level id="1">
          <class>FAQCategory</class>
          <parent_att/>
          <name_att/>
          <tooltip_att/>
          <title>Class:FAQCategory</title>
          <actions/>
          <levels>
            <level id="1">
              <class>FAQ</class>
              <parent_att>category_id</parent_att>
              <name_att>title</name_att>
              <tooltip_att>summary</tooltip_att>
              <title>Class:FAQ</title>
              <fields>
                <field id="error_code"/>
                <field id="domains"/>
                <field id="key_words">
                  <hidden>true</hidden>
                </field>
              </fields>
              <actions>
                <action id="view" xsi:type="view"/>
              </actions>
              <levels/>
            </level>
          </levels>
        </level>
      </levels>
      <browse_modes>
        <availables>
          <mode id="list"/>
          <mode id="tree"/>
        </availables>
        <default>list</default>
      </browse_modes>
      <data_loading>full</data_loading>
    </brick>
    <brick id="communication" xsi:type="Combodo\iTop\Portal\Brick\CommunicationBrick" _altered_in="itop-communications">
      <!-- Should be the class name (eg : CommunicationBrick) -->
      <active>true</active>
      <!-- yes|no -->
      <rank>1</rank>
      <!-- float -->
      <height>15</height>
      <!-- integer , size in em -->
      <width>12</width>
      <!-- integer , must be between 1 and 12 -->
      <title>Portal:Communications</title>
      <!-- string -->
      <oql/>
      <!-- Query for the displayed communications (if authorized to the current user, see Communication::IsAllowedToUser). Leave empty to preserve the default behavior. Use :now instead of NOW(). -->
      <security>
        <!-- Order is deny/allow Pseudo OQL traduction : WHERE user_profile NOT IN (:denied_profiles) AND user_profile IN (:allowed_profiles) -->
        <denied_profiles/>
        <!-- OQL query. Used only when not empty -->
        <allowed_profiles/>
        <!-- OQL query. Used only when not empty -->
      </security>
    </brick>
  </bricks>
  <navigation_rules>
    <!-- Close form (either the modal or the whole page) -->
    <navigation_rule id="close-form" xsi:type="close"/>
    <!-- Go to the homepage -->
    <navigation_rule id="go-to-homepage" xsi:type="go-to-homepage"/>
    <navigation_rule id="go-to-open-requests" xsi:type="go-to-manage-brick" _altered_in="itop-tickets">
      <!-- Mandatory, ID of the ManageBrick to go to -->
      <id>ongoing-tickets-for-portal-user</id>
      <!-- Optional, must be an ID of the available display modes of the brick (//brick/display_modes/availables/mode) -->
      <!-- <display_mode>list</mode> -->
      <!-- Optional, must be an ID of the grouping tab of the brick (//brick/grouping/tabs/groups/group)-->
      <!-- <grouping_tab>resolved</grouping_tab> -->
      <!-- Optional, a string to preset as filter in the brick. ":this->XXX" can be used for the current object -->
      <!-- <filter>:this->caller_id_friendlyname</filter> -->
    </navigation_rule>
    <navigation_rule id="go-to-services" xsi:type="go-to-browse-brick" _altered_in="itop-tickets">
      <!-- Mandatory, ID of the BrowseBrick to go to -->
      <id>services</id>
      <!-- Optional, must be an ID of the available browse modes of the brick (//brick/browse_modes/availables/mode) -->
      <!-- <browse_mode>tree</browse_mode> -->
      <!-- Optional, a string to preset as filter in the brick. ":this->XXX" can be used for the current object -->
      <!-- <filter>computer</filter> -->
    </navigation_rule>
  </navigation_rules>
  <forms>
    <form id="service-view" _altered_in="itop-tickets">
      <class>Service</class>
      <fields/>
      <twig>
        <div class="row">
          <div class="col-sm-6">
            <div class="form_field" data-field-id="name">
								</div>
            <div class="form_field" data-field-id="description">
								</div>
          </div>
          <div class="col-sm-6">
            <div class="form_field" data-field-id="org_id">
								</div>
            <div class="form_field" data-field-id="servicefamily_id">
								</div>
            <div class="form_field" data-field-id="status">
								</div>
          </div>
        </div>
      </twig>
      <modes>
        <mode id="view"/>
      </modes>
    </form>
    <form id="servicesubcategory" _altered_in="itop-tickets">
      <class>ServiceSubcategory</class>
      <!-- Optional tag to list the fields. If empty only fields from <twig> tag will be displayed, if omitted fields from zlist details will. -->
      <fields/>
      <!-- Optional tag to specify the form layout. Fields that are not positioned in the layout will be placed at the end of the form -->
      <twig>
        <div class="row">
          <div class="col-sm-6">
            <!-- data-field-id attribute must be an attribute code of the class -->
            <div class="form_field" data-field-id="service_id">
								</div>
            <!-- data-field-flags attribute contains flags among read_only/hidden/mandatory/must_prompt/must_change -->
            <div class="form_field" data-field-id="name" data-field-flags="read_only">
								</div>
            <div class="form_field" data-field-id="status" data-field-flags="read_only">
								</div>
          </div>
          <div class="col-sm-6">
            <div class="form_field" data-field-id="service_org_id">
								</div>
            <div class="form_field" data-field-id="request_type">
								</div>
          </div>
        </div>
        <div>
          <div class="form_field" data-field-id="description">
							</div>
        </div>
      </twig>
    </form>
    <form id="ticket-create" _altered_in="itop-tickets">
      <class>Ticket</class>
      <properties>
        <navigation_rules>
          <submit>
            <default>go-to-open-requests</default>
          </submit>
        </navigation_rules>
      </properties>
      <fields/>
      <twig>
        <div class="row">
          <div class="col-sm-6">
            <div class="form_field" data-field-id="service_id" data-field-flags="mandatory">
								</div>
          </div>
          <div class="col-sm-6">
            <div class="form_field" data-field-id="servicesubcategory_id" data-field-flags="mandatory">
								</div>
          </div>
        </div>
        <div id="service_details_placeholder">
						</div>
        <div class="row">
          <div class="col-sm-6">
            <div class="form_field" data-field-id="impact">
								</div>
          </div>
          <div class="col-sm-6">
            <div class="form_field" data-field-id="urgency">
								</div>
          </div>
        </div>
        <div>
          <div class="form_field" data-field-id="title">
							</div>
          <div class="form_field" data-field-id="description">
							</div>
          <div class="form_field" data-field-id="contacts_list">
							</div>
        </div>
      </twig>
      <modes>
        <!-- mode id can among create / edit / view -->
        <mode id="create"/>
      </modes>
    </form>
    <form id="ticket-edit" _altered_in="itop-tickets">
      <class>Ticket</class>
      <properties>
        <!-- Optional, display mode of the form fields. "cosy" for a regular labels over values layout; "compact" for a side-by-side
						layout with input aligned; "dense" for a side-by-side layout with input filling all available space. You can also use a custom css class that will be used on the form as "form_xxx", as well as on the fields as "form_field_xxx".-->
        <!--<display_mode>cosy</display_mode>-->
        <!-- Optional, when set to false, submit button is hidden when transitions are available on the object (in creation and edit
						mode). Default is false. -->
        <!--<always_show_submit>false</always_show_submit>-->
        <!-- Optional, navigation rules to define where to go when clicking on the submit/cancel buttons of the form -->
        <navigation_rules>
          <submit>
            <default>go-to-open-requests</default>
          </submit>
        </navigation_rules>
      </properties>
      <fields/>
      <twig>
        <div class="row">
          <div class="col-sm-7">
            <fieldset>
              <legend>{{'Ticket:baseinfo'|dict_s}}</legend>
              <div class="col-sm-6">
                <div class="form_field" data-field-id="title" data-field-flags="read_only"/>
                <div class="form_field" data-field-id="service_id" data-field-flags="read_only"/>
              </div>
              <div class="col-sm-6">
                <div class="form_field" data-field-id="caller_id" data-field-flags="read_only"/>
                <div class="form_field" data-field-id="servicesubcategory_id" data-field-flags="read_only"/>
              </div>
              <div class="col-sm-12">
                <div class="form_field" data-field-id="description" data-field-flags="read_only"/>
                <div class="form_field" data-field-id="solution" data-field-flags="read_only"/>
              </div>
              <div class="col-sm-6">
                <div class="form_field" data-field-id="user_satisfaction" data-field-flags="read_only"/>
              </div>
              <div class="col-sm-6">
                <div class="form_field" data-field-id="user_comment" data-field-flags="read_only"/>
              </div>
            </fieldset>
          </div>
          <div class="col-sm-5">
            <fieldset>
              <legend>{{'Ticket:Type'|dict_s}} &amp; {{'Ticket:date'|dict_s}}</legend>
              <div class="col-sm-6">
                <div class="form_field" data-field-id="status" data-field-flags="read_only"/>
                <div class="form_field" data-field-id="impact" data-field-flags="read_only"/>
                <div class="form_field" data-field-id="urgency" data-field-flags="read_only"/>
                <div class="form_field" data-field-id="priority" data-field-flags="read_only"/>
              </div>
              <div class="col-sm-6">
                <div class="form_field" data-field-id="start_date" data-field-flags="read_only"/>
                <div class="form_field" data-field-id="last_update" data-field-flags="read_only"/>
                <div class="form_field" data-field-id="resolution_date" data-field-flags="read_only"/>
                <div class="form_field" data-field-id="agent_id" data-field-flags="read_only"/>
              </div>
            </fieldset>
          </div>
        </div>
        <div>
          <div class="form_field" data-field-id="contacts_list"/>
          <div class="form_field" data-field-id="public_log"/>
        </div>
      </twig>
      <modes>
        <mode id="edit"/>
        <mode id="view"/>
      </modes>
    </form>
    <form id="ticket-reopen" _altered_in="itop-tickets">
      <class>Ticket</class>
      <properties>
        <navigation_rules>
          <submit>
            <default>go-to-open-requests</default>
          </submit>
        </navigation_rules>
      </properties>
      <fields/>
      <twig>
        <div>
          <div class="form_field" data-field-id="public_log" data-field-flags="must_change"/>
          <div class="form_field" data-field-id="team_id" data-field-flags="hidden"/>
          <div class="form_field" data-field-id="agent_id" data-field-flags="hidden"/>
        </div>
      </twig>
      <modes>
        <mode id="apply_stimulus">
          <stimuli>
            <stimulus id="ev_reopen"/>
          </stimuli>
        </mode>
      </modes>
    </form>
    <form id="ticket-apply-stimulus" _altered_in="itop-tickets">
      <class>Ticket</class>
      <properties>
        <navigation_rules>
          <submit>
            <default>go-to-open-requests</default>
          </submit>
        </navigation_rules>
      </properties>
      <fields/>
      <twig/>
      <modes>
        <mode id="apply_stimulus"/>
      </modes>
    </form>
    <form id="person-view" _altered_in="itop-tickets">
      <class>Person</class>
      <fields/>
      <twig>
        <div class="row">
          <div class="col-sm-4">
            <div class="form_field" data-field-id="picture" data-field-flags="read_only">
								</div>
          </div>
          <div class="col-sm-4">
            <div class="form_field" data-field-id="name" data-field-flags="read_only">
								</div>
            <div class="form_field" data-field-id="first_name" data-field-flags="read_only">
								</div>
            <div class="form_field" data-field-id="status" data-field-flags="read_only">
								</div>
          </div>
          <div class="col-sm-4">
            <div class="form_field" data-field-id="org_id" data-field-flags="read_only">
								</div>
            <div class="form_field" data-field-id="function" data-field-flags="read_only">
								</div>
            <div class="form_field" data-field-id="manager_id" data-field-flags="read_only">
								</div>
          </div>
        </div>
      </twig>
    </form>
    <form id="faq" _altered_in="itop-faq-light">
      <class>FAQ</class>
      <!-- fields tag is optional. If not specified, attributes from zlist "details" will be choose as default -->
      <fields>
        <field id="category_name"/>
        <field id="title"/>
        <field id="error_code"/>
        <field id="key_words"/>
        <field id="domains"/>
        <field id="summary"/>
        <field id="description"/>
      </fields>
      <twig>
        <div class="row">
          <div class="col-sm-4">
            <div class="form_field" data-field-id="category_name"/>
            <div class="form_field" data-field-id="title"/>
            <div class="form_field" data-field-id="error_code"/>
            <div class="form_field" data-field-id="key_words"/>
            <div class="form_field" data-field-id="domains"/>
            <div class="form_field" data-field-id="summary"/>
          </div>
          <div class="col-sm-8">
            <div class="form_field" data-field-id="description"/>
          </div>
        </div>
      </twig>
      <modes>
        <mode id="view"/>
      </modes>
    </form>
  </forms>
  <action_rules>
    <action_rule id="contact-to-userrequest" _altered_in="itop-tickets">
      <!-- source_oql|source_class is only necessary if there is some copy preset|retrofit -->
      <source_oql><![CDATA[SELECT Contact AS C WHERE C.id = :current_contact_id]]></source_oql>
      <presets>
        <!-- Only set() and copy() are supported for now -->
        <preset id="1">set(caller_id, $current_contact_id$)</preset>
        <preset id="2">copy(org_id, org_id)</preset>
        <preset id="3">set(origin, portal)</preset>
      </presets>
      <retrofits/>
    </action_rule>
    <action_rule id="service-to-userrequest" _altered_in="itop-tickets">
      <source_class>Service</source_class>
      <presets>
        <preset id="1">copy(id, service_id)</preset>
      </presets>
    </action_rule>
    <action_rule id="servicesubcategory-to-userrequest" _altered_in="itop-tickets">
      <source_class>ServiceSubcategory</source_class>
      <presets>
        <preset id="1">copy(id, servicesubcategory_id)</preset>
        <preset id="2">copy(service_id, service_id)</preset>
      </presets>
    </action_rule>
    <action_rule id="go-to-open-request-on-submit" _altered_in="itop-tickets">
      <submit xsi:type="goto">
        <brick>ongoing-tickets-for-portal-user</brick>
      </submit>
    </action_rule>
  </action_rules>
</module_design>
