ESign non-standard tables (#359)
[openemr.git] / library / ESign / Form / Log.php
blob8c335979f2ab97e224ff8d8bde71412935f4b868
1 <?php
3 namespace ESign;
5 /**
6 * Form implementation of LogIF interface, which is used to
7 * display the signature log
8 *
9 * Copyright (C) 2013 OEMR 501c3 www.oemr.org
11 * LICENSE: This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 3
14 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
22 * @package OpenEMR
23 * @author Ken Chapple <ken@mi-squared.com>
24 * @author Medical Information Integration, LLC
25 * @link http://www.open-emr.org
26 **/
28 require_once $GLOBALS['srcdir'].'/ESign/LogIF.php';
29 require_once $GLOBALS['srcdir'].'/ESign/Viewer.php';
31 class Form_Log implements LogIF
33 protected $_viewer = null;
35 /**
36 * Create a new instance of Form_Log.
38 * We pass custom variables needed to render log through
39 * the constructor because they aren't necessarily available
40 * through the SignableIF interface when render() function is called.
42 * @param unknown $formId
43 * @param unknown $formDir
44 * @param unknown $encounterId
46 public function __construct( $formId, $formDir, $encounterId )
48 $this->_viewer = new Viewer();
49 $this->_viewer->formId = $formId;
50 $this->_viewer->formDir = $formDir;
51 $this->_viewer->encounterId = $encounterId;
52 $this->_viewer->logId = $formDir."-".$formId;
55 public function render( SignableIF $signable )
57 $this->_viewer->verified = $signable->verify();
58 $this->_viewer->signatures = $signable->getSignatures();
59 return $this->_viewer->render( $this );
62 public function getHtml( SignableIF $signable )
64 $this->_viewer->verified = $signable->verify();
65 $this->_viewer->signatures = $signable->getSignatures();
66 return $this->_viewer->getHtml( $this );
69 public function getViewScript()
71 return $GLOBALS['srcdir'].'/ESign/views/default/esign_signature_log.php';
74 /**
75 * Check if the log is viewable.
77 * @return boolean
79 public function isViewable()
81 $viewable = false;
82 if ( $GLOBALS['esign_individual'] ) {
83 $viewable = true;
86 return $viewable;