• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP enterprise_hook函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中enterprise_hook函数的典型用法代码示例。如果您正苦于以下问题:PHP enterprise_hook函数的具体用法?PHP enterprise_hook怎么用?PHP enterprise_hook使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了enterprise_hook函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: load_file

function load_file($users_file, $group, $profile, $nivel, $pass_policy, $avatar)
{
    $file_handle = fopen($users_file, "r");
    global $config;
    enterprise_include('include/functions_license.php', true);
    $is_manager_profile = enterprise_hook('license_check_manager_profile', array($profile));
    if ($is_manager_profile == ENTERPRISE_NOT_HOOK) {
        $users_check = true;
    } else {
        if ($is_manager_profile) {
            $users_check = enterprise_hook('license_check_manager_users_num');
        } else {
            $users_check = enterprise_hook('license_check_regular_users_num');
        }
    }
    while (!feof($file_handle) && $users_check === true) {
        $line = fgets($file_handle);
        preg_match_all('/(.*),/', $line, $matches);
        $values = explode(',', $line);
        $id_usuario = $values[0];
        $pass = $values[1];
        $pass = md5($pass);
        $nombre_real = $values[2];
        $mail = $values[3];
        $tlf = $values[4];
        $desc = $values[5];
        $avatar = $values[6];
        $disabled = $values[7];
        $id_company = $values[8];
        $num_employee = $values[9];
        $enable_login = $values[10];
        $force_change_pass = 0;
        if ($pass_policy) {
            $force_change_pass = 1;
        }
        $value = array('id_usuario' => $id_usuario, 'nombre_real' => $nombre_real, 'password' => $pass, 'comentarios' => $desc, 'direccion' => $mail, 'telefono' => $tlf, 'nivel' => $nivel, 'avatar' => $avatar, 'disabled' => $disabled, 'id_company' => $id_company, 'num_employee' => $num_employee, 'enable_login' => $enable_login, 'force_change_pass' => $force_change_pass);
        if ($id_usuario != '' && $nombre_real != '') {
            if ($id_usuario == get_db_value('id_usuario', 'tusuario', 'id_usuario', $id_usuario)) {
                echo ui_print_error_message(__('User ') . $id_usuario . __(' already exists'), '', true, 'h3', true);
            } else {
                $resul = process_sql_insert('tusuario', $value);
                if ($resul == false) {
                    $value2 = array('id_usuario' => $id_usuario, 'id_perfil' => $profile, 'id_grupo' => $group, 'assigned_by' => $config["id_user"]);
                    if ($id_usuario != '') {
                        process_sql_insert('tusuario_perfil', $value2);
                    }
                }
            }
        }
    }
    if ($users_check === false) {
        echo ui_print_error_message(__('The number of users has reached the license limit'), '', true, 'h3', true);
    }
    fclose($file_handle);
    echo ui_print_success_message(__('File loaded'), '', true, 'h3', true);
    return;
}
开发者ID:articaST,项目名称:integriaims,代码行数:57,代码来源:functions_user.php


示例2: get_event_date_sql

function get_event_date_sql($start_date, $end_date, $id_user = '')
{
    global $config;
    if (empty($id_user)) {
        $id_user = $config["id_user"];
    }
    $return = enterprise_hook('get_event_date_sql_extra', array($start_date, $end_date, $id_user));
    if ($return !== ENTERPRISE_NOT_HOOK) {
        $sql = $return;
    } else {
        $sql = sprintf("SELECT *\n\t\t\t\t\t\tFROM tagenda\n\t\t\t\t\t\tWHERE (id_user = '%s' OR public = 1)\n\t\t\t\t\t\t\tAND timestamp >= '%s'\n\t\t\t\t\t\t\tAND timestamp <= '%s'\n\t\t\t\t\t\tORDER BY timestamp ASC", $id_user, $end_date, $start_date);
    }
    return $sql;
}
开发者ID:dsyman2,项目名称:integriaims,代码行数:14,代码来源:functions_agenda.php


示例3: check_incident_access

