|
@@ -45,6 +45,8 @@ function fgcf_odt_export_formations($filename) {
|
|
|
// Create new odf object from the template.
|
|
|
$odf = fgcf_new_odf($filename);
|
|
|
|
|
|
+ $count = 0;
|
|
|
+ $count_cat = array();
|
|
|
// Identify replacement segment in the template.
|
|
|
$thematique_1_boucle = $odf->setSegment('thematique_1_boucle');
|
|
|
|
|
@@ -59,8 +61,10 @@ function fgcf_odt_export_formations($filename) {
|
|
|
// Iterate over secondary terms.
|
|
|
$sub_tree = taxonomy_get_tree($vid, $term->tid);
|
|
|
foreach ($sub_tree as $term_2) {
|
|
|
+ $count_cat[$term_2->tid] = 0;
|
|
|
// Select nodes for that term.
|
|
|
- $result = taxonomy_select_nodes(array($term_2->tid), 'or', 0, FALSE, 'n.nid ASC');
|
|
|
+ $sql = 'SELECT n.nid FROM {node} n LEFT JOIN {term_node} tn ON tn.vid = n.vid WHERE tn.tid = %d AND n.status = 1';
|
|
|
+ $result = db_query(db_rewrite_sql($sql), $term_2->tid);
|
|
|
while ($row = db_fetch_array($result)) {
|
|
|
// Insert replacements for the node in the nested 'formations_boucle'
|
|
|
// loop.
|
|
@@ -68,6 +72,8 @@ function fgcf_odt_export_formations($filename) {
|
|
|
$node = node_load($row['nid']);
|
|
|
fgcf_odt_replace_node_formation($formation_boucle, $node);
|
|
|
$formation_boucle->merge();
|
|
|
+ $count++;
|
|
|
+ $count_cat[$term_2->tid]++;
|
|
|
}
|
|
|
}
|
|
|
|