diff --git a/dev/initdemo/initdemo.sh b/dev/initdemo/initdemo.sh index c34d9e2ffda..940f0b59467 100755 --- a/dev/initdemo/initdemo.sh +++ b/dev/initdemo/initdemo.sh @@ -174,7 +174,7 @@ then echo cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images" cp -pr $mydir/../../doc/images/* "$documentdir/ecm/Images" else - echo Detection of documents directory $documentdir failed so demo files were not copied. + echo Detection of documents directory from $mydir failed so demo files were not copied. fi diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 0583c45bdab..9f63b1e5489 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -194,7 +194,7 @@ if ($id > 0 && ! preg_match('/^add/i',$action)) * Fact bookmark mode or visually edition */ $object->fetch($id); - + $hselected = 'card'; $head = array( array( @@ -216,10 +216,10 @@ if ($id > 0 && ! preg_match('/^add/i',$action)) dol_fiche_head($head, $hselected, $langs->trans("Bookmark"),0,'bookmark'); - + $linkback = ''.$langs->trans("BackToList").''; - - dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', '', 0); + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', '', 0); print '
'; print ''; @@ -307,7 +307,7 @@ if ($id > 0 && ! preg_match('/^add/i',$action)) // Buttons - + print "
\n"; // Edit diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 584d3915430..41fe096d974 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -983,7 +983,7 @@ if ($action == 'create') $projectid = GETPOST('projectid')?GETPOST('projectid'):$object->fk_project; $langs->load('projects'); print '
'; } diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 22679af2110..173505329dc 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -45,6 +45,18 @@ $page = GETPOST('page','int'); $sortorder = GETPOST('sortorder','alpha'); $sortfield = GETPOST('sortfield','alpha'); +$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +$page = GETPOST("page",'int'); +if ($page == -1) { $page = 0; } +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortorder) $sortorder="DESC"; +if (! $sortfield) $sortfield="f.facnumber"; + + /* * View */ @@ -54,17 +66,7 @@ llxHeader(); $thirdpartystatic=new Societe($db); $invoicestatic=new Facture($db); -if ($page == -1) $page = 0 ; -$offset = $conf->liste_limit * $page ; -$pageprev = $page - 1; -$pagenext = $page + 1; -if (! $sortorder) $sortorder="DESC"; -if (! $sortfield) $sortfield="f.facnumber"; - - -/* - * Liste de demandes - */ +// List of requests $sql= "SELECT f.facnumber, f.rowid, f.total_ttc,"; $sql.= " s.nom as name, s.rowid as socid,"; @@ -83,10 +85,10 @@ if ($statut) $sql.= " AND pfd.traite = ".$statut; $sql.= " AND pfd.fk_facture = f.rowid"; if (dol_strlen(trim(GETPOST('search_societe','alpha')))) { - $sql.= " AND s.nom LIKE '%".GETPOST('search_societe','alpha')."%'"; + $sql.= natural_search("s.nom", 'search_societe'); } $sql.= " ORDER BY $sortfield $sortorder "; -$sql.= $db->plimit($conf->liste_limit+1, $offset); +$sql.= $db->plimit($limit+1, $offset); $resql=$db->query($sql); if ($resql) @@ -103,26 +105,35 @@ if ($resql) print_barre_liste($langs->trans("RequestStandingOrderTreated"), $page, "demandes.php", $urladd, $sortfield, $sortorder, '', $num); } + print ''; + print '
' . $langs->trans('Project') . ''; - $numprojet = $formproject->select_projects($socid, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, $forceaddid=0, $morecss=''); + $numprojet = $formproject->select_projects($object->thirdparty->id, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, ''); print '   thirdparty->id.(!empty($id)?'&id='.$id:'')).'">' . $langs->trans("AddProject") . ''; print '
'; print ''; - print ''; - print ''; - print ''; + print_liste_field_titre($langs->trans("Bill")); + print_liste_field_titre($langs->trans("Company")); + print_liste_field_titre($langs->trans("Amount")); + print_liste_field_titre($langs->trans("DateRequest")); + print_liste_field_titre(''); print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; + print ''; + // Action column + print ''; print ''; - print ''; $var = True; $users = array(); - while ($i < min($num,$conf->liste_limit)) + while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); $var=!$var; @@ -145,12 +156,15 @@ if ($resql) print ''; + print ''; + print ''; $i++; } print "
'.$langs->trans("Bill").''.$langs->trans("Company").''.$langs->trans("Amount").''.$langs->trans("DateRequest").'
'; + $searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); + print $searchpitco; + print '
'.dol_print_date($db->jdate($obj->date_demande),'day').'

