Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/api/class/api_login.class.php
	htdocs/dav/fileserver.php
This commit is contained in:
Laurent Destailleur 2019-08-22 12:45:23 +02:00
commit 3339f89fc5
9 changed files with 48 additions and 33 deletions

View File

@ -62,11 +62,7 @@ class Login
// TODO Remove the API login. The token must be generated from backoffice only.
// Authentication mode
if (empty($dolibarr_main_authentication))
$dolibarr_main_authentication = 'http,dolibarr';
// this is manage directly in the module with $context parameters
//$dolibarr_main_authentication = preg_replace('/twofactor/', 'dolibarr', $dolibarr_main_authentication);
if (empty($dolibarr_main_authentication)) $dolibarr_main_authentication = 'dolibarr';
// Authentication mode: forceuser
if ($dolibarr_main_authentication == 'forceuser')

View File

@ -312,7 +312,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
$reshook = $hookmanager->executeHooks('printObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if(empty($reshook)){
print $hookmanager->resPrint;
$solde = isset($hookmanager->resArray['solde']) ? $hookmanager->resArray['solde'] : $solde;
$solde = isset($hookmanager->resArray['solde']) ? $hookmanager->resArray['solde'] : $solde;
}
// solde

View File

@ -744,6 +744,9 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
}
print "</td>";
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $objp, $action); // Note that $action and $object may have been modified by hook
// Warning
print '<td align="center" width="16">';
//print "xx".$amounts[$invoice->id]."-".$amountsresttopay[$invoice->id]."<br>";
@ -754,9 +757,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
}
print '</td>';
$parameters=array();
$reshook=$hookmanager->executeHooks('printObjectLine', $parameters, $objp, $action); // Note that $action and $object may have been modified by hook
print "</tr>\n";
$total+=$objp->total;
@ -893,12 +893,13 @@ if (! GETPOST('action', 'aZ09'))
print '<td><a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$objp->facid.'">'.$objp->ref."</a></td>\n";
print '<td>'.dol_print_date($db->jdate($objp->dp))."</td>\n";
print '<td>'.$objp->paiement_type.' '.$objp->num_paiement."</td>\n";
print '<td class="right">'.price($objp->amount).'</td><td>&nbsp;</td>';
$parameters=array();
$reshook=$hookmanager->executeHooks('printObjectLine', $parameters, $objp, $action); // Note that $action and $object may have been modified by hook
print '<td class="right">'.price($objp->amount).'</td>';
print '<td>&nbsp;</td>';
print '</tr>';
$parameters=array();
$reshook=$hookmanager->executeHooks('printObjectLine', $parameters, $objp, $action); // Note that $action and $object may have been modified by hook
$i++;
}
print '</table>';

View File

