echo user_count_holidays($edituserid, HOL_TRAINING) . " {$strdaystraining}"; echo "<br />"; echo user_count_holidays($edituserid, HOL_FREE) . " {$strdaysother}"; echo "</td></tr>"; } echo "<tr><th>{$strGroupMembership}</th><td valign='top'>"; echo $user->group->name; echo "</td></tr>"; echo "<tr><th colspan='2'>{$strWorkStatus}</th></tr>"; if ($edituserpermission and $edituserid != $sit[2] and $user->user_source == 'sit') { $userdisable = TRUE; } else { $userdisable = FALSE; } echo "<tr><th>{$strStatus}</th><td>"; echo userstatus_drop_down("status", $user->status, $userdisable); echo "</td></tr>\n"; echo "<tr><th>{$strAccepting} {$strIncidents}</th><td>"; echo accepting_drop_down("accepting", $edituserid); echo "</td></tr>\n"; echo "<tr><th>{$strMessage} " . help_link('MessageTip') . "</th>"; echo "<td><textarea name='message' rows='4' cols='40'>" . strip_tags($user->message) . "</textarea></td></tr>\n"; echo "<tr><th colspan='2'>{$strContactDetails}</th></tr>"; echo "<tr id='email'><th>{$strEmail}</th>"; echo "<td>"; if ($_SESSION['user_source'] != 'sit' and !empty($CONFIG['ldap_email'])) { echo "<input name='email' type='hidden'value='" . strip_tags($user->email) . "' />{$user->email}"; } else { echo "<input class='required' maxlength='50' name='email' size='30' "; echo "type='text' value='" . strip_tags($user->email) . "' />"; echo " <span class='required'>{$strRequired}</span>";
/** * HTML for a config variable input box * @author Ivan Lucas * @param string $setupvar The setup variable key name * @param bool $showvarnames Whether to display the config variable name * @returns string HTML */ function cfgVarInput($setupvar, $showvarnames = FALSE) { global $CONFIG, $CFGVAR; if ($CFGVAR[$setupvar]['type'] == 'languageselect' or $CFGVAR[$setupvar]['type'] == 'languagemultiselect') { $available_languages = available_languages(); } $html .= "<div class='configvar'>"; if ($CFGVAR[$setupvar]['title'] != '') { $title = $CFGVAR[$setupvar]['title']; } else { $title = $setupvar; } $html .= "<h4>{$title}</h4>"; if ($CFGVAR[$setupvar]['help'] != '') { $html .= "<p class='helptip'>{$CFGVAR[$setupvar]['help']}</p>\n"; } $value = ''; if (!$cfg_file_exists or $cfg_file_exists and $cfg_file_writable) { $value = $CONFIG[$setupvar]; if (is_bool($value)) { if ($value == TRUE) { $value = 'TRUE'; } else { $value = 'FALSE'; } } elseif (is_array($value)) { if (is_assoc($value)) { $value = "array(" . implode_assoc('=>', ',', $value) . ")"; } else { $value = "array(" . implode(',', $value) . ")"; } } if ($setupvar == 'db_password' and $_REQUEST['action'] != 'reconfigure') { $value = ''; } } $value = stripslashes($value); switch ($CFGVAR[$setupvar]['type']) { case 'select': $html .= "<select name='{$setupvar}' id='{$setupvar}'>"; if (empty($CFGVAR[$setupvar]['options'])) { $CFGVAR[$setupvar]['options'] = "TRUE|FALSE"; } $options = explode('|', $CFGVAR[$setupvar]['options']); foreach ($options as $option) { $html .= "<option value=\"{$option}\""; if ($option == $value) { $html .= " selected='selected'"; } $html .= ">{$option}</option>\n"; } $html .= "</select>"; break; case 'percent': $html .= "<select name='{$setupvar}' id='{$setupvar}'>"; for ($i = 0; $i <= 100; $i++) { $html .= "<option value=\"{$i}\""; if ($i == $value) { $html .= " selected='selected'"; } $html .= ">{$i}</option>\n"; } $html .= "</select>%"; break; case 'interfacestyleselect': $html .= interfacestyle_drop_down($setupvar, $value); break; case 'languageselect': if (empty($value)) { $value = $_SESSION['lang']; } $html .= array_drop_down($available_languages, $setupvar, $value, '', TRUE); break; case 'languagemultiselect': if (empty($value)) { foreach ($available_languages as $code => $lang) { $value[] = $code; } $checked = TRUE; } else { $checked = FALSE; $replace = array('array(', ')', "'"); $value = str_replace($replace, '', $value); $value = explode(',', $value); } $html .= array_drop_down($available_languages, $setupvar, $value, '', TRUE, TRUE); $attributes = "onchange=\"toggle_multiselect('{$setupvar}[]')\""; $html .= "<label>" . html_checkbox($setupvar . 'checkbox', $checked, ""); $html .= $GLOBALS['strAll'] . "</label>"; break; case 'slaselect': $html .= serviceleveltag_drop_down($setupvar, $value, TRUE); break; case 'userselect': $html .= user_drop_down($setupvar, $value, FALSE, FALSE, '', TRUE); break; case 'siteselect': $html .= site_drop_down($setupvar, $value, FALSE); break; case 'userstatusselect': $html .= userstatus_drop_down($setupvar, $value); break; case 'roleselect': $html .= role_drop_down($setupvar, $value); break; case 'number': $html .= "<input type='text' name='{$setupvar}' id='{$setupvar}' size='7' value=\"{$value}\" />"; break; case '1darray': $replace = array('array(', ')', "'"); $value = str_replace($replace, '', $value); $html .= "<input type='text' name='{$setupvar}' id='{$setupvar}' size='60' value=\"{$value}\" />"; break; case '2darray': $replace = array('array(', ')', "'", '\\r', '\\n'); $value = str_replace($replace, '', $value); $value = str_replace(',', "\n", $value); $html .= "<textarea name='{$setupvar}' id='{$setupvar}' cols='60' rows='10'>{$value}</textarea>"; break; case 'password': $html .= "<input type='password' id='cfg{$setupvar}' name='{$setupvar}' size='16' value=\"{$value}\" /> " . password_reveal_link("cfg{$setupvar}"); break; case 'ldappassword': $html .= "<input type='password' id='cfg{$setupvar}' name='{$setupvar}' size='16' value=\"{$value}\" /> " . password_reveal_link("cfg{$setupvar}"); $html .= " <a href='javascript:void(0);' onclick=\"checkLDAPDetails('status{$setupvar}');\">{$GLOBALS['strCheckLDAPDetails']}</a>"; break; case 'text': default: if (strlen($CONFIG[$setupvar]) < 65) { $html .= "<input type='text' name='{$setupvar}' id='{$setupvar}' size='60' value=\"{$value}\" />"; } else { $html .= "<textarea name='{$setupvar}' id='{$setupvar}' cols='60' rows='10'>{$value}</textarea>"; } } if (!empty($CFGVAR[$setupvar]['unit'])) { $html .= " {$CFGVAR[$setupvar]['unit']}"; } if (!empty($CFGVAR[$setupvar]['helplink'])) { $html .= ' ' . help_link($CFGVAR[$setupvar]['helplink']); } if ($setupvar == 'db_password' and $_REQUEST['action'] != 'reconfigure' and $value != '') { $html .= "<p class='info'>The current password setting is not shown</p>"; } if ($showvarnames) { $html .= "<br />(<var>\$CONFIG['{$setupvar}']</var>)"; } if ($CFGVAR[$setupvar]['statusfield'] == 'TRUE') { $html .= "<div id='status{$setupvar}'></div>"; } $html .= "</div>"; $html .= "<br />\n"; if ($c == 1) { $c == 2; } else { $c = 1; } return $html; }