ajout champ editable du slug, par defaut = oui
This commit is contained in:
parent
3a8356e81b
commit
c576301511
5 changed files with 29 additions and 21 deletions
|
@ -55,6 +55,7 @@ function gamumail_declarer_tables_objets_sql($tables) {
|
||||||
'id_docs' => 'text NOT NULL DEFAULT ""',
|
'id_docs' => 'text NOT NULL DEFAULT ""',
|
||||||
'statut' => 'varchar(20) DEFAULT "0" NOT NULL',
|
'statut' => 'varchar(20) DEFAULT "0" NOT NULL',
|
||||||
'public' => 'varchar(20) DEFAULT "oui" NOT NULL',
|
'public' => 'varchar(20) DEFAULT "oui" NOT NULL',
|
||||||
|
'editable' => 'varchar(5) DEFAULT "oui" NOT NULL',
|
||||||
'maj' => 'TIMESTAMP'
|
'maj' => 'TIMESTAMP'
|
||||||
),
|
),
|
||||||
'key' => array(
|
'key' => array(
|
||||||
|
@ -63,8 +64,8 @@ function gamumail_declarer_tables_objets_sql($tables) {
|
||||||
),
|
),
|
||||||
'titre' => 'slug AS titre, "" AS lang',
|
'titre' => 'slug AS titre, "" AS lang',
|
||||||
#'date' => '',
|
#'date' => '',
|
||||||
'champs_editables' => array('slug', 'sujet', 'texte','titre'),
|
'champs_editables' => array('slug', 'sujet', 'texte','titre', 'editable'),
|
||||||
'champs_versionnes' => array('slug', 'sujet', 'texte','titre'),
|
'champs_versionnes' => array('slug', 'sujet', 'texte','titre', 'editable'),
|
||||||
'rechercher_champs' => array("slug" => 8),
|
'rechercher_champs' => array("slug" => 8),
|
||||||
'tables_jointures' => array(),
|
'tables_jointures' => array(),
|
||||||
'statut'=> array(
|
'statut'=> array(
|
||||||
|
|
|
@ -35,7 +35,7 @@ function gamumail_upgrade($nom_meta_base_version, $version_cible) {
|
||||||
$maj['1.0.6'] = array(array('maj_tables', array('spip_gamumails')));
|
$maj['1.0.6'] = array(array('maj_tables', array('spip_gamumails')));
|
||||||
$maj['1.0.11'] = array( array('maj_tables', array('spip_gamumails')));
|
$maj['1.0.11'] = array( array('maj_tables', array('spip_gamumails')));
|
||||||
$maj['1.0.12'] = array(array('creer_compte_curl'));
|
$maj['1.0.12'] = array(array('creer_compte_curl'));
|
||||||
$maj['1.0.13'] = array(array('maj_tables', array('spip_gamumails')));
|
$maj['1.0.14'] = array(array('maj_tables', array('spip_gamumails')));
|
||||||
|
|
||||||
include_spip('base/upgrade');
|
include_spip('base/upgrade');
|
||||||
maj_plugin($nom_meta_base_version, $version_cible, $maj);
|
maj_plugin($nom_meta_base_version, $version_cible, $maj);
|
||||||
|
|
|
@ -48,7 +48,14 @@ function autoriser_gamumail_configurer_dist($faire, $type, $id, $qui, $opt) {
|
||||||
* uniquement les webmestres avec un mail en @gamuza.fr
|
* uniquement les webmestres avec un mail en @gamuza.fr
|
||||||
**/
|
**/
|
||||||
function autoriser_gamumail_modifier_nom_slug_dist($faire, $type, $id, $qui, $opt) {
|
function autoriser_gamumail_modifier_nom_slug_dist($faire, $type, $id, $qui, $opt) {
|
||||||
|
if (
|
||||||
|
intval($id)
|
||||||
|
and $editable = sql_getfetsel('editable', 'spip_gamumails', 'id_gamumail='.intval($id))
|
||||||
|
and $editable === 'oui'
|
||||||
|
) {
|
||||||
return
|
return
|
||||||
autoriser('webmestre')
|
autoriser('webmestre')
|
||||||
and strpos($qui['email'], 'gamuza.fr') !== false;
|
and strpos($qui['email'], 'gamuza.fr') !== false;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
|
@ -102,7 +102,7 @@
|
||||||
<div id="#SLUG" class="js-hidden">
|
<div id="#SLUG" class="js-hidden">
|
||||||
<div class="objet--slug">
|
<div class="objet--slug">
|
||||||
<strong><:gamumail:slug:>: </strong>
|
<strong><:gamumail:slug:>: </strong>
|
||||||
[(#AUTORISER{modifier_nom_slug,gamumail}|?{
|
[(#AUTORISER{modifier_nom_slug,gamumail, #ID_GAMUMAIL}|?{
|
||||||
<span class="[(#EDIT{nom_slug})]">[(#SLUG|sinon{<:gamumail:dbe_clic_editer:>})]</span>
|
<span class="[(#EDIT{nom_slug})]">[(#SLUG|sinon{<:gamumail:dbe_clic_editer:>})]</span>
|
||||||
,
|
,
|
||||||
<span class="">[(#SLUG)]</span>
|
<span class="">[(#SLUG)]</span>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
compatibilite="[3.2.0;3.3.*]"
|
compatibilite="[3.2.0;3.3.*]"
|
||||||
logo="prive/themes/spip/images/gamumail-64.png"
|
logo="prive/themes/spip/images/gamumail-64.png"
|
||||||
documentation=""
|
documentation=""
|
||||||
schema="1.0.13"
|
schema="1.0.14"
|
||||||
>
|
>
|
||||||
|
|
||||||
<nom>GamuMail</nom>
|
<nom>GamuMail</nom>
|
||||||
|
|
Loading…
Add table
Reference in a new issue