Explorar o código

N°619 - Portal: Other allowed portals (eg. the administration console or other portal instances) can now be opened in the current window or a new tab. This is a new xml property of the portal instance.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4552 a333f486-631f-4898-b8df-5754b55c2be0
glajarige %!s(int64=8) %!d(string=hai) anos
pai
achega
fc617d477b

+ 21 - 1
datamodels/2.x/itop-portal-base/portal/src/helpers/applicationhelper.class.inc.php

@@ -324,7 +324,10 @@ class ApplicationHelper
 					'triggers_query' => null,
 					'attachments' => array(
 						'allow_delete' => true
-					)
+					),
+                    'allowed_portals' => array(
+                        'opening_mode' => null,
+                    ),
 				),
 				'portals' => array(),
 				'forms' => array(),
@@ -401,6 +404,23 @@ class ApplicationHelper
 							}
 						}
 						break;
+                    case 'allowed_portals':
+                        foreach ($oPropertyNode->GetNodes('*') as $oSubNode)
+                        {
+                            switch ($oSubNode->nodeName)
+                            {
+                                case 'opening_mode':
+                                    $sValue = $oSubNode->GetText();
+                                    // If the text is null, we keep the default value
+                                    // Else we set it
+                                    if ($sValue !== null)
+                                    {
+                                        $aPortalConf['properties']['allowed_portals'][$oSubNode->nodeName] = ($sValue === 'self') ? 'self' : 'tab';
+                                    }
+                                    break;
+                            }
+                        }
+                        break;
 				}
 			}
 			// - Rectifying portal logo url

+ 1 - 1
datamodels/2.x/itop-portal-base/portal/src/views/layout.html.twig

@@ -199,7 +199,7 @@
 									{% for aPortal in app['combodo.portal.instance.conf'].portals %}
 										{% if aPortal.id != app['combodo.portal.instance.conf'].properties.id %}
 											{% set sGlyphiconClass = (aPortal.id == 'backoffice') ? 'fa-list-alt' : 'fa-external-link' %}
-											<li><a href="{{ aPortal.url }}" target="_blank" title="{{ aPortal.label|dict_s }}"><span class="brick_icon fa {{ sGlyphiconClass }} fa-lg fa-fw"></span>{{ aPortal.label|dict_s }}</a></li>
+											<li><a href="{{ aPortal.url }}" {% if app['combodo.portal.instance.conf'].properties.allowed_portals.opening_mode == 'tab' %}target="_blank"{% endif %} title="{{ aPortal.label|dict_s }}"><span class="brick_icon fa {{ sGlyphiconClass }} fa-lg fa-fw"></span>{{ aPortal.label|dict_s }}</a></li>
 										{% endif %}
 									{% endfor %}
 									{# We display the separator only if the user has more then 1 portal. Meaning default portal + console or several portal at least #}

+ 7 - 1
datamodels/2.x/itop-tickets/datamodel.itop-tickets.xml

@@ -985,13 +985,19 @@
 				<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>
 			<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>
@@ -1199,7 +1205,7 @@
 			<forms>
 				<form id="servicesubcategory">
 					<class>ServiceSubcategory</class>
-					<!-- Optionnal tag to list the fields -->
+					<!-- Optionnal tag to list the fields. If empty only fields from <twig> tag will be displayed, if ommited fields from zlist details will. -->
 					<fields />
 					<!-- Optionnal tag to specify the form layout. Fields that are not positionned in the layout will be placed at the end of the form -->
 					<twig>