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;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]><td>";
|
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>\n";
|
||||||
print '<td align="right">'.dol_print_size($file['size']).'</td>';
|
print '<td align="right">'.dol_print_size($file['size']).'</td>';
|
||||||
print '<td align="center">'.dolibarr_print_date($file['date'],"dayhour").'</td>';
|
print '<td align="center">'.dolibarr_print_date($file['date'],"dayhour").'</td>';
|
||||||
|
|||||||
@ -44,9 +44,12 @@ class EcmDirectory // extends CommonObject
|
|||||||
var $label;
|
var $label;
|
||||||
var $fk_parent;
|
var $fk_parent;
|
||||||
var $description;
|
var $description;
|
||||||
var $tms;
|
var $cachenbofdoc;
|
||||||
|
var $date_c;
|
||||||
|
var $date_m;
|
||||||
|
|
||||||
var $cats=array();
|
var $cats=array();
|
||||||
|
var $motherof=array();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -549,14 +552,17 @@ class EcmDirectory // extends CommonObject
|
|||||||
$sql.= " WHERE rowid=".$this->id;
|
$sql.= " WHERE rowid=".$this->id;
|
||||||
dolibarr_syslog("EcmDirectories::refreshcachenboffile sql=".$sql, LOG_DEBUG);
|
dolibarr_syslog("EcmDirectories::refreshcachenboffile sql=".$sql, LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (! $resql)
|
if ($resql)
|
||||||
|
{
|
||||||
|
$this->cachenbofdoc=sizeof($filelist);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
$this->error="Error ".$this->db->lasterror();
|
$this->error="Error ".$this->db->lasterror();
|
||||||
dolibarr_syslog("EcmDirectories::refreshcachenboffile ".$this->error, LOG_ERR);
|
dolibarr_syslog("EcmDirectories::refreshcachenboffile ".$this->error, LOG_ERR);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user