Code Duplication    Length = 8-8 lines in 5 locations

src/projects/tclone.php 1 location

@@ 192-199 (lines=8) @@
189
190
$rs = dal_query('projects/list.sql', 'project_name');
191
192
while (($row = $rs->fetch()))
193
{
194
    $xml .= ($row['project_id'] == $project_id
195
                ? '<listitem value="' . $row['project_id'] . '" selected="true">'
196
                : '<listitem value="' . $row['project_id'] . '">')
197
          . ustr2html($row['project_name'])
198
          . '</listitem>';
199
}
200
201
$xml .= '</combobox>'
202
      . '</control>'

src/records/create.php 2 locations

@@ 401-408 (lines=8) @@
398
        debug_write_log(DEBUG_NOTICE, 'One project only is found.');
399
    }
400
401
    while (($row = $rs->fetch()))
402
    {
403
        $xml .= ($parent && $parent['project_id'] == $row['project_id']
404
                    ? '<listitem value="' . $row['project_id'] . '" selected="true">'
405
                    : '<listitem value="' . $row['project_id'] . '">')
406
              . ustr2html($row['project_name'])
407
              . '</listitem>';
408
    }
409
410
    $xml .= '</combobox>'
411
          . '</control>';
@@ 444-451 (lines=8) @@
441
            debug_write_log(DEBUG_NOTICE, 'One template only is found.');
442
        }
443
444
        while (($row = $rs->fetch()))
445
        {
446
            $xml .= ($parent && $parent['template_id'] == $row['template_id']
447
                        ? '<listitem value="' . $row['template_id'] . '" selected="true">'
448
                        : '<listitem value="' . $row['template_id'] . '">')
449
                  . ustr2html($row['template_name'])
450
                  . '</listitem>';
451
        }
452
453
        $xml .= '</combobox>'
454
              . '</control>';

src/reminders/create.php 1 location

@@ 290-297 (lines=8) @@
287
288
    $rs = dal_query('states/list.sql', $template_id, 'state_name');
289
290
    while (($row = $rs->fetch()))
291
    {
292
        $xml .= ($state_id == $row['state_id']
293
                    ? '<listitem value="' . $row['state_id'] . '" selected="true">'
294
                    : '<listitem value="' . $row['state_id'] . '">')
295
              . ustr2html($row['state_name'])
296
              . '</listitem>';
297
    }
298
299
    $xml .= '</combobox>'
300
          . '</control>'

src/reminders/modify.php 1 location

@@ 170-177 (lines=8) @@
167
168
$rs = dal_query('states/list.sql', $template_id, 'state_name');
169
170
while (($row = $rs->fetch()))
171
{
172
    $xml .= ($state_id == $row['state_id']
173
                ? '<listitem value="' . $row['state_id'] . '" selected="true">'
174
                : '<listitem value="' . $row['state_id'] . '">')
175
          . ustr2html($row['state_name'])
176
          . '</listitem>';
177
}
178
179
$xml .= '</combobox>'
180
      . '</control>'