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
Guest
Registered: 2017-08-10
Posts: 47

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
Guest
Registered: 2017-08-10
Posts: 47

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
Guest
Registered: 2017-08-10
Posts: 47

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: 3,829

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...
*GLPI 9.1.6+fusion9.1+1.1+behaviours1.5.0+reports+fields+appliances+pdf+badges+formcreator2.5.2 PHP7.0 Mariadb10
*GLPI 9.2.2(behaviours1.5.2+fusion9.2+1.0+applicatifs2.3.0+dashboard 0.8.9)hebergé sur serveur mutualisé.
*GLPI 9.3 BETA  en test (ubuntu 16.04 mariadb 10.2.4)

Offline

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

Bedoui
Guest
Registered: 2017-08-10
Posts: 47

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
Guest
Registered: 2017-08-10
Posts: 47

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

Board footer

Powered by FluxBB