]> src.bluestatic.org Git - bugdar.git/blob - docs/populate.php
Fix an issue where after creating a Bugdar user in _fetchBugdarUserFromAuthUser(...
[bugdar.git] / docs / populate.php
1 <?php
2
3 include 'global.php';
4 include 'includes/api_bug.php';
5 include 'includes/api_comment.php';
6
7 for ($i = 11; $i < 111; $i++)
8 {
9 $bug = new BugAPI();
10 $comment = new CommentAPI();
11
12 $bug->set('userid', bugdar::$userinfo['userid']);
13 $bug->set('username', bugdar::$userinfo['displayname']);
14 $bug->set('summary', 'AUTO POPULATE: ' . $i);
15 $bug->set('severity', 1);
16
17 $comment->set('userid', bugdar::$userinfo['userid']);
18 $comment->set('comment', BSFunctions::random(100));
19
20 $bug->set('priority', bugdar::$options['defaultpriority']);
21 $bug->set('status', bugdar::$options['defaultstatus']);
22 $bug->set('resolution', bugdar::$options['defaultresolve']);
23 $bug->set('assignedto', bugdar::$options['defaultassign']);
24
25 $bug->set('product', 6);
26 $bug->set('component', 0);
27 $bug->set('version', 14);
28
29 $bug->insert();
30
31 $comment->set('bugid', $bug->insertid);
32 $comment->insert();
33
34 $bug = new BugAPI(); // need to destroy because update will think the insert fields need to be changed, too
35 $bug->dorelations = array();
36 $bug->set('bugid', $comment->values['bugid']);
37 $bug->set_condition();
38 $bug->fetch();
39 $bug->set('dateline', $comment->values['dateline']);
40 $bug->set('initialreport', $comment->insertid);
41 $bug->set('lastposttime', $comment->values['dateline']);
42 $bug->set('lastpostby', bugdar::$userinfo['userid']);
43 $bug->set('lastpostbyname', bugdar::$userinfo['displayname']);
44 $bug->set('hiddenlastposttime', $comment->values['dateline']);
45 $bug->set('hiddenlastpostby', bugdar::$userinfo['userid']);
46 $bug->set('hiddenlastpostbyname', bugdar::$userinfo['displayname']);
47 $bug->update();
48 }
49
50
51 ?>