From eb17d8547239d3efbca2a08ccaea434efdd47ac2 Mon Sep 17 00:00:00 2001 From: Jos Groot Lipman Date: Tue, 3 Jan 2017 19:55:16 +0000 Subject: [PATCH] FSN#38889 Beter omgaan met undefined parameter waarden svn path=/Website/trunk/; revision=32198 --- UTILS/PutOrders/puo_notifications.js | 10 +++++----- UTILS/PutOrders/puo_sendfile.js | 8 ++++---- UTILS/PutOrders/puo_sendmail.js | 8 ++++---- UTILS/PutOrders/puo_sendsms.js | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/UTILS/PutOrders/puo_notifications.js b/UTILS/PutOrders/puo_notifications.js index d234f7d2dc..9c5431c89b 100644 --- a/UTILS/PutOrders/puo_notifications.js +++ b/UTILS/PutOrders/puo_notifications.js @@ -230,7 +230,7 @@ function notificationMail(rec, p_notificationXSL, params) , "summary" ); Log2File(2, "SubjectText na vertaling" + SubjectTextXSL); - if (SubjectTextXSL != "") + if (SubjectTextXSL) { SubjectText = SubjectTextXSL; } @@ -331,7 +331,7 @@ function notificationSMS(rec, p_notificationXSL, params) var SMSText = rec("fac_notificatie_oms").value; var SMSTextXSL = ""; - if ((rec("fac_notificatie_status").value & params.STATUS_SUMMARY_XSL) && (rec("fac_srtnotificatie_xmlnode").value != "")) + if ((rec("fac_notificatie_status").value & params.STATUS_SUMMARY_XSL) && (rec("fac_srtnotificatie_xmlnode").value)) { // Errors in de generatie van de XML worden afgevangen in fetchXMLContent // De functie levert dan een lege string, de notificatie wordt dan als verzonden @@ -352,7 +352,7 @@ function notificationSMS(rec, p_notificationXSL, params) , "summary" ); Log2File(2, "SMSText na vertaling" + SMSTextXSL); - if (SMSTextXSL != "") + if (SMSTextXSL) { SMSText = SMSTextXSL; } @@ -433,7 +433,7 @@ function notificationSYS(rec, params) encoding: encoding }; connect.connect(bedrijfadres); // vult eventueel bedrijfadres.username/password - if (xmlnode != "") + if (xmlnode) { // Errors in de generatie van de XML worden afgevangen in fetchXMLContent // De functie levert dan een lege string, de notificatie wordt dan als verzonden @@ -515,7 +515,7 @@ function getXslName(pNode) var fso = new ActiveXObject("Scripting.FileSystemObject"); var resxslsheet = S("puo_notificationxsl"); - if (pNode != "") + if (pNode) { resxslsheet = "xsl/" + pNode + ".xsl"; if (!fso.FileExists(custabspath + "/" + resxslsheet)) diff --git a/UTILS/PutOrders/puo_sendfile.js b/UTILS/PutOrders/puo_sendfile.js index 2b240986c8..e15600298a 100644 --- a/UTILS/PutOrders/puo_sendfile.js +++ b/UTILS/PutOrders/puo_sendfile.js @@ -138,7 +138,7 @@ function connectHTTP( p_connect Log2File(3, "(c)XML response: " + XMLresult.xml); TestAndRaiseAnXMLError("Analyseren (c)XML response", XMLresult); - if (XMLresult.text != "") + if (XMLresult.text) { Log2File(1, "(c)XML resultaat error: " + XMLresult.xml); resultcode = 1; @@ -338,7 +338,7 @@ function SendOrder( p_connect Log2File(2, "*> sendOrder"); try { - if (p_xslPath == "") + if (!p_xslPath) { throw new UserException(1000, "PutOrders", "No path specified"); } @@ -355,11 +355,11 @@ function SendOrder( p_connect xslDoc.setProperty("SelectionNamespaces", "xmlns:xsl='http://www.w3.org/1999/XSL/Transform'"); // verderop nodig var xmlDoc = SafeLoadTextXML(p_xmlData); - if (p_bedrijfadres.extension == "") + if (!p_bedrijfadres.extension) { p_bedrijfadres.extension = GetExtension(xmlDoc, xslDoc) // Old style via XSL } - if (p_bedrijfadres.extension != "") + if (p_bedrijfadres.extension) { var streamResult = new ActiveXObject("ADODB.Stream"); streamResult.Type = 2; // adTypeText diff --git a/UTILS/PutOrders/puo_sendmail.js b/UTILS/PutOrders/puo_sendmail.js index bdca1f8774..f516643b66 100644 --- a/UTILS/PutOrders/puo_sendmail.js +++ b/UTILS/PutOrders/puo_sendmail.js @@ -68,7 +68,7 @@ function sendMail( p_mailfrom var MailSender = S("puo_fromaddress"); var MailReply = S("puo_replyaddress"); - if (p_mailfrom != "") + if (p_mailfrom) { if (S("puo_usesenderasreplyto")) { @@ -95,7 +95,7 @@ function sendMail( p_mailfrom if (p_body) { objMail.TextBody = p_body; - if (p_bodyhtml != "") + if (p_bodyhtml) { // Als attachment er bij var cdoBodyPart = objMail.BodyPart.AddBodyPart(-1); @@ -311,7 +311,7 @@ function sendMail( p_mailfrom var attFile = allFiles.item(); Log2File(1, "Adding attachment: " + attFile.Path + " (" + attFile.Size + " bytes)"); - if (params.attachPassword == "") + if (!params.attachPassword) { // doe maar gewoon var objAttachment = objMail.AddAttachment(attFile.Path, attFile.Name); objAttachment.ContentTransferEncoding = "base64"; @@ -410,7 +410,7 @@ function sendMail( p_mailfrom objMail.Fields.Update(); // // - if (p_mailto != "") + if (p_mailto) { try { diff --git a/UTILS/PutOrders/puo_sendsms.js b/UTILS/PutOrders/puo_sendsms.js index 8bacd952de..580fba6434 100644 --- a/UTILS/PutOrders/puo_sendsms.js +++ b/UTILS/PutOrders/puo_sendsms.js @@ -34,7 +34,7 @@ function sendSMS( p_telnr var body = ""; Log2File(1, "SMS bericht: '" + p_msgtxt + "' wordt via " + S("puo_smsprotocol") + " verzonden naar: " + p_telnr); - if (S("puo_forcemobile") != "") + if (S("puo_forcemobile")) { Log2File(1, "Mobile number " + p_telnr + " forced to effective " + S("puo_forcemobile")) p_telnr = S("puo_forcemobile");