In this article we will see how to add additional attributes in our Dolibarr URL type. In this way we can create fields where we can enter a URL and we can click on the link to visit the página.Aunque this and what we can do with a text field, the text field can not click on the link created . The result we want to obtain is as follows: Dolibarr campos url redes sociales Dolibarr añadir atributos adicionales de tipo URL Although the change is generic to the entire application, I will base the example to use this type of field on the cards of our contacts where I will add information on their web and social networks. We will explain the steps that should be made to do so.

Create custom fields

To do this we go to the module configuration Third parties. In the third tab additional attributes We create fields that need the type Link. Dolibarr nuevo tipo de campo personalizado enlace Dolibarr añadir atributos adicionales de tipo URL The data to fill each of the fields would be:

  • Label: Name to be displayed on the Contact tab.
  • Attribute code: Is the internal name. Always avoid using spaces and lowercase letters.
  • Position: It is a numerical value of 1..n that will help us to display all the fields we have created in the order you indicate.

The other options are optional and taste of each. Dolibarr creacion de campos personalizados de tipo url Dolibarr añadir atributos adicionales de tipo URL And this would be the result. In the record of our contacts we can already visualize the links to the website and social networks that you have that you can visit by clicking directly on the link (which with text attribute can not do). Dolibarr Ficha Contacto Dolibarr añadir atributos adicionales de tipo URL

How to implement

In order to implement the type of URL field we have to touch the code of our Dolibarr. You have to touch the files:

  • coreclassextrafields.class.php
  • corelibfunctions.lib.php

In the file functions.lib.php you just have to change the display size of the field so that when accessing the contact card does not leave the field and cut the url appears with an ellipsis. Change:

dol_print_url function ($ url, $ target = '_ blank', $ max = 32)

by:

dol_print_url function ($ url, $ target = '_ blank', $ max = 60)

The extrafields.class.php file has more homework and this is where we need to create the new type and how to treat it properly to save the data and display the link format. Here you can download the file with the changes for version 3.7.1 of dolibarr:

Dolibarr 3.7.1 extrafields.class

Upgrade your Dolibarr to the latest version without risks If you like Dolibarr and would always be the last, write me and I will give personalized pricing to upgrade your Dolibarr environment without risk or compliaciones.

Keep updated your ERP / CRM Dolibarr

logo dolibarr Dolibarr añadir atributos adicionales de tipo URL

 

  • Upgrade your Dolibarr without complications or risks to the latest version.
  • Keep your data safe. I perform backup before performing the process.
  • all information is migrated without losing anything.
  • Escríbeme y te daré presupuesto personalizado sin compromiso pulsando el siguiente botón:

Quiero saber más sobre cómo Actualizar Dolibarr

 

Dime qué te ha parecido el artículo...

rating off Dolibarr añadir atributos adicionales de tipo URLrating off Dolibarr añadir atributos adicionales de tipo URLrating off Dolibarr añadir atributos adicionales de tipo URLrating off Dolibarr añadir atributos adicionales de tipo URLrating off Dolibarr añadir atributos adicionales de tipo URL (Ninguna valoración todavía)
loading Dolibarr añadir atributos adicionales de tipo URLCargando…
Advertisements

Use of cookies

This site uses cookies for you to have the best user experience. If you continue to browse you are giving your consent to the acceptance of the above cookies and acceptance of our cookies policy, Click the link for more information.

OK
Notice of cookies

Veo que te gusta mi Blog...

Si te ha parecido interesante este artículo, no esperes a suscribirte a mi blog. Cuando vuelva a escribir otro seguro que te interesará y no desearás no haberte enterado. Puedes suscribirte con total tranquilidad de que no recibirás spam. Lo odio igual que tu. Solo quiero que aprendas cosas nuevas y te sientas agusto con mis artículos. ¡Gracias!

Thank you for subscribing!

Pin it on Pinterest

Share This

Share

Share this with your friends!