2007-10-26 Roland Mas <lolando@debian.org>
- * www/tracker/admin/form-extrafieldcopy.php: Use the role_settings
+ * www/tracker/admin/form-extrafieldcopy.php: Use the role_setting
table instead of the artifact_perm view.
+ * www/tracker/reporting/index.php: Ditto.
2007-10-25 Roland Mas <lolando@debian.org>
- * www/pm/msproject/msp.php: Use the role_settings table instead of
+ * www/pm/msproject/msp.php: Use the role_setting table instead of
the project_perm view.
* www/tracker/mod.php: Ditto for artifact_perm.
//
// Get list of trackers this person can see
//
-if ($perm->isArtifactAdmin()) {
- $alevel='';
-} else {
- $alevel=' ap.user_id='. user_getid() ." AND ap.perm_level > 1 AND ";
-}
-
$sql="SELECT DISTINCT agl.group_artifact_id,agl.name
- FROM artifact_group_list agl
- LEFT JOIN artifact_perm ap
- ON (ap.group_artifact_id=agl.group_artifact_id)
- WHERE
- $alevel
- agl.group_id='$group_id'";
+ FROM artifact_group_list agl, role_setting rs, user_group ug
+ WHERE agl.group_id='$group_id'
+ AND agl.group_id=ug.group_id
+ AND ug.user_id=". user_getid() ."
+ AND ug.role_id=rs.role_id
+ AND (
+ (rs.section_name = 'projectadmin' AND rs.value = 'A')
+ OR (rs.section_name = 'trackeradmin' AND rs.value = 2)
+ OR (rs.section_name = 'tracker' AND rs.value >= 1 AND rs.ref_id = agl.group_artifact_id)
+ )";
$restracker=db_query($sql);
echo db_error();
delete from artifact_message where artifact_id in (select artifact_id from artifact where group_artifact_id in (select group_artifact_id from artifact_group_list where group_id in (select group_id from groups where status = 'D')));
delete from artifact where group_artifact_id in (select group_artifact_id from artifact_group_list where group_id in (select group_id from groups where status = 'D'));
-delete from artifact_perm where group_artifact_id in (select group_artifact_id from artifact_group_list where group_id in (select group_id from groups where status = 'D'));
delete from artifact_group where group_artifact_id in (select group_artifact_id from artifact_group_list where group_id in (select group_id from groups where status = 'D'));
delete from artifact_category where group_artifact_id in (select group_artifact_id from artifact_group_list where group_id in (select group_id from groups where status = 'D'));
delete from artifact_group_list where group_id in (select group_id from groups where status = 'D');
delete from user_group where user_id in
(select user_id from users where status='D');
-delete from artifact_perm where user_id in
-(select user_id from users where status='D');
-
delete from artifact_history where artifact_id in (select artifact_id from artifact where assigned_to in
(select user_id from users where status='D'));
delete from artifact where submitted_by in
(select user_id from users where status='D');
-delete from project_perm where user_id in
-(select user_id from users where status='D');
-
-delete from forum_perm where user_id in
-(select user_id from users where status='D');
-
delete from users where status='D';