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();
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"); ?
>
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";
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.
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);
61 function submitform() {
63 var valid
= submitme(1, undefined
, 'new_user', collectvalidation
);
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
);
73 var pwdresult
= passwordvalidate(password
);
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'; ?>");
79 } //secure_pwd if ends here
81 <?php
if($GLOBALS['erx_enable']){ ?
>
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
);
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
;
137 <style type
="text/css">
138 .physician_type_class
{
139 width
: 120px
!important
;
143 <body
class="body_top">
145 <span
class="title"><?php
xl('Add User','e'); ?
></span
> 
;</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
>
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"> 
;</span
>
164 <table border
=0 cellpadding
=0 cellspacing
=0 style
="width:600px;">
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"> 
;*</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"> 
;*</span
></td
>
170 <td
> <input type
="hidden" value
="124" name
="stiltskin" /></td
>
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
>
180 <td
><span
class="text"<?php
if ($GLOBALS['disable_non_default_groups']) echo " style='display:none'"; ?
>><?php
xl('Groupname','e'); ?
>: </span
></td
>
182 <select name
=groupname
<?php
if ($GLOBALS['disable_non_default_groups']) echo " style='display:none'"; ?
>>
184 $res = sqlStatement("select distinct name from groups");
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";
193 <td
><span
class="text"><?php
xl('Provider','e'); ?
>: </span
></td
><td
>
194 <input type
='checkbox' name
='authorized' value
='1' onclick
='authorized_clicked()' />
195  
; 
;<span
class='text'><?php
xl('Calendar','e'); ?
>:
196 <input type
='checkbox' name
='calendar' disabled
/>
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"> 
;*</span
></td
>
201 <td
><span
class="text"><?php
xl('Middle Name','e'); ?
>: </span
></td
><td
><input type
=entry name
='mname' style
="width:120px;"></td
>
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"> 
;*</span
></td
>
205 <td
><span
class="text"><?php
xl('Default Facility','e'); ?
>: </span
></td
><td
><select style
="width:120px;" name
=facility_id
>
207 $fres = $facilityService->getAllServiceLocations();
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
>
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
>
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;">
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";
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
>
244 <span
class="text"><?php
xl('Provider Type','e'); ?
>: </span
>
247 <?php
echo generate_select_list("physician_type", "physician_type", '','',xl('Select Type'),'physician_type_class','','',''); ?
>
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
> 
;</td
><td
> 
;</td
></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
>
261 <?php
echo generate_select_list("erxrole", "newcrop_erx_role", '','','--Select Role--','','','',array('style'=>'width:120px')); ?
>
265 <?php
if ($GLOBALS['inhouse_pharmacy']) { ?
>
267 <td
class="text"><?php
xl('Default Warehouse','e'); ?
>: </td
>
270 echo generate_select_list('default_warehouse', 'warehouse',
274 <td
class="text"><?php
xl('Invoice Refno Pool','e'); ?
>: </td
>
277 echo generate_select_list('irnpool', 'irnpool', '',
278 xl('Invoice reference number pool, if used'));
285 // List the access control groups if phpgacl installed
286 if (isset($phpgacl_location) && acl_check('admin', 'acl')) {
289 <td
class='text'><?php
xl('Access Control','e'); ?
>:</td
>
290 <td
><select name
="access_group[]" multiple style
="width:120px;">
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";
300 // Modified 6-2009 by BM - Translate group name if applicable
301 echo " <option value='$value'>" . xl_gacl_group($value) . "</option>\n";
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
>
310 <tr height
="25"><td colspan
="4"> 
;</td
></tr
>
318 <input type
="hidden" name
="newauthPass">
324 <tr
<?php
if ($GLOBALS['disable_non_default_groups']) echo " style='display:none'"; ?
>>
327 <form name
='new_group' method
='post' action
="usergroup_admin.php"
328 onsubmit
='return top.restoreSession()'>
330 <input type
=hidden name
=mode value
=new_group
>
331 <span
class="bold"><?php
xl('New Group','e'); ?
>:</span
>
333 <span
class="text"><?php
xl('Groupname','e'); ?
>: </span
><input type
=entry name
=groupname size
=10>
335 <span
class="text"><?php
xl('Initial User','e'); ?
>: </span
>
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";
347 <input type
="submit" value
=<?php
xl('Save','e'); ?
>>
353 <tr
<?php
if ($GLOBALS['disable_non_default_groups']) echo " style='display:none'"; ?
>>
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
>
362 <?php
xl('User','e'); ?
>
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";
375 <span
class="text"><?php
xl('Groupname','e'); ?
>: </span
>
376 <select name
=groupname
>
378 $res = sqlStatement("select distinct name from groups");
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";
388 <input type
="submit" value
=<?php
xl('Add User To Group','e'); ?
>>
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">
416 if ($alertmsg = trim($alertmsg)) {
417 echo "alert('$alertmsg');\n";
420 $
(document
).ready(function(){
421 $
("#cancel").click(function() {
422 parent
.$
.fn
.fancybox
.close();