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

remove logging

parent c17951ee
No related branches found
No related tags found
No related merge requests found
Showing
with 697 additions and 721 deletions
import("system.tools");
import("system.logging");
import("system.vars");
import("system.result");
import("system.calendars");
......
import("system.logging");
import("system.vars");
import("system.result");
import("Context_lib");
......
import("system.logging");
import("system.vars");
import("system.result");
import("system.neon");
......
import("system.logging");
import("system.neon");
import("system.db");
import("system.result");
......
import("system.logging");
import("system.neon");
import("system.vars");
import("system.result");
......
import("system.logging");
import("system.util");
import("system.vars");
import("system.db");
import("system.result");
import("Permission_lib");
import("system.project");
var selectedPermission = vars.get("$local.idvalues");
var sqlStr;
var whereCond = " where";
var alias = "_____SYSTEMALIAS";
var entitiesMetaData = project.getDataModels(project.DATAMODEL_KIND_ENTITY);
var entityStructure;
var entitiesUsePermFlagSet = [];
var fieldsUsePermFlagSet = [];
// gets all names of the entites which have the 'usePermission'-flag set (positive list)
// gets all names of the fields which have the 'usePermission'-flag set (positive list)
for each (let entityMetaData in entitiesMetaData) {
if (entityMetaData[6] == "true") {
entitiesUsePermFlagSet.push(entityMetaData[0])
entityStructure = project.getEntityStructure(entityMetaData[0]);
for (fieldname in entityStructure.fields) {
field = entityStructure.fields[fieldname];
if (field.usePermissions == true) {
fieldsUsePermFlagSet.push(field.name);
}
}
}
}
whereCond += " ENTITY_ID in ('" + entitiesUsePermFlagSet.join("','") + "')";
whereCond += " and (FIELD_ID in ('" + fieldsUsePermFlagSet.join("','") + "') or FIELD_ID is NULL)";
if (vars.exists("$param.RoleTitle_param") && vars.get("$param.RoleTitle_param")) {
whereCond += " and ASYS_PERMISSIONSET.ROLE_ID = '" + vars.getString("$param.RoleTitle_param") + "'";
} else if (vars.exists("$param.EntityTitle_param") && vars.get("$param.EntityTitle_param")) {
whereCond += " and ASYS_PERMISSIONSET.ENTITY_ID = '" + vars.getString("$param.EntityTitle_param") + "'";
}
sqlStr =
"select ASYS_PERMISSION.ASYS_PERMISSIONID, ASYS_PERMISSIONSET.ENTITY_ID, ASYS_PERMISSIONSET.ROLE_ID,"
+ " ASYS_PERMISSIONSET.FIELD_ID, ASYS_PERMISSION.COND, ASYS_PERMISSIONACTION.ACTION, ASYS_PERMISSIONSET.ACCESSTYPE, ASYS_PERMISSION.CONDTYPE from ASYS_PERMISSIONSET"
+ " join ASYS_PERMISSION on ASYS_PERMISSION.ASYS_PERMISSIONSET_ID = ASYS_PERMISSIONSET.ASYS_PERMISSIONSETID"
+ " join ASYS_PERMISSIONACTION on ASYS_PERMISSIONACTION.ASYS_PERMISSION_ID = ASYS_PERMISSION.ASYS_PERMISSIONID"
+ whereCond
+ " order by ASYS_PERMISSION.ASYS_PERMISSIONID";
var sqlRes = db.table(sqlStr, alias);
var permissionTable = PermissionUtil.convertArrToObj(sqlRes);
// group all permissions by permissionid and condition, concat actions
var groupedPermissionTable = [], concatAction;
for (let i = 0; i < permissionTable.length - 1; i++) {
for (let j = i + 1; j < permissionTable.length; j++) {
if (permissionTable[i].permissionid == permissionTable[j].permissionid && permissionTable[i].cond == permissionTable[j].cond) {
var currPermId = permissionTable[i].permissionid;
var indexCurrPermGrouped = PermissionUtil.indexOfPermId(groupedPermissionTable, currPermId);
if (indexCurrPermGrouped > -1) {
// permissionset got already grouped before
// concat current action with the actions which got already grouped
concatAction = groupedPermissionTable[indexCurrPermGrouped].action + "," + permissionTable[j].action;
groupedPermissionTable[indexCurrPermGrouped].action = concatAction;
break;
} else {
concatAction = permissionTable[i].action + "," + permissionTable[j].action;
groupedPermissionTable.push(permissionTable[i]);
groupedPermissionTable[groupedPermissionTable.length-1].action = concatAction;
break;
}
}
}
}
var res = [];
var permissionTableOrigin = PermissionUtil.convertArrToObj(sqlRes);
// no permission selected, return all permission entrys
if (selectedPermission == null) {
for each (let entry in groupedPermissionTable) {
res = prepareResultArray(entry, res);
}
for each (let entry in permissionTableOrigin) {
if (PermissionUtil.indexOfPermId(PermissionUtil.convertArrToObj(res), entry.permissionid) == -1) {
res = prepareResultArray(entry, res);
}
}
} else { // permission selected, return only the selected permission entry
for each (let entry in groupedPermissionTable) {
if (selectedPermission == entry.permissionid) {
res = prepareResultArray(entry, res);
break;
}
}
for each (let entry in permissionTableOrigin) {
if (selectedPermission == entry.permissionid) {
if (PermissionUtil.indexOfPermId(PermissionUtil.convertArrToObj(res), entry.permissionid) == -1) {
res = prepareResultArray(entry, res);
break;
}
}
}
}
result.object(res.sort(sortFunction));
function prepareResultArray(pEntry, pRes) {
var rootPermission = "";
if (pEntry.accesstype != "E") {
if (pEntry.accesstype == "F" && pEntry.cond != "") {
rootPermission = PermissionUtil.getRootFieldPermission(pEntry.permissionid);
if (rootPermission == "") {
rootPermission = PermissionUtil.getRootPermission(pEntry.permissionid);
}
} else
rootPermission = PermissionUtil.getRootPermission(pEntry.permissionid);
}
pRes.push([pEntry.permissionid, pEntry.entity, pEntry.role, pEntry.field, pEntry.cond, pEntry.action, pEntry.accesstype, pEntry.condtype, rootPermission]);
return pRes;
}
// used to sort result array: Entity -> Records -> Fields
function sortFunction(a, b) {
if (a[6] == b[6] && a[6] != "F" && a[6] != "R")
return 0;
else if (a[6] == "E")
return -1;
else if (b[6] == "E")
return 1;
else if (a[6] == "R" && b[6] == "F")
return -1;
else if (a[6] == "F" && b[6] == "R")
return 1;
else if (a[6] == "R" && b[6] == "R" && a[4] == "")
return -1;
else if (a[6] == "R" && b[6] == "R" && b[4] == "")
return 1;
else if (a[6] == "F" && b[6] == "F" && a[4] == "")
return -1;
else if (a[6] == "F" && b[6] == "F" && b[4] == "")
return 1;
else
return 0;
import("system.util");
import("system.vars");
import("system.db");
import("system.result");
import("Permission_lib");
import("system.project");
var selectedPermission = vars.get("$local.idvalues");
var sqlStr;
var whereCond = " where";
var alias = "_____SYSTEMALIAS";
var entitiesMetaData = project.getDataModels(project.DATAMODEL_KIND_ENTITY);
var entityStructure;
var entitiesUsePermFlagSet = [];
var fieldsUsePermFlagSet = [];
// gets all names of the entites which have the 'usePermission'-flag set (positive list)
// gets all names of the fields which have the 'usePermission'-flag set (positive list)
for each (let entityMetaData in entitiesMetaData) {
if (entityMetaData[6] == "true") {
entitiesUsePermFlagSet.push(entityMetaData[0])
entityStructure = project.getEntityStructure(entityMetaData[0]);
for (fieldname in entityStructure.fields) {
field = entityStructure.fields[fieldname];
if (field.usePermissions == true) {
fieldsUsePermFlagSet.push(field.name);
}
}
}
}
whereCond += " ENTITY_ID in ('" + entitiesUsePermFlagSet.join("','") + "')";
whereCond += " and (FIELD_ID in ('" + fieldsUsePermFlagSet.join("','") + "') or FIELD_ID is NULL)";
if (vars.exists("$param.RoleTitle_param") && vars.get("$param.RoleTitle_param")) {
whereCond += " and ASYS_PERMISSIONSET.ROLE_ID = '" + vars.getString("$param.RoleTitle_param") + "'";
} else if (vars.exists("$param.EntityTitle_param") && vars.get("$param.EntityTitle_param")) {
whereCond += " and ASYS_PERMISSIONSET.ENTITY_ID = '" + vars.getString("$param.EntityTitle_param") + "'";
}
sqlStr =
"select ASYS_PERMISSION.ASYS_PERMISSIONID, ASYS_PERMISSIONSET.ENTITY_ID, ASYS_PERMISSIONSET.ROLE_ID,"
+ " ASYS_PERMISSIONSET.FIELD_ID, ASYS_PERMISSION.COND, ASYS_PERMISSIONACTION.ACTION, ASYS_PERMISSIONSET.ACCESSTYPE, ASYS_PERMISSION.CONDTYPE from ASYS_PERMISSIONSET"
+ " join ASYS_PERMISSION on ASYS_PERMISSION.ASYS_PERMISSIONSET_ID = ASYS_PERMISSIONSET.ASYS_PERMISSIONSETID"
+ " join ASYS_PERMISSIONACTION on ASYS_PERMISSIONACTION.ASYS_PERMISSION_ID = ASYS_PERMISSION.ASYS_PERMISSIONID"
+ whereCond
+ " order by ASYS_PERMISSION.ASYS_PERMISSIONID";
var sqlRes = db.table(sqlStr, alias);
var permissionTable = PermissionUtil.convertArrToObj(sqlRes);
// group all permissions by permissionid and condition, concat actions
var groupedPermissionTable = [], concatAction;
for (let i = 0; i < permissionTable.length - 1; i++) {
for (let j = i + 1; j < permissionTable.length; j++) {
if (permissionTable[i].permissionid == permissionTable[j].permissionid && permissionTable[i].cond == permissionTable[j].cond) {
var currPermId = permissionTable[i].permissionid;
var indexCurrPermGrouped = PermissionUtil.indexOfPermId(groupedPermissionTable, currPermId);
if (indexCurrPermGrouped > -1) {
// permissionset got already grouped before
// concat current action with the actions which got already grouped
concatAction = groupedPermissionTable[indexCurrPermGrouped].action + "," + permissionTable[j].action;
groupedPermissionTable[indexCurrPermGrouped].action = concatAction;
break;
} else {
concatAction = permissionTable[i].action + "," + permissionTable[j].action;
groupedPermissionTable.push(permissionTable[i]);
groupedPermissionTable[groupedPermissionTable.length-1].action = concatAction;
break;
}
}
}
}
var res = [];
var permissionTableOrigin = PermissionUtil.convertArrToObj(sqlRes);
// no permission selected, return all permission entrys
if (selectedPermission == null) {
for each (let entry in groupedPermissionTable) {
res = prepareResultArray(entry, res);
}
for each (let entry in permissionTableOrigin) {
if (PermissionUtil.indexOfPermId(PermissionUtil.convertArrToObj(res), entry.permissionid) == -1) {
res = prepareResultArray(entry, res);
}
}
} else { // permission selected, return only the selected permission entry
for each (let entry in groupedPermissionTable) {
if (selectedPermission == entry.permissionid) {
res = prepareResultArray(entry, res);
break;
}
}
for each (let entry in permissionTableOrigin) {
if (selectedPermission == entry.permissionid) {
if (PermissionUtil.indexOfPermId(PermissionUtil.convertArrToObj(res), entry.permissionid) == -1) {
res = prepareResultArray(entry, res);
break;
}
}
}
}
result.object(res.sort(sortFunction));
function prepareResultArray(pEntry, pRes) {
var rootPermission = "";
if (pEntry.accesstype != "E") {
if (pEntry.accesstype == "F" && pEntry.cond != "") {
rootPermission = PermissionUtil.getRootFieldPermission(pEntry.permissionid);
if (rootPermission == "") {
rootPermission = PermissionUtil.getRootPermission(pEntry.permissionid);
}
} else
rootPermission = PermissionUtil.getRootPermission(pEntry.permissionid);
}
pRes.push([pEntry.permissionid, pEntry.entity, pEntry.role, pEntry.field, pEntry.cond, pEntry.action, pEntry.accesstype, pEntry.condtype, rootPermission]);
return pRes;
}
// used to sort result array: Entity -> Records -> Fields
function sortFunction(a, b) {
if (a[6] == b[6] && a[6] != "F" && a[6] != "R")
return 0;
else if (a[6] == "E")
return -1;
else if (b[6] == "E")
return 1;
else if (a[6] == "R" && b[6] == "F")
return -1;
else if (a[6] == "F" && b[6] == "R")
return 1;
else if (a[6] == "R" && b[6] == "R" && a[4] == "")
return -1;
else if (a[6] == "R" && b[6] == "R" && b[4] == "")
return 1;
else if (a[6] == "F" && b[6] == "F" && a[4] == "")
return -1;
else if (a[6] == "F" && b[6] == "F" && b[4] == "")
return 1;
else
return 0;
}
\ No newline at end of file
import("system.logging");
import("Turnover_lib");
import("system.vars");
import("system.result");
......
import("system.logging");
import("system.vars");
import("system.util");
import("system.datetime");
......@@ -132,7 +131,6 @@ TaskUtils.getTypeAttributes = function(pType)
TaskUtils.getAvailableStatus = function(pType)
{
logging.log("hääää" + KeywordUtils.getAttributeRelation(pType, $KeywordRegistry.taskType(), "availableStatus", ""))
return JSON.parse(KeywordUtils.getAttributeRelation(pType, $KeywordRegistry.taskType(), "availableStatus", ""));
}
......
import("system.logging");
import("system.db");
import("system.translate");
import("system.project");
......
This diff is collapsed.
import("system.logging");
import("system.translate");
import("system.text");
import("system.db");
import("system.util");
import("Communication_lib");
import("DocumentTemplate_lib");
import("system.neon");
import("system.mail");
function EmailUtils () {}
/**
* creates a new E-Mail-Object and ask for a download of a eml where all fields are prefilled
* The eml can be open with a mailclient and sent via the mailclient. Each mailclient has a different behaviour:
* In Outlook the mail is automatically opened in draft-mode
* In Thunderbird the mail is opened in view mode and you've to manually "edit as new"
*
* @param {String|Array} pToRecipients mailaddresses of the recipients, can either be a 1D-Array with several addresses or a string with one address
* @param {String} pSenderContactId contactId of the sender. the standard mailadress of the contact is used as sender-address
* @param {String} [pTemplateId] if a document-template shall be used, give the templateId here
* @param {String} [pRecipientContactId] contactId of the recipient, required to fill placeholders
*/
EmailUtils.openMailTemplate = function (pToRecipients, pSenderContactId, pTemplateId, pRecipientContactId)
{
var email = new Email(pToRecipients);
email.setSender(pSenderContactId);
if (pTemplateId)
email.setTemplate(pTemplateId, pRecipientContactId);
email.openMail();
}
/**
* opens a view where a new mail can be sent. In the view the use CAN select a DocumentTemplate if needed
*
* @param {String} pToContactId contactId with contacts to filter the communication-addresses
*/
EmailUtils.openNewMail = function (pToContactId)
{
var params = {
"ContactId_param" : pToContactId
};
neon.openContext("Email", "EmailEdit_view", null, neon.OPERATINGSTATE_NEW, params);
}
/**
* object for handling emails
*
* @param {String|Array} [pToRecipients=[]] recipient email address or array of recipient email addresses
* @param {String} [pSender=null] email address of the sender
* @param {String} [pSubject=null] subject
* @param {String} [pBody=null] mail body
* @param {Array} [pCcRecipients=[]] array of recipient cc addresses
* @param {Array} [pBccRecipients=[]] array of recipient bcc addresses
*
* @class
*/
function Email (pToRecipients, pSender, pSubject, pBody, pCcRecipients, pBccRecipients)
{
if (pToRecipients && typeof(pToRecipients) == "string")
pToRecipients = [pToRecipients];
this.sender = pSender;
this.subject = pSubject;
this.body = pBody;
this.toRecipients = pToRecipients || [];
this.ccRecipients = pCcRecipients || [];
this.bccRecipients = pBccRecipients || [];
}
/**
* loads a document template into the mail body
*
* @param {String} pTemplateId the id of the template
* @param {String} pContactId the id of the template
*
* @throws {Error} if the type of the template is invalid
*/
Email.prototype.setTemplate = function (pTemplateId, pContactId)
{
var template = DocumentTemplate.loadTemplate(pTemplateId);
//TODO: also set other properties if the template is a eml
if (template)
{
if (template.type != DocumentTemplate.types.EML && template.type != DocumentTemplate.types.HTML && template.type != DocumentTemplate.types.TXT)
throw new Error("Invalid document type for an email template");
this.body = template.getReplacedContentByContactId(pContactId);
}
}
/**
* sets the sender of the mail
*
* @param {String} pContactId the contactId of the sender
*/
Email.prototype.setSender = function (pContactId)
{
this.sender = CommUtil.getStandardMail(pContactId);
}
/**
* generates a 'mailto:' URL from the email object
*/
Email.prototype.getMailtoUrl = function ()
{
var url = [];
if (this.toRecipients.length)
url.push("to=" + this.toRecipients.join());
if (this.ccRecipients.length)
url.push("cc=" + this.ccRecipients.join());
if (this.bccRecipients.length)
url.push("bcc=" + this.bccRecipients.join());
if (this.subject)
url.push("subject=" + this.subject);
if (this.body)
url.push("body=" + text.html2text(this.body));
url = "mailto:?" + url.join("&");
return encodeURI(url);
}
/**
* generates a eml-element from the email object
*/
Email.prototype.getRFCmail = function ()
{
logging.log(this.body)
var ENCODING = "UTF-8";
var mailId = mail.newMail();
if (this.toRecipients.length)
mail.addRecipients(mailId, mail.RECIPIENT_TO, this.toRecipients);
if (this.ccRecipients.length)
mail.addRecipients(mailId, mail.RECIPIENT_CC, this.ccRecipients);
if (this.bccRecipients.length)
mail.addRecipients(mailId, mail.RECIPIENT_BCC, this.bccRecipients);
if (this.subject)
mail.setSubject(mailId, this.subject, ENCODING);
if (this.body)
mail.addText(mailId, this.body, "text/html", ENCODING, null);
else
mail.addText(mailId, "", "text/html", ENCODING, null);
//"X-Unsent" is a very badly, non-standardised header to gently ask the mail client that the mail should open in a compose-mode
//this is mainly done for Microsoft Outlook for Windows.
//Thunderbird has a dinosaur-request (it's from the year 2002) to also support this: https://bugzilla.mozilla.org/show_bug.cgi?id=166541
mail.addHeader(mailId, "X-Unsent", "1");
//accoding to this entry: https://stackoverflow.com/questions/11330628/os-x-mail-open-eml-files-in-compose-mode/33224913
//something similar exists for OS X Mail
//X-Uniform-Type-Identifier: com.apple.mail-draft
//this could be added later if needed
var mailObj = mail.getCachedMail(mailId);
return mail.toRFC(mailObj);
}
/**
* opens the email
*/
Email.prototype.openMail = function ()
{
neon.openUrl(this.getMailtoUrl(), false);
}
/**
* ask for a download of the email
*/
Email.prototype.downloadEML = function()
{
neon.download(util.encodeBase64String(this.getRFCmail(), null), (this.subject || translate.text("Email Template")) + ".eml");
}
import("system.translate");
import("system.text");
import("system.db");
import("system.util");
import("Communication_lib");
import("DocumentTemplate_lib");
import("system.neon");
import("system.mail");
function EmailUtils () {}
/**
* creates a new E-Mail-Object and ask for a download of a eml where all fields are prefilled
* The eml can be open with a mailclient and sent via the mailclient. Each mailclient has a different behaviour:
* In Outlook the mail is automatically opened in draft-mode
* In Thunderbird the mail is opened in view mode and you've to manually "edit as new"
*
* @param {String|Array} pToRecipients mailaddresses of the recipients, can either be a 1D-Array with several addresses or a string with one address
* @param {String} pSenderContactId contactId of the sender. the standard mailadress of the contact is used as sender-address
* @param {String} [pTemplateId] if a document-template shall be used, give the templateId here
* @param {String} [pRecipientContactId] contactId of the recipient, required to fill placeholders
*/
EmailUtils.openMailTemplate = function (pToRecipients, pSenderContactId, pTemplateId, pRecipientContactId)
{
var email = new Email(pToRecipients);
email.setSender(pSenderContactId);
if (pTemplateId)
email.setTemplate(pTemplateId, pRecipientContactId);
email.openMail();
}
/**
* opens a view where a new mail can be sent. In the view the use CAN select a DocumentTemplate if needed
*
* @param {String} pToContactId contactId with contacts to filter the communication-addresses
*/
EmailUtils.openNewMail = function (pToContactId)
{
var params = {
"ContactId_param" : pToContactId
};
neon.openContext("Email", "EmailEdit_view", null, neon.OPERATINGSTATE_NEW, params);
}
/**
* object for handling emails
*
* @param {String|Array} [pToRecipients=[]] recipient email address or array of recipient email addresses
* @param {String} [pSender=null] email address of the sender
* @param {String} [pSubject=null] subject
* @param {String} [pBody=null] mail body
* @param {Array} [pCcRecipients=[]] array of recipient cc addresses
* @param {Array} [pBccRecipients=[]] array of recipient bcc addresses
*
* @class
*/
function Email (pToRecipients, pSender, pSubject, pBody, pCcRecipients, pBccRecipients)
{
if (pToRecipients && typeof(pToRecipients) == "string")
pToRecipients = [pToRecipients];
this.sender = pSender;
this.subject = pSubject;
this.body = pBody;
this.toRecipients = pToRecipients || [];
this.ccRecipients = pCcRecipients || [];
this.bccRecipients = pBccRecipients || [];
}
/**
* loads a document template into the mail body
*
* @param {String} pTemplateId the id of the template
* @param {String} pContactId the id of the template
*
* @throws {Error} if the type of the template is invalid
*/
Email.prototype.setTemplate = function (pTemplateId, pContactId)
{
var template = DocumentTemplate.loadTemplate(pTemplateId);
//TODO: also set other properties if the template is a eml
if (template)
{
if (template.type != DocumentTemplate.types.EML && template.type != DocumentTemplate.types.HTML && template.type != DocumentTemplate.types.TXT)
throw new Error("Invalid document type for an email template");
this.body = template.getReplacedContentByContactId(pContactId);
}
}
/**
* sets the sender of the mail
*
* @param {String} pContactId the contactId of the sender
*/
Email.prototype.setSender = function (pContactId)
{
this.sender = CommUtil.getStandardMail(pContactId);
}
/**
* generates a 'mailto:' URL from the email object
*/
Email.prototype.getMailtoUrl = function ()
{
var url = [];
if (this.toRecipients.length)
url.push("to=" + this.toRecipients.join());
if (this.ccRecipients.length)
url.push("cc=" + this.ccRecipients.join());
if (this.bccRecipients.length)
url.push("bcc=" + this.bccRecipients.join());
if (this.subject)
url.push("subject=" + this.subject);
if (this.body)
url.push("body=" + text.html2text(this.body));
url = "mailto:?" + url.join("&");
return encodeURI(url);
}
/**
* generates a eml-element from the email object
*/
Email.prototype.getRFCmail = function ()
{
var ENCODING = "UTF-8";
var mailId = mail.newMail();
if (this.toRecipients.length)
mail.addRecipients(mailId, mail.RECIPIENT_TO, this.toRecipients);
if (this.ccRecipients.length)
mail.addRecipients(mailId, mail.RECIPIENT_CC, this.ccRecipients);
if (this.bccRecipients.length)
mail.addRecipients(mailId, mail.RECIPIENT_BCC, this.bccRecipients);
if (this.subject)
mail.setSubject(mailId, this.subject, ENCODING);
if (this.body)
mail.addText(mailId, this.body, "text/html", ENCODING, null);
else
mail.addText(mailId, "", "text/html", ENCODING, null);
//"X-Unsent" is a very badly, non-standardised header to gently ask the mail client that the mail should open in a compose-mode
//this is mainly done for Microsoft Outlook for Windows.
//Thunderbird has a dinosaur-request (it's from the year 2002) to also support this: https://bugzilla.mozilla.org/show_bug.cgi?id=166541
mail.addHeader(mailId, "X-Unsent", "1");
//accoding to this entry: https://stackoverflow.com/questions/11330628/os-x-mail-open-eml-files-in-compose-mode/33224913
//something similar exists for OS X Mail
//X-Uniform-Type-Identifier: com.apple.mail-draft
//this could be added later if needed
var mailObj = mail.getCachedMail(mailId);
return mail.toRFC(mailObj);
}
/**
* opens the email
*/
Email.prototype.openMail = function ()
{
neon.openUrl(this.getMailtoUrl(), false);
}
/**
* ask for a download of the email
*/
Email.prototype.downloadEML = function()
{
neon.download(util.encodeBase64String(this.getRFCmail(), null), (this.subject || translate.text("Email Template")) + ".eml");
}
\ No newline at end of file
import("system.logging");
import("system.translate");
import("system.db");
import("DataCaching_lib");
......@@ -93,7 +92,6 @@ KeywordData.getKeywordAttributeRelations = function (pKeywordContainer)
}
return res;
});
logging.log(data.toSource());
return data;
}
......
import("system.logging");
import("KeywordRegistry_basic");
import("KeywordData_lib");
import("system.vars");
......@@ -71,7 +70,6 @@ KeywordUtils.getAttributeRelationsByKey = function(pKeyId, pContainerName)
return "";
var data = KeywordData.getKeywordAttributeRelations(pContainerName);
logging.log("byKey " + data.toSource())
if (data[pKeyId] == undefined)
return {};
else
......@@ -92,10 +90,6 @@ KeywordUtils.getAttributeRelationsByKey = function(pKeyId, pContainerName)
KeywordUtils.getAttributeRelation = function(pKeyId, pContainerName, pAttrName, pDefault)
{
var attributes = KeywordUtils.getAttributeRelationsByKey(pKeyId, pContainerName);
logging.log("getRel " + attributes.toSource());
logging.log("ggggg " + pAttrName);
logging.log("ggggg " + pKeyId);
logging.log("ggggg " + attributes[pAttrName]);
if (attributes && attributes[pAttrName] != null)
{
return attributes[pAttrName];
......
import("system.logging");
import("Sql_lib");
import("system.translate");
import("KeywordRegistry_basic");
......@@ -87,13 +86,10 @@ TurnoverUtil.getForecastData = function (pMaxYear, pYearCount, pSalesprojectId)
TurnoverUtil.getTurnoverAndForecastData = function (pMaxYear, pYearCount, pShowForecast, pShowTurnover, pSalesprojectId)
{
var data = [];
logging.log(pShowTurnover);
logging.log(pShowForecast);
if (pShowTurnover)
data = data.concat(TurnoverUtil.getTurnoverData(pMaxYear, pYearCount, pSalesprojectId));
if (pShowForecast)
data = data.concat(TurnoverUtil.getForecastData(pMaxYear, pYearCount, pSalesprojectId));
logging.log(data.toSource());
return data;
}
\ No newline at end of file
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