Skip to content

Commit

Permalink
Fix: Count of files were wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jan 26, 2014
1 parent cd277aa commit ee41273
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions htdocs/core/lib/company.lib.php
Expand Up @@ -127,7 +127,7 @@ function societe_prepare_head($object)
// Attached files
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$upload_dir = $conf->societe->dir_output . "/" . $object->id;
$nbFiles = count(dol_dir_list($upload_dir));
$nbFiles = count(dol_dir_list($upload_dir,'files'));
$head[$h][0] = DOL_URL_ROOT.'/societe/document.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Documents");
if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')';
Expand Down Expand Up @@ -620,7 +620,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')

// Copy to clipboard
print "<td>&nbsp;</td>";

// Add to agenda
if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
{
Expand Down Expand Up @@ -725,7 +725,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
if (!empty($object->country))
$coords .= "<br />".addslashes($object->country);
}

print '<td align="center"><a href="#" onclick="return copyToClipboard(\''.$coords.'\');">';
print img_picto($langs->trans("Address"), 'object_address.png');
print '</a></td>';
Expand All @@ -744,7 +744,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
print img_object($langs->trans("Event"),"action");
print '</a></td>';
}

// Edit
if ($user->rights->societe->contact->creer)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/lib/product.lib.php
Expand Up @@ -120,7 +120,7 @@ function product_prepare_head($object, $user)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
if (! empty($conf->product->enabled)) $upload_dir = $conf->product->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
elseif (! empty($conf->service->enabled)) $upload_dir = $conf->service->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir));
$nbFiles = count(dol_dir_list($upload_dir,'files'));
$head[$h][0] = DOL_URL_ROOT.'/product/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')';
Expand Down

0 comments on commit ee41273

Please sign in to comment.