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");
13 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
14 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
15 <link rel
="stylesheet" type
="text/css" href
="<?php echo $GLOBALS['webroot'] ?>/library/js/fancybox/jquery.fancybox-1.2.6.css" media
="screen" />
16 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js?v=<?php echo $v_js_includes; ?>"></script
>
17 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative'] ?>/jquery-min-1-9-1/index.js"></script
>
18 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/common.js"></script
>
19 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/fancybox/jquery.fancybox-1.2.6.js"></script
>
21 <script src
="checkpwd_validation.js" type
="text/javascript"></script
>
23 <!-- validation library
-->
24 <!--//Not lbf forms use the new validation, please make sure you have the corresponding values in the list Page validation-->
25 <?php
$use_validate_js = 1;?
>
26 <?php
require_once($GLOBALS['srcdir'] . "/validation/validation_script.js.php"); ?
>
28 //Gets validation rules from Page Validation list.
29 //Note that for technical reasons, we are bypassing the standard validateUsingPageRules() call.
30 $collectthis = collectValidationPageRules("/interface/usergroup/usergroup_admin_add.php");
31 if (empty($collectthis)) {
32 $collectthis = "undefined";
35 $collectthis = $collectthis["new_user"]["rules"];
38 <script language
="JavaScript">
41 * validation on the form with new client side validation (using validate.js).
42 * this enable to add new rules for this form in the pageValidation list.
44 var collectvalidation
= <?php
echo($collectthis); ?
>;
46 function trimAll(sString
)
48 while (sString
.substring(0,1) == ' ')
50 sString
= sString
.substring(1, sString
.length
);
52 while (sString
.substring(sString
.length
-1, sString
.length
) == ' ')
54 sString
= sString
.substring(0,sString
.length
-1);
59 function submitform() {
61 var valid
= submitme(1, undefined
, 'new_user', collectvalidation
);
66 //Checking if secure password is enabled or disabled.
67 //If it is enabled and entered password is a weak password, alert the user to enter strong password.
68 if(document
.new_user
.secure_pwd
.value
== 1){
69 var password
= trim(document
.new_user
.stiltskin
.value
);
71 var pwdresult
= passwordvalidate(password
);
73 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'; ?>");
77 } //secure_pwd if ends here
79 <?php
if($GLOBALS['erx_enable']){ ?
>
82 for(i
=0;i
<f
.length
;i++
){
83 if(f
[i
].type
=='text' && f
[i
].value
)
85 if(f
[i
].name
== 'rumple')
87 alertMsg +
= checkLength(f
[i
].name
,f
[i
].value
,35);
88 alertMsg +
= checkUsername(f
[i
].name
,f
[i
].value
);
90 else if(f
[i
].name
== 'fname' || f
[i
].name
== 'mname' || f
[i
].name
== 'lname')
92 alertMsg +
= checkLength(f
[i
].name
,f
[i
].value
,35);
93 alertMsg +
= checkUsername(f
[i
].name
,f
[i
].value
);
95 else if(f
[i
].name
== 'federaltaxid')
97 alertMsg +
= checkLength(f
[i
].name
,f
[i
].value
,10);
98 alertMsg +
= checkFederalEin(f
[i
].name
,f
[i
].value
);
100 else if(f
[i
].name
== 'state_license_number')
102 alertMsg +
= checkLength(f
[i
].name
,f
[i
].value
,10);
103 alertMsg +
= checkStateLicenseNumber(f
[i
].name
,f
[i
].value
);
105 else if(f
[i
].name
== 'npi')
107 alertMsg +
= checkLength(f
[i
].name
,f
[i
].value
,35);
108 alertMsg +
= checkTaxNpiDea(f
[i
].name
,f
[i
].value
);
110 else if(f
[i
].name
== 'federaldrugid')
112 alertMsg +
= checkLength(f
[i
].name
,f
[i
].value
,30);
113 alertMsg +
= checkAlphaNumeric(f
[i
].name
,f
[i
].value
);
122 <?php
} // End erx_enable only include block?>
124 document
.forms
[0].submit();
125 parent
.$
.fn
.fancybox
.close();
128 function authorized_clicked() {
129 var f
= document
.forms
[0];
130 f
.calendar
.disabled
= !f
.authorized
.checked
;
131 f
.calendar
.checked
= f
.authorized
.checked
;
135 <style type
="text/css">
136 .physician_type_class
{
137 width
: 120px
!important
;
141 <body
class="body_top">
143 <span
class="title"><?php
xl('Add User','e'); ?
></span
> 
;</td
>
145 <a
class="css_button" name
='form_save' id
='form_save' href
='#' onclick
="return submitform()">
146 <span
><?php
xl('Save','e');?
></span
></a
>
147 <a
class="css_button large_button" id
='cancel' href
='#'>
148 <span
class='css_button_span large_button_span'><?php
xl('Cancel','e');?
></span
>
156 <form name
='new_user' id
="new_user" method
='post' target
="_parent" action
="usergroup_admin.php"
157 onsubmit
='return top.restoreSession()'>
158 <input type
='hidden' name
='mode' value
='new_user'>
159 <input type
='hidden' name
='secure_pwd' value
="<?php echo $GLOBALS['secure_password']; ?>">
161 <span
class="bold"> 
;</span
>
162 <table border
=0 cellpadding
=0 cellspacing
=0 style
="width:600px;">
164 <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"> 
;*</span
></td
>
165 <td style
="width:150px;"><span
class="text"><?php
xl('Password','e'); ?
>: </span
></td
><td style
="width:250px;"><input type
=entry style
="width:120px;" name
="stiltskin"><span
class="mandatory"> 
;*</span
></td
>
168 <td style
="width:150px;"></td
><td style
="width:220px;"></span
></td
>
169 <TD style
="width:200px;"><span
class=text
><?php
xl('Your Password','e'); ?
>: </span
></TD
>
170 <TD
class='text' style
="width:280px;"><input type
='password' name
=adminPass style
="width:120px;" value
="" autocomplete
='off'><font
class="mandatory">*</font
></TD
>
174 <td
><span
class="text"<?php
if ($GLOBALS['disable_non_default_groups']) echo " style='display:none'"; ?
>><?php
xl('Groupname','e'); ?
>: </span
></td
>
176 <select name
=groupname
<?php
if ($GLOBALS['disable_non_default_groups']) echo " style='display:none'"; ?
>>
178 $res = sqlStatement("select distinct name from groups");
180 for ($iter = 0;$row = sqlFetchArray($res);$iter++
)
181 $result2[$iter] = $row;
182 foreach ($result2 as $iter) {
183 print "<option value='".$iter{"name"}."'>" . $iter{"name"} . "</option>\n";
187 <td
><span
class="text"><?php
xl('Provider','e'); ?
>: </span
></td
><td
>
188 <input type
='checkbox' name
='authorized' value
='1' onclick
='authorized_clicked()' />
189  
; 
;<span
class='text'><?php
xl('Calendar','e'); ?
>:
190 <input type
='checkbox' name
='calendar' disabled
/>
194 <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"> 
;*</span
></td
>
195 <td
><span
class="text"><?php
xl('Middle Name','e'); ?
>: </span
></td
><td
><input type
=entry name
='mname' style
="width:120px;"></td
>
198 <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"> 
;*</span
></td
>
199 <td
><span
class="text"><?php
xl('Default Facility','e'); ?
>: </span
></td
><td
><select style
="width:120px;" name
=facility_id
>
201 $fres = sqlStatement("select * from facility where service_location != 0 order by name");
203 for ($iter = 0;$frow = sqlFetchArray($fres);$iter++
)
204 $result[$iter] = $frow;
205 foreach($result as $iter) {
207 <option value
="<?php echo $iter{'id'};?>"><?php
echo $iter{'name'};?
></option
>
215 <td
><span
class="text"><?php
xl('Federal Tax ID','e'); ?
>: </span
></td
><td
><input type
=entry name
='federaltaxid' style
="width:120px;"></td
>
216 <td
><span
class="text"><?php
xl('Federal Drug ID','e'); ?
>: </span
></td
><td
><input type
=entry name
='federaldrugid' style
="width:120px;"></td
>
219 <td
><span
class="text"><?php
xl('UPIN','e'); ?
>: </span
></td
><td
><input type
="entry" name
="upin" style
="width:120px;"></td
>
220 <td
class='text'><?php
xl('See Authorizations','e'); ?
>: </td
>
221 <td
><select name
="see_auth" style
="width:120px;">
223 foreach (array(1 => xl('None'), 2 => xl('Only Mine'), 3 => xl('All')) as $key => $value)
225 echo " <option value='$key'";
226 echo ">$value</option>\n";
232 <td
><span
class="text"><?php
xl('NPI','e'); ?
>: </span
></td
><td
><input type
="entry" name
="npi" style
="width:120px;"></td
>
233 <td
><span
class="text"><?php
xl('Job Description','e'); ?
>: </span
></td
><td
><input type
="entry" name
="specialty" style
="width:120px;"></td
>
238 <span
class="text"><?php
xl('Provider Type','e'); ?
>: </span
>
241 <?php
echo generate_select_list("physician_type", "physician_type", '','',xl('Select Type'),'physician_type_class','','',''); ?
>
245 <!-- (CHEMED
) Calendar UI preference
-->
247 <td
><span
class="text"><?php
xl('Taxonomy','e'); ?
>: </span
></td
>
248 <td
><input type
="entry" name
="taxonomy" style
="width:120px;" value
="207Q00000X"></td
>
249 <td
><span
class="text"><?php
xl('Calendar UI','e'); ?
>: </span
></td
><td
><select name
="cal_ui" style
="width:120px;">
251 foreach (array(3 => xl('Outlook'), 1 => xl('Original'), 2 => xl('Fancy')) as $key => $value)
253 echo " <option value='$key'>$value</option>\n";
258 <!-- END (CHEMED
) Calendar UI preference
-->
261 <td
><span
class="text"><?php
xl('State License Number','e'); ?
>: </span
></td
>
262 <td
><input type
="text" name
="state_license_number" style
="width:120px;"></td
>
263 <td
class='text'><?php
xl('NewCrop eRX Role','e'); ?
>:</td
>
265 <?php
echo generate_select_list("erxrole", "newcrop_erx_role", '','','--Select Role--','','','',array('style'=>'width:120px')); ?
>
269 <?php
if ($GLOBALS['inhouse_pharmacy']) { ?
>
271 <td
class="text"><?php
xl('Default Warehouse','e'); ?
>: </td
>
274 echo generate_select_list('default_warehouse', 'warehouse',
278 <td
class="text"><?php
xl('Invoice Refno Pool','e'); ?
>: </td
>
281 echo generate_select_list('irnpool', 'irnpool', '',
282 xl('Invoice reference number pool, if used'));
289 // List the access control groups if phpgacl installed
290 if (isset($phpgacl_location) && acl_check('admin', 'acl')) {
293 <td
class='text'><?php
xl('Access Control','e'); ?
>:</td
>
294 <td
><select name
="access_group[]" multiple style
="width:120px;">
296 $list_acl_groups = acl_get_group_title_list();
297 $default_acl_group = 'Administrators';
298 foreach ($list_acl_groups as $value) {
299 if ($default_acl_group == $value) {
300 // Modified 6-2009 by BM - Translate group name if applicable
301 echo " <option value='$value' selected>" . xl_gacl_group($value) . "</option>\n";
304 // Modified 6-2009 by BM - Translate group name if applicable
305 echo " <option value='$value'>" . xl_gacl_group($value) . "</option>\n";
310 <td
><span
class="text"><?php
xl('Additional Info','e'); ?
>: </span
></td
>
311 <td
><textarea name
=info style
="width:120px;" cols
=27 rows
=4 wrap
=auto
></textarea
></td
>
314 <tr height
="25"><td colspan
="4"> 
;</td
></tr
>
322 <input type
="hidden" name
="newauthPass">
328 <tr
<?php
if ($GLOBALS['disable_non_default_groups']) echo " style='display:none'"; ?
>>
331 <form name
='new_group' method
='post' action
="usergroup_admin.php"
332 onsubmit
='return top.restoreSession()'>
334 <input type
=hidden name
=mode value
=new_group
>
335 <span
class="bold"><?php
xl('New Group','e'); ?
>:</span
>
337 <span
class="text"><?php
xl('Groupname','e'); ?
>: </span
><input type
=entry name
=groupname size
=10>
339 <span
class="text"><?php
xl('Initial User','e'); ?
>: </span
>
342 $res = sqlStatement("select distinct username from users where username != ''");
343 for ($iter = 0;$row = sqlFetchArray($res);$iter++
)
344 $result[$iter] = $row;
345 foreach ($result as $iter) {
346 print "<option value='".$iter{"username"}."'>" . $iter{"username"} . "</option>\n";
351 <input type
="submit" value
=<?php
xl('Save','e'); ?
>>
357 <tr
<?php
if ($GLOBALS['disable_non_default_groups']) echo " style='display:none'"; ?
>>
360 <form name
='new_group' method
='post' action
="usergroup_admin.php"
361 onsubmit
='return top.restoreSession()'>
362 <input type
=hidden name
=mode value
=new_group
>
363 <span
class="bold"><?php
xl('Add User To Group','e'); ?
>:</span
>
366 <?php
xl('User','e'); ?
>
370 $res = sqlStatement("select distinct username from users where username != ''");
371 for ($iter = 0;$row = sqlFetchArray($res);$iter++
)
372 $result3[$iter] = $row;
373 foreach ($result3 as $iter) {
374 print "<option value='".$iter{"username"}."'>" . $iter{"username"} . "</option>\n";
379 <span
class="text"><?php
xl('Groupname','e'); ?
>: </span
>
380 <select name
=groupname
>
382 $res = sqlStatement("select distinct name from groups");
384 for ($iter = 0;$row = sqlFetchArray($res);$iter++
)
385 $result2[$iter] = $row;
386 foreach ($result2 as $iter) {
387 print "<option value='".$iter{"name"}."'>" . $iter{"name"} . "</option>\n";
392 <input type
="submit" value
=<?php
xl('Add User To Group','e'); ?
>>
400 if (empty($GLOBALS['disable_non_default_groups'])) {
401 $res = sqlStatement("select * from groups order by name");
402 for ($iter = 0;$row = sqlFetchArray($res);$iter++
)
403 $result5[$iter] = $row;
405 foreach ($result5 as $iter) {
406 $grouplist{$iter{"name"}} .= $iter{"user"} .
407 "(<a class='link_submit' href='usergroup_admin.php?mode=delete_group&id=" .
408 $iter{"id"} . "' onclick='top.restoreSession()'>Remove</a>), ";
411 foreach ($grouplist as $groupname => $list) {
412 print "<span class='bold'>" . $groupname . "</span><br>\n<span class='text'>" .
413 substr($list,0,strlen($list)-2) . "</span><br>\n";
418 <script language
="JavaScript">
420 if ($alertmsg = trim($alertmsg)) {
421 echo "alert('$alertmsg');\n";
424 $
(document
).ready(function(){
425 $
("#cancel").click(function() {
426 parent
.$
.fn
.fancybox
.close();