public function getList()
 {
     $addCreditRequests = Messaging::getSystemMessages(array('systemMessageType' => SYS_MSG_ADD_CREDIT, 'filterCustomerId' => array($this->customer->getId())));
     //        $this->log->write(print_r($addCreditRequests, true));
     foreach ($addCreditRequests as $addCreditRequest) {
         //            if ($addCreditRequest['senderId'] != $this->customer->getId())
         //                continue;
         $this->data['requests'][] = array('requestId' => $addCreditRequest['messageId'], 'amount' => $addCreditRequest['data']->amount, 'comment' => $addCreditRequest['data']->comment, 'currency' => $addCreditRequest['data']->currency, 'status' => Status::getStatus($addCreditRequest['data']->status, $this->config->get('language_id'), true), 'statusId' => $addCreditRequest['data']->status, 'timeAdded' => $addCreditRequest['timeAdded']);
     }
     /// Initialize interface
     $this->setBreadcrumps();
     $this->data['textAmount'] = $this->language->get('AMOUNT');
     $this->data['textComment'] = $this->language->get('COMMENT');
     $this->data['textRequestId'] = $this->language->get('REQUEST_ID');
     $this->data['textStatus'] = $this->language->get('STATUS');
     $this->data['textTimeAdded'] = $this->language->get('TIME_ADDED');
     $templateName = '/template/account/creditHistory.tpl';
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . $templateName)) {
         $this->template = $this->config->get('config_template') . $templateName;
     } else {
         $this->template = 'default' . $templateName;
     }
     $this->children = array('common/footer', 'common/header', 'common/column_right', 'common/column_left', 'common/content_top', 'common/content_bottom');
     $this->getResponse()->setOutput($this->render());
 }
 public function handleUpdate($messageId)
 {
     //        AddCreditRequest::$instance->log->write('Starting');
     $request = Messaging::getSystemMessage($messageId);
     //        AddCreditRequest::$instance->log->write(print_r($request, true));
     if ($request['data']->status == ADD_CREDIT_STATUS_ACCEPTED) {
         $this->load->library("Transaction");
         Transaction::addCredit($request['senderId'], $request['data']->amount, $request['data']->currency, $this->registry, $request['data']->comment);
     }
 }
Beispiel #3
0
 public function create()
 {
     if ($this->validateInput()) {
         $this->load->library("Messaging");
         Messaging::submitSystemMessage($this->customer->getId(), 0, SYS_MSG_ADD_CREDIT, array('amount' => $this->request->request['amount'], 'currency' => $this->request->request['currency'], 'comment' => $this->request->request['comment'], 'status' => ADD_CREDIT_STATUS_PENDING));
         $this->session->data['notifications']['success'] = $this->language->get('SUCCESS_ADD_CREDIT_REQUEST_SENT');
         $this->redirect($this->url->link('account/account', '', 'SSL'));
     } else {
         $this->index();
     }
 }
Beispiel #4
0
 private function getCreditRequests($customer)
 {
     $this->getLoader()->library('Messaging');
     $this->getLoader()->library('Status');
     $addCreditRequests = Messaging::getSystemMessages(array('systemMessageType' => SYS_MSG_ADD_CREDIT, 'filterCustomerId' => array($customer['customer_id']), 'start' => ($this->parameters['creditRequestsPage'] - 1) * 10, 'limit' => 10));
     //        $this->log->write(print_r($addCreditRequests, true));
     foreach ($addCreditRequests as $addCreditRequest) {
         $this->data['requests'][] = array('requestId' => $addCreditRequest['messageId'], 'amount' => $addCreditRequest['data']->amount, 'comment' => $addCreditRequest['data']->comment, 'currency' => $addCreditRequest['data']->currency, 'status' => Status::getStatus($addCreditRequest['data']->status, $this->config->get('language_id'), true), 'statusId' => $addCreditRequest['data']->status, 'timeAdded' => $addCreditRequest['timeAdded']);
     }
     /// Initialize interface
     $this->data['textAmount'] = $this->language->get('AMOUNT');
     $this->data['textComment'] = $this->language->get('COMMENT');
     $this->data['textRequestId'] = $this->language->get('REQUEST_ID');
     $this->data['textStatus'] = $this->language->get('STATUS');
     $this->data['textTimeAdded'] = $this->language->get('TIME_ADDED');
     $pagination = new Pagination();
     $pagination->total = Messaging::getSystemMessagesCount(SYS_MSG_ADD_CREDIT, $customer['customer_id']);
     $pagination->page = $this->parameters['creditRequestsPage'];
     $pagination->limit = 10;
     $pagination->text = $this->language->get('text_pagination');
     $pagination->url = $this->url->link('sale/customer/transaction', 'creditRequestsPage={page}&transactionsPage=' . $this->parameters['transactionsPage'] . '&token=' . $this->parameters['token'] . '&customerId=' . $this->parameters['customerId'], 'SSL');
     $this->data['creditRequestsPagination'] = $pagination->render();
 }
 public function getPersonId()
 {
     $personId = (int) $this->medication->personId;
     if (!$personId > 0) {
         $messaging = new Messaging();
         $messaging->messagingId = $this->messageId;
         $messaging->populate();
         $personId = (int) $messaging->personId;
     }
     return $personId;
 }
<h1>Core module configuration</h1>
<?php 
if (Messaging::has_messages()) {
    Messaging::display_messages();
} else {
    Messaging::display_messages('successes');
    Messaging::display_messages('warnings');
}
?>
<p><strong>You must create an initial user. This user will be given the administrator role. Users with administrator role can access any areas that are enabled for the role. By default, the user module is configured so that only administrators can add users. This configuration option can be changed later</strong></p>
<form method="post" action="<?php 
echo PathMap::build_path('fabriqinstall', 'install', 4);
?>
">
	<div style="padding: 2px;">
		<label for="display">Display name: </label>
		<input type="text" name="display" id="display" size="24" maxlength="24" /><br />
		<span style="font-size: 8pt;">Display names may only contain charcters, number, and the underscore character between 6 and 24 characters long.</span>
		
	</div>
	<div style="padding: 2px;">
		<label for="email">e-mail address: </label>
		<input type="text" name="email" id="email" size="50" maxlength="100" /><br />
		<span style="font-size: 8pt;">Must be a valid e-mail address. This e-mail address will be used when necessary to contact the user.</span>
		
	</div>
	<div style="padding: 2px;">
		<label for="pwd">Password: </label>
		<input type="password" name="pwd" id="pwd" size="24" /><br />
		<span style="font-size: 8pt;">Passwords must be at least 8 characters long. The user will be forced to change their password after their first log in.</span>
	</div>
Beispiel #7
0
<?php

