You are not logged in.
Pages: 1
Topic closed
I am trying to combine user first name with last name in the output.
Nothing is working yet.
I can use:
new PluginReportsColumn('name2','Password Reset For:'),
new PluginReportsColumn('name3',' '));
It works, but it's not pretty. How can I get them to both be in the same output field?
I am using glpi_users.firstname and glpi_users.realname fields
Thanks,
Dan
Offline
Dear danh,
You have two solutions:
Either to create a virtual field in the SELECT clause in your SQL request, or what I'm doing most of the time is to use a mySQL 'view' that I later use in my report.
regards,
Tomolimo
Last edited by tomolimo (2012-10-29 17:48:08)
GLPI 9.2.4 - PHP 7.2.13 x64 / ProcessMaker 3.3.0-community-RE-1.7 - PHP 7.1.24 x64 / Windows 2012 x64 / IIS 8.5 / MySQL 5.7.17 x64
Worldwide: >12316 PC, >9400 users (16 languages, >11 timezones), >360k tickets, >3600 entities, >4200 groups
Raynet is ARaymond (http://www.araymond.com) IT service management
Offline
I have created the view, but I am not able to call this in the actual SQL statement.
Here is what I am working with:
$sql="SELECT glpi_tickets.name as name1, glpi_tickets.Date, glpi_tickets.content, glpi_users.realname as name3, glpi_users.firstname as name2
FROM (glpi_tickets_users INNER JOIN glpi_tickets ON glpi_tickets_users.tickets_id = glpi_tickets.ID) INNER JOIN glpi_users ON glpi_tickets_users.users_id = glpi_users.ID
WHERE (((glpi_tickets.itilcategories_id)=32) AND ((glpi_tickets_users.type)=1))";
Thanks,
Dan
Offline
Try this:
SELECT glpi_tickets.name as name1, glpi_tickets.Date, glpi_tickets.content, CONCAT(glpi_users.realname, ' ' , glpi_users.firstname ) as UserName
regards,
Tomolimo
GLPI 9.2.4 - PHP 7.2.13 x64 / ProcessMaker 3.3.0-community-RE-1.7 - PHP 7.1.24 x64 / Windows 2012 x64 / IIS 8.5 / MySQL 5.7.17 x64
Worldwide: >12316 PC, >9400 users (16 languages, >11 timezones), >360k tickets, >3600 entities, >4200 groups
Raynet is ARaymond (http://www.araymond.com) IT service management
Offline
That works awesome. Thank you very much!
Thanks,
Dan
Offline
Pages: 1
Topic closed