Skip to content

Commit

Permalink
Merge branch '8.0' of https://github.com/Dolibarr/dolibarr.git into 8…
Browse files Browse the repository at this point in the history
….0_bug
  • Loading branch information
hregis committed Jan 18, 2019
2 parents f770323 + 45ea164 commit 6e7562b
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 9 deletions.
4 changes: 3 additions & 1 deletion htdocs/adherents/class/adherent.class.php
Expand Up @@ -219,7 +219,9 @@ function makeSubstitution($text)

// Substitutions
$substitutionarray=array(
'__CIVILITY__'=>$this->getCivilityLabel(),
'__ID__'=>$this->id,
'__MEMBER_ID__'=>$this->id,
'__CIVILITY__'=>$this->getCivilityLabel(),
'__FIRSTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
'__LASTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
'__FULLNAME__'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs),
Expand Down
2 changes: 1 addition & 1 deletion htdocs/adherents/subscription.php
Expand Up @@ -347,7 +347,7 @@
if (! $error)
{
// Send confirmation Email
if ($object->email && $sendalsoemail)
if ($object->email && $sendalsoemail) // $object is 'Adherent'
{
$subject = '';
$msg= '';
Expand Down
3 changes: 1 addition & 2 deletions htdocs/cashdesk/class/Facturation.class.php
Expand Up @@ -211,8 +211,7 @@ public function calculTotaux()
$total_localtax1 = 0;
$total_localtax2 = 0;

$tab=array();
$tab = $_SESSION['poscart'];
$tab = (! empty($_SESSION['poscart'])?$_SESSION['poscart']:array());

$tab_size=count($tab);
for($i=0;$i < $tab_size;$i++)
Expand Down
29 changes: 29 additions & 0 deletions htdocs/cashdesk/index.php
Expand Up @@ -41,6 +41,8 @@
$usertxt=GETPOST('user','',1);
$err=GETPOST("err");

// Instantiate hooks of thirdparty module only if not already define
$hookmanager->initHooks(array('cashdeskloginpage'));

/*
* View
Expand All @@ -51,6 +53,15 @@

$arrayofcss=array('/cashdesk/css/style.css');
top_htmlhead('','',0,0,'',$arrayofcss);

// Execute hook getLoginPageOptions (for table)
$parameters=array('entity' => GETPOST('entity','int'));
$reshook = $hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks.
if (is_array($hookmanager->resArray) && ! empty($hookmanager->resArray)) {
$morelogincontent = $hookmanager->resArray; // (deprecated) For compatibility
} else {
$morelogincontent = $hookmanager->resPrint;
}
?>

<body>
Expand Down Expand Up @@ -92,6 +103,24 @@
<td><input name="pwdPassword" class="texte_login" type="password" value="" /></td>
</tr>

<?php
if (! empty($morelogincontent)) {
if (is_array($morelogincontent)) {
foreach ($morelogincontent as $format => $option)
{
if ($format == 'table') {
echo '<!-- Option by hook -->';
echo $option;
}
}
}
else {
echo '<!-- Option by hook -->';
echo $morelogincontent;
}
}
?>

<tr>
<td colspan="2">
&nbsp;
Expand Down
3 changes: 1 addition & 2 deletions htdocs/cashdesk/tpl/liste_articles.tpl.php
Expand Up @@ -46,8 +46,7 @@
$societe->fetch($thirdpartyid);
/** end add Ditto */

$tab=array();
$tab = $_SESSION['poscart'];
$tab = (! empty($_SESSION['poscart'])?$_SESSION['poscart']:array());

$tab_size=count($tab);
if ($tab_size <= 0) print '<div class="center">'.$langs->trans("NoArticle").'</div><br>';
Expand Down
4 changes: 2 additions & 2 deletions htdocs/compta/facture/card.php
Expand Up @@ -1695,7 +1695,7 @@
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors');
$error++;
}
if ($prod_entry_mode == 'free' && empty($idprod) && (($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $price_ht == '') && $price_ht_devise == '') // Unit price can be 0 but not ''
if (($prod_entry_mode == 'free' && empty($idprod) && (($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $price_ht == '') && $price_ht_devise == '') && $object->type != Facture::TYPE_CREDIT_NOTE) // Unit price can be 0 but not ''
{
if ($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
{
Expand Down Expand Up @@ -2155,7 +2155,7 @@
setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors');
$error++;
}
if (empty($productid) && (($pu_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $pu_ht == '') && $pu_ht_devise == '') // Unit price can be 0 but not ''
if ((empty($productid) && (($pu_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $pu_ht == '') && $pu_ht_devise == '') && $object->type != Facture::TYPE_CREDIT_NOTE) // Unit price can be 0 but not ''
{
if ($pu_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/facture/class/paymentterm.class.php
Expand Up @@ -164,7 +164,7 @@ function fetch($id)
global $langs;
$sql = "SELECT";
$sql.= " t.rowid,";
$sql.= " t.entity";
$sql.= " t.entity,";

$sql.= " t.code,";
$sql.= " t.sortorder,";
Expand Down

0 comments on commit 6e7562b

Please sign in to comment.