function check_incident_access($id)
{
    global $config;
    if ($id) {
        $incident = get_incident($id);
        if ($incident !== false) {
            $id_grupo = $incident['id_grupo'];
        } else {
            echo "<h1>" . __("Ticket") . "</h1>";
            echo ui_print_error_message(__("There is no information for this ticket"), '', true, 'h3', true);
            echo "<br>";
            echo "<a style='margin-left: 90px' href='index.php?sec=incidents&sec2=operation/incidents/incident_search'>" . __("Try the search form to find the ticket") . "</a>";
            return false;
        }
    }
    if (isset($incident)) {
        //Incident creators must see their incidents
        $check_acl = enterprise_hook("incidents_check_incident_acl", array($incident));
        $standalone_check = enterprise_hook("manage_standalone", array($incident));
        if ($check_acl !== ENTERPRISE_NOT_HOOK && !$check_acl || $standalone_check !== ENTERPRISE_NOT_HOOK && !$standalone_check) {
            // Doesn't have access to this page
            audit_db($config['id_user'], $config["REMOTE_ADDR"], "ACL Violation", "Trying to access to ticket (External user) " . $id);
            include "general/noaccess.php";
            return false;
        }
    } else {
        if (!give_acl($config['id_user'], $id_grupo, "IR")) {
            // Doesn't have access to this page
            audit_db($config['id_user'], $config["REMOTE_ADDR"], "ACL Violation", "Trying to access to ticket " . $id);
            include "general/noaccess.php";
            return false;
        } else {
            //No incident but ACLs enabled
            echo ui_print_error_message(__("The ticket doesn't exist"), '', true, 'h3', true);
            return false;
        }
    }
    return true;
}
开发者ID:articaST,项目名称:integriaims,代码行数:39,代码来源:incident_summary.php


示例4: check_login

// ==================================================
// Copyright (c) 2008 Ártica Soluciones Tecnológicas
// http://www.artica.es  <[email protected]>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
global $config;
check_login();
include_once 'include/functions_crm.php';
$read = enterprise_hook('crm_check_user_profile', array($config['id_user'], 'cr'));
$write = enterprise_hook('crm_check_user_profile', array($config['id_user'], 'cw'));
$manage = enterprise_hook('crm_check_user_profile', array($config['id_user'], 'cm'));
$enterprise = false;
if ($result === ENTERPRISE_NOT_HOOK) {
    $read = true;
    $write = true;
    $manage = true;
} else {
    $enterprise = true;
    if (!$read) {
        include "general/noaccess.php";
        exit;
    }
}
$search_text = (string) get_parameter('search_text');
$search_role = (int) get_parameter("search_role");
$search_country = (string) get_parameter("search_country");
开发者ID:dsyman2,项目名称:integriaims,代码行数:31,代码来源:company_statistics.php


