You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2018-04-12 14:07:23

Bedoui
Member
Registered: 2017-08-10
Posts: 68

show printers on glpi

Hi everyone ,

I have imported from old glpi version to an GLPI 9.1.2 version ,based on sql dump , all printers so I test the import works very well . but only glpi user could show the printers even a user have same profille super-admin could not show the printers .

what's the main cause ?

Last edited by Bedoui (2018-04-12 16:36:29)

Offline

#2 2018-04-12 17:27:02

Bedoui
Member
Registered: 2017-08-10
Posts: 68

Re: show printers on glpi

enable debug mode return this sql query

SELECT 'glpi' AS currentuser, `glpi_printers`.`entities_id`, `glpi_printers`.`is_recursive`, `glpi_printers`.`name` AS `ITEM_0`, `glpi_printers`.`id` AS `ITEM_0_id`, `glpi_entities`.`completename` AS `ITEM_1`, `glpi_states`.`completename` AS `ITEM_2`, `glpi_manufacturers`.`name` AS `ITEM_3`, `glpi_locations`.`completename` AS `ITEM_4`, `glpi_printertypes`.`name` AS `ITEM_5`, `glpi_printermodels`.`name` AS `ITEM_6`, `glpi_printers`.`id` AS id
FROM `glpi_printers`
LEFT JOIN `glpi_entities` ON (`glpi_printers`.`entities_id` = `glpi_entities`.`id` )
LEFT JOIN `glpi_states` ON (`glpi_printers`.`states_id` = `glpi_states`.`id` )
LEFT JOIN `glpi_manufacturers` ON (`glpi_printers`.`manufacturers_id` = `glpi_manufacturers`.`id` )
LEFT JOIN `glpi_locations` ON (`glpi_printers`.`locations_id` = `glpi_locations`.`id` )
LEFT JOIN `glpi_printertypes` ON (`glpi_printers`.`printertypes_id` = `glpi_printertypes`.`id` )
LEFT JOIN `glpi_printermodels` ON (`glpi_printers`.`printermodels_id` = `glpi_printermodels`.`id` )
WHERE `glpi_printers`.`is_deleted` = '0' AND `glpi_printers`.`is_template` = '0'
ORDER BY ITEM_0 ASC limit 1,20

Offline

#3 2018-04-16 13:39:34

Bedoui
Member
Registered: 2017-08-10
Posts: 68

Re: show printers on glpi

I tried to create a printer  manually  with superadmin profile  but strangely the recent printer is  visible only for glpi   however the user(creator )  has the profile super-admin

Last edited by Bedoui (2018-04-16 14:15:29)

Offline

#4 2018-04-16 13:46:42

LaDenrée
HELPER
Registered: 2012-11-19
Posts: 6,288

Re: show printers on glpi

check entities :  (glpi_printers.entities_id)
check if your user profils is valid on this entity.

check if printers are in dustbin : `glpi_printers`.`is_deleted` = '0'


Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1  Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9

Offline

#5 2018-04-16 15:29:25

Bedoui
Member
Registered: 2017-08-10
Posts: 68

Re: show printers on glpi

the profile of super admin has id =4
MariaDB [glpi]> select * from glpi_profiles where id=4 ;
+----+-------------+-----------+------------+-------------------+-------------------------------------------------------------------------------------+---------------+----------+---------+----------------+------------------------+--------------------+---------------+---------------+
| id | name        | interface | is_default | helpdesk_hardware | helpdesk_item_type                                                                  | ticket_status | date_mod | comment | problem_status | create_ticket_on_login | tickettemplates_id | change_status | date_creation |
+----+-------------+-----------+------------+-------------------+-------------------------------------------------------------------------------------+---------------+----------+---------+----------------+------------------------+--------------------+---------------+---------------+
|  4 | Super-Admin | central   |          0 |                 3 | ["Computer","Monitor","NetworkEquipment","Peripheral","Phone","Printer","Software"] | []            | NULL     | NULL    | []             |                      0 |                  0 | NULL          | NULL          |
+----+-------------+-----------+------------+-------------------+-------------------------------------------------------------------------------------+---------------+----------+---------+----------------+------------------------+--------------------+---------------+---------------+
1 row in set (0.00 sec)

