|
@@ -85,7 +85,7 @@ function fgcf_odt_replace_term_1st_level($segment, $term) {
|
|
$replace = array();
|
|
$replace = array();
|
|
|
|
|
|
$replace['thematique_1_nom'] = strip_tags(filter_xss_admin($term->description));
|
|
$replace['thematique_1_nom'] = strip_tags(filter_xss_admin($term->description));
|
|
- $replace['thematique_1_code'] = $term->name;
|
|
|
|
|
|
+ $replace['thematique_1_code'] = check_plain($term->name);
|
|
|
|
|
|
_fgcf_odt_replace_segment($segment, $replace);
|
|
_fgcf_odt_replace_segment($segment, $replace);
|
|
|
|
|
|
@@ -93,7 +93,7 @@ function fgcf_odt_replace_term_1st_level($segment, $term) {
|
|
$term_nodes = nat_get_nids(array($term->tid), TRUE);
|
|
$term_nodes = nat_get_nids(array($term->tid), TRUE);
|
|
if ($term_node = current($term_nodes)) {
|
|
if ($term_node = current($term_nodes)) {
|
|
$file = $term_node->field_fgcf_thematique_logo[0]['filepath'];
|
|
$file = $term_node->field_fgcf_thematique_logo[0]['filepath'];
|
|
- $segment->setImage('thematique_1_image', $file);
|
|
|
|
|
|
+// $segment->setImage('thematique_1_image', $file);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -119,15 +119,17 @@ function fgcf_odt_replace_node_formation($segment, $node) {
|
|
// Initialise replacements with 'unspecified' text.
|
|
// Initialise replacements with 'unspecified' text.
|
|
$replace = array_fill_keys($keys, '-');
|
|
$replace = array_fill_keys($keys, '-');
|
|
|
|
|
|
|
|
+ // Note : check_plain() is needed to escape characters like &...
|
|
|
|
+
|
|
// formation_drupal_id
|
|
// formation_drupal_id
|
|
$replace['formation_drupal_id'] = $node->nid;
|
|
$replace['formation_drupal_id'] = $node->nid;
|
|
|
|
|
|
// formation_titre
|
|
// formation_titre
|
|
- $replace['formation_titre'] = $node->title;
|
|
|
|
|
|
+ $replace['formation_titre'] = check_plain($node->title);
|
|
|
|
|
|
// formation_reference
|
|
// formation_reference
|
|
if (!empty($node->field_fgcf_fiche_reference[0]['value'])) {
|
|
if (!empty($node->field_fgcf_fiche_reference[0]['value'])) {
|
|
- $replace['formation_reference'] = $node->field_fgcf_fiche_reference[0]['value'];
|
|
|
|
|
|
+ $replace['formation_reference'] = check_plain($node->field_fgcf_fiche_reference[0]['value']);
|
|
}
|
|
}
|
|
|
|
|
|
// formation_objectif
|
|
// formation_objectif
|
|
@@ -138,16 +140,21 @@ function fgcf_odt_replace_node_formation($segment, $node) {
|
|
// formation_contenu
|
|
// formation_contenu
|
|
// @todo bug sur certains nodes 220
|
|
// @todo bug sur certains nodes 220
|
|
if (!empty($node->field_fgcf_fiche_contenu[0]['value'])) {
|
|
if (!empty($node->field_fgcf_fiche_contenu[0]['value'])) {
|
|
- // Do not translate markdown syntax - only replace bullet points
|
|
|
|
|
|
+ // @todo Do not translate markdown syntax - only replace bullet points
|
|
$replace['formation_contenu'] = $node->field_fgcf_fiche_contenu[0]['value'];
|
|
$replace['formation_contenu'] = $node->field_fgcf_fiche_contenu[0]['value'];
|
|
//$replace['formation_contenu'] = check_markup($node->field_fgcf_fiche_contenu[0]['value'], $node->field_fgcf_fiche_contenu[0]['format']);
|
|
//$replace['formation_contenu'] = check_markup($node->field_fgcf_fiche_contenu[0]['value'], $node->field_fgcf_fiche_contenu[0]['format']);
|
|
}
|
|
}
|
|
|
|
|
|
// formation_organisme
|
|
// formation_organisme
|
|
- // @todo : organisme peut être multiple
|
|
|
|
- // @todo bug sur nodes 220 221 : Staff & Line Management
|
|
|
|
- $node_organisme = node_load($node->field_fgcf_fiche_organisme[0]['nid']);
|
|
|
|
- $replace['formation_organisme'] = $node_organisme->title;
|
|
|
|
|
|
+ $values = array();
|
|
|
|
+ foreach ((array) $node->field_fgcf_fiche_organisme as $item) {
|
|
|
|
+ if ($node_organisme = node_load($item['nid'])) {
|
|
|
|
+ $values[] = check_plain($node_organisme->title);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if ($values) {
|
|
|
|
+ $replace['formation_organisme'] = implode(', ', $values);
|
|
|
|
+ }
|
|
|
|
|
|
// formation_modalites
|
|
// formation_modalites
|
|
$field = content_fields('field_fgcf_fiche_modalite', 'fgcf_fiche');
|
|
$field = content_fields('field_fgcf_fiche_modalite', 'fgcf_fiche');
|
|
@@ -155,7 +162,7 @@ function fgcf_odt_replace_node_formation($segment, $node) {
|
|
$values = array();
|
|
$values = array();
|
|
foreach ((array) $node->field_fgcf_fiche_modalite as $item) {
|
|
foreach ((array) $node->field_fgcf_fiche_modalite as $item) {
|
|
if (isset($map[$item['value']])) {
|
|
if (isset($map[$item['value']])) {
|
|
- $values[] = $map[$item['value']];
|
|
|
|
|
|
+ $values[] = check_plain($map[$item['value']]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if ($values) {
|
|
if ($values) {
|
|
@@ -168,7 +175,7 @@ function fgcf_odt_replace_node_formation($segment, $node) {
|
|
$field = content_fields('field_fgcf_fiche_dif', 'fgcf_fiche');
|
|
$field = content_fields('field_fgcf_fiche_dif', 'fgcf_fiche');
|
|
$map = content_allowed_values($field);
|
|
$map = content_allowed_values($field);
|
|
if (isset($map[$item])) {
|
|
if (isset($map[$item])) {
|
|
- $replace['formation_dif'] = $map[$item];
|
|
|
|
|
|
+ $replace['formation_dif'] = check_plain($map[$item]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -189,7 +196,7 @@ function fgcf_odt_replace_node_formation($segment, $node) {
|
|
foreach ((array) $node->field_fgcf_fiche_format as $item) {
|
|
foreach ((array) $node->field_fgcf_fiche_format as $item) {
|
|
$tid = $item['value'];
|
|
$tid = $item['value'];
|
|
if ($term = taxonomy_get_term($tid)) {
|
|
if ($term = taxonomy_get_term($tid)) {
|
|
- $values[] = $term->name;
|
|
|
|
|
|
+ $values[] = check_plain($term->name);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if ($values) {
|
|
if ($values) {
|
|
@@ -202,7 +209,7 @@ function fgcf_odt_replace_node_formation($segment, $node) {
|
|
foreach ((array) $node->field_fgcf_fiche_supports as $item) {
|
|
foreach ((array) $node->field_fgcf_fiche_supports as $item) {
|
|
$tid = $item['value'];
|
|
$tid = $item['value'];
|
|
if ($term = taxonomy_get_term($tid)) {
|
|
if ($term = taxonomy_get_term($tid)) {
|
|
- $values[] = $term->name;
|
|
|
|
|
|
+ $values[] = check_plain($term->name);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if ($values) {
|
|
if ($values) {
|
|
@@ -215,7 +222,7 @@ function fgcf_odt_replace_node_formation($segment, $node) {
|
|
foreach ((array) $node->field_fgcf_fiche_sanction as $item) {
|
|
foreach ((array) $node->field_fgcf_fiche_sanction as $item) {
|
|
$tid = $item['value'];
|
|
$tid = $item['value'];
|
|
if ($term = taxonomy_get_term($tid)) {
|
|
if ($term = taxonomy_get_term($tid)) {
|
|
- $values[] = $term->name;
|
|
|
|
|
|
+ $values[] = check_plain($term->name);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if ($values) {
|
|
if ($values) {
|
|
@@ -228,7 +235,7 @@ function fgcf_odt_replace_node_formation($segment, $node) {
|
|
foreach ((array) $node->field_fgcf_fiche_public as $item) {
|
|
foreach ((array) $node->field_fgcf_fiche_public as $item) {
|
|
$tid = $item['value'];
|
|
$tid = $item['value'];
|
|
if ($term = taxonomy_get_term($tid)) {
|
|
if ($term = taxonomy_get_term($tid)) {
|
|
- $values[] = $term->name;
|
|
|
|
|
|
+ $values[] = check_plain($term->name);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if ($values) {
|
|
if ($values) {
|