diff --git a/process/DataPrivacy_lib/process.js b/process/DataPrivacy_lib/process.js index 78656bb581dc27cb7908a9dc6b0a3e6115e8f83d..65e179fdd4de873cd59545b02f29b0747180dccb 100644 --- a/process/DataPrivacy_lib/process.js +++ b/process/DataPrivacy_lib/process.js @@ -296,7 +296,7 @@ DataPrivacyUtils.collectAll = function(pContactId, pFilterCond) "", // "DATE_EDIT," + // 9 currentUser, // "USER_NEW," + // 10 "", // "USER_EDIT " // 11 - KeywordUtils.getViewValue($KeywordRegistry.dsgvoType(), StringUtils.toChar36(dsgvotype.key)), // 12 + KeywordUtils.getViewValue($KeywordRegistry.dsgvoType(), StringUtils.pad36(dsgvotype.key)), // 12 ]) } }); diff --git a/process/KeywordRegistry_basic/process.js b/process/KeywordRegistry_basic/process.js index 11f8e9dd000f4f85e919f0a2d363bad799c0d199..d7ff5a64143b144579b14df0d9cd8c4cac91b08d 100644 --- a/process/KeywordRegistry_basic/process.js +++ b/process/KeywordRegistry_basic/process.js @@ -16,16 +16,17 @@ * $KeywordRegistry.activityDirection() */ function $KeywordRegistry(){} -$KeywordRegistry._autoPad = function(pKey){return pKey + " ".repeat(Math.max(0, 36-pKey.length))}; +// this function can also be found as StringUtils.pad36() in Util_lib and is just here to avoid an import because this registry is heavily used. +$KeywordRegistry._autoPad = function(pKey){return (pKey + " ").slice(0, 36)}; $KeywordRegistry.attributeType = function(){return "AttributeType";}; $KeywordRegistry.keywordAttributeType = function(){return "KeywordAttributeType";}; $KeywordRegistry.contractPayment = function(){return "ContractPayment";}; $KeywordRegistry.contractStatus = function(){return "ContractStatus";}; -$KeywordRegistry.contractState$validLimited = function(){return "CONTRACTSTATVALIDLI ";}; -$KeywordRegistry.contractState$validUnlimited = function(){return "CONTRACTSTATVALIDUNLI ";}; -$KeywordRegistry.contractState$notSigned = function(){return "CONTRACTSTATSIGN ";}; +$KeywordRegistry.contractState$validLimited = function(){return $KeywordRegistry._autoPad("CONTRACTSTATVALIDLI");}; +$KeywordRegistry.contractState$validUnlimited = function(){return $KeywordRegistry._autoPad("CONTRACTSTATVALIDUNLI");}; +$KeywordRegistry.contractState$notSigned = function(){return $KeywordRegistry._autoPad("CONTRACTSTATSIGN");}; $KeywordRegistry.contractType = function(){return "ContractType";}; @@ -37,44 +38,44 @@ $KeywordRegistry.contactStatus = function(){return "ContactStatus";}; $KeywordRegistry.contactStatus$active = function(){return $KeywordRegistry._autoPad("CONTACTSTATACTIVE");}; $KeywordRegistry.currency = function(){return "Currency";}; -$KeywordRegistry.currency$eur = function(){return "EUR ";}; +$KeywordRegistry.currency$eur = function(){return $KeywordRegistry._autoPad("EUR");}; $KeywordRegistry.productGroupcode = function(){return "ProductGroupcode";}; $KeywordRegistry.offerStatus = function(){return "OfferStatus";}; -$KeywordRegistry.offerStatus$open = function(){return "OFFERSTATOPEN ";}; -$KeywordRegistry.offerStatus$checked = function(){return "OFFERSTATCHECK ";}; -$KeywordRegistry.offerStatus$sent = function(){return "OFFERSTATSENT ";}; -$KeywordRegistry.offerStatus$won = function(){return "OFFERSTATWON ";}; -$KeywordRegistry.offerStatus$lost = function(){return "OFFERSTATLOST ";}; +$KeywordRegistry.offerStatus$open = function(){return $KeywordRegistry._autoPad("OFFERSTATOPEN");}; +$KeywordRegistry.offerStatus$checked = function(){return $KeywordRegistry._autoPad("OFFERSTATCHECK");}; +$KeywordRegistry.offerStatus$sent = function(){return $KeywordRegistry._autoPad("OFFERSTATSENT");}; +$KeywordRegistry.offerStatus$won = function(){return $KeywordRegistry._autoPad("OFFERSTATWON");}; +$KeywordRegistry.offerStatus$lost = function(){return $KeywordRegistry._autoPad("OFFERSTATLOST");}; $KeywordRegistry.organisationType = function(){return "OrganisationType";}; -$KeywordRegistry.organisationType$manufacturer = function(){return "ORGMANUF";}; -$KeywordRegistry.organisationType$competitor = function(){return "ORGCOMP";}; +$KeywordRegistry.organisationType$manufacturer = function(){return $KeywordRegistry._autoPad("ORGMANUF");}; +$KeywordRegistry.organisationType$competitor = function(){return $KeywordRegistry._autoPad("ORGCOMP");}; $KeywordRegistry.personGender = function(){return "PersonGender";}; $KeywordRegistry.taskStatus = function(){return "TaskStatus";}; -$KeywordRegistry.taskStatus$new = function(){return "NEW ";}; -$KeywordRegistry.taskStatus$unassigned = function(){return "UNASSIGNED ";}; -$KeywordRegistry.taskStatus$assigned = function(){return "ASSIGNED ";}; -$KeywordRegistry.taskStatus$inProgress = function(){return "IN-PROGRESS ";}; -$KeywordRegistry.taskStatus$waiting = function(){return "WAITING ";}; -$KeywordRegistry.taskStatus$ended = function(){return "ENDED ";}; -$KeywordRegistry.taskStatus$customerChecks = function(){return "CUSTOMER-CHECKS ";}; +$KeywordRegistry.taskStatus$new = function(){return $KeywordRegistry._autoPad("NEW");}; +$KeywordRegistry.taskStatus$unassigned = function(){return $KeywordRegistry._autoPad("UNASSIGNED");}; +$KeywordRegistry.taskStatus$assigned = function(){return $KeywordRegistry._autoPad("ASSIGNED");}; +$KeywordRegistry.taskStatus$inProgress = function(){return $KeywordRegistry._autoPad("IN-PROGRESS");}; +$KeywordRegistry.taskStatus$waiting = function(){return $KeywordRegistry._autoPad("WAITING");}; +$KeywordRegistry.taskStatus$ended = function(){return $KeywordRegistry._autoPad("ENDED");}; +$KeywordRegistry.taskStatus$customerChecks = function(){return $KeywordRegistry._autoPad("CUSTOMER-CHECKS");}; $KeywordRegistry.taskType = function(){return "TaskType";}; -$KeywordRegistry.taskType$task = function(){return "TASK ";}; -$KeywordRegistry.taskType$ticket = function(){return "TICKET ";}; +$KeywordRegistry.taskType$task = function(){return $KeywordRegistry._autoPad("TASK");}; +$KeywordRegistry.taskType$ticket = function(){return $KeywordRegistry._autoPad("TICKET");}; $KeywordRegistry.ticketType = function(){return "TicketType";}; -$KeywordRegistry.ticketType$supportTicket = function(){return "SUPPORTTICKET ";}; +$KeywordRegistry.ticketType$supportTicket = function(){return $KeywordRegistry._autoPad("SUPPORTTICKET");}; $KeywordRegistry.productPricelist = function(){return "ProductPricelist";}; -$KeywordRegistry.productPricelist$standardList = function(){return "PRICELISTDEFAULT ";}; +$KeywordRegistry.productPricelist$standardList = function(){return $KeywordRegistry._autoPad("PRICELISTDEFAULT");}; $KeywordRegistry.quantityUnit = function(){return "QuantityUnit";}; -$KeywordRegistry.quantityUnit$pieces = function(){return "QUANTITYPIECES";}; +$KeywordRegistry.quantityUnit$pieces = function(){return $KeywordRegistry._autoPad("QUANTITYPIECES");}; $KeywordRegistry.MemberRole = function(){return "MemberRole";}; $KeywordRegistry.salesprojectSource = function(){return "SalesprojectSource";}; @@ -84,11 +85,11 @@ $KeywordRegistry.stockWarehouse = function(){return "StockWarehouse";}; $KeywordRegistry.salesprojectProbability = function(){return "SalesprojectProbability";}; $KeywordRegistry.activityCategory = function(){return "ActivityCategory";}; -$KeywordRegistry.activityCategory$mail = function(){return "MAIL ";}; +$KeywordRegistry.activityCategory$mail = function(){return $KeywordRegistry._autoPad("MAIL");}; $KeywordRegistry.addressType = function(){return "AddressType";}; -$KeywordRegistry.addressType$private = function(){return "HOMEADDR";}; -$KeywordRegistry.addressType$office = function(){return "OFFICEADDR";}; +$KeywordRegistry.addressType$private = function(){return $KeywordRegistry._autoPad("HOMEADDR");}; +$KeywordRegistry.addressType$office = function(){return $KeywordRegistry._autoPad("OFFICEADDR");}; $KeywordRegistry.offerProbability = function(){return "OfferProbability";}; $KeywordRegistry.communicationMedium = function(){return "CommunicationMedium";}; @@ -97,24 +98,24 @@ $KeywordRegistry.salesprojectWeakness = function(){return "SalesprojectWeakness" $KeywordRegistry.salesprojectStrenght = function(){return "SalesprojectStrenght";}; $KeywordRegistry.salesprojectState = function(){return "SalesprojectState";}; -$KeywordRegistry.salesprojectState$open = function(){return "SALPROJSTATOPEN ";}; -$KeywordRegistry.salesprojectState$postponed = function(){return "SALPROJSTATPOSTPONED ";}; -$KeywordRegistry.salesprojectState$aborted = function(){return "SALPROJSTATABORT ";}; -$KeywordRegistry.salesprojectState$partialOrder = function(){return "SALPROJSTATPARTIAL ";}; -$KeywordRegistry.salesprojectState$order = function(){return "SALPROJSTATORDER ";}; -$KeywordRegistry.salesprojectState$lost = function(){return "SALPROJSTATLOST ";}; +$KeywordRegistry.salesprojectState$open = function(){return $KeywordRegistry._autoPad("SALPROJSTATOPEN");}; +$KeywordRegistry.salesprojectState$postponed = function(){return $KeywordRegistry._autoPad("SALPROJSTATPOSTPONED");}; +$KeywordRegistry.salesprojectState$aborted = function(){return $KeywordRegistry._autoPad("SALPROJSTATABORT");}; +$KeywordRegistry.salesprojectState$partialOrder = function(){return $KeywordRegistry._autoPad("SALPROJSTATPARTIAL");}; +$KeywordRegistry.salesprojectState$order = function(){return $KeywordRegistry._autoPad("SALPROJSTATORDER");}; +$KeywordRegistry.salesprojectState$lost = function(){return $KeywordRegistry._autoPad("SALPROJSTATLOST");}; $KeywordRegistry.salesprojectPhase = function(){return "SalesprojectPhase";}; -$KeywordRegistry.salesprojectPhase$nqc = function(){return "SALPROJPHASENQC ";}; +$KeywordRegistry.salesprojectPhase$nqc = function(){return $KeywordRegistry._autoPad("SALPROJPHASENQC");}; $KeywordRegistry.taskPriority = function(){return "TaskPriority";}; -$KeywordRegistry.taskPriority$none = function(){return "TASKPRIONONE ";}; -$KeywordRegistry.taskPriority$low = function(){return "TASKPRIOLOW ";}; -$KeywordRegistry.taskPriority$medium = function(){return "TASKPRIOMEDIUM ";}; -$KeywordRegistry.taskPriority$high = function(){return "TASKPRIOHIGH ";}; +$KeywordRegistry.taskPriority$none = function(){return $KeywordRegistry._autoPad("TASKPRIONONE");}; +$KeywordRegistry.taskPriority$low = function(){return $KeywordRegistry._autoPad("TASKPRIOLOW");}; +$KeywordRegistry.taskPriority$medium = function(){return $KeywordRegistry._autoPad("TASKPRIOMEDIUM");}; +$KeywordRegistry.taskPriority$high = function(){return $KeywordRegistry._autoPad("TASKPRIOHIGH");}; $KeywordRegistry.taskProgress = function(){return "TaskProgress";}; -$KeywordRegistry.taskProgress$0 = function(){return "TASKPROG0 ";}; +$KeywordRegistry.taskProgress$0 = function(){return $KeywordRegistry._autoPad("TASKPROG0");}; $KeywordRegistry.competitionState = function(){return "CompetitionState";}; $KeywordRegistry.objectRelationType = function(){return "ObjectRelationType";}; @@ -125,28 +126,28 @@ $KeywordRegistry.contactPosition = function(){return "ContactPosition";}; $KeywordRegistry.contactContactrole = function(){return "ContactContactrole";}; $KeywordRegistry.campaignState = function(){return "CampaignManagementStates";}; -$KeywordRegistry.campaignState$planning = function(){return "PLANNING ";}; -$KeywordRegistry.campaignState$approved = function(){return "APPROVED ";}; +$KeywordRegistry.campaignState$planning = function(){return $KeywordRegistry._autoPad("PLANNING");}; +$KeywordRegistry.campaignState$approved = function(){return $KeywordRegistry._autoPad("APPROVED");}; $KeywordRegistry.campaignStepState = function(){return "CampaignManagementStepStates";}; -$KeywordRegistry.campaignStepState$open = function(){return "OPEN ";}; +$KeywordRegistry.campaignStepState$open = function(){return $KeywordRegistry._autoPad("OPEN");}; $KeywordRegistry.campaignStepCostCategory = function(){return "CampaignManagementCostCategory";}; $KeywordRegistry.documentTemplateType = function(){return "DocumentTemplateType";}; -$KeywordRegistry.documentTemplateType$letter = function(){return "LET ";}; -$KeywordRegistry.documentTemplateType$mail = function(){return "MAI ";}; -$KeywordRegistry.documentTemplateType$attachment = function(){return "ATT ";}; +$KeywordRegistry.documentTemplateType$letter = function(){return $KeywordRegistry._autoPad("LET");}; +$KeywordRegistry.documentTemplateType$mail = function(){return $KeywordRegistry._autoPad("MAI");}; +$KeywordRegistry.documentTemplateType$attachment = function(){return $KeywordRegistry._autoPad("ATT");}; $KeywordRegistry.documentTemplateTypeCategory = function(){return "DocumentTemplateTypeCategory";}; -$KeywordRegistry.documentTemplateTypeCategory$single = function(){return "1 ";}; -$KeywordRegistry.documentTemplateTypeCategory$serial = function(){return "2 ";}; +$KeywordRegistry.documentTemplateTypeCategory$single = function(){return $KeywordRegistry._autoPad("1");}; +$KeywordRegistry.documentTemplateTypeCategory$serial = function(){return $KeywordRegistry._autoPad("2");}; $KeywordRegistry.classificationType = function(){return "ClassificationType";}; -$KeywordRegistry.classificationType$salesproject = function(){return "SALESPROJ";}; +$KeywordRegistry.classificationType$salesproject = function(){return $KeywordRegistry._autoPad("SALESPROJ");}; $KeywordRegistry.personGender = function(){return "PersonGender";}; -$KeywordRegistry.personGender$other = function(){return "o";}; +$KeywordRegistry.personGender$other = function(){return $KeywordRegistry._autoPad("o");}; $KeywordRegistry.permissionCondType = function(){return "PermissionCondType";}; $KeywordRegistry.permissionAccessType = function(){return "PermissionAccessType";}; @@ -154,34 +155,34 @@ $KeywordRegistry.dsgvoPurpose = function(){return "DSGVOPurpose";}; $KeywordRegistry.dsgvoStatuoritysource = function(){return "DSGVOStatuoritysource";}; $KeywordRegistry.dsgvoType = function() {return "DSGVOType";}; -$KeywordRegistry.dsgvoType$birth = function() {return "TYPE_BIRTH ";}; +$KeywordRegistry.dsgvoType$birth = function(){return $KeywordRegistry._autoPad("TYPE_BIRTH");}; $KeywordRegistry.dsgvoTransmission = function() {return "DSGVOTransmission";}; -$KeywordRegistry.dsgvoTransmission$none = function() {return "DSGVONONE ";}; -$KeywordRegistry.dsgvoTransmission$inland = function() {return "DSGVOINLAND ";}; -$KeywordRegistry.dsgvoTransmission$foreign = function() {return "DSGVOFOREIGN ";}; +$KeywordRegistry.dsgvoTransmission$none = function(){return $KeywordRegistry._autoPad("DSGVONONE");}; +$KeywordRegistry.dsgvoTransmission$inland = function(){return $KeywordRegistry._autoPad("DSGVOINLAND");}; +$KeywordRegistry.dsgvoTransmission$foreign = function(){return $KeywordRegistry._autoPad("DSGVOFOREIGN");}; $KeywordRegistry.dsgvoDeadline = function() {return "DSGVODeadline";}; -$KeywordRegistry.dsgvoDeadline$onTime = function() {return "DSGVOONTIME ";}; -$KeywordRegistry.dsgvoDeadline$complex = function() {return "DSGVODEADLINECOMPLEX ";}; -$KeywordRegistry.dsgvoDeadline$count = function() {return "DSGVODEADLINECOUNT ";}; +$KeywordRegistry.dsgvoDeadline$onTime = function(){return $KeywordRegistry._autoPad("DSGVOONTIME");}; +$KeywordRegistry.dsgvoDeadline$complex = function(){return $KeywordRegistry._autoPad("DSGVODEADLINECOMPLEX");}; +$KeywordRegistry.dsgvoDeadline$count = function(){return $KeywordRegistry._autoPad("DSGVODEADLINECOUNT");}; $KeywordRegistry.dsgvoGuarantee = function() {return "DSGVOGuarantee";}; $KeywordRegistry.textPlaceholder = function(){return "textPlaceholder";}; $KeywordRegistry.communicationMediumCampaign = function(){return "CommunicationMediumCampaign";}; -$KeywordRegistry.communicationMediumCampaign$mail = function(){return "CAMPAIGNEMAIL ";}; -$KeywordRegistry.communicationMediumCampaign$letter = function(){return "CAMPAIGNLETTER ";}; +$KeywordRegistry.communicationMediumCampaign$mail = function(){return $KeywordRegistry._autoPad("CAMPAIGNEMAIL");}; +$KeywordRegistry.communicationMediumCampaign$letter = function(){return $KeywordRegistry._autoPad("CAMPAIGNLETTER");}; $KeywordRegistry.bulkMailRecipientStatus = function(){return "BulkMailRecipientStatus";}; -$KeywordRegistry.bulkMailRecipientStatus$pending = function(){return "EMAILPENDING ";}; -$KeywordRegistry.bulkMailRecipientStatus$sent = function(){return "EMAILSENT ";}; -$KeywordRegistry.bulkMailRecipientStatus$failed = function(){return "EMAILFAILED ";}; +$KeywordRegistry.bulkMailRecipientStatus$pending = function(){return $KeywordRegistry._autoPad("EMAILPENDING");}; +$KeywordRegistry.bulkMailRecipientStatus$sent = function(){return $KeywordRegistry._autoPad("EMAILSENT");}; +$KeywordRegistry.bulkMailRecipientStatus$failed = function(){return $KeywordRegistry._autoPad("EMAILFAILED");}; $KeywordRegistry.bulkMailStatus = function(){return "BulkMailStatus";}; -$KeywordRegistry.bulkMailStatus$notSent = function(){return "BULKMAILNOTSENT ";}; -$KeywordRegistry.bulkMailStatus$beingSent = function(){return "BULKMAILBEINGSENT ";}; -$KeywordRegistry.bulkMailStatus$sent = function(){return "BULKMAILSENT ";}; +$KeywordRegistry.bulkMailStatus$notSent = function(){return $KeywordRegistry._autoPad("BULKMAILNOTSENT");}; +$KeywordRegistry.bulkMailStatus$beingSent = function(){return $KeywordRegistry._autoPad("BULKMAILBEINGSENT");}; +$KeywordRegistry.bulkMailStatus$sent = function(){return $KeywordRegistry._autoPad("BULKMAILSENT");}; $KeywordRegistry.callDirection = function(){return "CallDirection";}; $KeywordRegistry.callDirection$incoming = function(){return $KeywordRegistry._autoPad("INC");}; diff --git a/process/Ticket_lib/process.js b/process/Ticket_lib/process.js index 33462056aca919ed342ba0490604ecacb1d2ec7f..5f1da6633ee76a72c61bb33bf3fd361128c0d0c2 100644 --- a/process/Ticket_lib/process.js +++ b/process/Ticket_lib/process.js @@ -123,7 +123,7 @@ TicketUtils.prototype.getAvailableStatus = function() if (states == null) return states; - return states.map(StringUtils.toChar36); + return states.map(StringUtils.pad36); } /** @@ -133,7 +133,7 @@ TicketUtils.prototype.getAvailableStatus = function() */ TicketUtils.prototype.getDefaultStatus = function() { - return StringUtils.toChar36(KeywordUtils.getAttributeRelation(this.type, $KeywordRegistry.ticketType(), "defaultStatus", "")); + return StringUtils.pad36(KeywordUtils.getAttributeRelation(this.type, $KeywordRegistry.ticketType(), "defaultStatus", "")); } /** diff --git a/process/Util_lib/process.js b/process/Util_lib/process.js index 75e04839b348358a042d57788a757b7de53c9107..de5d265459ddeb922c5c7dc07c679a00daaa4c77 100644 --- a/process/Util_lib/process.js +++ b/process/Util_lib/process.js @@ -43,7 +43,7 @@ StringUtils.concat = function(pSeparator, pElements) /** * converts a string to a string of always 36 chars. Whitespaces are added at the end if needed. */ -StringUtils.toChar36 = function(pValue) +StringUtils.pad36 = function(pValue) { return (pValue + " ").slice(0, 36); }