本文整理汇总了PHP中ui_print_error_message函数的典型用法代码示例。如果您正苦于以下问题:PHP ui_print_error_message函数的具体用法?PHP ui_print_error_message怎么用?PHP ui_print_error_message使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ui_print_error_message函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: safe_output
echo safe_output($name);
return;
}
if ($get_external_data) {
$table_name = get_parameter('table_name');
$id_table = (string) get_parameter('id_table');
$element_name = get_parameter('element_name');
$id_object_type_field = get_parameter('id_object_type_field');
$id_parent_value = get_parameter('id_parent_value', 0);
$id_parent_table = get_parameter('id_parent_table', "");
$external_label = get_parameter('external_label', "");
//We use MYSQL_QUERY becase we need this to fail silently to not show
//SQL errors on screen
$exists = mysql_query("SELECT * FROM " . $table_name . " LIMIT 1");
if (!$exists) {
echo ui_print_error_message(__("External table is not present"), '', true, 'h3', true);
return;
}
$sql_ext = "SHOW COLUMNS FROM " . $table_name;
$desc_ext = get_db_all_rows_sql($sql_ext);
$parent_reference_field = get_db_value_sql('SELECT parent_reference_field FROM tobject_type_field WHERE id=' . $id_object_type_field);
$fields = array();
foreach ($desc_ext as $key => $ext) {
if ($parent_reference_field == $ext['Field']) {
continue;
}
$fields[$ext['Field']] = $ext['Field'];
}
if ($id_parent_value) {
$id_parent = get_parameter("id_parent", 0);
$table_name_parent = get_db_value_sql("SELECT parent_table_name FROM tobject_type_field WHERE id=" . $id_object_type_field);
示例3: delete_tag
$result = delete_tag($id);
$crud_operation['result'] = $result;
// Result can be 0 if the target does not exist
if ($result !== false) {
$result = true;
// Prepare the values for another creation
$id = 0;
$name = '';
$colour = '';
}
$crud_operation['message'] .= ui_print_result_message($result, __('Tag deleted successsfully'), __('There was an error deleting the tag'), '', true);
} catch (Exception $e) {
$crud_operation['message'] .= ui_print_error_message($e->getMessage(), '', true);
}
} else {
$crud_operation['message'] .= ui_print_error_message(__('Some required values are missing'), '', true);
}
}
}
}
// Echo the result of the CRUD operation
if (isset($crud_operation)) {
echo $crud_operation['message'];
}
$table->width = '98%';
$table->class = 'search-table';
$table->style = array();
$table->colspan = array();
$table->style[0] = 'font-weight: bold; text-align: right;';
$table->style[1] = 'text-align: left;';
$table->style[2] = 'font-weight: bold; text-align: right;';
示例4: get_parameter
$id = false;
}
}
if ($update) {
$values['name'] = (string) get_parameter ('name');
$values['sql'] = (string) get_parameter ('sql');
$values['id_group'] = get_parameter('id_group');
$result = false;
if (! empty ($values['name']))
$result = process_sql_update ('tinventory_reports', $values, array ('id' => $id));
if ($result) {
$result_msg = ui_print_success_message (__("Successfully updated"), '', true, 'h3', true);
} else {
$result_msg = ui_print_error_message (__('Could not be updated'), '', true, 'h3', true);
}
}
if ($id) {
clean_cache_db();
$report = get_db_row ('tinventory_reports', 'id', $id);
if ($report === false)
return;
$name = $report['name'];
$sql = $report['sql'];
$id_group = $report['id_group'];
}
$render = get_parameter ("render",0);
示例5: get_parameter
// 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.
if (check_login () != 0) {
audit_db ("Noauth", $config["REMOTE_ADDR"], "No authenticated access","Trying to access ticket viewer");
require ("general/noaccess.php");
exit;
}
$id_incident = (int) get_parameter ('id');
$incidents = incidents_get_incident_childs ($id_incident, false);
if (count ($incidents) == 0) {
echo ui_print_error_message (__('There\'s no tickets associated to this ticket'), '', true, 'h3', true);
}
else {
$table = new StdClass();
$table->class = 'listing';
$table->width = '100%';
$table->head = array ();
$table->head[0] = __('ID');
$table->head[1] = __('Name');
$table->head[2] = __('Group');
$table->head[3] = __('Status');
$table->head[4] = __('Creator');
$table->head[5] = __('Owner');
$table->size = array ();
$table->size[0] = '40px';
示例6: get_parameter
$five_daysonly = (int) get_parameter ("five_daysonly", 0);
$time_from = (int) get_parameter ("time_from", 0);
$time_to = (int) get_parameter ("time_to", 0);
$max_inactivity = (float) get_parameter ('max_inactivity');
$no_holidays = (int) get_parameter ('no_holidays', 0);
$id_sla_type = (int) get_parameter ('id_sla_type', 0);
$sql = sprintf ('UPDATE tsla SET max_inactivity = %.2f, enforced = %d, description = "%s",
name = "%s", max_incidents = %d, min_response = %.2f, max_response = %.2f,
id_sla_base = %d, five_daysonly = %d, time_from = %d, time_to = %d, no_holidays = %d, id_sla_type = %d WHERE id = %d', $max_inactivity,
$enforced, $description, $name, $max_incidents, $min_response,
$max_response, $id_sla_base, $five_daysonly, $time_from, $time_to, $no_holidays, $id_sla_type, $id);
$result = process_sql ($sql);
if (! $result)
echo ui_print_error_message (__('Could not be updated'), '', true, 'h3', true);
else {
echo ui_print_success_message (__('Successfully updated'), '', true, 'h3', true);
audit_db ($config["id_user"], $config["REMOTE_ADDR"], "SLA Modified",
"Updated SLA ($name)", $sql);
}
$id = 0;
}
// DELETE
// ==================
if ($delete_sla) {
$name = get_db_value ('name', 'tsla', 'id', $id);
$sql = sprintf ('DELETE FROM tsla WHERE id = %d', $id);
$result = process_sql ($sql);
audit_db ($config["id_user"], $config["REMOTE_ADDR"], "SLA Deleted",
示例7: check_crm_acl
$read = check_crm_acl ('other', 'cr', $config['id_user'], $contact['id_company']);
if (!$read) {
audit_db($config["id_user"], $config["REMOTE_ADDR"], "ACL Violation","Trying to access to contact tickets without permission");
include ("general/noaccess.php");
exit;
}
$email = safe_output($contact["email"]);
$email = trim($email);
$email = safe_input($email);
$incidents = incidents_get_by_notified_email ($email);
if (!$incidents) {
echo ui_print_error_message (__("This contact doesn't have any ticket associated"), '', true, 'h3', true);
} else {
$table->class = "listing";
$table->width = "99%";
$table->head[0] = __("ID");
$table->head[1] = __("Ticket");
$table->head[2] = __("Status");
$table->head[3] = __("Priority");
$table->head[4] = __("Updated");
$table->data = array();
foreach ($incidents as $inc) {
$data = array();
if (give_acl($config["id_user"], 0, "IR")) {
示例8: sprintf
if ($id_workunit !== false) {
$sql = sprintf ('INSERT INTO tworkunit_task
(id_task, id_workunit) VALUES (%d, %d)',
$id_task, $id_workunit);
$result = process_sql ($sql, 'insert_id');
if ($result !== false) {
$result_output = ui_print_success_message (__('Workunit added'), '', true, 'h3', true);
audit_db ($config['id_user'], $config["REMOTE_ADDR"], "Spare work unit added",
'Workunit for '.$config['id_user'].' added to Task ID #'.$id_task);
mail_project (0, $config['id_user'], $id_workunit, $id_task);
}
else {
$result_output = ui_print_error_message (__('Problemd adding workunit.'), '', true, 'h3', true);
}
} else {
$result_output = ui_print_error_message (__('Problemd adding workunit.'), '', true, 'h3', true);
}
}
}
}
if ($id_workunit !== false) {
set_task_completion ($id_task);
}
audit_db ($config["id_user"], $config["REMOTE_ADDR"], "PWU", "Inserted PWU. Task: $id_task. Desc: $description");
}
if ($operation == "delete") {
$success = delete_task_workunit ($id_workunit);
if (! $success) {
示例9: check_login
// 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.
// CHECK LOGIN AND ACLs
check_login();
// SET VARS
$width = '99%';
if (!give_acl($config['id_user'], 0, "IR")) {
audit_db($config['id_user'], $config["REMOTE_ADDR"], "ACL Violation", "Trying to access ticket viewer");
require "general/noaccess.php";
exit;
}
$incident_id = get_parameter('incident_id', 0);
if ($incident_id == 0) {
ui_print_error_message(__('Unable to load ticket'));
exit;
}
// GET THE FILES
$incident['files'] = get_incident_files($incident_id, true);
if ($incident['files'] === false) {
$incident['files'] = array();
}
// SHOW THE FILES
$table->class = 'result_table listing';
$table->width = $width;
$table->id = 'incident_search_result_table';
$separator_style = 'border-bottom: 1px solid rgb(204, 204, 204);border-top: 1px solid rgb(204, 204, 204);';
$table->style = array();
$table->data = array();
$table->rowstyle = array();
示例10: ui_print_error_message
}
else {
echo ui_print_error_message (__('Could not load custom filter'), '', true, 'h3', true);
}
}
/* Delete a custom saved search via AJAX */
if ($delete_custom_search) {
$sql = sprintf ('DELETE FROM tcustom_search
WHERE id_user = "%s"
AND id = %d',
$config['id_user'], $id_search);
$result = process_sql ($sql);
if ($result === false) {
echo ui_print_error_message (__('Could not delete custom filter'), '', true, 'h3', true);
}
else {
echo ui_print_success_message (__('Custom filter deleted'), '', true, 'h3', true);
}
}
//FORM AND TABLE TO MANAGE CUSTOM SEARCHES
$table = new stdClass;
$table->id = 'saved_searches_table';
$table->width = '100%';
$table->class = 'search-table-button';
$table->size = array ();
$table->style = array ();
$table->style[0] = 'font-weight: bold';
$table->style[1] = 'font-weight: bold';
示例11: ui_print_error_message
$grant_access = $group["grant_access"];
$send_welcome = $group["send_welcome"];
$default_company = $group["default_company"];
$welcome_email = $group["welcome_email"];
$email_queue = $group["email_queue"];
$default_profile = $group["default_profile"];
$user_level = $group["nivel"];
$incident_type = $group["id_incident_type"];
$email_from = $group["email_from"];
$email_group = $group["email_group"];
//Inventory == zero is an empty string
if ($id_inventory == 0) {
$id_inventory = "";
}
} else {
echo ui_print_error_message(__('There was a problem loading group'), '', true, 'h3', true);
include "general/footer.php";
exit;
}
}
echo '<h2>' . __('Group management') . '</h2>';
if ($id) {
echo '<h4>' . __('Update group') . '</h4>';
} else {
echo '<h4>' . __('New group') . '</h4>';
}
$table = new StdClass();
$table->width = '100%';
$table->class = 'search-table-button';
$table->colspan = array();
$table->rowspan = array();
示例12: ui_print_error_message
if (!isset($incident)){
echo ui_print_error_message (__("Invalid ticket ID"), '', true, 'h3', true);
audit_db ($config['id_user'], $config["REMOTE_ADDR"], "Ticket score hack", "Trying to access ticket score on a invalid ticket");
no_permission();
return;
}
if ($incident["id_creator"] != $config["id_user"]){
echo ui_print_error_message (__("Non authorized ticket score review"), '', true, 'h3', true);
audit_db ($config['id_user'], $config["REMOTE_ADDR"], "Ticket score hack", "Trying to access ticket score on a non-authorship ticket");
no_permission();
return;
}
if (($incident["estado"] !=6) AND ($incident["estado"] != 7)){
echo ui_print_error_message (__("Ticket cannot be scored until be closed"), '', true, 'h3', true);
audit_db ($config['id_user'], $config["REMOTE_ADDR"], "Ticket score hack", "Trying to access ticket score before closing ticket");
no_permission();
return;
}
// Score it !
$sql = "UPDATE tincidencia SET score = $score WHERE id_incidencia = $id";
process_sql ($sql);
echo "<h1>".__("Ticket scoring")."</h1>";
echo "<br><br>";
echo __("Thanks for your feedback, this help us to keep improving our job");
示例13: get_parameter
$active_tab = 'files';
}
if($add_workunit) {
$note = get_parameter('note');
$public = 1;
$timeused = "0.05";
$result = create_workunit ($incident_id, $note, $config["id_user"], $timeused, 0, "", $public, 0);
if($result) {
ui_print_success_message(__('Workunit added'));
}
else {
ui_print_error_message(__('There was a problem adding workunit'));
}
$active_tab = 'workunits';
}
// GET INCIDENT FROM DATABASE
$incident = get_full_incident($incident_id);
// TABS
?>
<ul style="height: 30px;" class="ui-tabs-nav">
<li class="ui-tabs" id="li_files">
<a href='javascript:' id='tab_files' class='tab'><span><?php echo __('Files') ?></span></a>
</li>
<li class="ui-tabs" id="li_workunits">
示例14: get_parameter
$id = 0;
}
// ---------------
// DELETE template
// ---------------
// TODO: ACL Check. Should be only able to delete templates of their company or child companies
if ($operation == "delete") {
$id = get_parameter ("id");
$sql_delete= "DELETE FROM tcrm_template WHERE id = $id";
$result=mysql_query($sql_delete);
if (! $result)
echo ui_print_error_message (__('Not deleted. Error deleting data'), '', true, 'h3', true);
else
echo ui_print_success_message (__("Successfully deleted"), '', true, 'h3', true);
$operation = "";
}
// ---------------
// CREATE (form)
// ---------------
if (($operation == "create") || ($operation == "edit")){
echo "<h2>".__('CRM Template management')."</h2>";
if ($operation == "create"){
echo "<h4>".__('Create CRM Template')."</h4>";
$name = "";
示例15: round_number
$current_hours += $duration;
$expected_completion = round_number (floor ($current_hours * 100 / $task['hours']));
$sql = sprintf ('UPDATE ttask
SET completion = %d
WHERE id = %d',
$expected_completion, $id_task);
process_sql ($sql);
}
} else {
mail_project (1, $config['id_user'], $id_workunit, $id_task);
$result_output = ui_print_success_message (__('Workunit updated'), '', true, 'h3', true);
audit_db ($config["id_user"], $config["REMOTE_ADDR"], "PWU", "Updated PWU. $description");
}
} else {
$result_output = ui_print_error_message (__('There was a problem adding workunit'), '', true, 'h3', true);
}
$operation = "view";
}
// DELETE Workunit
if ($operation == "delete") {
// ACL
if (! $task_permission["write"]){
// Doesn't have access to this page
audit_db ($config['id_user'], $config["REMOTE_ADDR"], "ACL Violation", "Trying to delete a workunit in a task without permission");
no_permission();
}
$success = delete_task_workunit ($id_workunit);