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

This commit is contained in:
Laurent Destailleur 2020-05-15 14:11:13 +02:00
commit 0f403ba9ea
20 changed files with 80 additions and 52 deletions

View File

@ -8,7 +8,7 @@ CACHE MANIFEST
# Files listed under CACHE will be ALWAYS cached after they are loaded. # Files listed under CACHE will be ALWAYS cached after they are loaded.
# And they will be always used from Cache after (even after refresh). # And they will be always used from Cache after (even after refresh).
CACHE: CACHE:
theme/dolibarr_logo.png theme/dolibarr_logo.svg
support/ support/
support/index.php support/index.php

View File

@ -672,27 +672,27 @@ if (!empty($date_start) && !empty($date_stop))
} elseif ($data['item'] == 'ExpenseReport') { } elseif ($data['item'] == 'ExpenseReport') {
$expensereport->id = $data['id']; $expensereport->id = $data['id'];
$expensereport->ref = $data['ref']; $expensereport->ref = $data['ref'];
print $expensereport->getNomUrl(1, '', 0, 0, '', 0, 0, 0); print $expensereport->getNomUrl(1, 0, 0, '', 0, 0);
} elseif ($data['item'] == 'SalaryPayment') { } elseif ($data['item'] == 'SalaryPayment') {
$salary_payment->id = $data['id']; $salary_payment->id = $data['id'];
$salary_payment->ref = $data['ref']; $salary_payment->ref = $data['ref'];
print $salary_payment->getNomUrl(1, '', 0, 0, '', 0, 0, 0); print $salary_payment->getNomUrl(1, '', 0, '', 0);
} elseif ($data['item'] == 'Donation') { } elseif ($data['item'] == 'Donation') {
$don->id = $data['id']; $don->id = $data['id'];
$don->ref = $data['ref']; $don->ref = $data['ref'];
print $don->getNomUrl(1, '', 0, 0, '', 0, 0, 0); print $don->getNomUrl(1, 0, '', 0);
} elseif ($data['item'] == 'SocialContributions') { } elseif ($data['item'] == 'SocialContributions') {
$charge_sociales->id = $data['id']; $charge_sociales->id = $data['id'];
$charge_sociales->ref = $data['ref']; $charge_sociales->ref = $data['ref'];
print $charge_sociales->getNomUrl(1, '', 0, 0, '', 0, 0, 0); print $charge_sociales->getNomUrl(1, 0, 0, 0, 0);
} elseif ($data['item'] == 'VariousPayment') { } elseif ($data['item'] == 'VariousPayment') {
$various_payment->id = $data['id']; $various_payment->id = $data['id'];
$various_payment->ref = $data['ref']; $various_payment->ref = $data['ref'];
print $various_payment->getNomUrl(1, '', 0, 0, '', 0, 0, 0); print $various_payment->getNomUrl(1, '', 0, 0);
} elseif ($data['item'] == 'LoanPayment') { } elseif ($data['item'] == 'LoanPayment') {
$payment_loan->id = $data['id']; $payment_loan->id = $data['id'];
$payment_loan->ref = $data['ref']; $payment_loan->ref = $data['ref'];
print $payment_loan->getNomUrl(1, '', 0, 0, '', 0, 0, 0); print $payment_loan->getNomUrl(1, 0, 0, '', 0);
} else { } else {
print $data['ref']; print $data['ref'];
} }

View File

@ -328,6 +328,8 @@ class Interfaces
continue; continue;
} }
$text = '';
try { try {
$objMod = new $modName($db); $objMod = new $modName($db);

View File

@ -230,8 +230,8 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $
} elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) {
$urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$mysoc->logo); $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$mysoc->logo);
$width = 150; $width = 150;
} elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png')) { } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) {
$urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.png'; $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg';
} }
} }
} }
@ -254,7 +254,7 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $
} }
print '</div>'; print '</div>';
if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
print '<div class="poweredbypublicpayment opacitymedium right"><a href="https://www.dolibarr.org" target="dolibarr">'.$langs->trans("PoweredBy").'<br><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.png" width="80px"></a></div>'; print '<div class="poweredbypublicpayment opacitymedium right"><a href="https://www.dolibarr.org" target="dolibarr">'.$langs->trans("PoweredBy").'<br><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
} }
print '</div>'; print '</div>';
} }

