OpenEyes is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenEyes is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenEyes in a file titled COPYING. If not, see .
Author: OpenEyes (info@openeyes.org.uk)
Inheritance: extends BaseActiveRecordVersioned
コード例 #1
0
ファイル: AdminController.php プロジェクト: openeyes/openeyes
 public function actionDeleteEmailRecipients()
 {
     $result = 1;
     foreach (OphCoTherapyapplication_Email_Recipient::model()->findAllByPK($_POST['email_recipients']) as $email_recipient) {
         if (!$email_recipient->delete()) {
             $result = 0;
         }
     }
     echo $result;
 }
コード例 #2
0
 private function getEmailRecipients($service_info, $recipient_type)
 {
     if (!($recipients = OphCoTherapyapplication_Email_Recipient::model()->with('type')->findAll('site_id = ? and type.id is null or type.name = ?', array($service_info->site_id, $recipient_type)))) {
         if (!($recipients = OphCoTherapyapplication_Email_Recipient::model()->with('type')->findAll('site_id is null and type.id is null or type.name = ?', array($recipient_type)))) {
             throw new Exception('No email recipient defined for site ' . $service_info->site->name . ", {$recipient_type}");
         }
     }
     return $recipients;
 }