From: <psy...@us...> - 2007-07-29 20:29:17
|
Update of /cvsroot/frenchmozilla/bugzilla/docs/xml In directory sc8-pr-cvs17:/tmp/cvs-serv27071 Modified Files: customization.xml Log Message: Synchronisation avec la branche BZ_3_0_BRANCH Index: customization.xml =================================================================== RCS file: /cvsroot/frenchmozilla/bugzilla/docs/xml/customization.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- customization.xml 28 Jul 2007 13:48:12 -0000 1.2 +++ customization.xml 29 Jul 2007 20:29:16 -0000 1.3 @@ -470,124 +470,124 @@ d'extensions car chaque extension n'est rien d'autre qu'une simple arborescence de répertoires. </para> - + <para> - There are two main types of hooks: code hooks and template hooks. Code - hooks allow extensions to invoke code at specific points in various - source files, while template hooks allow extensions to add elements to - the Bugzilla user interface. + Il y a deux types principaux de crochetages : le crochetage du code et le crochetage des modèles. Le + crochetage du code permet aux extensions d'invoquer du code sur des points spécifiques dans divers + fichiers sources, alors que le crochetage des modèles permet aux extensions d'ajouter des éléments dans + l'interface utilisateur de Bugzilla. </para> <para> - A hook is just a named place in a standard source or template file - where extension source code or template files for that hook get processed. - Each extension has a corresponding directory in the Bugzilla directory - tree (<filename>BUGZILLA_ROOT/extensions/extension_name</filename>). Hooking - an extension source file or template to a hook is as simple as putting - the extension file into extension's template or code directory. - When Bugzilla processes the source file or template and reaches the hook, - it will process all extension files in the hook's directory. - The hooks themselves can be added into any source file or standard template - upon request by extension authors. + Un crochet est seulement un emplacement nommé dans un fichier source standard ou un modèle + où l'extension des fichiers du code source ou des modèles pour ce crochet sera traité. + Chaque extension à son répertoire lui correspondant dans l'arborescence des répertoires de Bugzilla + (<filename>RACINE_BUGZILLA/extensions/nom_extension</filename>). Crocheter + une extension de fichier source ou de modèle pour un crochet est aussi simple que de mettre + le fichier d'extension dans le répertoire de cette extension. + quand Bugzilla traite le fichier source ou le modèle et atteint le crochet, + il traitera tous les fichiers de l'extension dans le répertoire du crochet. + Les crochets eux-mêmes peuvent être ajoutés à n'importe quel fichier source ou modèle standard + sur requêtes des auteurs d'extensions. </para> <para> - To use hooks to extend Bugzilla, first make sure there is - a hook at the appropriate place within the source file or template you - want to extend. The exact appearance of a hook depends on if the hook - is a code hook or a template hook. + Pour utiliser des crochets afin d'étendre Bugzilla, assurez-vous d'abord qu'il y a + un crochet à l'emplacement approprié dans le fichier source ou le modèle que vous voulez + étendre. L'apparence exacte d'un crochet est fonction de son type : crochet de code ou crochet + de modèle. </para> <para> - Code hooks appear in Bugzilla source files as a single method call - in the format <literal role="code">Bugzilla::Hook->process("<varname>name</varname>");</literal>. - for instance, <filename>enter_bug.cgi</filename> may invoke the hook - "<varname>enter_bug-defaultvars</varname>". Thus, a source file at - <filename>BUGZILLA_ROOT/extensions/EXTENSION_NAME/code/enter_bug-entrydefaultvars.pl</filename> - will be automatically invoked when the code hook is reached. + Les crochets de code apparaissent dans les fichiers sources de Bugzilla source comme un simple appel de + méthode dans le format <literal role="code">Bugzilla::Hook->process("<varname>nom</varname>");</literal>. + Par exemple, <filename>enter_bug.cgi</filename> peut invoquer le crochet + <quote><varname>enter_bug-entrydefaultvars</varname></quote>. Par conséquent, un fichier source dans + <filename>RACINE_BUGZILLA/extensions/NOM_EXTENSION/code/enter_bug-entrydefaultvars.pl</filename> + sera automatiquement invoqué quand le crochet sera atteint. </para> <para> - Template hooks appear in the standard Bugzilla templates as a - single directive in the format - <literal role="code">[% Hook.process("<varname>name</varname>") %]</literal>, - where <varname>name</varname> is the unique name of the hook. + Les crochets de modèle apparaissent dans les modèles standard de Bugzilla comme une simple + directive dans le format + <literal role="code">[% Hook.process("<varname>nom</varname>") %]</literal>, + où <varname>nom</varname> est le nom unique du crochet. </para> <para> - If you aren't sure what you want to extend or just want to browse the - available hooks, either use your favorite multi-file search - tool (e.g. <command>grep</command>) to search the standard templates - for occurrences of <methodname>Hook.process</methodname> or the source - files for occurrences of <methodname>Bugzilla::Hook::process</methodname>. + Si vous n'êtes pas sûr de ce que vous voulez étendre ou si vous voulez seulement parcourir les + crochets disponibles, utilisez votre outil de recherche multi-fichiers préféré + (par ex. <command>grep</command>) pour rechercher les occurrences de + <methodname>Hook.process</methodname> dans les modèles standard ou dans les + fichiers sources pour rechercher <methodname>Bugzilla::Hook::process</methodname>. </para> <para> - If there is no hook at the appropriate place within the Bugzilla - source file or template you want to extend, - <ulink url="http://bugzilla.mozilla.org/enter_bug.cgi?product=Bugzilla&component=User%20Interface">file - a bug requesting one</ulink>, specifying: + S'il n'y a pas de crochet à l'emplacement approprié dans le fichier source ou le modèle de Bugzilla + que vous voulez étendre, + <ulink url="http://bugzilla.mozilla.org/enter_bug.cgi?product=Bugzilla&component=User%20Interface">créez + un bogue pour en demander un</ulink>, en spécifiant : </para> <simplelist> - <member>the source or template file for which you are - requesting a hook;</member> + <member>le fichier source ou le modèle pour lequel + vous demandez un crochet ;</member> <member> - where in the file you would like the hook to be placed - (line number/position for latest version of the file in CVS - or description of location); + où dans le fichier vous voudriez que le crochet soit placé + (position/numéro de la ligne pour la dernière version du fichier dans le CVS + ou une description de l'emplacement) ; </member> - <member>the purpose of the hook;</member> - <member>a link to information about your extension, if any.</member> + <member>le but de ce crochet ;</member> + <member>un lien vers des informations sur votre extension, s'il y en a.</member> </simplelist> <para> - The Bugzilla reviewers will promptly review each hook request, - name the hook, add it to the template or source file, and check - the new version of the template into CVS. + L'équipe de développement de Bugzilla procédera rapidement à la revue de chaque demande de crochet, + nommerra le crochet, l'ajoutera au modèle ou au fichier source et l'intégrera à la nouvelle + version du fichier dans le CVS. </para> <para> - You may optionally attach a patch to the bug which implements the hook - and check it in yourself after receiving approval from a Bugzilla - reviewer. The developers may suggest changes to the location of the - hook based on their analysis of your needs or so the hook can satisfy - the needs of multiple extensions, but the process of getting hooks - approved and checked in is not as stringent as the process for general - changes to Bugzilla, and any extension, whether released or still in - development, can have hooks added to meet their needs. + Vous pouvez aussi joindre un correctif au bogue qui met en œuvre le crochet + et l'intégrer vous même après avoir reçu l'approbation d'un réviseur de code de + Bugzilla. Les développeurs peuvent suggérer des changements de l'emplacement du crochet + basé sur leur analyse de vos besoins ou si le crochet peut satisfaire les + besoins de plusieurs extensions, mais le processus pour obtenir l'approbation et l'intégration des + crochets n'est pas aussi exigeant que le processus pour les changements généraux dans + Bugzilla, et toute extension, qu'elle soit publiée ou en cours + de développement, peut avoir des crochets qui sont ajoutés pour ses besoins. </para> <para> - After making sure the hook you need exists (or getting it added if not), - add your extension to the directory within the Bugzilla - extensions tree corresponding to the hook. + Après vous être assuré que le crochet dont vous avez besoin existe (ou l'avoir fait ajouté s'il n'existait pas), + ajoutez votre extension dans le sous-répertoire <filename>extensions/nom_extensions/</filename> de Bugzilla + correspondant à votre crochet. </para> <para> - That's it! Now, when the source file or template containing the hook - is processed, your extension file will be processed at the point - where the hook appears. + C'est tout ! Maintenant, quand le fichier source ou le modèle contenant le crochet + sera traité, votre fichier d'extension sera traité à l'endroit où + apparaît le crochet. </para> <para> - For example, let's say you have an extension named Projman that adds - project management capabilities to Bugzilla. Projman has an - administration interface <filename>edit-projects.cgi</filename>, - and you want to add a link to it into the navigation bar at the bottom - of every Bugzilla page for those users who are authorized - to administer projects. + Par exemple, imaginons que vous ayez une extension nommée <quote>Projman</quote> qui ajoute des + capacités de gestion de projet dans Bugzilla. <quote>Projman</quote> a une interface + d'administration <filename>edit-projects.cgi</filename>, + et vous voulez ajouter un lien vers celui-ci dans la barre de navigation au bas de chaque + page de Bugzilla pour les utilisateurs autorisés + à administrer les projets. </para> <para> - The navigation bar is generated by the template file - <filename>useful-links.html.tmpl</filename>, which is located in - the <filename>global/</filename> subdirectory on the standard Bugzilla - template path - <filename>BUGZILLA_ROOT/template/en/default/</filename>. - Looking in <filename>useful-links.html.tmpl</filename>, you find - the following hook at the end of the list of standard Bugzilla - administration links: + La barre de navigation est générée par le fichier de modèle + <filename>useful-links.html.tmpl</filename>, qui est situé dans le sous-répertoire + <filename>global/</filename> du répertoire standard des modèles + de Bugzilla + <filename>RACINE_BUGZILLA/template/en/default/</filename>. + En regardant dans le fichier <filename>useful-links.html.tmpl</filename>, vous trouverez + le crochet suivant à la fin de la liste des liens d'administration standard + de Bugzilla : </para> <programlisting><![CDATA[... @@ -597,154 +597,154 @@ ...]]></programlisting> <para> - The corresponding extension file for this hook is - <filename>BUGZILLA_ROOT/extensions/projman/template/en/hook/global/useful-links-edit.html.tmpl</filename>. - You then create that template file and add the following constant: + Le nom du fichier d'extension correspondant pour ce crochet est + <filename>RACINE_BUGZILLA/extensions/projman/template/en/hook/global/useful-links-edit.html.tmpl</filename>. + Créez alors ce fichier et ajoutez la constante suivante : </para> - <programlisting><![CDATA[...[% ', <a href="edit-projects.cgi">projects</a>' IF user.groups.projman_admins %]]]></programlisting> + <programlisting><![CDATA[...[% ', <a href="edit-projects.cgi">projets</a>' IF user.groups.projman_admins %]]]></programlisting> <para> - Voila! The link now appears after the other administration links in the - navigation bar for users in the <literal>projman_admins</literal> group. + Voilà ! Le lien apparaît maintenant à la suite des autres liens de + la barre de navigation pour les utilisateurs appartenant au groupe <literal>projman_admins</literal>. </para> <para> - Now, let us say your extension adds a custom "project_manager" field - to enter_bug.cgi. You want to modify the CGI script to set the default - project manager to be pro...@co.... Looking at - <filename>enter_bug.cgi</filename>, you see the enter_bug-entrydefaultvars - hook near the bottom of the file before the default form values are set. - The corresponding extension source file for this hook is located at - <filename>BUGZILLA_ROOT/extensions/projman/code/enter_bug-entrydefaultvars.pl</filename>. - You then create that file and add the following: + Maintenant, imaginons que votre extension ajoute un champ personnalisé <quote>chef_de_projet</quote> + dans <filename>enter_bug.cgi</filename>. Vous voulez modifier le script CGI pour définir + <quote>nom...@so...</quote> comme chef de projet par défaut. En regardant + <filename>enter_bug.cgi</filename>, vous voyez le crochet <varname>enter_bug-entrydefaultvars</varname> + vers la fin du fichier avant la définition des valeurs par défaut du formulaire. + Le fichier d'extension de code source correspondant pour ce crochet se trouve dans + <filename>RACINE_BUGZILLA/extensions/projman/code/enter_bug-entrydefaultvars.pl</filename>. + Créez ce fichier et ajoutez-y : </para> - <programlisting>$default{'project_manager'} = $product.'@company.com';</programlisting> + <programlisting>$default{'chef_de_projet'} = $product.'@societe.com';</programlisting> <para> - This code will be invoked whenever enter_bug.cgi is executed. - Assuming that the rest of the customization was completed (e.g. the - custom field was added to the enter_bug template and the required hooks - were used in process_bug.cgi), the new field will now have this - default value. + Ce code sera invoqué chaque fois que le fichier <filename>enter_bug.cgi</filename> sera exécuté. + En admettant que le reste de la personnalisation soit terminée (par ex. le champ + personnalisé a été ajouté au modèle <quote>enter_bug</quote> et les crochets nécessaires + ont été utilisés dans <filename>process_bug.cgi</filename>), le nouveau champ aura maintenant cette + valeur par défaut. </para> <para> - Notes: + Notes : </para> <itemizedlist> <listitem> <para> - If your extension includes entirely new templates in addition to - extensions of standard templates, it should store those new - templates in its - <filename>BUGZILLA_ROOT/extensions/template/en/</filename> - directory. Extension template directories, like the - <filename>default/</filename> and <filename>custom/</filename> - directories, are part of the template search path, so putting templates - there enables them to be found by the template processor. + Si votre extension inclut de nouveaux modèles en plus des extensions de + modèles standard existants, vous devrez stocker ces modèles + dans le répertoire + <filename>RACINE_BUGZILLA/extensions/template/en/</filename>. + Les répertoires de modèles, comme + <filename>default/</filename> et <filename>custom/</filename> + font partie du chemin de recherche des modèles, donc en les mettant dans ces + répertoires, les modèles sont trouvés par le processeur de modèles. </para> <para> - The template processor looks for templates first in the - <filename>custom/</filename> directory (i.e. templates added by the - specific installation), then in the <filename>extensions/</filename> - directory (i.e. templates added by extensions), and finally in the - <filename>default/</filename> directory (i.e. the standard Bugzilla - templates). Thus, installation-specific templates override both - default and extension templates. + Le processeur de modèles recherche les modèles d'abord dans le répertoire + <filename>custom/</filename> (c-à-d. les modèles ajoutés par une + installation spécifique), puis le répertoire <filename>extensions/</filename> + (c-à-d. les modèles ajoutés par les extensions) et enfin dans le répertoire + <filename>default/</filename> (c-à-d. les modèles standard de + Bugzilla). Par conséquent, les modèles d'installation spécifiques écrasent ceux des répertoires + <filename>default/</filename> et <filename>extension</filename>. </para> </listitem> <listitem> <para> - If you are looking to customize Bugzilla, you can also take advantage - of template hooks. To do so, create a directory in - <filename>BUGZILLA_ROOT/template/en/custom/hook/</filename> - that corresponds to the hook you wish to use, then place your - customization templates into those directories. For example, - if you wanted to use the hook "end" in - <filename>global/useful-links.html.tmpl</filename>, you would - create the directory <filename>BUGZILLA_ROOT/template/en/custom/hook/ - global/useful-links.html.tmpl/end/</filename> and add your customization - template to this directory. + Si vous cherchez à personnaliser Bugzilla, vous pouvez aussi tirer avantage + des crochets de modèles. Pour ce faire, créez un répertoire dans + <filename>RACINE_BUGZILLA/template/en/custom/hook/</filename> + qui correspond au crochet que vous voulez utiliser, puis placez vos modèles + personnalisés dans ces répertoires. Par exemple, + si vous voulez utiliser le crochet <quote>end</quote> dans + <filename>global/useful-links.html.tmpl</filename>, vous devez créer le répertoire + <filename>RACINE_BUGZILLA/template/en/custom/hook/ + global/useful-links.html.tmpl/end/</filename> et ajouter votre modèle + personnalisé dans ce répertoire. </para> <para> - Obviously this method of customizing Bugzilla only lets you add code - to the standard source files and templates; you cannot change the - existing code. Nevertheless, for those customizations that only add - code, this method can reduce conflicts when merging changes, - making upgrading your customized Bugzilla installation easier. + Évidemment, cette méthode de personnalisation de Bugzilla ne permet que d'ajouter du code + aux fichiers sources et modèles standard ; vous ne pouvez pas changer le code + existant. Néanmoins, pour les personnalisations qui ne font qu'ajouter du + code, cette méthode peut réduire les conflits lors de la fusion de changements, + rendant la mise à jour d'une installation Bugzilla personnalisée plus facile. </para> </listitem> - </itemizedlist> + </itemizedlist> </section> <section id="cust-change-permissions"> - <title>Customizing Who Can Change What</title> + <title>Personnaliser qui peut changer quoi</title> <warning> <para> - This feature should be considered experimental; the Bugzilla code you - will be changing is not stable, and could change or move between - versions. Be aware that if you make modifications as outlined here, - you may have - to re-make them or port them if Bugzilla changes internally between - versions, and you upgrade. + Cette fonctionnalité doit être considérée comme expérimentale ; le code Bugzilla que vous + changerez n'est pas stable et pourrait être modifié ou déplacé entre les + versions. Soyez conscients que les modifications que vous pourront être à refaire ou à porter + si des modifications du code + interne de Bugzilla sont faites entre les + versions et que vous faites une mises à jour de Bugzilla. </para> </warning> <para> - Companies often have rules about which employees, or classes of employees, - are allowed to change certain things in the bug system. For example, - only the bug's designated QA Contact may be allowed to VERIFY the bug. - Bugzilla has been - designed to make it easy for you to write your own custom rules to define - who is allowed to make what sorts of value transition. + Les sociétés ont souvent des règles pour déterminer quels employés ou classes d'employés + sont autorisés à modifier certaines choses dans le système de suivi de bogues. Par exemple, + seul le contact QA désigné peut être autorisé à marquer le bogue VÉRIFIÉ. + Bugzilla a été conçu + pour vous faciliter la tâche d'écrire vos propres règles pour définir + qui est autorisé à faire certains types de modifications. </para> <para> - For maximum flexibility, customizing this means editing Bugzilla's Perl - code. This gives the administrator complete control over exactly who is - allowed to do what. The relevant method is called - <filename>check_can_change_field()</filename>, - and is found in <filename>Bug.pm</filename> in your - Bugzilla/ directory. If you open that file and search for - <quote>sub check_can_change_field</quote>, you'll find it. + Pour une flexibilité maximale, personnaliser cela signifie de modifier le code Perl de Bugzilla. + Ceci donne à l'administrateur le contrôle total sur ce que chacun + peut faire. La méthode pour réaliser cela s'appelle + <methodname>check_can_change_field()</methodname>, + et se trouve dans le fichier <filename>Bug.pm</filename> de votre répertoire + <filename>Bugzilla/</filename>. Si vous ouvrez ce fichier pour y rechercher + <quote>sub check_can_change_field</quote>, vous la trouverez. </para> <para> - This function has been carefully commented to allow you to see exactly - how it works, and give you an idea of how to make changes to it. - Certain marked sections should not be changed - these are - the <quote>plumbing</quote> which makes the rest of the function work. - In between those sections, you'll find snippets of code like: + Cette méthode a été soigneusement commentée pour vous permettre de voir exactement + comment elle fonctionne et vous donner une idée sur la façon de la modifier. + Certaines sections identifiées ne doivent pas être modifiées - c'est le + <quote>squelette</quote> qui permet au reste de la fonction de fonctionner. + Entre ces sections, vous trouverez des morceaux de code comme : <programlisting> # Allow the assignee to change anything. if ($ownerid eq $whoid) { return 1; }</programlisting> - It's fairly obvious what this piece of code does. - </para> - + Il est évident de savoir ce que cette partie de code fait. + </para> + <para> - So, how does one go about changing this function? Well, simple changes - can be made just by removing pieces - for example, if you wanted to - prevent any user adding a comment to a bug, just remove the lines marked - <quote>Allow anyone to change comments.</quote> If you don't want the - Reporter to have any special rights on bugs they have filed, just - remove the entire section that deals with the Reporter. + Alors, comment modifier cette fonction ? Certains changements simples peuvent être accomplis + en supprimant quelques parties - par exemple, si vous voulez empêcher + un utilisateur d'ajouter un commentaire à un bogue, supprimez les lignes marquées + <quote>Allow anyone to change comments.</quote> Si vous ne voulez pas que le rapporteur + ait des droits spéciaux sur les bogues qu'il a rapporté, supprimez + toute la section concernant le rapporteur. </para> <para> - More complex customizations are not much harder. Basically, you add - a check in the right place in the function, i.e. after all the variables - you are using have been set up. So, don't look at $ownerid before - $ownerid has been obtained from the database. You can either add a - positive check, which returns 1 (allow) if certain conditions are true, - or a negative check, which returns 0 (deny.) E.g.: + Des personnalisations plus complexes ne sont pas beaucoup plus difficiles. En gros, vous ajoutez un point + de vérification au bon endroit dans la fonction, c-à-d. après que toutes les variables + que vous utilisez ont été définies. Aussi, ne cherchez pas <quote>$ownerid</quote> avant que + cette variable n'ait été obtenue de la base de données. Vous pouvez ajouter soit un point de vérification + positif, qui renvoie <quote>1</quote> (autoriser) si certaines conditions sont vérifiées, + soit un point de vérification négatif, qui renvoie <quote>0</quote> (refuser). Par ex. : <programlisting> if ($field eq "qacontact") { if (Bugzilla->user->groups("quality_assurance")) { return 1; @@ -753,14 +753,14 @@ return 0; } }</programlisting> - This says that only users in the group "quality_assurance" can change - the QA Contact field of a bug. + Ceci signifie que seuls les utilisateurs du groupe <quote>quality_assurance</quote> peuvent changer + le champ <quote>Contact QA</quote> d'un bogue. </para> <para> - Getting more weird: + Plus bizarre : <programlisting><![CDATA[ if (($field eq "priority") && - (Bugzilla->user->email =~ /.*\@example\.com$/)) + (Bugzilla->user->email =~ /.*\@exemple\.com$/)) { if ($oldvalue eq "P1") { return 1; @@ -769,26 +769,26 @@ return 0; } }]]></programlisting> - This says that if the user is trying to change the priority field, - and their email address is @example.com, they can only do so if the - old value of the field was "P1". Not very useful, but illustrative. + Ceci signifie que si l'utilisateur essaie de changer le champ <quote>Priorité</quote>, + et que son adresse électronique est <quote>…@exemple.com</quote>, il ne peut le faire que si + l'ancienne valeur du champ était <quote>P1</quote>. Pas très utile, mais illustratif. </para> <warning> <para> - If you are modifying <filename>process_bug.cgi</filename> in any - way, do not change the code that is bounded by DO_NOT_CHANGE blocks. - Doing so could compromise security, or cause your installation to - stop working entirely. + Si vous modifiez le fichier <filename>process_bug.cgi</filename>, + ne changez pas les blocs de code marqués <quote>DO_NOT_CHANGE</quote>. + Si vous le faites, cela compromettra la sécurité de votre installation ou provoquera empêchera votre + de fonctionner. </para> </warning> - + <para> - For a list of possible field names, look at the bugs table in the - database. If you need help writing custom rules for your organization, - ask in the newsgroup. - </para> - </section> + Pour une liste des noms de champs possibles, consultez la table <quote>bugs</quote> dans la base de données. + Si vous avez besoin d'aide pour écrire des règles personnalisées pour votre organisation, + demandez de l'aide sur le forum. + </para> + </section> <!-- Integrating Bugzilla with Third-Party Tools --> &integration; |