diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 3fd45013ab5..812d108b2d5 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2013 Florian Henry @@ -1056,7 +1056,7 @@ if ($action == 'create') print ''.$langs->trans('Ref').''.$langs->trans("Draft").''; // Description (must be a textarea and not html must be allowed (used in list view) - print ''.$langs->trans("Description").''; + print ''.$langs->trans("Description").''; print ''; print ''; print ''; @@ -1068,7 +1068,7 @@ if ($action == 'create') $langs->load("project"); - print ''.$langs->trans("Project").''; + print ''.$langs->trans("Project").''; /* Fix: If a project must be linked to any companies (suppliers or not), project must be not be set as limited to customer but must be not linked to any particular thirdparty if ($societe->fournisseur==1) $numprojet=select_projects(-1,$_POST["projectid"],'projectid'); @@ -1087,7 +1087,7 @@ if ($action == 'create') if ($conf->contrat->enabled) { $langs->load("contracts"); - print ''.$langs->trans("Contract").''; + print ''.$langs->trans("Contract").''; $numcontrat=$formcontract->select_contract($soc->id,GETPOST('contratid','int'),'contratid',0,1); if ($numcontrat==0) { @@ -1106,19 +1106,19 @@ if ($action == 'create') // Public note print ''; - print ''.$langs->trans('NotePublic').''; - print ''; + print ''.$langs->trans('NotePublic').''; + print ''; $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); print $doleditor->Create(1); //print ''; print ''; // Private note - if (!empty($user->societe_id)) + if (empty($user->societe_id)) { print ''; - print ''.$langs->trans('NotePrivate').''; - print ''; + print ''.$langs->trans('NotePrivate').''; + print ''; $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); print $doleditor->Create(1); //print ''; @@ -1278,7 +1278,7 @@ else if ($id > 0 || ! empty($ref)) } // Description (must be a textarea and not html must be allowed (used in list view) - print ''; + print ''; print $form->editfieldkey("Description",'description',$object->description,$object,$user->rights->ficheinter->creer,'textarea'); print ''; print $form->editfieldval("Description",'description',$object->description,$object,$user->rights->ficheinter->creer,'textarea:8:80'); diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 948f73b21ef..ff7fba8fde3 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -861,7 +861,7 @@ else // Description (used in invoice, propal...) print ''.$langs->trans("Description").''; - $doleditor = new DolEditor('desc', GETPOST('desc'), '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 4, 80); + $doleditor = new DolEditor('desc', GETPOST('desc'), '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 4, '80%'); $doleditor->Create(); print ""; @@ -965,7 +965,7 @@ else print ''.$langs->trans("NoteNotVisibleOnBill").''; // We use dolibarr_details as type of DolEditor here, because we must not accept images as description is included into PDF and not accepted by TCPDF. - $doleditor = new DolEditor('note', GETPOST('note'), '', 140, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 8, 70); + $doleditor = new DolEditor('note', GETPOST('note'), '', 140, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 8, '80%'); $doleditor->Create(); print ""; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 5bca7bb2b86..d82adceb1a4 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -222,10 +222,7 @@ else // multilang if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid AND pl.lang = '".$langs->getDefaultLang() ."'"; $sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')'; - if ($sall) - { - $sql .= natural_search(array_keys($fieldstosearchall), $sall); - } + if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); // if the type is not 1, we show all products (type = 0,2,3) if (dol_strlen($type)) { diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index 5b81f8c0818..87d6d4e46eb 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015 Raphaël Doursenaud @@ -350,8 +350,11 @@ if ($resql) // Warehouse print ''; - $warehousetmp->fetch($objp->fk_entrepot); - print $warehousetmp->getNomUrl(1); + if ($objp->fk_entrepot > 0) + { + $warehousetmp->fetch($objp->fk_entrepot); + print $warehousetmp->getNomUrl(1); + } print ''; print ''.$objp->batch.''; print ''.dol_print_date($db->jdate($objp->eatby), 'day').''; diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 5cc9e27a8cb..80d8bea62f7 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -192,7 +192,7 @@ if ($action == 'create') print ''.$langs->trans("LocationSummary").''; // Description - print ''.$langs->trans("Description").''; + print ''.$langs->trans("Description").''; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor=new DolEditor('desc',(!empty($object->description)?$object->description:''),'',180,'dolibarr_notes','In',false,true,$conf->fckeditor->enabled,5,70); @@ -270,7 +270,7 @@ else print ''.$langs->trans("LocationSummary").''.$object->lieu.''; // Description - print ''.$langs->trans("Description").''.nl2br($object->description).''; + print ''.$langs->trans("Description").''.nl2br($object->description).''; // Address print ''.$langs->trans('Address').''; @@ -298,17 +298,17 @@ else $calcproducts=$object->nb_products(); // Total nb of different products - print ''.$langs->trans("NumberOfDifferentProducts").''; + print ''.$langs->trans("NumberOfDifferentProducts").''; print empty($calcproductsunique['nb'])?'0':$calcproductsunique['nb']; print ""; // Nb of products - print ''.$langs->trans("NumberOfProducts").''; + print ''.$langs->trans("NumberOfProducts").''; print empty($calcproducts['nb'])?'0':$calcproducts['nb']; print ""; // Value - print ''.$langs->trans("EstimatedStockValueShort").''; + print ''.$langs->trans("EstimatedStockValueShort").''; print price((empty($calcproducts['value'])?'0':price2num($calcproducts['value'],'MT')), 0, $langs, 0, -1, -1, $conf->currency); print ""; @@ -326,7 +326,7 @@ else { dol_print_error($db); } - print ''.$langs->trans("LastMovement").''; + print ''.$langs->trans("LastMovement").''; if ($lastmovementdate) { print dol_print_date($lastmovementdate,'dayhour').' '; @@ -529,10 +529,10 @@ else // Ref print ''.$langs->trans("Ref").''; - print ''.$langs->trans("LocationSummary").''; + print ''.$langs->trans("LocationSummary").''; // Description - print ''.$langs->trans("Description").''; + print ''.$langs->trans("Description").''; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor=new DolEditor('desc',$object->description,'',180,'dolibarr_notes','In',false,true,$conf->fckeditor->enabled,5,70); @@ -551,12 +551,12 @@ else print ''; // Country - print ''.$langs->trans('Country').''; + print ''.$langs->trans('Country').''; print $form->select_country($object->country_id?$object->country_id:$mysoc->country_code,'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print ''; - print ''.$langs->trans("Status").''; + print ''.$langs->trans("Status").''; print ''; -print "".$langs->trans("Other").':'; +print $langs->trans("Warehouse").':'; print "
"; $sql = "SELECT e.label, e.rowid, e.statut"; diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 833e285f608..0240b6d8d51 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -48,6 +48,17 @@ $offset = $limit * $page; $year = strftime("%Y",time()); +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'e.label'=>"Ref", + 'e.lieu'=>"LocationSummary", + 'e.description'=>"Description", + 'e.address'=>"Address", + 'e.zip'=>'Zip', + 'e.town'=>'Town', +); + + /* * View @@ -62,11 +73,10 @@ $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON e.rowid = ps.fk_entrepot"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON ps.fk_product = p.rowid"; $sql.= " WHERE e.entity IN (".getEntity('stock', 1).")"; - if ($search_ref) $sql.= natural_search("e.label", $search_ref); // ref if ($search_label) $sql.= natural_search("e.lieu", $search_label); // label if ($search_status != '' && $search_status >= 0) $sql.= " AND e.statut = ".$search_status; -if ($sall) $sql.= natural_search(array('e.label','e.description','e.lieu','e.address','e.town'), $sall); +if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); $sql.= " GROUP BY e.rowid, e.label, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays"; $totalnboflines=0; $result=$db->query($sql); @@ -95,6 +105,12 @@ if ($result) print ''; print ''; + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); + } + print ''; print "";