remove unused calendar styles
[openemr.git] / interface / usergroup / usergroup_admin_add.php
blobae62728bf99592c0f5cd88c9f5b1c968b73242cc
1 <?php
2 require_once("../globals.php");
3 require_once("../../library/acl.inc");
4 require_once("$srcdir/options.inc.php");
5 require_once("$srcdir/erx_javascript.inc.php");
7 $facilityService = new \services\FacilityService();
9 $alertmsg = '';
12 <html>
13 <head>
15 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
16 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
17 <link rel="stylesheet" type="text/css" href="<?php echo $GLOBALS['webroot'] ?>/library/js/fancybox/jquery.fancybox-1.2.6.css" media="screen" />
18 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js?v=<?php echo $v_js_includes; ?>"></script>
19 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative'] ?>/jquery-min-1-9-1/index.js"></script>
20 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/common.js"></script>
21 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/fancybox/jquery.fancybox-1.2.6.js"></script>
23 <script src="checkpwd_validation.js" type="text/javascript"></script>
25 <!-- validation library -->
26 <!--//Not lbf forms use the new validation, please make sure you have the corresponding values in the list Page validation-->
27 <?php $use_validate_js = 1;?>
28 <?php require_once($GLOBALS['srcdir'] . "/validation/validation_script.js.php"); ?>
29 <?php
30 //Gets validation rules from Page Validation list.
31 //Note that for technical reasons, we are bypassing the standard validateUsingPageRules() call.
32 $collectthis = collectValidationPageRules("/interface/usergroup/usergroup_admin_add.php");
33 if (empty($collectthis)) {
34 $collectthis = "undefined";
36 else {
37 $collectthis = $collectthis["new_user"]["rules"];
40 <script language="JavaScript">
43 * validation on the form with new client side validation (using validate.js).
44 * this enable to add new rules for this form in the pageValidation list.
45 * */
46 var collectvalidation = <?php echo($collectthis); ?>;
48 function trimAll(sString)
50 while (sString.substring(0,1) == ' ')
52 sString = sString.substring(1, sString.length);
54 while (sString.substring(sString.length-1, sString.length) == ' ')
56 sString = sString.substring(0,sString.length-1);
58 return sString;
61 function submitform() {
63 var valid = submitme(1, undefined, 'new_user', collectvalidation);
64 if (!valid) return;
66 top.restoreSession();
68 //Checking if secure password is enabled or disabled.
69 //If it is enabled and entered password is a weak password, alert the user to enter strong password.
70 if(document.new_user.secure_pwd.value == 1){
71 var password = trim(document.new_user.stiltskin.value);
72 if(password != "") {
73 var pwdresult = passwordvalidate(password);
74 if(pwdresult == 0){
75 alert("<?php echo xl('The password must be at least eight characters, and should'); echo '\n'; echo xl('contain at least three of the four following items:'); echo '\n'; echo xl('A number'); echo '\n'; echo xl('A lowercase letter'); echo '\n'; echo xl('An uppercase letter'); echo '\n'; echo xl('A special character');echo '('; echo xl('not a letter or number'); echo ').'; echo '\n'; echo xl('For example:'); echo ' healthCare@09'; ?>");
76 return false;
79 } //secure_pwd if ends here
81 <?php if($GLOBALS['erx_enable']){ ?>
82 alertMsg='';
83 f=document.forms[0];
84 for(i=0;i<f.length;i++){
85 if(f[i].type=='text' && f[i].value)
87 if(f[i].name == 'rumple')
89 alertMsg += checkLength(f[i].name,f[i].value,35);
90 alertMsg += checkUsername(f[i].name,f[i].value);
92 else if(f[i].name == 'fname' || f[i].name == 'mname' || f[i].name == 'lname')
94 alertMsg += checkLength(f[i].name,f[i].value,35);
95 alertMsg += checkUsername(f[i].name,f[i].value);
97 else if(f[i].name == 'federaltaxid')
99 alertMsg += checkLength(f[i].name,f[i].value,10);
100 alertMsg += checkFederalEin(f[i].name,f[i].value);
102 else if(f[i].name == 'state_license_number')
104 alertMsg += checkLength(f[i].name,f[i].value,10);
105 alertMsg += checkStateLicenseNumber(f[i].name,f[i].value);
107 else if(f[i].name == 'npi')
109 alertMsg += checkLength(f[i].name,f[i].value,35);
110 alertMsg += checkTaxNpiDea(f[i].name,f[i].value);
112 else if(f[i].name == 'federaldrugid')
114 alertMsg += checkLength(f[i].name,f[i].value,30);
115 alertMsg += checkAlphaNumeric(f[i].name,f[i].value);
119 if(alertMsg)
121 alert(alertMsg);
122 return false;
124 <?php } // End erx_enable only include block?>
126 document.forms[0].submit();
127 parent.$.fn.fancybox.close();
130 function authorized_clicked() {
131 var f = document.forms[0];
132 f.calendar.disabled = !f.authorized.checked;
133 f.calendar.checked = f.authorized.checked;
136 </script>
137 <style type="text/css">
138 .physician_type_class{
139 width: 120px !important;
141 </style>
142 </head>
143 <body class="body_top">
144 <table><tr><td>
145 <span class="title"><?php xl('Add User','e'); ?></span>&nbsp;</td>
146 <td>
147 <a class="css_button" name='form_save' id='form_save' href='#' onclick="return submitform()">
148 <span><?php xl('Save','e');?></span></a>
149 <a class="css_button large_button" id='cancel' href='#'>
150 <span class='css_button_span large_button_span'><?php xl('Cancel','e');?></span>
151 </a>
152 </td></tr></table>
153 <br><br>
155 <table border=0>
157 <tr><td valign=top>
158 <form name='new_user' id="new_user" method='post' target="_parent" action="usergroup_admin.php"
159 onsubmit='return top.restoreSession()'>
160 <input type='hidden' name='mode' value='new_user'>
161 <input type='hidden' name='secure_pwd' value="<?php echo $GLOBALS['secure_password']; ?>">
163 <span class="bold">&nbsp;</span>
164 <table border=0 cellpadding=0 cellspacing=0 style="width:600px;">
165 <tr>
166 <td style="width:150px;"><span class="text"><?php xl('Username','e'); ?>: </span></td><td style="width:220px;"><input type=entry name="rumple" style="width:120px;"> <span class="mandatory">&nbsp;*</span></td>
167 <?php if(!$GLOBALS['use_active_directory']) { ?>
168 <td style="width:150px;"><span class="text"><?php xl('Password','e'); ?>: </span></td><td style="width:250px;"><input type="password" style="width:120px;" name="stiltskin"><span class="mandatory">&nbsp;*</span></td>
169 <?php }else{ ?>
170 <td> <input type="hidden" value="124" name="stiltskin" /></td>
171 <?php } ?>
172 </tr>
173 <tr>
174 <td style="width:150px;"></td><td style="width:220px;"></span></td>
175 <TD style="width:200px;"><span class=text><?php xl('Your Password','e'); ?>: </span></TD>
176 <TD class='text' style="width:280px;"><input type='password' name=adminPass style="width:120px;" value="" autocomplete='off'><font class="mandatory">*</font></TD>
178 </tr>
179 <tr>
180 <td><span class="text"<?php if ($GLOBALS['disable_non_default_groups']) echo " style='display:none'"; ?>><?php xl('Groupname','e'); ?>: </span></td>
181 <td>
182 <select name=groupname<?php if ($GLOBALS['disable_non_default_groups']) echo " style='display:none'"; ?>>
183 <?php
184 $res = sqlStatement("select distinct name from groups");
185 $result2 = array();
186 for ($iter = 0;$row = sqlFetchArray($res);$iter++)
187 $result2[$iter] = $row;
188 foreach ($result2 as $iter) {
189 print "<option value='".$iter{"name"}."'>" . $iter{"name"} . "</option>\n";
192 </select></td>
193 <td><span class="text"><?php xl('Provider','e'); ?>: </span></td><td>
194 <input type='checkbox' name='authorized' value='1' onclick='authorized_clicked()' />
195 &nbsp;&nbsp;<span class='text'><?php xl('Calendar','e'); ?>:
196 <input type='checkbox' name='calendar' disabled />
197 </td>
198 </tr>
199 <tr>
200 <td><span class="text"><?php xl('First Name','e'); ?>: </span></td><td><input type=entry name='fname' id='fname' style="width:120px;"><span class="mandatory">&nbsp;*</span></td>
201 <td><span class="text"><?php xl('Middle Name','e'); ?>: </span></td><td><input type=entry name='mname' style="width:120px;"></td>
202 </tr>
203 <tr>
204 <td><span class="text"><?php xl('Last Name','e'); ?>: </span></td><td><input type=entry name='lname' id='lname' style="width:120px;"><span class="mandatory">&nbsp;*</span></td>
205 <td><span class="text"><?php xl('Default Facility','e'); ?>: </span></td><td><select style="width:120px;" name=facility_id>
206 <?php
207 $fres = $facilityService->getAllServiceLocations();
208 if ($fres) {
209 for ($iter = 0; $iter < sizeof($fres);$iter++)
210 $result[$iter] = $fres[$iter];
211 foreach($result as $iter) {
213 <option value="<?php echo $iter{'id'};?>"><?php echo $iter{'name'};?></option>
214 <?php
218 </select></td>
219 </tr>
220 <tr>
221 <td><span class="text"><?php xl('Federal Tax ID','e'); ?>: </span></td><td><input type=entry name='federaltaxid' style="width:120px;"></td>
222 <td><span class="text"><?php xl('Federal Drug ID','e'); ?>: </span></td><td><input type=entry name='federaldrugid' style="width:120px;"></td>
223 </tr>
224 <tr>
225 <td><span class="text"><?php xl('UPIN','e'); ?>: </span></td><td><input type="entry" name="upin" style="width:120px;"></td>
226 <td class='text'><?php xl('See Authorizations','e'); ?>: </td>
227 <td><select name="see_auth" style="width:120px;">
228 <?php
229 foreach (array(1 => xl('None'), 2 => xl('Only Mine'), 3 => xl('All')) as $key => $value)
231 echo " <option value='$key'";
232 echo ">$value</option>\n";
235 </select></td>
237 <tr>
238 <td><span class="text"><?php xl('NPI','e'); ?>: </span></td><td><input type="entry" name="npi" style="width:120px;"></td>
239 <td><span class="text"><?php xl('Job Description','e'); ?>: </span></td><td><input type="entry" name="specialty" style="width:120px;"></td>
240 </tr>
242 <tr>
243 <td>
244 <span class="text"><?php xl('Provider Type','e'); ?>: </span>
245 </td>
246 <td>
247 <?php echo generate_select_list("physician_type", "physician_type", '','',xl('Select Type'),'physician_type_class','','',''); ?>
248 </td>
249 </tr>
251 <tr>
252 <td><span class="text"><?php xl('Taxonomy','e'); ?>: </span></td>
253 <td><input type="entry" name="taxonomy" style="width:120px;" value="207Q00000X"></td>
254 <td>&nbsp;</td><td>&nbsp;</td></tr>
256 <tr>
257 <td><span class="text"><?php xl('State License Number','e'); ?>: </span></td>
258 <td><input type="text" name="state_license_number" style="width:120px;"></td>
259 <td class='text'><?php xl('NewCrop eRX Role','e'); ?>:</td>
260 <td>
261 <?php echo generate_select_list("erxrole", "newcrop_erx_role", '','','--Select Role--','','','',array('style'=>'width:120px')); ?>
262 </td>
263 </tr>
265 <?php if ($GLOBALS['inhouse_pharmacy']) { ?>
266 <tr>
267 <td class="text"><?php xl('Default Warehouse','e'); ?>: </td>
268 <td class='text'>
269 <?php
270 echo generate_select_list('default_warehouse', 'warehouse',
271 '', '');
273 </td>
274 <td class="text"><?php xl('Invoice Refno Pool','e'); ?>: </td>
275 <td class='text'>
276 <?php
277 echo generate_select_list('irnpool', 'irnpool', '',
278 xl('Invoice reference number pool, if used'));
280 </td>
281 </tr>
282 <?php } ?>
284 <?php
285 // List the access control groups if phpgacl installed
286 if (isset($phpgacl_location) && acl_check('admin', 'acl')) {
288 <tr>
289 <td class='text'><?php xl('Access Control','e'); ?>:</td>
290 <td><select name="access_group[]" multiple style="width:120px;">
291 <?php
292 $list_acl_groups = acl_get_group_title_list();
293 $default_acl_group = 'Administrators';
294 foreach ($list_acl_groups as $value) {
295 if ($default_acl_group == $value) {
296 // Modified 6-2009 by BM - Translate group name if applicable
297 echo " <option value='$value' selected>" . xl_gacl_group($value) . "</option>\n";
299 else {
300 // Modified 6-2009 by BM - Translate group name if applicable
301 echo " <option value='$value'>" . xl_gacl_group($value) . "</option>\n";
305 </select></td>
306 <td><span class="text"><?php xl('Additional Info','e'); ?>: </span></td>
307 <td><textarea name=info style="width:120px;" cols=27 rows=4 wrap=auto></textarea></td>
309 </tr>
310 <tr height="25"><td colspan="4">&nbsp;</td></tr>
311 <?php
315 </table>
317 <br>
318 <input type="hidden" name="newauthPass">
319 </form>
320 </td>
322 </tr>
324 <tr<?php if ($GLOBALS['disable_non_default_groups']) echo " style='display:none'"; ?>>
326 <td valign=top>
327 <form name='new_group' method='post' action="usergroup_admin.php"
328 onsubmit='return top.restoreSession()'>
329 <br>
330 <input type=hidden name=mode value=new_group>
331 <span class="bold"><?php xl('New Group','e'); ?>:</span>
332 </td><td>
333 <span class="text"><?php xl('Groupname','e'); ?>: </span><input type=entry name=groupname size=10>
334 &nbsp;&nbsp;&nbsp;
335 <span class="text"><?php xl('Initial User','e'); ?>: </span>
336 <select name=rumple>
337 <?php
338 $res = sqlStatement("select distinct username from users where username != ''");
339 for ($iter = 0;$row = sqlFetchArray($res);$iter++)
340 $result[$iter] = $row;
341 foreach ($result as $iter) {
342 print "<option value='".$iter{"username"}."'>" . $iter{"username"} . "</option>\n";
345 </select>
346 &nbsp;&nbsp;&nbsp;
347 <input type="submit" value=<?php xl('Save','e'); ?>>
348 </form>
349 </td>
351 </tr>
353 <tr <?php if ($GLOBALS['disable_non_default_groups']) echo " style='display:none'"; ?>>
355 <td valign=top>
356 <form name='new_group' method='post' action="usergroup_admin.php"
357 onsubmit='return top.restoreSession()'>
358 <input type=hidden name=mode value=new_group>
359 <span class="bold"><?php xl('Add User To Group','e'); ?>:</span>
360 </td><td>
361 <span class="text">
362 <?php xl('User','e'); ?>
363 : </span>
364 <select name=rumple>
365 <?php
366 $res = sqlStatement("select distinct username from users where username != ''");
367 for ($iter = 0;$row = sqlFetchArray($res);$iter++)
368 $result3[$iter] = $row;
369 foreach ($result3 as $iter) {
370 print "<option value='".$iter{"username"}."'>" . $iter{"username"} . "</option>\n";
373 </select>
374 &nbsp;&nbsp;&nbsp;
375 <span class="text"><?php xl('Groupname','e'); ?>: </span>
376 <select name=groupname>
377 <?php
378 $res = sqlStatement("select distinct name from groups");
379 $result2 = array();
380 for ($iter = 0;$row = sqlFetchArray($res);$iter++)
381 $result2[$iter] = $row;
382 foreach ($result2 as $iter) {
383 print "<option value='".$iter{"name"}."'>" . $iter{"name"} . "</option>\n";
386 </select>
387 &nbsp;&nbsp;&nbsp;
388 <input type="submit" value=<?php xl('Add User To Group','e'); ?>>
389 </form>
390 </td>
391 </tr>
393 </table>
395 <?php
396 if (empty($GLOBALS['disable_non_default_groups'])) {
397 $res = sqlStatement("select * from groups order by name");
398 for ($iter = 0;$row = sqlFetchArray($res);$iter++)
399 $result5[$iter] = $row;
401 foreach ($result5 as $iter) {
402 $grouplist{$iter{"name"}} .= $iter{"user"} .
403 "(<a class='link_submit' href='usergroup_admin.php?mode=delete_group&id=" .
404 $iter{"id"} . "' onclick='top.restoreSession()'>Remove</a>), ";
407 foreach ($grouplist as $groupname => $list) {
408 print "<span class='bold'>" . $groupname . "</span><br>\n<span class='text'>" .
409 substr($list,0,strlen($list)-2) . "</span><br>\n";
414 <script language="JavaScript">
415 <?php
416 if ($alertmsg = trim($alertmsg)) {
417 echo "alert('$alertmsg');\n";
420 $(document).ready(function(){
421 $("#cancel").click(function() {
422 parent.$.fn.fancybox.close();
426 </script>
427 <table>
429 </table>
431 </body>
432 </html>