-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject.php
64 lines (49 loc) · 2.1 KB
/
project.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
define('PAGE', 'project');
require 'includes/init.inc.php';
require 'includes/template.inc.php';
list($Attachment, $Bug, $Comment, $Date, $Deliverable, $Milestone, $Product, $Project) =
load_models('Attachment', 'Bug', 'Comment', 'Date', 'Deliverable', 'Milestone', 'Product', 'Project');
$product = $Product->getProductFromURL($_GET['product']);
// Get the project's info
$project = $Project->getProjectFromURL($_GET['project']);
// If project is in a milestone, get milestone info
if (!empty($project['milestone_id'])) {
$project['milestone'] = $Milestone->get($project['milestone_id']);
$project['milestone']['dates'] = $Date->getAll('milestone_id = '.escape($project['milestone_id']));
}
// Get all deliverables for the project
$deliverables = $Deliverable->getKeyedDeliverables($project['id']);
// Get resources for each deliverable
if (!empty($deliverables)) {
$Attachment->addAttachmentsToDeliverables($deliverables);
$Bug->addBugsToDeliverables($deliverables);
$Comment->addCommentsToDeliverables($deliverables);
$deliverables = $Deliverable->nestDeliverables($deliverables);
}
// Get all products and milestones for edit dropdowns
$milestones = $Milestone->getAll(null, 'id, name');
$products = $Product->getAll(null, 'id, name');
$template = new Template($product['theme'], $Config->get('theme'));
$template->render('head', array(
'title' => $product['name'].' - '.$project['name'].' @ '. $Config->get('site_name').' moxie',
'css' => $template->cssString('global')
));
$template->render('header', array(
'site_name' => $Config->get('site_name'),
'product_name' => $product['name'],
'page_type' => 'projects',
'page_name' => $project['name'],
'product_base_url' => $template->getBaseURL().'/'.$product['url']
));
$template->render('project', array(
'product' => $product,
'project' => $project,
'deliverables' => $deliverables,
'products' => $products,
'milestones' => $milestones
));
$template->render('footer', array(
'jsFiles' => $template->jsString('project')
));
?>