forked from Kitware/CDash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewSubprojectDependenciesGraph.php
117 lines (100 loc) · 3.23 KB
/
viewSubprojectDependenciesGraph.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
$noforcelogin = 1;
include("cdash/config.php");
require_once("cdash/pdo.php");
include('login.php');
include_once("cdash/common.php");
include("cdash/version.php");
require_once("models/project.php");
require_once("models/subproject.php");
$db = pdo_connect("$CDASH_DB_HOST", "$CDASH_DB_LOGIN","$CDASH_DB_PASS");
pdo_select_db("$CDASH_DB_NAME",$db);
@$projectname = $_GET["project"];
if ($projectname != NULL)
{
$projectname = htmlspecialchars(pdo_real_escape_string($projectname));
}
@$date = $_GET["date"];
if ($date != NULL)
{
$date = htmlspecialchars(pdo_real_escape_string($date));
}
$projectid = get_project_id($projectname);
if($projectid == 0)
{
echo "Invalid project";
return;
}
$project = pdo_query("SELECT * FROM project WHERE id='$projectid'");
if(pdo_num_rows($project)>0)
{
$project_array = pdo_fetch_array($project);
$svnurl = make_cdash_url(htmlentities($project_array["cvsurl"]));
$homeurl = make_cdash_url(htmlentities($project_array["homeurl"]));
$bugurl = make_cdash_url(htmlentities($project_array["bugtrackerurl"]));
$googletracker = htmlentities($project_array["googletracker"]);
$docurl = make_cdash_url(htmlentities($project_array["documentationurl"]));
$projectpublic = $project_array["public"];
$projectname = $project_array["name"];
}
else
{
$projectname = "NA";
}
checkUserPolicy(@$_SESSION['cdash']['loginid'],$project_array["id"]);
$xml = begin_XML_for_XSLT();
$xml .= "<title>CDash - Subproject dependencies Graph - ".$projectname."</title>";
list ($previousdate, $currentstarttime, $nextdate) = get_dates($date,$project_array["nightlytime"]);
$logoid = getLogoID($projectid);
// Main dashboard section
$xml .=
"<dashboard>
<datetime>".date("l, F d Y H:i:s T",time())."</datetime>
<date>".$date."</date>
<unixtimestamp>".$currentstarttime."</unixtimestamp>
<svn>".$svnurl."</svn>
<bugtracker>".$bugurl."</bugtracker>
<googletracker>".$googletracker."</googletracker>
<documentation>".$docurl."</documentation>
<logoid>".$logoid."</logoid>
<projectid>".$projectid."</projectid>
<projectname>".$projectname."</projectname>
<projectname_encoded>".urlencode($projectname)."</projectname_encoded>
<previousdate>".$previousdate."</previousdate>
<projectpublic>".$projectpublic."</projectpublic>
<nextdate>".$nextdate."</nextdate>";
if(empty($project_array["homeurl"]))
{
$xml .= "<home>index.php?project=".urlencode($projectname)."</home>";
}
else
{
$xml .= "<home>".$homeurl."</home>";
}
if($CDASH_USE_LOCAL_DIRECTORY&&file_exists("local/models/proProject.php"))
{
include_once("local/models/proProject.php");
$pro= new proProject;
$pro->ProjectId=$projectid;
$xml.="<proedition>".$pro->GetEdition(1)."</proedition>";
}
if($currentstarttime>time())
{
$xml .= "<future>1</future>";
}
else
{
$xml .= "<future>0</future>";
}
$xml .= "</dashboard>";
// Menu definition
$xml .= "<menu>";
if(!isset($date) || strlen($date)<8 || date(FMT_DATE, $currentstarttime)==date(FMT_DATE))
{
$xml .= add_XML_value("nonext","1");
}
$xml .= "</menu>";
$xml .= "</cdash>";
// Now doing the xslt transition
generate_XSLT($xml,"viewSubprojectDependenciesGraph");
?>