Merge pull request #22606 from colemanw/relationshipPseudoFields
[civicrm-core.git] / CRM / SMS / Form / Schedule.php
index a3f0a76374ed09a969399b6b05ac5fadf2c96a48..00afbb84e8bb9b47cff112b29c84ea3c1cd271f4 100644 (file)
@@ -52,13 +52,15 @@ class CRM_SMS_Form_Schedule extends CRM_Core_Form {
     // on page refresh.
     $this->setAttribute('autocomplete', 'off');
 
-    $sendOptions = [
-      $this->createElement('radio', NULL, NULL, ts('Send immediately'), 'send_immediate', ['id' => 'send_immediate', 'style' => 'margin-bottom: 10px;']),
-      $this->createElement('radio', NULL, NULL, ts('Send at:'), 'send_later', ['id' => 'send_later']),
-    ];
-    $this->addGroup($sendOptions, 'send_option', '', '<br>');
+    $this->addRadio('send_option', '', [
+      'send_immediate' => ts('Send immediately'),
+      'send_later' => ts('Send at:'),
+    ], [], '<br>', FALSE, [
+      'send_immediate' => ['id' => 'send_immediate', 'style' => 'margin-bottom: 10px;'],
+      'send_later' => ['id' => 'send_later'],
+    ]);
 
-    $this->add('datepicker', 'start_date', '', NULL, FALSE, ['minDate' => time()]);
+    $this->add('datepicker', 'start_date', '', NULL, FALSE, ['minDate' => date('Y-m-d')]);
 
     $this->addFormRule(['CRM_SMS_Form_Schedule', 'formRule'], $this);
 
@@ -98,7 +100,7 @@ class CRM_SMS_Form_Schedule extends CRM_Core_Form {
    *   The form values.
    *
    * @param $files
-   * @param $self
+   * @param self $self
    *
    * @return bool
    *   True if either we deliver immediately, or the date is properly