View File

@ -470,15 +470,15 @@ class DataPolicyCron
{ {
$sql = sprintf($params['sql'], (int) $conf->entity, (int) $conf->global->$key, (int) $conf->global->$key); $sql = sprintf($params['sql'], (int) $conf->entity, (int) $conf->global->$key, (int) $conf->global->$key);
$resql = $db->query($sql); $resql = $this->db->query($sql);
if ($resql && $db->num_rows($resql) > 0) if ($resql && $this->db->num_rows($resql) > 0)
{ {
$num = $db->num_rows($resql); $num = $this->db->num_rows($resql);
$i = 0; $i = 0;
require_once $params['file']; require_once $params['file'];
$object = new $params['class']($db); $object = new $params['class']($this->db);
while ($i < $num && !$error) while ($i < $num && !$error)
{ {

View File

@ -916,11 +916,13 @@ class Don extends CommonObject
/** /**
* Return clicable name (with picto eventually) * Return clicable name (with picto eventually)
* *
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param int $notooltip 1=Disable tooltip * @param int $notooltip 1=Disable tooltip
* @return string Chaine avec URL * @param string $moretitle Add more text to title tooltip
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string Chaine avec URL
*/ */
public function getNomUrl($withpicto = 0, $notooltip = 0) public function getNomUrl($withpicto = 0, $notooltip = 0, $moretitle = '', $save_lastsearch_value = -1)
{ {
global $conf, $langs; global $conf, $langs;
@ -928,10 +930,18 @@ class Don extends CommonObject
$result = ''; $result = '';
$label = '<u>'.$langs->trans("Donation").'</u>'; $label = '<u>'.$langs->trans("Donation").'</u>';
if (!empty($this->id)) if (!empty($this->id)) {
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->id; $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->id;
}
if ($moretitle) $label .= ' - '.$moretitle;
$linkstart = '<a href="'.DOL_URL_ROOT.'/don/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; $url = DOL_URL_ROOT.'/don/card.php?id='.$this->id;
$add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1;
if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1';
$linkstart = '<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend = '</a>'; $linkend = '</a>';
$result .= $linkstart; $result .= $linkstart;

View File

@ -507,25 +507,39 @@ class PaymentLoan extends CommonObject
/** /**
* Return clicable name (with eventually a picto) * Return clicable name (with eventually a picto)
* *
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=No picto * @param int $withpicto 0=No picto, 1=Include picto into link, 2=No picto
* @param int $maxlen Max length label * @param int $maxlen Max length label
* @return string Chaine with URL * @param int $notooltip 1=Disable tooltip
* @param string $moretitle Add more text to title tooltip
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string String with URL
*/ */
public function getNomUrl($withpicto = 0, $maxlen = 0) public function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0, $moretitle = '', $save_lastsearch_value = -1)
{ {
global $langs; global $langs, $conf;
if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
$result = ''; $result = '';
$label = '<u>'.$langs->trans("Loan").'</u>';
if (!empty($this->id)) if (!empty($this->id)) {
{ $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->id;
$link = '<a href="'.DOL_URL_ROOT.'/loan/payment/card.php?id='.$this->id.'">';
$linkend = '</a>';
if ($withpicto) $result .= ($link.img_object($langs->trans("ShowPayment").': '.$this->ref, 'payment').$linkend.' ');
if ($withpicto && $withpicto != 2) $result .= ' ';
if ($withpicto != 2) $result .= $link.($maxlen ?dol_trunc($this->ref, $maxlen) : $this->ref).$linkend;
} }
if ($moretitle) $label .= ' - '.$moretitle;
$url = DOL_URL_ROOT.'/loan/payment/card.php?id='.$this->id;
$add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1;
if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1';
$linkstart = '<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend = '</a>';
$result .= $linkstart;
if ($withpicto) $result .= img_object(($notooltip ? '' : $label), $this->picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
if ($withpicto != 2) $result .= $this->ref;
$result .= $linkend;
return $result; return $result;
} }

View File

@ -440,7 +440,7 @@ class MyObject extends CommonObject
if ($resql) { if ($resql) {
$num = $this->db->num_rows($resql); $num = $this->db->num_rows($resql);
$i = 0; $i = 0;
while ($i < min($limit, $num)) while ($i < ($limit ? min($limit, $num) : $num))
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);

View File

@ -121,7 +121,7 @@ function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $
print '>'; print '>';
print '</div>'; print '</div>';
if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
print '<div class="poweredbypublicpayment opacitymedium right"><a href="https://www.dolibarr.org" target="dolibarr">'.$langs->trans("PoweredBy").'<br><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.png" width="80px"></a></div>'; print '<div class="poweredbypublicpayment opacitymedium right"><a href="https://www.dolibarr.org" target="dolibarr">'.$langs->trans("PoweredBy").'<br><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
} }
print '</div>'; print '</div>';
} }

View File

@ -1015,7 +1015,7 @@ class Product extends CommonObject
$sql .= ", volume = ".($this->volume != '' ? "'".$this->db->escape($this->volume)."'" : 'null'); $sql .= ", volume = ".($this->volume != '' ? "'".$this->db->escape($this->volume)."'" : 'null');
$sql .= ", volume_units = ".($this->volume_units != '' ? "'".$this->db->escape($this->volume_units)."'" : 'null'); $sql .= ", volume_units = ".($this->volume_units != '' ? "'".$this->db->escape($this->volume_units)."'" : 'null');
$sql .= ", fk_default_warehouse = ".($this->fk_default_warehouse > 0 ? $this->db->escape($this->fk_default_warehouse) : 'null'); $sql .= ", fk_default_warehouse = ".($this->fk_default_warehouse > 0 ? $this->db->escape($this->fk_default_warehouse) : 'null');
$sql .= ", seuil_stock_alerte = ".((isset($this->seuil_stock_alerte) && $this->seuil_stock_alerte != '') ? "'".$this->db->escape($this->seuil_stock_alerte)."'" : "null"); $sql .= ", seuil_stock_alerte = ".((isset($this->seuil_stock_alerte) && is_numeric($this->seuil_stock_alerte)) ? (int) $this->seuil_stock_alerte : 'null');
$sql .= ", description = '".$this->db->escape($this->description)."'"; $sql .= ", description = '".$this->db->escape($this->description)."'";
$sql .= ", url = ".($this->url ? "'".$this->db->escape($this->url)."'" : 'null'); $sql .= ", url = ".($this->url ? "'".$this->db->escape($this->url)."'" : 'null');
$sql .= ", customcode = '".$this->db->escape($this->customcode)."'"; $sql .= ", customcode = '".$this->db->escape($this->customcode)."'";

View File

@ -105,8 +105,11 @@ img.demothumb {
object-fit: contain; object-fit: contain;
height: 140px; height: 140px;
background-position-y: bottom; background-position-y: bottom;
background-position-x: right;
}
.demologo {
width: 200px;
} }
@media only screen and (max-width: 767px) @media only screen and (max-width: 767px)
{ {

View File

@ -274,13 +274,13 @@ print "\n";
print '<div class="demoban demobackground">'; print '<div class="demoban demobackground">';
print '<div class="right" style="padding-right: 30px; padding-top: 30px;">'; print '<div class="right" style="padding-right: 30px; padding-top: 30px;">';
print '<a alt="Official portal of your ERP CRM application" targe="_blank" href="https://www.dolibarr.org"><img class="demologo" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.png" alt="Dolibarr logo"></a>'; print '<a alt="Official portal of your ERP CRM application" targe="_blank" href="https://www.dolibarr.org"><img class="demologo" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" alt="Dolibarr logo"></a>';
print '</div>'; print '</div>';
print '</div>'; print '</div>';
print '<div class="demobantext" style="max-width: 1024px;">'; print '<div class="demobantext" style="max-width: 1024px;">';
print '<div style="font-size: 20px; padding: 40px;">'; print '<div style="font-size: 20px; padding: 40px;">';
print '<div style="text-align: justify;">'.$langs->trans("DemoDesc").'</div><br>'; print '<div class="hideonsmartphone" style="text-align: justify;">'.$langs->trans("DemoDesc").'</div><br>';
print '<div class="titre"><font style="font-size: 20px">'.$langs->trans("ChooseYourDemoProfil").'</font></div>'; print '<div class="titre"><font style="font-size: 20px">'.$langs->trans("ChooseYourDemoProfil").'</font></div>';
print '</div>'; print '</div>';
print '</div>'; print '</div>';

View File

@ -113,9 +113,9 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $
$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/'.$mysoc->logo); $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/'.$mysoc->logo);
$width = 150; $width = 150;
} }
elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png')) elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg'))
{ {
$urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.png'; $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg';
$width = 150; $width = 150;
} }
@ -130,7 +130,7 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $
print '>'; print '>';
print '</div>'; print '</div>';
if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
print '<div class="poweredbypublicpayment opacitymedium right"><a href="https://www.dolibarr.org" target="dolibarr">'.$langs->trans("PoweredBy").'<br><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.png" width="80px"></a></div>'; print '<div class="poweredbypublicpayment opacitymedium right"><a href="https://www.dolibarr.org" target="dolibarr">'.$langs->trans("PoweredBy").'<br><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
} }
print '</div>'; print '</div>';
} }

