Hi everyone,

In my pull request #343 (https://github.com/Dolibarr/dolibarr/pull/343/files),
I introduced a change that maybe some people don't agree.

It is changing this:

>  $h = 0;
>  $head = array();
> $head[$h][0] =
> DOL_URL_ROOT.'/adherents/fiche_subscription.php?rowid='.$subscription->id;
>  $head[$h][1] = $langs->trans("SubscriptionCard");
>  $head[$h][2] = 'general';
> $h++;
>  $head[$h][0] =
> DOL_URL_ROOT.'/adherents/info_subscription.php?rowid='.$subscription->id;
>  $head[$h][1] = $langs->trans("Info");
>  $head[$h][2] = 'info';
> $h++;
>  dol_fiche_head($head, 'general', $langs->trans("Subscription"));


To this:

 $tabs = array(
> array(
> DOL_URL_ROOT.'/adherents/fiche_subscription.php?rowid='.$subscription->id,
>  $langs->trans('SubscriptionCard'),
> 'general'
> ),
>  array(
> DOL_URL_ROOT.'/adherents/info_subscription.php?rowid='.$subscription->id,
>  $langs->trans('Info'),
> 'info'
> )
>  );
>
> dol_fiche_head($tabs, 'general', $langs->trans("Subscription"));
>
>
I prefer the 2nd way because it doesn't make sense to use $h if we know the
value of $h and if the array is not going to be generated dynamically, also
we already know the value of the array so it doesn't make sense to split it
in multiple lines.

I was planning to change it for every call of dol_fiche_head in Dolibarr,
but a comment in the pull request of Régis made me think that maybe you
don't like this change.

What do you think about it?

Regards,


*Marcos García*

marcos...@gmail.com
_______________________________________________
Dolibarr-dev mailing list
Dolibarr-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev

Répondre à