示例5: print_image

         echo $row["name"] . '&nbsp;&nbsp;<a href="index.php?sec=inventory&sec2=operation/inventories/inventory_detail&id=' . $row['id'] . '">' . print_image("images/application_edit.png", true, array("style" => 'vertical-align: middle;')) . '</a>';
         echo "</a>";
         if ($end) {
             echo "<div hiddenDiv='1' loadDiv='0' class='tree_view' id='tree_div" . $aux_ref_tree . "_inventory_" . $row["id"] . "'></div>";
         } else {
             echo "<div hiddenDiv='1' loadDiv='0' class='tree_view tree_view_branch' id='tree_div" . $aux_ref_tree . "_inventory_" . $row["id"] . "'></div>";
         }
         echo "</li>";
     }
 }
 echo "</ul>\n";
 //TERCER NIVEL DEL ARBOL.
 if ($type == 'inventory') {
     $sql = "SELECT id FROM tinventory WHERE `id_parent`={$id_item}";
     $cont_invent = get_db_all_rows_sql($sql);
     $cont = enterprise_hook('inventory_get_user_inventories', array($config['id_user'], $cont_invent));
     if ($cont === ENTERPRISE_NOT_HOOK) {
         $cont = $cont_invent;
     }
     if (!$cont) {
         $cont = array();
     }
     $countRows = count($cont);
     $count_blanks = strlen($ref_tree);
     if ($countRows == false) {
         $countRows = 0;
     }
     if ($countRows == 0) {
         echo "<ul style='margin: 0; padding: 0;'>\n";
         echo "<li style='margin: 0; padding: 0;'>";
         echo "<i>" . __("Empty") . "</i>";
开发者ID:dsyman2,项目名称:integriaims,代码行数:31,代码来源:inventory_search.php


示例6: print_groups_table

function print_groups_table($groups)
{
    enterprise_include("include/functions_groups.php");
    $return = enterprise_hook('print_groups_table_extra', array($groups));
    if ($return === ENTERPRISE_NOT_HOOK) {
        echo "<div class='divresult'>";
        echo '<table width="99%" class="listing" id="table1">';
        echo '<thead>';
        echo '<tr>';
        echo '<th class="header c0" scope="col">' . __('Users') . '</th>';
        echo '<th class="header c1" scope="col">' . __('Icon') . '</th>';
        echo '<th class="header c2" scope="col">' . __('Name') . '</th>';
        echo '<th class="header c3" scope="col">' . __('Parent') . '</th>';
        echo '<th class="header c4" scope="col">' . __('Delete') . '</th>';
        echo '</tr>';
        echo '</thead>';
        $count = 0;
        if ($groups === false) {
            $groups = array();
        }
        if (!empty($groups)) {
            foreach ($groups as $group) {
                $data = array();
                $num_users = get_db_value("COUNT(id_usuario)", "tusuario_perfil", "id_grupo", $group["id_grupo"]);
                if ($num_users > 0) {
                    $users_icon = '<a href="javascript:"><img src="images/group.png" title="' . __('Show and hide the user list') . '" /></a>';
                } else {
                    $users_icon = '';
                }
                $icon = '';
                if ($group['icon'] != '') {
                    $icon = '<img src="images/groups_small/' . $group['icon'] . '" />';
                }
                if ($group["id_grupo"] != 1) {
                    $group_name = '<a href="index.php?sec=users&sec2=godmode/grupos/configurar_grupo&id=' . $group['id_grupo'] . '">' . $group['nombre'] . '</a>';
                } else {
                    $group_name = $group["nombre"];
                }
                $parent = dame_nombre_grupo($group["parent"]);
                //Group "all" is special not delete and no update
                if ($group["id_grupo"] != 1) {
                    $delete_button = '<a href="index.php?sec=users&
							sec2=godmode/grupos/lista_grupos&
							id_grupo=' . $group["id_grupo"] . '&
							delete_group=1&id=' . $group["id_grupo"] . '" onClick="if (!confirm(\'' . __('Are you sure?') . '\')) 
							return false;">
							<img src="images/cross.png"></a>';
                } else {
                    $delete_button = "";
                }
                echo '<tr id="table1-' . $count . '" style="border:1px solid #505050;" class="datos2">';
                echo '<td id="table1-' . $count . '-0" style="text-align:center; width:40px;" class="datos2">' . $users_icon . '</td>';
                echo '<td id="table1-' . $count . '-1" style="width:40px;" class="datos2">' . $icon . '</td>';
                echo '<td id="table1-' . $count . '-2" style=" font-weight: bold;" class="datos2">' . $group_name . '</td>';
                echo '<td id="table1-' . $count . '-3" style="" class="datos2">' . $parent . '</td>';
                echo '<td id="table1-' . $count . '-4" style=" text-align:center; width:40px;" class="datos2">' . $delete_button . '</td>';
                echo '</tr>';
                echo '<tr id="table1-' . $count . '-users" style="display:none;">';
                echo '<td colspan="5" style="text-align:center; background-color:#e6e6e6;">';
                echo '<table width="99%" cellpadding="0" cellspacing="0" border="0px" id="table_users_' . $count . '">';
                echo '<tr style="text-align:center;">';
                if ($num_users > 0) {
                    $users_sql = "SELECT * FROM tusuario_perfil WHERE id_grupo =" . $group["id_grupo"] . " ORDER BY id_usuario";
                    $count_users = 0;
                    $new = true;
                    while ($user = get_db_all_row_by_steps_sql($new, $result_users, $users_sql)) {
                        $new = false;
                        if ($count_users >= 4) {
                            $count_users = 0;
                            echo '</tr>';
                            echo '<tr style="text-align:center;">';
                        }
                        $user_name = "<a href=\"index.php?sec=users&sec2=godmode/usuarios/configurar_usuarios&update_user=" . $user['id_usuario'] . "\"><strong>" . $user['id_usuario'] . "</strong></a>";
                        $user_real_name = get_db_value("nombre_real", "tusuario", "id_usuario", $user['id_usuario']);
                        $delete_icon = '<a href="index.php?sec=users&sec2=godmode/grupos/lista_grupos&delete_user=1&id_user_delete=' . $user['id_usuario'] . '" onClick="if (!confirm(\'' . __('Are you sure?') . '\')) return false;"><img src="images/cross.png"></a>';
                        $user_name = "{$user_name}&nbsp;({$user_real_name})&nbsp;" . $delete_icon;
                        echo '<td style="background-color:#e6e6e6;"">' . $user_name . '</td>';
                        $count_users++;
                    }
                } else {
                    echo '<td style="background-color:#e6e6e6;"">' . __('There are no users') . '</td>';
                }
                echo '</tr>';
                echo '</table>';
                echo '</td>';
                echo '</tr>';
                echo "<script type=\"text/javascript\">\n\t\t\t\t\t  \$(document).ready (function () {\n\t\t\t\t\t\t  \$(\"#table1-{$count}-0\").click(function() {\n\t\t\t\t\t\t\t  \$(\"#table1-{$count}-users\").toggle();\n\t\t\t\t\t\t  });\n\t\t\t\t\t  });\n\t\t\t\t\t  </script>";
                $count++;
            }
        }
        echo '</table>';
        if (empty($groups)) {
            echo ui_print_error_message(__("No groups"), '', true, 'h3', true);
        }
        echo '</div>';
    }
}
开发者ID:articaST,项目名称:integriaims,代码行数:97,代码来源:functions_groups.php


示例7: get_parameter

$id_grupo = "";
$creacion_incidente = "";

$id = (int) get_parameter ('id');
$clean_output = get_parameter('clean_output');
if (! $id) {
	require ("general/noaccess.php");
	exit;
}

$incident = get_db_row ('tincidencia', 'id_incidencia', $id);

//user with IR and incident creator see the information
$check_acl = enterprise_hook("incidents_check_incident_acl", array($incident));
$standalone_check = enterprise_hook("manage_standalone", array($incident));

if (($check_acl !== ENTERPRISE_NOT_HOOK && !$check_acl) || ($standalone_check !== ENTERPRISE_NOT_HOOK && !$standalone_check)) {
	audit_db ($config['id_user'], $config["REMOTE_ADDR"], "ACL Violation","Trying to access to ticket #".$id);
	include ("general/noaccess.php");
	exit;
}

//Clean output we need to print incident title header :)
if ($clean_output) {
	echo '<h1 class="ticket_clean_report_title">'.__("Statistics")."</h1>";
}

$fields = array(SECONDS_1DAY => "1 day",
				SECONDS_2DAY => "2 days",
				SECONDS_1WEEK => "1 week",
开发者ID:articaST,项目名称:integriaims,代码行数:30,代码来源:incident_tracking.php


示例8: enterprise_include

	echo "</li>";
	
}

// Inventory
if (give_acl($config["id_user"], 0, "VR") && (get_standalone_user($config["id_user"]) == false) && $show_inventory != MENU_HIDDEN) {
    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>";
}

enterprise_include("include/functions_reporting.php", true);
enterprise_hook("enterprise_main_menu_reports", array($show_reports, $sec));

// Customers

if ((give_acl($config["id_user"], 0, "CR") || (give_acl($config["id_user"], 0, "CN"))) && (get_standalone_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>";
}

if (($show_people != MENU_HIDDEN) && (get_standalone_user($config["id_user"]) == false)) {
	// Users
开发者ID:articaST,项目名称:integriaims,代码行数:31,代码来源:main_menu.php


示例9: process_user_login

/**
 * process_user_login accepts $login and $pass and handles it according to current authentication scheme
 *
 * @param string $login 
 * @param string $pass
 *
 * @return mixed False in case of error or invalid credentials, the username in case it's correct.
 */
function process_user_login($login, $pass)
{
    global $config, $mysql_cache;
    include_once $config['homedir'] . "/include/functions_profile.php";
    // Always authenticate admins against the local database
    if (strtolower($config["auth_methods"]) == 'mysql' || dame_admin($login)) {
        $sql = sprintf("SELECT `id_usuario`, `password` FROM `tusuario` WHERE `disabled` = 0 AND `id_usuario` = '%s' AND `enable_login` = 1", $login);
        $row = get_db_row_sql($sql);
        //Check that row exists, that password is not empty and that password is the same hash
        if ($row !== false && $row["password"] !== md5("") && $row["password"] == md5($pass)) {
            // Login OK
            // Nick could be uppercase or lowercase (select in MySQL
            // is not case sensitive)
            // We get DB nick to put in PHP Session variable,
            // to avoid problems with case-sensitive usernames.
            // Thanks to David Muñiz for Bug discovery :)
            return $row["id_usuario"];
        } else {
            $mysql_cache["auth_error"] = "User not found in database or incorrect password";
        }
        return false;
        // Remote authentication
    } else {
        switch ($config["auth_methods"]) {
            // LDAP
            case 'ldap':
                $sql = sprintf("SELECT `disabled` FROM `tusuario` WHERE `id_usuario` = '%s'", $login);
                $disabled = get_db_sql($sql);
                // Check if user is disabled
                if ($disabled == 1) {
                    $config["auth_error"] = "User not found in database or incorrect password";
                    return false;
                }
                if (ldap_process_user_login($login, $pass) === false) {
                    $config["auth_error"] = "User not found in database or incorrect password";
                    return false;
                }
                break;
                // Active Directory
            // Active Directory
            case 'ad':
                if (enterprise_hook('ad_process_user_login', array($login, $pass)) === false) {
                    return false;
                }
                break;
                // Remote Pandora FMS
                /* case 'pandora':
                				
                				break;
                
                			// Remote Babel Enterprise
                			case 'babel':
                				
                				break;
                
                			// Remote Integria
                			case 'integria':
                				
                				break; */
                // Unknown authentication method
            // Remote Pandora FMS
            /* case 'pandora':
            				
            				break;
            
            			// Remote Babel Enterprise
            			case 'babel':
            				
            				break;
            
            			// Remote Integria
            			case 'integria':
            				
            				break; */
            // Unknown authentication method
            default:
                $config["auth_error"] = "User not found in database or incorrect password";
                return false;
        }
        // Authentication ok, check if the user exists in the local database
        if (is_user($login)) {
            return $login;
        }
        // The user does not exist and can not be created
        if ($config['autocreate_remote_users'] == 0 || is_user_blacklisted($login)) {
            $config["auth_error"] = "Ooops User not found in database or incorrect password";
            return false;
        }
        // Create the user in the local database
        if (create_user($login, $pass, array('nombre_real' => $login, 'comentarios' => 'Imported from ' . $config['auth_methods'])) === false) {
            $config["auth_error"] = "User not found in database or incorrect password";
            return false;
//.........这里部分代码省略.........
开发者ID:dsyman2,项目名称:integriaims,代码行数:101,代码来源:mysql.php


示例10: api_update_incident

function api_update_incident($return_type, $user, $params)
{
    $id_incident = $params[0];
    $values['titulo'] = $params[1];
    // Check if user and title is not empty and user exists
    if (empty($values['titulo'])) {
        return;
    }
    if (!check_user_incident($user, $id_incident)) {
        return;
    }
    $timestamp = print_mysql_timestamp();
    $values['descripcion'] = $params[2];
    $values['epilog'] = $params[3];
    $values['id_grupo'] = $params[4];
    $values['prioridad'] = $params[5];
    $values['resolution'] = $params[6];
    $values['estado'] = $params[7];
    $values['id_usuario'] = $params[8];
    $id_parent = $params[9];
    if ($id_parent != 0 && $id_parent != '') {
        $values['id_parent'] = $params[9];
    }
    $values['id_incident_type'] = $params[10];
    $values['extra_data'] = $params[11];
    $values['extra_data2'] = $params[12];
    $values['actualizacion'] = $timestamp;
    if ($values['estado'] == 7) {
        $values['cierre'] = $timestamp;
    }
    $id_incident_type = $values['id_incident_type'];
    $old_incident = get_incident($id_incident);
    if (!$old_incident['old_status2']) {
        $values['old_status'] = $old_incident["old_status"];
        $values['old_resolution'] = $old_incident["old_resolution"];
        $values['old_status2'] = $values['estado'];
        $values['old_resolution2'] = $values['resolution'];
    } else {
        if ($old_incident['old_status2'] == $values['estado'] && $old_incident['old_resolution2'] == $values['resolution']) {
            $values['old_status'] = $old_incident["old_status"];
            $values['old_resolution'] = $old_incident["old_resolution"];
            $values['old_status2'] = $old_incident["old_status2"];
            $values['old_resolution2'] = $old_incident["old_resolution2"];
        } else {
            $values['old_status'] = $old_incident["old_status2"];
            $values['old_resolution'] = $old_incident["old_resolution2"];
            $values['old_status2'] = $values['estado'];
            $values['old_resolution2'] = $values['resolution'];
        }
    }
    $old_status = api_get_status_incident($id_incident);
    $values['old_status'] = $old_status;
    $old_resolution = api_get_resolution_incident($id_incident);
    $values['old_resolution'] = $old_resolution;
    $new_status = $values['estado'];
    $check_status = enterprise_hook("incidents_check_allowed_status", array($old_status, $new_status, false, true, true, $old_resolution));
    if ($check_status == ENTERPRISE_NOT_HOOK) {
        $check_status = true;
    }
    if ($values['estado'] == STATUS_CLOSED) {
        //~ $check_resolution = enterprise_hook("incidents_check_allowed_resolution", array($resolution, $values['estado'], $id_incident, true));
        $check_resolution = enterprise_hook("incidents_check_allowed_resolution", array($values['resolution'], $values['estado'], $id_incident, true));
        if ($check_resolution == ENTERPRISE_NOT_HOOK) {
            $check_resolution = true;
        }
    } else {
        $check_resolution = true;
        //~ $enterprise = enterprise_hook("incidents_check_allowed_resolution", array($resolution, $values['estado'], $id_incident, true));
        $enterprise = enterprise_hook("incidents_check_allowed_resolution", array($values['resolution'], $values['estado'], $id_incident, true));
        if ($enterprise != ENTERPRISE_NOT_HOOK) {
            $values['resolution'] = 0;
        }
    }
    if ($check_status && $check_resolution) {
        $result = process_sql_update('tincidencia', $values, array('id_incidencia' => $id_incident));
        //Add traces and statistic information
        incidents_set_tracking($id_incident, 'update', $values['prioridad'], $values['estado'], $values['resolution'], $user, $values['id_grupo']);
        //Add only update info
        incident_tracking($id_incident, INCIDENT_UPDATED);
        if ($id_incident_type != 0) {
            //in the massive operations no change id_incident_type
            $sql_label = "SELECT `label` FROM `tincident_type_field` WHERE id_incident_type = {$id_incident_type}";
            $labels = get_db_all_rows_sql($sql_label);
            if ($labels === false) {
                $labels = array();
            }
            $num_params = 13;
            foreach ($labels as $label) {
                $values_type_field['data'] = $params[$num_params];
                $id_incident_field = get_db_value_filter('id', 'tincident_type_field', array('id_incident_type' => $id_incident_type, 'label' => $label['label']), 'AND');
                $values_type_field['id_incident_field'] = $id_incident_field;
                $values_type_field['id_incident'] = $id_incident;
                $exists_id = get_db_value_filter('id', 'tincident_field_data', array('id_incident' => $id_incident, 'id_incident_field' => $id_incident_field), 'AND');
                if ($exists_id) {
                    process_sql_update('tincident_field_data', $values_type_field, array('id_incident_field' => $id_incident_field, 'id_incident' => $id_incident), 'AND');
                } else {
                    process_sql_insert('tincident_field_data', $values_type_field);
                }
                $num_params++;
            }
//.........这里部分代码省略.........
开发者ID:keunes,项目名称:integriaims,代码行数:101,代码来源:functions_api.php


示例11: __

     echo '<a href="index.php?sec=users&sec2=operation/inventories/inventory_reports">' . __('Custom reports') . '</a>';
     echo '</li>';
     enterprise_hook('show_programmed_reports', array($sec2));
     echo "</ul></div>";
 } else {
     echo "<div class='portlet'>";
     echo "<h3>" . __('People reporting') . "</h3>";
     echo "<ul class='sidemenu'>";
     if ($sec2 == "operation/inventories/inventory_reports" || $sec2 == "operation/inventories/inventory_reports_detail") {
         echo "<li id='sidesel'>";
     } else {
         echo "<li>";
     }
     echo '<a href="index.php?sec=users&sec2=operation/inventories/inventory_reports">' . __('Custom reports') . '</a>';
     echo '</li>';
     enterprise_hook('show_programmed_reports', array($sec2));
     echo "</ul></div>";
 }
 // PEOPLE MANAGEMENT
 if (give_acl($config["id_user"], 0, "UM") && $show_people != MENU_LIMITED) {
     if ($show_people != MENU_MINIMAL) {
         echo "<div class='portlet'>";
         echo "<h3>" . __('People management') . "</h3>";
         echo "<ul class='sidemenu'>";
         // Usermanager
         if ($sec2 == "godmode/usuarios/lista_usuarios") {
             echo "<li id='sidesel'>";
         } else {
             echo "<li>";
         }
         echo "<a href='index.php?sec=users&sec2=godmode/usuarios/lista_usuarios'>" . __('Manage users') . "</a>";
开发者ID:dsyman2,项目名称:integriaims,代码行数:31,代码来源:side_menu.php


示例12: incident_tracking

                    incident_tracking($id_ticket, INCIDENT_GOLD_MEDAL_REMOVED, $values['id_usuario']);
                    audit_db($config['id_user'], $config["REMOTE_ADDR"], "Gold medal removed", "Gold medal removed by user " . $config['id_user'] . " to the ticket #" . $id_ticket);
                    break;
                case 3:
                    //Add black medal
                    incident_tracking($id_ticket, INCIDENT_BLACK_MEDAL_ADDED, $values['id_usuario']);
                    audit_db($config['id_user'], $config["REMOTE_ADDR"], "Black medal added", "Black medal added by user " . $config['id_user'] . " to the ticket #" . $id_ticket);
                    break;
                case 4:
                    //Remove black medal
                    incident_tracking($id_ticket, INCIDENT_BLACK_MEDAL_REMOVED, $values['id_usuario']);
                    audit_db($config['id_user'], $config["REMOTE_ADDR"], "Black medal removed", "Black medal removed by user " . $config['id_user'] . " to the ticket #" . $id_ticket);
                    break;
            }
        }
        enterprise_hook("incidents_run_realtime_workflow_rules", array($id_ticket));
    }
}
if ($search_ajax) {
    $filter = array();
    $filter['inverse_filter'] = (bool) get_parameter('search_inverse_filter');
    $filter['string'] = (string) get_parameter('search_string');
    $filter['status'] = (int) get_parameter('search_status', -10);
    $filter['priority'] = (int) get_parameter('search_priority', -1);
    $filter['id_group'] = (int) get_parameter('search_id_group', 1);
    $filter['id_company'] = (int) get_parameter('search_id_company');
    $filter['id_inventory'] = (int) get_parameter('search_id_inventory');
    $filter['id_incident_type'] = (int) get_parameter('search_id_incident_type');
    $filter['id_user'] = (string) get_parameter('search_id_user', '');
    $filter['id_user_or_creator'] = (string) get_parameter('id_user_or_creator');
    $filter['first_date'] = (string) get_parameter('search_first_date');
开发者ID:articaST,项目名称:integriaims,代码行数:31,代码来源:incidents.php


示例13: incidents_get_filter_tickets_tree


//.........这里部分代码省略.........
            //Just count items
            $sql = sprintf('SELECT COUNT(id_incidencia) FROM tincidencia FD
				WHERE estado IN (%s)
				%s
				AND (titulo LIKE "%%%s%%" OR descripcion LIKE "%%%s%%" 
				OR id_creator LIKE "%%%s%%" OR id_usuario LIKE "%%%s%%" 
				OR id_incidencia IN (SELECT id_incident FROM tincident_field_data WHERE data LIKE "%%%s%%"))
				%s', $filters['status'], $sql_clause, $filters['string'], $filters['string'], $filters['string'], $filters['string'], $filters['string'], $sla_filter);
            $count = get_db_value_sql($sql);
            if ($count === false) {
                return 0;
            }
            return $count;
            break;
        case 'tasks':
            $sql = sprintf('SELECT id_task FROM tincidencia FD
				WHERE estado IN (%s)
				%s
				AND (titulo LIKE "%%%s%%" OR descripcion LIKE "%%%s%%" 
				OR id_creator LIKE "%%%s%%" OR id_usuario LIKE "%%%s%%" 
				OR id_incidencia IN (SELECT id_incident FROM tincident_field_data WHERE data LIKE "%%%s%%"))
				%s
				GROUP BY id_task', $filters['status'], $sql_clause, $filters['string'], $filters['string'], $filters['string'], $filters['string'], $filters['string'], $sla_filter);
            $tasks = get_db_all_rows_sql($sql);
            if ($tasks === false) {
                return false;
            }
            return $tasks;
            break;
        case 'tickets':
        default:
            //Select all items and return all information
            $sql = sprintf('SELECT * FROM tincidencia FD
				WHERE estado IN (%s)
				%s
				AND (titulo LIKE "%%%s%%" OR descripcion LIKE "%%%s%%" 
				OR id_creator LIKE "%%%s%%" OR id_usuario LIKE "%%%s%%" 
				OR id_incidencia IN (SELECT id_incident FROM tincident_field_data WHERE data LIKE "%%%s%%"))
				%s
				ORDER BY %s actualizacion DESC', $filters['status'], $sql_clause, $filters['string'], $filters['string'], $filters['string'], $filters['string'], $filters['string'], $sla_filter, $order_by);
            $incidents = get_db_all_rows_sql($sql);
            if ($incidents === false) {
                return false;
            }
            $result = array();
            foreach ($incidents as $incident) {
                //Check external users ACLs
                $external_check = enterprise_hook("manage_external", array($incident));
                if ($external_check !== ENTERPRISE_NOT_HOOK && !$external_check) {
                    continue;
                } else {
                    //Normal ACL pass if IR for this group or if the user is the incident creator
                    //or if the user is the owner or if the user has workunits
                    $check_acl = enterprise_hook("incidents_check_incident_acl", array($incident));
                    if (!$check_acl) {
                        continue;
                    }
                }
                $inventories = get_inventories_in_incident($incident['id_incidencia'], false);
                if ($filters['id_inventory']) {
                    $found = false;
                    foreach ($inventories as $inventory) {
                        if ($inventory['id'] == $filters['id_inventory']) {
                            $found = true;
                            break;
                        }
                    }
                    if (!$found) {
                        continue;
                    }
                }
                if ($filters['id_company']) {
                    $found = false;
                    $user_creator = $incident['id_creator'];
                    $user_company = get_db_value('id_company', 'tusuario', 'id_usuario', $user_creator);
                    //If company do no match, dismiss incident
                    if ($filters['id_company'] != $user_company) {
                        continue;
                    }
                }
                if ($filters['left_sla']) {
                    $percent_sla_incident = format_numeric(get_sla_compliance_single_id($incident['id_incidencia']));
                    //If sla do not match, dismiss incident
                    if ($filters['left_sla'] > $percent_sla_incident) {
                        continue;
                    }
                }
                if ($filters['right_sla']) {
                    $percent_sla_incident = format_numeric(get_sla_compliance_single_id($incident['id_incidencia']));
                    //If sla do not match, dismiss incident
                    if ($filters['right_sla'] < $percent_sla_incident) {
                        continue;
                    }
                }
                array_push($result, $incident);
            }
            return $result;
            break;
    }
}
开发者ID:dsyman2,项目名称:integriaims,代码行数:101,代码来源:functions_incidents.php


示例14: inventories_show_list

function inventories_show_list($sql_search, $sql_count, $params = '', $last_update = 0)
{
    global $config;
    $is_enterprise = false;
    if (file_exists("enterprise/include/functions_inventory.php")) {
        require_once "enterprise/include/functions_inventory.php";
        $is_enterprise = true;
    }
    $write_permission = enterprise_hook('inventory_check_acl', array($config['id_user'], $id, true));
    $params .= "&mode=list";
    if (!$sql_search) {
        $sql_search = "SELECT * FROM tinventory";
    }
    if ($last_update) {
        $sql_search .= " ORDER BY last_update DESC";
    } else {
        $sql_search .= " ORDER BY name ASC";
    }
    $clean_output = get_parameter("clean_output");
    if ($clean_output) {
        $block_limit = 5000;
    } else {
        $block_limit = $config["block_size"];
    }
    $sql_search .= " LIMIT " . $block_limit;
    $offset = get_parameter("offset", 0);
    $sql_search .= " OFFSET {$offset}";
    $inventories_aux = get_db_all_rows_sql($sql_search);
    $count_inv = get_db_value_sql($sql_count);
    if ($is_enterprise) {
        $inventories = inventory_get_user_inventories($config['id_user'], $inventories_aux);
    } else {
        $inventories = $inventories_aux;
    }
    if ($inventories === false) {
        echo "<h3 class='error'>" . __("Empty inventory") . "</h3>";
    } else {
        $result_check = inventories_check_same_object_type_list($inventories);
        $table->id = 'inventory_list';
        $table->class = 'listing';
        $table->width = '100%';
        $table->data = array();
        $table->head = array();
        $table->colspan = array();
        $table->head[0] = __('Id');
        $table->head[1] = __('Name');
        $table->head[2] = __('Owner');
        $table->head[3] = __("Parent object");
        $table->head[4] = __('Object type');
        $table->head[5] = __('Manufacturer');
        $table->head[6] = __('Contract');
        if ($result_check) {
            $res_object_fields = inventories_get_all_type_field($result_check, false, true);
            $i = 6;
            foreach ($res_object_fields as $key => $object_field) {
                if (isset($object_field["label"])) {
                    $table->head[$i] = $object_field['label'];
                    $i++;
                }
            }
            $table->head[$i] = __('Actions');
            if ($write_permission) {
                $table->head[$i] = print_checkbox('inventorycb-all', "", false, true);
            }
        } else {
            if (!$clean_output) {
                $table->head[7] = __('Actions');
            }
            if ($write_permission) {
                $table->head[8] = print_checkbox('inventorycb-all', "", false, true);
            }
        }
        $count = $count_inv;
        $url_pag = "index.php?sec=inventory&sec2=operation/inventories/inventory" . $params;
        $offset = get_parameter("offset");
        if (!$clean_output) {
            pagination($count, $url_pag, $offset);
        }
        $idx = 0;
        foreach ($inventories as $key => $inventory) {
            $data = array();
            if (defined('AJAX')) {
                $url = "javascript:loadInventory(" . $inventory['id'] . ");";
            } else {
                $url = 'index.php?sec=inventory&sec2=operation/inventories/inventory_detail&id=' . $inventory['id'];
            }
            $data[0] = "<a href=" . $url . ">" . $inventory['id'] . "</a>";
            $data[1] = "<a href=" . $url . ">" . $inventory['name'] . '</a>';
            if ($inventory['owner'] != '') {
                $name_owner = get_db_value('nombre_real', 'tusuario', 'id_usuario', $inventory['owner']);
            } else {
                $name_owner = '--';
            }
            $data[2] = "<a href=" . 'index.php?sec=inventory&sec2=users&sec2=operation/users/user_edit&id=' . $inventory['owner'] . ">" . $name_owner . '</a>';
            if ($inventory["id_parent"] != 0) {
                $name_parent = get_db_value('name', 'tinventory', 'id', $inventory['id_parent']);
                $data[3] = "<a href=" . 'index.php?sec=inventory&sec2=operation/inventories/inventory_detail&id=' . $inventory['id_parent'] . ">" . $name_parent . '</a>';
            } else {
                $name_parent = '--';
                $data[3] = $name_parent;
//.........这里部分代码省略.........
开发者ID:keunes,项目名称:integriaims,代码行数:101,代码来源:functions_inventories.php


示例15: check_crm_acl

function check_crm_acl($type, $flag, $user = false, $id = false)
{
    global $config;
    if (!$user) {
        $user = $config['id_user'];
    }
    $permission = false;
    switch ($type) {
        case 'company':
            if ($id) {
                $permission = enterprise_hook('crm_check_acl_company', array($user, $id, $flag));
            } else {
                $permission = enterprise_hook('crm_check_user_profile', array($user, $flag));
            }
            break;
        case 'other':
            if ($id) {
                $permission = enterprise_hook('crm_check_acl_other', array($user, $id, $flag));
            }
            break;
        case 'invoice':
            if ($id) {
                $permission = enterprise_hook('crm_check_acl_invoice', array($user, $id));
            }
            break;
        case 'lead':
            if ($id) {
                $permission = enterprise_hook('crm_check_acl_lead', array($user, $id, $flag));
            } else {
                $permission = enterprise_hook('crm_check_user_profile', array($user, $flag));
            }
            break;
        case 'contract':
            if ($id) {
                $permission = enterprise_hook('crm_check_acl_contract', array($user, $id, $flag));
            } else {
                $permission = enterprise_hook('crm_check_user_profile', array($user, $flag));
            

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP enterprise_include函数代码示例发布时间:2022-05-15
下一篇:
PHP enter函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap