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

remove preficWithCurrentContextTitle

parent f1bba09b
No related branches found
No related tags found
No related merge requests found
Showing
with 19 additions and 67 deletions
import("Context_lib");
import("system.vars");
import("system.result");
var title = vars.get("$field.FULL_ATTRIBUTE_NAME");
if (!(vars.exists("$param.ObjectType_param") && vars.get("$param.ObjectType_param"))) //TODO: the prefix shouldn't be in the lookup, this condition is a workaround
title = ContextUtils.prefixWithCurrentContextTitle(title);
result.string(title);
\ No newline at end of file
result.string(vars.get("$field.FULL_ATTRIBUTE_NAME"));
\ No newline at end of file
import("Context_lib");
import("system.result");
import("system.vars");
result.string(ContextUtils.prefixWithCurrentContextTitle(vars.getString("$field.NAME")));
\ No newline at end of file
result.string(vars.getString("$field.NAME"));
\ No newline at end of file
import("Context_lib");
import("system.result");
import("system.vars");
result.string(ContextUtils.prefixWithCurrentContextTitle(vars.getString("$field.NAME")));
\ No newline at end of file
result.string(vars.getString("$field.NAME"));
\ No newline at end of file
import("Context_lib");
import("system.vars");
import("system.result");
result.string(ContextUtils.prefixWithCurrentContextTitle(vars.get("$field.CONTRACTCODE_DISPLAY_fieldGroup")));
\ No newline at end of file
result.string(vars.get("$field.CONTRACTCODE_DISPLAY_fieldGroup"));
\ No newline at end of file
import("Context_lib");
import("system.result");
import("system.vars");
result.string(ContextUtils.prefixWithCurrentContextTitle(vars.get("$field.NAME_TRANSLATED")));
\ No newline at end of file
result.string(vars.get("$field.NAME_TRANSLATED"));
\ No newline at end of file
import("Context_lib");
import("system.vars");
import("system.result");
result.string(ContextUtils.prefixWithCurrentContextTitle((vars.get("$field.FIRSTNAME") + " " + vars.get("$field.LASTNAME")).trim()));
\ No newline at end of file
result.string((vars.get("$field.FIRSTNAME") + " " + vars.get("$field.LASTNAME")).trim());
\ No newline at end of file
import("Context_lib");
import("system.vars");
import("system.result");
result.string(ContextUtils.prefixWithCurrentContextTitle(vars.get("$field.NAME")));
\ No newline at end of file
result.string(vars.get("$field.NAME"));
\ No newline at end of file
import("Context_lib");
import("system.vars");
import("system.result");
result.string(ContextUtils.prefixWithCurrentContextTitle(vars.get("$field.TITLE_TRANSLATED")));
\ No newline at end of file
result.string(vars.get("$field.TITLE_TRANSLATED"));
\ No newline at end of file
import("Context_lib");
import("system.translate");
import("system.vars");
import("system.result");
if (vars.exists("$param.OnlyFirstSide_param") && vars.get("$param.OnlyFirstSide_param") == "1" && vars.get("$field.DIRECTION") != "same")
{
result.string(ContextUtils.prefixWithCurrentContextTitle(translate.text(vars.get("$field.SOURCE_RELATION_TITLE")) + " -> " + translate.text(vars.get("$field.DEST_RELATION_TITLE"))));
result.string(translate.text(vars.get("$field.SOURCE_RELATION_TITLE")) + " -> " + translate.text(vars.get("$field.DEST_RELATION_TITLE")));
}
else
{
result.string(ContextUtils.prefixWithCurrentContextTitle(translate.text(vars.get("$field.SOURCE_RELATION_TITLE"))));
result.string(translate.text(vars.get("$field.SOURCE_RELATION_TITLE")));
}
\ No newline at end of file
import("Context_lib");
import("system.vars");
import("system.result");
result.string(ContextUtils.prefixWithCurrentContextTitle(vars.get("$field.OfferCode_VersNr_fieldgroup")));
\ No newline at end of file
result.string(vars.get("$field.OfferCode_VersNr_fieldgroup"));
\ No newline at end of file
import("Context_lib");
import("system.translate");
import("system.vars");
import("system.result");
result.string(ContextUtils.prefixWithCurrentContextTitle(vars.get("$field.OrderCode_VersNr_fieldgroup")));
result.string(vars.get("$field.OrderCode_VersNr_fieldgroup"));
import("Context_lib");
import("system.vars");
import("system.result");
result.string(ContextUtils.prefixWithCurrentContextTitle(vars.get("$field.NAME")))
\ No newline at end of file
result.string(vars.get("$field.NAME"));
\ No newline at end of file
import("Context_lib");
import("system.vars");
import("system.result");
import("Util_lib");
......@@ -14,4 +13,4 @@ contact.lastname = vars.get("$field.LASTNAME");
contact.organisationName = vars.get("$field.ORGANISATION_NAME");
var renderer = new ContactTitleRenderer(contact, null);
result.string(ContextUtils.prefixWithCurrentContextTitle(renderer.asString()));
\ No newline at end of file
result.string(renderer.asString());
\ No newline at end of file
import("Context_lib");
import("system.vars");
import("system.result");
result.string(ContextUtils.prefixWithCurrentContextTitle(vars.get("$field.PRODUCTNAME")));
\ No newline at end of file
result.string(vars.get("$field.PRODUCTNAME"));
\ No newline at end of file
import("Context_lib");
import("system.vars");
import("system.translate");
import("system.result");
if (vars.exists("$field.TYPE") && vars.get("$field.TYPE"))
{
result.string(ContextUtils.prefixWithCurrentContextTitle(translate.text("Milestones") + " " + translate.text(vars.get("$field.TYPE"))));
result.string(translate.text("Milestones") + " " + translate.text(vars.get("$field.TYPE")));
}
else
result.string(ContextUtils.prefixWithCurrentContextTitle(translate.text("Milestones")));
\ No newline at end of file
result.string(translate.text("Milestones"));
\ No newline at end of file
import("Context_lib");
import("system.vars");
import("system.result");
result.string(ContextUtils.prefixWithCurrentContextTitle(vars.get("$field.PROJECTTITLE")));
\ No newline at end of file
result.string(vars.get("$field.PROJECTTITLE"));
\ No newline at end of file
......@@ -26,21 +26,6 @@ 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
......@@ -143,21 +128,6 @@ 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