Skip to content

Commit

Permalink
Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into develop
Browse files Browse the repository at this point in the history
Conflicts:
	htdocs/user/card.php
  • Loading branch information
eldy committed Aug 26, 2017
2 parents 271d0c8 + 08da8ef commit c573df4
Show file tree
Hide file tree
Showing 26 changed files with 217 additions and 129 deletions.
31 changes: 31 additions & 0 deletions ChangeLog
Expand Up @@ -158,6 +158,37 @@ content by doing a print into function, sometimes by returning content into "res
hook specifications so you must return output into "resprint".


***** ChangeLog for 5.0.5 compared to 5.0.4 *****
FIX: #7075 : bad path for document
FIX: #7156
FIX: #7173
FIX: #7224
FIX: #7226
FIX: #7239
FIX: add supplierproposaldet without price (new product)
FIX: amount overlap other amount when a pagebreak is done due to an image at the bottom of page.
FIX: Bad tax calculation with expense report
FIX: Best buy price calculation
FIX: Buying prices must always be in positive value.
FIX: calculate correct remain to pay for planned bank transactions
FIX: delete linked element on facture rec
FIX: edit sociale was emptying label
FIX: Error when updating thirdparty not returned
FIX: holidays with postgresql like on rowid integer
FIX: id of user not saved when making a payment of expense report
FIX: invoice page list
FIX: invoice situation VAT total rounding into PDF crabe
FIX: PgSQL compatibility.
FIX: remove order rights on invoice page
FIX: status were wrong on product referent list
FIX: supplier id was not passed to hooks
FIX: Support of vat code when using price per customer
FIX: User id correction on holiday request
FIX: value of user id filled to 0 in llx_bank_url when recording an expense report.
FIX: we have to check if contact doesn't already exist on add_contact() function
FIX: We should be able to insert data with value '0' into const
FIX: install process with DoliWamp

***** ChangeLog for 5.0.4 compared to 5.0.3 *****
FIX: #5640 Prices of a predefined product/service were incorrect under certain circumstances
FIX: #6541 since 4.0.4 to 5.0.0 autofill zip/town not working
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/journal/bankjournal.php
Expand Up @@ -4,7 +4,7 @@
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/journal/expensereportsjournal.php
Expand Up @@ -2,7 +2,7 @@
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/journal/purchasesjournal.php
Expand Up @@ -2,7 +2,7 @@
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/journal/sellsjournal.php
Expand Up @@ -2,7 +2,7 @@
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
Expand Down
8 changes: 6 additions & 2 deletions htdocs/comm/action/card.php
Expand Up @@ -577,6 +577,11 @@

}

// Actions to delete doc
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref);
$permissioncreate = ($user->rights->agenda->allactions->delete || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->delete));
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';


/*
* View
Expand Down Expand Up @@ -1212,7 +1217,6 @@ function init_repeat()
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep,'%Y').'&month='.dol_print_date($object->datep,'%m').'&day='.dol_print_date($object->datep,'%d').'">'.$langs->trans("ViewDay").'</a>';
$linkback.=$out;


$morehtmlref='<div class="refidno">';
// Thirdparty
//$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
Expand Down Expand Up @@ -1477,7 +1481,7 @@ function init_repeat()
*/

$filedir=$conf->agenda->multidir_output[$conf->entity].'/'.$object->id;
$urlsource=$_SERVER["PHP_SELF"]."?socid=".$object->id;
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;

$genallowed=$user->rights->agenda->myactions->create;
$delallowed=$user->rights->agenda->myactions->delete;
Expand Down
16 changes: 7 additions & 9 deletions htdocs/compta/bank/document.php
Expand Up @@ -3,7 +3,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
*
* 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
Expand Down Expand Up @@ -62,9 +62,7 @@
$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;
Expand Down Expand Up @@ -122,21 +120,21 @@
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/index.php">'.$langs->trans("BackToList").'</a>';

dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);


print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';