MariaDB [glpi]> show columns from glpi_profiles_users ;
+--------------+------------+------+-----+---------+----------------+
| Field        | Type       | Null | Key | Default | Extra          |
+--------------+------------+------+-----+---------+----------------+
| id           | int(11)    | NO   | PRI | NULL    | auto_increment |
| users_id     | int(11)    | NO   | MUL | 0       |                |
| profiles_id  | int(11)    | NO   | MUL | 0       |                |
| entities_id  | int(11)    | NO   | MUL | 0       |                |
| is_recursive | tinyint(1) | NO   | MUL | 1       |                |
| is_dynamic   | tinyint(1) | NO   | MUL | 0       |                |
+--------------+------------+------+-----+---------+----------------+
6 rows in set (0.00 sec)

the id of glpi user is 2

MariaDB [glpi]>  select * from glpi_profiles_users where users_id=2;
+-----+----------+-------------+-------------+--------------+------------+
| id  | users_id | profiles_id | entities_id | is_recursive | is_dynamic |
+-----+----------+-------------+-------------+--------------+------------+
|   2 |        2 |           4 |           0 |            1 |          0 |
| 520 |        2 |           1 |           0 |            0 |          0 |
| 521 |        2 |           4 |           0 |            1 |          0 |
+-----+----------+-------------+-------------+--------------+------------+
3 rows in set (0.00 sec)


the id of user who create manulally the printer is 12 (has superadmin as profile ;; entities_id is 0)

MariaDB [glpi]>  select * from glpi_profiles_users where users_id=12;
+-----+----------+-------------+-------------+--------------+------------+
| id  | users_id | profiles_id | entities_id | is_recursive | is_dynamic |
+-----+----------+-------------+-------------+--------------+------------+
|  16 |       12 |           2 |           0 |            0 |          0 |
| 522 |       12 |           4 |           0 |            1 |          0 |
| 523 |       12 |           1 |           0 |            1 |          0 |
| 530 |       12 |          12 |           6 |            1 |          0 |
| 532 |       12 |          10 |           0 |            1 |          0 |
| 538 |       12 |          14 |           8 |            1 |          0 |
| 571 |       12 |          15 |           0 |            1 |          0 |
| 592 |       12 |          18 |           0 |            1 |          0 |
| 589 |       12 |          13 |           0 |            1 |          0 |
| 590 |       12 |           9 |           0 |            1 |          0 |
+-----+----------+-------------+-------------+--------------+------------+
10 rows in set (0.00 sec)

so if i get details of printer created manullay i got this with 0 as entities_id

MariaDB [glpi]>   select * from glpi_printers where id =7636;
+------+-------------+--------------+------------------+---------------------+---------+-------------+---------------+----------------+--------+-------------+-------------+---------------+----------+-----------+---------------+---------+-------------+--------------+------------+-------------+-----------------+------------------+------------------+-----------+------------+-------------+---------------+--------------------+--------------------+----------+-----------+-----------+------------+------------+
| id   | entities_id | is_recursive | name             | date_mod            | contact | contact_num | users_id_tech | groups_id_tech | serial | otherserial | have_serial | have_parallel | have_usb | have_wifi | have_ethernet | comment | memory_size | locations_id | domains_id | networks_id | printertypes_id | printermodels_id | manufacturers_id | is_global | is_deleted | is_template | template_name | init_pages_counter | last_pages_counter | users_id | groups_id | states_id | ticket_tco | is_dynamic |
+------+-------------+--------------+------------------+---------------------+---------+-------------+---------------+----------------+--------+-------------+-------------+---------------+----------+-----------+---------------+---------+-------------+--------------+------------+-------------+-----------------+------------------+------------------+-----------+------------+-------------+---------------+--------------------+--------------------+----------+-----------+-----------+------------+------------+
| 7636 |           0 |            1 | Imprimantedetest | 2018-04-16 13:39:57 |         |             |            12 |             13 |        |             |           0 |             0 |        0 |         0 |             0 |         |             |           15 |          0 |           0 |               2 |               12 |              533 |         0 |          0 |           0 | NULL          |                  0 |                  0 |        0 |        13 |         1 |     0.0000 |          0 |
+------+-------------+--------------+------------------+---------------------+---------+-------------+---------------+----------------+--------+-------------+-------------+---------------+----------+-----------+---------------+---------+-------------+--------------+------------+-------------+-----------------+------------------+------------------+-----------+------------+-------------+---------------+--------------------+--------------------+----------+-----------+-----------+------------+------------+
1 row in set (0.00 sec)



MariaDB [glpi]>   select entities_id  from glpi_printers where id =7636;
+-------------+
| entities_id |
+-------------+
|           0 |
+-------------+
1 row in set (0.00 sec)







MariaDB [glpi]> select count(id) from  glpi_printers  where is_deleted=0 ;
+-----------+
| count(id) |
+-----------+
|       749 |
+-----------+
1 row in set (0.01 sec)



MariaDB [glpi]> select count(id) from  glpi_printers  where is_deleted=1 ;
+-----------+
| count(id) |
+-----------+
|       919 |
+-----------+
1 row in set (0.00 sec)

Offline

#6 2018-04-17 13:18:15

Bedoui
Member
Registered: 2017-08-10
Posts: 68

Re: show printers on glpi

I'm not sure why printers are not visible even if printer is created manually .I'm certain that is not related to dump from another version

Offline

#7 2018-09-24 18:29:44

Bedoui
Member
Registered: 2017-08-10
Posts: 68

Re: show printers on glpi

I need an explanation : why  printers are not  visible after an import (i take an example of super-Admin)

MariaDB [glpi]>  select entities_id,profiles_id from glpi_users where name =92606;
+-------------+-------------+
| entities_id | profiles_id |
+-------------+-------------+
|           0 |           4 |
+-------------+-------------+
1 row in set, 11 warnings (0.00 sec)



MariaDB [glpi]> select id,name from glpi_entities where id =0;
+----+------+
| id | name |
+----+------+
|  0 | GCT  |
+----+------+
1 row in set (0.00 sec)





MariaDB [glpi]> select entities_id,name from glpi_printers limit 1 ;
+-------------+----------------------------------------+
| entities_id | name                                   |
+-------------+----------------------------------------+
|           0 | HP LaserJet 8100 Series PCL6           |
+-------------+----------------------------------------+

Offline

#8 2018-10-12 15:03:54

Bedoui
Member
Registered: 2017-08-10
Posts: 68

Re: show printers on glpi

In debug mode : Unknown column 'glpi_printers.date_creation' in 'field list' is displayed

Offline

#9 2018-10-22 14:21:34

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,278

Re: show printers on glpi

Version of GLPI used?
Do you used some plugins?


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

#10 2019-12-05 17:09:51

Bedoui
Member
Registered: 2017-08-10
Posts: 68

Re: show printers on glpi

GLPI version :: GLPI 9.1.2 Copyright (C) 2015-2016
I use  plugin but printers are not visible since i try to change filter and when i when choose Date creation

Offline

#11 2020-01-06 16:53:54

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,278

Re: show printers on glpi

9.1.2? migrate to 9.1.7.1 at least


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

#12 2020-01-07 13:31:12

mab3
Member
Registered: 2014-09-22
Posts: 193

Re: show printers on glpi

Hi,
Do you export with the CLI command

mysqldump

?


Contexte : GLPI 9.4.3/FusionInventory 9.4+1.1 / Agent FI 2.5.1

Offline

Board footer

Powered by FluxBB