mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
PHRAS-64 #time 1h
fix "subdefs to be done" in admin/base
This commit is contained in:

committed by
Nicolas Le Goff

parent
752f0d5da4
commit
4441eae4a5
@@ -430,19 +430,14 @@ class databox extends base
|
|||||||
$ret['thesaurus_indexed'] += $row['n'];
|
$ret['thesaurus_indexed'] += $row['n'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT type, jeton, COUNT(record_id) AS n FROM record WHERE jeton & ".JETON_MAKE_SUBDEF." GROUP BY type, jeton";
|
$sql = "SELECT type, COUNT(record_id) AS n FROM record WHERE jeton & ".JETON_MAKE_SUBDEF." GROUP BY type";
|
||||||
$stmt = $this->get_connection()->prepare($sql);
|
$stmt = $this->get_connection()->prepare($sql);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
foreach ($rs as $row) {
|
foreach ($rs as $row) {
|
||||||
if(!array_key_exists($row['type'], $ret['jeton_subdef'])) {
|
$ret['jeton_subdef'][$row['type']] = (int)$row['n'];
|
||||||
$ret['jeton_subdef'][$row['type']] = 0;
|
|
||||||
}
|
|
||||||
if((int)$row['jeton'] & JETON_MAKE_SUBDEF) {
|
|
||||||
$ret['jeton_subdef'][$row['type']] += (int)$row['n'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
|
@@ -287,6 +287,9 @@
|
|||||||
{
|
{
|
||||||
t += (t==""?"":" ; ") + i + ": " + data.jeton_subdef[i];
|
t += (t==""?"":" ; ") + i + ": " + data.jeton_subdef[i];
|
||||||
}
|
}
|
||||||
|
if(t == "") {
|
||||||
|
t = "0";
|
||||||
|
}
|
||||||
$("#subdefs_todo").text(t);
|
$("#subdefs_todo").text(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user