"; + print ''; } else { diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 04010fd3ad2..3fbd4fa462d 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -77,7 +77,7 @@ $userid=GETPOST('userid','int'); $begin=GETPOST('begin'); if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="p.lastname"; -if ($page < 0) { $page = 0; } +if (empty($page) || $page < 0) { $page = 0; } $offset = $limit * $page; $langs->load("companies"); @@ -147,7 +147,7 @@ $arrayfields=array( // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) + foreach($extrafields->attribute_label as $key => $val) { $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); } @@ -176,7 +176,7 @@ if (empty($reshook)) { // Selection of new fields include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; - + // Purge search criteria if (GETPOST('button_removefilter_x') || GETPOST('button_removefilter.x') || GETPOST('button_removefilter')) // All tests are required to be compatible with all browsers { @@ -200,7 +200,7 @@ if (empty($reshook)) $search_categ_supplier=''; $search_array_options=array(); } - + // Mass actions $objectclass='Contact'; $objectlabel='Contact'; @@ -345,7 +345,7 @@ foreach ($search_array_options as $key => $val) $typ=$extrafields->attribute_type[$tmpkey]; $mode=0; if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric - if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) { $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); } @@ -424,7 +424,7 @@ foreach ($search_array_options as $key => $val) $crit=$val; $tmpkey=preg_replace('/search_options_/','',$key); if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); -} +} print '
'; if ($optioncss != '') print ''; @@ -504,9 +504,9 @@ if (! empty($arrayfields['p.priv']['checked'])) print_liste_field_tit // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) + foreach($extrafields->attribute_label as $key => $val) { - if (! empty($arrayfields["ef.".$key]['checked'])) + if (! empty($arrayfields["ef.".$key]['checked'])) { $align=$extrafields->getAlignFlag($key); print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); @@ -555,13 +555,13 @@ if (! empty($arrayfields['p.town']['checked'])) print ''; print ''; } -if (! empty($arrayfields['p.phone']['checked'])) +if (! empty($arrayfields['p.phone']['checked'])) { print ''; print ''; print ''; } -if (! empty($arrayfields['p.phone_perso']['checked'])) +if (! empty($arrayfields['p.phone_perso']['checked'])) { print ''; print ''; @@ -607,9 +607,9 @@ if (! empty($arrayfields['p.priv']['checked'])) // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) + foreach($extrafields->attribute_label as $key => $val) { - if (! empty($arrayfields["ef.".$key]['checked'])) + if (! empty($arrayfields["ef.".$key]['checked'])) { print ''; print ''; @@ -664,7 +664,7 @@ while ($i < min($num,$limit)) $contactstatic->phone_mobile=$obj->phone_mobile; $contactstatic->zip=$obj->zip; $contactstatic->town=$obj->town; - + // Name if (! empty($arrayfields['p.lastname']['checked'])) { @@ -746,9 +746,9 @@ while ($i < min($num,$limit)) // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) + foreach($extrafields->attribute_label as $key => $val) { - if (! empty($arrayfields["ef.".$key]['checked'])) + if (! empty($arrayfields["ef.".$key]['checked'])) { print 'getAlignFlag($key); diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index c6d6c075d62..cc320250682 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2013 Christophe Battarel * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2015 Marcos García - * Copyright (C) 2015-2016 Ferran Marcet + * Copyright (C) 2015-2017 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -2251,11 +2251,11 @@ class Contrat extends CommonObject $this->context['createfromclone'] = 'createfromclone'; $error = 0; - $now = dol_now(); $this->fetch($this->id); // Load dest object $clonedObj = clone $this; + $clonedObj->socid = $socid; $this->db->begin(); @@ -2290,16 +2290,13 @@ class Contrat extends CommonObject $this->error = $clonedObj->error; $this->errors[] = $clonedObj->error; } else { - // copy internal contacts - if ($clonedObj->copy_linked_contact($this, 'internal') < 0) - $error ++; - - // copy external contacts if same company - elseif ($this->socid == $clonedObj->socid) { - if ($clonedObj->copy_linked_contact($this, 'external') < 0) - $error ++; - } - } + // copy external contacts if same company + if ($this->socid == $clonedObj->socid) { + if ($clonedObj->copy_linked_contact($this, 'external') < 0) { + $error++; + } + } + } if (! $error) { foreach ( $this->lines as $line ) { diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 849a466e18d..6c6b55ee949 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -272,7 +272,7 @@ $sql.= " state.code_departement, state.nom"; // Add where from extra fields foreach ($extrafields->attribute_label as $key => $val) { - $sql .= ', ef.'.$val; + $sql .= ', ef.'.$key; } // Add where from hooks $parameters=array(); diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index b6aad949b64..e1e647e3117 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -669,7 +669,7 @@ class FormFile // Show file name with link to download $out.= ''; - $out.= ' * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2015 Marcos García + * Copyright (C) 2017 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1285,10 +1286,12 @@ class pdf_einstein extends ModelePDFCommandes $arrayidcontact=$object->getIdContact('internal','SALESREPFOLL'); if (count($arrayidcontact) > 0) { - $usertmp=new User($this->db); + $usertmp=new User($this->db); $usertmp->fetch($arrayidcontact[0]); + $posy+=4; + $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(190, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); + $pdf->MultiCell(100, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); } } diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 3c3324d741a..fc9bae07c9c 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -7,6 +7,7 @@ * Copyright (C) 2012 Cédric Salvador * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2015 Marcos García + * Copyright (C) 2017 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1620,8 +1621,10 @@ class pdf_crabe extends ModelePDFFactures { $usertmp=new User($this->db); $usertmp->fetch($arrayidcontact[0]); + $posy+=4; + $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(190, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); + $pdf->MultiCell($w, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); } } diff --git a/htdocs/core/modules/product/mod_codeproduct_elephant.php b/htdocs/core/modules/product/mod_codeproduct_elephant.php index 517cd0a7ce9..bb7eb09abf4 100644 --- a/htdocs/core/modules/product/mod_codeproduct_elephant.php +++ b/htdocs/core/modules/product/mod_codeproduct_elephant.php @@ -252,7 +252,7 @@ class mod_codeproduct_elephant extends ModeleProductCode // Get Mask value $mask = ''; if ($type==0) $mask = empty($conf->global->PRODUCT_ELEPHANT_MASK_PRODUCT)?'':$conf->global->PRODUCT_ELEPHANT_MASK_PRODUCT; - if ($type==1) $mask = empty($conf->global->PRODUCT_ELEPHANT_MASK_SSERVICE)?'':$conf->global->PRODUCT_ELEPHANT_MASK_SERVICE; + if ($type==1) $mask = empty($conf->global->PRODUCT_ELEPHANT_MASK_SERVICE)?'':$conf->global->PRODUCT_ELEPHANT_MASK_SERVICE; if (! $mask) { $this->error='NotConfigured'; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 566127c803d..41cd29f8b35 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -6,6 +6,7 @@ * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2015 Marcos García + * Copyright (C) 2017 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1473,8 +1474,10 @@ class pdf_azur extends ModelePDFPropales { $usertmp=new User($this->db); $usertmp->fetch($arrayidcontact[0]); + $posy+=4; + $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(190, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); + $pdf->MultiCell(100, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); } } diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 96cec5e5ba3..111fe12d9ec 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -4,6 +4,7 @@ * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2015 Marcos García + * Copyright (C) 2017 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1111,8 +1112,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders { $usertmp=new User($this->db); $usertmp->fetch($arrayidcontact[0]); + $posy+=4; + $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(190, 3, $langs->trans("BuyerName")." : ".$usertmp->getFullName($langs), '', 'R'); + $pdf->MultiCell(100, 3, $langs->trans("BuyerName")." : ".$usertmp->getFullName($langs), '', 'R'); } } diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index b3f99886f25..32c8eb23cbb 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -4,6 +4,7 @@ * Copyright (C) 2008 Raphael Bertrand * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2017 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1288,8 +1289,10 @@ class pdf_aurore extends ModelePDFSupplierProposal { $usertmp=new User($this->db); $usertmp->fetch($arrayidcontact[0]); + $posy+=4; + $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(190, 3, $langs->trans("BuyerName")." : ".$usertmp->getFullName($langs), '', 'R'); + $pdf->MultiCell(100, 3, $langs->trans("BuyerName")." : ".$usertmp->getFullName($langs), '', 'R'); } } diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index b70e17942a3..f71a766ce8a 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2015-2016 Alexandre Spangaro + * Copyright (C) 2017 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1311,8 +1312,8 @@ if ($action == 'create') print ''; $defaultselectuser=$user->id; if (GETPOST('fk_user_author') > 0) $defaultselectuser=GETPOST('fk_user_author'); - $include_users = 'hierarchyme'; - if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expensereport->writeall_advance)) $include_users=array(); + $include_users = 'hierarchyme'; + if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expensereport->writeall_advance)) $include_users=array(); $s=$form->select_dolusers($defaultselectuser, "fk_user_author", 0, "", 0, $include_users); print $s; print ''; diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 44dfb07f255..dc34686361f 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -6,6 +6,7 @@ * Copyright (C) 2010 Juanjo Menent * Copyright (C) 2014 Cedric Gross * Copyright (C) 2016 Florian Henry + * Copyright (C) 2017 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -368,7 +369,7 @@ if ($id > 0 || ! empty($ref)) { print ""; if ($object->methode_commande) { - print '' . $langs->trans("Method") . '' . $commande->getInputMethod() . ''; + print '' . $langs->trans("Method") . '' . $object->getInputMethod() . ''; } } diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 2cf93493739..6e418e2e649 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -460,7 +460,7 @@ class Dolresource extends CommonObject $extrafields=new ExtraFields($this->db); $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); if (is_array($extralabels) && count($extralabels)>0) { - foreach($extralabels as $label=>$code) { + foreach($extralabels as $code=>$label) { $sql.= " ef.".$code." as extra_".$code.","; } } diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index b2ef82cf8c1..2c97b68f7ed 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -119,12 +119,15 @@ $arrayfields = array( // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { foreach ( $extrafields->attribute_label as $key => $val ) { - $arrayfields["ef." . $key] = array( - 'label' => $extrafields->attribute_label[$key], - 'checked' => $extrafields->attribute_list[$key], - 'position' => $extrafields->attribute_pos[$key], - 'enabled' => $extrafields->attribute_perms[$key] - ); + $typeofextrafield=$extrafields->attribute_type[$key]; + if ($typeofextrafield!='separate') { + $arrayfields["ef." . $key] = array( + 'label' => $extrafields->attribute_label[$key], + 'checked' => $extrafields->attribute_list[$key], + 'position' => $extrafields->attribute_pos[$key], + 'enabled' => $extrafields->attribute_perms[$key] + ); + } } } diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 301ca845286..4a0be451c45 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -88,7 +88,7 @@ $sortorder=GETPOST("sortorder",'alpha'); $page=GETPOST("page",'int'); if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="s.nom"; -if ($page == -1) { $page = 0 ; } +if (empty($page) || $page == -1) { $page = 0 ; } $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -240,7 +240,7 @@ if (empty($reshook)) $object->stcomm_id=dol_getIdFromCode($db, GETPOST('stcomm','alpha'), 'c_stcomm'); $result=$object->update($object->id, $user); if ($result < 0) setEventMessages($object->error,$object->errors,'errors'); - + $action=''; } } @@ -505,7 +505,7 @@ foreach ($search_array_options as $key => $val) $crit=$val; $tmpkey=preg_replace('/search_options_/','',$key); if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); -} +} // Show delete result message if (GETPOST('delsoc')) @@ -619,9 +619,9 @@ if (! empty($arrayfields['s.fk_stcomm']['checked'])) print_liste_f // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) + foreach($extrafields->attribute_label as $key => $val) { - if (! empty($arrayfields["ef.".$key]['checked'])) + if (! empty($arrayfields["ef.".$key]['checked'])) { $align=$extrafields->getAlignFlag($key); print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); @@ -838,9 +838,9 @@ if (! empty($arrayfields['s.fk_stcomm']['checked'])) // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) + foreach($extrafields->attribute_label as $key => $val) { - if (! empty($arrayfields["ef.".$key]['checked'])) + if (! empty($arrayfields["ef.".$key]['checked'])) { $align=$extrafields->getAlignFlag($key); $typeofextrafield=$extrafields->attribute_type[$key]; @@ -895,7 +895,7 @@ while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); $var=!$var; - + $companystatic->id=$obj->rowid; $companystatic->name=$obj->name; $companystatic->canvas=$obj->canvas; @@ -906,7 +906,7 @@ while ($i < min($num, $limit)) $companystatic->code_fournisseur=$obj->code_fournisseur; $companystatic->fk_prospectlevel=$obj->fk_prospectlevel; $companystatic->name_alias=$obj->name_alias; - + print ""; if (! empty($arrayfields['s.nom']['checked'])) { @@ -948,12 +948,12 @@ while ($i < min($num, $limit)) if (! empty($arrayfields['s.zip']['checked'])) { print "".$obj->zip."\n"; - } + } // State if (! empty($arrayfields['state.nom']['checked'])) { print "".$obj->state_name."\n"; - } + } // Country if (! empty($arrayfields['country.code_iso']['checked'])) { diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 80db7aef081..36fe26447fa 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -2517,7 +2517,7 @@ else $var=true; - print $formfile->showdocuments('company', $object->id, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 0, 0, 0, 28, 0, '', 0, '', $object->default_lang); + print $formfile->showdocuments('company', $object->id, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 0, 0, 0, 28, 0, 'entity='.$object->entity, 0, '', $object->default_lang); print '
'; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 2f1e61e48ce..c450b616d1f 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1,7 +1,7 @@ * Copyright (C) 2006 Rodolphe Quiedeville - * Copyright (C) 2007-2012 Regis Houssin + * Copyright (C) 2007-2017 Regis Houssin * Copyright (C) 2011 Philippe Grand * Copyright (C) 2012 Juanjo Menent * @@ -158,25 +158,25 @@ if (! empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)) // Set text color to black or white $tmppart=explode(',',$colorbackhmenu1); -$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); +$tmpval=(! empty($tmppart[0]) ? $tmppart[0] : '')+(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : ''); if ($tmpval <= 360) $colortextbackhmenu='FFFFFF'; else $colortextbackhmenu='000000'; $tmppart=explode(',',$colorbackvmenu1); -$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); +$tmpval=(! empty($tmppart[0]) ? $tmppart[0] : '')+(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : ''); if ($tmpval <= 360) { $colortextbackvmenu='FFFFFF'; } else { $colortextbackvmenu='000000'; } $tmppart=explode(',',$colorbacktitle1); if ($colortexttitle == '') { - $tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); + $tmpval=(! empty($tmppart[0]) ? $tmppart[0] : '')+(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : ''); if ($tmpval <= 360) { $colortexttitle='FFFFFF'; $colorshadowtitle='888888'; } else { $colortexttitle='000000'; $colorshadowtitle='FFFFFF'; } } $tmppart=explode(',',$colorbacktabcard1); -$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); +$tmpval=(! empty($tmppart[0]) ? $tmppart[0] : '')+(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : ''); if ($tmpval <= 340) { $colortextbacktab='FFFFFF'; } else { $colortextbacktab='111111'; } @@ -255,7 +255,7 @@ a.tab { font-weight: bold !important; } a:link, a:visited, a:hover, a:active { font-family: ; font-weight: normal; color: rgb(); text-decoration: none; } a:hover { text-decoration: underline; color: rgb(); } -a.commonlink { color: rgb() !important; text-decoration: none; } +a.commonlink { color: rgb() !important; text-decoration: none; } input, input.flat, textarea, textarea.flat, form.flat select, select, select.flat, .dataTables_length label select { background-color: #FFF; @@ -285,7 +285,7 @@ textarea.cke_source:focus input, input.flat, textarea, textarea.flat, form.flat select, select, select.flat, .dataTables_length label select { font-size: px; font-family: ; - + border: 1px solid #C0C0C0; /* v6 border: none; border-bottom: 1px solid #C0C0C0; @@ -310,7 +310,7 @@ textarea { border: solid 1px rgba(0,0,0,.3); border-top:solid 1px rgba(0,0,0,.3); border-bottom:solid 1px rgba(0,0,0,.2); - + padding:4px; margin-left:0px; margin-bottom:1px; @@ -622,13 +622,13 @@ div.myavailability { overflow-y: hidden; -ms-overflow-style: -ms-autohiding-scrollbar; }*/ -/* Style used for most tables */ +/* Style used for most tables */ .div-table-responsive, .div-table-responsive-no-min { overflow-x: auto; min-height: 0.01%; line-height: 100%; } -/* Style used for full page tables with field selector and no content after table (priority before previous for such tables) */ +/* Style used for full page tables with field selector and no content after table (priority before previous for such tables) */ div.fiche>form>div.div-table-responsive, div.fiche>form>div.div-table-responsive-no-min { overflow-x: auto; } @@ -717,20 +717,20 @@ div.fiche>form>div.div-table-responsive { .border tbody tr, .border tbody tr td, div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col { height: 40px !important; } - + .quatrevingtpercent, .inputsearch { width: 95%; } - - input, input[type=text], input[type=password], select, textarea { - min-width: 20px; + + input, input[type=text], input[type=password], select, textarea { + min-width: 20px; min-height: 1.4em; line-height: 1.4em; padding: .4em .1em; border: 1px solid #BBB; /* max-width: inherit; why this ? */ } - + .hideonsmartphone { display: none; } .noenlargeonsmartphone { width : 50px !important; display: inline !important; } .maxwidthonsmartphone, #search_newcompany.ui-autocomplete-input { max-width: 100px; } @@ -749,20 +749,20 @@ div.fiche>form>div.div-table-responsive { .minwidth500imp { min-width: 50px !important; } .titlefield { width: auto; } .titlefieldcreate { width: auto; } - + #tooltip { position: absolute; width: px; } - + /* intput, input[type=text], */ select { width: 98%; min-width: 40px; } - + div.divphotoref { - padding-right: 5px; + padding-right: 5px; } img.photoref, div.photoref { border: none; @@ -774,7 +774,7 @@ div.fiche>form>div.div-table-responsive { width: 20px; object-fit: contain; } - + } .linkobject { cursor: pointer; } @@ -1241,7 +1241,7 @@ div.menu_titre { padding-top: 4px; padding-bottom: 4px; overflow: hidden; - text-overflow: ellipsis; + text-overflow: ellipsis; } .mainmenuaspan { @@ -1444,7 +1444,7 @@ form#login { -moz-box-shadow: 0 2px 23px 2px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(60,60,60,0.15); -webkit-box-shadow: 0 2px 23px 2px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(60,60,60,0.15); box-shadow: 0 2px 23px 2px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(60,60,60,0.15); - + /*-moz-box-shadow: 3px 2px 20px #CCC; -webkit-box-shadow: 3px 2px 20px #CCC; box-shadow: 3px 2px 20px #CCC;*/ @@ -1648,7 +1648,7 @@ a.vsmenu.addbookmarkpicto { { /* border-bottom: 1px solid #BBB; */ } -div.blockvmenusearchphone +div.blockvmenusearchphone { border-bottom: none !important; } @@ -2513,8 +2513,8 @@ div.liste_titre_bydiv .divsearchfield { padding: 2px 1px 2px 0px; /* t r b l */ } -tr.box_titre .nobordernopadding td { - padding: 0px ! important; +tr.box_titre .nobordernopadding td { + padding: 0px ! important; } table.nobordernopadding { border-collapse: collapse !important; @@ -2809,7 +2809,7 @@ div.liste_titre_bydiv { border-top-width: px; border-top-color: rgb(); border-top-style: solid; - + border-collapse: collapse; display: table; padding: 2px 0px 2px 0; @@ -3421,7 +3421,7 @@ td.hidden { border-bottom: 1px solid #888; background: #eee; } -.websitebar .button, .websitebar .buttonDelete +.websitebar .button, .websitebar .buttonDelete { padding: 2px 5px 3px 5px !important; margin: 2px 4px 2px 4px !important; @@ -3430,7 +3430,7 @@ td.hidden { .websiteselection { display: inline-block; padding-left: 10px; - vertical-align: middle; + vertical-align: middle; line-height: 29px; } .websitetools { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 080b50e1c8c..d70ba65643c 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1,7 +1,7 @@ * Copyright (C) 2006 Rodolphe Quiedeville - * Copyright (C) 2007-2012 Regis Houssin + * Copyright (C) 2007-2017 Regis Houssin * Copyright (C) 2011 Philippe Grand * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2015 Alexandre Spangaro @@ -159,25 +159,25 @@ if (empty($colortopbordertitle1)) $colortopbordertitle1=$colorbackhmenu1; // Set text color to black or white $tmppart=explode(',',$colorbackhmenu1); -$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); +$tmpval=(! empty($tmppart[0]) ? $tmppart[0] : '')+(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : ''); if ($tmpval <= 360) $colortextbackhmenu='FFFFFF'; else $colortextbackhmenu='000000'; $tmppart=explode(',',$colorbackvmenu1); -$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); +$tmpval=(! empty($tmppart[0]) ? $tmppart[0] : '')+(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : ''); if ($tmpval <= 360) { $colortextbackvmenu='FFFFFF'; } else { $colortextbackvmenu='000000'; } $tmppart=explode(',',$colorbacktitle1); if ($colortexttitle == '') { - $tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); + $tmpval=(! empty($tmppart[0]) ? $tmppart[0] : '')+(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : ''); if ($tmpval <= 260) { $colortexttitle='FFFFFF'; $colorshadowtitle='888888'; } else { $colortexttitle='101010'; $colorshadowtitle='FFFFFF'; } } $tmppart=explode(',',$colorbacktabcard1); -$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); +$tmpval=(! empty($tmppart[0]) ? $tmppart[0] : '')+(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : ''); if ($tmpval <= 340) { $colortextbacktab='FFFFFF'; } else { $colortextbacktab='111111'; } @@ -255,7 +255,7 @@ a.tab { font-weight: bold !important; } a:link, a:visited, a:hover, a:active { font-family: ; font-weight: normal; color: rgb(); text-decoration: none; } a:hover { text-decoration: underline; color: rgb(); } -a.commonlink { color: rgb() !important; text-decoration: none; } +a.commonlink { color: rgb() !important; text-decoration: none; } input, input.flat, textarea, textarea.flat, form.flat select, select, select.flat, .dataTables_length label select { background-color: #FDFDFD; @@ -526,7 +526,7 @@ div.divsearchfield { margin-: 2px; margin-top: 4px; margin-bottom: 4px; - padding-left: 2px; + padding-left: 2px; } div.confirmmessage { padding-top: 6px; @@ -540,8 +540,8 @@ div.myavailability { } .checkallactions { vertical-align: top; - margin-top: 6px; - margin-left: 4px; + margin-top: 6px; + margin-left: 4px; } .selectlimit, .marginrightonly { margin-right: 10px !important; @@ -599,13 +599,13 @@ div.myavailability { overflow-y: hidden; -ms-overflow-style: -ms-autohiding-scrollbar; }*/ -/* Style used for most tables */ +/* Style used for most tables */ .div-table-responsive, .div-table-responsive-no-min { overflow-x: auto; min-height: 0.01%; line-height: 100%; } -/* Style used for full page tables with field selector and no content after table (priority before previous for such tables) */ +/* Style used for full page tables with field selector and no content after table (priority before previous for such tables) */ div.fiche>form>div.div-table-responsive, div.fiche>form>div.div-table-responsive-no-min { overflow-x: auto; } @@ -652,7 +652,7 @@ div.fiche>form>div.div-table-responsive { .titlefield { width: 25%; } .titlefieldmiddle { width: 50%; } .imgmaxwidth180 { max-width: 180px; } - + /* Force values for small screen 1400 */ @media only screen and (max-width: 1400px) @@ -695,20 +695,20 @@ div.fiche>form>div.div-table-responsive { .border tbody tr, .border tbody tr td, div.tabBar table.border tr { height: 40px !important; } - + .quatrevingtpercent, .inputsearch { width: 95%; } - - input, input[type=text], input[type=password], select, textarea { - min-width: 20px; + + input, input[type=text], input[type=password], select, textarea { + min-width: 20px; min-height: 1.4em; line-height: 1.4em; padding: .4em .1em; border: 1px solid #BBB; /* max-width: inherit; why this */ } - + .hideonsmartphone { display: none; } .noenlargeonsmartphone { width : 50px !important; display: inline !important; } .maxwidthonsmartphone, #search_newcompany.ui-autocomplete-input { max-width: 100px; } @@ -727,20 +727,20 @@ div.fiche>form>div.div-table-responsive { .minwidth500imp { min-width: 50px !important; } .titlefield { width: auto; } .titlefieldcreate { width: auto; } - + #tooltip { position: absolute; width: px; } - + /* intput, input[type=text], */ select { width: 98%; min-width: 40px; } - + div.divphotoref { - padding-right: 5px; + padding-right: 5px; } img.photoref, div.photoref { border: none; @@ -751,7 +751,7 @@ div.fiche>form>div.div-table-responsive { height: 20px; width: 20px; object-fit: contain; - } + } } .linkobject { cursor: pointer; } @@ -804,7 +804,7 @@ td.showDragHandle { padding-left: 229px; padding-top: 12px; - + } .side-nav { @@ -1019,7 +1019,7 @@ table.noborder tr.liste_titre td { padding-right: 1px; padding-top: 1px; padding-bottom: 1px; - width: 44px; + width: 44px; } div.attacharea { padding-top: 10px; @@ -1035,7 +1035,7 @@ div.arearefnobottom { padding-bottom: 4px; } div.heightref { - min-height: 80px; + min-height: 80px; } div.divphotoref { padding-right: 20px; @@ -1251,7 +1251,7 @@ div.tmenucenter div.menu_titre { padding-bottom: 2px; overflow: hidden; - text-overflow: ellipsis; + text-overflow: ellipsis; } .mainmenuaspan { @@ -1627,8 +1627,8 @@ div.vmenu, td.vmenu { width: 202px; } -.menu_contenu { - padding-top: 4px; +.menu_contenu { + padding-top: 4px; padding-bottom: 3px; overflow: hidden; text-overflow: ellipsis; @@ -2206,16 +2206,16 @@ span.butAction, span.butActionDelete { text-shadow: none; border-color: #555; cursor: not-allowed; - + background-color: #f5f5f5; background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); - background-repeat: repeat-x + background-repeat: repeat-x } - + .butActionDelete, .buttonDelete { color: #ffffff !important; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); @@ -2360,9 +2360,9 @@ table.liste, table.noborder, table.formdoc, div.noborder { border-bottom-width: 1px; border-bottom-color: #BBB; border-bottom-style: solid; - + margin: 0px 0px 8px 0px; - + -moz-border-radius: 0.1em; -webkit-border-radius: 0.1em; border-radius: 0.1em; @@ -2620,7 +2620,7 @@ div.pagination li.paginationafterarrows { margin-bottom: 1px; color: #202020; min-height: 18px; /* seems to not be used */ - + background: #; } #GanttChartDIV { @@ -2687,7 +2687,7 @@ div.liste_titre_bydiv { border-top-width: px; border-top-color: rgb(); border-top-style: solid; - + box-shadow: none; border-collapse: collapse; display: table; @@ -2710,7 +2710,7 @@ div.liste_titre, tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.list background: rgb(); font-weight: ; - + color: rgb(); font-family: ; border-bottom: 1px solid #FDFFFF; @@ -2878,7 +2878,7 @@ span.dashboardlineko { tr.box_titre { height: 26px !important; - + /* TO MATCH BOOTSTRAP */ /*background: #ddd; color: #000 !important; */ @@ -2893,7 +2893,7 @@ tr.box_titre { background: rgb(); - + background-repeat: repeat-x; color: rgb(); font-family: , sans-serif; @@ -3326,7 +3326,7 @@ td.hidden { border-bottom: 1px solid #888; background: #eee; } -.websitebar .button, .websitebar .buttonDelete +.websitebar .button, .websitebar .buttonDelete { padding: 2px 4px 2px 4px !important; margin: 2px 4px 2px 4px !important; @@ -3335,7 +3335,7 @@ td.hidden { .websiteselection { display: inline-block; padding-left: 10px; - vertical-align: middle; + vertical-align: middle; line-height: 29px; } .websitetools { @@ -4496,12 +4496,12 @@ img.demothumb { @media only screen and (max-width: 767px) { .imgopensurveywizard, .imgautosize { width:95%; height: auto; } - + #tooltip { position: absolute; width: px; } - + img.demothumb { box-shadow: 1px 1px 4px #BBB; margin-right: 6px; @@ -4518,7 +4518,7 @@ img.demothumb { border-right: none; border-left: none; } - + } @@ -4592,7 +4592,7 @@ img.demothumb { div.mainmenu { min-width: 20px; } - + #tooltip { position: absolute; width: px; @@ -4602,7 +4602,7 @@ img.demothumb { min-width: 0 !important; } div.divphotoref { - padding-right: 5px; + padding-right: 5px; } img.photoref, div.photoref { border: none; @@ -4614,7 +4614,7 @@ img.demothumb { width: 20px; object-fit: contain; } - + } diff --git a/htdocs/user/document.php b/htdocs/user/document.php index a9162767bea..081bf2bc408 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -76,7 +76,7 @@ if ($user->id <> $id && ! $canreaduser) accessforbidden(); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { $page = 0; } +if (empty($page) || $page == -1) { $page = 0; } $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -132,11 +132,11 @@ if ($object->id) dol_fiche_head($head, 'document', $langs->trans("User"),0,'user'); $linkback = ''.$langs->trans("BackToList").''; - + dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin); - + print '
'; - + // Construit liste des fichiers $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); $totalsize=0; @@ -160,7 +160,7 @@ if ($object->id) print ''; dol_fiche_end(); - + $modulepart = 'user'; $permission = $user->rights->user->user->creer; diff --git a/htdocs/user/group/index.php b/htdocs/user/group/index.php index c2dd4936ea8..94c12147f1a 100644 --- a/htdocs/user/group/index.php +++ b/htdocs/user/group/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2015 Regis Houssin + * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2011 Herve Prot * * This program is free software; you can redistribute it and/or modify @@ -43,7 +43,7 @@ $limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $sortfield = GETPOST('sortfield','alpha'); $sortorder = GETPOST('sortorder','alpha'); $page = GETPOST('page','int'); -if ($page == -1) { $page = 0; } +if (empty($page) || $page == -1) { $page = 0; } $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -115,16 +115,16 @@ $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); - + $nbtotalofrecords = $num; - + $i = 0; $param="&search_group=".urlencode($search_group)."&sall=".urlencode($sall); if ($optioncss != '') $param.='&optioncss='.$optioncss; - + $text = $langs->trans("ListOfGroups"); - + print ''."\n"; if ($optioncss != '') print ''; print ''; @@ -133,26 +133,26 @@ if ($resql) print ''; print ''; print ''; - + print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $nbtotalofrecords, 'title_generic', 0, '', '', $limit); - - if ($sall) - { - foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); - print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); - } - + if ($sall) { foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); } - + + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); + } + $moreforfilter=''; - + //$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; //$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - + print '
'; print ''."\n"; @@ -166,7 +166,7 @@ if ($resql) print_liste_field_titre($langs->trans("NbOfUsers"),$_SERVER["PHP_SELF"],"nb",$param,"",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateCreationShort"),$_SERVER["PHP_SELF"],"g.datec",$param,"",'align="right"',$sortfield,$sortorder); print "\n"; - + $var=True; while ($i < $num) { @@ -192,10 +192,10 @@ if ($resql) $i++; } print "
"; - + print '
'; print "\n"; - + $db->free(); } else diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 54c99ca411a..623e2df3434 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2016 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016 Marcos García * @@ -50,7 +50,7 @@ $limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $sortfield = GETPOST('sortfield','alpha'); $sortorder = GETPOST('sortorder','alpha'); $page = GETPOST('page','int'); -if ($page == -1) { $page = 0; } +if (empty($page) || $page == -1) { $page = 0; } $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -103,7 +103,7 @@ $arrayfields=array( // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) + foreach($extrafields->attribute_label as $key => $val) { $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); } @@ -146,7 +146,7 @@ if (empty($reshook)) { // Selection of new fields include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; - + // Purge search criteria if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All test are required to be compatible with all browsers { @@ -224,7 +224,7 @@ foreach ($search_array_options as $key => $val) $typ=$extrafields->attribute_type[$tmpkey]; $mode=0; if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric - if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) { $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); } @@ -285,7 +285,7 @@ foreach ($search_array_options as $key => $val) $crit=$val; $tmpkey=preg_replace('/search_options_/','',$key); if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); -} +} $text = $langs->trans("ListOfUsers"); @@ -331,9 +331,9 @@ if (! empty($arrayfields['u.datepreviouslogin']['checked'])) print_liste_field_t // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) + foreach($extrafields->attribute_label as $key => $val) { - if (! empty($arrayfields["ef.".$key]['checked'])) + if (! empty($arrayfields["ef.".$key]['checked'])) { $align=$extrafields->getAlignFlag($key); print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); @@ -368,7 +368,7 @@ if (! empty($arrayfields['u.gender']['checked'])) { print ''; $arraygender=array('man'=>$langs->trans("Genderman"),'woman'=>$langs->trans("Genderwoman")); - print $form->selectarray('search_gender', $arraygender, $search_gender, 1); + print $form->selectarray('search_gender', $arraygender, $search_gender, 1); print ''; } if (! empty($arrayfields['u.employee']['checked'])) @@ -408,9 +408,9 @@ if (! empty($arrayfields['u.datepreviouslogin']['checked'])) // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) + foreach($extrafields->attribute_label as $key => $val) { - if (! empty($arrayfields["ef.".$key]['checked'])) + if (! empty($arrayfields["ef.".$key]['checked'])) { $align=$extrafields->getAlignFlag($key); $typeofextrafield=$extrafields->attribute_type[$key]; @@ -479,7 +479,7 @@ while ($i < min($num,$limit)) $userstatic->lastname=$obj->lastname; $userstatic->employee=$obj->employee; $userstatic->photo=$obj->photo; - + $li=$userstatic->getNomUrl(-1,'',0,0,24,1,'login'); print ""; @@ -592,8 +592,8 @@ while ($i < min($num,$limit)) } } print ''; - } - + } + // Date last login if (! empty($arrayfields['u.datelastlogin']['checked'])) { @@ -604,13 +604,13 @@ while ($i < min($num,$limit)) { print ''.dol_print_date($db->jdate($obj->datepreviouslogin),"dayhour").''; } - + // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) + foreach($extrafields->attribute_label as $key => $val) { - if (! empty($arrayfields["ef.".$key]['checked'])) + if (! empty($arrayfields["ef.".$key]['checked'])) { print 'getAlignFlag($key);