Code Duplication    Length = 6-6 lines in 3 locations

src/records/addsubrec.php 1 location

@@ 53-58 (lines=6) @@
50
51
$permissions = record_get_permissions($record['template_id'], $record['creator_id'], $record['responsible_id']);
52
53
if (!can_subrecord_be_added($record, $permissions))
54
{
55
    debug_write_log(DEBUG_NOTICE, 'Subrecord cannot be added.');
56
    header('HTTP/1.1 307 subrecords.php?id=' . $id);
57
    exit;
58
}
59
60
// get current date
61

src/records/modify.php 1 location

@@ 57-62 (lines=6) @@
54
55
$permissions = record_get_permissions($record['template_id'], $record['creator_id'], $record['responsible_id']);
56
57
if (!can_record_be_modified($record, $permissions))
58
{
59
    debug_write_log(DEBUG_NOTICE, 'Record cannot be modified.');
60
    header('HTTP/1.1 307 view.php?id=' . $id);
61
    exit;
62
}
63
64
// modification form is submitted
65

src/records/postpone.php 1 location

@@ 55-60 (lines=6) @@
52
53
$permissions = record_get_permissions($record['template_id'], $record['creator_id'], $record['responsible_id']);
54
55
if (!can_record_be_postponed($record, $permissions))
56
{
57
    debug_write_log(DEBUG_NOTICE, 'Record cannot be postponed.');
58
    header('HTTP/1.1 307 view.php?id=' . $id);
59
    exit;
60
}
61
62
// get current date
63