コード例 #1
0
$search_range = cleanvar($_REQUEST['search_range']);
$search_date = cleanvar($_REQUEST['search_date']);
$search_user = cleanvar($_REQUEST['search_user']);
$action = cleanvar($_REQUEST['action']);
include APPLICATION_INCPATH . 'htmlheader.inc.php';
// show search incidents form
if (empty($action)) {
    echo "<h2>" . icon('search', 32) . " ";
    echo "{$strSearch} ({$strAdvanced})</h2>";
    echo "<form action=\"{$_SERVER['PHP_SELF']}\" method='get'>";
    echo "<table class='vertical'>";
    echo "<tr><th colspan='2'>{$strIncidents}</th><tr>\n";
    echo "<tr><th>{$strTitle}:</th><td><input maxlength='100' name='search_title' size='30' type='text' /></td></tr>\n";
    echo "<tr><th>{$strIncident} ID:</th><td><input maxlength='100' name='search_id' size='30' type='text' /></td></tr>\n";
    echo "<tr><th>{$strExternalID}:</th><td><input maxlength='100' name='search_externalid' size='30' type='text' /></td></tr>\n";
    echo "<tr><th>{$strServiceLevel}:</th><td>" . serviceleveltag_drop_down('search_servicelevel', 0, TRUE) . "</td></tr>\n";
    echo "<tr><th>{$strContact}:</th><td><input maxlength='100' name='search_contact' size='30' type='text' /></td></tr>\n";
    echo "<tr><th>{$strPriority}:</th><td>" . priority_drop_down('search_priority', 0) . "</td></tr>\n";
    echo "<tr><th>{$strProduct}:</th><td>" . product_drop_down('search_product', 0) . "</td></tr>\n";
    echo "<tr><th>{$strDetails}:</th><td><input maxlength='100' name='search_details' size='30' type='text' /></td></tr>\n";
    echo "<tr><th>{$strStatus}<br />{$strOpen}/{$strClosed}:</th><td>";
    echo "<select size='1' name='search_range'>";
    echo "<option selected='selected' value='All'>{$strAll}</option>";
    echo "<option value='Open'>{$strAllOpen}</option>";
    echo "<option value='Closed'>{$strAllClosed}</option>";
    echo "</select>\n";
    echo "</td></tr>\n";
    echo "<tr><th>{$strLastUpdated}:</th><td width='300'>";
    echo "<select size='1' name='search_date'>";
    echo "<option selected='selected' value='All'>{$strAll}</option>";
    echo "<option value='Recent180'>" . sprintf($strPreviousXMonths, 6) . "</option>";
コード例 #2
0
ファイル: incident_add.php プロジェクト: nicdev007/sitracker
     $updaterow = mysql_fetch_array($result);
     $mailed_body_text = $updaterow['bodytext'];
     $sql = "SELECT subject FROM `{$dbTempIncoming}` WHERE updateid={$updateid}";
     $result = mysql_query($sql);
     if (mysql_error()) {
         trigger_error("MySQL Query Error " . mysql_error(), E_USER_WARNING);
     }
     $updaterow = mysql_fetch_array($result);
     $mailed_subject = $updaterow['subject'];
     echo "<tr><td><label for='incidenttitle'>{$strIncidentTitle}</label><br />";
     echo "<input class='required' maxlength='200' id='incidenttitle' ";
     echo "name='incidenttitle' size='50' type='text' value=\"" . htmlspecialchars($mailed_subject, ENT_QUOTES) . "\" />";
     echo " <span class='required'>{$strRequired}</span></td>\n";
     echo "<td>";
     if ($type == 'free') {
         echo "<th>{$strServiceLevel}</th><td>" . serviceleveltag_drop_down('servicelevel', $CONFIG['default_service_level'], TRUE) . "</td>";
         echo "<th>{$strSkill}</th><td>" . skill_drop_down('software', 0) . "</td></tr>";
     } else {
         echo "<label for='software'>{$strSkill}</label><br />" . softwareproduct_drop_down('software', 1, $productid);
     }
     echo "</td></tr>";
     echo "<tr><td colspan='2'>&nbsp;</td></tr>\n";
     echo "<tr><th>{$strProblemDescription}<br /><span style='font-weight: normal'>{$strReceivedByEmail}</span></th>";
     echo "<td>" . parse_updatebody($mailed_body_text) . "</td></tr>\n";
     echo "<tr><td class='shade1' colspan='2'>&nbsp;</td></tr>\n";
 }
 echo "<tr><td><strong>{$strNextAction}</strong><br />";
 //     echo "<input type='text' name='nextaction' maxlength='50' size='30' value='Initial Response' /><br /><br />";
 echo show_next_action();
 echo "</td>";
 echo "<td colspan='2'>";
コード例 #3
0
/**
 * 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 .= " &nbsp; <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;
}