check for missing recipients

Cette révision appartient à :
Daniel Seifert 2022-08-09 12:02:06 +02:00
Parent 1ac8b193e9
révision 3c12bd79b5
Signé par: DanielS
ID de la clé GPG: 8A7C4C6ED1915C6F
2 fichiers modifiés avec 10 ajouts et 6 suppressions

Voir le fichier

@ -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 ));
}
}
/**

Voir le fichier

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