2 // +-----------------------------------------------------------------------------+
3 // Copyright (C) 2011 Z&H Consultancy Services Private Limited <sam@zhservices.com>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
18 // A copy of the GNU General Public License is included along with this program:
19 // openemr/interface/login/GnuGPL.html
20 // For more information write to the Free Software
21 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 // Author: Eldho Chacko <eldho@zhservices.com>
24 // Jacob T Paul <jacob@zhservices.com>
26 // +------------------------------------------------------------------------------+
30 require_once("../../interface/globals.php");
31 $list_id = $_REQUEST['list_id'];
35 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
36 <script type
="text/javascript" src
="<?php echo $webroot ?>/interface/main/tabs/js/include_opener.js?v=<?php echo $v_js_includes; ?>"></script
>
37 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-3-1-1/index.js"></script
>
38 <script type
="text/javascript">
39 function add_template(){
41 mainform
=window
.opener
.opener
.document
;
42 if(document
.getElementById('template_name').value
){
43 len
= document
.getElementById('multi_context').options
.length
;
47 if(document
.getElementById('multi_context').options
[i
].selected
==true){
49 val+
=document
.getElementById('multi_context').options
[i
].value+
"|";
58 templateid
: document
.getElementById('template_name').value
,
59 list_id
: <?php
echo $list_id;?
>,
61 source
: "add_template"
64 success
: function(thedata
){
66 alert(document
.getElementById('template_name').value+
" <?php echo addslashes(xl('already exists'));?>");
70 mainform
.getElementById('templateDD').innerHTML
= thedata
;
71 alert("<?php echo addslashes(xl('Successfully added category'));?> "+document
.getElementById('template_name').value
);
72 //window.opener.opener.location.reload();
82 alert("<?php echo addslashes(xl('You should select at least one context'));?>");
86 alert("<?php echo addslashes(xl('Category name is empty'));?>");
92 <body
class="body_top">
97 <select multiple name
="multi_context[]" id
="multi_context" size
="5">
99 $res = sqlStatement("SELECT * FROM customlists WHERE cl_list_type=2 AND cl_deleted=0");
100 while ($row=sqlFetchArray($res)) {
101 echo "<option value='".htmlspecialchars($row['cl_list_id'], ENT_QUOTES
)."'>".htmlspecialchars($row['cl_list_item_long'], ENT_QUOTES
)."</option>";
107 <input type
="text" name
="template_name" id
="template_name">
110 <a href
="#" onclick
="add_template()" class="css_button"><span
><?php
echo htmlspecialchars(xl('ADD'), ENT_QUOTES
);?
></span
></a
>