View File

@ -191,7 +191,7 @@ if ($urllogo)
print '>'; print '>';
print '</div>'; print '</div>';
if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
print '<div class="poweredbypublicpayment opacitymedium right"><a href="https://www.dolibarr.org" target="dolibarr">'.$langs->trans("PoweredBy").'<br><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.png" width="80px"></a></div>'; print '<div class="poweredbypublicpayment opacitymedium right"><a href="https://www.dolibarr.org" target="dolibarr">'.$langs->trans("PoweredBy").'<br><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
} }
print '</div>'; print '</div>';
} }

View File

@ -793,7 +793,7 @@ if ($urllogo)
print '>'; print '>';
print '</div>'; print '</div>';
if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
print '<div class="poweredbypublicpayment opacitymedium right"><a href="https://www.dolibarr.org" target="dolibarr">'.$langs->trans("PoweredBy").'<br><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.png" width="80px"></a></div>'; print '<div class="poweredbypublicpayment opacitymedium right"><a href="https://www.dolibarr.org" target="dolibarr">'.$langs->trans("PoweredBy").'<br><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
} }
print '</div>'; print '</div>';
} }

View File

@ -245,7 +245,7 @@ if ($urllogo)
print '>'; print '>';
print '</div>'; print '</div>';
if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
print '<div class="poweredbypublicpayment opacitymedium right"><a href="https://www.dolibarr.org" target="dolibarr">'.$langs->trans("PoweredBy").'<br><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.png" width="80px"></a></div>'; print '<div class="poweredbypublicpayment opacitymedium right"><a href="https://www.dolibarr.org" target="dolibarr">'.$langs->trans("PoweredBy").'<br><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
} }
print '</div>'; print '</div>';
} }

