From e2e95641a3198d527fe1b39667dd3eb803aca3b8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 May 2016 12:27:02 +0200 Subject: [PATCH 01/14] FIX Search supplier ref on contract --- htdocs/contrat/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 669f2b09775..e9a9e2cb8bc 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -180,7 +180,7 @@ if ($resql) print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; From 1ce91bac06f445c955e710d061caab0bb038d0ce Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 25 May 2016 11:25:19 +0200 Subject: [PATCH 02/14] FIX : same page added several times on mergepropal option --- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index f8e6874f3b2..54ffdf0c437 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -710,7 +710,7 @@ class pdf_azur extends ModelePDFPropales if (file_exists($infile) && is_readable($infile)) { $pagecount = $pdf->setSourceFile($infile); for($i = 1; $i <= $pagecount; $i ++) { - $tplIdx = $pdf->importPage(1); + $tplIdx = $pdf->importPage($i); if ($tplIdx!==false) { $s = $pdf->getTemplatesize($tplIdx); $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L'); From 71ee941cf84f3954b69bd0a6927cc6eb575dc02e Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 25 May 2016 12:25:39 +0200 Subject: [PATCH 03/14] FIX : SQL error function on getAvailableDiscounts function, on bill create mode if socid is empty --- htdocs/compta/facture.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index c13d8197801..ccfd057ccde 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1935,7 +1935,7 @@ if ($action == 'create') $dateinvoice = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$dateinvoice); // Do not set 0 here (0 for a date is 1970) } - $absolute_discount = $soc->getAvailableDiscounts(); + if(!empty($soc->id)) $absolute_discount = $soc->getAvailableDiscounts(); if (! empty($conf->use_javascript_ajax)) { From 41a41f8931a7cf79299ce9e5150aa3271d4cb1d0 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 31 May 2016 22:55:49 +0200 Subject: [PATCH 04/14] FIX #5209 --- htdocs/societe/consumption.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 621a8988a04..e07e13ef751 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -115,7 +115,7 @@ $head = societe_prepare_head($object); dol_fiche_head($head, 'consumption', $langs->trans("ThirdParty"),0,'company'); dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); - + print '
'; print '
'; @@ -270,7 +270,7 @@ if ($type_element == 'contract') { // Supplier : Show products from orders. require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; $documentstatic=new Contrat($db); - $documentstaticline=new ContratLigne($db); + $documentstaticline=new ContratLigne($db); $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_contrat as dateprint, d.statut as status, '; $tables_from = MAIN_DB_PREFIX."contrat as c,".MAIN_DB_PREFIX."contratdet as d"; $where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".$socid; @@ -304,7 +304,7 @@ if ($month > 0) { $sql.= " AND ".$dateprint." BETWEEN '".$db->idate($start)."' AND '".$db->idate($end)."'"; } if ($sref) $sql.= " AND ".$doc_number." LIKE '%".$sref."%'"; -if ($sprod_fulldescr) +if ($sprod_fulldescr) { $sql.= " AND (d.description LIKE '%".$db->escape($sprod_fulldescr)."%'"; if (GETPOST('type_element') != 'fichinter') $sql.= " OR p.ref LIKE '%".$db->escape($sprod_fulldescr)."%'"; @@ -330,10 +330,10 @@ if ($sql_select) { $resql=$db->query($sql); if (!$resql) dol_print_error($db); - + $var=true; $num = $db->num_rows($resql); - + $param="&socid=".$socid."&type_element=".$type_element; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($sprod_fulldescr) $param.= "&sprod_fulldescr=".urlencode($sprod_fulldescr); @@ -341,15 +341,15 @@ if ($sql_select) if ($month) $param.= "&month=".$month; if ($year) $param.= "&year=".$year; if ($optioncss != '') $param.='&optioncss='.$optioncss; - + print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, $totalnboflines, '', 0, '', '', $limit); - + print ''."\n"; // Titles with sort buttons print ''; print_liste_field_titre($langs->trans('Ref'),$_SERVER['PHP_SELF'],'doc_number','',$param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Date'),$_SERVER['PHP_SELF'],'dateprint','',$param,'align="center" width="150"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('Status'),$_SERVER['PHP_SELF'],'fk_status','',$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('Status'),$_SERVER['PHP_SELF'],'fk_statut','',$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Product'),$_SERVER['PHP_SELF'],'','',$param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Quantity'),$_SERVER['PHP_SELF'],'prod_qty','',$param,'align="right"',$sortfield,$sortorder); print "\n"; @@ -384,7 +384,7 @@ if ($sql_select) $documentstatic->statut=$objp->status; $documentstatic->status=$objp->status; $documentstatic->paye=$objp->paid; - + if (is_object($documentstaticline)) $documentstaticline->statut=$objp->status; $var=!$var; @@ -550,7 +550,7 @@ if ($sql_select) } print "
"; - + if ($num > $limit) { print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num); } @@ -559,7 +559,7 @@ if ($sql_select) else if (empty($type_element) || $type_element == -1) { print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, '', ''); - + print ''."\n"; // Titles with sort buttons print ''; @@ -569,16 +569,16 @@ else if (empty($type_element) || $type_element == -1) print_liste_field_titre($langs->trans('Product'),$_SERVER['PHP_SELF'],'','',$param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Quantity'),$_SERVER['PHP_SELF'],'prod_qty','',$param,'align="right"',$sortfield,$sortorder); print "\n"; - + print ''; print "
'.$langs->trans("SelectElementAndClickRefresh").'
"; } else { print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, '', ''); - + print ''."\n"; - + print ''; print "
'.$langs->trans("FeatureNotYetAvailable").'
"; From bf5fbd3a80c180cedba9d451f61cd1c32c389a75 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Jun 2016 21:14:28 +0200 Subject: [PATCH 05/14] FIX Infinite loop on menu tree output for edition FIX Can show tree of entries added by external modules using fk_mainmenu and fk_leftmenu instead of fk_menu. --- htdocs/admin/menus/index.php | 57 +++++++++++++++++++++++++++----- htdocs/core/lib/treeview.lib.php | 23 ++++++++----- 2 files changed, 63 insertions(+), 17 deletions(-) diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index 7da0673b196..27b8ab74a96 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -289,17 +289,18 @@ if ($conf->use_javascript_ajax) - la chaine a afficher ie: data[]= array (index, index parent, chaine ) */ + //il faut d'abord declarer un element racine de l'arbre - $data[] = array('rowid'=>0,'fk_menu'=>-1,'title'=>"racine",'mainmenu'=>'','leftmenu'=>'','fk_mainmenu'=>'','fk_leftmenu'=>''); - + $data[] = array('rowid'=>0,'fk_menu'=>-1,'title'=>"racine",'mainmenu'=>'','leftmenu'=>'','fk_mainmenu'=>'','fk_leftmenu'=>''); + //puis tous les elements enfants - $sql = "SELECT m.rowid, m.titre, m.langs, m.mainmenu, m.leftmenu, m.fk_menu, m.fk_mainmenu, m.fk_leftmenu"; + $sql = "SELECT m.rowid, m.titre, m.langs, m.mainmenu, m.leftmenu, m.fk_menu, m.fk_mainmenu, m.fk_leftmenu, m.module"; $sql.= " FROM ".MAIN_DB_PREFIX."menu as m"; $sql.= " WHERE menu_handler = '".$menu_handler_to_search."'"; $sql.= " AND entity = ".$conf->entity; - $sql.= " AND fk_menu >= 0"; + //$sql.= " AND fk_menu >= 0"; $sql.= " ORDER BY m.position, m.rowid"; // Order is position then rowid (because we need a sort criteria when position is same) $res = $db->query($sql); @@ -314,9 +315,10 @@ if ($conf->use_javascript_ajax) $titre = $langs->trans($menu['titre']); $data[] = array( 'rowid'=>$menu['rowid'], + 'module'=>$menu['module'], 'fk_menu'=>$menu['fk_menu'], 'title'=>$titre, - 'mainmenu'=>$menu['mainmenu'], + 'mainmenu'=>$menu['mainmenu'], 'leftmenu'=>$menu['leftmenu'], 'fk_mainmenu'=>$menu['fk_mainmenu'], 'fk_leftmenu'=>$menu['fk_leftmenu'], @@ -334,17 +336,54 @@ if ($conf->use_javascript_ajax) } } + global $tree_recur_alreadyadded; // This var was def into tree_recur + // Appelle de la fonction recursive (ammorce) // avec recherche depuis la racine. //var_dump($data); - tree_recur($data,$data[0],0); + tree_recur($data, $data[0], 0, 'iddivjstree'); // $data[0] is virtual record 'racine' + print ''; - + print ''; - + print ''; - + + + // Process remaining records (records that are not linked to root by any path) + $remainingdata = array(); + foreach($data as $datar) + { + if (empty($datar['rowid']) || $tree_recur_alreadyadded[$datar['rowid']]) continue; + $remainingdata[] = $datar; + } + + if (count($remainingdata)) + { + print ''; + + print ''; + print ''; + print ''; + print ''; + + print ''; + print ''; + + print ''; + + print '
'.$langs->trans("NotTopTreeMenuPersonalized").'
'; + + foreach($remainingdata as $datar) + { + $father = array('rowid'=>$datar['rowid'],'title'=>"???",'mainmenu'=>$datar['fk_mainmenu'],'leftmenu'=>$datar['fk_leftmenu'],'fk_mainmenu'=>'','fk_leftmenu'=>''); + //print 'Start with rowid='.$datar['rowid'].' mainmenu='.$father ['mainmenu'].' leftmenu='.$father ['leftmenu'].'
'."\n"; + tree_recur($data, $father, 0, 'iddivjstree'.$datar['rowid'], 1, 1); + } + + print '
'; + } print '
'; diff --git a/htdocs/core/lib/treeview.lib.php b/htdocs/core/lib/treeview.lib.php index 225568fd776..6fc0c9f013f 100644 --- a/htdocs/core/lib/treeview.lib.php +++ b/htdocs/core/lib/treeview.lib.php @@ -109,15 +109,17 @@ function tree_showpad(&$fulltree,$key,$silent=0) * @param int $pere Array with parent ids ('rowid'=>,'mainmenu'=>,'leftmenu'=>,'fk_mainmenu=>,'fk_leftmenu=>) * @param int $rang Level of element * @param string $iddivjstree Id to use for parent ul element + * @param int $donoresetalreadyloaded Do not reset global array $donoresetalreadyloaded used to avoid to go down on an aleady processed record + * @param int $showfk Show fk links to parent into label * @return void */ -function tree_recur($tab, $pere, $rang, $iddivjstree='iddivjstree') +function tree_recur($tab, $pere, $rang, $iddivjstree='iddivjstree', $donoresetalreadyloaded=0, $showfk=0) { global $tree_recur_alreadyadded; - if ($rang == 0) $tree_recur_alreadyadded=array(); + if ($rang == 0 && empty($donoresetalreadyloaded)) $tree_recur_alreadyadded=array(); - if (empty($pere['rowid'])) + if ($rang == 0) { // Test also done with jstree and dynatree (not able to have inside label) print ''; print load_fiche_titre($langs->trans("NewMenu"),'','title_setup'); - + print '
'; print ''; @@ -281,7 +281,7 @@ if ($action == 'create') $parent_rowid = $_GET['menuId']; if ($_GET['menuId']) { - $sql = "SELECT m.rowid, m.mainmenu, m.level, m.langs FROM ".MAIN_DB_PREFIX."menu as m WHERE m.rowid = ".$_GET['menuId']; + $sql = "SELECT m.rowid, m.mainmenu, m.leftmenu, m.level, m.langs FROM ".MAIN_DB_PREFIX."menu as m WHERE m.rowid = ".$_GET['menuId']; $res = $db->query($sql); if ($res) { @@ -290,6 +290,7 @@ if ($action == 'create') { $parent_rowid = $menu['rowid']; $parent_mainmenu = $menu['mainmenu']; + $parent_leftmenu = $menu['leftmenu']; $parent_langs = $menu['langs']; $parent_level = $menu['level']; } @@ -340,7 +341,9 @@ if ($action == 'create') { print ''; } - print ''.$langs->trans('DetailMenuIdParent').''; + print ''.$langs->trans('DetailMenuIdParent'); + print ', '.$langs->trans("Example").': fk_mainmenu=abc&fk_leftmenu=def'; + print ''; // Title print ''.$langs->trans('Title').''.$langs->trans('DetailTitre').''; @@ -418,7 +421,12 @@ elseif ($action == 'edit') print ''.$langs->trans('MenuIdParent').''; //$menu_handler //print ''; - print ''.$menu->fk_menu.''; + print ''; + $valtouse=$menu->fk_menu; + if ($menu->fk_mainmenu) $valtouse='fk_mainmenu='.$menu->fk_mainmenu; + if ($menu->fk_leftmenu) $valtouse.='&fk_leftmenu='.$menu->fk_leftmenu; + print $valtouse; + print ''; print ''.$langs->trans('DetailMenuIdParent').''; // Niveau diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index cb370e31d96..bb842bab1aa 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -264,6 +264,8 @@ class Menubase $sql.= " t.mainmenu,"; $sql.= " t.leftmenu,"; $sql.= " t.fk_menu,"; + $sql.= " t.fk_mainmenu,"; + $sql.= " t.fk_leftmenu,"; $sql.= " t.position,"; $sql.= " t.url,"; $sql.= " t.target,"; @@ -293,6 +295,8 @@ class Menubase $this->mainmenu = $obj->mainmenu; $this->leftmenu = $obj->leftmenu; $this->fk_menu = $obj->fk_menu; + $this->fk_mainmenu = $obj->fk_mainmenu; + $this->fk_leftmenu = $obj->fk_leftmenu; $this->position = $obj->position; $this->url = $obj->url; $this->target = $obj->target; From 19f6aa805be4dac3f5278fe74a68a1a5f02db01c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 30 Apr 2016 18:56:16 +0200 Subject: [PATCH 08/14] select engine for code 128 didn't work --- htdocs/admin/barcode.php | 54 +++++++++++++++------------------------- 1 file changed, 20 insertions(+), 34 deletions(-) diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index b7cc6e94bf2..29475d712df 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -62,21 +62,12 @@ if ($action == 'setcoder') } else if ($action == 'update') { - if (GETPOST('submit_GENBARCODE_LOCATION')) - { - $location = GETPOST('GENBARCODE_LOCATION','alpha'); - $res = dolibarr_set_const($db, "GENBARCODE_LOCATION",$location,'chaine',0,'',$conf->entity); - } - if (GETPOST('submit_PRODUIT_DEFAULT_BARCODE_TYPE')) - { - $coder_id = GETPOST('PRODUIT_DEFAULT_BARCODE_TYPE','alpha'); - $res = dolibarr_set_const($db, "PRODUIT_DEFAULT_BARCODE_TYPE", $coder_id,'chaine',0,'',$conf->entity); - } - if (GETPOST('submit_GENBARCODE_BARCODETYPE_THIRDPARTY')) - { - $coder_id = GETPOST('GENBARCODE_BARCODETYPE_THIRDPARTY','alpha'); - $res = dolibarr_set_const($db, "GENBARCODE_BARCODETYPE_THIRDPARTY", $coder_id,'chaine',0,'',$conf->entity); - } + $location = GETPOST('GENBARCODE_LOCATION','alpha'); + $res = dolibarr_set_const($db, "GENBARCODE_LOCATION",$location,'chaine',0,'',$conf->entity); + $coder_id = GETPOST('PRODUIT_DEFAULT_BARCODE_TYPE','alpha'); + $res = dolibarr_set_const($db, "PRODUIT_DEFAULT_BARCODE_TYPE", $coder_id,'chaine',0,'',$conf->entity); + $coder_id = GETPOST('GENBARCODE_BARCODETYPE_THIRDPARTY','alpha'); + $res = dolibarr_set_const($db, "GENBARCODE_BARCODETYPE_THIRDPARTY", $coder_id,'chaine',0,'',$conf->entity); } else if ($action == 'updateengine') { @@ -195,9 +186,9 @@ $var=true; print '
'; print load_fiche_titre($langs->trans("BarcodeEncodeModule"),'',''); -print ""; -print ''; -print ""; +//print ""; +//print ''; +//print ""; print ''; print ''; @@ -261,7 +252,7 @@ if ($resql) // Build barcode on disk (not used, this is done to make debug easier) $result=$module->writeBarCode($obj->example,$obj->encoding,'Y'); // Generate on the fly and output barcode with generator - $url=DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($obj->coder).'&code='.urlencode($obj->example).'&encoding='.urlencode($obj->encoding); + $url=DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($obj->coder).'&code='.urlencode($obj->example).'&encoding='.urlencode($obj->encoding); //print $url; print ''; } @@ -296,7 +287,7 @@ if (empty($conf->use_javascript_ajax)) // TODO Implement code behind action updateengine //print '
'; } -print ''; +//print ''; print "
"; @@ -331,9 +322,7 @@ if (! isset($_SERVER['WINDIR'])) $langs->load("errors"); print '
'.$langs->trans("ErrorFileNotFound",$conf->global->GENBARCODE_LOCATION).''; } - print ''; - print ''; - print ''; + print ''; } // Module products @@ -344,10 +333,7 @@ if (! empty($conf->product->enabled)) print ''; print '"; - print ''; + print ''; } // Module thirdparty @@ -358,13 +344,13 @@ if (! empty($conf->societe->enabled)) print ''; print '"; - print ''; + print ''; } print "
'.$langs->trans("SetDefaultBarcodeTypeProducts").''; $formbarcode->select_barcode_type($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE,"PRODUIT_DEFAULT_BARCODE_TYPE",1); - print ''; - print ''; - print "
'.$langs->trans("SetDefaultBarcodeTypeThirdParties").''; print $formbarcode->select_barcode_type($conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY,"GENBARCODE_BARCODETYPE_THIRDPARTY",1); - print ''; - print ''; - print "
\n"; +print '
'; +print ''; +print "
"; print ''; print '
'; @@ -419,13 +405,13 @@ if ($conf->produit->enabled) if ($conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file") { - print '
'; + print ''; print img_picto($langs->trans("Activated"),'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"),'switch_off'); print ''; } @@ -442,7 +428,7 @@ if ($conf->produit->enabled) print "\n"; } -print ''; +//print ''; print "
"; From ab44adc6d5b7d7fe6d8c926fbe9d45ed225e6cac Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 2 Jun 2016 12:37:37 +0200 Subject: [PATCH 09/14] Fix SQL error on order stats --- htdocs/commande/class/commandestats.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index 1ab418a9daa..e38097e4e3a 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -206,7 +206,7 @@ class CommandeStats extends Stats $sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg"; $sql.= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product"; - //if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE ".$this->where; $sql.= " AND c.rowid = tl.fk_commande AND tl.fk_product = product.rowid"; $sql.= " AND c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year,1,false))."' AND '".$this->db->idate(dol_get_last_day($year,12,false))."'"; From 778b05c3416f9ba7c89792ce7e97a00229280f8f Mon Sep 17 00:00:00 2001 From: phf Date: Fri, 3 Jun 2016 23:06:53 +0200 Subject: [PATCH 10/14] Fix #4632 --- htdocs/societe/soc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 76a2c948636..76680649958 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1863,7 +1863,7 @@ else /* * View */ - $res=$object->fetch_optionals($object->id,$extralabels); + if (!empty($object->id)) $res=$object->fetch_optionals($object->id,$extralabels); //if ($res < 0) { dol_print_error($db); exit; } From c9c7045a6f0ed6d925ac89635a45eeccd492b077 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 3 Jun 2016 23:34:37 +0200 Subject: [PATCH 11/14] Fix access to project task time spent creation #5249 --- htdocs/projet/tasks/time.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index e54eef4cf6e..7f820304b60 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -359,7 +359,7 @@ if ($id > 0 || ! empty($ref)) /* * Form to add time spent */ - if ($user->rights->projet->creer) + if ($user->rights->projet->lire) { print '
'; From 8b0b3b1a9dc1ac1db0b0d70a14005c9043945a1d Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 3 Jun 2016 23:49:34 +0200 Subject: [PATCH 12/14] PMP available only if stock module enabled --- htdocs/fourn/ajax/getSupplierPrices.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index 664c8a2da4e..ae711d2f01b 100644 --- a/htdocs/fourn/ajax/getSupplierPrices.php +++ b/htdocs/fourn/ajax/getSupplierPrices.php @@ -125,9 +125,11 @@ if ($idprod > 0) } } - // Add price for pmp - $price=$producttmp->pmp; - $prices[] = array("id" => 'pmpprice', "price" => $price, "label" => $langs->trans("PMPValueShort").': '.price($price,0,$langs,0,0,-1,$conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price,0,$langs,0,0,-1,$conf->currency)); + if(!empty($conf->stock->enabled)) { + // Add price for pmp + $price=$producttmp->pmp; + $prices[] = array("id" => 'pmpprice', "price" => $price, "label" => $langs->trans("PMPValueShort").': '.price($price,0,$langs,0,0,-1,$conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price,0,$langs,0,0,-1,$conf->currency)); + } } echo json_encode($prices); From 8901b99e2dfc1eab203fd40a1a7beae04816d4b7 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 4 Jun 2016 00:14:08 +0200 Subject: [PATCH 13/14] Fix import model not correctly saved #5185 --- htdocs/install/mysql/migration/3.8.0-3.9.0.sql | 1 + htdocs/install/mysql/tables/llx_import_model.sql | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql index 74f89441f64..35ebf79e1ef 100755 --- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql +++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql @@ -610,3 +610,4 @@ INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (14 -- VMYSQL4.1 ALTER TABLE llx_c_type_resource CHANGE COLUMN rowid rowid integer NOT NULL AUTO_INCREMENT; +ALTER TABLE llx_import_model MODIFY COLUMN type varchar(50); \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_import_model.sql b/htdocs/install/mysql/tables/llx_import_model.sql index cb5266a0c41..37ab1c00c12 100644 --- a/htdocs/install/mysql/tables/llx_import_model.sql +++ b/htdocs/install/mysql/tables/llx_import_model.sql @@ -23,6 +23,6 @@ create table llx_import_model rowid integer AUTO_INCREMENT PRIMARY KEY, fk_user integer DEFAULT 0 NOT NULL, label varchar(50) NOT NULL, - type varchar(20) NOT NULL, + type varchar(50) NOT NULL, field text NOT NULL )ENGINE=innodb; \ No newline at end of file From 9c3365aefcd4c02ad4aed8ce1b7783561267bcc5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 4 Jun 2016 00:52:55 +0200 Subject: [PATCH 14/14] FIX #5163 --- htdocs/comm/action/listactions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 447a247ad56..a9dd8d8f1e5 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Eric Seigne - * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -210,7 +210,7 @@ if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR ( if ($filtert > 0 || $usergroup > 0) { $sql.= " AND ("; - if ($filtert > 0) $sql.= "(ar.fk_element = ".$filtert." OR a.fk_user_action=".$filtert.")"; + if ($filtert > 0) $sql.= "(ar.fk_element = ".$filtert." OR (ar.fk_element IS NULL AND a.fk_user_action=".$filtert."))"; // The OR is for backward compatibility if ($usergroup > 0) $sql.= ($filtert>0?" OR ":"")." ugu.fk_usergroup = ".$usergroup; $sql.= ")"; } @@ -350,7 +350,7 @@ if ($resql) $actionstatic->type_code=$obj->type_code; $actionstatic->type_label=$obj->type_label; $actionstatic->label=$obj->label; - print $actionstatic->getNomUrl(1,28); + print $actionstatic->getNomUrl(1,36); print ''; if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))