diff --git a/auted_pipelines.php b/auted_pipelines.php index 8b73a9e..42055d5 100644 --- a/auted_pipelines.php +++ b/auted_pipelines.php @@ -14,8 +14,17 @@ if (!defined('_ECRIRE_INC_VERSION')) { } - - +/** + * Charger des styles CSS + * + * @pipeline insert_head_css + * @param string $flux Code html des styles CSS à charger + * @return string Code html complété + **/ +function auted_insert_head_css($flux){ + $flux .= '' . "\n"; + return $flux; +} /** * Optimiser la base de données diff --git a/css/auted.css b/css/auted.css new file mode 100644 index 0000000..58144a7 --- /dev/null +++ b/css/auted.css @@ -0,0 +1,11 @@ +.formulaire_editer_autorisations .boss { + max-width: 24px; +} + +.formulaire_editer_autorisations .chosen-container { + max-width: 100%; +} + +.formulaire_editer_autorisations table tr:nth-child(even) { + background-color: rgb(231, 233, 237); +} diff --git a/formulaires/editer_autorisations.html b/formulaires/editer_autorisations.html new file mode 100644 index 0000000..45c0686 --- /dev/null +++ b/formulaires/editer_autorisations.html @@ -0,0 +1,48 @@ +
+ +[

(#ENV*{message_erreur})

] +[

(#ENV*{message_ok})

] + +
+ #ACTION_FORMULAIRE{#ENV{action}} + + + + + + + + + + + + + + + + [(#SET{autorisations,#AUTORISATIONS|json_decode{true}|table_valeur{#VALEUR{type}}})] + + + + + +
Auteur#VALEUR{label}
+ [(#PGP|=={boss}|oui) + boss + ] + #NOM #PRENOM + + + [(#PGP|!={boss}|oui) + + ] +
+ +

+
+
diff --git a/formulaires/editer_autorisations.php b/formulaires/editer_autorisations.php new file mode 100644 index 0000000..fd78e19 --- /dev/null +++ b/formulaires/editer_autorisations.php @@ -0,0 +1,47 @@ + _AUTH_MODELE]; + + if (intval($id_auteur)) { + $valeurs["id_auteur"] = intval($id_auteur); + } + + return $valeurs; +} + +function formulaires_editer_autorisations_verifier_dist($id_auteur=0, $redirect=''){ + $erreurs = array(); + return $erreurs; +} + +function formulaires_editer_autorisations_traiter_dist($id_auteur=0, $redirect=''){ + include_spip('inc/session'); + $retour = array(); + + $Tid_auteur = _request('Tid_auteur'); + foreach ($Tid_auteur as $id) { + $Tauths =_request('id-'.$id); + $Tautorisations = []; + + if (!empty($Tauths)) { + foreach ($Tauths as $valeur) { + $Tautorisations[key($valeur)][]= $valeur[key($valeur)]; + } + } + + $set = [ 'autorisations' => json_encode($Tautorisations) ]; + sql_updateq('spip_auteurs', $set, 'id_auteur='.intval($id)); + + $auteur = sql_fetsel('*', 'spip_auteurs','id_auteur='.intval($id)); + actualiser_sessions($auteur); + $retour['message_ok'] = "Enregistrement validé"; + } + + if ($redirect) { + $retour['redirect'] = $redirect; + } + + return $retour; +} diff --git a/img/boss.png b/img/boss.png new file mode 100644 index 0000000..efbb57a Binary files /dev/null and b/img/boss.png differ diff --git a/inclure/auth_choix.html b/inclure/auth_choix.html new file mode 100644 index 0000000..50cda1a --- /dev/null +++ b/inclure/auth_choix.html @@ -0,0 +1,7 @@ +#SET{name,aut_#ENV{type}} + diff --git a/paquet.xml b/paquet.xml index 3872ac0..adba159 100644 --- a/paquet.xml +++ b/paquet.xml @@ -28,6 +28,7 @@ +