From: <vb...@us...> - 2002-09-19 05:15:50
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv6789/core Modified Files: config_defaults_inc.php constants_inc.php note_api.php Log Message: - Fixed a typo in the name of note_update_visibility() - Added to the phpnet theme the [ actions ] to change the visibility of a note. - Display in phpnet theme the visibility of notes if the user can moderate. - Filtering all notes in the pages based on access rights, rather than only viewing accepted independent of access rights. Index: config_defaults_inc.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/config_defaults_inc.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- config_defaults_inc.php 19 Sep 2002 04:15:48 -0000 1.4 +++ config_defaults_inc.php 19 Sep 2002 05:15:47 -0000 1.5 @@ -147,6 +147,11 @@ ACTION_NOTES_EDIT_OWN => REGISTERED, ACTION_NOTES_DELETE_OWN => REGISTERED, ACTION_NOTES_MODERATE => MODERATOR, + ACTION_NOTES_MODERATE_ACCEPT => MODERATOR, + ACTION_NOTES_MODERATE_DECLINE => MODERATOR, + ACTION_NOTES_MODERATE_ARCHIVE => MODERATOR, + ACTION_NOTES_MODERATE_DELETE => MODERATOR, + ACTION_NOTES_MODERATE_QUEUE => MODERATOR, ACTION_NOTES_PACK_DELETED => NOBODY, ACTION_NOTES_PACK_DECLINED => MODERATOR, ACTION_USERS_MANAGE => ADMINISTRATOR, Index: constants_inc.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/constants_inc.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- constants_inc.php 19 Sep 2002 04:15:48 -0000 1.7 +++ constants_inc.php 19 Sep 2002 05:15:47 -0000 1.8 @@ -29,25 +29,25 @@ define( 'EVERYBODY', 0 ); # Actions - define( 'ACTION_NOTES_VIEW_PENDING', 0 ); - define( 'ACTION_NOTES_VIEW_ACCEPTED', 1 ); - define( 'ACTION_NOTES_VIEW_DECLINED', 2 ); - define( 'ACTION_NOTES_VIEW_ARCHIVED', 3 ); - define( 'ACTION_NOTES_VIEW_DELETED', 4 ); + define( 'ACTION_NOTES_VIEW_PENDING', 0 ); # view pending notes + define( 'ACTION_NOTES_VIEW_ACCEPTED', 1 ); # view accepted notes + define( 'ACTION_NOTES_VIEW_DECLINED', 2 ); # view declined notes + define( 'ACTION_NOTES_VIEW_ARCHIVED', 3 ); # view archived notes + define( 'ACTION_NOTES_VIEW_DELETED', 4 ); # view deleted notes define( 'ACTION_NOTES_SUBMIT', 10 ); # add as pending define( 'ACTION_NOTES_ADD', 11 ); # add as accepted - define( 'ACTION_NOTES_EDIT', 20 ); - define( 'ACTION_NOTES_EDIT_OWN', 21 ); - define( 'ACTION_NOTES_DELETE', 30 ); - define( 'ACTION_NOTES_DELETE_OWN', 31 ); - define( 'ACTION_NOTES_MODERATE', 40 ); - define( 'ACTION_NOTES_MODERATE_PENDING', 41 ); - define( 'ACTION_NOTES_MODERATE_ACCEPTED', 42 ); - define( 'ACTION_NOTES_MODERATE_DECLINED', 43 ); - define( 'ACTION_NOTES_MODERATE_ARCHIVED', 44 ); - define( 'ACTION_NOTES_MODERATE_DELETED', 45 ); - define( 'ACTION_NOTES_PACK_DELETED', 50 ); - define( 'ACTION_NOTES_PACK_DECLINED', 51 ); + define( 'ACTION_NOTES_EDIT', 20 ); # edit all notes that are viewable + define( 'ACTION_NOTES_EDIT_OWN', 21 ); # edit notes submitted by yourself + define( 'ACTION_NOTES_DELETE', 30 ); # delete all notes that are viewable + define( 'ACTION_NOTES_DELETE_OWN', 31 ); # delete notes submitted by yourself + define( 'ACTION_NOTES_MODERATE', 40 ); # can done some moderation + define( 'ACTION_NOTES_MODERATE_QUEUE', 41 ); # move notes to pending state + define( 'ACTION_NOTES_MODERATE_ACCEPT', 42 ); # move notes to accepted state + define( 'ACTION_NOTES_MODERATE_DECLINE', 43 ); # move notes to declined state + define( 'ACTION_NOTES_MODERATE_ARCHIVE', 44 ); # move notes to archived state + define( 'ACTION_NOTES_MODERATE_DELETE', 45 ); # move notes to deleted state + define( 'ACTION_NOTES_PACK_DELETED', 50 ); # purge notes that are marked for deletion + define( 'ACTION_NOTES_PACK_DECLINED', 51 ); # purge notes that are declined define( 'ACTION_USERS_MANAGE', 101 ); define( 'ACTION_USERS_ADD', 102 ); Index: note_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/note_api.php,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- note_api.php 19 Sep 2002 04:15:48 -0000 1.17 +++ note_api.php 19 Sep 2002 05:15:47 -0000 1.18 @@ -41,7 +41,24 @@ return db_query( $query ); } ### -------------------- - function note_update_visiblity( $p_id, $p_visibility ) { + function note_get_visibility_str( $p_visible ) { + switch ( $p_visible ) { + case NOTE_VISIBLE_PENDING: + return "Pending"; + case NOTE_VISIBLE_ACCEPTED: + return "Accepted"; + case NOTE_VISIBLE_DECLINED: + return "Declined"; + case NOTE_VISIBLE_ARCHIVED: + return "Archived"; + case NOTE_VISIBLE_DELETED: + return "Deleted"; + default: + return "Unknown"; + } + } + ### -------------------- + function note_update_visibility( $p_id, $p_visibility ) { $c_id = db_prepare_int( $p_id ); $c_visibility = db_prepare_int( $p_visibility ); @@ -104,23 +121,23 @@ $row = db_fetch_array( $result ); extract( $row, EXTR_PREFIX_ALL, 'v' ); - if ( ( NOTE_VISIBLE_PENDING === $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_PENDING ) === false ) ) { + if ( ( NOTE_VISIBLE_PENDING == $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_PENDING ) === false ) ) { continue; } - if ( ( NOTE_VISIBLE_ACCEPTED === $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_ACCEPTED ) === false ) ) { + if ( ( NOTE_VISIBLE_ACCEPTED == $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_ACCEPTED ) === false ) ) { continue; } - if ( ( NOTE_VISIBLE_DECLINED === $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_DECLINED ) === false ) ) { + if ( ( NOTE_VISIBLE_DECLINED == $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_DECLINED ) === false ) ) { continue; } - if ( ( NOTE_VISIBLE_ARCHIVED === $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_ARCHIVED ) === false ) ) { + if ( ( NOTE_VISIBLE_ARCHIVED == $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_ARCHIVED ) === false ) ) { continue; } - if ( ( NOTE_VISIBLE_DELETED === $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_DELETED ) === false ) ) { + if ( ( NOTE_VISIBLE_DELETED == $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_DELETED ) === false ) ) { continue; } |