From 6c27963d1d87a1fec6f8731270ab971f729ac5f4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Jun 2012 14:30:58 +0200 Subject: [PATCH 1/9] Fix: Use order date for stats, not valid date. --- htdocs/commande/class/commandestats.class.php | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index 7aa1f4280b6..bc209081ca5 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -28,8 +28,7 @@ include_once DOL_DOCUMENT_ROOT . "/fourn/class/fournisseur.commande.class.php"; /** - * \class CommandeStats - * \brief Classe permettant la gestion des stats des commandes + * Class to manage order statistics */ class CommandeStats extends Stats { @@ -66,7 +65,7 @@ class CommandeStats extends Stats $this->from = MAIN_DB_PREFIX.$object->table_element." as c"; $this->from.= ", ".MAIN_DB_PREFIX."societe as s"; $this->field='total_ht'; - $this->where.= " c.fk_statut > 0"; + $this->where.= " c.fk_statut > 0"; // Not draft and not cancelled } if ($mode == 'supplier') { @@ -74,7 +73,7 @@ class CommandeStats extends Stats $this->from = MAIN_DB_PREFIX.$object->table_element." as c"; $this->from.= ", ".MAIN_DB_PREFIX."societe as s"; $this->field='total_ht'; - $this->where.= " c.fk_statut > 0"; + $this->where.= " c.fk_statut > 0"; // Not draft and not cancelled } $this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity; @@ -97,10 +96,10 @@ class CommandeStats extends Stats global $conf; global $user; - $sql = "SELECT date_format(c.date_valid,'%m') as dm, count(*) nb"; + $sql = "SELECT date_format(c.date_commande,'%m') as dm, count(*) nb"; $sql.= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " WHERE date_format(c.date_valid,'%Y') = '".$year."'"; + $sql.= " WHERE date_format(c.date_commande,'%Y') = '".$year."'"; $sql.= " AND ".$this->where; $sql.= " GROUP BY dm"; $sql.= $this->db->order('dm','DESC'); @@ -119,7 +118,7 @@ class CommandeStats extends Stats global $conf; global $user; - $sql = "SELECT date_format(c.date_valid,'%Y') as dm, count(*), sum(c.".$this->field.")"; + $sql = "SELECT date_format(c.date_commande,'%Y') as dm, count(*), sum(c.".$this->field.")"; $sql.= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE ".$this->where; @@ -140,10 +139,10 @@ class CommandeStats extends Stats global $conf; global $user; - $sql = "SELECT date_format(c.date_valid,'%m') as dm, sum(c.".$this->field.")"; + $sql = "SELECT date_format(c.date_commande,'%m') as dm, sum(c.".$this->field.")"; $sql.= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " WHERE date_format(c.date_valid,'%Y') = '".$year."'"; + $sql.= " WHERE date_format(c.date_commande,'%Y') = '".$year."'"; $sql.= " AND ".$this->where; $sql.= " GROUP BY dm"; $sql.= $this->db->order('dm','DESC'); @@ -162,10 +161,10 @@ class CommandeStats extends Stats global $conf; global $user; - $sql = "SELECT date_format(c.date_valid,'%m') as dm, avg(c.".$this->field.")"; + $sql = "SELECT date_format(c.date_commande,'%m') as dm, avg(c.".$this->field.")"; $sql.= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " WHERE date_format(c.date_valid,'%Y') = '".$year."'"; + $sql.= " WHERE date_format(c.date_commande,'%Y') = '".$year."'"; $sql.= " AND ".$this->where; $sql.= " GROUP BY dm"; $sql.= $this->db->order('dm','DESC'); @@ -182,7 +181,7 @@ class CommandeStats extends Stats { global $user; - $sql = "SELECT date_format(c.date_valid,'%Y') as year, count(*) as nb, sum(c.".$this->field.") as total, avg(".$this->field.") as avg"; + $sql = "SELECT date_format(c.date_commande,'%Y') as year, count(*) as nb, sum(c.".$this->field.") as total, avg(".$this->field.") as avg"; $sql.= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE ".$this->where; From 383195581f6e2347c401be32fa73dced9aa3d363 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Jun 2012 17:50:32 +0200 Subject: [PATCH 2/9] Fix: Messy source address --- htdocs/core/lib/pdf.lib.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 8aec9a4349d..650b83c6016 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -214,18 +214,21 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target if ($sourcecompany->state_id && empty($sourcecompany->departement)) $sourcecompany->departement=getState($sourcecompany->state_id); if ($targetcompany->state_id && empty($targetcompany->departement)) $targetcompany->departement=getState($targetcompany->state_id); - if ($mode == 'source' || ! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS)) + if ($mode == 'source') { $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($sourcecompany))."\n"; - // Tel - if ($sourcecompany->tel) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($sourcecompany->tel); - // Fax - if ($sourcecompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($sourcecompany->fax); - // EMail - if ($sourcecompany->email) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($sourcecompany->email); - // Web - if ($sourcecompany->url) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($sourcecompany->url); + if (! empty($conf->global->MAIN_PDF_ADDALSOSOURCEDETAILS)) + { + // Tel + if ($sourcecompany->tel) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($sourcecompany->tel); + // Fax + if ($sourcecompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($sourcecompany->fax); + // EMail + if ($sourcecompany->email) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($sourcecompany->email); + // Web + if ($sourcecompany->url) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($sourcecompany->url); + } } if ($mode == 'target') From c28c5c10035d2a63adaa9204befa33bb964ed375 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Jun 2012 19:58:35 +0200 Subject: [PATCH 3/9] Fix: Bad calculation of nb of line. Fix: Bad position of lines into pdf_soleil --- htdocs/core/lib/functions.lib.php | 5 ++-- .../fichinter/doc/pdf_soleil.modules.php | 23 +++++++++++++++---- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e3818af190c..d7ae1cd1440 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3249,7 +3249,7 @@ function dol_nboflines($s,$maxchar=0) /** - * Return nb of lines of a formated text with \n and
+ * Return nb of lines of a formated text with \n and
(we can't have both \n and br) * * @param string $text Text * @param int $maxlinesize Largeur de ligne en caracteres (ou 0 si pas de limite - defaut) @@ -3258,8 +3258,9 @@ function dol_nboflines($s,$maxchar=0) */ function dol_nboflines_bis($text,$maxlinesize=0,$charset='UTF-8') { - //print $text; $repTable = array("\t" => " ", "\n" => "
", "\r" => " ", "\0" => " ", "\x0B" => " "); + if (dol_textishtml($text)) $repTable = array("\t" => " ", "\n" => " ", "\r" => " ", "\0" => " ", "\x0B" => " "); + $text = strtr($text, $repTable); if ($charset == 'UTF-8') { $pattern = '/(<[^>]+>)/Uu'; } // /U is to have UNGREEDY regex to limit to one html tag. /u is for UTF8 support else $pattern = '/(<[^>]+>)/U'; // /U is to have UNGREEDY regex to limit to one html tag. diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index a8117d80cfe..91f4b18c172 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -227,7 +227,7 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->line($this->marge_gauche, $nexY, $this->page_largeur-$this->marge_droite, $nexY); - $pdf->MultiCell(0, 3, ''); // Set interline to 3. Then writeMultiCell must use 3 also. + $pdf->MultiCell(0, 2, ''); // Set interline to 3. Then writeMultiCell must use 3 also. $nblines = count($object->lines); @@ -244,14 +244,27 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->SetFont('','B', $default_font_size - 1); $pdf->SetXY($this->marge_gauche, $curY); $txt=dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true)." - ".$outputlangs->transnoentities("Duration")." : ".convertSecondToTime($objectligne->duration),1,$outputlangs->charset_output); + + $curYold=$nexYold=$nexY; $pdf->writeHTMLCell(0, 3, $this->marge_gauche, $curY, $txt, 0, 1, 0); $curY = $pdf->GetY(); - $pdf->SetFont('','', $default_font_size - 1); + $nexY+=3; - $pdf->SetXY($this->marge_gauche, $curY + 3); + $pdf->SetFont('','', $default_font_size - 1); + + $pdf->SetXY($this->marge_gauche, $nexY); $desc = dol_htmlentitiesbr($objectligne->desc,1); - $pdf->writeHTMLCell(0, 3, $this->marge_gauche, $curY + 3, $desc, 0, 1, 0); - $nexY+=dol_nboflines_bis($objectligne->desc,52,$outputlangs->charset_output)*3; + + $curYold = $pdf->GetY(); + $nexYold = $curYold; + + $pdf->writeHTMLCell(0, 3, $this->marge_gauche, $curY, $desc, 0, 1, 0); + + $stringheight=$pdf->getStringHeight('A', $txt); + $curY = $pdf->GetY(); + + $nexY+=(dol_nboflines_bis($objectligne->desc,0,$outputlangs->charset_output)*$stringheight); + //print $curYold."-".$nexYold." +".dol_nboflines_bis($objectligne->desc,52,$outputlangs->charset_output)."*".$stringheight."= ".$curY."-".$nexY."
"; $nexY+=2; // Passe espace entre les lignes From 5d502aa7d180284806a16bf2b75cdd5225053290 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Jun 2012 00:15:30 +0200 Subject: [PATCH 4/9] Fix: function dol_nboflines_bis --- htdocs/core/lib/functions.lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d7ae1cd1440..34e3d32fe3e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3262,9 +3262,10 @@ function dol_nboflines_bis($text,$maxlinesize=0,$charset='UTF-8') if (dol_textishtml($text)) $repTable = array("\t" => " ", "\n" => " ", "\r" => " ", "\0" => " ", "\x0B" => " "); $text = strtr($text, $repTable); - if ($charset == 'UTF-8') { $pattern = '/(<[^>]+>)/Uu'; } // /U is to have UNGREEDY regex to limit to one html tag. /u is for UTF8 support - else $pattern = '/(<[^>]+>)/U'; // /U is to have UNGREEDY regex to limit to one html tag. + if ($charset == 'UTF-8') { $pattern = '/(]*>)/Uu'; } // /U is to have UNGREEDY regex to limit to one html tag. /u is for UTF8 support + else $pattern = '/(]*>)/U'; // /U is to have UNGREEDY regex to limit to one html tag. $a = preg_split($pattern, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); + $nblines = floor((count($a)+1)/2); // count possible auto line breaks if($maxlinesize) From 2e74a4ba85016a144a6904c8c1029aa8eed175f6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Jun 2012 11:16:17 +0200 Subject: [PATCH 5/9] Fix: The fix made by renaming PDF_ADDALSOTARGETDETAILS into MAIN_PDF_ADDALSOSOURCEDETAILS was fixing things in the wrong direction. The regression was the missing data on the recipient compared to 3.1.1 --- htdocs/core/lib/pdf.lib.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 650b83c6016..d5c8dcfcb5d 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -239,12 +239,36 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcontact))."\n"; // Country if ($targetcontact->country_code && $targetcontact->country_code != $sourcecompany->pays_code) $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcontact->pays_code))."\n"; + + if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS)) + { + // Tel + if ($targetcontact->tel) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcontact->tel); + // Fax + if ($targetcontact->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax); + // EMail + if ($targetcontact->email) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcontact->email); + // Web + if ($targetcontact->url) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcontact->url); + } } else { $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcompany))."\n"; // Country if ($targetcompany->country_code && $targetcompany->country_code != $sourcecompany->pays_code) $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->pays_code))."\n"; + + if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS)) + { + // Tel + if ($targetcompany->tel) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcompany->tel); + // Fax + if ($targetcompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcompany->fax); + // EMail + if ($targetcompany->email) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcompany->email); + // Web + if ($targetcompany->url) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcompany->url); + } } // Intra VAT From 83d75aaa31114edcdb4cfc783a84729026c688ba Mon Sep 17 00:00:00 2001 From: simnandez Date: Fri, 15 Jun 2012 12:20:45 +0200 Subject: [PATCH 6/9] Fix: [ bug #427 ] Bad links to wiki help in certains menus --- htdocs/comm/propal/index.php | 2 +- htdocs/commande/index.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index c3f07553948..ea518da991a 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -51,7 +51,7 @@ $propalstatic=new Propal($db); $companystatic=new Societe($db); $form = new Form($db); $formfile = new FormFile($db); -$help_url="EN:Module_Commercial_Proposals|FR:Module_Propositions_commerciales|ES:Módulo Presupuestos"; +$help_url="EN:Module_Commercial_Proposals|FR:Module_Propositions_commerciales|ES:Módulo_Presupuestos"; llxHeader("",$langs->trans("ProspectionArea"),$help_url); diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index d70aaf52af1..c2000d6b8b1 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -49,7 +49,7 @@ if ($user->societe_id > 0) $commandestatic=new Commande($db); $form = new Form($db); $formfile = new FormFile($db); -$help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo Pedidos de clientes"; +$help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes"; llxHeader("",$langs->trans("Orders"),$help_url); From eb543f0606657557ef728eb412ec3aff31d87f11 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Jun 2012 11:24:09 +0200 Subject: [PATCH 7/9] Fix: missing a return into clean_url function --- htdocs/core/lib/functions2.lib.php | 1 + htdocs/societe/soc.php | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index d028322987a..f44aea29ed8 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -378,6 +378,7 @@ function clean_url($url,$http=1) return $CleanUrl; } + else return $url; } /** diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 7958c4d49ba..c35c85f87ea 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -451,6 +451,21 @@ if (empty($reshook)) } } } + + // Remove file in doc form + else if ($action == 'remove_file') + { + if ($object->fetch($socid)) + { + require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); + + $langs->load("other"); + $upload_dir = $conf->societe->dir_output; + $file = $upload_dir . '/' . GETPOST('file'); + dol_delete_file($file,0,0,0,$object); + $mesg = '
'.$langs->trans("FileWasRemoved",GETPOST('file')).'
'; + } + } } From bcfd35648b01d2963bcb303d814ebfeef894c3c6 Mon Sep 17 00:00:00 2001 From: simnandez Date: Fri, 15 Jun 2012 15:54:56 +0200 Subject: [PATCH 8/9] Fix: [ bug #427 ] Bad links to wiki help in certains menus --- htdocs/comm/action/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index e13a6af9fdf..6ff8843da54 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -121,7 +121,7 @@ if ($action=='delete_action') * View */ -$help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda'; +$help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda'; llxHeader('',$langs->trans("Agenda"),$help_url); $form=new Form($db); From 3556adc11d233afc72b967eb21c2ab45b8865f25 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Jun 2012 00:07:24 +0200 Subject: [PATCH 9/9] Fix: Permissions for click2dial tab --- htdocs/core/lib/security.lib.php | 2 +- htdocs/user/clicktodial.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 414d2c25709..54567b0bc66 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -90,7 +90,7 @@ function dol_hash($chain,$type=0) * @param User $user User to check * @param string $features Features to check (in most cases, it's module name. Examples: 'societe', 'contact', 'produit|service', ...) * @param int $objectid Object ID if we want to check permission on a particular record (optionnal) - * @param string $dbtablename Table name where object is stored. Not used if objectid is null (optionnal) + * @param string $dbtablename 'TableName&SharedElement' with Tablename is table where object is stored, SharedElement is key to define where to check entity. Not used if objectid is null (optionnal) * @param string $feature2 Feature to check, second level of permission (optionnal) * @param string $dbt_keyfield Field name for socid foreign key if not fk_soc (optionnal) * @param string $dbt_select Field name for select if not rowid (optionnal) diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index eef8a16bc7a..797a1950d86 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -34,11 +34,12 @@ $id=GETPOST('id','int'); $socid=0; if ($user->societe_id > 0) $socid = $user->societe_id; $feature2 = (($socid && $user->rights->user->self->creer)?'':'user'); -if ($user->id == $_GET["id"]) // A user can always read its own card +if ($user->id == $id) // A user can always read its own card { $feature2=''; } -$result = restrictedArea($user, 'user', $_GET["id"], '', $feature2); +$result = restrictedArea($user, $feature, $id, '&user', $feature2); + /* * Actions