View File

@ -181,7 +181,7 @@ if ($urllogo)
print '>'; print '>';
print '</div>'; print '</div>';
if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
print '<div class="poweredbypublicpayment opacitymedium right"><a href="https://www.dolibarr.org" target="dolibarr">'.$langs->trans("PoweredBy").'<br><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.png" width="80px"></a></div>'; print '<div class="poweredbypublicpayment opacitymedium right"><a href="https://www.dolibarr.org" target="dolibarr">'.$langs->trans("PoweredBy").'<br><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
} }
print '</div>'; print '</div>';
} }

View File

@ -34,7 +34,6 @@ $WS_DOL_URL_WSDL = 'https://ec.europa.eu/taxation_customs/vies/checkVatService.w
$WS_METHOD = 'checkVat'; $WS_METHOD = 'checkVat';
$conf->dol_hide_topmenu = 1; $conf->dol_hide_topmenu = 1;
$conf->dol_hide_leftmenu = 1; $conf->dol_hide_leftmenu = 1;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -192,13 +192,13 @@ elseif (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'
$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/'.$mysoc->logo); $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/'.$mysoc->logo);
$width = 128; $width = 128;
} }
elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.png')) elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.svg'))
{ {
$urllogo = DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.png'; $urllogo = DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.svg';
} }
elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png')) elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg'))
{ {
$urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.png'; $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg';
} }
// Security graphical code // Security graphical code