From 0d5c0350340a73f1089e9a3056cc1444d443d2ab Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 8 Dec 2016 22:12:16 +0100 Subject: [PATCH 01/10] Expense report - Remove filed note_private and note_public in card. Already in tab Notes --- htdocs/expensereport/card.php | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 6ad1e4ff0e8..315347bd63e 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1427,26 +1427,6 @@ else // Other attributes //$cols = 3; //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; - - // Public note - print ''; - print '' . $langs->trans('NotePublic') . ''; - print ''; - - $doleditor = new DolEditor('note_public', $object->note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); - print $doleditor->Create(1); - print ''; - - // Private note - if (empty($user->societe_id)) { - print ''; - print '' . $langs->trans('NotePrivate') . ''; - print ''; - - $doleditor = new DolEditor('note_private', $object->note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); - print $doleditor->Create(1); - print ''; - } print ''; @@ -1624,14 +1604,6 @@ else print ''; */ - print ''; - print ''.$langs->trans("NotePublic").''; - print ''.$object->note_public.''; - print ''; - print ''; - print ''.$langs->trans("NotePrivate").''; - print ''.$object->note_private.''; - print ''; // Amount print ''; print ''.$langs->trans("AmountHT").''; From eef245d23b64139181690e496068627773fe5d77 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 8 Dec 2016 22:17:03 +0100 Subject: [PATCH 02/10] Expense report - Hidden button to generate files in create mode --- htdocs/expensereport/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 315347bd63e..7206dc532a5 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2252,7 +2252,7 @@ print '
'; * Generate documents */ -if($user->rights->expensereport->export && $action != 'edit') +if($user->rights->expensereport->export && $action != 'create' && $action != 'edit') { $filename = dol_sanitizeFileName($object->ref); $filedir = $conf->expensereport->dir_output . "/" . dol_sanitizeFileName($object->ref); From cd4286b3025c1d515e8b08edbc7546df58637aea Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 8 Dec 2016 22:27:48 +0100 Subject: [PATCH 03/10] Loan - Remove field note_private and note_public into view/edit mode. Already present in tab Notes --- htdocs/loan/card.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 2b31ca856bc..be04b806b1f 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -399,12 +399,6 @@ if ($id > 0) // Rate print ''.$langs->trans("Rate").''.$object->rate.' %'; - // Note Private - print ''.$langs->trans('NotePrivate').''.nl2br($object->note_private).''; - - // Note Public - print ''.$langs->trans('NotePublic').''.nl2br($object->note_public).''; - // Accountancy account capital print ''; print $langs->trans("LoanAccountancyCapitalCode"); From 302109b3fea6744f9967ea19eabdc79766f84bb8 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 8 Dec 2016 22:32:10 +0100 Subject: [PATCH 04/10] Loan - Move tab Notes after Files tab --- htdocs/core/lib/loan.lib.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/core/lib/loan.lib.php b/htdocs/core/lib/loan.lib.php index fa80fe31a2b..f1748a0dfb9 100644 --- a/htdocs/core/lib/loan.lib.php +++ b/htdocs/core/lib/loan.lib.php @@ -1,6 +1,6 @@ - * Copyright (C) 2015 Frederic France +/* Copyright (C) 2014-2016 Alexandre Spangaro + * Copyright (C) 2015 Frederic France * * 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 @@ -41,16 +41,6 @@ function loan_prepare_head($object) $head[$tab][2] = 'card'; $tab++; - if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) - { - $nbNote = (empty($object->note_private)?0:1)+(empty($object->note_public)?0:1); - $head[$tab][0] = DOL_URL_ROOT."/loan/note.php?id=".$object->id; - $head[$tab][1] = $langs->trans("Notes"); - if($nbNote > 0) $head[$tab][1].= ' '.$nbNote.''; - $head[$tab][2] = 'note'; - $tab++; - } - // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab @@ -68,6 +58,16 @@ function loan_prepare_head($object) $head[$tab][2] = 'documents'; $tab++; + if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) + { + $nbNote = (empty($object->note_private)?0:1)+(empty($object->note_public)?0:1); + $head[$tab][0] = DOL_URL_ROOT."/loan/note.php?id=".$object->id; + $head[$tab][1] = $langs->trans("Notes"); + if($nbNote > 0) $head[$tab][1].= ' '.$nbNote.''; + $head[$tab][2] = 'note'; + $tab++; + } + $head[$tab][0] = DOL_URL_ROOT.'/loan/info.php?id='.$object->id; $head[$tab][1] = $langs->trans("Info"); $head[$tab][2] = 'info'; From b31d5d7f7525b266174f56a2e2dbfe2461430c37 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 8 Dec 2016 22:50:03 +0100 Subject: [PATCH 05/10] VAT - Correct presentation on card --- htdocs/compta/tva/card.php | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 17bcd80757c..8646489db0b 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -236,13 +236,13 @@ if ($action == 'create') print ''; print '
'; print "
\n"; - + dol_fiche_head(); print ''; print ""; - print ''; @@ -263,7 +263,7 @@ if ($action == 'create') if (! empty($conf->banque->enabled)) { - print ''; } @@ -273,12 +273,12 @@ if ($action == 'create') $form->select_types_paiements(GETPOST("type_payment"), "type_payment"); print "\n"; print ""; - + // Number print ''."\n"; - + // Other attributes $parameters=array('colspan' => ' colspan="1"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook @@ -296,13 +296,7 @@ if ($action == 'create') print ''; } - -/* ************************************************************************** */ -/* */ -/* Barre d'action */ -/* */ -/* ************************************************************************** */ - +// View mode if ($id) { $h = 0; @@ -317,7 +311,7 @@ if ($id) print '
'.$langs->trans("DatePayment").''; + print ''.$langs->trans("DatePayment").''; print $form->select_date($datep,"datep",'','','','add',1,1); print '
'.$langs->trans("Account").''; + print '
'.$langs->trans("BankAccount").''; $form->select_comptes($_POST["accountid"],"accountid",0,"courant=1",1); // Affiche liste des comptes courant print '
'.$langs->trans('Numero'); print ' ('.$langs->trans("ChequeOrTransferNumber").')'; print '
'; print ""; - print ''; @@ -325,19 +319,19 @@ if ($id) print ''; print ""; - print ''; print ''; - print ''; + print ''; if (! empty($conf->banque->enabled)) { @@ -348,7 +342,7 @@ if ($id) print ''; print ''; - print ''; print ''; @@ -356,14 +350,12 @@ if ($id) } // Other attributes - $parameters=array('colspan' => ' colspan="3"'); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + $reshook=$hookmanager->executeHooks('formObjectOptions','',$object,$action); // Note that $action and $object may have been modified by hook print '
'.$langs->trans("Ref").''; + print ''.$langs->trans("Ref").''; print $object->ref; print '
'.$langs->trans("Label").''.$object->label.'
'.$langs->trans("DatePayment").''; + print ''.$langs->trans("DatePayment").''; print dol_print_date($object->datep,'day'); print '
'; print $form->editfieldkey("DateValue", 'datev', $object->datev, $object, $user->rights->tax->charges->creer, 'day'); - print ''; + print ''; print $form->editfieldval("DateValue", 'datev', $object->datev, $object, $user->rights->tax->charges->creer, 'day'); //print dol_print_date($object->datev,'day'); print '
'.$langs->trans("Amount").''.price($object->amount).'
'.$langs->trans("Amount").''.price($object->amount).'
'.$langs->trans('BankTransactionLine').''; + print ''; print $bankline->getNomUrl(1,0,'showall'); print '
'; dol_fiche_end(); - /* * Action buttons */ From 9f51691ae498508a25821ab2dbef846e07f47e87 Mon Sep 17 00:00:00 2001 From: Benoit Date: Fri, 9 Dec 2016 00:15:59 +0100 Subject: [PATCH 06/10] Fix bug on fournisseur list --- htdocs/fourn/commande/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index d184845cb76..169d22622d7 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -502,7 +502,7 @@ if ($resql) if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder); if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['cf.fk_author']['checked'])) print_liste_field_titre($arrayfields['cf.fk_author']['label'],$_SERVER["PHP_SELF"],"u.login","",$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['cf.fk_author']['checked'])) print_liste_field_titre($arrayfields['cf.fk_author']['label'],$_SERVER["PHP_SELF"],"cf.fk_author","",$param,'',$sortfield,$sortorder); if (! empty($arrayfields['cf.date_commande']['checked'])) print_liste_field_titre($arrayfields['cf.date_commande']['label'],$_SERVER["PHP_SELF"],"cf.date_commande","",$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['cf.date_delivery']['checked'])) print_liste_field_titre($arrayfields['cf.date_delivery']['label'],$_SERVER["PHP_SELF"],'cf.date_livraison','',$param, 'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['cf.total_ht']['checked'])) print_liste_field_titre($arrayfields['cf.total_ht']['label'],$_SERVER["PHP_SELF"],"cf.total_ht","",$param,'align="right"',$sortfield,$sortorder); @@ -756,7 +756,7 @@ if ($resql) $userstatic->firstname = $obj->firstname; $userstatic->login = $obj->login; $userstatic->photo = $obj->photo; - if (! empty($arrayfields['s.nom']['checked'])) + if (! empty($arrayfields['u.login']['checked'])) { print ""; if ($userstatic->id) print $userstatic->getNomUrl(1); From b1c007aa75b4eba59a583a9783de1f3369f39c08 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Fri, 9 Dec 2016 06:59:24 +0100 Subject: [PATCH 07/10] VAT payment card - Uniformize presentation --- htdocs/compta/tva/card.php | 14 +++--- htdocs/compta/tva/class/tva.class.php | 48 ++++++++++++++++++++ htdocs/compta/tva/info.php | 64 +++++++++++++++++++++++++++ htdocs/core/lib/vat.lib.php | 57 ++++++++++++++++++++++++ 4 files changed, 175 insertions(+), 8 deletions(-) create mode 100644 htdocs/compta/tva/info.php create mode 100644 htdocs/core/lib/vat.lib.php diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 17bcd80757c..01581f7e626 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -27,6 +27,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/vat.lib.php'; $langs->load("compta"); $langs->load("banks"); @@ -38,7 +39,7 @@ $refund=GETPOST("refund","int"); if (empty($refund)) $refund=0; // Security check -$socid = isset($_GET["socid"])?$_GET["socid"]:''; +$socid = GETPOST('socid','int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'tax', '', '', 'charges'); @@ -179,8 +180,9 @@ if ($action == 'delete') /* * View */ - -llxHeader(); +$title=$langs->trans("VAT") . " - " . $langs->trans("Card"); +$help_url=''; +llxHeader("",$title,$helpurl); $form = new Form($db); @@ -305,11 +307,7 @@ if ($action == 'create') if ($id) { - $h = 0; - $head[$h][0] = DOL_URL_ROOT.'/compta/tva/card.php?id='.$object->id; - $head[$h][1] = $langs->trans('Card'); - $head[$h][2] = 'card'; - $h++; + $head=vat_prepare_head($object); dol_fiche_head($head, 'card', $langs->trans("VATPayment"), 0, 'payment'); diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index eb4ee3a2408..3c45ec77a89 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -671,4 +671,52 @@ class Tva extends CommonObject return $result; } + /** + * Informations of vat payment object + * + * @param int $id Id of vat payment + * @return int <0 if KO, >0 if OK + */ + function info($id) + { + $sql = "SELECT t.rowid, t.tms as datec, t.fk_user_creat"; + $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; + $sql.= " WHERE t.rowid = ".$id; + + dol_syslog(get_class($this)."::info", LOG_DEBUG); + $result=$this->db->query($sql); + if ($result) + { + if ($this->db->num_rows($result)) + { + $obj = $this->db->fetch_object($result); + + $this->id = $obj->rowid; + + if ($obj->fk_user_creat) { + $cuser = new User($this->db); + $cuser->fetch($obj->fk_user_creat); + $this->user_creation = $cuser; + } + + if ($obj->fk_user_modif) { + $muser = new User($this->db); + $muser->fetch($obj->fk_user_modif); + $this->user_modification = $muser; + } + + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = $this->db->jdate($obj->datec); + $this->import_key = $obj->import_key; + } + + $this->db->free($result); + + } + else + { + dol_print_error($this->db); + } + } + } diff --git a/htdocs/compta/tva/info.php b/htdocs/compta/tva/info.php new file mode 100644 index 00000000000..f85ab9fc2b0 --- /dev/null +++ b/htdocs/compta/tva/info.php @@ -0,0 +1,64 @@ + + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/compta/tva/info.php + * \ingroup tax + * \brief Page with info about vat + */ + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/vat.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + +$langs->load("compta"); +$langs->load("bills"); + +$id=GETPOST('id','int'); +$action=GETPOST("action"); + +// Security check +$socid = GETPOST('socid','int'); +if ($user->societe_id) $socid=$user->societe_id; +$result = restrictedArea($user, 'tax', '', '', 'charges'); + + +/* + * View + */ +$title=$langs->trans("VAT") . " - " . $langs->trans("Info"); +$help_url=''; +llxHeader("",$title,$helpurl); + +$object = new Tva($db); +$object->fetch($id); +$object->info($id); + +$head = vat_prepare_head($object); + +dol_fiche_head($head, 'info', $langs->trans("VATPayment"), 0, 'payment'); + +print '
'; +dol_print_object_info($object); +print '
'; + +print ''; + +llxFooter(); + +$db->close(); diff --git a/htdocs/core/lib/vat.lib.php b/htdocs/core/lib/vat.lib.php new file mode 100644 index 00000000000..9355bb1056e --- /dev/null +++ b/htdocs/core/lib/vat.lib.php @@ -0,0 +1,57 @@ + + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/core/lib/vat.lib.php + * \ingroup tax + * \brief Library for tax module (VAT) + */ + + +/** + * Prepare array with list of tabs + * + * @param Object $object Object related to tabs + * @return array Array of tabs to show + */ +function vat_prepare_head($object) +{ + global $db, $langs, $conf; + + $tab = 0; + $head = array(); + + $head[$tab][0] = DOL_URL_ROOT.'/compta/tva/card.php?id='.$object->id; + $head[$tab][1] = $langs->trans('Card'); + $head[$tab][2] = 'card'; + $tab++; + + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab + // $this->tabs = array('entity:-tabname); to remove a tab + complete_head_from_modules($conf, $langs, $object, $head, $tab,'vat'); + + $head[$tab][0] = DOL_URL_ROOT.'/compta/tva/info.php?id='.$object->id; + $head[$tab][1] = $langs->trans("Info"); + $head[$tab][2] = 'info'; + $tab++; + + complete_head_from_modules($conf,$langs,$object,$head,$tab,'vat','remove'); + + return $head; +} From ec5a094d27a767f5c742a75c9d85cbc72a28440d Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Fri, 9 Dec 2016 17:17:58 +0100 Subject: [PATCH 08/10] FIX : Do not include separate extrafields into export cause "separate" extrafields aren't sql column --- htdocs/core/extrafieldsinexport.inc.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/core/extrafieldsinexport.inc.php b/htdocs/core/extrafieldsinexport.inc.php index 7466c66df08..ac22841ad20 100644 --- a/htdocs/core/extrafieldsinexport.inc.php +++ b/htdocs/core/extrafieldsinexport.inc.php @@ -42,9 +42,11 @@ if ($resql) // This can fail when class is used on old database (during migra if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter="List:".$tmp; break; } - $this->export_fields_array[$r][$fieldname]=$fieldlabel; - $this->export_TypeFields_array[$r][$fieldname]=$typeFilter; - $this->export_entities_array[$r][$fieldname]=$keyforelement; + if ($obj->type!='separate') { + $this->export_fields_array[$r][$fieldname]=$fieldlabel; + $this->export_TypeFields_array[$r][$fieldname]=$typeFilter; + $this->export_entities_array[$r][$fieldname]=$keyforelement; + } } } // End add axtra fields From b17480928e5d34cc11cf7a84ad2e3ed8c3f15333 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Sat, 10 Dec 2016 10:40:38 +0100 Subject: [PATCH 09/10] fix default account selection (when cache is use) --- .../class/html.formventilation.class.php | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/htdocs/accountancy/class/html.formventilation.class.php b/htdocs/accountancy/class/html.formventilation.class.php index 2c538e7a627..376e5b00d56 100644 --- a/htdocs/accountancy/class/html.formventilation.class.php +++ b/htdocs/accountancy/class/html.formventilation.class.php @@ -30,10 +30,10 @@ */ class FormVentilation extends Form { - + private $options_cache = array(); - - + + /** * Return select filter with date of transaction * @@ -87,21 +87,22 @@ class FormVentilation extends Form if ($usecache && ! empty($this->options_cache[$usecache])) { $options = $this->options_cache[$usecache]; + $selected=$selectid; } else { $trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? $conf->global->ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50; - + $sql = "SELECT DISTINCT aa.account_number, aa.label, aa.rowid, aa.fk_pcg_version"; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; $sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS; $sql .= " AND aa.active = 1"; $sql .= " ORDER BY aa.account_number"; - + dol_syslog(get_class($this) . "::select_account", LOG_DEBUG); $resql = $this->db->query($sql); - + if (!$resql) { $this->error = "Error " . $this->db->lasterror(); dol_syslog(get_class($this) . "::select_account " . $this->error, LOG_ERR); @@ -109,16 +110,16 @@ class FormVentilation extends Form } $out = ajax_combobox($htmlname, $event); - + $selected = 0; - while ($obj = $this->db->fetch_object($resql)) + while ($obj = $this->db->fetch_object($resql)) { $label = length_accountg($obj->account_number) . ' - ' . $obj->label; $label = dol_trunc($label, $trunclength); - + $select_value_in = $obj->rowid; $select_value_out = $obj->rowid; - + // Try to guess if we have found default value if ($select_in == 1) { $select_value_in = $obj->account_number; @@ -132,19 +133,19 @@ class FormVentilation extends Form //var_dump("Found ".$selectid." ".$select_value_in); $selected = $select_value_out; } - + $options[$select_value_out] = $label; } $this->db->free($resql); - + if ($usecache) { $this->options_cache[$usecache] = $options; } } - + $out .= Form::selectarray($htmlname, $options, $selected, $showempty, 0, 0, '', 0, 0, 0, '', $morecss, 1); - + return $out; } @@ -303,7 +304,7 @@ class FormVentilation extends Form function selectyear_accountancy_bookkepping($selected = '', $htmlname = 'yearid', $useempty = 0, $output_format = 'html') { global $conf; - + $out_array = array(); $sql = "SELECT DISTINCT date_format(doc_date,'%Y') as dtyear"; @@ -342,7 +343,7 @@ class FormVentilation extends Form function selectjournal_accountancy_bookkepping($selected = '', $htmlname = 'journalid', $useempty = 0, $output_format = 'html') { global $conf,$langs; - + $out_array = array(); $sql = "SELECT DISTINCT code_journal"; From 73f5254159506f52e0ba48667c10fe5bb3a6a9b1 Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Sat, 10 Dec 2016 11:35:34 +0100 Subject: [PATCH 10/10] FIX #6031 search on login but fullname displayed --- htdocs/fourn/commande/list.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 6a193174322..b5c1cf16ad7 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -300,7 +300,7 @@ if ($search_ref) $sql .= natural_search('cf.ref', $search_ref); if ($search_refsupp) $sql.= natural_search("cf.ref_supplier", $search_refsupp); if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); if ($search_company) $sql .= natural_search('s.nom', $search_company); -if ($search_request_author) $sql.= " AND u.login LIKE '%".$db->escape($search_request_author)."%'"; +if ($search_request_author) $sql.=natural_search(array('u.lastname','u.firstname','u.login'), $search_request_author) ; if ($billed != '' && $billed >= 0) $sql .= " AND cf.billed = ".$billed; //Required triple check because statut=0 means draft filter @@ -379,7 +379,6 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) } $sql.= $db->plimit($limit+1, $offset); - $resql = $db->query($sql); if ($resql) {