5 * ESign object consists of the all the essential parts.
7 * Copyright (C) 2013 OEMR 501c3 www.oemr.org
9 * LICENSE: This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 3
12 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
21 * @author Ken Chapple <ken@mi-squared.com>
22 * @author Medical Information Integration, LLC
23 * @author Brady Miller <brady.g.miller@gmail.com>
24 * @link http://www.open-emr.org
30 private $_configuration = null;
31 private $_signable = null;
32 private $_button = null;
35 function __construct( ConfigurationIF
$configuration, SignableIF
$signable, ButtonIF
$button, LogIF
$log )
37 $this->_configuration
= $configuration;
38 $this->_signable
= $signable;
39 $this->_button
= $button;
44 * Check if the signable object is locked from futher editing
48 public function isLocked()
50 return $this->_signable
->isLocked();
53 public function isButtonViewable()
55 return $this->_button
->isViewable();
59 * Check if the log is viewable
60 * @param string $mode Currently supports "default" and "report"
63 public function isLogViewable($mode="default")
66 if ( count( $this->_signable
->getSignatures() ) > 0 ) {
67 // If we have signatures, always show the log.
70 // If in report mode then hide the log if $_GLOBALS['esign_report_hide_empty_sig'] is true and there are no signatures
71 if ( ($mode=="report") && ($GLOBALS['esign_report_hide_empty_sig']) ) {
75 // defer if viewable to the log object
76 $viewable = $this->_log
->isViewable();
83 public function renderLog()
85 $this->_log
->render( $this->_signable
);
88 public function buttonHtml()
90 return $this->_button
->getHtml();
93 public function getSignatures()
95 return $this->_signable
->getSignatures();