@ -172,7 +172,8 @@ function societe_prepare_head(Societe $object)
}
// Related items
if (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->ficheinter->enabled) || ! empty($conf->fournisseur->enabled))
if ((! empty($conf->commande->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->ficheinter->enabled) || ! empty($conf->fournisseur->enabled))
&& empty($conf->global->THIRPARTIES_DISABLE_RELATED_OBJECT_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Referers");

View File

@ -1230,7 +1230,7 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
}
if ($popuptab) $outmore.='</div>';
if ($displaytab > $limittoshow)
if ($popuptab) // If there is some tabs not shown
{
$left=($langs->trans("DIRECTION") == 'rtl'?'right':'left');
$right=($langs->trans("DIRECTION") == 'rtl'?'left':'right');

View File

@ -47,10 +47,10 @@ function dol_getwebuser($mode)
* @param string $passwordtotest Password value to test
* @param string $entitytotest Instance of data we must check
* @param array $authmode Array list of selected authentication mode array('http', 'dolibarr', 'xxx'...)
* @param string $context Context checkLoginPassEntity was created for ('api', 'dav', ...)
* @param string $context Context checkLoginPassEntity was created for ('api', 'dav', '')
* @return string Login or ''
*/
function checkLoginPassEntity($usertotest, $passwordtotest, $entitytotest, $authmode, $context = null)
function checkLoginPassEntity($usertotest, $passwordtotest, $entitytotest, $authmode, $context = '')
{
global $conf,$langs;
//global $dolauthmode; // To return authentication finally used

View File

@ -106,9 +106,6 @@ $authBackend = new \Sabre\DAV\Auth\Backend\BasicCallBack(function ($username, $p
// Authentication mode
if (empty($dolibarr_main_authentication)) $dolibarr_main_authentication='dolibarr';
// this is manage directly in the module with $context parameters
//$dolibarr_main_authentication = preg_replace('/twofactor/', 'dolibarr', $dolibarr_main_authentication);
// Authentication mode: forceuser
if ($dolibarr_main_authentication == 'forceuser')
{

View File

@ -810,12 +810,16 @@ SCRIPT;
print_liste_field_titre("BarcodeType", $_SERVER["PHP_SELF"], "pfp.fk_barcode_type", "", $param, '', $sortfield, $sortorder, 'center ');
}
print_liste_field_titre("DateModification", $_SERVER["PHP_SELF"], "pfp.tms", "", $param, '', $sortfield, $sortorder, 'right ');
if (is_object($hookmanager))
{
$parameters=array('id_fourn'=>$id_fourn, 'prod_id'=>$object->id);
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action);
}
print_liste_field_titre('');
print "</tr>\n";
if (is_array($product_fourn_list))
{
foreach($product_fourn_list as $productfourn)
{
print '<tr class="oddeven">';
@ -923,7 +927,7 @@ SCRIPT;
if (is_object($hookmanager))
{
$parameters=array('id_pfp'=>$productfourn->product_fourn_price_id,'id_fourn'=>$id_fourn,'prod_id'=>$object->id);
$reshook=$hookmanager->executeHooks('printObjectLine', $parameters, $object, $action);
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action);
}
// Modify-Remove

View File

@ -817,9 +817,11 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
if ($facture->type == 2) { $remaindertopay=$langs->trans("RemainderToPayBack"); $multicurrencyremaindertopay=$langs->trans("MulticurrencyRemainderToPayBack"); }
$i = 0;
//print '<tr><td colspan="3">';
print '<br>';
print_barre_liste($langs->trans('StripeInvoiceList').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, '', '');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$arraytitle.'</td>';
@ -837,7 +839,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
if (!empty($conf->multicurrency->enabled)) {
print '<td class="right">'.$langs->trans('MulticurrencyPaymentAmount').'</td>';
}
print '<td class="right">&nbsp;</td>';
$tmpinvoice =new Facture($db);
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $tmpinvoice, $action); // Note that $action and $object may have been modified by hook
print '<td align="right">&nbsp;</td>';
print "</tr>\n";
$total=0;
@ -967,6 +974,9 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print "</td>";
}
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $objp, $action); // Note that $action and $object may have been modified by hook
// Warning
print '<td class="center" width="16">';
//print "xx".$amounts[$invoice->id]."-".$amountsresttopay[$invoice->id]."<br>";
@ -977,9 +987,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
}
print '</td>';
$parameters=array();
$reshook=$hookmanager->executeHooks('printObjectLine', $parameters, $objp, $action); // Note that $action and $object may have been modified by hook
print "</tr>\n";
$total+=$objp->total;
@ -991,7 +998,8 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
}
if ($i > 1)
{
$amount=round(price($sign * price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits, 'MT'))*100);
$amount=round(price($sign * price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits, 'MT'))*100);
// Print total
print '<tr class="liste_total">';
print '<td colspan="2" class="left">'.$langs->trans('TotalTTC').'</td>';
@ -1010,6 +1018,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
if (!empty($conf->multicurrency->enabled)) {
print '<td class="right" id="multicurrency_result" style="font-weight: bold;"></td>';
}
print '<td></td>';
print "</tr>\n";
}
print "</table>";
@ -1106,22 +1115,29 @@ if (! GETPOST('action'))
print_liste_field_titre('Date', $_SERVER["PHP_SELF"], 'dp', '', '', '', $sortfield, $sortorder);
print_liste_field_titre('Type', $_SERVER["PHP_SELF"], 'libelle', '', '', '', $sortfield, $sortorder);
print_liste_field_titre('Amount', $_SERVER["PHP_SELF"], 'fa_amount', '', '', '', $sortfield, $sortorder, 'right ');
$tmpobject = new Paiement($db);
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $tmpobject, $action); // Note that $action and $object may have been modified by hook
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
print "</tr>\n";
print "</tr>\n";
while ($i < min($num, $limit))
{
$objp = $db->fetch_object($resql);
print '<tr class="oddeven">';
print '<td><a href="'.DOL_URL_ROOT.'compta/facture/card.php?facid='.$objp->facid.'">'.$objp->ref."</a></td>\n";
print '<td>'.dol_print_date($db->jdate($objp->dp))."</td>\n";
print '<td>'.$objp->paiement_type.' '.$objp->num_paiement."</td>\n";
print '<td class="right">'.price($objp->amount).'</td><td>&nbsp;</td>';
print '<td class="right">'.price($objp->amount).'</td>';
$parameters=array();
$reshook=$hookmanager->executeHooks('printObjectLine', $parameters, $objp, $action); // Note that $action and $object may have been modified by hook
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $objp, $action); // Note that $action and $object may have been modified by hook
print '</tr>';
print '<td>&nbsp;</td>';
print '</tr>';
$i++;
}
print '</table>';