Skip to content

Commit

Permalink
Merge branch '3.7' of git@github.com:Dolibarr/dolibarr.git into 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Aug 29, 2015
2 parents 17b69e1 + a7d1a35 commit a3d612a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 24 deletions.
4 changes: 2 additions & 2 deletions htdocs/compta/salaries/index.php
Expand Up @@ -168,7 +168,7 @@
// Type
print '<td>'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.'</td>';
// Amount
print "<td align=\"right\">".price($obj->amount,0,$outputlangs,1,-1,-1,$conf->currency)."</td>";
print "<td align=\"right\">".price($obj->amount)."</td>";
print "<td>&nbsp;</td>";
print "</tr>\n";

Expand All @@ -177,7 +177,7 @@
$i++;
}
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").'</td>';
print '<td class="liste_total" align="right">'.price($total,0,$outputlangs,1,-1,-1,$conf->currency)."</td>";
print '<td class="liste_total" align="right">'.price($total)."</td>";
print "<td>&nbsp;</td></tr>";

print "</table>";
Expand Down
1 change: 1 addition & 0 deletions htdocs/core/ajax/box.php
Expand Up @@ -27,6 +27,7 @@
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1');

require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
Expand Down
3 changes: 2 additions & 1 deletion htdocs/core/ajax/security.php
@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
/* Copyright (C) 2011-2015 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 All @@ -26,6 +26,7 @@
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1');

require '../../main.inc.php';

Expand Down
6 changes: 3 additions & 3 deletions htdocs/core/class/commonobject.class.php
Expand Up @@ -1837,7 +1837,7 @@ function add_object_linked($origin=null, $origin_id=null)
* @return void
* @see add_object_linked, updateObjectLinked, deleteObjectLinked
*/
function fetchObjectLinked($sourceid='',$sourcetype='',$targetid='',$targettype='',$clause='OR')
function fetchObjectLinked($sourceid=null,$sourcetype='',$targetid=null,$targettype='',$clause='OR')
{
global $conf;

Expand Down Expand Up @@ -1865,11 +1865,11 @@ function fetchObjectLinked($sourceid='',$sourcetype='',$targetid='',$targettype=
$sourcetype = (! empty($sourcetype) ? $sourcetype : $this->element);
$targettype = (! empty($targettype) ? $targettype : $this->element);

if (empty($sourceid) && empty($targetid))
/*if (empty($sourceid) && empty($targetid))
{
dol_syslog('Bad usage of function. No source nor target id defined (nor as parameter nor as object id)', LOG_ERROR);
return -1;
}
}*/

// Links beetween objects are stored in this table
$sql = 'SELECT fk_source, sourcetype, fk_target, targettype';
Expand Down
33 changes: 15 additions & 18 deletions htdocs/core/lib/pdf.lib.php
Expand Up @@ -1585,55 +1585,52 @@ function pdf_getLinkedObjects($object,$outputlangs)
if ($objecttype == 'propal')
{
$outputlangs->load('propal');
$num=count($objects);
for ($i=0;$i<$num;$i++)

foreach($objects as $elementobject)
{
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefProposal");
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($objects[$i]->ref);
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref);
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DatePropal");
$linkedobjects[$objecttype]['date_value'] = dol_print_date($objects[$i]->date,'day','',$outputlangs);
$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date,'day','',$outputlangs);
}
}
else if ($objecttype == 'commande')
{
$outputlangs->load('orders');
$num=count($objects);
for ($i=0;$i<$num;$i++)
foreach($objects as $elementobject)
{
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder");
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($objects[$i]->ref) . ($objects[$i]->ref_client ? ' ('.$objects[$i]->ref_client.')' : '');
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref) . ($elementobject->ref_client ? ' ('.$elementobject->ref_client.')' : '');
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("OrderDate");
$linkedobjects[$objecttype]['date_value'] = dol_print_date($objects[$i]->date,'day','',$outputlangs);
$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date,'day','',$outputlangs);
}
}
else if ($objecttype == 'contrat')
{
$outputlangs->load('contracts');
$num=count($objects);
for ($i=0;$i<$num;$i++)
foreach($objects as $elementobject)
{
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefContract");
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($objects[$i]->ref);
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref);
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DateContract");
$linkedobjects[$objecttype]['date_value'] = dol_print_date($objects[$i]->date_contrat,'day','',$outputlangs);
$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date_contrat,'day','',$outputlangs);
}
}
else if ($objecttype == 'shipping')
{
$outputlangs->load('orders');
$outputlangs->load('sendings');
$num=count($objects);
for ($i=0;$i<$num;$i++)
foreach($objects as $elementobject)
{
$objects[$i]->fetchObjectLinked();
$order = $objects[$i]->linkedObjects['commande'][0];
$elementobject->fetchObjectLinked();
$order = $elementobject->linkedObjects['commande'][0];

$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder") . ' / ' . $outputlangs->transnoentities("RefSending");
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($order->ref) . ($order->ref_client ? ' ('.$order->ref_client.')' : '');
$linkedobjects[$objecttype]['ref_value'].= ' / ' . $outputlangs->transnoentities($objects[$i]->ref);
$linkedobjects[$objecttype]['ref_value'].= ' / ' . $outputlangs->transnoentities($elementobject->ref);
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("OrderDate") . ' / ' . $outputlangs->transnoentities("DateSending");
$linkedobjects[$objecttype]['date_value'] = dol_print_date($order->date,'day','',$outputlangs);
$linkedobjects[$objecttype]['date_value'].= ' / ' . dol_print_date($objects[$i]->date_delivery,'day','',$outputlangs);
$linkedobjects[$objecttype]['date_value'].= ' / ' . dol_print_date($elementobject->date_delivery,'day','',$outputlangs);
}
}
}
Expand Down

0 comments on commit a3d612a

Please sign in to comment.