Menu

[2eb2a2]: / list_branches.php  Maximize  Restore  History

Download this file

155 lines (143 with data), 4.3 kB

  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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?php session_start(); ?>
<html>
<head>
<title>deltasql - List branches and Tags </title>
<link rel="stylesheet" type="text/css" href="deltasql.css">
<link rel="shortcut icon" href="pictures/favicon.ico" />
</head>
<body>
<?php
include("head.inc.php");
include("utils/utils.inc.php");
include("utils/constants.inc.php");
if (!file_exists($configurationfile)) die("<h2><a href=\"install.php\">$installmessage</a></h2>");
show_user_level();
if(isset($_SESSION['rights'])) {
$rights = $_SESSION["rights"];
} else $rights=0;
?>
<h2>Branches and Tags</h2>
<p><i>Project branches are in blue and tags in yellow.</i></p>
<table border="1">
<?php
include("conf/config.inc.php");
mysql_connect($dbserver, $username, $password);
@mysql_select_db($database) or die("Unable to select database");
$query="SELECT * from tbbranch ORDER BY id ASC";
$result=mysql_query($query);
$num=mysql_num_rows($result);
echo "<tr>
<th>id</th>
<th>name</th>
<th>project</th>
<th>description</th>
<th>source branch</th>
<th>update dt</th>
<th>version number</th>
<th>visible</th>
<th>istag</th>
<th>ishead</th>
<th>actions</th>
</tr>";
$i=0;
while ($i<$num) {
$id=mysql_result($result,$i,"id");
$name=mysql_result($result,$i,"name");
$description=mysql_result($result,$i,"description");
$create_dt=mysql_result($result,$i,"create_dt");
// exception for HEAD, we show something else, as in db the latest update version is saved
$versionnr=mysql_result($result,$i,"versionnr");
if ($name=="HEAD") $versionnr="always latest ($versionnr)";
$projectid=mysql_result($result,$i,"project_id");
$visible=mysql_result($result,$i,"visible");
$sourcebranch=mysql_result($result,$i,"sourcebranch");
$istag=mysql_result($result,$i,"istag");
$ishead=mysql_result($result,$i,"ishead");
$projectname="";
if ($projectid!="") {
$query2="SELECT * from tbproject where id=$projectid";
$result2=mysql_query($query2);
if ($result2!="") $projectname=mysql_result($result2,0,'name');
}
// colouring tags and branches
if ($visible==1) {
if ($istag==1) {
echo "<tr BGCOLOR=\"#FDD017\">"; // yellow
}
else {
echo "<tr BGCOLOR=\"#99CCFF\">"; // blue
}
} else {
echo "<tr>";
}
if ($description=="") $description="-";
if ($sourcebranch=="") $sourcebranch="-";
echo "
<td>$id</td>
<td>$name</td>
<td>$projectname</td>
<td>$description</td>
<td>$sourcebranch</td>
<td>$create_dt</td>
<td>$versionnr</td>
<td>$visible</td>
<td>$istag</td>
<td>$ishead</td>
<td>";
if (($rights>=2) && ($name!="HEAD")) {
echo "<a href=\"edit_branch.php?id=$id\"><img alt=\"Edit\" src=\"icons/edit.png\"></a> ";
if ($rights==3) {
$encoded_name=urlencode($name);
echo " <a href=\"delete_branch_confirm.php?id=$id&name=$encoded_name&tag=$istag\"><img alt=\"Delete\" src=\"icons/delete.png\"></a> ";
}
if ($visible==0) {
echo " <a href=\"change_branch_visibility.php?id=$id&show=1\">Show</a> ";
} else {
echo " <a href=\"change_branch_visibility.php?id=$id&show=0\">Hide</a> ";
}
}
if ($rights>=2) {
if ($istag==0) {
echo "<a href=\"branch_again.php?id=$id&tag=0\">Branch</a> ";
echo "<a href=\"branch_again.php?id=$id&tag=1\">Tag Me</a> ";
} else {
echo "<a href=\"branch_from_existing_tag.php?id=$id\">Branch</a> ";
}
}
echo "</td>";
$i++;
}
?>
</table>
<br>
<hr>
<form action="get_dev_tree_graph.php" method="post">
<?php
// plotting project combobox
echo "Project: <select NAME=\"frmprojectid\">";
$query="SELECT * FROM tbproject ORDER BY name";
$result=mysql_query($query);
$num=mysql_num_rows($result);
$i=0;
while ($i<$num) {
$projectid=mysql_result($result,$i,"id");
$projectname=mysql_result($result,$i,"name");
echo "<option ";
echo "VALUE=\"$projectid\">$projectname";
$i++;
}
echo "</select> |";
mysql_close();
?>
<input name="frmexcltag" type="checkbox" value="1">Exclude tags
<img alt="Tree" src="icons/tree.png">
<input type="Submit" value="Get tree graph">
</form>
<?php
if (isset($_SESSION['displayhelplinks'])) $displayhelp=$_SESSION['displayhelplinks']; else $displayhelp=$default_displayhelplinks;
if ($displayhelp==1)
echo '<a href="faq.php#devprod"><img src="icons/help.png"> What is the difference between a production and a development schema?</a><br>';
?>
<?php include("bottom.inc.php"); ?>
</body>
</html>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.