3 // +-----------------------------------------------------------------------------+
4 // Copyright (C) 2011 Z&H Consultancy Services Private Limited <sam@zhservices.com>
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License
9 // as published by the Free Software Foundation; either version 2
10 // 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.
19 // A copy of the GNU General Public License is included along with this program:
20 // openemr/interface/login/GnuGPL.html
21 // For more information write to the Free Software
22 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 // Author: Eldho Chacko <eldho@zhservices.com>
25 // Jacob T Paul <jacob@zhservices.com>
27 // +------------------------------------------------------------------------------+
31 require_once("../../interface/globals.php");
33 use OpenEMR\Core\Header
;
35 $list_id = $_REQUEST['list_id'];
39 <?php Header
::setupHeader('opener'); ?
>
41 function add_template(){
43 mainform
=window
.opener
.opener
.document
;
44 if(document
.getElementById('template_name').value
){
45 len
= document
.getElementById('multi_context').options
.length
;
49 if(document
.getElementById('multi_context').options
[i
].selected
==true){
51 val+
=document
.getElementById('multi_context').options
[i
].value+
"|";
60 templateid
: document
.getElementById('template_name').value
,
61 list_id
: <?php
echo js_escape($list_id);?
>,
63 source
: "add_template"
66 success
: function(thedata
){
68 alert(document
.getElementById('template_name').value+
" <?php echo addslashes(xl('already exists'));?>");
72 mainform
.getElementById('templateDD').innerHTML
= thedata
;
73 alert("<?php echo addslashes(xl('Successfully added category'));?> "+document
.getElementById('template_name').value
);
74 //window.opener.opener.location.reload();
84 alert("<?php echo addslashes(xl('You should select at least one context'));?>");
88 alert("<?php echo addslashes(xl('Category name is empty'));?>");
94 <body
class="body_top">
99 <select multiple name
="multi_context[]" id
="multi_context" size
="5">
101 $res = sqlStatement("SELECT * FROM customlists WHERE cl_list_type=2 AND cl_deleted=0");
102 while ($row = sqlFetchArray($res)) {
103 echo "<option value='" . htmlspecialchars($row['cl_list_id'], ENT_QUOTES
) . "'>" . htmlspecialchars($row['cl_list_item_long'], ENT_QUOTES
) . "</option>";
109 <input type
="text" name
="template_name" id
="template_name">
112 <a href
="#" onclick
="add_template()" class="btn btn-primary"><span
><?php
echo htmlspecialchars(xl('ADD'), ENT_QUOTES
);?
></span
></a
>