name = $_POST["name"]; $P->shortname = $_POST["shortname"]; $P->ordinal = $_POST["ordinal"]; $P->notifyemail = $_POST["email"]; $CS = MTrackChangeset::begin("project:X", $pid == 'new' ? "added project $P->name" : "edit project $P->name"); $P->save($CS); if (MTrackACL::hasAnyRights('Components', 'modify')) { MTrackDB::q('delete from components_by_project where projid = ?', $P->projid); if (isset($_POST['components'])) { $comps = $_POST['components']; foreach ($comps as $cid) { MTrackDB::q( 'insert into components_by_project (compid, projid) values (?, ?)', $cid, $P->projid); } } } $CS->setObject("project:$P->projid"); if (isset($_POST['perms'])) { MTrackACL::setACL("project:$P->projid", 0, json_decode($_POST['perms'])); } $CS->commit(); header("Location: ${ABSWEB}admin/project.php"); exit; } mtrack_head("Administration - Projects"); ?>
Projects can be created to track development on a per-project or per-product basis. Components may be associated with a project, as well as a default email distribution address.
'new', 'name' => 'My New Project', 'shortname' => 'newproject', 'ordinal' => 5, 'notifyemail' => null ); } echo ""; } else { ?>Select a project below to edit it, or click the "Add" button to create a new project.
\n"; foreach (MTrackDB::q( 'select projid, name, shortname, ordinal, notifyemail from projects order by ordinal') as $row) { $pid = $row[0]; $name = htmlentities($row[1], ENT_QUOTES, 'utf-8'); $sname = htmlentities($row[2], ENT_QUOTES, 'utf-8'); if ($sname != $name) { $sname = " ($sname)"; } else { $sname = ''; } $email = htmlentities($row[4], ENT_QUOTES, 'utf-8'); echo "