print '<table class="border" width="100%">';
print '<tr><td class="titlefield">' . $langs->trans("NbOfAttachedFiles") . '</td><td colspan="3">' . count($filearray) . '</td></tr>';
print '<tr><td>' . $langs->trans("TotalSizeOfAttachedFiles") . '</td><td colspan="3">' . $totalsize . ' ' . $langs->trans("bytes") . '</td></tr>';
print "</table>\n";

print '</div>';

dol_fiche_end();


$modulepart = 'bank';
$permission = $user->rights->banque->modifier;
$permtoedit = $user->rights->banque->modifier;
Expand Down
13 changes: 7 additions & 6 deletions htdocs/compta/facture/card.php
Expand Up @@ -664,12 +664,13 @@
if ($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT || $object->type == Facture::TYPE_SITUATION)
{
// If we're on a standard invoice, we have to get excess received to create a discount in TTC without VAT

$sql = 'SELECT SUM(pf.amount) as total_paiements
FROM llx_c_paiement as c, llx_paiement_facture as pf, llx_paiement as p
WHERE pf.fk_facture = '.$object->id.' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid ORDER BY p.datep, p.tms';
WHERE pf.fk_facture = '.$object->id.' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid';

$resql = $db->query($sql);
if (! $resql) dol_print_error($db);

$res = $db->fetch_object($resql);
$total_paiements = $res->total_paiements;

Expand Down Expand Up @@ -4128,11 +4129,11 @@
if ($objectidnext) {
print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseReplacedInvoice") . '">' . $langs->trans('DoPayment') . '</span></div>';
} else {
if ($resteapayer == 0) {
print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseRemainderToPayIsZero") . '">' . $langs->trans('DoPayment') . '</span></div>';
} else {
//if ($resteapayer == 0) {
// print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseRemainderToPayIsZero") . '">' . $langs->trans('DoPayment') . '</span></div>';
//} else {
print '<div class="inline-block divButAction"><a class="butAction" href="'. DOL_URL_ROOT .'/compta/paiement.php?facid=' . $object->id . '&amp;action=create&amp;accountid='.$object->fk_account.'">' . $langs->trans('DoPayment') . '</a></div>';
}
//}
}
}

Expand Down
40 changes: 20 additions & 20 deletions htdocs/contact/agenda.php
Expand Up @@ -211,7 +211,7 @@
dol_fiche_head($head, 'agenda', $title, -1, 'contact');

$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';

$morehtmlref='<div class="refidno">';
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
{
Expand All @@ -223,42 +223,42 @@
else $morehtmlref.=$langs->trans("ContactNotLinkedToCompany");
}
$morehtmlref.='</div>';

dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);

print '<div class="fichecenter">';

print '<div class="underbanner clearboth"></div>';

$object->info($id);
print dol_print_object_info($object, 1);

print '</div>';

print dol_fiche_end();


// Actions buttons

$objcon=$object;
$object->fetch_thirdparty();
$objthirdparty=$object->thirdparty;

$out='';
$permok=$user->rights->agenda->myactions->create;
if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok)
{
//$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
if (get_class($objthirdparty) == 'Societe') $out.='&amp;socid='.$objthirdparty->id;
if (is_object($objthirdparty) && get_class($objthirdparty) == 'Societe') $out.='&amp;socid='.$objthirdparty->id;
$out.=(! empty($objcon->id)?'&amp;contactid='.$objcon->id:'').'&amp;backtopage=1&amp;percentage=-1';
//$out.=$langs->trans("AddAnAction").' ';
//$out.=img_picto($langs->trans("AddAnAction"),'filenew');
//$out.="</a>";
}


print '<div class="tabsAction">';

if (! empty($conf->agenda->enabled))
{
if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create))
Expand All @@ -270,22 +270,22 @@
print '<a class="butActionRefused" href="#">'.$langs->trans("AddAction").'</a>';
}
}

print '</div>';

if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
{
$param='&id='.$id;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;


print load_fiche_titre($langs->trans("TasksHistoryForThisContact"),'','');

// List of all actions
$filters=array();
$filters['search_agenda_label']=$search_agenda_label;

show_actions_done($conf,$langs,$db,$objthirdparty,$object,0,$actioncode, '', $filters, $sortfield, $sortorder);
}
}
Expand Down
5 changes: 3 additions & 2 deletions htdocs/core/class/dolgraph.class.php
Expand Up @@ -25,7 +25,7 @@

