diff --git a/base/podcast.php b/base/podcast.php
index c37506c..d7cc2a4 100644
--- a/base/podcast.php
+++ b/base/podcast.php
@@ -49,8 +49,9 @@ function podcast_declarer_tables_objets_sql($tables) {
'field'=> array(
'id_podcast' => 'bigint(21) NOT NULL',
'id_article' => 'bigint(21) NOT NULL DEFAULT 0',
- 'code' => 'tinytext NOT NULL DEFAULT ""',
- 'duree' => 'tinytext NOT NULL DEFAULT ""',
+ 'code' => 'varchar(25) NOT NULL DEFAULT ""',
+ 'fichier' => 'tinytext NOT NULL DEFAULT ""',
+ 'duree' => 'varchar(25) NOT NULL DEFAULT ""',
'maj' => 'TIMESTAMP NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP'
),
'key' => array(
@@ -59,8 +60,8 @@ function podcast_declarer_tables_objets_sql($tables) {
),
'titre' => 'code AS titre, "" AS lang',
#'date' => '',
- 'champs_editables' => array('code', 'duree', 'id_article'),
- 'champs_versionnes' => array('code', 'duree', 'id_article'),
+ 'champs_editables' => array('code', 'fichier', 'duree', 'id_article'),
+ 'champs_versionnes' => array('code', 'fichier', 'duree', 'id_article'),
'rechercher_champs' => array(),
'tables_jointures' => array(),
diff --git a/fabrique_diff.diff b/fabrique_diff.diff
index d7da545..f94ad4c 100644
--- a/fabrique_diff.diff
+++ b/fabrique_diff.diff
@@ -1,194 +1,13 @@
-Only in ../sites/fabrique.spip/tmp/cache/fabrique/podcast/action: supprimer_chapitre.php
-diff -r -x . -x .. -x fabrique_diff.diff -x fabrique_podcast.php ../sites/fabrique.spip/tmp/cache/fabrique/.backup/podcast/base/podcast.php ../sites/fabrique.spip/tmp/cache/fabrique/podcast/base/podcast.php
-28a29
-> $interfaces['table_des_tables']['chapitres'] = 'chapitres';
-63a65,91
-> 'tables_jointures' => array(),
->
->
-> );
->
-> $tables['spip_chapitres'] = array(
-> 'type' => 'chapitre',
-> 'principale' => 'oui',
-> 'field'=> array(
-> 'id_chapitre' => 'bigint(21) NOT NULL',
-> 'id_podcast' => 'bigint(21) NOT NULL DEFAULT 0',
-> 'titre' => 'tinytext NOT NULL DEFAULT ""',
-> 'nom_identifiant' => 'tinytext NOT NULL DEFAULT ""',
-> 'sujet_principal' => 'int(6) NOT NULL DEFAULT 0',
-> 'debut' => 'varchar(25) NOT NULL DEFAULT ""',
-> 'fin' => 'varchar(25) NOT NULL DEFAULT ""',
-> 'maj' => 'TIMESTAMP NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP'
-> ),
-> 'key' => array(
-> 'PRIMARY KEY' => 'id_chapitre',
-> 'KEY id_podcast' => 'id_podcast',
-> ),
-> 'titre' => 'titre AS titre, "" AS lang',
-> #'date' => '',
-> 'champs_editables' => array('titre', 'nom_identifiant', 'sujet_principal', 'debut', 'fin', 'id_podcast'),
-> 'champs_versionnes' => array('titre', 'nom_identifiant', 'sujet_principal', 'debut', 'fin', 'id_podcast'),
-> 'rechercher_champs' => array("titre" => 5),
-Only in ../sites/fabrique.spip/tmp/cache/fabrique/podcast/formulaires: editer_chapitre.html
-Only in ../sites/fabrique.spip/tmp/cache/fabrique/podcast/formulaires: editer_chapitre.php
-Only in ../sites/fabrique.spip/tmp/cache/fabrique/podcast/lang: chapitre_fr.php
-diff -r -x . -x .. -x fabrique_diff.diff -x fabrique_podcast.php ../sites/fabrique.spip/tmp/cache/fabrique/.backup/podcast/paquet.xml ../sites/fabrique.spip/tmp/cache/fabrique/podcast/paquet.xml
+diff -r -x . -x .. -x fabrique_diff.diff -x fabrique_podcast.php ../plugins/fabrique_auto/.backup/podcast/paquet.xml ../plugins/fabrique_auto/podcast/paquet.xml
+4c4
+< version="1.1.1"
+---
+> version="1.1.2"
+9c9
+< schema="1.0.0"
+---
+> schema="1.2.2"
12c12
-< Paquet généré le 2021-02-10 07:11:23
+< Paquet généré le 2021-02-11 21:24:46
---
-> Paquet généré le 2021-02-11 09:30:30
-diff -r -x . -x .. -x fabrique_diff.diff -x fabrique_podcast.php ../sites/fabrique.spip/tmp/cache/fabrique/.backup/podcast/podcast_administrations.php ../sites/fabrique.spip/tmp/cache/fabrique/podcast/podcast_administrations.php
-54c54
-< $maj['create'] = array(array('maj_tables', array('spip_podcasts')));
----
-> $maj['create'] = array(array('maj_tables', array('spip_podcasts', 'spip_chapitres')));
-79a80
-> sql_drop_table('spip_chapitres');
-82,84c83,85
-< sql_delete('spip_documents_liens', sql_in('objet', array('podcast')));
-< sql_delete('spip_mots_liens', sql_in('objet', array('podcast')));
-< sql_delete('spip_auteurs_liens', sql_in('objet', array('podcast')));
----
-> sql_delete('spip_documents_liens', sql_in('objet', array('podcast', 'chapitre')));
-> sql_delete('spip_mots_liens', sql_in('objet', array('podcast', 'chapitre')));
-> sql_delete('spip_auteurs_liens', sql_in('objet', array('podcast', 'chapitre')));
-86,88c87,89
-< sql_delete('spip_versions', sql_in('objet', array('podcast')));
-< sql_delete('spip_versions_fragments', sql_in('objet', array('podcast')));
-< sql_delete('spip_forum', sql_in('objet', array('podcast')));
----
-> sql_delete('spip_versions', sql_in('objet', array('podcast', 'chapitre')));
-> sql_delete('spip_versions_fragments', sql_in('objet', array('podcast', 'chapitre')));
-> sql_delete('spip_forum', sql_in('objet', array('podcast', 'chapitre')));
-diff -r -x . -x .. -x fabrique_diff.diff -x fabrique_podcast.php ../sites/fabrique.spip/tmp/cache/fabrique/.backup/podcast/podcast_autorisations.php ../sites/fabrique.spip/tmp/cache/fabrique/podcast/podcast_autorisations.php
-143a144,233
-> // -----------------
-> // Objet chapitres
->
->
->
->
-> /**
-> * Autorisation de voir (chapitres)
-> *
-> * @param string $faire Action demandée
-> * @param string $type Type d'objet sur lequel appliquer l'action
-> * @param int $id Identifiant de l'objet
-> * @param array $qui Description de l'auteur demandant l'autorisation
-> * @param array $opt Options de cette autorisation
-> * @return bool true s'il a le droit, false sinon
-> **/
-> function autoriser_chapitres_voir_dist($faire, $type, $id, $qui, $opt) {
-> return true;
-> }
->
-> /**
-> * Autorisation de voir (chapitre)
-> *
-> * @param string $faire Action demandée
-> * @param string $type Type d'objet sur lequel appliquer l'action
-> * @param int $id Identifiant de l'objet
-> * @param array $qui Description de l'auteur demandant l'autorisation
-> * @param array $opt Options de cette autorisation
-> * @return bool true s'il a le droit, false sinon
-> **/
-> function autoriser_chapitre_voir_dist($faire, $type, $id, $qui, $opt) {
-> return true;
-> }
->
-> /**
-> * Autorisation de créer (chapitre)
-> *
-> * @param string $faire Action demandée
-> * @param string $type Type d'objet sur lequel appliquer l'action
-> * @param int $id Identifiant de l'objet
-> * @param array $qui Description de l'auteur demandant l'autorisation
-> * @param array $opt Options de cette autorisation
-> * @return bool true s'il a le droit, false sinon
-> **/
-> function autoriser_chapitre_creer_dist($faire, $type, $id, $qui, $opt) {
-> return in_array($qui['statut'], array('0minirezo', '1comite'));
-> }
->
-> /**
-> * Autorisation de modifier (chapitre)
-> *
-> * @param string $faire Action demandée
-> * @param string $type Type d'objet sur lequel appliquer l'action
-> * @param int $id Identifiant de l'objet
-> * @param array $qui Description de l'auteur demandant l'autorisation
-> * @param array $opt Options de cette autorisation
-> * @return bool true s'il a le droit, false sinon
-> **/
-> function autoriser_chapitre_modifier_dist($faire, $type, $id, $qui, $opt) {
-> return in_array($qui['statut'], array('0minirezo', '1comite'));
-> }
->
-> /**
-> * Autorisation de supprimer (chapitre)
-> *
-> * @param string $faire Action demandée
-> * @param string $type Type d'objet sur lequel appliquer l'action
-> * @param int $id Identifiant de l'objet
-> * @param array $qui Description de l'auteur demandant l'autorisation
-> * @param array $opt Options de cette autorisation
-> * @return bool true s'il a le droit, false sinon
-> **/
-> function autoriser_chapitre_supprimer_dist($faire, $type, $id, $qui, $opt) {
-> return in_array($qui['statut'], array('0minirezo', '1comite'));
-> }
->
->
-> /**
-> * Autorisation de créer l'élément (chapitre) dans un podcasts
-> *
-> * @param string $faire Action demandée
-> * @param string $type Type d'objet sur lequel appliquer l'action
-> * @param int $id Identifiant de l'objet
-> * @param array $qui Description de l'auteur demandant l'autorisation
-> * @param array $opt Options de cette autorisation
-> * @return bool true s'il a le droit, false sinon
-> **/
-> function autoriser_podcast_creerchapitredans_dist($faire, $type, $id, $qui, $opt) {
-> return ($id and autoriser('voir', 'podcasts', $id) and autoriser('creer', 'chapitre'));
-> }
-diff -r -x . -x .. -x fabrique_diff.diff -x fabrique_podcast.php ../sites/fabrique.spip/tmp/cache/fabrique/.backup/podcast/podcast_pipelines.php ../sites/fabrique.spip/tmp/cache/fabrique/podcast/podcast_pipelines.php
-57a58,78
->
-> if ($e['type'] === 'podcast') {
-> $flux['data'] .= recuperer_fond(
-> 'prive/objets/liste/chapitres',
-> array(
-> 'titre' => _T('chapitre:titre_chapitres'),
-> 'id_podcast' => $id_objet
-> )
-> );
->
-> if (autoriser('creerchapitredans', 'podcasts', $id_objet)) {
-> include_spip('inc/presentation');
-> $flux['data'] .= icone_verticale(
-> _T('chapitre:icone_creer_chapitre'),
-> generer_url_ecrire('chapitre_edit', "id_podcast=$id_objet"),
-> 'chapitre-24.png',
-> 'new',
-> 'right'
-> ) . "
";
-> }
-> }
-74a96,98
-> if ($flux['args']['type'] == 'podcast' and $nb = sql_countsel('spip_chapitres', array('id_podcast=' . $id))) {
-> $texte .= '