8
0

check for missing recipients

Dieser Commit ist enthalten in:
Daniel Seifert 2022-08-09 12:02:06 +02:00
Ursprung 1ac8b193e9
Commit 3c12bd79b5
Signiert von: DanielS
GPG-Schlüssel-ID: 8A7C4C6ED1915C6F
2 geänderte Dateien mit 10 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -67,6 +67,8 @@ class d3linkmobility_ordermanager_action extends d3ordermanager_action_abstract
return 'D3_ORDERMANAGER_ACTION_LINKMOBILITYMESSAGE_ERR_NOVALIDTPL';
} elseif ($this->hasRequiredValuesCmsSource(false)) {
return 'D3_ORDERMANAGER_ACTION_LINKMOBILITYMESSAGE_ERR_NOVALIDCMS';
} elseif ($this->hasRequiredValuesRecipient(false)) {
return 'D3_ORDERMANAGER_ACTION_LINKMOBILITYMESSAGE_ERR_NORECIPIENT';
} else {
return 'D3_ORDERMANAGER_ACTION_LINKMOBILITYMESSAGE_ERR_UNDEFINED';
}
@ -132,7 +134,7 @@ class d3linkmobility_ordermanager_action extends d3ordermanager_action_abstract
(
$this->hasRequiredValuesTplSource(true) ||
$this->hasRequiredValuesCmsSource(true)
) && $this->hasRequiredValuesRecipient();
) && $this->hasRequiredValuesRecipient(true);
}
/**
@ -204,16 +206,17 @@ class d3linkmobility_ordermanager_action extends d3ordermanager_action_abstract
/**
* @return bool
*/
protected function hasRequiredValuesRecipient(): bool
protected function hasRequiredValuesRecipient(bool $blExpected): bool
{
$toCust = (bool) $this->getManager()->getValue('blLinkMobilityMessageToCustomer');
$toCustom = (bool) $this->getManager()->getValue('blLinkMobilityMessageToCustom');
$toCustomAddress = (string) $this->getManager()->getValue('sLinkMobilityMessageToCustomAddress');
return $toCust || (
$toCustom &&
(bool) strlen(trim($toCustomAddress))
);
if ($blExpected === true) {
return $toCust || ( $toCustom && (bool) strlen( trim( $toCustomAddress ) ) === true );
} else {
return !($toCust || ( $toCustom && (bool) strlen( trim( $toCustomAddress ) ) === true ));
}
}
/**

Datei anzeigen

@ -47,6 +47,7 @@ $aLang = [
'D3_ORDERMANAGER_ACTION_LINKMOBILITYMESSAGE_ERR_NOVALIDSOURCE' => 'keine gültige Inhaltsquelle gesetzt',
'D3_ORDERMANAGER_ACTION_LINKMOBILITYMESSAGE_ERR_NOVALIDTPL' => 'keine gültigen Templatedaten gesetzt',
'D3_ORDERMANAGER_ACTION_LINKMOBILITYMESSAGE_ERR_NOVALIDCMS' => 'kein gültiger CMS-Eintrag gesetzt',
'D3_ORDERMANAGER_ACTION_LINKMOBILITYMESSAGE_ERR_NORECIPIENT' => 'kein gültiger Empfänger gesetzt',
'D3_ORDERMANAGER_ACTION_LINKMOBILITYMESSAGE_ERR_UNDEFINED' => 'unbekannter Fehler',
'D3_ORDERMANAGER_JOBDESC_SENDLMMESSAGE' => 'sende SMS via LinkMobility an %s',