File: form-clonetracker.php

package info (click to toggle)
gforge 4.5.14-22etch13
  • links: PTS
  • area: main
  • in suites: etch
  • size: 13,004 kB
  • ctags: 11,918
  • sloc: php: 36,047; sql: 29,050; sh: 10,538; perl: 6,496; xml: 3,810; makefile: 341; python: 263; ansic: 256
file content (45 lines) | stat: -rw-r--r-- 1,556 bytes parent folder | download | duplicates (2)
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
<?php
//
//	FORM TO CLONE A TRACKER
//
		$g =& group_get_object($sys_template_group);
		if (!$g || !is_object($g)) {
			exit_error('Error','Unable to Create Template Group Object');
		} elseif ($g->isError()) {
			exit_error('Error',$g->getErrorMessage());
		} else {
			$atf = new ArtifactTypeFactory($g);
			if (!$atf || !is_object($atf)) {
				exit_error('Error','Unable to Create Template Group Object');
			} elseif ($atf->isError()) {
				exit_error('Error',$atf->atfetErrorMessaatfe());
			} else {
				$ata =& $atf->getArtifactTypes();
				for ($i=0; $i<count($ata); $i++) {
					if (!$ata[$i] || $ata[$i]->isError()) {
//skip it
					} else {
						$ids[]=$ata[$i]->getID();
						$titles[]=$g->getPublicName().'::'.$ata[$i]->getName();
					}
				}

				$ath->adminHeader(array ('title'=>$Language->getText('tracker_admin','clone_tracker')));

				echo "<h1>".$Language->getText('tracker_admin','clone_tracker')."</h1>";

				?>
				<p><?php echo $Language->getText('tracker_admin','choose_tracker') ?></p>
				<p>
				<form action="<?php echo $PHP_SELF.'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
				<input type="hidden" name="clone_tracker" value="y" />
				<p><strong><?php echo $Language->getText('tracker_admin','clone_warning') ?></strong></p>
				<p><?php echo html_build_select_box_from_arrays($ids,$titles,'clone_id','',false); ?></p>
				<input type="submit" name="post_changes" value="<?php echo $Language->getText('general','submit') ?>" /></p>
				</form></p>
				<?php
				$ath->footer(array());
			}
		}

?>