$check = Post::GCheck(array("user"));
if ($check) {
    $time = Messaging::GetNewMsg($_GET['user']);
    echo $time->c;
}
Beispiel #8
0
 /**
  * @param  \SimpleXMLElement $xml
  * @return At247
  */
 public static function createFromXML(\SimpleXMLElement $xml)
 {
     $at247 = new At247();
     if (isset($xml->{'at24-7'}->product) && $xml->{'at24-7'}->product != '') {
         $at247->setProduct((string) $xml->{'at24-7'}->product);
     }
     if (isset($xml->{'at24-7'}->options)) {
         foreach ($xml->{'at24-7'}->options as $optionData) {
             $optionData = $optionData->children('http://schema.post.be/shm/deepintegration/v3/common');
             if (in_array($optionData->getName(), array('infoDistributed'))) {
                 $option = Messaging::createFromXML($optionData);
             } else {
                 $className = '\\TijsVerkoyen\\Bpost\\Bpost\\Order\\Box\\Option\\' . ucfirst($optionData->getName());
                 if (!method_exists($className, 'createFromXML')) {
                     throw new Exception('Not Implemented');
                 }
                 $option = call_user_func(array($className, 'createFromXML'), $optionData);
             }
             $at247->addOption($option);
         }
     }
     if (isset($xml->{'at24-7'}->weight) && $xml->{'at24-7'}->weight != '') {
         $at247->setWeight((int) $xml->{'at24-7'}->weight);
     }
     if (isset($xml->{'at24-7'}->memberId) && $xml->{'at24-7'}->memberId != '') {
         $at247->setMemberId((string) $xml->{'at24-7'}->memberId);
     }
     if (isset($xml->{'at24-7'}->receiverName) && $xml->{'at24-7'}->receiverName != '') {
         $at247->setReceiverName((string) $xml->{'at24-7'}->receiverName);
     }
     if (isset($xml->{'at24-7'}->receiverCompany) && $xml->{'at24-7'}->receiverCompany != '') {
         $at247->setReceiverCompany((string) $xml->{'at24-7'}->receiverCompany);
     }
     if (isset($xml->{'at24-7'}->parcelsDepotId) && $xml->{'at24-7'}->parcelsDepotId != '') {
         $at247->setParcelsDepotId((string) $xml->{'at24-7'}->parcelsDepotId);
     }
     if (isset($xml->{'at24-7'}->parcelsDepotName) && $xml->{'at24-7'}->parcelsDepotName != '') {
         $at247->setParcelsDepotName((string) $xml->{'at24-7'}->parcelsDepotName);
     }
     if (isset($xml->{'at24-7'}->parcelsDepotAddress)) {
         $parcelsDepotAddressData = $xml->{'at24-7'}->parcelsDepotAddress->children('http://schema.post.be/shm/deepintegration/v3/common');
         $at247->setParcelsDepotAddress(ParcelsDepotAddress::createFromXML($parcelsDepotAddressData));
     }
     return $at247;
 }
 public function getDisplayAction()
 {
     $action = '';
     switch (strtolower($this->transmit)) {
         case 'fax':
             if ($this->eSignatureId > 0) {
                 $action = 'Faxing';
                 $messaging = new Messaging();
                 $messaging->messagingId = $this->medicationId;
                 $messaging->populate();
                 if (strlen($messaging->status) > 0) {
                     $action = $messaging->status;
                 }
             } else {
                 $action = 'Pending';
             }
             break;
     }
     return $action;
 }
