You are not logged in.
The report docs state to use:
new PluginReportsColumnLink( field , label , itemtype , options);
- or -
new PluginReportsColumnTypeLink( field , label , fieldtype , options);
My report is correct expect for the link. I want to link to the ticket. I am trying to link the ticket ID:
new PluginReportsColumnTypeLink('id','Ticket ID','id'),
I have glpi_tickets.ID as id. I have tried both link examples and am still coming up short.
Thanks,
Dan
Offline
I kind of fixed it with this:
new PluginReportsColumnLink('id','Ticket ID','Ticket',
array('with_navigate' => true,
'sorton' => 'glpi_tickets.id')),
// new PluginReportsColumn('name2','Ticket'),
I wanted to display :
Ticket ID Ticket Title(link)
The above code changes the ID to the title and adds a link.
I commented out the second line as it was displaying:
Title(Link) Title
Thanks,
Dan
Offline
ug...
any ideas why this isn't working? I have the exact code used for computer lookups and it works just fine.
replace 'monitors' with 'computers' and that is how the working one looks.
<?
define('GLPI_ROOT', '../../../..');
include(GLPI_ROOT."/inc/includes.php");
$USEDBREPLICATE=0;
$DBCONNECTION_REQUIRED=1;
$report = new PluginReportsAutoReport($LANG['plugin_reports']['inventory_monitors'][1]);
// (sql field, column name)
$columns= array(new PluginReportsColumn('name1','User Name'),
new PluginReportsColumn('itemtype','Item'),
new PluginReportsColumnLink('name2','Item Name','Monitor',
array('with_navigate' => true)),
new PluginReportsColumn('serial','Serial'),
new PluginReportsColumn('otherserial','MSB Inv'),
new PluginReportsColumn('inventory_date','Last Inventory Date'));
$report->setColumnsNames($columns);
//SQL Statement
$sql="SELECT glpi_users.name AS name1, glpi_infocoms.itemtype, glpi_monitors.name AS name2, glpi_monitors.serial, glpi_monitors.otherserial, glpi_infocoms.inventory_date
FROM glpi_users INNER JOIN (glpi_infocoms INNER JOIN glpi_monitors ON glpi_infocoms.items_id = glpi_monitors.ID) ON glpi_users.ID = glpi_monitors.users_id
WHERE (((glpi_infocoms.itemtype)='monitor'))
ORDER BY glpi_users.name";
$report->setSqlRequest($sql);
$report->execute();
?>
Thanks,
Dan
Offline
Try new PluginReportsColumnLink('id', 'Ticket ID', 'Ticket'),
CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6 - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)
Offline
still doesn't give me a link.
Thanks,
Dan
Offline