Code Duplication    Length = 33-34 lines in 2 locations

src/reminders/create.php 2 locations

@@ 209-241 (lines=33) @@
206
207
// generate project selector
208
209
if ($form == 'projectform')
210
{
211
    $xml .= '<control name="project" required="' . get_html_resource(RES_REQUIRED3_ID) . '">'
212
          . '<label>' . get_html_resource(RES_PROJECT_ID) . '</label>'
213
          . '<combobox>';
214
215
    $rs = dal_query(DATABASE_DRIVER == DRIVER_ORACLE9 ? 'reminders/oracle/plist.sql' : 'reminders/plist.sql',
216
                    $_SESSION[VAR_USERID]);
217
218
    if ($rs->rows == 1)
219
    {
220
        debug_write_log(DEBUG_NOTICE, 'One project only is found.');
221
    }
222
223
    while (($row = $rs->fetch()))
224
    {
225
        $xml .= '<listitem value="' . $row['project_id'] . '">'
226
              . ustr2html($row['project_name'])
227
              . '</listitem>';
228
    }
229
230
    $xml .= '</combobox>'
231
          . '</control>';
232
}
233
elseif (isset($project_id))
234
{
235
    $xml .= '<control name="project" required="' . get_html_resource(RES_REQUIRED3_ID) . '">'
236
          . '<label>' . get_html_resource(RES_PROJECT_ID) . '</label>'
237
          . '<combobox>'
238
          . '<listitem value="' . $project_id . '">' . ustr2html($project_name) . '</listitem>'
239
          . '</combobox>'
240
          . '</control>';
241
}
242
243
// generate template selector
244
@@ 245-278 (lines=34) @@
242
243
// generate template selector
244
245
if ($form == 'templateform')
246
{
247
    $xml .= '<control name="template" required="' . get_html_resource(RES_REQUIRED3_ID) . '">'
248
          . '<label>' . get_html_resource(RES_TEMPLATE_ID) . '</label>'
249
          . '<combobox>';
250
251
    $rs = dal_query(DATABASE_DRIVER == DRIVER_ORACLE9 ? 'reminders/oracle/tlist.sql' : 'reminders/tlist.sql',
252
                    $_SESSION[VAR_USERID],
253
                    $project_id);
254
255
    if ($rs->rows == 1)
256
    {
257
        debug_write_log(DEBUG_NOTICE, 'One template only is found.');
258
    }
259
260
    while (($row = $rs->fetch()))
261
    {
262
        $xml .= '<listitem value="' . $row['template_id'] . '">'
263
              . ustr2html($row['template_name'])
264
              . '</listitem>';
265
    }
266
267
    $xml .= '</combobox>'
268
          . '</control>';
269
}
270
elseif (isset($template_id))
271
{
272
    $xml .= '<control name="template" required="' . get_html_resource(RES_REQUIRED3_ID) . '">'
273
          . '<label>' . get_html_resource(RES_TEMPLATE_ID) . '</label>'
274
          . '<combobox>'
275
          . '<listitem value="' . $template_id . '">' . ustr2html($template_name) . '</listitem>'
276
          . '</combobox>'
277
          . '</control>';
278
}
279
280
// generate other reminder attributes
281