コード例 #1
0
ファイル: sla.inc.php プロジェクト: nicdev007/sitracker
/**
    * @author Ivan Lucas
    * @deprecated
    * @note DEPRECATED service level tags should be used in favour of service level ID's
    * @note Temporary solution, eventually we will move away from using servicelevel id's  and just use tags instead
*/
function servicelevel_id2tag($id)
{
    global $dbServiceLevels;
    return db_read_column('tag', $dbServiceLevels, $id);
}
コード例 #2
0
ファイル: incident_add.php プロジェクト: nicdev007/sitracker
 if (mysql_error()) {
     trigger_error("MySQL Query Error " . mysql_error(), E_USER_WARNING);
 }
 if (mysql_num_rows($result) > 0) {
     $html = "<h3>{$strCustomers}</h3>\n";
     $html .= "<p align='center'>{$strThisListShowsCustomers}</p>";
     $html .= "<table align='center'>";
     $html .= "<tr>";
     $html .= "<th>&nbsp;</th>";
     $html .= "<th>{$strName}</th>";
     $html .= "<th>{$strSite}</th>";
     $html .= "</tr>\n";
     $customermatches = 0;
     while ($contactrow = mysql_fetch_array($result)) {
         $html .= "<tr class='shade2'>";
         $site_incident_pool = db_read_column('freesupport', $dbSites, $contactrow['siteid']);
         if ($site_incident_pool > 0) {
             $html .= "<td><a href=\"{$_SERVER['PHP_SELF']}?action=incidentform&amp;type=free&amp;contactid=" . $contactrow['contactid'] . "&amp;updateid={$updateid}&amp;win={$win}\" onclick=\"return confirm_free();\">";
             $html .= "{$strAddSiteSupportIncident}</a> ({$site_incident_pool})</td>";
             $customermatches++;
         } else {
             $html .= "<td class='expired'>{$strZeroRemaining}</td>";
         }
         $html .= '<td>' . $contactrow['forenames'] . ' ' . $contactrow['surname'] . '</td>';
         $html .= '<td>' . site_name($contactrow['siteid']) . '</td>';
         $html .= "</tr>\n";
     }
     $html .= "</table>\n";
     if ($customermatches > 0) {
         echo $html;
     }
コード例 #3
0
ファイル: feedback.php プロジェクト: sitracker/sitracker_old
 if (mysql_error()) {
     trigger_error(mysql_error(), E_USER_WARNING);
 }
 if (mysql_num_rows($result) < 1) {
     echo "<h2>{$strError}</h2>";
     echo "<p>{$strNoFeedBackFormToCompleteHere}</p>";
     echo "\n\n<!-- f: {$formid} r:{$respondent} rr:{$responseref} dh:{$decodehash}  hc:{$hashcode} -->\n\n";
 } else {
     $reqd = 0;
     while ($form = mysql_fetch_object($result)) {
         echo "<form action='feedback.php' method='post'>\n";
         echo "<h2>{$form->name}</h2>\n";
         echo "<p>{$strRelatingToIncident} <strong>#{$incidentid}</strong> &mdash; <strong>" . incident_title($incidentid) . "</strong><br />";
         echo sprintf($strOpenedbyXonY, contact_realname(incident_contact($incidentid)), ldate($CONFIG['dateformat_date'], db_read_column('opened', $dbIncidents, $incidentid)));
         echo ' &nbsp; ';
         echo sprintf($strClosedOnX, ldate($CONFIG['dateformat_date'], db_read_column('closed', $dbIncidents, $incidentid))) . ".</p>";
         if (!empty($_REQUEST['error'])) {
             echo "<p style='color: red'>{$strErrorRequiredQuestionsNotCompleted}</p>";
         }
         echo nl2br($form->introduction);
         $qsql = "SELECT * FROM `{$dbFeedbackQuestions}` ";
         $qsql .= "WHERE formid='{$form->id}' ";
         $qsql .= "ORDER BY taborder ASC";
         $qresult = mysql_query($qsql);
         if (mysql_error()) {
             trigger_error(mysql_error(), E_USER_WARNING);
         }
         while ($question = mysql_fetch_object($qresult)) {
             if (strlen(trim($question->sectiontext)) > 3) {
                 echo "<hr />{$question->sectiontext}\n";
             }
コード例 #4
0
                     trigger_error("MySQL Query Error " . mysql_error(), E_USER_ERROR);
                 }
             }
         }
     }
     //tidy up temp reassigns
     $sql = "DELETE FROM `{$dbTempAssigns}` WHERE incidentid = '{$id}'";
     $result = mysql_query($sql);
     if (mysql_error()) {
         trigger_error("MySQL Query Error " . mysql_error(), E_USER_ERROR);
     }
 }
 $bodytext = "{$SYSLANG['strClosingStatus']}: <b>" . closingstatus_name($closingstatus) . "</b>\n\n" . $bodytext;
 if ($addition_errors == 0) {
     //maintenceid
     $send_feedback = send_feedback(db_read_column('maintenanceid', $dbIncidents, $id));
     if ($CONFIG['feedback_form'] != '' and $CONFIG['feedback_form'] > 0 and $send_feedback == TRUE) {
         create_incident_feedback($CONFIG['feedback_form'], $id);
     }
     $notifyexternal = $notifycontact = $awaitingclosure = 0;
     if ($send_engineer_email == 'yes') {
         $notifyexternal = 1;
     }
     if ($send_email == 'yes') {
         $notifycontact = 1;
         if ($wait == 'yes') {
             $awaitingclosure = 1;
         } else {
             $awaitingclosure = 0;
         }
     }
コード例 #5
0
ファイル: triggers.php プロジェクト: sitracker/sitracker_old
    $selecteduser = $_REQUEST['user'];
} else {
    $selecteduser = $_SESSION['userid'];
}
if ($_GET['user'] == '0') {
    $title = $strSystemActions;
} else {
    $title = $strNotifications;
}
switch ($_REQUEST['mode']) {
    case 'delete':
        $id = cleanvar($_GET['id']);
        if (!is_numeric($id)) {
            html_redirect($_SERVER['PHP_SELF'], FALSE);
        }
        $triggerowner = db_read_column('userid', $dbTriggers, $id);
        if ($triggerowner == 0 and !user_permission($sit[2], 72)) {
            html_redirect($_SERVER['PHP_SELF'] . "?user={$selecteduser}", FALSE, $strPermissionDenied);
        } elseif ($triggerowner != 0 and $triggerowner != $sit[2] and !user_permission($sit[2], 72)) {
            html_redirect($_SERVER['PHP_SELF'] . "?user={$selecteduser}", FALSE, $strPermissionDenied);
        } elseif ($triggerowner == $sit[2] and !user_permission($sit[2], 71)) {
            html_redirect($_SERVER['PHP_SELF'] . "?user={$selecteduser}", FALSE, $strPermissionDenied);
        } else {
            $sql = "DELETE FROM `{$dbTriggers}` WHERE id = {$id} LIMIT 1";
            mysql_query($sql);
            if (mysql_error()) {
                trigger_error("MySQL Query Error " . mysql_error(), E_USER_WARNING);
            }
            if (mysql_affected_rows() >= 1) {
                html_redirect($_SERVER['PHP_SELF'] . "?user={$selecteduser}");
            } else {
コード例 #6
0
ファイル: users.php プロジェクト: sitracker/sitracker_old
 echo "<a href='mailto:{$users->email}' title='{$strEmail} ";
 echo "{$users->realname}'>";
 echo icon('email', 16, $strEmail) . "</a> ";
 echo "<a href='incidents.php?user={$users->id}&amp;queue=1&amp;";
 echo "type=support' class='info'>";
 if (!empty($users->message)) {
     echo icon('messageflag', 16, $strMessage, $users->message);
 }
 echo " {$users->realname}";
 echo "<span>";
 echo gravatar($users->email, 50, FALSE);
 if (!empty($users->title)) {
     echo "<strong>{$users->title}</strong><br />";
 }
 if ($users->groupid > 0) {
     echo "{$strGroup}: " . db_read_column("name", $GLOBALS['dbGroups'], $users->groupid) . "<br />";
 }
 if (strlen($users->aim) > 3) {
     echo icon('aim', 16, $users->aim);
     echo " <strong>AIM</strong>: {$users->aim}<br />";
 }
 if (strlen($users->icq) > 3) {
     echo icon('icq', 16, $users->icq);
     echo " <strong>ICQ</strong>: {$users->icq}<br />";
 }
 if (strlen($users->msn) > 3) {
     echo icon('msn', 16, $users->msn);
     echo " <strong>MSN</strong>: {$users->msn}<br />";
 }
 if (!empty($users->message)) {
     echo "<br />" . icon('messageflag', 16);
コード例 #7
0
        echo "<input name='submit' type='submit' value='{$strSave}' /></p>";
        echo "</form>";
        echo protectform('permissionsform');
    }
} elseif ($action == "edit" && (!empty($user) or !empty($role))) {
    // Show form
    if (!empty($role) and !empty($user)) {
        trigger_error("{$strCannotEditUserAndRole}", E_USER_ERROR);
    }
    if (!empty($user)) {
        // Echo lines have been moved to simplify i18n - Tomse 02Aug09
        //        $object = "user: "******"<h2>" . sprintf($strSetPermissionsForUserX, user_realname($user)) . "</h2>";
    } else {
        //        $object = "role: ".db_read_column('rolename', $dbRoles, $role);
        echo "<h2>" . sprintf($strSetPermissionsForRoleX, db_read_column('rolename', $dbRoles, $role)) . "</h2>";
    }
    //    echo "<h2>".sprintf($strSetPermissionsForUserX, user_realname($user))."</h2>";
    if (!empty($user)) {
        echo "<p align='center'>{$strPermissionsInhereitedCannotBeChanged}</p>";
    }
    // Next lookup the permissions
    $sql = "SELECT * FROM `{$dbUsers}` AS u, `{$dbRolePermissions}` AS rp WHERE u.roleid = rp.roleid AND u.id = '{$user}' AND granted='true'";
    $result = mysql_query($sql);
    if (mysql_error()) {
        trigger_error(mysql_error(), E_USER_ERROR);
    }
    $userrolepermission = array();
    if (mysql_num_rows($result) >= 1) {
        while ($roleperm = mysql_fetch_object($result)) {
            $userrolepermission[] = $roleperm->permissionid;
コード例 #8
0
function holding_email_update_id($holding_email)
{
    $holding_email = intval($holding_email);
    return db_read_column('updateid', $GLOBALS['dbTempIncoming'], $holding_email);
}
コード例 #9
0
 if ($oldexternalid != $externalid) {
     $header .= "External ID: ";
     if ($oldexternalid != '') {
         $header .= $oldexternalid;
     } else {
         $header .= "None";
     }
     $header .= " -&gt; <b>";
     if ($externalid != '') {
         $header .= $externalid;
     } else {
         $header .= "None";
     }
     $header .= "</b>\n";
 }
 $escalationpath = db_read_column('name', $dbEscalationPaths, $escalationpath);
 if ($oldccemail != $ccemail) {
     $header .= "CC Email: " . $oldccemail . " -&gt; <b>" . $ccemail . "</b>\n";
 }
 if ($oldescalationpath != $escalationpath) {
     $header .= "Escalation: " . $oldescalationpath . " -&gt; <b>" . $escalationpath . "</b>\n";
 }
 if ($oldexternalengineer != $externalengineer) {
     $header .= "External Engineer: " . $oldexternalengineer . " -&gt; <b>" . $externalengineer . "</b>\n";
 }
 if ($oldexternalemail != $externalemail) {
     $header .= "External email: " . $oldexternalemail . " -&gt; <b>" . $externalemail . "</b>\n";
 }
 if ($oldsoftware != $software) {
     $header .= "Skill: " . software_name($oldsoftware) . " -&gt; <b>" . software_name($software) . "</b>\n";
 }
コード例 #10
0
require APPLICATION_LIBPATH . 'auth.inc.php';
// External variables
$action = mysql_real_escape_string($_REQUEST['action']);
$productid = cleanvar($_REQUEST['productid']);
$softwareid = cleanvar($_REQUEST['softwareid']);
$context = cleanvar($_REQUEST['context']);
$return = cleanvar($_REQUEST['return']);
if (empty($action) or $action == "showform") {
    $title = $strAddLink;
    include APPLICATION_INCPATH . 'htmlheader.inc.php';
    echo "<h2>{$title}</h2>";
    echo "<form action='{$_SERVER['PHP_SELF']}?action=add' method='post'>\n";
    echo "<input type='hidden' name='context' value='{$context}' />\n";
    if (empty($productid)) {
        if (!empty($softwareid)) {
            $name = db_read_column('name', $dbSoftware, $softwareid);
            echo "<h3>" . icon('skill', 16) . " ";
            echo "{$strSkill}: {$name}</h3>";
        }
        echo "<input name=\"softwareid\" type=\"hidden\" value=\"{$softwareid}\" />\n";
        echo "<p align='center'>{$strProduct}: " . icon('product', 16) . " ";
        echo product_drop_down("productid", 0);
        echo "</p>";
    } else {
        $sql = "SELECT name FROM `{$dbProducts}` WHERE id='{$productid}' ";
        $result = mysql_query($sql);
        if (mysql_error()) {
            trigger_error("MySQL Query Error " . mysql_error(), E_USER_WARNING);
        }
        list($product) = mysql_fetch_row($result);
        echo "<h3>{$strProduct}: {$product}</h3>";
コード例 #11
0
        exit;
    }
    $transactionid = cleanvar($_REQUEST['transactionid']);
    $selected = $_POST['selected'];
    if (!empty($transactionid)) {
        $status = true;
        $status = approve_incident_transaction($transactionid);
        $maintid = maintid_from_transaction($transactionid);
        $percent = get_service_percentage($maintid);
    } elseif (!empty($selected)) {
        $status = TRUE;
        foreach ($selected as $s) {
            $l = approve_incident_transaction($s);
            $status = $status and $l;
            $maintid = maintid_from_transaction($s);
            $p = get_service_percentage($maintid);
            if (p == FALSE) {
                $percent = true;
            }
        }
    }
    if ($percent !== FALSE) {
        $siteid = db_read_column('site', $dbMaintenance, $maintid);
        trigger('TRIGGER_SERVICE_LIMIT', array('contractid' => $maintid, 'serviceremaining' => $percent, 'siteid' => $siteid));
    }
    if ($status) {
        html_redirect("{$_SERVER['PHP_SELF']}?mode=approvalpage&amp;startdate={$startdateorig}&amp;enddate={$enddateorig}&amp;showonlyapproved={$showonlyapproved}");
    } else {
        html_redirect("{$_SERVER['PHP_SELF']}?mode=approvalpage&amp;startdate={$startdateorig}&amp;enddate={$enddateorig}&amp;showonlyapproved={$showonlyapproved}", FALSE, $strError);
    }
}