コード例 #1
0
 function send_action_process($id)
 {
     $dummy = "";
     // Added by Rod to avoid run-time warnings
     if ($_POST['process'] != "true") {
         return;
     }
     if (empty($id)) {
         $this->function_argument_error();
     }
     $p = new Prescription($id);
     switch ($_POST['submit']) {
         case xl("Print") . " (" . xl("PDF") . ")":
             // The following statement added by Rod.
             // Looking at Controller.class.php, it appears that _state is set to false
             // to indicate that no further HTML is to be generated.
             $this->_state = false;
             // Added by Rod - see Controller.class.php
             return $this->_print_prescription($p, $dummy);
             break;
         case xl("Print") . " (" . xl("HTML") . ")":
             $this->_state = false;
             return $this->_print_prescription_css($p, $dummy);
             break;
         case xl("Print To Fax"):
             $this->_state = false;
             $this->is_print_to_fax = true;
             return $this->_print_prescription($p, $dummy);
             break;
         case xl("Email"):
             return $this->_email_prescription($p, $_POST['email_to']);
             break;
         case xl("Fax"):
             //this is intended to be the hook for the hylafax code we already have that hasn't worked its way into the tree yet.
             //$this->assign("process_result","No fax server is currently setup.");
             return $this->_fax_prescription($p, $_POST['fax_to']);
             break;
         case xl("Auto Send"):
             $pharmacy_id = $_POST['pharmacy_id'];
             //echo "auto sending to : " . $_POST['pharmacy_id'];
             $phar = new Pharmacy($_POST['pharmacy_id']);
             //print_r($phar);
             if ($phar->get_transmit_method() == TRANSMIT_PRINT) {
                 return $this->_print_prescription($p, $dummy);
             } elseif ($phar->get_transmit_method() == TRANSMIT_EMAIL) {
                 $email = $phar->get_email();
                 if (!empty($email)) {
                     return $this->_email_prescription($p, $phar->get_email());
                 }
                 //else print it
             } elseif ($phar->get_transmit_method() == TRANSMIT_FAX) {
                 $faxNum = $phar->get_fax();
                 if (!empty($faxNum)) {
                     return $this->_fax_prescription($p, $faxNum);
                 }
                 // return $this->assign("process_result","No fax server is currently setup.");
                 // else default is printing,
             } else {
                 //the pharmacy has no default or default is print
                 return $this->_print_prescription($p, $dummy);
             }
             break;
     }
     return;
 }