1 % Task management for Unified Process Methodology
3 % Copyright (c) 2006-2007 Stephane GALLAND <galland@arakhne.org>
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.
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.
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.
20 % Creation date: 2006-04-20
22 % 2009-10-30 Clean code.
23 % 2007-03-19 Add localization.
26 \global\edef\upm@package@task@ver{2009/10/30}
28 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
29 \ProvidesPackage{upmethodology-task}[\upm@package@task@ver]
31 \RequirePackage{upmethodology-p-common}
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}
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}
60 \DeclareOption{french}{%
63 \DeclareOption{francais}{%
66 \DeclareOption{english}{%
67 \upm@task@lang@english
69 \ExecuteOptions{english}
73 \RequirePackage{upmethodology-version}
76 \newif\if@upm@task@displaydescription
77 \newif\if@upm@task@rebuild
78 \@upm@task@rebuildfalse
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}%
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}%
90 \expandafter\xdef\csname upm@task@#1@#2\endcsname{%
91 \csname upm@task@#1@#2\endcsname, #3%
94 \AtEndDocument{\protected@write\@auxout{}{\string\global\string\@namedef{upm@task@#1@#2}{\csname upm@task@#1@#2\endcsname}}}
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}{}%
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}%
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}}} \\}
119 \def\upm@task@currenttask{#1}
121 \if@upm@task@displaydescription\thetaskdescription{\upm@task@currenttask}\fi%
122 \let\upm@task@currenttask\relax%
126 %\begin{taskdescription}{id}...\end{taskdescription}
127 \newenvironment{taskdescription}[1]{%
128 \@upm@task@displaydescriptiontrue%
129 \upm@taskdescription{#1}%
131 \endupm@taskdescription%
135 %\begin{taskdescription*}{id}...\end{taskdescription*}
136 \newenvironment{taskdescription*}[1]{%
137 \@upm@task@displaydescriptionfalse%
138 \upm@taskdescription{#1}%
140 \endupm@taskdescription%
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%
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%
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%
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%
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%
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%
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%
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%
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%
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%
216 %\thetaskdescription{id}
217 \newcommand{\thetaskdescription}[2][\linewidth]{%
218 \ifthenelse{\equal{\csname upm@task@#2@members\endcsname}{\@empty}}{
219 \gdef\upm@task@tmp@a{}%
221 \gdef\upm@task@tmp@a{\upm@task@lang@members: & \multicolumn{2}{X|}{\parbox[t]{1.9\linewidth}{\thetaskmembers{#2}}} \\}%
223 \ifthenelse{\equal{\csname upm@task@#2@milestones\endcsname}{\@empty}}{
224 \gdef\upm@task@tmp@b{}%
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}}%
234 \begin{description}\upm@task@tmp@e\end{description}%
237 \vspace{.25cm}\noindent\begin{mtabular}[#1]{3}{|X|X|X|}
238 \tabulartitle{{\upm@task@lang@task}~\textit{#2}: \thetaskname{#2}}
241 \upm@task@lang@description: & \multicolumn{2}{X|}{\parbox[t]{1.9\linewidth}{\thetaskcomment{#2}}} \\
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}}} \\
248 \upm@task@lang@startat: & \upm@task@lang@endat: & \upm@task@lang@archieved: \\
249 \thetaskstart{#2} & \thetaskend{#2} & \thetaskprogress{#2}\% \\
252 \upm@task@lang@managers: & \multicolumn{2}{X|}{\parbox[t]{1.9\linewidth}{\thetaskmanagers{#2}}} \\
257 %\@nameuse{upm@task@#1@description@milestones}
259 \end{mtabular}\par\vspace{.5cm}%
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%