Added ESign api and implemantion of ESign on forms and encounters
[openemr.git] / library / ESign / Encounter / Button.php
blob62b75e86ef8423f32646a66fffd31f9adb8803a4
1 <?php
3 namespace ESign;
5 /**
6 * Implementation of ButtonIF for encounter module
7 *
8 * Copyright (C) 2013 OEMR 501c3 www.oemr.org
10 * LICENSE: This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 3
13 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
21 * @package OpenEMR
22 * @author Ken Chapple <ken@mi-squared.com>
23 * @author Medical Information Integration, LLC
24 * @link http://www.open-emr.org
25 **/
27 require_once $GLOBALS['srcdir'].'/ESign/ButtonIF.php';
28 require_once $GLOBALS['srcdir'].'/ESign/ViewableIF.php';
30 class Encounter_Button implements ButtonIF
32 private $_viewer = null;
34 public function __construct( $encounterId )
36 $this->_viewer = new Viewer();
37 $this->_viewer->target = $GLOBALS['concurrent_layout'] ? "_parent" : "Main";
38 $this->_viewer->encounterId = $encounterId;
41 public function isViewable()
43 return $GLOBALS['esign_all'];
46 public function getViewScript()
48 return $GLOBALS['srcdir'].'/ESign/views/encounter/esign_button.php';
51 public function render( SignableIF $signable = null )
53 return $this->_viewer->render( $this );
56 public function getHtml( SignableIF $signable = null )
58 return $this->_viewer->getHtml( $this );