Merge branch '3.8'

Conflicts:
	.gitignore
	lib/Alchemy/Phrasea/Core/Version.php
	lib/classes/databox.php
	lib/classes/task/abstract.php
	lib/classes/task/manager.php
	lib/classes/task/period/subdef.php
	lib/classes/task/period/writemeta.php
	lib/conf.d/bases_structure.xml
	templates/web/admin/tasks/list.html.twig
This commit is contained in:
Nicolas Le Goff
2014-08-26 13:38:01 +02:00
16 changed files with 531 additions and 17 deletions

View File

@@ -419,14 +419,18 @@ class databox extends base
public function get_indexed_record_amount()
{
$sql = "SELECT status & 3 AS status, SUM(1) AS n FROM record GROUP BY(status & 3)";
$stmt = $this->get_connection()->prepare($sql);
$stmt->execute();
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor();
$ret = ['xml_indexed' => 0, 'thesaurus_indexed' => 0];
$ret = array(
'xml_indexed' => 0,
'thesaurus_indexed' => 0,
'jeton_subdef' => array()
);
foreach ($rs as $row) {
$status = $row['status'];
if ($status & 1)
@@ -435,6 +439,21 @@ class databox extends base
$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";
$stmt = $this->get_connection()->prepare($sql);
$stmt->execute();
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor();
foreach ($rs as $row) {
if(!array_key_exists($row['type'], $ret['jeton_subdef'])) {
$ret['jeton_subdef'][$row['type']] = 0;
}
if((int)$row['jeton'] & JETON_MAKE_SUBDEF) {
$ret['jeton_subdef'][$row['type']] += (int)$row['n'];
}
}
return $ret;
}