本文整理汇总了PHP中ui_print_success_message函数的典型用法代码示例。如果您正苦于以下问题:PHP ui_print_success_message函数的具体用法?PHP ui_print_success_message怎么用?PHP ui_print_success_message使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ui_print_success_message函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_db_row
$lead = get_db_row('tlead','id',$id);
$user = get_db_row("tusuario", "id_usuario", $config["id_user"]);
$company_user = get_db_sql ("select name FROM tcompany where id = ". $user["id_company"]);
$from = get_parameter ("from", $user["direccion"]);
$to = get_parameter ("to", "");
$subject = get_parameter ("subject", "");
$mail = get_parameter ("mail", "");
$send = (int) get_parameter ("send",0);
$cco = get_parameter ("cco", "");
// Send mail
if ($send) {
if (($subject != "") AND ($from != "") AND ($to != "")) {
echo ui_print_success_message (__('Mail queued'), '', true, 'h3', true);
integria_sendmail ($to, $subject, $mail, false, "", $from, true);
if ($cco != "")
integria_sendmail ($cco, $subject, $mail, false, "", $from, true);
$datetime = date ("Y-m-d H:i:s");
// Update tracking
$sql = sprintf ('INSERT INTO tlead_history (id_lead, id_user, timestamp, description) VALUES (%d, "%s", "%s", "%s")', $id, $config["id_user"], $datetime, "Forwarded lead by mail to $to");
process_sql ($sql);
// Update activity
$comments = __("Forwarded lead by mail to $to"). "
" . $mail; // this adds 

$sql = sprintf ('INSERT INTO tlead_activity (id_lead, written_by, creation, description) VALUES (%d, "%s", "%s", "%s")', $id, $config["id_user"], $datetime, $comments);
process_sql ($sql);
开发者ID:articaST,项目名称:integriaims,代码行数:30,代码来源:lead_forward.php
示例2: ui_print_error_message
} else {
$result_msg = ui_print_error_message (__('Could not be created'), '', true, 'h3', true);
$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'];
}
开发者ID:articaST,项目名称:integriaims,代码行数:31,代码来源:inventory_reports_detail.php
示例3: update_config_token
update_config_token("access_public", $config["access_public"]);
update_config_token("loginhash_pwd", $config["loginhash_pwd"]);
update_config_token("csv_standard_encoding", $config["csv_standard_encoding"]);
update_config_token("enable_update_manager", $config["enable_update_manager"]);
update_config_token("max_direct_download", $config["max_direct_download"]);
if ($is_enterprise) {
update_config_token("enable_pass_policy", $config["enable_pass_policy"]);
update_config_token("pass_size", $config["pass_size"]);
update_config_token("pass_needs_numbers", $config["pass_needs_numbers"]);
update_config_token("pass_needs_symbols", $config["pass_needs_symbols"]);
update_config_token("pass_expire", $config["pass_expire"]);
update_config_token("first_login", $config["first_login"]);
update_config_token("mins_fail_pass", $config["mins_fail_pass"]);
update_config_token("number_attempts", $config["number_attempts"]);
}
echo ui_print_success_message(__('Successfully updated'), '', true, 'h3', true);
}
// Render SYSTEM language code, not current language.
$table = new StdClass();
$table->width = '100%';
$table->class = 'search-table-button';
$table->colspan = array();
$table->data = array();
$incident_reporter_options[0] = __('Disabled');
$incident_reporter_options[1] = __('Enabled');
$language_config = get_db_value('value', 'tconfig', 'token', 'language_code');
$table->data[0][0] = print_select_from_sql('SELECT id_language, name FROM tlanguage ORDER BY name', 'language_code', $language_config, '', '', '', true, false, false, __('Language'));
$table->data[0][1] = print_input_text("sitename", $config["sitename"], '', 30, 50, true, __('Sitename'));
$error_log_options[0] = __('Disabled');
$error_log_options[1] = __('Enabled');
$table->data[1][0] = print_checkbox("error_log", $error_log_options, $config["error_log"], true, __('Enable error log') . print_help_tip(__("This errorlog is on /integria.log"), true));
开发者ID:articaST,项目名称:integriaims,代码行数:31,代码来源:setup.php
示例4: process_sql
work_home = %d
WHERE id = %d',
$timestamp, $duration, $description, $have_cost,
$id_profile, $public, $wu_user, $work_home, $id_workunit);
$result = process_sql ($sql);
if ($id_task !=0) {
// Old old association
process_sql ("DELETE FROM tworkunit_task WHERE id_workunit = $id_workunit");
// Create new one
$sql = sprintf ('INSERT INTO tworkunit_task
(id_task, id_workunit) VALUES (%d, %d)',
$id_task, $id_workunit);
$result = process_sql ($sql, 'insert_id');
}
$result_output = ui_print_success_message (__('Workunit updated'), '', true, 'h3', true);
audit_db ($config["id_user"], $config["REMOTE_ADDR"], "PWU", "Updated PWU. $description");
if ($result !== false) {
set_task_completion ($id_task);
}
}
$multiple_wu_report = array();
if ($operation == 'multiple_wu_insert') {
//Walk post array looking for
$i = 1;
while(true) {
开发者ID:articaST,项目名称:integriaims,代码行数:30,代码来源:user_spare_workunit.php
示例5: ui_print_success_message
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",
"Delete SLA ($name)", $sql);
echo ui_print_success_message (__("Successfully deleted"), '', true, 'h3', true);
$id = 0;
}
// FORM (Update / Create)
if ($id || $new_sla) {
if ($new_sla) {
$name = "";
$description = "";
$min_response = 48.0;
$max_response = 480.0;
$max_incidents = 10;
$max_inactivity = 96.0;
$id_sla_base = 0;
$enforced = 1;
$five_daysonly = 1;
开发者ID:articaST,项目名称:integriaims,代码行数:31,代码来源:sla_detail.php
示例6: get_parameter
// ---------------
if ($operation == "delete"){
// Delete workunit with ACL / Project manager check
$id_workunit = get_parameter ("id_workunit");
$sql = "SELECT * FROM tworkunit WHERE id = $id_workunit";
if ($res = mysql_query($sql))
$row=mysql_fetch_array($res);
else
return;
$id_user_wu = $row["id_user"];
if (($id_user_wu == $config["id_user"]) OR (give_acl($config["id_user"], 0,"PM") ==1 ) OR (project_manager_check($id_project) == 1)){
mysql_query ("DELETE FROM tworkunit where id = '$id_workunit'");
if (mysql_query ("DELETE FROM tworkunit_task where id_workunit = '$id_workunit'")){
$result_output = ui_print_success_message (__('Successfully deleted'), '', true, 'h3', true);
audit_db ($id_user, $config["REMOTE_ADDR"], "Work unit deleted", "Workunit for $id_user");
} else {
$result_output = ui_print_error_message (__('Not deleted. Error deleting data'), '', true, 'h3', true);
}
} else {
audit_db($id_user, $config["REMOTE_ADDR"], "ACL Violation","Trying to delete WU $id_workunit without rigths");
include ("general/noaccess.php");
exit;
}
}
// --------------------
// Workunit report
// --------------------
开发者ID:articaST,项目名称:integriaims,代码行数:30,代码来源:user_workunit_report.php
示例7: process_sql_insert
'id_incident_type' => $id_incident_type,
'id_parent' => $idParentValue,
'sla_disabled' => $sla_disabled,
'email_copy' => $email_copy,
'editor' => $editor,
'id_group_creator' => $id_group_creator,
'blocked' => $blocked,
'old_status' => $old_status,
'old_resolution' => $old_resolution
);
$id = process_sql_insert ('tincidencia', $values);
if ($id !== false) {
/* Update inventory objects in incident */
update_incident_inventories ($id, get_parameter ('inventories'));
$result_msg = ui_print_success_message (__('Successfully created'), '', true, 'h3', true);
$result_msg .= '<h4><a href="index.php?sec=incidents&sec2=operation/incidents/incident_dashboard_detail&id='.$id.'">'.__('Please click here to continue working with incident #').$id."</a></h4>";
//Add traces and statistic information
incidents_set_tracking ($id, 'create', $priority, $estado, $resolution, $usuario, $grupo);
audit_db ($config["id_user"], $config["REMOTE_ADDR"],
"Ticket created",
"User ".$config['id_user']." created incident #".$id);
// Create automatically a WU with the editor ?
if ($config["incident_creation_wu"] == 1){
$wu_text = __("WU automatically created by the editor on the incident creation.");
// Do not send mail in this WU
create_workunit ($id, $wu_text, $editor, $config["iwu_defaultime"], 0, "", 1, 0);
}
开发者ID:articaST,项目名称:integriaims,代码行数:30,代码来源:incident_detail.php
示例8: get_parameter
// Database DELETE
// ==================
if (isset($_GET["delete_cat"])){ // if delete
$id = get_parameter ("delete_cat",0);
// First delete from tagente_modulo
$sql_delete= "DELETE FROM tkb_category WHERE id = $id";
// Move parent who has this product to 0
mysql_query("UPDATE tkb_category SET parent = 0 WHERE parent = $id");
$result = mysql_query($sql_delete);
if ($result)
echo ui_print_error_message (__('Successfully deleted'), '', true, 'h3', true);
else
echo ui_print_success_message (__('Cannot be deteled'), '', true, 'h3', true);
}
// CREATE form
if ((isset($_GET["create"]) OR (isset($_GET["update"])))) {
if (isset($_GET["create"])){
$icon = "";
$description = "";
$name = "";
$id = -1;
$parent = -1;
} else {
$id = get_parameter ("update",-1);
$row = get_db_row ("tkb_category", "id", $id);
开发者ID:articaST,项目名称:integriaims,代码行数:29,代码来源:manage_cat.php
示例9: get_workunit_data
$workunit_data = get_workunit_data($workunit["id_workunit"]);
echo '<div class="comment">';
show_workunit_data ($workunit_data, $title);
echo '</div>';
}
}
}
if ($is_enterprise) {
incidents_run_realtime_workflow_rules ($id_incident);
}
return;
}
else {
$result_msg = ui_print_success_message (__('Comment added successfully'), '', true, 'h3', true);
echo $result_msg;
}
if ($is_enterprise) {
incidents_run_realtime_workflow_rules ($id_incident);
}
}
$table = new StdClass();
$table->width = '100%';
$table->class = 'search-table';
$table->colspan = array ();
$table->colspan[1][0] = 6;
$table->colspan[2][0] = 6;
$table->data = array ();
开发者ID:articaST,项目名称:integriaims,代码行数:31,代码来源:incident_workunits.php
示例10: sprintf
}
/* Delete a custom saved search */
if ($id_search && $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 search'), '', true, 'h3', true);
}
else {
$id_search = false;
echo ui_print_success_message (__('Custom search deleted'), '', true, 'h3', true);
}
}
// FORM (Update / Create)
if ($id || $new) {
if ($new) {
if (!$section_write_permission && !$section_manage_permission) {
audit_db ($config["id_user"], $config["REMOTE_ADDR"], "ACL Violation", "Trying to create a lead");
require ("general/noaccess.php");
exit;
}
$id = 0;
开发者ID:articaST,项目名称:integriaims,代码行数:30,代码来源:lead_detail.php
示例11: process_sql_delete
}
echo "<br>";
print_button (__('OK'), 'OK', false, '', 'class="sub blank"');
}
}
if ($delete_agenda_entry) {
if (!empty($id) && !$permission) {
// Doesn't have access to this page
audit_db ($config['id_user'], $config["REMOTE_ADDR"], "ACL Violation", "Trying to delete an agenda entry");
include ("general/noaccess.php");
exit;
}
$result = process_sql_delete('tagenda', array('id' => $id));
if ($result !== false) {
echo ui_print_success_message (__('The event was deleted'), '', true, 'h3', true);
echo "<br>";
print_button (__('OK'), 'OK', false, '', 'class="sub blank"');
} else {
echo ui_print_error_message (__('An error ocurred. Event not deleted'), '', true, 'h3', true);
echo "<br>";
print_button (__('OK'), 'OK', false, '', 'class="sub blank"');
}
}
?>
开发者ID:articaST,项目名称:integriaims,代码行数:30,代码来源:entry.php
示例12: db_update_schema
function db_update_schema()
{
global $config;
$dir = $config["homedir"] . "extras/mr";
$message = '';
if (file_exists($dir) && is_dir($dir)) {
if (is_readable($dir)) {
$files = scandir($dir);
// Get all the files from the directory ordered by asc
if ($files !== false) {
$pattern = "/^\\d+\\.sql\$/";
$sqlfiles = preg_grep($pattern, $files);
// Get the name of the correct files
$files = null;
$pattern = "/\\.sql\$/";
$replacement = "";
$sqlfiles_num = preg_replace($pattern, $replacement, $sqlfiles);
// Get the number of the file
$sqlfiles = null;
if ($sqlfiles_num) {
foreach ($sqlfiles_num as $sqlfile_num) {
$file = "{$dir}/{$sqlfile_num}.sql";
if ($config["minor_release"] >= $sqlfile_num) {
if (!file_exists($dir . "/updated") || !is_dir($dir . "/updated")) {
mkdir($dir . "/updated");
}
$file_dest = "{$dir}/updated/{$sqlfile_num}.sql";
if (copy($file, $file_dest)) {
unlink($file);
}
} else {
$result = db_run_sql_file($file);
if ($result) {
update_config_token("minor_release", $sqlfile_num);
if ($config["minor_release"] == $sqlfile_num) {
if (!file_exists($dir . "/updated") || !is_dir($dir . "/updated")) {
mkdir($dir . "/updated");
}
$file_dest = "{$dir}/updated/{$sqlfile_num}.sql";
if (copy($file, $file_dest)) {
unlink($file);
}
}
$message = ui_print_success_message(__('The database schema has been updated to the minor release') . $sqlfile_num, '', true, 'h3', true);
} else {
$message = ui_print_error_message(__('An error occurred while updating the database schema to the minor release ') . $sqlfile_num, '', true, 'h3', true);
break;
}
}
}
}
}
} else {
$message = ui_print_error_message(__('The directory ') . $dir . __(' should have read permissions in order to update the database schema'), '', true, 'h3', true);
}
} else {
$message = ui_print_error_message(__('The directory ') . $dir . __(' does not exist'), '', true, 'h3', true);
}
return $message;
}
开发者ID:articaST,项目名称:integriaims,代码行数:60,代码来源:functions_db.mysql.php
示例13: get_parameter
$id_user = get_parameter ("id_user", $config["id_user"]);
$id_role = get_parameter ("roles", 0);
if (isset($_POST["tasks"])){
$tasks = (array) $_POST["tasks"];
}
$delete = get_parameter ("delete", 0);
if ($delete) {
$id_project = get_db_value ('id_project', 'ttask', 'id', $delete);
$project_access = get_project_access ($config['id_user'], $id_project);
$task_access = get_project_access ($config['id_user'], $id_project, $delete);
// ACL - To delete a task, you should have TW permission and belong to the task or be project manager
if ($project_access['manage'] || $task_access['manage']) {
$id_task = $delete;
$sql = "DELETE FROM trole_people_task WHERE id_task = $id_task AND id_user = '$id_user'";
$resq1=mysql_query($sql);
echo ui_print_success_message (__("Assigment removed succesfully"), '', true, 'h3', true);
} else {
audit_db ($config['id_user'], $config["REMOTE_ADDR"], "ACL Violation", "Trying to delete the task $delete");
echo ui_print_error_message (__("You do not have permission to delete this task"), '', true, 'h3', true);
}
}
$add = get_parameter ("add", 0);
if ($add && $id_role) {
foreach ($tasks as $id_task) {
$id_project = get_db_value ('id_project', 'ttask', 'id', $id_task);
$task = get_db_value ('name', 'ttask', 'id', $id_task);
if (!$id_project) {
echo ui_print_error_message (__('Error. Task is not assigned to a project.'), '', true, 'h3', true);
开发者ID:articaST,项目名称:integriaims,代码行数:31,代码来源:role_user_global.php
示例14: get_parameter
$key = get_parameter('key');
if ($fields == false) {
$fields = array();
}
foreach ($fields as $field) {
if ($field['Field'] != $key) {
$values[$field['Field']] = get_parameter($field['Field']);
}
}
$result_insert = process_sql_insert ($external_table, $values);
if ($result_insert) {
echo ui_print_success_message (__('Inserted row'), '', true, 'h3', true);
} else {
echo ui_print_error_message (__('There was a problem inserting row'), '', true, 'h3', true);
}
}
echo "<h1>".__('External table management')."</h1>";
$table = new stdClass;
$table->width = '98%';
$table->class = 'search-table';
$table->id = "external-editor";
$table->data = array ();
开发者ID:articaST,项目名称:integriaims,代码行数:29,代码来源:manage_external_tables.php
示例15: user_delete_user
function user_delete_user($id_user)
{
global $config;
// Delete user
// Delete cols from table tgrupo_usuario
if ($config["enteprise"] == 1) {
$query_del1 = "DELETE FROM tusuario_perfil WHERE id_usuario = '" . $id_user . "'";
$resq1 = mysql_query($query_del1);
}
// Delete trole_people_task entries
mysql_query("DELETE FROM trole_people_task WHERE id_user = '" . $id_user . "'");
// Delete trole_people_project entries
mysql_query("DELETE FROM trole_people_project WHERE id_user = '" . $id_user . "'");
$query_del2 = "DELETE FROM tusuario WHERE id_usuario = '" . $id_user . "'";
$resq2 = mysql_query($query_del2);
//Delet custom fields
$query_del3 = "DELETE FROM tuser_field_data WHERE id_user = '" . $id_user . "'";
$resq3 = mysql_query($query_del3);
if (!$resq2) {
echo ui_print_error_message(__('Could not be deleted'), '', true, 'h3', true);
} else {
echo ui_print_success_message(__('Successfully deleted'), '', true, 'h3', true);
}
return;
}
开发者ID:articaST,项目名称:integriaims,代码行数:25,代码来源:functions_user.php
示例16: inventories_load_file
//.........这里部分代码省略.........
if ($id_manufacturer != 0 && $id_manufacturer != '') {
$exists = get_db_value('id', 'tmanufacturer', 'id', $id_manufacturer);
if (!$exists) {
echo ui_print_error_message(__('Manufacturer ') . $id_manufacturer . __(' doesn\'t exist'), '', true, 'h3', true);
$create = false;
}
}
if ($id_object_type != 0 && $id_object_type != '') {
$exists_object_type = get_db_value('id', 'tobject_type', 'id', $id_object_type);
if (!$exists_object_type) {
echo ui_print_error_message(__('Object type ') . $id_object_type . __(' doesn\'t exist'), '', true, 'h3', true);
$create = false;
} else {
//~ $all_fields = inventories_get_all_type_field ($id_object_type);
$sql = "SELECT * FROM tobject_type_field WHERE id_object_type=" . $id_object_type;
$all_fields = get_db_all_rows_sql($sql);
if ($all_fields == false) {
$all_fields = array();
}
$value_data = array();
$i = 9;
$j = 0;
foreach ($all_fields as $key => $field) {
$data = $values[$i];
switch ($field['type']) {
case 'combo':
$combo_val = explode(",", $field['combo_value']);
$k = array_search($data, $combo_val);
if ($k === false) {
echo ui_print_error_message(__('Field ') . $field['label'] . __(' doesn\'t match. Valid values: ') . $field['combo_value'], '', true, 'h3', true);
$create = false;
}
break;
case 'numeric':
$res = is_numeric($data);
if (!$res) {
echo ui_print_error_message(__('Field ') . $field['label'] . __(' must be numeric'), '', true, 'h3', true);
$create = false;
}
break;
case 'external':
$table_ext = $field['external_table_name'];
$exists_table = get_db_sql("SHOW TABLES LIKE '{$table_ext}'");
if (!$exists_table) {
echo ui_print_error_message(__('External table ') . $table_ext . __(' doesn\'t exist'), '', true, 'h3', true);
$create = false;
}
$id = $field['external_reference_field'];
$exists_id = get_db_sql("SELECT {$id} FROM {$table_ext}");
if (!$exists_id) {
echo ui_print_error_message(__('Id ') . $id . __(' doesn\'t exist'), '', true, 'h3', true);
$create = false;
}
break;
}
if ($field['inherit']) {
$ok = inventories_check_unique_field($data, $field['type']);
if (!$ok) {
echo ui_print_error_message(__('Field ') . $field['label'] . __(' must be unique'), '', true, 'h3', true);
$create = false;
}
}
$value_data[$j]['id_object_type_field'] = $field['id'];
$value_data[$j]['data'] = safe_input($data);
$i++;
$j++;
}
}
}
if ($create) {
$result_id = process_sql_insert('tinventory', $value);
if ($result_id) {
foreach ($value_data as $k => $val_data) {
$val_data['id_inventory'] = $result_id;
process_sql_insert('tobject_field_data', $val_data);
}
if (!empty($id_companies_arr)) {
foreach ($id_companies_arr as $id_company) {
$values_company['id_inventory'] = $result_id;
$values_company['id_reference'] = $id_company;
$values_company['type'] = 'company';
process_sql_insert('tinventory_acl', $values_company);
}
}
if (!empty($id_users_arr)) {
foreach ($id_users_arr as $id_user) {
$values_user['id_inventory'] = $result_id;
$values_user['id_reference'] = $id_user;
$values_user['type'] = 'user';
process_sql_insert('tinventory_acl', $values_user);
}
}
}
}
}
//end while
fclose($file_handle);
echo ui_print_success_message(__('File loaded'), '', true, 'h3', true);
return;
}
开发者ID:articaST,项目名称:integriaims,代码行数:101,代码来源:functions_inventories.php
示例17: include_once
$search_params = "&search_text=$search_text&search_invoice_status=$search_invoice_status&search_last_date=$search_last_date&search_date_end=$search_date_end&search_date_begin=$search_date_begin&search_exp_date=$search_exp_date&search_exp_end=$search_exp_end&search_exp_begin=$search_exp_begin&order_by=$order_by&search_invoice_type=$search_invoice_type&search_company_role=$search_company_role&search_company_manager=$search_company_manager";
include_once('include/functions_crm.php');
$read = check_crm_acl ('company', 'cr');
$write = check_crm_acl ('company', 'cw');
$manage = check_crm_acl ('company', 'cm');
if (!$read) {
include ("general/noaccess.php");
exit;
}
$message = get_parameter('message', '');
if ($message != '') {
echo ui_print_success_message (__($message), '', true, 'h3', true);
}
if ($id_invoice || $id) {
if ($id_invoice) {
$id_company = get_db_value('id_company', 'tinvoice', 'id', $id_invoice);
} elseif ($id) {
$id_company = get_db_value('id_company', 'tinvoice', 'id_company', $id);
}
$permission = check_crm_acl ('invoice', '', $config['id_user'], $id_company);
if (!$permission) {
include ("general/noaccess.php");
exit;
}
开发者ID:articaST,项目名称:integriaims,代码行数:30,代码来源:invoice_detail.php
示例18: ui_print_err_message
$error_msg = ui_print_err_message (__('Project manager user does not exist'), '', true, 'h3', true);
$id_project = false;
}
else {
$sql = sprintf ('INSERT INTO tproject
(name, description, start, end, id_owner, id_project_group, cc)
VALUES ("%s", "%s", "%s", "%s", "%s", %d, "%s")',
$name, $description, $start_date, $end_date, $id_owner,
$id_project_group, $cc);
$id_project = process_sql ($sql, 'insert_id');
}
if ($id_project === false) {
echo ui_print_err_message (__('Project cannot be created, problem found.').$error_msg, '', true, 'h3', true);
} else {
echo ui_print_success_message (__('The project successfully created.').' #'.$id_project, '', true, 'h3', true);
audit_db ($id_owner, $REMOTE_ADDR, "Project created", "User ".$config['id_user']." created project '$name'");
project_tracking ($id_project, PROJECT_CREATED);
// Add this user as profile 1 (project manager) automatically
$sql = sprintf ('INSERT INTO trole_people_project
(id_project, id_user, id_role)
VALUES ("%s", "%s", 1)',
$id_project, $id_owner, 1);
process_sql ($sql);
// If current user is different than owner, add also current user
if ($config['id_user'] != $id_owner) {
$sql = sprintf ('INSERT INTO trole_people_project
(id_project, id_user, id_role)
VALUES (%d, "%s", 1)',
开发者ID:articaST,项目名称:integriaims,代码行数:31,代码来源:project_overview.php
示例19: get_parameter
$description = get_parameter ('description');
$start_date = get_parameter ('start_date');
$end_date = get_parameter ('end_date');
$id_project_group = get_parameter ("id_project_group");
$cc = get_parameter('cc', '');
$sql = sprintf ('UPDATE tproject SET
name = "%s", description = "%s", id_project_group = %d,
start = "%s", end = "%s", id_owner = "%s", cc = "%s"
WHERE id = %d',
$name, $description, $id_project_group,
$start_date, $end_date, $user, $cc, $id_project);
$result = process_sql ($sql);
audit_db ($config["id_user"], $config["REMOTE_ADDR"], "Project updated", "Project $name");
if ($result !== false) {
project_tracking ($id_project, PROJECT_UPDATED);
$result_output = ui_print_success_message (__('The project successfully updated'), '', true, 'h3', true);
} else {
$result_output = ui_print_error_message (__('Could not update project'), '', true, 'h3', true);
}
}
// Edition / View mode
if ($id_project) {
$project = get_db_row ('tproject', 'id', $id_project);
$name = $project["name"];
$description = $project["description"];
$start_date = $project["start"];
$end_date = $project["end"];
$owner = $project["id_owner"];
$id_project_group = $project["id_project_group"];
开发者ID:articaST,项目名称:integriaims,代码行数:31,代码来源:project_detail.php
示例20: attach_incident_file
/**
* Copy and insert in database a new file into incident
*
* @param int incident id
* @param string file full path
* @param string file description
*
*/
function attach_incident_file($id, $file_temp, $file_description, $email_notify = false, $file_name = "")
{
global $config;
$file_temp = safe_output($file_temp);
// Decoding HTML entities
$filesize = filesize($file_temp);
// In bytes
if ($file_name != "") {
$filename = $file_name;
} else {
$filename = basename($file_temp);
}
$filename = str_replace(array(" ", "(", ")"), "_", $filename);
// Replace blank spaces
$filename = filter_var($filename, FILTER_SANITIZE_URL);
// Replace conflictive characters
$sql = sprintf('INSERT INTO tattachment (id_incidencia, id_usuario,
filename, description, size)
VALUES (%d, "%s", "%s", "%s", %d)', $id, $config['id_user'], $filename, $file_description, $filesize);
$id_attachment = process_sql($sql, 'insert_id');
incident_tracking($id, INCIDENT_FILE_ADDED);
$result_msg = ui_print_success_message(__('File added'), '', true);
// Email notify to all people involved in this incident
if ($email_notify) {
if ($config["email_on_incident_update"] == 1) {
mail_incident($id, $config['id_user'], 0, 0, 2);
}
}
// Copy file to directory and change name
$file_target = $config["homedir"] . "attachment/" . $id_attachment . "_" . $filename;
$copy = copy($file_temp, $file_target);
if (!$copy) {
$result_msg = ui_print_error_message(__('File cannot be saved. Please contact Integria administrator about this error'), '', true);
$sql = sprintf('DELETE FROM tattachment
WHERE id_attachment = %d', $id_attachment);
process_sql($sql);
} else {
// Delete temporal file
unlink($file_temp);
// Adding a WU noticing about this
$link = "<a target='_blank' href='operation/common/download_file.php?type=incident&id_attachment=" . $id_attachment . "'>" . $filename . "</a>";
$note = "Automatic WU: Added a file to this issue. Filename uploaded: " . $link;
$public = 1;
$timeused = 0;
create_workunit($id, $note, $config["id_user"], $timeused, 0, "", $public);
$timestamp = print_mysql_timestamp();
$sql = sprintf('UPDATE tincidencia SET actualizacion = "%s" WHERE id_incidencia = %d', $timestamp, $id);
process_sql($sql);
}
return $result_msg;
}
开发者ID:dsyman2,项目名称:integriaims,代码行数:59,代码来源:functions_incidents.php
注:本文中的ui_print_success_message函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论