/**
* Class to build graphs.
* Usage is:
* Usage is:
* $dolgraph=new DolGraph();
* $dolgraph->SetTitle($langs->transnoentities('Tracking_Projects_Pourcent').'<br>'.$langs->transnoentities('Tracking_IndicatorDefGraph').'%');
* $dolgraph->SetMaxValue(50);
Expand Down Expand Up @@ -570,6 +570,7 @@ function GetCeilMaxValue()
function GetFloorMinValue()
{
$min = $this->GetMinValueInData();
if ($min == '') $min=0;
if ($min != 0) $min--;
$size=dol_strlen(abs(floor($min)));
$factor=1;
Expand Down Expand Up @@ -868,7 +869,7 @@ private function draw_jflot($file,$fileurl)
return;
}
$this->stringtoshow.='<div id="placeholder_'.$tag.'" style="width:'.$this->width.'px;height:'.$this->height.'px;" class="dolgraph'.(empty($this->cssprefix)?'':' dolgraph'.$this->cssprefix).'"></div>'."\n";

$this->stringtoshow.='<script id="'.$tag.'">'."\n";
$this->stringtoshow.='$(function () {'."\n";
$i=$firstlot;
Expand Down
26 changes: 13 additions & 13 deletions htdocs/core/lib/company.lib.php
Expand Up @@ -1043,7 +1043,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
global $param;

// Check parameters
if (! is_object($filterobj)) dol_print_error('','BadParameter');
if (! is_object($filterobj) && ! is_object($objcon)) dol_print_error('','BadParameter');

$out='';
$histo=array();
Expand All @@ -1061,24 +1061,24 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$sql.= " a.fk_user_author, a.fk_contact,";
$sql.= " c.code as acode, c.libelle as alabel, c.picto as apicto,";
$sql.= " u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname";
if (get_class($filterobj) == 'Societe') $sql.= ", sp.lastname, sp.firstname";
if (get_class($filterobj) == 'Adherent') $sql.= ", m.lastname, m.firstname";
if (get_class($filterobj) == 'CommandeFournisseur') $sql.= ", o.ref";
if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql.= ", sp.lastname, sp.firstname";
if (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql.= ", m.lastname, m.firstname";
if (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", o.ref";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id";
if (get_class($filterobj) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
if (get_class($filterobj) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
if (get_class($filterobj) == 'CommandeFournisseur') $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as o";
if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
if (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
if (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as o";
$sql.= " WHERE u.rowid = a.fk_user_action";
$sql.= " AND a.entity IN (".getEntity('agenda').")";
if (get_class($filterobj) == 'Societe' && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id;
if (get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id;
if (get_class($filterobj) == 'Adherent')
if (is_object($filterobj) && get_class($filterobj) == 'Societe' && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id;
if (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id;
if (is_object($filterobj) && get_class($filterobj) == 'Adherent')
{
$sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'";
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
}
if (get_class($filterobj) == 'CommandeFournisseur')
if (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur')
{
$sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'order_supplier'";
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
Expand Down Expand Up @@ -1239,15 +1239,15 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$facturestatic=new Facture($db);

$out.='<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
if ($objcon && get_class($objcon) == 'Contact' && get_class($filterobj) == 'Societe')
if ($objcon && get_class($objcon) == 'Contact' && $filterobj && get_class($filterobj) == 'Societe')
{
$out.='<input type="hidden" name="id" value="'.$objcon->id.'" />';
}
else
{
$out.='<input type="hidden" name="id" value="'.$filterobj->id.'" />';
}
if (get_class($filterobj) == 'Societe') $out.='<input type="hidden" name="socid" value="'.$filterobj->id.'" />';
if ($filterobj && get_class($filterobj) == 'Societe') $out.='<input type="hidden" name="socid" value="'.$filterobj->id.'" />';

$out.="\n";

Expand Down

0 comments on commit c573df4

Please sign in to comment.