dolibarr-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Dolibarr-dev] Question about the use of $links of dol_fiche_head()


From: Régis Houssin
Subject: Re: [Dolibarr-dev] Question about the use of $links of dol_fiche_head()
Date: Fri, 24 Aug 2012 18:49:15 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:14.0) Gecko/20120713 Thunderbird/14.0

hi,

it was a joke, I also prefer the 2nd way, it avoids errors numbering

:-))


Le 24/08/12 18:00, Marcos García a écrit :
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
address@hidden



_______________________________________________
Dolibarr-dev mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev

Cordialement,
-- 
Régis Houssin
---------------------------------------------------------
Cap-Networks
Cidex 1130
34, route de Gigny
71240 MARNAY
FRANCE
VoIP: +33 1 83 62 40 03
GSM: +33 6 33 02 07 97
Web: http://www.cap-networks.com/
Email: address@hidden

Dolibarr developer: address@hidden
Web Portal: http://www.dolibarr.fr/
SaaS offers: http://www.dolibox.fr/
Shop: http://www.dolistore.com/
Development platform: https://doliforge.org/
---------------------------------------------------------

reply via email to

[Prev in Thread] Current Thread [Next in Thread]