Add button to update cache of nb of files in ECM module
This commit is contained in:
parent
1fa8bbf08e
commit
07cf3b532c
@ -317,7 +317,10 @@ foreach($filearray as $key => $file)
|
||||
{
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td>";
|
||||
echo '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&type=application/binary&file='.urlencode($prefix.$file['name']).'">'.$file['name'].'</a>';
|
||||
echo '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&type=application/binary&file='.urlencode($prefix.$file['name']).'">';
|
||||
print img_mime($file['name']).' ';
|
||||
print $file['name'];
|
||||
print '</a>';
|
||||
print "</td>\n";
|
||||
print '<td align="right">'.dol_print_size($file['size']).'</td>';
|
||||
print '<td align="center">'.dolibarr_print_date($file['date'],"dayhour").'</td>';
|
||||
|
||||
@ -44,10 +44,13 @@ class EcmDirectory // extends CommonObject
|
||||
var $label;
|
||||
var $fk_parent;
|
||||
var $description;
|
||||
var $tms;
|
||||
|
||||
var $cachenbofdoc;
|
||||
var $date_c;
|
||||
var $date_m;
|
||||
|
||||
var $cats=array();
|
||||
|
||||
var $motherof=array();
|
||||
|
||||
|
||||
/**
|
||||
* \brief Constructor
|
||||
@ -549,14 +552,17 @@ class EcmDirectory // extends CommonObject
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
dolibarr_syslog("EcmDirectories::refreshcachenboffile sql=".$sql, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (! $resql)
|
||||
if ($resql)
|
||||
{
|
||||
$this->cachenbofdoc=sizeof($filelist);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error="Error ".$this->db->lasterror();
|
||||
dolibarr_syslog("EcmDirectories::refreshcachenboffile ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user