Skip to content

Commit

Permalink
Merge pull request #557 from PAWECOGmbH/staging
Browse files Browse the repository at this point in the history
Staging to Production
  • Loading branch information
ptruessel authored Nov 20, 2024
2 parents 2f17f64 + 9b5f9d9 commit 607afb3
Show file tree
Hide file tree
Showing 2,557 changed files with 3,623 additions and 2,912 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
www/test.*

### Userdata folder ###
www/userdata/**
www/userdata

### Config files ###
config.cfm
Expand Down
11 changes: 11 additions & 0 deletions config/db/core/V3__frontend-changes.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

UPDATE frontend_mappings SET strPath = 'templates/login.cfm' WHERE strMapping = 'login';
UPDATE frontend_mappings SET strPath = 'templates/register.cfm' WHERE strMapping = 'register';
UPDATE frontend_mappings SET strPath = 'templates/password.cfm' WHERE strMapping = 'password';
UPDATE frontend_mappings SET strPath = 'templates/plans.cfm' WHERE strMapping = 'plans';
UPDATE frontend_mappings SET strPath = 'templates/mfa.cfm' WHERE strMapping = 'mfa';


SET FOREIGN_KEY_CHECKS = 1;
16 changes: 8 additions & 8 deletions config/db/dev/create-notifications.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@ SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

INSERT INTO notifications (intCustomerID, intUserID, dtmCreated, strTitleVar, strDescrVar, strLink, strLinkTextVar, dtmRead)
VALUES (1, 1, NOW(), 'txtInformation', 'errSystemStoppedFixProblem', 'account-settings/company', 'btnActivate', NULL);
VALUES (1, 1, NOW(), 'txtInformation', 'errSystemStoppedFixProblem', '/account-settings/company', 'btnActivate', NULL);

INSERT INTO notifications (intCustomerID, intUserID, dtmCreated, strTitleVar, strDescrVar, strLink, strLinkTextVar, dtmRead)
VALUES (1, 1, NOW(), 'formInvoiceInfo', 'errSystemStoppedFixProblem', 'account-settings/tenants', 'btnActivate', NULL);
VALUES (1, 1, NOW(), 'formInvoiceInfo', 'errSystemStoppedFixProblem', '/account-settings/tenants', 'btnActivate', NULL);

INSERT INTO notifications (intCustomerID, intUserID, dtmCreated, strTitleVar, strDescrVar, strLink, strLinkTextVar, dtmRead)
VALUES (1, 1, NOW(), 'txtNetwork', 'errSystemStoppedFixProblem', 'account-settings/users', 'btnActivate', NULL);
VALUES (1, 1, NOW(), 'txtNetwork', 'errSystemStoppedFixProblem', '/account-settings/users', 'btnActivate', NULL);

INSERT INTO notifications (intCustomerID, intUserID, dtmCreated, strTitleVar, strDescrVar, strLink, strLinkTextVar, dtmRead)
VALUES (1, 1, NOW(), 'titTimezone', 'errSystemStoppedFixProblem', 'account-settings/reset-password', 'btnActivate', NULL);
VALUES (1, 1, NOW(), 'titTimezone', 'errSystemStoppedFixProblem', '/account-settings/reset-password', 'btnActivate', NULL);

INSERT INTO notifications (intCustomerID, intUserID, dtmCreated, strTitleVar, strDescrVar, strLink, strLinkTextVar, dtmRead)
VALUES (1, 1, NOW(), 'titDowngrade', 'errSystemStoppedFixProblem', 'account-settings', 'btnActivate', NULL);
VALUES (1, 1, NOW(), 'titDowngrade', 'errSystemStoppedFixProblem', '/account-settings', 'btnActivate', NULL);

INSERT INTO notifications (intCustomerID, intUserID, dtmCreated, strTitleVar, strDescrVar, strLink, strLinkTextVar, dtmRead)
VALUES (1, 1, NOW(), 'titModule', 'errSystemStoppedFixProblem', 'account-settings/modules', 'btnActivate', NULL);
VALUES (1, 1, NOW(), 'titModule', 'errSystemStoppedFixProblem', '/account-settings/modules', 'btnActivate', NULL);

INSERT INTO notifications (intCustomerID, intUserID, dtmCreated, strTitleVar, strDescrVar, strLink, strLinkTextVar, dtmRead)
VALUES (1, 1, NOW(), 'titNotifications', 'errSystemStoppedFixProblem', 'account-settings', 'btnActivate', NULL);
VALUES (1, 1, NOW(), 'titNotifications', 'errSystemStoppedFixProblem', '/account-settings', 'btnActivate', NULL);

INSERT INTO notifications (intCustomerID, intUserID, dtmCreated, strTitleVar, strDescrVar, strLink, strLinkTextVar, dtmRead)
VALUES (1, 1, NOW(), 'titStatus', 'errSystemStoppedFixProblem', 'account-settings', 'btnActivate', NULL);
VALUES (1, 1, NOW(), 'titStatus', 'errSystemStoppedFixProblem', '/account-settings', 'btnActivate', NULL);

SET FOREIGN_KEY_CHECKS = 1;
3 changes: 3 additions & 0 deletions config/example.config.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
// Datasource
variables.datasource = "saaster";
// Theme (default_theme or custom_theme)
variables.activeTheme = "default_theme";
// Environment
variables.environment = "prod" // "dev" or "prod"
Expand Down
19 changes: 16 additions & 3 deletions www/Application.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ component displayname="Application" output="false" extends="backend.myapp.ownApp

// Load java files
this.javaSettings = {
loadPaths = [expandPath("/dist/java")],
loadPaths = [expandPath("/assets/java")],
reloadOnChange = true
};

Expand All @@ -36,6 +36,7 @@ component displayname="Application" output="false" extends="backend.myapp.ownApp
application.errorMail = variables.errorEmail;
application.mainURL = variables.mainURL;
application.environment = variables.environment;
application.activeTheme = variables.activeTheme;

// Payrexx initialising
local.payrexxStruct = structNew();
Expand All @@ -55,6 +56,7 @@ component displayname="Application" output="false" extends="backend.myapp.ownApp
application.objNotifications = new backend.core.com.notifications();
application.objSysadmin = new backend.core.com.sysadmin();
application.objMeta = new backend.core.com.meta();
application.objCoreUtil = new frontend.core.com.coreutility();

// Save all choosable languages into a list
local.qLanguages = queryExecute(
Expand Down Expand Up @@ -244,12 +246,23 @@ component displayname="Application" output="false" extends="backend.myapp.ownApp

// Protect the 'backend' folder excluding the pdf print page
if (listFirst(thiscontent.thisPath, "/") eq "backend" and !structKeyExists(session, "user_id")) {

if (structKeyExists(url, "pdf")) {

location url="#application.mainURL#/backend/core/views/invoices/print.cfm?pdf=#url.pdf#" addtoken="false";

} else {
getAlert('alertSessionExpired', 'warning');
location url="#application.mainURL#/login" addtoken="false";

// Redirect to the register form with plan redirect
if (structKeyExists(url, "plan")) {
location url="#application.mainURL#/register?redirect=book?plan=#url.plan#" addtoken="false";
} else {
getAlert('alertSessionExpired', 'warning');
location url="#application.mainURL#/login" addtoken="false";
}

}

}


Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
13 changes: 13 additions & 0 deletions www/assets/img/payments/card_post-finance-pay.svg
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
14 changes: 9 additions & 5 deletions www/backend/core/com/global.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ component displayname="globalFunctions" output="false" {
strMapping: {type: "nvarchar", value: local.sefString}
},
sql = "
SELECT strPath, blnOnlyAdmin, blnOnlySuperAdmin, blnOnlySysAdmin
SELECT strPath, blnOnlyAdmin, blnOnlySuperAdmin, blnOnlySysAdmin, 0 as itsFrontend
FROM system_mappings
WHERE strMapping = :strMapping
UNION
SELECT strPath, blnOnlyAdmin, blnOnlySuperAdmin, blnOnlySysAdmin
SELECT strPath, blnOnlyAdmin, blnOnlySuperAdmin, blnOnlySysAdmin, 0 as itsFrontend
FROM custom_mappings
WHERE strMapping = :strMapping
UNION
SELECT strPath, 0, 0, 0
SELECT strPath, 0, 0, 0, 1 as itsFrontend
FROM frontend_mappings
WHERE strMapping = :strMapping
UNION
Expand All @@ -47,15 +47,19 @@ component displayname="globalFunctions" output="false" {
SELECT strPath
FROM frontend_mappings
WHERE intFrontendMappingsID = frontend_mappings_trans.intFrontendMappingsID
) as strPath, 0, 0, 0
) as strPath, 0, 0, 0, 1 as itsFrontend
FROM frontend_mappings_trans
WHERE strMapping = :strMapping
LIMIT 1
"
)

if (local.qCheckSEF.recordCount) {
local.returnStruct['thisPath'] = local.qCheckSEF.strPath;
if (local.qCheckSEF.itsFrontend) {
local.returnStruct['thisPath'] = "frontend/" & application.activeTheme & "/" & local.qCheckSEF.strPath;
} else {
local.returnStruct['thisPath'] = local.qCheckSEF.strPath;
}
local.returnStruct['onlyAdmin'] = trueFalseFormat(local.qCheckSEF.blnOnlyAdmin);
local.returnStruct['onlySuperAdmin'] = trueFalseFormat(local.qCheckSEF.blnOnlySuperAdmin);
local.returnStruct['onlySysAdmin'] = trueFalseFormat(local.qCheckSEF.blnOnlySysAdmin);
Expand Down
67 changes: 51 additions & 16 deletions www/backend/core/com/invoices.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -1459,13 +1459,8 @@ component displayname="invoices" output="false" {
// Build the link in order to download the pdf without login
local.dl_link = application.mainURL & "/account-settings/invoice/print?pdf=" & local.uuid;

// Get the invoicing email address
// Get the customer data
local.customerData = application.objCustomer.getCustomerData(local.customerID);
if (len(trim(local.customerData.billingEmail))) {
local.toEmail = local.customerData.billingEmail;
} else {
local.toEmail = local.customerData.email;
}

local.invoicePerson = "";
if (structKeyExists(local.invoiceData, "userID") and (local.invoiceData.userID) gt 0) {
Expand Down Expand Up @@ -1494,8 +1489,8 @@ component displayname="invoices" output="false" {
");
}

// Send activation link
mail to="#local.toEmail#" from="#application.fromEmail#" subject="#getTrans('titInvoiceReady', local.customerData.language)#" type="html" {
// Send invoice
mail to="#getInvoiceEmail(customerID=local.customerID)#" from="#application.fromEmail#" subject="#getTrans('titInvoiceReady', local.customerData.language)#" type="html" {
include template="/config.cfm";
include template="/frontend/core/mail_design.cfm";
}
Expand Down Expand Up @@ -1537,13 +1532,8 @@ component displayname="invoices" output="false" {

try {

// Get the invoicing email address
// Get the customer data
local.customerData = application.objCustomer.getCustomerData(local.customerID);
if (len(trim(local.customerData.billingEmail))) {
local.toEmail = local.customerData.billingEmail;
} else {
local.toEmail = local.customerData.email;
}

local.invoicePerson = "";
if (structKeyExists(local.invoiceData, "userID") and (local.invoiceData.userID) gt 0) {
Expand Down Expand Up @@ -1574,7 +1564,7 @@ component displayname="invoices" output="false" {
}

// Send activation link
mail to="#local.toEmail#" from="#application.fromEmail#" subject="#variables.mailTitle#" type="html" {
mail to="#getInvoiceEmail(customerID=local.customerID)#" from="#application.fromEmail#" subject="#variables.mailTitle#" type="html" {
include template="/config.cfm";
include template="/frontend/core/mail_design.cfm";
}
Expand Down Expand Up @@ -1627,7 +1617,7 @@ component displayname="invoices" output="false" {
local.qrDataSet['qrSize'] = "300";

// Path to the swiss cross logo (if desired)
local.qrDataSet['qrLogo'] = "/dist/img/ch-cross.png";
local.qrDataSet['qrLogo'] = "/assets/img/ch-cross.png";

// Set all the needed data
local.qrDataSet['billerIBAN'] = application.objSysAdmin.getSystemSetting('settingIBANnumber').strDefaultValue;
Expand All @@ -1654,7 +1644,52 @@ component displayname="invoices" output="false" {
}


public string function getInvoiceEmail(numeric userID, numeric customerID) {

local.userEmail;
local.customerEmail;
local.billingEmail;
local.invoiceEmail;

// Get data using the userID
if (structKeyExists(arguments, "userID") and arguments.userID gt 0) {

local.qUserData = application.objCustomer.getUserDataByID(arguments.userID);
local.userEmail = local.qUserData.strEmail;

// Get data using the customerID
} else if (structKeyExists(arguments, "customerID") and arguments.customerID gt 0) {

local.customerEmail = application.objCustomer.getCustomerData(arguments.customerID).email;
local.billingEmail = application.objCustomer.getCustomerData(arguments.customerID).billingEmail;
local.userEmail = application.objUser.getAllUsers(arguments.customerID).strEmail;

// Send back with error
} else {
return "Eighter the userID or the customerID must be passed in!";
}

// First, we check the billing address
if (application.objGlobal.checkEmail(local.billingEmail)) {
local.invoiceEmail = local.billingEmail;
return local.invoiceEmail;
}

//Second, check the customers email address
if (application.objGlobal.checkEmail(local.customerEmail)) {
local.invoiceEmail = local.customerEmail;
}

// If neighter the billing nor the customer email address is valid, return the users email address
if (!len(trim(local.billingEmail)) and !len(trim(local.customerEmail))) {

local.invoiceEmail = local.userEmail;

}

return local.invoiceEmail;

}



Expand Down
Loading

0 comments on commit 607afb3

Please sign in to comment.