diff -r 2ef32c1528488a6ce343a5257222ed465fb9518b -r 128fa1b9447e2d8d46ddd76caf60bc7bcb610059 indefero/src/IDF/Views/Project.php --- a/indefero/src/IDF/Views/Project.php Mon Mar 24 23:15:04 2014 -0500 +++ b/indefero/src/IDF/Views/Project.php Fri Apr 04 23:54:03 2014 -0500 @@ -325,6 +325,53 @@ $request); } + public $backup_precond = array('IDF_Precondition::projectOwner'); + public function backup($request, $match) + { + $prj = $request->project; + + $to_json = array(); + $to_json["IDF_Project"] = Pluf_Test_Fixture::prepare(Pluf::factory("IDF_Project")->getOne(array("filter" => "id=" . $prj->id))); + + $to_json["IDF_Issue"] = array(); + $to_json["IDF_Upload"] = array(); + $to_json["IDF_Wiki_Page"] = array(); + + + foreach(Pluf::factory("IDF_Issue")->getList(array("filter"=>"project=".$prj->id)) as $item) + { + $tmp = array(); + $tmp = Pluf_Test_Fixture::dump($item, false); + $tmp = $tmp[0]; + $tmp["comments"] = array(); + foreach($item->get_comments_list() as $item2) + $tmp["comments"][] = Pluf_Test_Fixture::dump($item2, false)[0]; + $to_json["IDF_Issue"][] = $tmp; + } + foreach(Pluf::factory("IDF_Upload")->getList(array("filter"=>"project=".$prj->id)) as $item) + { + $path = $item->getFullPath(); + $file = file_get_contents($path); + + $tmp = Pluf_Test_Fixture::dump($item, false); + $tmp[0]["file_encoded"] = base64_encode($file); + $to_json["IDF_Upload"][] = $tmp[0]; + + } + + foreach(Pluf::factory("IDF_Wiki_Page")->getList(array("filter"=>"project=".$prj->id)) as $item) + { + $tmp = Pluf_Test_Fixture::dump($item, false)[0]; + $tmp["WikiPageRevs"] = array(); + foreach($item->get_revisions_list() as $item2) + $tmp["WikiPageRevs"][] = Pluf_Test_Fixture::dump($item2, false)[0]; + $to_json["IDF_Wiki_Page"][] = $tmp; + } + $render = new Pluf_HTTP_Response(json_encode($to_json), "application/json"); + $render->headers['Content-Disposition'] = 'attachment; filename="backup-' . $prj->name . '-' . date("YmdGis") . '.json"'; + return $render; + } + /** * Administrate the issue tracking of a project. */ diff -r 2ef32c1528488a6ce343a5257222ed465fb9518b -r 128fa1b9447e2d8d46ddd76caf60bc7bcb610059 indefero/src/IDF/templates/idf/admin/summary.html --- a/indefero/src/IDF/templates/idf/admin/summary.html Mon Mar 24 23:15:04 2014 -0500 +++ b/indefero/src/IDF/templates/idf/admin/summary.html Fri Apr 04 23:54:03 2014 -0500 @@ -100,4 +100,8 @@

The description of the project can be improved using the Markdown syntax.

{/blocktrans} +
+

Download Project

+

A copy of the project can be downloaded here: Download

+
{/block} diff -r 2ef32c1528488a6ce343a5257222ed465fb9518b -r 128fa1b9447e2d8d46ddd76caf60bc7bcb610059 indefero/src/IDF/templates/idf/project/home.html --- a/indefero/src/IDF/templates/idf/project/home.html Mon Mar 24 23:15:04 2014 -0500 +++ b/indefero/src/IDF/templates/idf/project/home.html Fri Apr 04 23:54:03 2014 -0500 @@ -3,7 +3,7 @@ {block tabhome} class="active"{/block} {block subtabs}
-{trans 'Welcome'} | {trans 'Latest Updates'}{superblock} +{trans 'Welcome'} | {trans 'RSS'} {trans 'Latest Updates'}{superblock}
{/block} {block body}