コード例 #1
0
ファイル: main_menu.php プロジェクト: dsyman2/integriaims
    echo "<div>|</div>";
    echo "<a href='" . $support_link . "'>" . __('Support') . "</a></li>";
}
// Inventory
if (give_acl($config["id_user"], 0, "VR") && get_external_user($config["id_user"]) == false && $show_inventory != MENU_HIDDEN) {
    // Incident
    if ($sec == "inventory") {
        echo "<li id='current' class='inventory'>";
    } else {
        echo "<li class='inventory'>";
    }
    echo "<div>|</div>";
    echo "<a href='index.php?sec=inventory&sec2=operation/inventories/inventory'>" . __('Inventory') . "</a></li>";
}
// Customers
if ((give_acl($config["id_user"], 0, "CR") || give_acl($config["id_user"], 0, "CN")) && get_external_user($config["id_user"]) == false && $show_customers != MENU_HIDDEN) {
    if ($sec == "customers") {
        echo "<li id='current' class='customer'>";
    } else {
        echo "<li class='customer'>";
    }
    echo "<div>|</div>";
    if (give_acl($config["id_user"], 0, "CR")) {
        echo "<a href='index.php?sec=customers&sec2=operation/companies/company_detail'>" . __('Customers') . "</a></li>";
    } else {
        echo "<a href='index.php?sec=customers&sec2=operation/newsletter/newsletter_definition'>" . __("Newsletters") . "</a></lI>";
    }
}
if ($show_people != MENU_HIDDEN) {
    // Users
    if ($sec == "users") {
コード例 #2
0
}
$id_grupo = (int) get_parameter('id_grupo');
$id = (int) get_parameter('id');
$id_task = (int) get_parameter('id_task');
if ($id) {
    $incident = get_incident($id);
    if ($incident !== false) {
        $id_grupo = $incident['id_grupo'];
    }
    $blocked_incident = get_db_value_filter('blocked', 'tincidencia', array('id_incidencia' => $id));
}
$check_incident = (bool) get_parameter('check_incident');
if ($check_incident) {
    // IR and incident creator can see the incident
    if ($incident !== false && (give_acl($config['id_user'], $id_grupo, "IR") || $incident["id_creator"] == $config["id_user"])) {
        if (get_external_user($config["id_user"]) and $incident["id_creator"] != $config["id_user"]) {
            echo 0;
        } else {
            echo 1;
        }
    } else {
        echo 0;
    }
    if (defined('AJAX')) {
        return;
    }
}
if (isset($incident)) {
    //Incident creators must see their incidents
    $check_acl = enterprise_hook("incidents_check_incident_acl", array($incident, false, "IW"));
    if ($check_acl !== ENTERPRISE_NOT_HOOK && !$check_acl) {
コード例 #3
0
	$incident = get_incident ($id);
	if ($incident !== false) {
		$id_grupo = $incident['id_grupo'];
	}
	
	$blocked_incident = get_db_value_filter('blocked', 'tincidencia', array('id_incidencia'=>$id));
}

$check_incident = (bool) get_parameter ('check_incident');

if ($check_incident) {
	// IR and incident creator can see the incident
	if ($incident !== false && (give_acl ($config['id_user'], $id_grupo, "IR")
		|| ($incident["id_creator"] == $config["id_user"]))){
	
		if ((get_external_user($config["id_user"])) AND ($incident["id_creator"] != $config["id_user"]))
			echo 0;
		else
			echo 1;
	}
	else
		echo 0;
	if (defined ('AJAX'))
		return;
}

if (isset($incident)) {
	//Incident creators must see their incidents
	$check_acl = enterprise_hook("incidents_check_incident_acl", array($incident, false, "IW"));

	if ($check_acl !== ENTERPRISE_NOT_HOOK && !$check_acl) {
コード例 #4
0
ファイル: functions_form.php プロジェクト: keunes/integriaims
function incident_users_list($id_incident, $return = false)
{
    function render_sidebox_user_info($user, $label)
    {
        $output = "";
        $output .= '<div style="text-align:center;"><b>' . __($label) . ' </b></div>';
        $output .= '<div class="user_info_sidebox">';
        $output .= print_user_avatar($user, true, true);
        $output .= '<a href="index.php?sec=users&sec2=operation/users/user_edit&id=' . $user . '">';
        $output .= ' <strong>' . $user . '</strong></a><br>';
        $user_data = get_db_row("tusuario", "id_usuario", $user);
        if ($user_data["nombre_real"] != "") {
            $output .= $user_data["nombre_real"] . "<br>";
        }
        if ($user_data["telefono"] != "") {
            $output .= $user_data["telefono"] . "<br>";
        }
        if ($user_data["direccion"] != "") {
            $output .= $user_data["direccion"];
        }
        if ($user_data["id_company"] != 0) {
            $company_name = (string) get_db_value('name', 'tcompany', 'id', $user_data['id_company']);
            $output .= "<br>(<em>{$company_name}</em>)";
        }
        $output .= '</div>';
        return $output;
    }
    $output = '';
    $users = get_incident_users($id_incident);
    $output .= '<ul id="incident-users-list" class="sidemenu">';
    // OWNER
    $output .= render_sidebox_user_info($users['owner']['id_usuario'], "Responsible");
    // CREATOR
    $output .= render_sidebox_user_info($users['creator']['id_usuario'], "Creator");
    // EDITOR (if different from CREATOR)
    $editor = get_db_sql("SELECT editor FROM tincidencia WHERE id_incidencia = {$id_incident}");
    if ($editor != $users['creator']['id_usuario'] and $editor != "") {
        $output .= render_sidebox_user_info($editor, "Editor");
    }
    //if ($users['affected'])
    // PARTICIPANTS
    if ($users['affected'] == false) {
        $users['affected'] = array();
    }
    foreach ($users['affected'] as $user_item) {
        $user = $user_item["id_usuario"];
        if (!get_external_user($user)) {
            $output .= render_sidebox_user_info($user, "Participant");
        }
    }
    $output .= '</ul>';
    if ($return) {
        return $output;
    }
    echo $output;
}
コード例 #5
0
ファイル: functions_db.php プロジェクト: keunes/integriaims
/**
 * Function to get a where filter to filter results
 * by accessible companies.
 * NOT FULLY IMPLEMENTED IN OPENSOURCE version
 * Please visit http://integriaims.com for more information
*/
function get_filter_by_company_accessibility($id_user)
{
    global $config;
    $company = get_user_company($id_user, false);
    if (get_external_user($id_user)) {
        return "IN (" . $company['id'] . ")";
    }
    $return = enterprise_hook('get_filter_by_company_accessibility_extra', array($company['id']));
    if ($return !== ENTERPRISE_NOT_HOOK && !dame_admin($id_user)) {
        return $return;
    }
    return "";
}