[SPIP Zone] [Spip-zone-commit] r31387 - in /_plugins_/tickets: formulaires/editer_ticket.html plugin.xml tickets_fonctions.php tickets_options.php

Mathieu, Kent1,

Je pense qu’il faut mettre un tags avec une version tickets 1 et à ce moment là se permettre tout ce qu’on veut dans la version 2.

++
Eric

Le 7 septembre 2009 17:52, <marcimat@free.fr> a écrit :

Author: marcimat@free.fr
Date: Mon Sep 7 17:52:25 2009
New Revision: 31387

Log:

  • Mettre les messages d’erreurs sur les champs CVT. Pour ça, par simplicité, on utilise Saisies (et Bonux, j’en suis désolé). Application au formulaire d’édition.
  • Reprise un peu du code des définitions de champs. C’est pas encore gégé.

Modified:
plugins/tickets/formulaires/editer_ticket.html
plugins/tickets/plugin.xml
plugins/tickets/tickets_fonctions.php
plugins/tickets/tickets_options.php

Modified: plugins/tickets/formulaires/editer_ticket.html

plugins/tickets/formulaires/editer_ticket.html (original)
+++ plugins/tickets/formulaires/editer_ticket.html Mon Sep 7 17:52:25 2009
@@ -8,67 +8,57 @@
#ACTION_FORMULAIRE{#ENV{action}}

    -
  • - <:tickets:champ_titre_ticket:> - -
  • -
  • - <:tickets:champ_statut:> - - [(#SESSION{id_auteur}|oui)[(#VAL{redac}|tickets_texte_statut)]] - [(#VAL{ouvert}|tickets_texte_statut)] - [(#VAL{resolu}|tickets_texte_statut)] - [(#VAL{ferme}|tickets_texte_statut)] - -
  • -
  • - <:tickets:champ_type:> - [(#VAL{1}|tickets_texte_type)] - [(#VAL{2}|tickets_texte_type)] - [(#VAL{3}|tickets_texte_type)] - -
  • -
  • - <:tickets:champ_severite:> - [(#VAL{1}|tickets_texte_severite)] - [(#VAL{2}|tickets_texte_severite)] - [(#VAL{3}|tickets_texte_severite)] - [(#VAL{4}|tickets_texte_severite)] - -
  • - - [
  • - <:tickets:champ_projet:> - (#VAL{projet}|tickets_select_champ_optionnel{#ENV**{projet}}) -
  • ] - [
  • - <:tickets:champ_composant:> - (#VAL{composant}|tickets_select_champ_optionnel{#ENV**{composant}}) -
  • ] - [
  • - <:tickets:champ_version:> - (#VAL{version}|tickets_select_champ_optionnel{#ENV**{version}}) -
  • ] - [
  • - <:tickets:champ_jalon:> - (#VAL{jalon}|tickets_select_champ_optionnel{#ENV**{jalon}}) -
  • ] - -
  • - <:tickets:champ_description:> -
    - <:tickets:explication_description_ticket:> -
    - [(#SPIP_VERSION|<{2.1}|oui) - [(#VAL{text_area}|barre_typo{#LANGUE})] + [(#SAISIE{input, titre, + label=<:tickets:champ_titre_ticket:>, + defaut=<:tickets:nouveau_ticket:>, + obligatoire=oui})] + + [(#SAISIE{selection, statut, + label=<:tickets:champ_statut:>, + datas=[(#VAL{#SESSION{id_auteur}}|tickets_liste_statuts)]})] + + [(#SAISIE{selection, type, + label=<:tickets:champ_type:>, + datas=[(#VAL|tickets_liste_types)]})] + + [(#SAISIE{selection, severite, + label=<:tickets:champ_severite:>, + datas=[(#VAL|tickets_liste_severite)]})] + + + [(#REM) 4 fois la meme chose ] + + [(#VAL{projet}|tickets_champ_optionnel_actif|oui) + [(#SAISIE{selection, projet, + label=<:tickets:champ_projet:>, + datas=[(#VAL{projet}|tickets_champ_optionnel_actif)]})] + ] + [(#VAL{composant}|tickets_champ_optionnel_actif|oui) + [(#SAISIE{selection, composant, + label=<:tickets:champ_composant:>, + datas=[(#VAL{composant}|tickets_champ_optionnel_actif)]})] + ] + [(#VAL{version}|tickets_champ_optionnel_actif|oui) + [(#SAISIE{selection, version, + label=<:tickets:champ_version:>, + datas=[(#VAL{version}|tickets_champ_optionnel_actif)]})] ] - [(#ENV**{texte})] -
  • -
  • - <:tickets:champ_url_exemple:> -
    <:tickets:explication_url_exemple:>
    - -
  • + [(#VAL{jalon}|tickets_champ_optionnel_actif|oui) + [(#SAISIE{selection, jalon, + label=<:tickets:champ_jalon:>, + datas=[(#VAL{jalon}|tickets_champ_optionnel_actif)]})] + ] + + [(#SAISIE{textarea, texte, + label=<:tickets:champ_description:>, + explication=<:tickets:explication_description_ticket:>, + obligatoire=oui, + class=inserer_barre_edition, + rows=20})] + + [(#SAISIE{input, exemple, + label=<:tickets:champ_url_exemple:>, + explication=<:tickets:explication_url_exemple:>})]

Modified: plugins/tickets/plugin.xml

plugins/tickets/plugin.xml (original)
+++ plugins/tickets/plugin.xml Mon Sep 7 17:52:25 2009
@@ -9,7 +9,7 @@

imgs/logo-bugs.png

  • 1.5.2
  • 1.6
    <version_base>0.6</version_base>
    stable

@@ -63,4 +63,7 @@

+ + + \ No newline at end of file

Modified: plugins/tickets/tickets_fonctions.php

plugins/tickets/tickets_fonctions.php (original)
+++ plugins/tickets/tickets_fonctions.php Mon Sep 7 17:52:25 2009
@@ -2,36 +2,11 @@

// Creation de la liste des options du select des champ jalon, version, projet ou composant
function tickets_select_champ_optionnel($champ=‹  ›, $en_cours){

  • $options = NULL;
  • if ($champ == ‹  ›)
  • return $options;
  • switch(strtolower($champ))
  • {
  • case ‹ jalon ›:
  • if (defined(‹ _TICKETS_LISTE_JALONS ›))
  • $define = _TICKETS_LISTE_JALONS;
  • break;
  • case ‹ version ›:
  • if (defined(‹ _TICKETS_LISTE_VERSIONS ›))
  • $define = _TICKETS_LISTE_VERSIONS;
  • break;
  • case ‹ projet ›:
  • if (defined(‹ _TICKETS_LISTE_PROJETS ›))
  • $define = _TICKETS_LISTE_PROJETS;
  • break;
  • case ‹ composant ›:
  • if (defined(‹ _TICKETS_LISTE_COMPOSANTS ›))
  • $define = _TICKETS_LISTE_COMPOSANTS;
  • break;
  • default:
  • $define = ‹  ›;
  • break;
  • if (!$liste = tickets_champ_optionnel_actif($champ)) {
  • return null;
    }
  • if ($define == ‹  ›)

  • return $options;

  • $liste = explode(‹ : ›, $define);

  • $options = ‹  ›;
    foreach ($liste as $_item) {
    if ($_item != ‹  ›) {
    $selected = ($_item == $en_cours) ? ’ selected=« selected »’ : ‹  ›;
    @@ -42,6 +16,20 @@
    return $options;
    }

+// retourne false si pas de champ defini
+// sinon retourne un tableau des elements du champ
+function tickets_champ_optionnel_actif($nom){

  • $nom = ‹ TICKETS_LISTE › . strtoupper($nom);
  • if (!defined($nom)) {
  • return false;
  • }
  • $liste = constant($nom);
  • if ($liste == ‹  ›) return false;
  • return explode(‹ : ›, $liste);
    +}

// Creation de la liste des options du select d’assignation
function tickets_select_assignation($en_cours){
$options = NULL;
@@ -99,24 +87,17 @@
return bouton_block_depliable($texte,$deplie,$ids);
}

-// Interpretation des valeurs de certains champs de la table ticket
-function tickets_texte_severite ($niveau) {

  • if ($niveau == 1) return « bloquant »;
  • else if ($niveau == 2) return « important »;
  • else if ($niveau == 3) return « normal »;
  • else if ($niveau == 4) return « peu important »;
    -}
    -function tickets_texte_type ($niveau) {
  • if ($niveau == 1) return « problème »;
  • else if ($niveau == 2) return « amélioration »;
  • else if ($niveau == 3) return « tâche »;
    -}
    -function tickets_texte_statut ($niveau) {
  • if ($niveau == « redac ») return « en cours de rédaction »;
  • else if ($niveau == « ouvert ») return « ouvert et discuté »;
  • else if ($niveau == « resolu ») return « résolu »;
  • else if ($niveau == « ferme ») return « fermé »;
    +// creation des fonction de selection de texte
    +// encore en truc a reprendre !
    +foreach (array(‹ severite ›, ‹ type ›, ‹ statut ›) as $nom){

[… 54 lines stripped …]


Spip-zone-commit@rezo.net - http://listes.rezo.net/mailman/listinfo/spip-zone-commit