pluginsGLPI / barcode

GNU Affero General Public License v3.0
36 stars 34 forks source link

Display on label depends on integration in QRcode #122

Open CoralieXXC opened 1 year ago

CoralieXXC commented 1 year ago

Hello,

I have been using the barcode plugin and it is great!

I have noticed that, in the form, I need to both select "Yes" for a field and "Yes" for the display of the same field in order to be able to display it. Only selecting "Yes" for the display doesn't work. Is it an intended behaviour?

If it is not the intended behaviour, I think in qrcode.class.php, the code should be:

      if ($data['name']) {
         if ($item->fields['name'] != '') {
            $have_content = true;
         }
         $a_content[] = __('Item Name').' = '.$item->fields['name'];
      }
      if ($data['displayname']) {
         $label = '';
         if ($data['displaylabels']) {
            $label = __('Item Name').': ';
         }
         $b_content[] = $label.$item->fields['name'];
      }

instead of:

      if ($data['name']) {
         if ($item->fields['name'] != '') {
            $have_content = true;
         }
         $a_content[] = __('Item Name').' = '.$item->fields['name'];
         if ($data['displayname']) {
            $label = '';
            if ($data['displaylabels']) {
               $label = __('Item Name').': ';
            }
            $b_content[] = $label.$item->fields['name'];
         }
      }

Any idea about this?

Many thanks!