Code Duplication    Length = 18-18 lines in 2 locations

src/dbo/accounts.php 2 locations

@@ 452-469 (lines=18) @@
449
                    $account_id,
450
                    ustrtolower(get_html_resource(RES_ALL_ASSIGNED_TO_ME_ID, $locale)));
451
452
    if ($rs->rows == 0)
453
    {
454
        debug_write_log(DEBUG_WARNING, '[account_create] Created filter #1 not found.');
455
    }
456
    else
457
    {
458
        $filter_id = $rs->fetch('filter_id');
459
460
        // Complete filter settings and active the filter.
461
        dal_query('filters/facreate.sql', $filter_id, FILTER_FLAG_ASSIGNED_TO, $account_id);
462
        dal_query('filters/set.sql', $filter_id, $account_id);
463
464
        // Add filter into default view.
465
        if (!is_null($view_id))
466
        {
467
            dal_query('views/fcreate.sql', $view_id, $filter_id);
468
        }
469
    }
470
471
    // Create 2nd default filter for new account, which will show all opened records created by this account.
472
    dal_query('filters/create.sql',
@@ 484-501 (lines=18) @@
481
                    $account_id,
482
                    ustrtolower(get_html_resource(RES_ALL_CREATED_BY_ME_ID, $locale)));
483
484
    if ($rs->rows == 0)
485
    {
486
        debug_write_log(DEBUG_WARNING, '[account_create] Created filter #2 not found.');
487
    }
488
    else
489
    {
490
        $filter_id = $rs->fetch('filter_id');
491
492
        // Complete filter settings and active the filter.
493
        dal_query('filters/facreate.sql', $filter_id, FILTER_FLAG_CREATED_BY, $account_id);
494
        dal_query('filters/set.sql', $filter_id, $account_id);
495
496
        // Add filter into default view.
497
        if (!is_null($view_id))
498
        {
499
            dal_query('views/fcreate.sql', $view_id, $filter_id);
500
        }
501
    }
502
503
    return NO_ERROR;
504
}