if (!$found) {
    ?>
<h1>Menu not found</h1>
<p><a href="<?php 
    echo PathMap::build_path('sitemenus', 'index');
    ?>
">Return to menu list</a></p>
<?php 
} else {
    ?>
<h1>Create menu item</h1>
<?php 
    if (Messaging::has_messages()) {
        Messaging::display_messages();
    }
    if (!$submitted || $submitted && Messaging::has_messages()) {
        ?>
<p><a href="<?php 
        echo PathMap::build_path('sitemenus', 'items', 'index', $menu->id);
        ?>
">Return to menu items list</a></p>
<form method="post" action="<?php 
        echo PathMap::build_path('sitemenus', 'items', 'create', $menu->id);
        ?>
">
	<div style="padding: 2px;">
		<label for="<?php 
        echo $moduleName;
        ?>
_itemName">
			<strong>Item name:</strong>
Beispiel #11
0
<?php

/**
 * Check if the current user ip is banned
 */
$banned = UserBan::IsBanned($_SERVER['REMOTE_ADDR']);
/**
 * Output 0 if banned, alowing javascript to operate with this value
 */
if ($banned) {
    die("0");
}
/**
 * Load static function from class Messaging and return 1 if there are new messages
 * awaiting the current user or not.
 */
$time = Messaging::GetNewMsg();
/**
 * Outputs 0 or 1 to the browser for javascript operation
 */
echo $time->c;
 public function send($response, $inputs, $messageId = null)
 {
     if ($messageId === null) {
         $messageId = $this->messageId;
     }
     if (!isset($this->_validResponses[$response])) {
         $response = 'approved';
     }
     $messaging = new Messaging();
     $messaging->messagingId = $messageId;
     if (!$messaging->populate()) {
         trigger_error(__('Refill request messaging does not exists.'), E_USER_NOTICE);
         return false;
     }
     $refillRequest = new MedicationRefillRequest();
     $refillRequest->messageId = $messageId;
     if (!$refillRequest->populate()) {
         trigger_error(__('Refill request does not exists.'), E_USER_NOTICE);
         return false;
     }
     $data = array();
     //$data['writtenDate'] = date('Ymd',strtotime($inputs['datePrescribed']))
     $data['writtenDate'] = date('Ymd');
     // should be set to the date the prescriber authorized the renewal of the prescription
     $data['message'] = $messaging->rawMessage;
     if ($response == 'approved' && $refillRequest->medication->isScheduled()) {
         $response = 'denied';
         $inputs['note'] = 'This Refill Request is for a controlled substance (Schedule III - V). The approved controlled substance prescription is being faxed to your pharmacy';
         $inputs['refills'] = 0;
     }
     $arrResponse = array();
     switch ($response) {
         case 'approved':
             $this->response = 'Approved';
             $refills = $messaging->refills;
             $newRefills = (int) $inputs['refills'];
             if ($refills != $newRefills) {
                 if ($refills != 0) {
                     $this->response = 'ApprovedWithChanges';
                 }
                 //else {
                 $data['refills'] = $newRefills;
                 //}
             }
             $this->message = $inputs['note'];
             $arrResponse[$this->response] = array('Note' => $this->message);
             break;
         case 'denied':
             // quantity should be set to zero
             $data['refills'] = 0;
             if (isset($inputs['note'])) {
                 $this->response = 'DeniedNewPrescriptionToFollow';
                 $this->message = $inputs['note'];
                 $arrResponse[$this->response] = array('Note' => $this->message);
                 //$data['medicationId'] = (int)$inputs['medicationId'];
             } else {
                 $this->response = 'Denied';
                 //$this->message = $inputs['reasonCode'].':'.$inputs['reason']; // empty reason
                 $this->message = $inputs['reason'];
                 $arrResponse[$this->response] = array('DenialReasonCode' => $inputs['reasonCode'], 'DenialReason' => $inputs['reason']);
             }
             break;
     }
     $data['response'] = $arrResponse;
     $data['type'] = 'refill';
     $ret = ePrescribe::sendResponse($data, $messaging);
     if ($ret === true) {
         $this->dateTime = date('Y-m-d H:i:s');
         $this->persist();
         $refillRequest->action = $this->_validResponses[$response];
         $refillRequest->status = 'RESPONDED';
         $refillRequest->persist();
     }
     return $ret;
 }
Beispiel #13
0
$post_check = Post::Check(array("msg", "to"));
if ($post_check) {
    /**
     * If variables are passed we set the $html variable. This defines
     * if html is allowed or not. We don't allow html for messages, but
     * we will have to allow it when administrator sends a file to the user.
     */
    $html = isset($_GET['html']) && $_GET['html'] == 1 ? true : false;
    if ($_POST['to'] > 0) {
        /**
         * Add message if there is someone to pass it
         */
        $post = new AddMsg($_POST['msg'], $_POST['to'], $html);
    }
}
/**
 * Start Messaging class
 */
$msg = new Messaging();
/**
 * Delete all messages older that 520 minutes. This can be adjusted, but must
 * be adjusted in the client area as well, because all the users trigger this
 * function.
 */
$msg->DeleteOld(520);
/**
 * Get the message by the users respectivly
 */
$to_user = isset($_GET['to']) ? $_GET['to'] : $_POST['to'];
$messages = $msg->GetMsgs($to_user);
include 'views/template/messages.tpl';
 public function dashboard()
 {
     $user_id = Session::get('user_id');
     $practice_id = Session::get('practice_id');
     $data['practiceinfo'] = Practiceinfo::find($practice_id);
     $result = User::find($user_id);
     $data['displayname'] = $result->displayname;
     $displayname = $result->displayname;
     $fax_query = Received::where('practice_id', '=', $practice_id)->count();
     $from = $displayname . ' (' . $user_id . ')';
     if (Session::get('group_id') == '2') {
         $data['number_messages'] = Messaging::where('mailbox', '=', $user_id)->count();
         $data['number_documents'] = Scans::where('practice_id', '=', $practice_id)->count() + $fax_query;
         $data['number_appts'] = $this->getNumberAppts($user_id);
         $query1 = DB::table('t_messages')->join('demographics', 't_messages.pid', '=', 'demographics.pid')->where('t_messages.t_messages_from', '=', $from)->where('t_messages.t_messages_signed', '=', 'No')->count();
         $query2 = DB::table('encounters')->join('demographics', 'encounters.pid', '=', 'demographics.pid')->where('encounters.encounter_provider', '=', $displayname)->where('encounters.encounter_signed', '=', 'No')->count();
         $data['number_drafts'] = $query1 + $query2;
         $data['number_reminders'] = DB::table('alerts')->join('demographics', 'alerts.pid', '=', 'demographics.pid')->where('alerts.alert_provider', '=', $user_id)->where('alerts.alert_date_complete', '=', '0000-00-00 00:00:00')->where('alerts.alert_reason_not_complete', '=', '')->where(function ($query_array) {
             $query_array->where('alerts.alert', '=', 'Laboratory results pending')->orWhere('alerts.alert', '=', 'Radiology results pending')->orWhere('alerts.alert', '=', 'Cardiopulmonary results pending')->orWhere('alerts.alert', '=', 'Referral pending')->orWhere('alerts.alert', '=', 'Reminder')->orWhere('alerts.alert', '=', 'REMINDER');
         })->count();
         $data['number_bills'] = Encounters::where('bill_submitted', '=', 'No')->where('user_id', '=', $user_id)->count();
         $data['number_tests'] = Tests::whereNull('pid')->where('practice_id', '=', $practice_id)->count();
         if ($data['practiceinfo']->mtm_extension == 'y') {
             $mtm_users_array = explode(",", $data['practiceinfo']->mtm_alert_users);
             if (in_array($user_id, $mtm_users_array)) {
                 $data['mtm_alerts'] = Alerts::where('alert_date_complete', '=', '0000-00-00 00:00:00')->where('alert_reason_not_complete', '=', '')->where('alert', '=', 'Medication Therapy Management')->where('practice_id', '=', $practice_id)->count();
                 $data['mtm_alerts_status'] = "y";
             } else {
                 $data['mtm_alerts_status'] = "n";
             }
         } else {
             $data['mtm_alerts_status'] = "n";
         }
         $data['vaccine_supplement_alert'] = $this->vaccine_supplement_alert($practice_id);
     }
     if (Session::get('group_id') == '3') {
         $data['number_messages'] = Messaging::where('mailbox', '=', $user_id)->count();
         $data['number_documents'] = Scans::where('practice_id', '=', $practice_id)->count() + $fax_query;
         $data['number_drafts'] = DB::table('t_messages')->join('demographics', 't_messages.pid', '=', 'demographics.pid')->where('t_messages.t_messages_from', '=', $from)->where('t_messages.t_messages_signed', '=', 'No')->count();
         $data['number_reminders'] = DB::table('alerts')->join('demographics', 'alerts.pid', '=', 'demographics.pid')->where('alerts.alert_provider', '=', $user_id)->where('alerts.alert_date_complete', '=', '0000-00-00 00:00:00')->where('alerts.alert_reason_not_complete', '=', '')->where(function ($query_array) {
             $query_array->where('alerts.alert', '=', 'Laboratory results pending')->orWhere('alerts.alert', '=', 'Radiology results pending')->orWhere('alerts.alert', '=', 'Cardiopulmonary results pending')->orWhere('alerts.alert', '=', 'Referral pending')->orWhere('alerts.alert', '=', 'Reminder')->orWhere('alerts.alert', '=', 'REMINDER');
         })->count();
         $data['number_bills'] = Encounters::where('bill_submitted', '=', 'No')->where('practice_id', '=', $practice_id)->count();
         $data['number_tests'] = Tests::whereNull('pid')->where('practice_id', '=', $practice_id)->count();
         $data['vaccine_supplement_alert'] = $this->vaccine_supplement_alert($practice_id);
     }
     if (Session::get('group_id') == '4') {
         $data['number_messages'] = Messaging::where('mailbox', '=', $user_id)->count();
         $data['number_bills'] = Encounters::where('bill_submitted', '=', 'No')->where('practice_id', '=', $practice_id)->count();
         $data['number_documents'] = Scans::where('practice_id', '=', $practice_id)->count() + $fax_query;
     }
     if (Session::get('group_id') == '100') {
         $row = Demographics_relate::where('id', '=', $user_id)->first();
         Session::put('pid', $row->pid);
     }
     if (Session::get('group_id') == '1') {
         if ($practice_id == '1') {
             $data['saas_admin'] = 'y';
         } else {
             $data['saas_admin'] = 'n';
         }
         if (Session::get('patient_centric') != 'y') {
             $users = DB::table('users')->where('group_id', '=', '2')->where('practice_id', '=', Session::get('practice_id'))->first();
             if ($users) {
                 $data['users_needed'] = 'n';
             } else {
                 $data['users_needed'] = 'y';
             }
         } else {
             $data['users_needed'] = 'n';
         }
         if (Session::get('patient_centric') != 'y') {
             $schedule = DB::table('practiceinfo')->where('practice_id', '=', Session::get('practice_id'))->whereNull('minTime')->first();
             if ($schedule) {
                 $data['schedule_needed'] = 'y';
             } else {
                 $data['schedule_needed'] = 'n';
             }
         } else {
             $data['schedule_needed'] = 'n';
         }
     }
     if ($data['practiceinfo']->weekends == '1') {
         $data['weekends'] = 'true';
     } else {
         $data['weekends'] = 'false';
     }
     $data['minTime'] = ltrim($data['practiceinfo']->minTime, "0");
     $data['maxTime'] = ltrim($data['practiceinfo']->maxTime, "0");
     if (Session::get('group_id') == '2') {
         $provider = Providers::find(Session::get('user_id'));
         $data['schedule_increment'] = $provider->schedule_increment;
     } else {
         $data['schedule_increment'] = '15';
     }
     if (!Session::get('encounter_active')) {
         Session::put('encounter_active', 'n');
     }
     if ($data['practiceinfo']->fax_type != "") {
         $data1['fax'] = true;
     } else {
         $data1['fax'] = false;
     }
     $this->layout->style = $this->css_assets();
     $this->layout->script = $this->js_assets('home');
     $this->layout->content = '';
     if (Session::get('group_id') == '1') {
         $this->layout->content .= View::make('search', $this->getSearchData())->render();
         $this->layout->content .= View::make('dashboard', $data)->render();
         $this->layout->content .= View::make('setup')->render();
         $this->layout->content .= View::make('users')->render();
         $this->layout->content .= View::make('extensions', $data)->render();
         $this->layout->content .= View::make('schedule_admin')->render();
         $this->layout->content .= View::make('update')->render();
         $this->layout->content .= View::make('logs')->render();
         $this->layout->content .= View::make('schedule')->render();
     }
     if (Session::get('group_id') == '2' || Session::get('group_id') == '3' || Session::get('group_id') == '4') {
         $this->layout->content .= View::make('search', $this->getSearchData())->render();
         $this->layout->content .= View::make('dashboard', $data)->render();
         $this->layout->content .= View::make('demographics')->render();
         $this->layout->content .= View::make('options')->render();
         $this->layout->content .= View::make('messaging', $data1)->render();
         $this->layout->content .= View::make('schedule')->render();
         $this->layout->content .= View::make('billing')->render();
         $this->layout->content .= View::make('financial')->render();
         $this->layout->content .= View::make('office')->render();
         if (Session::get('patient_centric') == 'yp' && Session::get('group_id') == '2') {
             $this->layout->content .= View::make('setup')->render();
         }
     }
     if (Session::get('group_id') == '100') {
         $this->layout->content .= View::make('dashboard', $data)->render();
         $this->layout->content .= View::make('demographics')->render();
         $this->layout->content .= View::make('messaging', $data1)->render();
         $this->layout->content .= View::make('schedule')->render();
         $this->layout->content .= View::make('issues')->render();
         $this->layout->content .= View::make('encounters')->render();
         $this->layout->content .= View::make('t_messages')->render();
         $this->layout->content .= View::make('medications')->render();
         $this->layout->content .= View::make('supplements')->render();
         $this->layout->content .= View::make('allergies')->render();
         $this->layout->content .= View::make('immunizations')->render();
         $this->layout->content .= View::make('documents')->render();
         $this->layout->content .= View::make('forms')->render();
         $this->layout->content .= View::make('graph')->render();
     }
 }
Beispiel #15
0
 function resource_message_action($resource_id)
 {
     $r_perms = new ResourceObjectPerms($resource_id, $GLOBALS['user']->id);
     if (!$r_perms->havePerm('admin')) {
         throw new AccessDeniedException();
     }
     $this->resource = new ResourceObject($resource_id);
     $title = sprintf(_("Nutzer von %s benachrichtigen"), htmlReady($this->resource->getName()));
     $form_fields['start_day'] = array('type' => 'text', 'size' => '10', 'required' => true, 'caption' => _("Belegungen berücksichtigen von"));
     $form_fields['start_day']['attributes'] = array('onMouseOver' => 'jQuery(this).datepicker();this.blur();', 'onChange' => '$(this).closest("form").submit();');
     $form_fields['start_day']['default_value'] = strftime('%x');
     $form_fields['end_day'] = array('type' => 'text', 'size' => '10', 'required' => true, 'caption' => _("Belegungen berücksichtigen bis"));
     $form_fields['end_day']['attributes'] = array('onMouseOver' => 'jQuery(this).datepicker();this.blur();', 'onChange' => '$(this).closest("form").submit();');
     $form_fields['end_day']['default_value'] = strftime('%x', strtotime('+6 months'));
     $form_fields['subject'] = array('type' => 'text', 'size' => '200', 'attributes' => array('style' => 'width:100%'), 'required' => true, 'caption' => _("Betreff"));
     $form_fields['subject']['default_value'] = $this->resource->getName();
     $form_fields['message'] = array('caption' => _("Nachricht"), 'type' => 'textarea', 'required' => true, 'attributes' => array('rows' => 4, 'style' => 'width:100%'));
     $form_buttons['save_close'] = array('caption' => _('OK'), 'info' => _("Benachrichtigung verschicken und Dialog schließen"));
     $form = new StudipForm($form_fields, $form_buttons, 'resource_message', false);
     $start_time = strtotime($form->getFormFieldValue('start_day'));
     $end_time = strtotime($form->getFormFieldValue('end_day'));
     $assign_events = new AssignEventList($start_time, $end_time, $resource_id, '', '', TRUE, 'all');
     $rec = array();
     while ($event = $assign_events->nextEvent()) {
         if ($owner_type = $event->getOwnerType()) {
             if ($owner_type == 'date') {
                 $seminar = new Seminar(Seminar::GetSemIdByDateId($event->getAssignUserId()));
                 foreach ($seminar->getMembers('dozent') as $dozent) {
                     $rec[$dozent['username']][] = strftime('%x %R', $event->begin) . ' - ' . strftime('%R', $event->end) . ' ' . $seminar->getName();
                 }
             } else {
                 $rec[get_username($event->getAssignUserId())][] = strftime('%x %R', $event->begin) . ' - ' . strftime('%R', $event->end);
             }
         }
     }
     if ($form->isSended() && count($rec) && $form->getFormFieldValue('message')) {
         $messaging = new Messaging();
         $ok = $messaging->insert_message($form->getFormFieldValue('message'), array_keys($rec), $GLOBALS['user']->id, null, null, null, '', $form->getFormFieldValue('subject'), true);
         PageLayout::postMessage(MessageBox::success(sprintf(_("Die Nachricht wurde an %s Nutzer verschickt"), $ok)));
         return $this->redirect(URLHelper::getUrl('resources.php?view=resources'));
     }
     if (!count($rec)) {
         PageLayout::postMessage(MessageBox::error(sprintf(_("Im Zeitraum %s - %s wurden keine Belegungen gefunden!"), strftime('%x', $start_time), strftime('%x', $end_time))));
         $this->no_receiver = true;
     } else {
         $submessage = array();
         foreach ($rec as $username => $slots) {
             $submessage[] = get_fullname_from_uname($username, 'full_rev_username', true) . ' ' . sprintf(_('(%s Belegungen)'), count($slots));
         }
         PageLayout::postMessage(MessageBox::info(sprintf(_("Benachrichtigung an %s Nutzer verschicken"), count($rec)), $submessage, true));
     }
     $this->form = $form;
     $this->response->add_header('X-Title', $title);
 }
Beispiel #16
0
 public static function activateDownload($daily)
 {
     $data = array();
     $data['daily'] = (int) $daily;
     //$data['clinicName'] = $practice->name;
     $type = 'full';
     if ($data['daily']) {
         $type = 'daily';
     }
     $messaging = new Messaging();
     //$messaging->messagingId = '';
     $messaging->messageType = 'DirectoryDownload';
     $messaging->populate();
     //$messaging->objectId = '';
     //$messaging->objectClass = '';
     $messaging->status = 'Downloading';
     $messaging->note = 'Downloading pharmacy (' . $type . ')';
     $messaging->dateStatus = date('Y-m-d H:i:s');
     //$messaging->auditId = '';
     $messaging->persist();
     trigger_error($messaging->note, E_USER_NOTICE);
     $ch = curl_init();
     $pharmacyActivateURL = Zend_Registry::get('config')->healthcloud->URL;
     $pharmacyActivateURL .= 'ss-manager.raw/activate-pharmacy-download?apiKey=' . Zend_Registry::get('config')->healthcloud->apiKey;
     $cookieFile = tempnam(sys_get_temp_dir(), 'ssddcookies_');
     trigger_error('URL: ' . $pharmacyActivateURL, E_USER_NOTICE);
     trigger_error('COOKIEFILE: ' . $cookieFile, E_USER_NOTICE);
     trigger_error('DATA: ' . print_r($data, true));
     curl_setopt($ch, CURLOPT_URL, $pharmacyActivateURL);
     curl_setopt($ch, CURLOPT_POST, true);
     curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
     curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
     curl_setopt($ch, CURLOPT_COOKIEJAR, $cookieFile);
     curl_setopt($ch, CURLOPT_USERPWD, 'admin:ch3!');
     $output = curl_exec($ch);
     $error = "";
     $downloadURL = "";
     $messaging->status = 'Downloaded';
     $messaging->note = 'Pharmacy downloaded (' . $type . ')';
     if (!curl_errno($ch)) {
         try {
             $responseXml = simplexml_load_string($output);
             if (isset($responseXml->error)) {
                 $error = (string) $responseXml->error->messageCode . ': ' . (string) $responseXml->error->message;
                 trigger_error("There was an error activating synchronization of pharmacies, Error code: " . $responseXml->error->code . " Error Message: " . $responseXml->error->message, E_USER_NOTICE);
             } elseif (isset($responseXml->data->SSDirectoryDownloadUrl)) {
                 $downloadURL = $responseXml->data->SSDirectoryDownloadUrl;
                 trigger_error('DOWNLOAD URL: ' . $downloadURL, E_USER_NOTICE);
             }
             if (isset($responseXml->rawMessage)) {
                 $messaging->rawMessage = base64_decode((string) $responseXml->rawMessage);
                 $messaging->rawMessageResponse = base64_decode((string) $responseXml->rawMessageResponse);
             }
         } catch (Exception $e) {
             $error = __("There was an error connecting to HealthCloud to activate synchronization of pharmacies. Please try again or contact the system administrator.");
             trigger_error("Curl error connecting to healthcloud to activate pharmacy sync: " . curl_error($ch), E_USER_NOTICE);
         }
     } else {
         $error = __("There was an error connecting to HealthCloud to activate synchronization of pharmacies. Please try again or contact the system administrator.");
         trigger_error("Curl error connecting to healthcloud to activate pharmacy sync: " . curl_error($ch), E_USER_NOTICE);
     }
     curl_close($ch);
     if (strlen($error) > 0) {
         $messaging->status = 'Error';
         $messaging->note .= ' ERROR: ' . $error;
         $ret = false;
     }
     if ($messaging->resend) {
         $messaging->resend = 0;
     }
     $messaging->retries++;
     $messaging->dateStatus = date('Y-m-d H:i:s');
     $messaging->persist();
     trigger_error($messaging->note, E_USER_NOTICE);
     return array('downloadUrl' => $downloadURL, 'cookieFile' => $cookieFile, 'error' => $error);
 }
 public function update()
 {
     if (FabriqModules::module('roles')->requiresPermission('update blog posts', 'blog')) {
         $blog = FabriqModules::new_model('blog', 'Blogs');
         $blog->find(PathMap::arg(2));
         if ($blog->title != '' && ($blog->locked == 0 || FabriqModules::module('roles')->requiresPermission('update blog posts', 'blog'))) {
             Fabriq::title('Update blog entry');
             if (file_exists('libs/javascript/tiny_mce/tiny_mce.js')) {
                 FabriqLibs::js_lib('tiny_mce', 'tiny_mce');
                 FabriqLibs::js_lib('jquery.tinymce', 'tiny_mce');
                 FabriqModules::add_js('blog', 'blog');
             }
             // determine if extension modules are enabled
             $pathmapEnabled = FabriqModules::enabled('pathmap');
             FabriqModules::set_var('blog', 'pathmapEnabled', $pathmapEnabled);
             if ($pathmapEnabled) {
                 FabriqModules::module('pathmap')->start_update('blog', 'show', $blog->id);
                 FabriqModules::set_var('pathmap', 'pathmap_controller', 'blog');
                 FabriqModules::set_var('pathmap', 'pathmap_action', 'show');
                 FabriqModules::set_var('pathmap', 'pathmap_modpage', 'module');
             }
             $taxonomyEnabled = FabriqModules::enabled('taxonomy');
             FabriqModules::set_var('blog', 'taxonomyEnabled', $taxonomyEnabled);
             if ($taxonomyEnabled) {
                 FabriqModules::module('taxonomy')->termsList('blog', $blog->db_table, $blog->id);
             }
             if (isset($_POST['submit'])) {
                 $blog->title = trim($_POST['title']);
                 $blog->body = trim($_POST['body']);
                 $blog->locked = isset($_POST['locked']) && $_POST['locked'] == 1 ? 1 : 0;
                 $blog->user = $_SESSION[Fabriq::siteTitle()]['FABMOD_USERS_userid'];
                 if (strlen($blog->title) == '') {
                     Messaging::message('Blog title is required');
                 }
                 if (strlen($blog->body) == '') {
                     Messaging::message('Blog body is required');
                 }
                 if (!Messaging::has_messages()) {
                     $blog->update();
                     FabriqModules::trigger_event($this->name, 'create', 'blog entry updated', $blog);
                     // create map if needed
                     if ($pathmapEnabled) {
                         $_POST['pathmap_extra'] = $blog->id;
                         $_POST['pathmap_wildcard'] = NULL;
                         FabriqModules::module('pathmap')->update('blog', 'show', $blog->id);
                     }
                     // add taxonomy if available
                     if ($taxonomyEnabled) {
                         FabriqModules::module('taxonomy')->termsList('blog', $blog->db_table, $blog->id);
                     }
                     if (!Messaging::has_messages()) {
                         header('Location: ' . PathMap::build_path('blog'));
                         exit;
                     }
                 }
                 FabriqModules::set_var('blog', 'submitted', true);
             }
             FabriqModules::set_var('blog', 'blog', $blog);
         } else {
             FabriqModules::set_var('blog', 'notFound', true);
             Fabriq::title('Blog entry not found');
         }
     }
 }
Beispiel #18
0
<h1>Manage Roles</h1>
<?php 
if ($submitted && Messaging::has_messages('successes')) {
    Messaging::display_messages('successes');
}
?>
<p>
	<a href="<?php 
echo PathMap::build_path('fabriqadmin', 'roles', 'create');
?>
">Add role</a> | 
	<a href="<?php 
echo PathMap::build_path('fabriqadmin', 'roles', 'perms');
?>
">Manage permissions</a>
</p>
<form method="post" action="<?php 
PathMap::build_path('fabriqadmin', 'roles', 'manage');
?>
">
<table border="0" style="border: solid 1px #999;" cellspacing="0">
	<thead>
		<tr>
			<th style="width: 300px;">Role</th>
			<th>Enabled</th>
		</tr>
	</thead>
	<tbody>
<?php 
for ($i = 0; $i < $roles->count(); $i++) {
    ?>
Beispiel #19
0
 public function sendError($message)
 {
     $this->sendMessage(Messaging::error($message));
     $this->_client->close();
 }
Beispiel #20
0
 public static function sendResponse($data, Messaging $messaging)
 {
     $messageInfo = '';
     if (strlen($data['message']) > 0) {
         $xmlMessage = new SimpleXMLElement($data['message']);
         $lastName = (string) $xmlMessage->Body->RefillRequest->Patient->Name->LastName;
         $firstName = (string) $xmlMessage->Body->RefillRequest->Patient->Name->FirstName;
         $messageInfo = $lastName . ', ' . $firstName;
         $description = (string) $xmlMessage->Body->RefillRequest->MedicationPrescribed->DrugDescription;
         $datePrescribed = date('m/d/Y', strtotime((string) $xmlMessage->Body->RefillRequest->MedicationPrescribed->WrittenDate));
         $messageInfo .= ' - ' . $description . ' #' . $datePrescribed;
     }
     $tmpMessaging = $messaging;
     $messaging = new Messaging();
     //		$messaging->messagingId = $messageId;
     //		$messaging->populate();
     $messaging->messageType = 'RefillResponse';
     $messaging->objectId = $tmpMessaging->messagingId;
     $messaging->objectClass = 'MedicationRefillResponse';
     $messaging->status = 'Sending';
     $messaging->note = 'Sending refill response (' . $messageInfo . ')';
     $messaging->dateStatus = date('Y-m-d H:i:s');
     $messaging->auditId = $tmpMessaging->auditId;
     $messaging->persist();
     if (isset($data['medicationId'])) {
         $medicationId = $data['medicationId'];
         unset($data['medicationId']);
         $medication = new Medication();
         $medication->medicationId = $medicationId;
         if ($medication->populate()) {
             $medData = array();
             $medData['description'] = $medication->description;
             $medData['strength'] = $medication->strength;
             $medData['strengthUnits'] = '00';
             //$medication->unit;
             $medData['quantity'] = $medication->quantity;
             $medData['quantityUnits'] = '00';
             $medData['directions'] = $medication->directions;
             $qualifier = 'R';
             if ($medication->prn) {
                 $qualifier = 'PRN';
             }
             $medData['refills'] = $medication->refills;
             $medData['refillsUnits'] = $qualifier;
             $medData['substitutions'] = $medication->substitution;
             $medData['writtenDate'] = date('Ymd', strtotime($medication->datePrescribed));
             $data['Medication'] = $medData;
         }
     }
     $query = http_build_query($data);
     $ch = curl_init();
     $ePrescribeURL = Zend_Registry::get('config')->healthcloud->URL;
     $ePrescribeURL .= 'ss-manager.raw/receive-response?apiKey=' . Zend_Registry::get('config')->healthcloud->apiKey;
     curl_setopt($ch, CURLOPT_URL, $ePrescribeURL);
     curl_setopt($ch, CURLOPT_POST, true);
     curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
     curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
     $output = curl_exec($ch);
     $error = '';
     $rawMessage = '';
     $messaging->status = 'Sent';
     $messaging->note = 'Refill response pending';
     $messaging->unresolved = 1;
     if (!curl_errno($ch)) {
         try {
             $xml = new SimpleXMLElement($output);
             if (isset($xml->error)) {
                 $errorCode = (string) $xml->error->code;
                 $errorMsg = (string) $xml->error->message;
                 if (isset($xml->error->errorCode)) {
                     $errorCode = (string) $xml->error->errorCode;
                 }
                 if (isset($xml->error->errorMsg)) {
                     $errorMsg = (string) $xml->error->errorMsg;
                 }
                 $error = $errorMsg;
                 trigger_error('There was an error sending refill response, Error code: ' . $errorCode . ' Error Message: ' . $errorMsg, E_USER_NOTICE);
             } else {
                 if (isset($xml->status)) {
                     $messaging->note = 'Refill response awaiting confirmation';
                     if ((string) $xml->status->code == '010') {
                         // value 000 is for free standing error?
                         $messaging->status .= ' and Verified';
                         $messaging->note = 'Refill response sent and verified';
                         $messaging->unresolved = 0;
                     }
                 } else {
                     $error = 'Unrecognized HealthCloud response: ' . $output;
                 }
             }
             if (isset($xml->rawMessage)) {
                 $messaging->rawMessage = base64_decode((string) $xml->rawMessage);
                 $messaging->rawMessageResponse = base64_decode((string) $xml->rawMessageResponse);
             }
         } catch (Exception $e) {
             $error = __('There was an error, the response couldn\'t be parsed as XML: ' . $output);
             trigger_error($error, E_USER_NOTICE);
         }
     } else {
         $error = __('There was an error connecting to HealthCloud. Please try again or contact the system administrator.');
         trigger_error('Curl error connecting to healthcare: ' . curl_error($ch), E_USER_NOTICE);
     }
     $messaging->note .= ' (' . $messageInfo . ')';
     curl_close($ch);
     $ret = true;
     if (strlen($error) > 0) {
         $messaging->status = 'Error';
         $messaging->note = $error;
         $ret = $error;
     }
     if ($messaging->resend) {
         $messaging->resend = 0;
     }
     $messaging->retries++;
     $messaging->dateStatus = date('Y-m-d H:i:s');
     $messaging->persist();
     return $ret;
 }
 /**
  * Check that the fabriqinstall module is installed
  */
 public static function fabriqinstallReady()
 {
     // check that the fabriqinstall module is installed
     if (!FabriqModules::installed('fabriqinstall')) {
         FabriqModules::register_module('fabriqinstall');
         FabriqModules::install('fabriqinstall');
         $module = new Modules();
         $module->getModuleByName('fabriqinstall');
         $module->enabled = 1;
         $module->update();
         Messaging::message('Installed fabriqinstall module', 'success');
     }
 }
 public function saveComment()
 {
     //        $this->log->write(print_r($this->parameters, true));
     $request = Messaging::getSystemMessage($this->parameters['requestId']);
     $request['data']->comment = $this->parameters['comment'];
     Messaging::updateSystemMessage($request['messageId'], $request['data']);
 }
Beispiel #23
0
 public function dashboard()
 {
     $practice = DB::table('practiceinfo')->where('practice_id', '=', Session::get('practice_id'))->first();
     $user_id = Session::get('user_id');
     $result = User::find($user_id);
     $practice_id = Session::get('practice_id');
     $fax_query = Received::where('practice_id', '=', $practice_id)->count();
     $displayname = $result->displayname;
     $from = $displayname . ' (' . $user_id . ')';
     $data['header'] = $this->mobile_header_build(Session::get('displayname'));
     if (Session::get('group_id') == '2') {
         $data1['number_messages'] = Messaging::where('mailbox', '=', $user_id)->count();
         $data1['number_documents'] = Scans::where('practice_id', '=', $practice_id)->count() + $fax_query;
         $data1['number_appts'] = $this->getNumberAppts($user_id);
         $query1 = DB::table('t_messages')->join('demographics', 't_messages.pid', '=', 'demographics.pid')->where('t_messages.t_messages_from', '=', $from)->where('t_messages.t_messages_signed', '=', 'No')->count();
         $query2 = DB::table('encounters')->join('demographics', 'encounters.pid', '=', 'demographics.pid')->where('encounters.encounter_provider', '=', $displayname)->where('encounters.encounter_signed', '=', 'No')->count();
         $data1['number_drafts'] = $query1 + $query2;
         $data1['number_reminders'] = DB::table('alerts')->join('demographics', 'alerts.pid', '=', 'demographics.pid')->where('alerts.alert_provider', '=', $user_id)->where('alerts.alert_date_complete', '=', '0000-00-00 00:00:00')->where('alerts.alert_reason_not_complete', '=', '')->where(function ($query_array) {
             $query_array->where('alerts.alert', '=', 'Laboratory results pending')->orWhere('alerts.alert', '=', 'Radiology results pending')->orWhere('alerts.alert', '=', 'Cardiopulmonary results pending')->orWhere('alerts.alert', '=', 'Referral pending')->orWhere('alerts.alert', '=', 'Reminder')->orWhere('alerts.alert', '=', 'REMINDER');
         })->count();
         $data1['number_bills'] = Encounters::where('bill_submitted', '=', 'No')->where('user_id', '=', $user_id)->count();
         $data1['number_tests'] = Tests::whereNull('pid')->where('practice_id', '=', $practice_id)->count();
     }
     $data['content'] = View::make('mobile.home_content', $data1)->render();
     $data['form'] = '';
     $left_panel_array = array(array('Schedule', 'mobile_schedule'), array('Inbox', 'mobile_inbox'));
     if (Session::get('group_id') != '100') {
         $left_panel_array[] = array('Drafts', 'mobile_drafts');
         $left_panel_array[] = array('Alerts', 'mobile_alerts');
         if (Session::get('patient_centric') == 'n') {
             $left_panel_array[] = array('Scans', 'mobile_scan');
             if ($practice->fax_type != "") {
                 $left_panel_array[] = array('Faxes', 'mobile_fax');
             }
         }
     }
     $data['left_panel'] = $this->mobile_menu_build($left_panel_array, "left_panel_list", 'mobile_click_home');
     $data['right_panel'] = '';
     $this->layout->style = HTML::style('css/mobile.css');
     $this->layout->style .= HTML::style('css/toastr.min.css');
     $this->layout->script = $this->js_assets('base', true);
     $this->layout->content = View::make('mobile.home', $data);
 }
 public function postSendMessage()
 {
     $message_id = Input::get('message_id');
     $from = Session::get('user_id');
     $t_messages_id = Input::get('t_messages_id');
     if (Input::get('patient_name') == '') {
         $subject = Input::get('subject');
     } else {
         $subject = Input::get('subject') . ' [RE: ' . Input::get('patient_name') . ']';
     }
     $mailbox = array();
     $messages_to = "";
     $i = 0;
     foreach (Input::get('message_to') as $key => $to_row) {
         $to_pos = strpos($to_row, "(");
         $to_pos = $to_pos + 1;
         $to_id = substr($to_row, $to_pos);
         $mailbox[] = str_replace(")", "", $to_id);
         if ($i > 0) {
             $messages_to .= ";" . $to_row;
         } else {
             $messages_to .= $to_row;
         }
         $i++;
     }
     $messages_cc = "";
     if (Input::get('cc') != '') {
         $j = 0;
         foreach (Input::get('cc') as $key1 => $cc_row) {
             $cc_pos = strpos($cc_row, "(");
             $cc_pos = $cc_pos + 1;
             $cc_id = substr($cc_row, $cc_pos);
             $mailbox[] = str_replace(")", "", $cc_id);
             if ($j > 0) {
                 $messages_cc .= ";" . $cc_row;
             } else {
                 $messages_cc .= $cc_row;
             }
             $j++;
         }
     }
     foreach ($mailbox as $mailbox_row) {
         if ($mailbox_row != '') {
             $data = array('pid' => Input::get('pid'), 'patient_name' => Input::get('patient_name'), 'message_to' => $messages_to, 'cc' => $messages_cc, 'message_from' => $from, 'subject' => $subject, 'body' => Input::get('body'), 't_messages_id' => $t_messages_id, 'status' => 'Sent', 'mailbox' => $mailbox_row, 'practice_id' => Session::get('practice_id'));
             DB::table('messaging')->insert($data);
             $this->audit('Add');
             $user_row = User::find($mailbox_row);
             if ($user_row->group_id === '100') {
                 $practice = Practiceinfo::find(Session::get('practice_id'));
                 $data_message['patient_portal'] = $practice->patient_portal;
                 $this->send_mail('emails.newmessage', $data_message, 'New Message in your Patient Portal', $user_row->email, Session::get('practice_id'));
             }
         }
     }
     $data1a = array('pid' => Input::get('pid'), 'patient_name' => Input::get('patient_name'), 'message_to' => $messages_to, 'cc' => $messages_cc, 'message_from' => $from, 'subject' => $subject, 'body' => Input::get('body'), 'status' => 'Sent', 'mailbox' => '0', 'practice_id' => Session::get('practice_id'));
     if ($message_id != '') {
         DB::table('messaging')->where('message_id', '=', $message_id)->update($data1a);
         $this->audit('Update');
     } else {
         $message_id = DB::table('messaging')->insertGetId($data1a);
         $this->audit('Add');
     }
     if ($t_messages_id != '' || $t_messages_id != '0') {
         $row = User::find($from);
         $displayname = $row->displayname . ' (' . $row->id . ')';
         $row1 = Messaging::find($message_id);
         $date = explode(" ", $row1->date);
         $message1 = Input::get('body');
         $message = 'On ' . $row1->date . ', ' . $displayname . ' wrote:' . "\n---------------------------------\n" . $message1;
         $data1 = array('t_messages_message' => $message, 't_messages_to' => '');
         DB::table('t_messages')->where('t_messages_id', '=', $t_messages_id)->update($data1);
         $this->audit('Update');
     }
     echo 'Message sent!';
 }
 public static function handlereFaxAct(Audit $audit, array $sourceData)
 {
     if ($audit->objectClass != 'ESignature') {
         return false;
     }
     $eSignature = new ESignature();
     $eSignature->eSignatureId = $audit->objectId;
     $eSignature->populate();
     if ($eSignature->objectClass != 'Medication') {
         return false;
     }
     $medication = new Medication();
     $medication->medicationId = $eSignature->objectId;
     $medication->populate();
     $audit = $sourceData['_audit'];
     $messaging = new Messaging(Messaging::TYPE_OUTBOUND_FAX);
     $messaging->messagingId = (int) $sourceData['transmissionId'];
     $messaging->transmissionId = $messaging->messagingId;
     $messaging->populate();
     $messaging->objectId = $messaging->messagingId;
     $messaging->objectClass = $audit->objectClass;
     $messaging->status = 'Faxed';
     $messaging->dateStatus = date('Y-m-d H:i:s');
     $messaging->auditId = $audit->auditId;
     // this must be required for retransmission in case of error
     $messaging->persist();
     $efax = new eFaxOutbound();
     $url = Zend_Registry::get('config')->healthcloud->eFax->outboundUrl;
     $url .= '?apiKey=' . Zend_Registry::get('config')->healthcloud->apiKey;
     $efax->setUrl($url);
     $efax->setTransmissionId($sourceData['transmissionId']);
     $efax->setNoDuplicate(eFaxOutbound::NO_DUPLICATE_ENABLE);
     $efax->setDispositionMethod('POST');
     // use the default disposition URL
     $dispositionUrl = Zend_Registry::get('config')->healthcloud->eFax->dispositionUrl;
     $efax->setDispositionUrl($dispositionUrl);
     //$efax->setDispositionMethod('EMAIL');
     //$efax->addDispositionEmail('Arthur Layese','*****@*****.**');
     foreach ($sourceData['recipients'] as $recipient) {
         if ($messaging->resend && strlen($messaging->faxNumber) > 9) {
             // supersedes fax number from messaging
             $recipient['fax'] = $messaging->faxNumber;
         }
         $efax->addRecipient($recipient['fax'], $recipient['name'], $recipient['company']);
     }
     foreach ($sourceData['files'] as $file) {
         $efax->addFile($file['contents'], $file['type']);
     }
     $ret = $efax->send();
     if (!$ret) {
         $messaging->status = 'Fax Error';
         $messaging->note = implode(PHP_EOL, $efax->getErrors());
     } else {
         $messaging->docid = $efax->getDocId();
         $messaging->status = 'Fax Sent';
         $messaging->note = '';
     }
     if ($messaging->resend) {
         $messaging->resend = 0;
     }
     $messaging->retries++;
     $messaging->dateStatus = date('Y-m-d H:i:s');
     $messaging->persist();
     return true;
 }
 public function updateAccount()
 {
     if (!$this->isLoggedIn()) {
         header('Location: ' . PathMap::build_path('users', 'login'));
         exit;
     }
     Fabriq::title('Update account');
     $user = FabriqModules::new_model('users', 'Users');
     $user->find($_SESSION[Fabriq::siteTitle()]['FABMOD_USERS_userid']);
     if (isset($_POST['submit'])) {
         $emailPattern = '/^([a-z0-9])(([-a-z0-9._])*([a-z0-9]))*\\@([a-z0-9])(([a-z0-9-])*([a-z0-9]))+' . '(\\.([a-z0-9])([-a-z0-9_-])?([a-z0-9])+)+$/i';
         $displayPattern = '/([A-z0-9]){6,24}/';
         if (!preg_match($displayPattern, $_POST['display'])) {
             Messaging::message("Display name is invalid");
         }
         if (!preg_match($emailPattern, $_POST['email'])) {
             Messaging::message("e-mail address is invalid");
         }
         if (!Messaging::has_messages()) {
             $user->display = $_POST['display'];
             $user->email = $_POST['email'];
             $user->update();
             $_SESSION[Fabriq::siteTitle()]['FABMOD_USERS_displayname'] = $user->display;
             $_SESSION[Fabriq::siteTitle()]['FABMOD_USERS_email'] = $user->email;
             Messaging::message('Account has bee updated', 'success');
         }
         FabriqModules::set_var('users', 'submitted', true);
     }
     FabriqModules::set_var('users', 'user', $user);
     FabriqModules::add_js('users', 'jquery.validate.min');
     FabriqModules::add_js('users', 'users-updateAccount');
     FabriqModules::add_css('users', 'users-admin');
 }
 public function viewGatewayResponseRawMessageAction()
 {
     $messagingId = $this->_getParam('messagingId');
     $messaging = new Messaging();
     $messaging->messagingId = $messagingId;
     $messaging->populate();
     $this->view->gatewayResponseRawMessage = $messaging->rawMessageResponse;
     $this->render();
 }
Beispiel #28
0
 /**
  * invites members to a studygroup.
  */
 function execute_invite_action($id)
 {
     // Security Check
     global $perm;
     if (!$perm->have_studip_perm('tutor', $id)) {
         $this->redirect(URLHelper::getURL('seminar_main.php?auswahl=' . $id));
         exit;
     }
     // load MultiPersonSearch object
     $mp = MultiPersonSearch::load("studygroup_invite_" . $id);
     $fail = false;
     $count = 0;
     $addedUsers = "";
     foreach ($mp->getAddedUsers() as $receiver) {
         // save invite in database
         StudygroupModel::inviteMember($receiver, $id);
         // send invite message to user
         $msg = new Messaging();
         $sem = new Seminar($id);
         $message = sprintf(_("%s möchte Sie auf die Studiengruppe %s aufmerksam machen. Klicken Sie auf den untenstehenden Link, um direkt zur Studiengruppe zu gelangen.\n\n %s"), get_fullname(), $sem->name, URLHelper::getlink("dispatch.php/course/studygroup/details/" . $id, array('cid' => NULL)));
         $subject = _("Sie wurden in eine Studiengruppe eingeladen");
         $msg->insert_message($message, get_username($receiver), '', '', '', '', '', $subject);
         if ($count > 0) {
             $addedUsers .= ", ";
         }
         $addedUsers .= get_fullname($receiver, 'full', true);
         $count++;
     }
     if ($count == 1) {
         $this->flash['success'] = sprintf(_("%s wurde in die Studiengruppe eingeladen."), $addedUsers);
     } else {
         if ($count >= 1) {
             $this->flash['success'] = sprintf(_("%s wurden in die Studiengruppe eingeladen."), $addedUsers);
         }
     }
     $this->redirect($this->url_for('course/studygroup/members/' . $id, array('view' => Request::get('view'))));
 }
<h1>Site configuration</h1>
<?php 
if ($submitted && Messaging::has_messages()) {
    Messaging::display_messages();
}
$appPath = '/';
$aPath = substr($_SERVER['REQUEST_URI'], 1);
$aPath = str_replace('index.php?q=', '', $aPath);
$aPath = explode('/', $aPath);
$i = 0;
while ($aPath[$i] != 'fabriqinstall') {
    $appPath .= $aPath[$i] . '/';
    $i++;
}
if (isset($_SESSION['FAB_INSTALL_site']) && $_SESSION['FAB_INSTALL_site'] != '') {
    $siteConfig = unserialize($_SESSION['FAB_INSTALL_site']);
    $submitted = true;
    foreach ($siteConfig as $key => $val) {
        $_POST[$key] = $val;
    }
}
?>
<form method="post" action="<?php 
PathMap::build_path('fabriqinstall', 'install', 2);
?>
">
	<label for="title">Page title <span class="required-field">*</span>: </label><input type="text" id="title" name="title" size="50" tabindex="1"<?php 
if ($submitted) {
    echo ' value="' . $_POST['title'] . '"';
}
?>
 public function itemsUpdate()
 {
     if (FabriqModules::module('roles')->requiresPermission('update menus', 'sitemenus')) {
         $menu = FabriqModules::new_model('sitemenus', 'Menus');
         $menu->find(PathMap::arg(3));
         if ($menu->menuName != '') {
             $menuItem = FabriqModules::new_model('sitemenus', 'MenuItems');
             $menuItem->find(PathMap::arg(4));
             if ($menuItem->itemName != '') {
                 Fabriq::title("Add item to menu \"{$menu->menuName}\"");
                 $menu->buildMenu();
                 FabriqModules::set_var('sitemenus', 'menu', $menu);
                 FabriqModules::set_var('sitemenus', 'found', true);
                 FabriqModules::set_var('sitemenus', 'moduleName', $this->name);
                 if (isset($_POST['submitted'])) {
                     $menuItem->itemName = trim($_POST[$this->name . '_itemName']);
                     $menuItem->path = trim($_POST[$this->name . '_path']);
                     $menuItem->parentItem = $_POST[$this->name . '_parentItem'];
                     $menuItem->weight = $_POST[$this->name . '_weight'];
                     $menuItem->menu = $menu->id;
                     $menuItem->newWindow = isset($_POST[$this->name . '_newWindow']) && $_POST[$this->name . '_newWindow'] == 1 ? 1 : 0;
                     if (strlen($menuItem->itemName) == 0) {
                         Messaging::message('An item name is required');
                     }
                     if (strlen($menuItem->path) == 0) {
                         $menuItem->path = NULL;
                     }
                     if ($menuItem->parentItem == '') {
                         $menuItem->parentItem = NULL;
                     }
                     if (!Messaging::has_messages()) {
                         $menuItem->update();
                     }
                     FabriqModules::set_var('sitemenus', 'submitted', true);
                 }
                 FabriqModules::set_var('sitemenus', 'menuItem', $menuItem);
             } else {
                 Fabriq::title("Menu item not found");
                 FabriqModules::set_var('sitemenus', 'found', false);
             }
         } else {
             Fabriq::title("Menu not found");
             FabriqModules::set_var('sitemenus', 'found', false);
         }
     }
 }