]> AND Private Git Repository - these_kahina.git/blob - upmethodology-task.sty
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
le chapitre 1
[these_kahina.git] / upmethodology-task.sty
1 % Task management for Unified Process Methodology
2 %
3 % Copyright (c) 2006-2007 Stephane GALLAND <galland@arakhne.org>
4
5 % This program is free library; you can redistribute it and/or modify
6 % it under the terms of the GNU Lesser General Public License as
7 % published by the Free Software Foundation; either version 3 of the
8 % License, or any later version.
9 %
10 % This library is distributed in the hope that it will be useful, but
11 % WITHOUT ANY WARRANTY; without even the implied warranty of
12 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 % Lesser General Public License for more details.
14 %
15 % You should have received a copy of the GNU Lesser General Public
16 % License along with this library; see the file COPYING.  If not,
17 % write to the Free Software Foundation, Inc., 59 Temple Place - Suite
18 % 330, Boston, MA 02111-1307, USA.
19 %
20 % Creation date: 2006-04-20
21 % Modifications:
22 %   2009-10-30   Clean code.
23 %   2007-03-19   Add localization.
24 %
25
26 \global\edef\upm@package@task@ver{2009/10/30}
27
28 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
29 \ProvidesPackage{upmethodology-task}[\upm@package@task@ver]
30
31 \RequirePackage{upmethodology-p-common}
32
33 %----- LOCALIZATION
34 \def\upm@task@lang@english{
35   \gdef\upm@lang@@{\message{**** upmethodology-task is using English language ****}}%
36   \gdef\upm@task@lang@task{Task}
37   \gdef\upm@task@lang@description{Description}
38   \gdef\upm@task@lang@startat{Start at}
39   \gdef\upm@task@lang@endat{End at}
40   \gdef\upm@task@lang@archieved{Archieved}
41   \gdef\upm@task@lang@managers{Managers}
42   \gdef\upm@task@lang@members{Members}
43   \gdef\upm@task@lang@milestones{Milestones}
44   \gdef\upm@task@lang@subtask{Sub-task of}
45 }
46 \def\upm@task@lang@french{
47   \gdef\upm@lang@@{\message{**** upmethodology-task is using French language ****}}%
48   \gdef\upm@task@lang@task{T\^ache}
49   \gdef\upm@task@lang@description{Description}
50   \gdef\upm@task@lang@startat{D\'ebut le}
51   \gdef\upm@task@lang@endat{Fin le}
52   \gdef\upm@task@lang@archieved{Termin\'ee}
53   \gdef\upm@task@lang@managers{R\'ef\'erent}
54   \gdef\upm@task@lang@members{Membres}
55   \gdef\upm@task@lang@milestones{\'Etapes}
56   \gdef\upm@task@lang@subtask{Sous-t\^ache de}
57 }
58
59 %----- OPTIONS
60 \DeclareOption{french}{%
61   \upm@task@lang@french
62 }
63 \DeclareOption{francais}{%
64   \upm@task@lang@french
65 }
66 \DeclareOption{english}{%
67   \upm@task@lang@english
68 }
69 \ExecuteOptions{english}
70 \ProcessOptions
71 \upm@lang@@
72
73 \RequirePackage{upmethodology-version}
74
75 %----- 
76 \newif\if@upm@task@displaydescription
77 \newif\if@upm@task@rebuild
78 \@upm@task@rebuildfalse
79
80 \def\upm@task@define#1#2#3{%
81         \protected@write\@auxout{}{\string\global\string\@namedef{upm@task@#1@#2}{#3}}%
82         \ifthenelse{\equal{\csname upm@task@#1@#2\endcsname}{#3}}{}{\@upm@task@rebuildtrue}%
83         \global\@namedef{upm@task@#1@#2}{#3}%
84 }
85
86 \def\upm@task@define@list#1#2#3{%
87         \ifthenelse{\equal{\csname upm@task@#1@#2\endcsname}{\@empty}}{%
88                 \expandafter\xdef\csname upm@task@#1@#2\endcsname{#3}%
89         }{%
90                 \expandafter\xdef\csname upm@task@#1@#2\endcsname{%
91                         \csname upm@task@#1@#2\endcsname, #3%
92                 }%
93         }%
94         \AtEndDocument{\protected@write\@auxout{}{\string\global\string\@namedef{upm@task@#1@#2}{\csname upm@task@#1@#2\endcsname}}}
95 }
96
97 \newenvironment{upm@taskdescription}[1]{%
98         \global\@namedef{upm@task@#1@managers}{}%
99         \global\@namedef{upm@task@#1@members}{}%
100         \global\@namedef{upm@task@#1@milestones}{}%
101
102         \newcommand{\taskname}[1]{\upm@task@define{#1}{name}{##1}}
103         \newcommand{\tasksuper}[1]{\upm@task@define{#1}{super}{##1}}
104         \newcommand{\taskcomment}[1]{\upm@task@define{#1}{comment}{##1}}%
105         \newcommand{\taskprogress}[1]{\upm@task@define{#1}{progress}{##1}}%
106         \newcommand{\taskstart}[1]{\upm@task@define{#1}{startat}{##1}}%
107         \newcommand{\taskend}[1]{\upm@task@define{#1}{endat}{##1}}%
108         \newcommand{\taskmanager}[1]{\upm@task@define@list{#1}{managers}{##1}}
109         \newcommand{\taskmember}[1]{%
110                 \upm@task@define@list{#1}{members}{##1}%
111         }
112         \newcommand{\taskmilestone}[2]{%
113                 \upm@task@define@list{#1}{milestones}{##1}%
114                 \upm@task@define{#1}{ml@##1}{##2}%
115                 %\global\@namedef{upm@task@#1@description@milestones}{\upm@task@lang@milestones: & \multicolumn{2}{X|}{\parbox[t]{1.9\linewidth}{\thetaskmembers{#1}}} \\}
116         }
117
118
119         \def\upm@task@currenttask{#1}
120 }{%
121         \if@upm@task@displaydescription\thetaskdescription{\upm@task@currenttask}\fi%
122         \let\upm@task@currenttask\relax%
123 }
124
125 %-----
126 %\begin{taskdescription}{id}...\end{taskdescription}
127 \newenvironment{taskdescription}[1]{%
128         \@upm@task@displaydescriptiontrue%
129         \upm@taskdescription{#1}%
130 }{%
131         \endupm@taskdescription%
132 }
133
134 %-----
135 %\begin{taskdescription*}{id}...\end{taskdescription*}
136 \newenvironment{taskdescription*}[1]{%
137         \@upm@task@displaydescriptionfalse%
138         \upm@taskdescription{#1}%
139 }{%
140         \endupm@taskdescription%
141 }
142
143 %-----
144 %\thetasksuper{id}
145 \newcommand{\thetasksuper}[1]{%
146         \expandafter\providecommand\csname upm@task@#1@super\endcsname{??\@latex@warning{The task identified by '#1' was not found.}\@upm@task@rebuildtrue}%
147         \expandafter\csname upm@task@#1@super\endcsname%
148 }
149
150 %-----
151 %\thetaskname{id}
152 \newcommand{\thetaskname}[1]{%
153         \expandafter\providecommand\csname upm@task@#1@name\endcsname{??\@latex@warning{The task identified by '#1' was not found.}\@upm@task@rebuildtrue}%
154         \expandafter\csname upm@task@#1@name\endcsname%
155 }
156
157 %-----
158 %\thetaskcomment{id}
159 \newcommand{\thetaskcomment}[1]{%
160         \expandafter\providecommand\csname upm@task@#1@comment\endcsname{??\@latex@warning{The task identified by '#1' was not found.}\@upm@task@rebuildtrue}%
161         \expandafter\csname upm@task@#1@comment\endcsname%
162 }
163
164 %-----
165 %\thetaskprogress{id}
166 \newcommand{\thetaskprogress}[1]{%
167         \expandafter\providecommand\csname upm@task@#1@progress\endcsname{??\@latex@warning{The task identified by '#1' was not found.}\@upm@task@rebuildtrue}%
168         \expandafter\csname upm@task@#1@progress\endcsname%
169 }
170
171 %-----
172 %\thetaskstart{id}
173 \newcommand{\thetaskstart}[1]{%
174         \expandafter\providecommand\csname upm@task@#1@startat\endcsname{??\@latex@warning{The task identified by '#1' was not found.}\@upm@task@rebuildtrue}%
175         \expandafter\csname upm@task@#1@startat\endcsname%
176 }
177
178 %-----
179 %\thetaskend{id}
180 \newcommand{\thetaskend}[1]{%
181         \expandafter\providecommand\csname upm@task@#1@endat\endcsname{??\@latex@warning{The task identified by '#1' was not found.}\@upm@task@rebuildtrue}%
182         \expandafter\csname upm@task@#1@endat\endcsname%
183 }
184
185 %-----
186 %\thetaskmanagers{id}
187 \newcommand{\thetaskmanagers}[1]{%
188         \expandafter\providecommand\csname upm@task@#1@managers\endcsname{??\@latex@warning{The task identified by '#1' was not found.}\@upm@task@rebuildtrue}%
189         \expandafter\csname upm@task@#1@managers\endcsname%
190 }
191
192 %-----
193 %\thetaskmembers{id}
194 \newcommand{\thetaskmembers}[1]{%
195         \expandafter\providecommand\csname upm@task@#1@members\endcsname{??\@latex@warning{The task identified by '#1' was not found.}\@upm@task@rebuildtrue}%
196         \expandafter\csname upm@task@#1@members\endcsname%
197 }
198
199 %-----
200 %\thetaskmilestones{id}
201 \newcommand{\thetaskmilestones}[1]{%
202         \expandafter\providecommand\csname upm@task@#1@milestones\endcsname{??\@latex@warning{The task identified by '#1' was not found.}\@upm@task@rebuildtrue}%
203         \expandafter\csname upm@task@#1@milestones\endcsname%
204 }
205
206 %-----
207 %\thetaskmilestonecomment{id}{date}
208 \newcommand{\thetaskmilestonecomment}[2]{%
209         \expandafter\providecommand\csname upm@task@#1@ml@#2\endcsname{??\@latex@warning{The task milestone identified by '#1' and '#2' was not found.}\@upm@task@rebuildtrue}%
210         \expandafter\csname upm@task@#1@ml@#2\endcsname%
211 }
212
213 \def\@upm@trim#1{#1}
214
215 %-----
216 %\thetaskdescription{id}
217 \newcommand{\thetaskdescription}[2][\linewidth]{%
218         \ifthenelse{\equal{\csname upm@task@#2@members\endcsname}{\@empty}}{
219                 \gdef\upm@task@tmp@a{}%
220         }{%
221                 \gdef\upm@task@tmp@a{\upm@task@lang@members: & \multicolumn{2}{X|}{\parbox[t]{1.9\linewidth}{\thetaskmembers{#2}}} \\}%
222         }%
223         \ifthenelse{\equal{\csname upm@task@#2@milestones\endcsname}{\@empty}}{
224                 \gdef\upm@task@tmp@b{}%
225         }{%
226                 \gdef\upm@task@tmp@b{\hline \upm@task@lang@milestones: &%
227                 \multicolumn{2}{X|}{\parbox[t]{1.95\linewidth}{%
228                 \edef\upm@task@tmp@c{\csname upm@task@#2@milestones\endcsname}%
229                 \def\upm@task@tmp@e{}%
230                 \@for\reserved@a:=\upm@task@tmp@c\do{%
231                         \edef\upm@task@tmp@d{\expandafter\@upm@trim\reserved@a}%
232                         \protected@edef\upm@task@tmp@e{\upm@task@tmp@e \protect\item[\upm@task@tmp@d~:] \protect\thetaskmilestonecomment{#2}{\upm@task@tmp@d}}%
233                 }%
234                 \begin{description}\upm@task@tmp@e\end{description}%
235                 }} \\}%
236         }%
237         \vspace{.25cm}\noindent\begin{mtabular}[#1]{3}{|X|X|X|}
238                 \tabulartitle{{\upm@task@lang@task}~\textit{#2}: \thetaskname{#2}}
239                 \hline
240                 %description
241                 \upm@task@lang@description: & \multicolumn{2}{X|}{\parbox[t]{1.9\linewidth}{\thetaskcomment{#2}}} \\
242                 %sub-task
243                 \expandafter\ifx\csname upm@task@#2@super\endcsname\relax\else%
244                 \upm@task@lang@subtask: & \multicolumn{2}{X|}{\parbox[t]{1.9\linewidth}{{\upm@task@lang@task}~\textit{\csname upm@task@#2@super\endcsname}}} \\
245                 \fi
246                 \hline
247                 %dates
248                 \upm@task@lang@startat: & \upm@task@lang@endat: & \upm@task@lang@archieved: \\
249                 \thetaskstart{#2} & \thetaskend{#2} & \thetaskprogress{#2}\% \\
250                 \hline
251                 %manager
252                 \upm@task@lang@managers: & \multicolumn{2}{X|}{\parbox[t]{1.9\linewidth}{\thetaskmanagers{#2}}} \\
253                 %members
254                 \upm@task@tmp@a
255                 %milestones
256                 \upm@task@tmp@b
257                 %\@nameuse{upm@task@#1@description@milestones}
258                 \hline
259         \end{mtabular}\par\vspace{.5cm}%
260 }
261
262 \AtEndDocument{%
263         \if@upm@task@rebuild%
264         \@latex@warning@no@line{Project Task(s) may have changed.\MessageBreak%
265         Rerun to get cross-references right}\fi%
266
267 }
268 \endinput