Example #1
0
                    $t_status = "Copy to '{$t_filename}' failed";
                    $t_failures++;
                }
                # Add the file and status to the list of processed attachments
                $t_file = array('id' => $t_row['id'], 'filename' => $t_row['filename'], 'status' => $t_status);
                if ($p_type == 'bug') {
                    $t_file['bug_id'] = $t_row['bug_id'];
                }
                $t_data[] = $t_file;
            }
        }
        $t_moved[] = array('name' => project_get_name($t_project), 'path' => $t_upload_path, 'rows' => db_num_rows($t_result), 'failed' => $t_failures, 'data' => $t_data);
    }
    return $t_moved;
}
$t_moved = move_attachments_to_disk($f_file_type, $f_projects_to_disk);
form_security_purge('move_attachments_project_select');
$t_redirect_url = 'admin/system_utils.php';
# Page header, menu
html_page_top('MantisBT Administration - Moving Attachments', empty($t_result) ? $t_redirect_url : null);
?>

<div align="center">

<?php 
# Display results
if (empty($t_moved)) {
    echo "<p>Nothing to do.</p>\n";
} else {
    foreach ($t_moved as $t_row) {
        printf("<p class=\"bold\">Project '%s' : %d attachments %s.</p>\n", $t_row['name'], $t_row['rows'], 0 == $t_row['failed'] ? 'moved successfully' : 'to move, ' . $t_row['failed'] . ' failures');
Example #2
0
                $t_data[] = $t_file;
            }
        }
        $t_moved[] = array('name' => project_get_name($t_project), 'path' => $t_upload_path, 'rows' => db_num_rows($t_result), 'failed' => $t_failures, 'data' => $t_data);
    }
    return $t_moved;
}
$t_array = explode(':', $f_project_to_move, 2);
if (isset($t_array[1])) {
    $f_project_id = $t_array[1];
    if (!is_numeric($f_project_id) || (int) $f_project_id == 0) {
        $t_moved = array();
    } else {
        switch ($t_array[0]) {
            case 'disk':
                $t_moved = move_attachments_to_disk($f_file_type, array($f_project_id));
                break;
            case 'db':
                $t_moved = move_attachments_to_db($f_file_type, array($f_project_id));
                break;
        }
    }
}
form_security_purge('move_attachments_project_select');
# Page header, menu
html_page_top('MantisBT Administration - Moving Attachments');
?>

<div align="center">

<?php