Skip to content
Extraits de code Groupes Projets
Valider d062a0e7 rédigé par nicod's avatar nicod
Parcourir les fichiers

change: statut des blocks mis à jour

On supprime le statut prop, doublon de prepa fonctionnellement
On ajoute le statut poubelle, et on branche la corbeille
parent da8b657c
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -44,16 +44,16 @@ function blocks_declarer_tables_objets_sql($tables) {
'type' => 'block',
'principale' => 'oui',
'field' => [
'id_block' => 'bigint(21) NOT NULL',
'blocktype' => 'varchar(255) DEFAULT "" NOT NULL',
'objet' => 'varchar(25) DEFAULT "" NOT NULL',
'id_objet' => 'bigint(21) DEFAULT "0" NOT NULL',
'rang_lien' => 'int(4) DEFAULT "0" NOT NULL',
'ancre' => 'varchar(20) NOT NULL DEFAULT ""',
'valeurs' => 'text NOT NULL DEFAULT ""',
'date' => 'datetime NOT NULL DEFAULT "0000-00-00 00:00:00"',
'statut' => 'varchar(20) DEFAULT "0" NOT NULL',
'maj' => 'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
'id_block' => 'bigint(21) NOT NULL',
'blocktype' => 'varchar(255) DEFAULT "" NOT NULL',
'objet' => 'varchar(25) DEFAULT "" NOT NULL',
'id_objet' => 'bigint(21) DEFAULT "0" NOT NULL',
'rang_lien' => 'int(4) DEFAULT "0" NOT NULL',
'ancre' => 'varchar(20) NOT NULL DEFAULT ""',
'valeurs' => 'text NOT NULL DEFAULT ""',
'date' => 'datetime NOT NULL DEFAULT "0000-00-00 00:00:00"',
'statut' => 'varchar(20) DEFAULT "0" NOT NULL',
'maj' => 'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
],
'key' => [
'PRIMARY KEY' => 'id_block',
......@@ -67,11 +67,9 @@ function blocks_declarer_tables_objets_sql($tables) {
'champs_editables' => ['blocktype', 'id_objet', 'objet', 'ancre'],
'champs_versionnes' => ['blocktype', 'id_objet', 'objet', 'ancre', 'valeurs'],
'statut_textes_instituer' => [
'prepa' => 'texte_statut_en_cours_redaction',
'prop' => 'texte_statut_propose_evaluation',
'publie' => 'texte_statut_publie',
// 'refuse' => 'texte_statut_refuse',
// 'poubelle' => 'texte_statut_poubelle',
'prepa' => 'block:texte_statut_masque',
'publie' => 'block:texte_statut_affiche',
'poubelle' => 'texte_statut_poubelle',
],
'statut' => [
[
......
......@@ -115,6 +115,8 @@ function blocks_update_1_3_0() {
'id_block = ' . $blocks_lien['id_block']
);
}
// Le statut prop disparait au profit de prepa
sql_updateq('spip_blocks',['statut' => 'prepa'],'statut = "prop"');
}
function blocks_update_2_0_0() {
......
......@@ -68,3 +68,18 @@ function blocks_optimiser_base_disparus($flux) {
sql_delete('spip_blocks', "statut='poubelle' AND maj < " . $flux['args']['date']);
return $flux;
}
/**
* Pipeline de la corbeille, permet de définir les objets à supprimer
*
* @param array $param Tableau d'objets
* @return array Tableau d'objets complété
*/
function blocks_corbeille_table_infos($param) {
$param['blocks'] = [
'statut' => 'poubelle',
'table' => 'spip_blocks',
];
return $param;
}
......@@ -23,6 +23,8 @@ return [
'champ_blocktype_label' => 'Type de bloc',
'champ_valeurs_label' => 'Valeurs',
'confirmer_supprimer_block' => 'Confirmez-vous la suppression de ce bloc ?',
'corbeille_blocks_un' => 'Un block dans la corbeille',
'corbeille_blocks_tous' => '@nb@ blocks dans la corbeille',
// I
'icone_creer_block' => 'Créer un bloc',
......@@ -57,4 +59,6 @@ return [
'titre_logo_block' => 'Logo de ce bloc',
'titre_objets_lies_block' => 'Liés à ce bloc',
'titre_page_blocks' => 'Les blocs',
'texte_statut_masque' => 'Masqué',
'texte_statut_affiche' => 'Affiché',
];
<paquet
prefix="blocks"
version="2.0.0"
etat="dev"
compatibilite="[4.2.0;4.*]"
logo="prive/themes/spip/images/blocks-xx.svg"
documentation=""
schema="2.0.0"
prefix="blocks"
version="2.0.0"
etat="dev"
compatibilite="[4.2.0;4.*]"
logo="prive/themes/spip/images/blocks-xx.svg"
documentation=""
schema="2.0.0"
>
<nom>Blocks</nom>
<!-- Composer des pages avec des blocs -->
<nom>Blocks</nom>
<!-- Composer des pages avec des blocs -->
<auteur lien='https://contrib.spip.net/nicod_'>nicod_</auteur>
<auteur lien='https://contrib.spip.net/nicod_'>nicod_</auteur>
<licence>GNU/GPL</licence>
<necessite nom="ajaxfiltre" compatibilite="[1.0.10;]"/>
<necessite nom="saisies" compatibilite="[3.50.1;]"/>
<necessite nom="select2" compatibilite="[2.0.0;]"/>
<necessite nom="spip_bonux" compatibilite="[4.1.2;]"/>
<necessite nom="verifier" compatibilite="[3.1.0;]"/>
<necessite nom="yaml" compatibilite="[3.0.3;]"/>
<licence>GNU/GPL</licence>
<necessite nom="ajaxfiltre" compatibilite="[1.0.10;]"/>
<necessite nom="saisies" compatibilite="[3.50.1;]"/>
<necessite nom="select2" compatibilite="[2.0.0;]"/>
<necessite nom="spip_bonux" compatibilite="[4.1.2;]"/>
<necessite nom="verifier" compatibilite="[3.1.0;]"/>
<necessite nom="yaml" compatibilite="[3.0.3;]"/>
<utilise nom="corbeille"/>
<pipeline nom="autoriser" inclure="blocks_autorisations.php"/>
<pipeline nom="autoriser" inclure="blocks_autorisations.php"/>
<pipeline nom="declarer_tables_objets_sql" inclure="base/blocks.php"/>
<pipeline nom="declarer_tables_interfaces" inclure="base/blocks.php"/>
<pipeline nom="declarer_tables_auxiliaires" inclure="base/blocks.php" />
<pipeline nom="declarer_tables_objets_sql" inclure="base/blocks.php"/>
<pipeline nom="declarer_tables_interfaces" inclure="base/blocks.php"/>
<pipeline nom="declarer_tables_auxiliaires" inclure="base/blocks.php"/>
<pipeline nom="header_prive" inclure="blocks_pipelines.php"/>
<pipeline nom="affiche_enfants" inclure="blocks_pipelines.php"/>
<pipeline nom="afficher_contenu_objet" inclure="blocks_pipelines.php"/>
<pipeline nom="optimiser_base_disparus" inclure="blocks_pipelines.php"/>
<pipeline nom="header_prive" inclure="blocks_pipelines.php"/>
<pipeline nom="affiche_enfants" inclure="blocks_pipelines.php"/>
<pipeline nom="afficher_contenu_objet" inclure="blocks_pipelines.php"/>
<pipeline nom="optimiser_base_disparus" inclure="blocks_pipelines.php"/>
<pipeline nom="corbeille_table_infos" inclure="blocks_pipelines.php"/>
<menu nom="blocks" titre="block:titre_blocks" parent="menu_squelette" icone="images/block-16.png" action="blocks"/>
<menu nom="blocktypes" titre="blocktype:titre_blocktypes" parent="menu_squelette" icone="images/blocktype-16.png" action="blocktypes"/>
<menu nom="blocks" titre="block:titre_blocks" parent="menu_squelette" icone="images/block-16.png" action="blocks"/>
<menu nom="blocktypes" titre="blocktype:titre_blocktypes" parent="menu_squelette" icone="images/blocktype-16.png" action="blocktypes"/>
<chemin path="squelettes"/>
<chemin path=""/>
<chemin path="squelettes"/>
<chemin path=""/>
</paquet>
<B_corbeille>
<div class="liste">
[<h3 class="titrem">(#GRAND_TOTAL|singulier_ou_pluriel{block:corbeille_blocks_un,block:corbeille_blocks_tous})</h3>]
[<nav class='pagination'>(#PAGINATION)</nav>]
<ul class='liste-items checkables'>
<BOUCLE_corbeille(BLOCKS){statut='poubelle'}{pagination 5}{!par date}{recherche ?}>
<li class='item'>
<label for='block-#ID_BLOCK'><:corbeille:selectionner:></label>
<input type='checkbox' name='elements[]' id="block-#ID_BLOCK" value='#ID_BLOCK'[ (#ID_BLOCK|in_any{#ENV{elements}}|oui)checked='checked']/>
<h4>[(#INFO_TITRE{block,#ID_BLOCK}|concat{' (',#OBJET,' n° ',#ID_OBJET,')'}|sinon{<:info_sans_titre:>})]</h4>
<small>[(#DATE|affdate)][ (#DATE|heures)]:[(#DATE|minutes)]</small>
<p class='actions'><a href='#URL_ECRIRE{block,id_block=#ID_BLOCK}'><:corbeille:voir_detail:></a></p>
</li>
</BOUCLE_corbeille>
</ul>
[<p class='pagination'>(#PAGINATION{prive})</p>]
</div>
</B_corbeille>
[(#ENV{statut}|=={poubelle}|non)
#SET{where,'statut <> "poubelle"'}
]
[(#SET{defaut_tri,#ARRAY{
date,-1,
id_block,1,
......@@ -20,7 +23,8 @@
</tr>
</thead>
<tbody>
<BOUCLE_liste_blocks(BLOCKS) {id_?} {objet?}{ where?} {statut?} {blocktype?} {recherche?}
<BOUCLE_liste_blocks(BLOCKS) {id_?} {objet?} {statut?} {blocktype?} {recherche?}
{where #GET{where}}
{tri #ENV{par,date},#GET{defaut_tri}} {!par date} {pagination #ENV{nb,10}}>
<tr class="[(#COMPTEUR_BOUCLE|alterner{row_odd,row_even})]">
<td class="picto">[(#CHEMIN_IMAGE{block-16.png}|balise_img)]</td>
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter