Skip to content
Snippets Groups Projects
Commit 17957ba4 authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

Merge branch '1036821-contextnames' into 'master'

1036821 contextnames

See merge request xrm/basic!34
parents 2a491f6d 67159f82
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,7 @@
<cardViewTemplate>
<name>Header</name>
<iconField>IMAGE</iconField>
<titleField>Offer_OfferCode_VersNr_fieldgroup</titleField>
<titleField>OfferCode_VersNr_fieldgroup</titleField>
<descriptionField>CONTACT_ID</descriptionField>
<favoriteAction1>newActivity</favoriteAction1>
<entityField>#ENTITY</entityField>
......
......@@ -12,7 +12,7 @@
<cardViewTemplate>
<name>Header</name>
<iconField>IMAGE</iconField>
<titleField>Order_OrderCode_VersNr_fieldgroup</titleField>
<titleField>OrderCode_VersNr_fieldgroup</titleField>
<descriptionField>CONTACT_ID</descriptionField>
<favoriteAction1>newActivity</favoriteAction1>
<entityField>#ENTITY</entityField>
......
......@@ -26,6 +26,21 @@ ContextUtils.getCurrentContextId = function()
return vars.getString("$sys.currentcontextname");
}
/**
* Get the title of the current context
* Note: The variable contexttitle is not always available.
* In this case this function returns ""
*
* @return {String} Title of the current context
*/
ContextUtils.getCurrentContextTitle = function()
{
if (vars.exists("$sys.currentcontexttitle") && vars.get("$sys.currentcontexttitle"))
return vars.get("$sys.currentcontexttitle");
return "";
}
/**
* TODO: use System function. Currently the Name is also the id.
* Returns the Name of a context by the Id
......@@ -100,6 +115,21 @@ ContextUtils.getContext = function(pContextId)
return ContextUtils._contextDataMapping(project.getDataModel(project.DATAMODEL_KIND_CONTEXT, pContextId));
}
/**
* Prefix the given title with the current context title. (only if the title is available)
* @param {String} pTitle
*
* @return {String} e.g.: Kontakt - Herr Tim Admin
*/
ContextUtils.prefixWithCurrentContextTitle = function(pTitle)
{
var titlePrefix = ContextUtils.getCurrentContextTitle();
if (titlePrefix)
return titlePrefix + " - " + pTitle;
return pTitle;
}
/**
* map the contextData from the system.project-lib to [contextId, contextName, contextTitle]
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment