FSN#38889 Beter omgaan met undefined parameter waarden

svn path=/Website/trunk/; revision=32198
This commit is contained in:
Jos Groot Lipman
2017-01-03 19:55:16 +00:00
parent fe6928c587
commit eb17d85472
4 changed files with 14 additions and 14 deletions

View File

@@ -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))

View File

@@ -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

View File

@@ -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
{

View File

@@ -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");