Skip to content
Extraits de code Groupes Projets
Valider 9efb3a58 rédigé par cerdic's avatar cerdic
Parcourir les fichiers

fix quelques erreurs restant par utilisation de module au lieu de id_tradlang_module

parent 73fb3ea2
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -82,7 +82,7 @@ function tradlang_set($id_tradlang, $set = null) { ...@@ -82,7 +82,7 @@ function tradlang_set($id_tradlang, $set = null) {
if (($statut = (in_array(_request('statut'), array('NEW', 'MODIF', 'OK', 'RELIRE'))) ? _request('statut') : $c['statut']) and ($statut != $infos_tradlang['statut'])) { if (($statut = (in_array(_request('statut'), array('NEW', 'MODIF', 'OK', 'RELIRE'))) ? _request('statut') : $c['statut']) and ($statut != $infos_tradlang['statut'])) {
sql_updateq('spip_tradlangs', array('statut' => $statut), 'id_tradlang = ' . intval($id_tradlang)); sql_updateq('spip_tradlangs', array('statut' => $statut), 'id_tradlang = ' . intval($id_tradlang));
$infos_maj = array(); $infos_maj = array();
$bilan = sql_fetsel('chaines_ok,chaines_relire,chaines_modif,chaines_new', 'spip_tradlangs_bilans', 'module = ' . sql_quote($infos_tradlang['module']) . ' AND lang = ' . sql_quote($infos_tradlang['lang'])); $bilan = sql_fetsel('chaines_ok,chaines_relire,chaines_modif,chaines_new', 'spip_tradlangs_bilans', 'id_tradlang_module=' . intval($infos_tradlang['id_tradlang_module']) . ' AND lang=' . sql_quote($infos_tradlang['lang']));
if ($statut == 'OK') { if ($statut == 'OK') {
$infos_maj['chaines_ok'] = ($bilan['chaines_ok']+1); $infos_maj['chaines_ok'] = ($bilan['chaines_ok']+1);
} elseif ($statut == 'RELIRE') { } elseif ($statut == 'RELIRE') {
...@@ -103,7 +103,7 @@ function tradlang_set($id_tradlang, $set = null) { ...@@ -103,7 +103,7 @@ function tradlang_set($id_tradlang, $set = null) {
$infos_maj['chaines_new'] = ($bilan['chaines_new']-1); $infos_maj['chaines_new'] = ($bilan['chaines_new']-1);
} }
sql_updateq('spip_tradlangs_bilans', $infos_maj, 'module = ' . sql_quote($infos_tradlang['module']) . ' AND lang = ' . sql_quote($infos_tradlang['lang'])); sql_updateq('spip_tradlangs_bilans', $infos_maj, 'id_tradlang_module=' . intval($infos_tradlang['id_tradlang_module']) . ' AND lang=' . sql_quote($infos_tradlang['lang']));
} }
//$c = collecter_requests(array('statut'),array(),$set); //$c = collecter_requests(array('statut'),array(),$set);
...@@ -131,7 +131,7 @@ function instituer_tradlang($id_tradlang, $c) { ...@@ -131,7 +131,7 @@ function instituer_tradlang($id_tradlang, $c) {
// cf autorisations dans inc/instituer_article // cf autorisations dans inc/instituer_article
if ($s != $statut) { if ($s != $statut) {
if (autoriser('modifier', 'tradlang', $tradlang)) { if (autoriser('modifier', 'tradlang', $id_tradlang)) {
$statut = $champs['statut'] = $s; $statut = $champs['statut'] = $s;
} else { } else {
spip_log("editer_tradlang $id_tradlang refus " . join(' ', $c)); spip_log("editer_tradlang $id_tradlang refus " . join(' ', $c));
......
...@@ -68,8 +68,8 @@ function inc_tradlang_ajouter_code_langue($module, $lang) { ...@@ -68,8 +68,8 @@ function inc_tradlang_ajouter_code_langue($module, $lang) {
/** /**
* On ajoute un job tout de suite pour générer les premières révisions * On ajoute un job tout de suite pour générer les premières révisions
*/ */
$job_description = _T('tradlang:job_creation_revisions_modules', array('module' => $module['module'])); $job_description = _T('tradlang:job_creation_revisions_modules', array('module' => "#". $module['id_tradlang_module'] . ' ' . $module['module']));
job_queue_add('tradlang_creer_premieres_revisions', $job_description, array('module' => $module['module'], 'lang'=>$lang), 'inc/', false, 0, 10); job_queue_add('tradlang_creer_premieres_revisions', $job_description, array($module['id_tradlang_module'], $lang), 'inc/', false, 0, 10);
/** /**
* On ajoute la ligne du bilan * On ajoute la ligne du bilan
......
...@@ -7,17 +7,16 @@ if (!defined('_ECRIRE_INC_VERSION')) { ...@@ -7,17 +7,16 @@ if (!defined('_ECRIRE_INC_VERSION')) {
/** /**
* Fonction de création des premières révisions * Fonction de création des premières révisions
* *
* @param array $module * @param int $id_tradlang_module
* Les informations du module en base (on a besoin des champs "module","lang_mere")
* @param string $lang * @param string $lang
* La langue dans laquelle on souhaite créer la nouvelle version * La langue dans laquelle on souhaite créer la nouvelle version
*/ */
function inc_tradlang_creer_premieres_revisions_dist($module = false, $lang = false, $nb = false) { function inc_tradlang_creer_premieres_revisions_dist($id_tradlang_module=0, $lang = false, $nb = false) {
include_spip('inc/revisions'); include_spip('inc/revisions');
$count = 0; $count = 0;
if ($versionnes = liste_champs_versionnes('spip_tradlangs')) { if ($versionnes = liste_champs_versionnes('spip_tradlangs')) {
$where = 'b.id_objet IS NULL'; $where = 'b.id_objet IS NULL';
$where .= (isset($module) and $module) ? ' AND a.module = '.sql_quote($module) : ''; $where .= (isset($id_tradlang_module) and $id_tradlang_module) ? ' AND a.id_tradlang_module = '.intval($id_tradlang_module) : '';
$where .= (isset($lang) and $lang) ? ' AND a.lang = '.sql_quote($lang) : ''; $where .= (isset($lang) and $lang) ? ' AND a.lang = '.sql_quote($lang) : '';
if (isset($nb) && is_numeric($nb) && $nb > 1) { if (isset($nb) && is_numeric($nb) && $nb > 1) {
$nb = $nb; $nb = $nb;
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter