From 7f950d8b4560579ca9614e68a80bab4e53843cd5 Mon Sep 17 00:00:00 2001 From: Florian Henry Date: Thu, 21 Nov 2013 12:28:51 +0100 Subject: [PATCH 1/7] Fix user pram_ihm, display tab and allow modify button only is user right allow it is OK --- htdocs/core/lib/usergroups.lib.php | 11 +++++++---- htdocs/user/param_ihm.php | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 041234bf206..41fca18e278 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -66,10 +66,13 @@ function user_prepare_head($object) $h++; } - $head[$h][0] = DOL_URL_ROOT.'/user/param_ihm.php?id='.$object->id; - $head[$h][1] = $langs->trans("UserGUISetup"); - $head[$h][2] = 'guisetup'; - $h++; + //Display this tab only if can updte information + if (!empty($user->admin) || !empty($user->rights->user->self->creer)) { + $head[$h][0] = DOL_URL_ROOT.'/user/param_ihm.php?id='.$object->id; + $head[$h][1] = $langs->trans("UserGUISetup"); + $head[$h][2] = 'guisetup'; + $h++; + } if (! empty($conf->clicktodial->enabled)) { diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 54a9093bd34..a6b718f83b8 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -258,7 +258,7 @@ else } else { - if ($user->id == $fuser->id || ! empty($user->admin)) // Si utilisateur edite = utilisateur courant (pas besoin de droits particulier car il s'agit d'une page de modif d'output et non de données) ou si admin + if (($user->id == $fuser->id || ! empty($user->admin)) && $caneditfield) // Si utilisateur edite = utilisateur courant (pas besoin de droits particulier car il s'agit d'une page de modif d'output et non de données) ou si admin { print 'id.'">'.$langs->trans("Modify").''; } From f852c9a5bbc56e01b7b9c4cfa648dbf93fd436c4 Mon Sep 17 00:00:00 2001 From: Florian Henry Date: Fri, 22 Nov 2013 14:43:15 +0100 Subject: [PATCH 2/7] Fix [ bug #1145 ] Agenda button list type do not display --- ChangeLog | 3 +- htdocs/core/lib/agenda.lib.php | 224 ++++++++++++++++----------------- 2 files changed, 109 insertions(+), 118 deletions(-) diff --git a/ChangeLog b/ChangeLog index f6d72624b4d..4702e01e0a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,7 +8,8 @@ Fix: Bad rounding on margin calculations and display. Fix: Option drop table into backup was broken. Fix: [ bug #1105 ] Searching Boxes other search option Fix: wrong buy price update -Fix :[ bug #1142 ] Set paiement on invoice (PGSql) +Fix: [ bug #1142 ] Set paiement on invoice (PGSql) +Fix: [ bug #1145 ] Agenda button list type do not display ***** ChangeLog for 3.4.1 compared to 3.4.0 ***** Fix: Display buying price on line edit when no supplier price is defined diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index dda971668de..32584a19a9b 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -43,126 +43,116 @@ * @param string $actioncode Preselected value of actioncode for filter on type * @return void */ -function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,$showextcals=array(),$actioncode='') -{ - global $conf,$user,$langs,$db; +function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $showextcals = array(), $actioncode = '') { + global $conf, $user, $langs, $db; + // Filters - if ($canedit || ! empty($conf->projet->enabled)) - { - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - if ($canedit || ! empty($conf->projet->enabled)) - { - print ''; - - // Buttons - print ''; - - // Legend - if ($conf->use_javascript_ajax && is_array($showextcals)) - { - print ''; - } - - print ''; - } - print '
'; - - print ''; - - if ($canedit) - { - print ''; - print ''; - print ''; - - print ''; - print ''; - - print ''; - print ''; - - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; - $formactions=new FormActions($db); - print ''; - print ''; - } - - if (! empty($conf->projet->enabled) && $user->rights->projet->lire) - { - print ''; - print ''; - } - - print '
'; - print $langs->trans("ActionsAskedBy"); - print '  '; - print $form->select_dolusers($filtera,'userasked',1,'',!$canedit); - print '
'; - print $langs->trans("or").' '.$langs->trans("ActionsToDoBy"); - print '  '; - print $form->select_dolusers($filtert,'usertodo',1,'',!$canedit); - print '
'; - print $langs->trans("or").' '.$langs->trans("ActionsDoneBy"); - print '  '; - print $form->select_dolusers($filterd,'userdone',1,'',!$canedit); - print '
'; - print $langs->trans("Type"); - print '  '; - - print $formactions->select_type_actions($actioncode, "actioncode", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0)); - - print '
'; - print $langs->trans("Project").'   '; - print ''; - select_projects($socid?$socid:-1, $pid, 'projectid', 64); - print '
'; - print '
'; - print img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone"').' '; - print '
'; - print img_picto($langs->trans("ViewWeek"),'object_calendarweek','class="hideonsmartphone"').' '; - print '
'; - print img_picto($langs->trans("ViewDay"),'object_calendarday','class="hideonsmartphone"').' '; - print '
'; - print img_picto($langs->trans("ViewList"),'object_list','class="hideonsmartphone"').' '; - print '
'; - print ''."\n"; - print ''; - if (! empty($conf->global->MAIN_JS_SWITCH_AGENDA)) - { - if (count($showextcals) > 0) - { - print ''; - foreach($showextcals as $val) - { - $htmlname=dol_string_nospecial($val['name']); - print ''."\n"; - print ''; - } - } - } - print ''; - print '
'.$langs->trans("LocalAgenda").'
'.$val['name'].'
'.$langs->trans("AgendaShowBirthdayEvents").'
'; - print '
'; - print '
'; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + print ''; + + // Buttons + print ''; + + // Legend + if ($conf->use_javascript_ajax && is_array ( $showextcals )) { + print ''; + } + + print ''; + + print '
'; + + print ''; + + if ($canedit) { + print ''; + print ''; + print ''; + + print ''; + print ''; + + print ''; + print ''; + + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; + $formactions = new FormActions ( $db ); + print ''; + print ''; } + + if (! empty ( $conf->projet->enabled ) && $user->rights->projet->lire) { + print ''; + print ''; + } + + print '
'; + print $langs->trans ( "ActionsAskedBy" ); + print '  '; + print $form->select_dolusers ( $filtera, 'userasked', 1, '', ! $canedit ); + print '
'; + print $langs->trans ( "or" ) . ' ' . $langs->trans ( "ActionsToDoBy" ); + print '  '; + print $form->select_dolusers ( $filtert, 'usertodo', 1, '', ! $canedit ); + print '
'; + print $langs->trans ( "or" ) . ' ' . $langs->trans ( "ActionsDoneBy" ); + print '  '; + print $form->select_dolusers ( $filterd, 'userdone', 1, '', ! $canedit ); + print '
'; + print $langs->trans ( "Type" ); + print '  '; + + print $formactions->select_type_actions ( $actioncode, "actioncode", '', (empty ( $conf->global->AGENDA_USE_EVENT_TYPE ) ? 1 : 0) ); + + print '
'; + print $langs->trans ( "Project" ) . '   '; + print ''; + select_projects ( $socid ? $socid : - 1, $pid, 'projectid', 64 ); + print '
'; + print '
'; + print img_picto ( $langs->trans ( "ViewCal" ), 'object_calendar', 'class="hideonsmartphone"' ) . ' '; + print '
'; + print img_picto ( $langs->trans ( "ViewWeek" ), 'object_calendarweek', 'class="hideonsmartphone"' ) . ' '; + print '
'; + print img_picto ( $langs->trans ( "ViewDay" ), 'object_calendarday', 'class="hideonsmartphone"' ) . ' '; + print '
'; + print img_picto ( $langs->trans ( "ViewList" ), 'object_list', 'class="hideonsmartphone"' ) . ' '; + print '
'; + print '' . "\n"; + print ''; + if (! empty ( $conf->global->MAIN_JS_SWITCH_AGENDA )) { + if (count ( $showextcals ) > 0) { + print ''; + foreach ( $showextcals as $val ) { + $htmlname = dol_string_nospecial ( $val ['name'] ); + print '' . "\n"; + print ''; + } + } + } + print ''; + print '
' . $langs->trans ( "LocalAgenda" ) . '
' . $val ['name'] . '
' . $langs->trans ( "AgendaShowBirthdayEvents" ) . '
'; + print '
'; + print '
'; } From 6615ee7e6f12a8298b29ae84e95c90966f7d75a8 Mon Sep 17 00:00:00 2001 From: Florian Henry Date: Sat, 23 Nov 2013 14:59:28 +0100 Subject: [PATCH 3/7] [ bug #1148 ] Product consomation : supplier order bad status --- ChangeLog | 1 + htdocs/product/stats/commande_fournisseur.php | 16 +++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4702e01e0a1..c49735f97e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ Fix: [ bug #1105 ] Searching Boxes other search option Fix: wrong buy price update Fix: [ bug #1142 ] Set paiement on invoice (PGSql) Fix: [ bug #1145 ] Agenda button list type do not display +Fix: [ bug #1148 ] Product consomation : supplier order bad status ***** ChangeLog for 3.4.1 compared to 3.4.0 ***** Fix: Display buying price on line edit when no supplier price is defined diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index 0e8b5509149..f8d73c3e5e9 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -25,7 +25,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; $langs->load("orders"); @@ -136,8 +136,8 @@ if ($id > 0 || ! empty($ref)) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"c.fk_statut","","&id=".$product->id,'align="right"',$sortfield,$sortorder); print "\n"; - $commandestatic=new Commande($db); - + $commandestatic=new CommandeFournisseur($db); + if ($num > 0) { $var=True; @@ -145,17 +145,19 @@ if ($id > 0 || ! empty($ref)) { $objp = $db->fetch_object($result); $var=!$var; + + $commandestatic->id=$objp->commandeid; + $commandestatic->ref=$objp->ref; + $commandestatic->statut=$objp->statut; print ""; - print ''.img_object($langs->trans("ShowOrder"),"order").' '; - print $objp->ref; - print "\n"; + print ''.$commandestatic->getNomUrl(1)."\n"; print ''.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).''; print "".$objp->code_client."\n"; print ""; print dol_print_date($db->jdate($objp->date_commande)).""; print "".price($objp->total_ht)."\n"; - print ''.$commandestatic->LibStatut($objp->statut,$objp->facture,5).''; + print ''.$commandestatic->getLibStatut(4).''; print "\n"; $i++; } From 65b6dca55481b1c7a402f816a8341c78ce10fbc5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 Nov 2013 13:40:33 +0100 Subject: [PATCH 4/7] Fix: business rule to protect button and action was not synchronized --- htdocs/user/param_ihm.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 54a9093bd34..44686e9277e 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2013 Laurent Destailleur * Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2013 Florian Henry * @@ -78,7 +78,7 @@ $formadmin=new FormAdmin($db); /* * Actions */ -if ($action == 'update' && ($caneditfield || $user->admin)) +if ($action == 'update' && ($caneditfield || ! empty($user->admin))) { if (! $_POST["cancel"]) { @@ -258,7 +258,7 @@ else } else { - if ($user->id == $fuser->id || ! empty($user->admin)) // Si utilisateur edite = utilisateur courant (pas besoin de droits particulier car il s'agit d'une page de modif d'output et non de données) ou si admin + if ($caneditfield || ! empty($user->admin)) // Si utilisateur edite = utilisateur courant (pas besoin de droits particulier car il s'agit d'une page de modif d'output et non de données) ou si admin { print 'id.'">'.$langs->trans("Modify").''; } From 8f9143cef7065c7b9dacbf5e405bb385b707b6e4 Mon Sep 17 00:00:00 2001 From: Florian Henry Date: Sun, 24 Nov 2013 18:07:40 +0100 Subject: [PATCH 5/7] revert param_ihm --- htdocs/core/lib/usergroups.lib.php | 11 ++++------- htdocs/user/param_ihm.php | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 41fca18e278..041234bf206 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -66,13 +66,10 @@ function user_prepare_head($object) $h++; } - //Display this tab only if can updte information - if (!empty($user->admin) || !empty($user->rights->user->self->creer)) { - $head[$h][0] = DOL_URL_ROOT.'/user/param_ihm.php?id='.$object->id; - $head[$h][1] = $langs->trans("UserGUISetup"); - $head[$h][2] = 'guisetup'; - $h++; - } + $head[$h][0] = DOL_URL_ROOT.'/user/param_ihm.php?id='.$object->id; + $head[$h][1] = $langs->trans("UserGUISetup"); + $head[$h][2] = 'guisetup'; + $h++; if (! empty($conf->clicktodial->enabled)) { diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index a6b718f83b8..54a9093bd34 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -258,7 +258,7 @@ else } else { - if (($user->id == $fuser->id || ! empty($user->admin)) && $caneditfield) // Si utilisateur edite = utilisateur courant (pas besoin de droits particulier car il s'agit d'une page de modif d'output et non de données) ou si admin + if ($user->id == $fuser->id || ! empty($user->admin)) // Si utilisateur edite = utilisateur courant (pas besoin de droits particulier car il s'agit d'une page de modif d'output et non de données) ou si admin { print 'id.'">'.$langs->trans("Modify").''; } From baebc7e91db24dba5fd6ff7238afd918d03f501c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 Nov 2013 19:33:22 +0100 Subject: [PATCH 6/7] Fix: Not coherent filename --- build/makepack-dolibarr.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 05eef72a978..6390e6c81f5 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -483,11 +483,12 @@ if ($nboftargetok) { $newbuild =~ s/(dev|alpha)/0.1.a/gi; # dev $newbuild =~ s/beta/0.2.beta1/gi; # beta $newbuild =~ s/rc./0.3.rc1/gi; # rc - if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale + if ($newbuild !~ /-/) { $newbuild.='-0.3'; } # finale #$newbuild =~ s/(dev|alpha)/0/gi; # dev #$newbuild =~ s/beta/1/gi; # beta #$newbuild =~ s/rc./2/gi; # rc #if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale + #print "newbuild=".$newbuild."\n";exit; $REL1 = $newbuild; $REL1 =~ s/-.*$//gi; if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; } print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n"; From 2178ab60076b7dfa1ea3b6189056a4d535d43278 Mon Sep 17 00:00:00 2001 From: Florian Henry Date: Wed, 27 Nov 2013 22:05:29 +0100 Subject: [PATCH 7/7] Fix [ bug #1156 ] Update TVA mass update tools do not work --- htdocs/product/admin/product_tools.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/admin/product_tools.php b/htdocs/product/admin/product_tools.php index aafe01bbb01..e3ba408bc16 100644 --- a/htdocs/product/admin/product_tools.php +++ b/htdocs/product/admin/product_tools.php @@ -107,7 +107,7 @@ if ($action == 'convert') $newlevel=$level; //print "$objectstatic->id $newprice, $price_base_type, $newvat, $newminprice, $newlevel, $newnpr
\n"; - $retm=$objectstatic->updatePrice($newprice, $price_base_type, $user, $newvat, $newminprice, $newlevel, $newnpr); + $retm=$objectstatic->updatePrice($objectstatic->id, $newprice, $price_base_type, $user, $newvat, $newminprice, $newlevel, $newnpr); if ($retm < 0) { $error++; @@ -136,7 +136,7 @@ if ($action == 'convert') if (! empty($price_base_type) && ! $updatelevel1) { //print "$objectstatic->id $newprice, $price_base_type, $newvat, $newminprice, $newlevel, $newnpr
\n"; - $ret=$objectstatic->updatePrice($newprice, $price_base_type, $user, $newvat, $newminprice, $newlevel, $newnpr); + $ret=$objectstatic->updatePrice($objectstatic->id,$newprice, $price_base_type, $user, $newvat, $newminprice, $newlevel, $newnpr); } if ($ret < 0 || $retm < 0) $error++;