2013-03-07 Sergio Martin <sergio.martin@artica.es>

* include/functions_events.php
	operation/events/events.build_table.php: Fixed the owner info
	in wrong column of event view for bug 3607097

	Fixed a problem changing the owner when change status too



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7804 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2013-03-07 09:46:35 +00:00
parent cb0044375a
commit de332b7cda
3 changed files with 29 additions and 9 deletions

View File

@ -1,3 +1,11 @@
2013-03-07 Sergio Martin <sergio.martin@artica.es>
* include/functions_events.php
operation/events/events.build_table.php: Fixed the owner info
in wrong column of event view for bug 3607097
Fixed a problem changing the owner when change status too
2013-03-07 Sergio Martin <sergio.martin@artica.es>
* operation/events/events.build_table.php: Added carriage

View File

@ -498,7 +498,7 @@ function events_change_owner ($id_event, $new_owner = false, $force = false, $me
}
// If no new_owner is provided, the current user will be the owner
if($new_owner === false) {
if(empty($new_owner)) {
$new_owner = $config['id_user'];
}
@ -511,9 +511,9 @@ function events_change_owner ($id_event, $new_owner = false, $force = false, $me
$where = array('id_evento' => $id_event);
// If not force, add to where if owner_user <> ''
// If not force, add to where if owner_user = ''
if(!$force) {
$where['owner_user'] = '<>';
$where['owner_user'] = '';
}
$ret = db_process_sql_update($event_table, $values,
@ -2059,6 +2059,9 @@ function events_page_general ($event) {
}
else {
$user_owner = db_get_value('fullname', 'tusuario', 'id_user', $event["owner_user"]);
if(empty($user_owner)) {
$user_owner = $event['owner_user'];
}
$data[1] = $user_owner;
}
$table_general->data[] = $data;
@ -2122,6 +2125,9 @@ function events_page_general ($event) {
if($event['estado'] == 1) {
$user_ack = db_get_value('fullname', 'tusuario', 'id_user', $event['id_usuario']);
if(empty($user_ack)) {
$user_ack = $event['id_usuario'];
}
$date_ack = date ($config["date_format"], $event['ack_utimestamp']);
$data[1] = $user_ack.' ('.$date_ack.')';
}

View File

@ -319,15 +319,21 @@ foreach ($result as $event) {
$i++;
}
if (in_array('owner_user',$show_fields)) {
$owner_name = db_get_value('fullname', 'tusuario', 'id_user', $event['owner_user']);
$data[$i] = $owner_name;
if (in_array('id_usuario',$show_fields)) {
$user_name = db_get_value('fullname', 'tusuario', 'id_user', $event['id_usuario']);
if(empty($user_name)) {
$user_name = $event['id_usuario'];
}
$data[$i] = $user_name;
$i++;
}
if (in_array('id_usuario',$show_fields)) {
$user_name = db_get_value('fullname', 'tusuario', 'id_user', $event['id_usuario']);
$data[$i] = $user_name;
if (in_array('owner_user',$show_fields)) {
$owner_name = db_get_value('fullname', 'tusuario', 'id_user', $event['owner_user']);
if(empty($owner_name)) {
$owner_name = $event['owner_user'];
}
$data[$i] = $owner_name;
$i++;
}