From 722847cbe6f10eb341b4e80324ea5d5cc2386143 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Thu, 26 Jun 2014 21:57:49 +0200 Subject: [PATCH] Add option to enable keypad (in most cases, we don't need this). --- htdocs/cashdesk/include/keypad.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/cashdesk/include/keypad.php b/htdocs/cashdesk/include/keypad.php index e8c3780f348..cc56a2d1192 100644 --- a/htdocs/cashdesk/include/keypad.php +++ b/htdocs/cashdesk/include/keypad.php @@ -15,8 +15,17 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +/** + * Return a string to outptu a keypad + * + * @param string $keypadname Key pad name + * @param string $formname Form name + * @return string HTML code to show a js keypad. + */ function genkeypad($keypadname, $formname) { + if (empty($conf->global->CASHDESK_SHOW_KEYPAD)) return ''; + // défine the font size of button $btnsize=32; $sz='<input type="button" id="closekeypad'.$keypadname.'" value="X" style="display:none;" onclick="closekeypad(\''.$keypadname.'\')"/>'."\n"; @@ -33,7 +42,7 @@ function genkeypad($keypadname, $formname) $sz.='<input type="button" style="font-size:'.$btnsize.'px;" value=" 1 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',1);"/>'."\n"; $sz.='<input type="button" style="font-size:'.$btnsize.'px;" value=" 2 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',2);"/>'."\n"; $sz.='<input type="button" style="font-size:'.$btnsize.'px;" value=" 3 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',3);"/><br/>'."\n"; - + $sz.='<input type="button" style="font-size:'.$btnsize.'px;" value=" 0 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',0);"/>'."\n"; $sz.='<input type="button" style="font-size:'.$btnsize.'px;" value="←" '; $sz.=' onclick="document.getElementById(\''.$keypadname.'\').value=document.getElementById(\''.$keypadname.'\').value.substr(0,document.getElementById(\''.$keypadname.'\').value.length-1);modif();"/>'."\n"; -- GitLab