5 // This page lists the available trackers as well as a
6 // form to create a new tracker
12 // get the Group object
14 $group =& group_get_object($group_id);
15 if (!$group || !is_object($group)) {
16 exit_error('Error','Could Not Get Group Object');
17 } elseif ($group->isError()) {
18 exit_error('Error',$group->getErrorMessage());
21 $perm =& $group->getPermission( session_get_user() );
23 if (getStringFromRequest('post_changes')) {
24 $name = getStringFromRequest('name');
25 $description = getStringFromRequest('description');
26 $is_public = getStringFromRequest('is_public');
27 $allow_anon = getStringFromRequest('allow_anon');
28 $email_all = getStringFromRequest('email_all');
29 $email_address = getStringFromRequest('email_address');
30 $due_period = getStringFromRequest('due_period');
31 $use_resolution = getStringFromRequest('use_resolution');
32 $submit_instructions = getStringFromRequest('submit_instructions');
33 $browse_instructions = getStringFromRequest('browse_instructions');
35 if (!$perm || !is_object($perm) || !$perm->isArtifactAdmin()) {
36 exit_permission_denied();
39 if (getStringFromRequest('add_at')) {
40 $res=new ArtifactTypeHtml($group);
41 if (!$res->create($name,$description,$is_public,$allow_anon,$email_all,$email_address,
42 $due_period,$use_resolution,$submit_instructions,$browse_instructions)) {
43 $feedback .= $res->getErrorMessage();
45 header ("Location: /tracker/admin/?group_id=$group_id&atid=".$res->getID()."&update_users=1");
53 // Display existing artifact types
55 $atf = new ArtifactTypeFactory($group);
56 if (!$group || !is_object($group) || $group->isError()) {
57 exit_error('Error','Could Not Get ArtifactTypeFactory');
60 $at_arr =& $atf->getArtifactTypes();
62 //required params for site_project_header();
63 $params['group']=$group_id;
64 $params['toptab']='tracker';
65 $params['title'] = $page_title;
67 echo site_project_header($params);
74 '/tracker/reporting/?group_id='.$group_id,
75 '/tracker/admin/?group_id='.$group_id
79 if (!$at_arr || count($at_arr) < 1) {
80 echo "<h1>"._('MISSINGTEXT:tracker_admin/no_trackers_found:TEXTMISSING')."</h1>";
85 <p>'._('Choose a data type and you can set up prefs, categories, groups, users, and permissions').'.</p>';
88 Put the result set (list of forums for this group) into a column with folders
90 $tablearr=array(_('Tracker'),_('Tracker'));
91 echo $HTML->listTableTop($tablearr);
93 for ($j = 0; $j < count($at_arr); $j++) {
95 <tr '. $HTML->boxGetAltRowStyle($j) . '>
96 <td><a href="'.$GLOBALS['sys_urlprefix'].'/tracker/admin/?atid='. $at_arr[$j]->getID() . '&group_id='.$group_id.'">' .
97 html_image("ic/tracker20w.png","20","20",array("border"=>"0")) . ' '.
98 $at_arr[$j]->getName() .'</a>
100 <td>'.$at_arr[$j]->getDescription() .'
104 echo $HTML->listTableBottom();
108 // Set up blank ArtifactType
111 if (!$perm || !is_object($perm) || !$perm->isArtifactAdmin()) {
115 ?><?php echo _('<h3>Create a new tracker</h3><p>You can use this system to track virtually any kind of data, with each tracker having separate user, group, category, and permission lists. You can also easily move items between trackers when needed.</p><p>Trackers are referred to as "Artifact Types" and individual pieces of data are "Artifacts". "Bugs" might be an Artifact Type, whiles a bug report would be an Artifact. You can create as many Artifact Types as you want, but remember you need to set up categories, groups, and permission for each type, which can get time-consuming') ?>
117 <form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id; ?>" method="post">
118 <input type="hidden" name="add_at" value="y" />
120 <?php echo _('<strong> Name:</strong> (examples: meeting minutes, test results, RFP Docs)') ?><br />
121 <input type="text" name="name" value=""></p>
123 <strong><?php echo _('Description') ?>:</strong><br />
124 <input type="text" name="description" value="" size="50" /></p>
126 <input type="checkbox" name="is_public" value="1" /> <strong><?php echo _('Publicly Available') ?></strong><br />
127 <input type="checkbox" name="allow_anon" value="1" /> <strong><?php echo _('Allow non-logged-in postings') ?></strong><br />
129 <strong><?php echo _('Send email on new submission to address') ?>:</strong><br />
130 <input type="text" name="email_address" value="" /></p>
132 <input type="checkbox" name="email_all" value="1" /> <strong><?php echo _('Send email on all changes') ?></strong><br /></p>
134 <strong><?php echo _('Days till considered overdue') ?>:</strong><br />
135 <input type="text" name="due_period" value="30" /></p>
137 <strong><?php echo _('Days till pending tracker items time out') ?>:</strong><br />
138 <input type="text" name="status_timeout" value="14" /></p>
140 <strong><?php echo _('Free form text for the "submit new item" page') ?>:</strong><br />
141 <textarea name="submit_instructions" rows="10" cols="55" wrap="hard"></textarea></p>
143 <strong><?php echo _('Free form text for the "browse items" page') ?>:</strong><br />
144 <textarea name="browse_instructions" rows="10" cols="55" wrap="hard"></textarea></p>
146 <input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
151 echo site_project_footer(array());