xref: /plugin/bez/tpl/8d.php (revision 620500d93209054c714c6d45d7a949ff2dfd2a1a)
1e8827d73SSzymon Olewniczak<?php /* @var \dokuwiki\plugin\bez\meta\Tpl $tpl */ ?>
2c8bd19cbSSzymon Olewniczak<?php $D = 2 ?>
3c8bd19cbSSzymon Olewniczak<?php if (count($tpl->get('8d_tasks')['correction']) > 0) $D++ ?>
479fbde34SSzymon Olewniczak<?php if (count($tpl->get('causes')) > 0) $D++ ?>
5c8bd19cbSSzymon Olewniczak<?php if (count($tpl->get('8d_tasks')['corrective']) > 0) $D++ ?>
679fbde34SSzymon Olewniczak<?php if (count($tpl->get('risks')) > 0 || count($tpl->get('opportunities')) > 0) $D++ ?>
7c8bd19cbSSzymon Olewniczak<?php if (count($tpl->get('8d_tasks')['preventive']) > 0) $D++ ?>
81fad0229SSzymon Olewniczak<?php if ($tpl->get('thread')->state == 'closed' || $tpl->get('thread')->state == 'rejected') $D++ ?>
9c8bd19cbSSzymon Olewniczak
10e8fc7594Sghi<h1>
11*620500d9SSzymon Olewniczak    <?php if ($tpl->get('variant') == 2): ?>
12c8bd19cbSSzymon Olewniczak	    <?php printf($tpl->getLang('8d_report_header'), $D); ?>
13*620500d9SSzymon Olewniczak    <?php else: ?>
14*620500d9SSzymon Olewniczak        <?php echo $tpl->getLang('noneconformities_report') ?>
15*620500d9SSzymon Olewniczak    <?php endif ?>
16e8fc7594Sghi	<span id="bez_8d_send_button">[<a href="
17e8827d73SSzymon Olewniczak		<?php echo $tpl->mailto('',
18e8827d73SSzymon Olewniczak   $tpl->getLang('8d_report').': #'.$tpl->get('thread')->id.' '.$tpl->get('thread')->title,
192467512fSSzymon Olewniczak            $tpl->url('8d', 'id', $tpl->get('thread')->id) . '?t=' . $_GET['t']) ?>">
20e8827d73SSzymon Olewniczak<?php echo $tpl->getLang('send_mail') ?>
21e8fc7594Sghi	</a>]</span>
22e8fc7594Sghi</h1>
23f2f5b3feSghi
24f2f5b3feSghi<table>
25f2f5b3feSghi<tr>
26f2f5b3feSghi	<td>
2738ce6055Sghi		 <strong>
28e8827d73SSzymon Olewniczak		 	<a href="<?php echo $tpl->url('thread', 'id', $tpl->get('thread')->id) ?>">
29e8827d73SSzymon Olewniczak				#<?php echo  $tpl->get('thread')->id ?>
3038ce6055Sghi			</a>
3138ce6055Sghi		</strong>
32e8827d73SSzymon Olewniczak        <?php if (!empty($tpl->get('thread')->label_name)): ?>
33e8827d73SSzymon Olewniczak            <?php echo $tpl->get('thread')->label_name ?>
34e8827d73SSzymon Olewniczak        <?php else: ?>
35e8827d73SSzymon Olewniczak            <i style="color: #777"><?php echo $tpl->getLang('issue_type_no_specified') ?></i>
36e8827d73SSzymon Olewniczak        <?php endif ?>
37f2f5b3feSghi	</td>
38f2f5b3feSghi
39f2f5b3feSghi	<td>
40e8827d73SSzymon Olewniczak		<strong><?php echo $tpl->getLang('open_date') ?>:</strong>
41ff14b107SSzymon Olewniczak        <?php echo $tpl->date($tpl->get('thread')->create_date) ?>
42f2f5b3feSghi	</td>
43f2f5b3feSghi</tr>
44f2f5b3feSghi
45f2f5b3feSghi	<tr>
469fbfe943Sghi	<td colspan="2">
47e8827d73SSzymon Olewniczak		<strong><?php echo $tpl->getLang('title') ?>:</strong>
48e8827d73SSzymon Olewniczak		<?php echo  $tpl->get('thread')->title ?>
49f2f5b3feSghi	</td>
50f2f5b3feSghi</tr>
51f2f5b3feSghi</table>
52e2b0e8caSSzymon Olewniczak<?php $D = 1 ?>
53e8827d73SSzymon Olewniczak<h2><?php echo $D++ ?>D - <?php echo $tpl->getLang('1d') ?></h2>
5466b54849Sghi<ul>
55e8827d73SSzymon Olewniczak	<?php foreach($tpl->get('thread')->get_participants() as $participant): ?>
56e8827d73SSzymon Olewniczak		<li><?php echo $tpl->user_name($participant['user_id']) ?></li>
5766b54849Sghi	<?php endforeach ?>
5866b54849Sghi</ul>
59f2f5b3feSghi
60e8827d73SSzymon Olewniczak<h2><?php echo $D++ ?>D - <?php echo $tpl->getLang('2d') ?></h2>
61e8827d73SSzymon Olewniczak<?php echo $tpl->get('thread')->content_html ?>
62f2f5b3feSghi
63e8827d73SSzymon Olewniczak<?php if (count($tpl->get('8d_tasks')['correction']) > 0): ?>
64e8827d73SSzymon Olewniczak    <h2><?php echo $D++ ?>D - <?php echo $tpl->getLang('3d') ?></h2>
65e8827d73SSzymon Olewniczak    <?php $tpl->set('tasks', $tpl->get('8d_tasks')['correction']) ?>
6644189046SSzymon Olewniczak    <?php include '8d_tasks.php' ?>
67e2b0e8caSSzymon Olewniczak<?php endif ?>
68683e6b20Sghi
6979fbde34SSzymon Olewniczak<?php if (count($tpl->get('causes')) > 0): ?>
70e8827d73SSzymon Olewniczak    <h2><?php echo $D++ ?>D - <?php echo $tpl->getLang('4d') ?></h2>
7179fbde34SSzymon Olewniczak    <?php $tpl->set('causes', $tpl->get('causes')) ?>
7244189046SSzymon Olewniczak    <?php include '8d_causes.php' ?>
73e2b0e8caSSzymon Olewniczak<?php endif ?>
7438ce6055Sghi
75e8827d73SSzymon Olewniczak<?php if (count($tpl->get('8d_tasks')['corrective']) > 0): ?>
76e8827d73SSzymon Olewniczak    <h2><?php echo $D++ ?>D - <?php echo $tpl->getLang('5d') ?></h2>
77*620500d9SSzymon Olewniczak    <?php if ($tpl->get('variant') == 2): ?>
78*620500d9SSzymon Olewniczak        <?php $tpl->set('tasks', $tpl->get('8d_tasks')['corrective']) ?>
79*620500d9SSzymon Olewniczak        <?php include '8d_tasks_no_closing.php' ?>
80*620500d9SSzymon Olewniczak    <?php else: ?>
81e8827d73SSzymon Olewniczak        <?php $tpl->set('tasks', $tpl->get('8d_tasks')['corrective']) ?>
8244189046SSzymon Olewniczak        <?php include '8d_tasks.php' ?>
83e2b0e8caSSzymon Olewniczak    <?php endif ?>
84*620500d9SSzymon Olewniczak<?php endif ?>
85f2f5b3feSghi
86*620500d9SSzymon Olewniczak
87*620500d9SSzymon Olewniczak<?php if ($tpl->get('variant') == 2): ?>
88*620500d9SSzymon Olewniczak    <h2><?php echo $D++ ?>D - <?php echo $tpl->getLang('6d-var2') ?></h2>
89*620500d9SSzymon Olewniczak    <?php $tpl->set('tasks', $tpl->get('8d_tasks')['corrective']) ?>
90*620500d9SSzymon Olewniczak    <?php include '8d_tasks.php' ?>
91*620500d9SSzymon Olewniczak<?php else: ?>
9279fbde34SSzymon Olewniczak    <?php if (count($tpl->get('risks')) > 0 || count($tpl->get('opportunities')) > 0): ?>
93e8827d73SSzymon Olewniczak        <h2><?php echo $D++ ?>D - <?php echo $tpl->getLang('6d') ?></h2>
9479fbde34SSzymon Olewniczak        <?php if (count($tpl->get('risks')) > 0): ?>
9579fbde34SSzymon Olewniczak            <h3><?php echo $tpl->getLang('risks') ?></h3>
9679fbde34SSzymon Olewniczak            <?php $tpl->set('causes', $tpl->get('risks')) ?>
9744189046SSzymon Olewniczak            <?php include '8d_causes.php' ?>
98e2b0e8caSSzymon Olewniczak        <?php endif ?>
9979fbde34SSzymon Olewniczak        <?php if (count($tpl->get('opportunities')) > 0): ?>
10079fbde34SSzymon Olewniczak            <h3><?php echo $tpl->getLang('opportunities') ?></h3>
10179fbde34SSzymon Olewniczak            <?php $tpl->set('causes', $tpl->get('opportunities')) ?>
10279fbde34SSzymon Olewniczak            <?php include '8d_causes.php' ?>
10379fbde34SSzymon Olewniczak        <?php endif ?>
10479fbde34SSzymon Olewniczak    <?php endif ?>
105*620500d9SSzymon Olewniczak<?php endif ?>
106*620500d9SSzymon Olewniczak
107f2f5b3feSghi
108e8827d73SSzymon Olewniczak<?php if (count($tpl->get('8d_tasks')['preventive']) > 0): ?>
109e8827d73SSzymon Olewniczak    <h2><?php echo $D++ ?>D - <?php echo $tpl->getLang('7d') ?></h2>
110e8827d73SSzymon Olewniczak    <?php $tpl->set('tasks', $tpl->get('8d_tasks')['preventive']) ?>
11144189046SSzymon Olewniczak    <?php include '8d_tasks.php' ?>
112e2b0e8caSSzymon Olewniczak<?php endif ?>
1130e31399aSSzymon Olewniczak
114e2b0e8caSSzymon Olewniczak
115bf67f2caSSzymon Olewniczak<?php if ($tpl->get('thread')->state == 'closed' || $tpl->get('thread')->state == 'rejected'): ?>
116bf67f2caSSzymon Olewniczak    <h2><?php echo $D++ ?>D - <?php echo $tpl->getLang('8d') ?></h2>
117bf67f2caSSzymon Olewniczak    <?php echo  $tpl->get('thread')->closing_comment() ?>
118bf67f2caSSzymon Olewniczak    <table>
119bf67f2caSSzymon Olewniczak        <tr>
120bf67f2caSSzymon Olewniczak            <td>
121bf67f2caSSzymon Olewniczak                <strong><?php echo $tpl->getLang('true_date') ?>:</strong>
122bf67f2caSSzymon Olewniczak                <?php echo $tpl->date($tpl->get('thread')->close_date) ?>
123bf67f2caSSzymon Olewniczak            </td>
124bf67f2caSSzymon Olewniczak            <td>
125bf67f2caSSzymon Olewniczak                <strong><?php echo $tpl->getLang('state') ?>:</strong>
126bf67f2caSSzymon Olewniczak                <?php echo $tpl->getLang('state_' . $tpl->get('thread')->state) ?>
127bf67f2caSSzymon Olewniczak            </td>
128bf67f2caSSzymon Olewniczak        </tr>
129bf67f2caSSzymon Olewniczak
130bf67f2caSSzymon Olewniczak        <tr>
131bf67f2caSSzymon Olewniczak            <td>
132bf67f2caSSzymon Olewniczak                <strong><?php echo $tpl->getLang('totalcost') ?>:</strong>
133bf67f2caSSzymon Olewniczak                <?php if ($tpl->get('thread')->task_sum_cost != ''): ?>
134bf67f2caSSzymon Olewniczak                    <?php echo $tpl->get('thread')->task_sum_cost ?>
135bf67f2caSSzymon Olewniczak                <?php else: ?>
136bf67f2caSSzymon Olewniczak                    <em>---</em>
137bf67f2caSSzymon Olewniczak                <?php endif ?>
138bf67f2caSSzymon Olewniczak            </td>
139bf67f2caSSzymon Olewniczak            <td>
140bf67f2caSSzymon Olewniczak                <strong><?php echo $tpl->getLang('coordinator') ?>:</strong>
141bf67f2caSSzymon Olewniczak                <?php echo $tpl->user_name($tpl->get('thread')->coordinator) ?>
142bf67f2caSSzymon Olewniczak            </td>
143bf67f2caSSzymon Olewniczak        </tr>
144bf67f2caSSzymon Olewniczak    </table>
145bf67f2caSSzymon Olewniczak<?php endif ?>
146