src/Command/StoreMannedToEwsAlertCommand.php line 217

Open in your IDE?
  1. <?php
  2. namespace App\Command;
  3. use App\Model\UserModel;
  4. use DateTime;
  5. use Pimcore\Db;
  6. use GuzzleHttp\Client;
  7. use Pimcore\Log\Simple;
  8. use App\Service\RedisCache;
  9. use App\Model\LocationModel;
  10. use GuzzleHttp\Psr7\Request;
  11. use App\Service\EmailService;
  12. use Pimcore\Model\DataObject;
  13. use App\Model\EwsNotificationModel;
  14. use App\Service\NCMWeatherAPIService;
  15. use App\Service\MeteomaticsWeatherService;
  16. use Symfony\Component\Console\Command\Command;
  17. use Symfony\Component\Templating\EngineInterface;
  18. use Symfony\Component\Console\Input\InputArgument;
  19. use Symfony\Component\Console\Input\InputInterface;
  20. use Symfony\Component\Console\Output\OutputInterface;
  21. use App\C2IntegrationBundle\Service\C2Service;
  22. use App\Service\RichService;
  23. use Symfony\Contracts\HttpClient\HttpClientInterface;
  24. use Pimcore\Model\DataObject\FetchSentEwsEmail;
  25. use Symfony\Contracts\Translation\TranslatorInterface;
  26. use Pimcore\Log\ApplicationLogger;
  27. use Pimcore\Model\DataObject\Customer;
  28. class StoreMannedToEwsAlertCommand extends Command
  29. {
  30.     protected static $defaultName 'app:get-manned-in-ews-alerts';
  31.     private EmailService $emailService;
  32.     private EngineInterface $templating;
  33.     private NCMWeatherAPIService $ncmWeatherAPIService;
  34.     private RedisCache $redisCache;
  35.     private LocationModel $locationModel;
  36.     private EwsNotificationModel $ewsNotificationModel;
  37.     private $userModel;
  38.     private C2Service $c2Service;
  39.     private RichService $richService;
  40.     private HttpClientInterface $httpClient;
  41.     private TranslatorInterface $translator;
  42.     private ApplicationLogger $logger;
  43.     public function __construct(
  44.         EngineInterface $templating,
  45.         RedisCache $redisCache,
  46.         RichService $richService,
  47.         HttpClientInterface $httpClient,
  48.         TranslatorInterface $translator,
  49.         ApplicationLogger $logger
  50.     ) {
  51.         parent::__construct();
  52.         $this->templating $templating;
  53.         $this->redisCache $redisCache;
  54.         $this->richService $richService;
  55.         $this->httpClient $httpClient;
  56.         $this->translator $translator;
  57.         $this->logger $logger;
  58.         $this->ncmWeatherAPIService = new NCMWeatherAPIService($redisCache$httpClient);
  59.         $this->locationModel = new LocationModel();
  60.         $this->ewsNotificationModel = new EwsNotificationModel();
  61.         $this->userModel = new UserModel();
  62.         $this->c2Service = new C2Service();
  63.         $this->emailService = new EmailService();
  64.     }
  65.     protected function configure(): void
  66.     {
  67.         $this->setDescription('Retrieve manned alerts by location and store in EwsNotification object');
  68.     }
  69.     protected function execute(InputInterface $inputOutputInterface $output): int
  70.     {
  71.         $alerts $this->ncmWeatherAPIService->getAlerts();
  72.         if (!$alerts) {
  73.             $output->writeln('No alerts found.');
  74.             return Command::SUCCESS;
  75.         }
  76.         foreach ($alerts as $alert) {
  77.             try {
  78.                 $ewsAlert $this->createOrUpdateAlertNotification($alert);
  79.                 if (!$ewsAlert) {
  80.                     $output->writeln('Nothing updated on notification = ' $alert['id']);
  81.                     continue;
  82.                 }
  83.                 if ($_ENV['SEND_EMAIL_NOTIFICATION'] === "false") {
  84.                     $output->writeln('Email notifications are disabled in this environment.');
  85.                     continue;
  86.                 }
  87.                 if (!$ewsAlert->getIsSent()) {
  88.                     $this->processSubscriptionsForAlert($alert$ewsAlert$output);
  89.                 }
  90.                 $ewsAlert->setIsSent(true);
  91.                 $ewsAlert->save();
  92.             } catch (\Exception $ex) {
  93.                 $output->writeln('Error processing alert ID ' $alert['id'] . ': ' $ex->getMessage());
  94.                 $this->logger->error($ex->getMessage());
  95.             }
  96.         }
  97.         return Command::SUCCESS;
  98.     }
  99.     private function processSubscriptionsForAlert(array $alertDataObject\EwsNotification $ewsAlertOutputInterface $output): void
  100.     {
  101.         $subscriptions = new DataObject\MannedAlertSubscription\Listing();
  102.         $subscriptions->setOrderKey('o_creationDate');
  103.         $subscriptions->setOrder('desc');
  104.         foreach ($subscriptions as $subscription) {
  105.             if ($subscription->getIsPublic() === true) {
  106.                 continue; // skip public subscriptions
  107.             }
  108.             if (!$this->subscriptionMatchesAlert($subscription$alert)) {
  109.                 continue;
  110.             }
  111.             // Send notifications based on subscription settings
  112.             if ($subscription->getNotifyEmail()) {
  113.                 $users $this->getUsersFromSubscription($subscription);
  114.                 foreach ($users as $user) {
  115.                     if ($user instanceof \Pimcore\Model\DataObject\Customer && $user->getSevereWeatherAlert()) {
  116.                         $this->sendEmailNotification($user$alertnulltrue$ewsAlert);
  117.                     }
  118.                 }
  119.             }
  120.             // SMS Notifications
  121.             if ($subscription->getNotifySms()) {
  122.                 $users $this->getUsersFromSubscription($subscription);
  123.                 foreach ($users as $user) {
  124.                     if ($user instanceof \Pimcore\Model\DataObject\Customer && $user->getSevereWeatherAlert()) {
  125.                         $this->sendAlertSMS($ewsAlert$alert$user);
  126.                     }
  127.                 }
  128.             }
  129.         }
  130.     }
  131.     private function subscriptionMatchesAlert(DataObject\MannedAlertSubscription $subscription, array $alert): bool
  132.     {
  133.         // Region check
  134.         $regionMatch false;
  135.         if ($region $subscription->getRegion()) {
  136.             $regionMatch = ($region->getRegionId() == $alert['regionID']);
  137.         }
  138.         // Alert type check
  139.         $alertTypeMatch false;
  140.         if ($alertTypes $subscription->getAlertType()) {
  141.             foreach ($alertTypes as $alertType) {
  142.                 if ($alertType->getAlertTypeId() == $alert['alertType']) {
  143.                     $alertTypeMatch true;
  144.                     break;
  145.                 }
  146.             }
  147.         }
  148.         // Governorate check
  149.         $governorateMatch false;
  150.         $alertGovernorateIds array_column($alert['governorates'], 'id');
  151.         if ($governorates $subscription->getGovernorate()) {
  152.             foreach ($governorates as $governorate) {
  153.                 if (in_array($governorate->getGovernoteId(), $alertGovernorateIds)) {
  154.                     $governorateMatch true;
  155.                     break;
  156.                 }
  157.             }
  158.         }
  159.         // Alert status check (phenomena)
  160.         $phenomenaMatch false;
  161.         if ($alertStatuses $subscription->getAlertStatus()) {
  162.             foreach ($alertStatuses as $status) {
  163.                 if ($status->getAlertStatusId() == $alert['alertStatusID']) {
  164.                     $phenomenaMatch true;
  165.                     break;
  166.                 }
  167.             }
  168.         }
  169.         return $regionMatch && $alertTypeMatch && $governorateMatch && $phenomenaMatch;
  170.     }
  171.     private function getUsersFromSubscription(DataObject\MannedAlertSubscription $subscription): array
  172.     {
  173.         $owner $subscription->getCreator();
  174.         $subscribers $subscription->getSubscribers();
  175.         $users = [];
  176.         if ($owner) {
  177.             $users[] = $owner;
  178.         }
  179.         if (is_array($subscribers) || $subscribers instanceof \Traversable) {
  180.             foreach ($subscribers as $subscriber) {
  181.                 $users[] = $subscriber;
  182.             }
  183.         }
  184.         return $users;
  185.     }
  186.     private function sendEmailNotification($user, array $alert, ?string $email nullbool $actualUser falseDataObject\EwsNotification $alertObject): ?bool
  187.     {
  188.         if (!$alert) {
  189.             return null;
  190.         }
  191.         $governorates array_map(fn($g) => $g['nameEn'], $alert['governorates'] ?? []);
  192.         $alertHazardsEn = [];
  193.         $alertHazardsAr = [];
  194.         foreach ($alert['alertHazards'] ?? [] as $hazard) {
  195.             $alertHazardsEn[] = $hazard['descriptionEn'];
  196.             $alertHazardsAr[] = ['nameAr' => $hazard['descriptionAr']];
  197.         }
  198.         $alertActions array_map(fn($action) => $action['descriptionEn'], $alert['alertActions'] ?? []);
  199.         //$subject = $alert['alertStatusAr'] . ' - ' . $alert['regionAR'];
  200.         $subject 'الإنذار - ' . ($alert['regionAR'] ?? '') . ' - ' . ($alert['id'] ?? '');
  201.         $data $alert;
  202.         $data['sender'] = 'National Center for Meteorology';
  203.         if ($user) {
  204.             $entityUserSubscriptionMain $this->userModel->getEntitySubscription($user);
  205.             $packageExpiredMain $entityUserSubscriptionMain ? (new \DateTime() > $entityUserSubscriptionMain->getEndDate() ? true false) : false;
  206.             $subActiveMain $entityUserSubscriptionMain $entityUserSubscriptionMain->getIsActive() : false;
  207.             $subUserMain $subActiveMain && !$packageExpiredMain;
  208.             if ($subUserMain) {
  209.                 $data['name'] = $email ?? $user->getName();
  210.                 $alertTypeObj \Pimcore\Model\DataObject\AlertType::getByAlertTypeId($alert['alertType'], true);
  211.                 $alertColor $alertTypeObj $alertTypeObj->getColor() : '';
  212.                 $alert['user_name'] = $email ?? $user->getName();
  213.                 $alert['host'] = API_BASE_URL;
  214.                 $alert['alertColor'] = $alertColor;
  215.                 $currentDate = new DateTime($alert['fromDate']);
  216.                 $alert['searchEwsIdAr'] = 'النظام Ø§Ù„الي Ù„لإنذار Ø§Ù„مبكر | ' $currentDate->format('dmY') . '-' $alert['id'] . ' | ' $alert['alertTypeAr'] . ' | ' $alert['alertStatusAr'];
  217.                 $alert['alertHazard'] = $alertHazardsAr;
  218.                 $alert['last_modified_date'] = $alert['lastModified'];
  219.                 if ($actualUser) {
  220.                     $token \App\Lib\Utility::getUnSubscribeToken($user->getId());
  221.                     $alert['tokenURL'] = BASE_URL '/unsubscribe/email?token=' $token;
  222.                 } else {
  223.                     $alert['tokenURL'] = null;
  224.                 }
  225.                 $alert['mannedAlertDatailUrl'] = "https://ncm.gov.sa/Ar/alert/Pages/MapDetail.aspx?AlertId=" $alert['id'];
  226.                 $html $this->templating->render('web2print/_manned_alert_notification_ar.html.twig'$alert);
  227.                 $mannedAlert \Pimcore\Model\DataObject\EwsNotification::getByAlertId($alert['id'], true);
  228.                 $purpose MANNED_ALERT_MESSAGE;
  229.                 if ($email) {
  230.                     $mailSent $this->c2Service->sendDefaultEmail($_ENV['EWS_MAIL_TEMPLATE'], $mannedAlert->getId(), $email$html$subject$purpose);
  231.                 } else {
  232.                     $mailSent $this->c2Service->sendNotificationEmail($_ENV['EWS_MAIL_TEMPLATE'], $mannedAlert->getId(), $user->getId(), $html$subject$purpose);
  233.                 }
  234.             }
  235.             return $mailSent ?? null;
  236.         }
  237.         return null;
  238.     }
  239.     // Send SMS alert
  240.     private function sendAlertSMS(DataObject\EwsNotification $alertObject, array $alertCustomer $user): void
  241.     {
  242.         $entityUserSubscriptionMain $this->userModel->getEntitySubscription($user);
  243.         $packageExpiredMain $entityUserSubscriptionMain ? (new \DateTime() > $entityUserSubscriptionMain->getEndDate() ? true false) : false;
  244.         $subActiveMain $entityUserSubscriptionMain $entityUserSubscriptionMain->getIsActive() : false;
  245.         $subUserMain $subActiveMain && !$packageExpiredMain;
  246.         if ($subUserMain) {
  247.             if ($alertObject->getEnableSmsNotification() && $user->getPhoneNo() && strlen($user->getPhoneNo()) === && $user->getEmail() == 'ismat.waseem@centricdxb.com') {
  248.                 $smsTemplate \Pimcore\Model\WebsiteSetting::getByName('MANNED_ALERT'null);
  249.                 if ($smsTemplate?->getData()) {
  250.                     $purpose MANNED_ALERT_MESSAGE;
  251.                     $alertTypeObj \Pimcore\Model\DataObject\AlertType::getByAlertTypeId($alert['alertType'], true);
  252.                     $alertColor $alertTypeObj $alertTypeObj->getColor() : '';
  253.                     $messageSMS sprintf(SMS_MESSAGE["MANNED_ALERT"], strtoupper($alertColor) . " alert raised in " $alert['regionAR'] . ' for ' $alert['alertStatusAr'] . " event");
  254.                     try {
  255.                         $responseSMS $this->richService->sendMannedAlertNotificationSMS($alertObject$user$purpose$messageSMS);
  256.                         if (!$responseSMS) {
  257.                             $this->logger->error('Failed to send SMS to ' SAUDI_CALL_CODE $user->getPhoneNo());
  258.                         }
  259.                         p_r("sms sent");
  260.                     } catch (\Exception $e) {
  261.                         $this->logger->error('Exception while sending SMS: ' $e->getMessage());
  262.                     }
  263.                 }
  264.             }
  265.         }
  266.     }
  267.     private function createOrUpdateAlertNotification(array $alert): ?DataObject\EwsNotification
  268.     {
  269.         // Generate the hash for the current alert data
  270.         $alertHash md5(json_encode($alert));
  271.         // Retrieve the existing EwsNotification object by alert ID
  272.         $ewsNotification \Pimcore\Model\DataObject\EwsNotification::getByAlertId($alert['id'], true);
  273.         // Check if the ews alert already exists
  274.         if ($ewsNotification && $ewsNotification->getHash() === $alertHash) {
  275.             return null// No changes detected
  276.         }
  277.         if (!$ewsNotification) {
  278.             $ewsNotification = new DataObject\EwsNotification();
  279.             $ewsNotification->setKey($alert['id']);
  280.             $date date('Y-m-d'strtotime($alert['fromDate']));
  281.             $ewsNotification->setParent(\Pimcore\Model\DataObject\Service::createFolderByPath('/MannedAlert/Master/EWSNotification/' $date));
  282.             $ewsNotification->setGuid(\App\Lib\Utility::getUUID()->toRfc4122());
  283.         }
  284.         $ewsNotification->setIsManned(true);
  285.         $ewsNotification->setAlertId($alert['id']);
  286.         $ewsNotification->setTitle($alert['title']);
  287.         $ewsNotification->setAlertType($this->getAlertType($alert['alertType'], $alert['alertTypeAr'], $alert['alertTypeEn']));
  288.         $fromDate \Carbon\Carbon::createFromFormat('m/d/Y h:i:s A'$alert['fromDate']);
  289.         $toDate \Carbon\Carbon::createFromFormat('m/d/Y h:i:s A'$alert['toDate']);
  290.         $lastModified \Carbon\Carbon::createFromFormat('m/d/Y h:i:s A'$alert['lastModified']);
  291.         $ewsNotification->setStartDate($fromDate);
  292.         $ewsNotification->setEndDate($toDate);
  293.         $ewsNotification->setLastModifiedDate($lastModified);
  294.         $ewsNotification->setAlertStatusCategory($this->getAlertStatusCategory($alert['alertStatusCategory'])); // need  to fix
  295.         $ewsNotification->setStatus("active");
  296.         if ($alertStatus $this->getAlertStatus($alert['alertStatusID'], $alert['alertStatusAr'], $alert['alertStatusEn'])) {
  297.             $ewsNotification->setAlertStatus($alertStatus);
  298.         }
  299.         $alertHazards = [];
  300.         foreach ($alert['alertHazards'] ?? [] as $hazard) {
  301.             $alertHazards[] = $this->getAlertHazard($hazard['id'], $hazard['descriptionAr'], $hazard['descriptionEn']);
  302.         }
  303.         $ewsNotification->setAlertHazard(array_filter($alertHazards));
  304.         $ewsNotification->setRegion($this->getRegion($alert['regionID'], $alert['regionAR'], $alert['regionEn']));
  305.         $governorates = [];
  306.         foreach ($alert['governorates'] ?? [] as $gov) {
  307.             $governorates[] = $this->getGovernorates($gov['id'], $gov['nameAr'], $gov['nameEn'], $gov['longitude'], $gov['latitude']);
  308.         }
  309.         $ewsNotification->setGovernorate(array_filter($governorates));
  310.         $ewsNotification->setOtherLocation($alert['otherLocationsEn'], 'en');
  311.         $ewsNotification->setOtherLocation($alert['otherLocationsAr'], 'ar');
  312.         if (!empty($alert['otherLocationsAr'])) {
  313.             $otherLocation \Pimcore\Model\DataObject\EwsOtherLocation::getByName($alert['otherLocationsAr'], 'en'true);
  314.             $ewsNotification->setEwsOtherLocations($otherLocation);
  315.         }
  316.         $ewsNotification->setTweetID($alert['tweetID'] ?? null);
  317.         $alertActions = [];
  318.         foreach ($alert['alertActions'] ?? [] as $action) {
  319.             $alertActions[] = $this->getAlertAction($action['id'], $action['descriptionAr'], $action['descriptionEn']);
  320.         }
  321.         $ewsNotification->setAlertAction(array_filter($alertActions));
  322.         $ewsNotification->setHash($alertHash);
  323.         $ewsNotification->setRawText(json_encode($alert));
  324.         $ewsNotification->setIsSent(false);
  325.         $ewsNotification->setOmitMandatoryCheck(true);
  326.         $ewsNotification->save();
  327.         $currentDate = new DateTime();
  328.         $formattedDate $currentDate->format('dmY') . '-' $ewsNotification->getId();
  329.         $searchIdEn 'Early Warning System | ' $formattedDate ' | ' ucfirst($ewsNotification->getAlertType()?->getColor()) . ' Alert | ' $ewsNotification->getAlertStatus()?->getName("en");
  330.         $searchIdAr $this->translator->trans('Early Warning System', [], null"ar") . ' | ' $formattedDate ' | ' $this->translator->trans(ucfirst($ewsNotification->getAlertType()?->getColor()) . ' Alert', [], null"ar") . ' | ' $ewsNotification->getAlertStatus()?->getName("ar");
  331.         $ewsNotification->setEwsSearchId($searchIdEn'en');
  332.         $ewsNotification->setEwsSearchId($searchIdAr'ar');
  333.         $ewsNotification->setPublished(true);
  334.         $ewsNotification->save();
  335.         return $ewsNotification;
  336.     }
  337.     private function getAlertType($id$nameAr$nameEn): DataObject\AlertType
  338.     {
  339.         $alertType \Pimcore\Model\DataObject\AlertType::getByAlertTypeId($idtrue);
  340.         if (!$alertType) {
  341.             $alertType = new \Pimcore\Model\DataObject\AlertType();
  342.             $alertType->setKey($id);
  343.             $alertType->setParent(\Pimcore\Model\DataObject\Service::createFolderByPath('/MannedAlert/Master/AlertType'));
  344.             $alertType->setAlertTypeId($id);
  345.             $alertType->setName($nameAr'ar');
  346.             $alertType->setName($nameEn'en');
  347.             $alertType->setPublished(true);
  348.             $alertType->save();
  349.         }
  350.         return $alertType;
  351.     }
  352.     private function getAlertStatusCategory(string $name): DataObject\AlertStatusCategory
  353.     {
  354.         $category \Pimcore\Model\DataObject\AlertStatusCategory::getByName($nametrue);
  355.         if (!$category) {
  356.             $category = new \Pimcore\Model\DataObject\AlertStatusCategory();
  357.             $category->setParent(\Pimcore\Model\DataObject\Service::createFolderByPath('/MannedAlert/Master/AlertStatusCategory'));
  358.             $category->setKey($name);
  359.             $category->setName($name);
  360.             $category->setPublished(true);
  361.             $category->save();
  362.         }
  363.         return $category;
  364.     }
  365.     private function getAlertStatus($id$nameAr$nameEn): ?DataObject\AlertStatus
  366.     {
  367.         $status \Pimcore\Model\DataObject\AlertStatus::getByAlertStatusId($idtrue);
  368.         if (!$status) {
  369.             $status = new \Pimcore\Model\DataObject\AlertStatus();
  370.             $status->setKey($id);
  371.             $status->setParent(\Pimcore\Model\DataObject\Service::createFolderByPath('/MannedAlert/Master/AlertStatus'));
  372.             $status->setAlertStatusId($id);
  373.             $status->setName($nameAr'ar');
  374.             $status->setName($nameEn'en');
  375.             $status->setPublished(true);
  376.             $status->save();
  377.         }
  378.         return $status;
  379.     }
  380.     private function getAlertHazard($id$descriptionAr$descriptionEn): DataObject\AlertHazard
  381.     {
  382.         $hazard \Pimcore\Model\DataObject\AlertHazard::getByAlertHazardId($idtrue);
  383.         if (!$hazard) {
  384.             $hazard = new \Pimcore\Model\DataObject\AlertHazard();
  385.             $hazard->setKey($id);
  386.             $hazard->setParent(\Pimcore\Model\DataObject\Service::createFolderByPath('/MannedAlert/Master/AlertHazard'));
  387.             $hazard->setAlertHazardId($id);
  388.             $hazard->setName($descriptionAr'ar');
  389.             $hazard->setName($descriptionEn'en');
  390.             $hazard->setPublished(true);
  391.             $hazard->save();
  392.         } else {
  393.             $hazard->setName($descriptionAr'ar');
  394.             $hazard->setName($descriptionEn'en');
  395.             $hazard->save();
  396.         }
  397.         return $hazard;
  398.     }
  399.     private function getRegion($id$nameAr$nameEn): DataObject\Region
  400.     {
  401.         $region \Pimcore\Model\DataObject\Region::getByRegionId($idtrue);
  402.         if (!$region) {
  403.             $region = new \Pimcore\Model\DataObject\Region();
  404.             $region->setKey($id);
  405.             $region->setParent(\Pimcore\Model\DataObject\Service::createFolderByPath('/MannedAlert/Master/Region'));
  406.             $region->setRegionId($id);
  407.             $region->setName($nameAr'ar');
  408.             $region->setName($nameEn'en');
  409.             $region->setPublished(true);
  410.             $region->save();
  411.         }
  412.         return $region;
  413.     }
  414.     private function getGovernorates($id$nameAr$nameEn$longitude$latitude): DataObject\Governorate
  415.     {
  416.         $governorate \Pimcore\Model\DataObject\Governorate::getByGovernoteId($idtrue);
  417.         if (!$governorate) {
  418.             $governorate = new \Pimcore\Model\DataObject\Governorate();
  419.             $governorate->setKey($id);
  420.             $governorate->setParent(\Pimcore\Model\DataObject\Service::createFolderByPath('/MannedAlert/Master/Governorate'));
  421.             $governorate->setGovernoteId($id);
  422.             $governorate->setName($nameAr'ar');
  423.             $governorate->setName($nameEn'en');
  424.             $governorate->setLongitude($longitude);
  425.             $governorate->setLatitude($latitude);
  426.             $governorate->setPublished(true);
  427.             $governorate->save();
  428.         }
  429.         return $governorate;
  430.     }
  431.     private function getAlertAction($id$descriptionAr$descriptionEn): DataObject\AlertAction
  432.     {
  433.         $alertAction \Pimcore\Model\DataObject\AlertAction::getByAlertActionId($idtrue);
  434.         if (!$alertAction) {
  435.             $alertAction = new \Pimcore\Model\DataObject\AlertAction();
  436.             $alertAction->setKey($id);
  437.             $alertAction->setParent(\Pimcore\Model\DataObject\Service::createFolderByPath('/MannedAlert/Master/AlertAction'));
  438.             $alertAction->setAlertActionId($id);
  439.             $alertAction->setName($descriptionAr'ar');
  440.             $alertAction->setName($descriptionEn'en');
  441.             $alertAction->setPublished(true);
  442.             $alertAction->save();
  443.         }
  444.         return $alertAction;
  445.     }
  446. }