diff --git a/entity/Appointment_entity/recordcontainers/jdito/contentProcess.js b/entity/Appointment_entity/recordcontainers/jdito/contentProcess.js index 240de2d44397c0acee5d8311b5b41941549b68c2..0499835a647ad301bee4e604b05fa99b6fb5eb3f 100644 --- a/entity/Appointment_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/Appointment_entity/recordcontainers/jdito/contentProcess.js @@ -24,10 +24,10 @@ else if(vars.getString("$param.LinkedAppointmentsFromDashlet_param")) { var contactid = tools.getCurrentUser()["params"]["contactID"]; - cond.andPrepareValue("AB_APPOINTMENTLINK.OBJECT_ROWID", contactid) - var idscond = db.translateCondition(cond.build("1 = 1")); + cond.andPrepareIfSet("AB_APPOINTMENTLINK.OBJECT_ROWID", contactid) + let idscond = db.translateCondition(cond.build("1 = 1")); - var appointmentUids = db.table("select APPOINTMENT_ID from AB_APPOINTMENTLINK where " + idscond); + let appointmentUids = db.table("select APPOINTMENT_ID from AB_APPOINTMENTLINK where " + idscond); result.object(buildEntriesFromUids(appointmentUids)); } @@ -37,9 +37,9 @@ else if(vars.getString("$param.LinkedAppointmentsFromDashlet_param")) else if(vars.getString("$param.LinkedObjectId_param") != undefined) { cond.andPrepareVars("AB_APPOINTMENTLINK.OBJECT_ROWID", "$param.LinkedObjectId_param") - var idscond = db.translateCondition(cond.build("1 = 1")); + let idscond = db.translateCondition(cond.build("1 = 1")); - var appointmentUids = db.table("select APPOINTMENT_ID from AB_APPOINTMENTLINK where " + idscond); + let appointmentUids = db.table("select APPOINTMENT_ID from AB_APPOINTMENTLINK where " + idscond); result.object(buildEntriesFromUids(appointmentUids)); } /** diff --git a/entity/Appointment_entity/recordcontainers/jdito/onDelete.js b/entity/Appointment_entity/recordcontainers/jdito/onDelete.js index 7abca1e85cd72262cbcde93854d041f1a6956211..fe7f38a0fba3c871e577a04aa0d70fee4f8f95e8 100644 --- a/entity/Appointment_entity/recordcontainers/jdito/onDelete.js +++ b/entity/Appointment_entity/recordcontainers/jdito/onDelete.js @@ -18,7 +18,7 @@ if (vars.exists("$param.Entry_param")) * Deletes ApointmentLinks referring to the deleted Appointment. */ var cond = SqlCondition.begin(); - cond.andPrepareValue("AB_APPOINTMENTLINK.APPOINTMENT_ID", entry[calendars.ID]) + cond.andPrepareIfSet("AB_APPOINTMENTLINK.APPOINTMENT_ID", entry[calendars.ID]) var idscond = db.translateCondition(cond.build("1 = 2")); db.deleteData("AB_APPOINTMENTLINK", idscond); diff --git a/process/Sql_lib/process.js b/process/Sql_lib/process.js index bc8e3cdaff76696243e3ef8095277694f70b33c8..817b916a62894a468d9d5a3e87f344fc32739a71 100644 --- a/process/Sql_lib/process.js +++ b/process/Sql_lib/process.js @@ -317,13 +317,6 @@ SqlCondition.prototype.andPrepareVars = function(field, variable, cond, fieldTyp return this; } -SqlCondition.prototype.andPrepareValue = function(field, value) { - if (value) { - return this.andPrepare(field, value, null, null); - } - return this; -} - /** * same as the "orPrepare"-function but with validation of adito-variables functionality * @param {String | String[]} field the database field as "tablename.columnname"; e.g. "ORGANISATION.NAME" or as array with column-alias: ["ORGANISATION", "NAME", "myorgAlias"]