Ticket #6210: 6210-imath-suggestions.patch
File 6210-imath-suggestions.patch, 18.5 KB (added by , 6 years ago) |
---|
-
src/bp-core/admin/bp-core-admin-schema.php
diff --git src/bp-core/admin/bp-core-admin-schema.php src/bp-core/admin/bp-core-admin-schema.php index 928948797..bda0edaf0 100644
function bp_core_install_invitations() { 579 579 ) {$charset_collate};"; 580 580 dbDelta( $sql ); 581 581 582 // @TODO: Migrate invitations here 582 /** 583 * @TODO: Migrate invitations here 584 */ 583 585 584 586 /** 585 587 * Fires after BuddyPress adds the invitations table. -
src/bp-core/bp-core-update.php
diff --git src/bp-core/bp-core-update.php src/bp-core/bp-core-update.php index 27e3819bc..db6d0289e 100644
function bp_update_to_5_0() { 585 585 586 586 bp_core_install_invitations(); 587 587 588 bp_groups_migrate_invitations(); 588 if ( bp_is_active( 'groups' ) ) { 589 bp_groups_migrate_invitations(); 590 } 589 591 } 590 592 591 593 /** -
src/bp-core/classes/class-bp-invitation-manager.php
diff --git src/bp-core/classes/class-bp-invitation-manager.php src/bp-core/classes/class-bp-invitation-manager.php index 397258511..30158447a 100644
abstract class BP_Invitation_Manager { 69 69 * @type int $item_id ID associated with the invitation and class. 70 70 * @type int $secondary_item_id secondary ID associated with the 71 71 * invitation and class. 72 * @type string $type @TODO. 72 * @type string $type @TODO. < missing description. 73 73 * @type string $content Extra information provided by the requester 74 74 * or inviter. 75 75 * @type string $date_modified Date the invitation was last modified. … … abstract class BP_Invitation_Manager { 83 83 84 84 $r = bp_parse_args( $args, array( 85 85 'user_id' => 0, 86 'invitee_email' 87 'inviter_id' 86 'invitee_email' => '', 87 'inviter_id' => 0, 88 88 'item_id' => 0, 89 89 'secondary_item_id' => 0, 90 'type' 91 'content' 90 'type' => 'invite', 91 'content' => '', 92 92 'date_modified' => bp_core_current_time(), 93 93 'send_invite' => 0, 94 94 'accepted' => 0 … … abstract class BP_Invitation_Manager { 215 215 * @type int $item_id ID associated with the invitation and class. 216 216 * @type int $secondary_item_id secondary ID associated with the 217 217 * invitation and class. 218 * @type string $type @TODO. 218 * @type string $type @TODO. < missing description. 219 219 * @type string $content Extra information provided by the requester 220 220 * or inviter. 221 221 * @type string $date_modified Date the invitation was last modified. -
src/bp-core/classes/class-bp-invitation.php
diff --git src/bp-core/classes/class-bp-invitation.php src/bp-core/classes/class-bp-invitation.php index 18ec7b27c..bc75bd634 100644
class BP_Invitation { 269 269 * 270 270 * @param array $data { 271 271 * Array of invitation data, passed to {@link wpdb::insert()}. 272 * @type int $user_idID of the invited user.273 * @type int $inviter_idID of the user who created the invitation.274 * @type string $invitee_email Email address of the invited user.275 * @type string $class Name of the related class.276 * @type int item_idID associated with the invitation and component.277 * @type int secondary_item_id secondary ID associated with the278 * invitation andcomponent.279 * @type string contentExtra information provided by the requester280 * or inviter.281 * @type string date_modifiedDate the invitation was last modified.282 * @type int invite_sent Has the invitation been sent, or is it a283 * draftinvite?272 * @type int $user_id ID of the invited user. 273 * @type int $inviter_id ID of the user who created the invitation. 274 * @type string $invitee_email Email address of the invited user. 275 * @type string $class Name of the related class. 276 * @type int $item_id ID associated with the invitation and component. 277 * @type int $secondary_item_id Secondary ID associated with the invitation and 278 * component. 279 * @type string $content Extra information provided by the requester 280 * or inviter. 281 * @type string $date_modified Date the invitation was last modified. 282 * @type int $invite_sent Has the invitation been sent, or is it a draft 283 * invite? 284 284 * } 285 285 * @param array $data_format See {@link wpdb::insert()}. 286 286 * @return int|false The number of rows inserted, or false on error. … … class BP_Invitation { 297 297 * 298 298 * @see wpdb::update() for further description of paramater formats. 299 299 * 300 * @param array $data Array of invitation data to update, passed to301 * {@link wpdb::update()}. Accepts any property of a302 * BP_Invitation object.303 * @param array $where The WHERE params as passed to wpdb::update().304 * Typically consists of array( 'ID' => $id ) to specify the ID305 * of the item being updated. See {@link wpdb::update()}.306 * @param array $data_format See {@link wpdb::insert()}.300 * @param array $data Array of invitation data to update, passed to 301 * {@link wpdb::update()}. Accepts any property of a 302 * BP_Invitation object. 303 * @param array $where The WHERE params as passed to wpdb::update(). 304 * Typically consists of array( 'ID' => $id ) to specify the ID 305 * of the item being updated. See {@link wpdb::update()}. 306 * @param array $data_format See {@link wpdb::insert()}. 307 307 * @param array $where_format See {@link wpdb::insert()}. 308 308 * @return int|false The number of rows updated, or false on error. 309 309 */ … … class BP_Invitation { 319 319 * 320 320 * @see wpdb::update() for further description of paramater formats. 321 321 * 322 * @param array $where Array of WHERE clauses to filter by, passed to323 * {@link wpdb::delete()}. Accepts any property of a324 * BP_Invitation object.322 * @param array $where Array of WHERE clauses to filter by, passed to 323 * {@link wpdb::delete()}. Accepts any property of a 324 * BP_Invitation object. 325 325 * @param array $where_format See {@link wpdb::insert()}. 326 326 * @return int|false The number of rows updated, or false on error. 327 327 */ … … class BP_Invitation { 338 338 * 339 339 * @since 5.0.0 340 340 * 341 * @param array $args See {@link BP_Invitation::get()} 342 * for more details. 341 * @param array $args See {@link BP_Invitation::get()} for more details. 343 342 * @return string WHERE clause. 344 343 */ 345 344 protected static function get_where_sql( $args = array() ) { … … class BP_Invitation { 462 461 * 463 462 * @since 5.0.0 464 463 * 465 * @param array $args See {@link BP_Invitation::get()} 466 * for more details. 464 * @param array $args See {@link BP_Invitation::get()} for more details. 467 465 * @return string ORDER BY clause. 468 466 */ 469 467 protected static function get_order_by_sql( $args = array() ) { … … class BP_Invitation { 499 497 * 500 498 * @since 5.0.0 501 499 * 502 * @param array $args See {@link BP_Invitation::get()} 503 * for more details. 500 * @param array $args See {@link BP_Invitation::get()} for more details. 504 501 * @return string LIMIT clause. 505 502 */ 506 503 protected static function get_paged_sql( $args = array() ) { … … class BP_Invitation { 556 553 * 557 554 * @since 5.0.0 558 555 * 559 * @param $args Associative array of filter arguments.560 * See {@BP_Invitation::get()} for a breakdown.556 * @param array $args Associative array of filter arguments. 557 * See {@BP_Invitation::get()} for a breakdown. 561 558 * @return array Associative array of 'data' and 'format' args. 562 559 */ 563 560 protected static function get_query_clauses( $args = array() ) { … … class BP_Invitation { 847 844 * accepted update/where arguments. 848 845 * 849 846 * @param array $update_args Associative array of fields to update, 850 * and the values to update them to. Of the format851 * array( 'user_id' => 4, 'class' => 'BP_Groups_Invitation_Manager', )852 * @param array $where_args Associative array of columns/values, to853 * determine which rows should be updated. Of the format854 * array( 'item_id' => 7, 'class' => 'BP_Groups_Invitation_Manager', )847 * and the values to update them to. Of the format 848 * array( 'user_id' => 4, 'class' => 'BP_Groups_Invitation_Manager', ). 849 * @param array $where_args Associative array of columns/values, to 850 * determine which rows should be updated. Of the format 851 * array( 'item_id' => 7, 'class' => 'BP_Groups_Invitation_Manager', ). 855 852 * @return int|bool Number of rows updated on success, false on failure. 856 853 */ 857 854 public static function update( $update_args = array(), $where_args = array() ) { … … class BP_Invitation { 883 880 * accepted where arguments. 884 881 * 885 882 * @param array $args Associative array of columns/values, to determine 886 * which rows should be deleted. Of the format887 * array( 'item_id' => 7, 'class' => 'BP_Groups_Invitation_Manager', )883 * which rows should be deleted. Of the format 884 * array( 'item_id' => 7, 'class' => 'BP_Groups_Invitation_Manager', ). 888 885 * @return int|bool Number of rows deleted on success, false on failure. 889 886 */ 890 887 public static function delete( $args = array() ) { -
src/bp-groups/bp-groups-functions.php
diff --git src/bp-groups/bp-groups-functions.php src/bp-groups/bp-groups-functions.php index b1865ddb6..7bcad1a0a 100644
function groups_uninvite_user( $user_id, $group_id, $inviter_id = false ) { 1491 1491 'inviter_id' => $inviter_id, 1492 1492 ) ); 1493 1493 1494 1494 if ( $success ) { 1495 1495 /** 1496 1496 * Fires after uninviting a user from a group. 1497 1497 * … … function groups_reject_invite( $user_id, $group_id, $inviter_id = false ) { 1560 1560 * @since 1.0.0 1561 1561 * @since 5.0.0 The $inviter_id arg was added. 1562 1562 * 1563 * @param int $user_id ID of the user rejecting the invite.1564 * @param int $group_id ID of the group being rejected.1563 * @param int $user_id ID of the user rejecting the invite. 1564 * @param int $group_id ID of the group being rejected. 1565 1565 * @param int $inviter_id ID of the inviter. 1566 1566 */ 1567 1567 do_action( 'groups_reject_invite', $user_id, $group_id, $inviter_id ); … … function groups_check_for_membership_request( $user_id, $group_id ) { 2188 2188 * @return array Array of group IDs. 2189 2189 */ 2190 2190 function groups_get_membership_requested_user_ids( $group_id = 0 ) { 2191 2192 2193 2191 if ( ! $group_id ) { 2192 $group_id = bp_get_current_group_id(); 2193 } 2194 2194 2195 $requests 2195 $requests = groups_get_requests( array( 2196 2196 'item_id' => $group_id, 2197 2197 'fields' => 'user_ids' 2198 2198 ) ); 2199 2199 2200 //@TODO-6210: What about those who make a request by email only (not yet site members)? 2200 /** 2201 * @TODO-6210: What about those who make a request by email only (not yet site members)? 2202 */ 2201 2203 return $requests; 2202 2204 } 2203 2205 -
src/bp-groups/classes/class-bp-groups-group.php
diff --git src/bp-groups/classes/class-bp-groups-group.php src/bp-groups/classes/class-bp-groups-group.php index 8469129a5..dca139318 100644
class BP_Groups_Group { 970 970 } 971 971 if ( $page ) { 972 972 $args['page'] = $page; 973 973 } 974 974 975 975 $requests = groups_get_requests( $args ); 976 976 $total = count( groups_get_membership_requested_user_ids( $group_id ) ); -
src/bp-groups/classes/class-bp-groups-invitation-manager.php
diff --git src/bp-groups/classes/class-bp-groups-invitation-manager.php src/bp-groups/classes/class-bp-groups-invitation-manager.php index 9abf2b854..d22cd0977 100644
class BP_Groups_Invitation_Manager extends BP_Invitation_Manager { 22 22 /** 23 23 * Construct parameters. 24 24 * 25 * @since 3.1.025 * @since 5.0.0 26 26 * 27 * @param array|string $args { 28 29 * } 27 * @param array|string $args. 30 28 */ 31 29 public function __construct( $args = '' ) { 32 30 parent::__construct(); … … class BP_Groups_Invitation_Manager extends BP_Invitation_Manager { 36 34 * This is where custom actions are added to run when notifications of an 37 35 * invitation or request need to be generated & sent. 38 36 * 39 * @since 2.7.037 * @since 5.0.0 40 38 * 41 39 * @param int $id The ID of the invitation to mark as sent. 42 40 * @return bool True on success, false on failure. … … class BP_Groups_Invitation_Manager extends BP_Invitation_Manager { 63 61 * This is where custom actions are added to run when an invitation 64 62 * or request is accepted. 65 63 * 66 * @since 2.7.064 * @since 5.0.0 67 65 * 68 66 * @param string $type Are we accepting an invitation or request? 69 67 * @param array $r Parameters that describe the invitation being accepted. … … class BP_Groups_Invitation_Manager extends BP_Invitation_Manager { 131 129 * With group invitations, we don't need to keep the old record, so we delete rather than 132 130 * mark invitations as "accepted." 133 131 * 134 * @since 2.7.0132 * @since 5.0.0 135 133 * 136 134 * @see BP_Invitation::mark_accepted_by_data() 137 135 * for a description of arguments. 136 * 137 * @param array $args. 138 138 */ 139 139 public function mark_accepted( $args ) { 140 140 // Delete all existing invitations/requests to this group for this user. … … class BP_Groups_Invitation_Manager extends BP_Invitation_Manager { 149 149 * Should this invitation be created? 150 150 * 151 151 * @since 5.0.0 152 * 153 * @param array $args. 154 * @return bool 152 155 */ 153 156 public function allow_invitation( $args ) { 154 157 // Does the inviter have this capability? … … class BP_Groups_Invitation_Manager extends BP_Invitation_Manager { 173 176 * Should this request be created? 174 177 * 175 178 * @since 5.0.0 179 * 180 * @param array $args. 181 * @return bool. 176 182 */ 177 183 public function allow_request( $args ) { 178 184 // Does the requester have this capability? (Also checks for duplicates.) -
src/bp-groups/classes/class-bp-groups-member.php
diff --git src/bp-groups/classes/class-bp-groups-member.php src/bp-groups/classes/class-bp-groups-member.php index dc54b9466..8a6fe86f5 100644
class BP_Groups_Member { 833 833 'where' => '', 834 834 'limits' => '', 835 835 ); 836 //@TODO 6210. 836 /** 837 * @TODO 6210. < What has to be done? :) 838 */ 837 839 switch ( $r['type'] ) { 838 840 case 'membership' : 839 841 default : … … class BP_Groups_Member { 884 886 * 885 887 * @global WPDB $wpdb 886 888 * 887 * @param int $user_id ID of the user.888 * @param int $group_id ID of the group.889 * @param int $user_id ID of the user. 890 * @param int $group_id ID of the group. 889 891 * @param int $inviter_id ID of the inviter. Specify if you want to delete 890 892 * a specific invite. Leave false if you want to 891 893 * delete all invites to this group. -
src/class-buddypress.php
diff --git src/class-buddypress.php src/class-buddypress.php index ea807f44b..0d195abc5 100644
class BuddyPress { 467 467 require( $this->plugin_dir . 'bp-core/bp-core-theme-compatibility.php' ); 468 468 469 469 // Require all of the BuddyPress core libraries 470 require( $this->plugin_dir . 'bp-core/bp-core-dependency.php' );471 require( $this->plugin_dir . 'bp-core/bp-core-actions.php' );472 require( $this->plugin_dir . 'bp-core/bp-core-caps.php' );473 require( $this->plugin_dir . 'bp-core/bp-core-cache.php' );474 require( $this->plugin_dir . 'bp-core/bp-core-cssjs.php' );475 require( $this->plugin_dir . 'bp-core/bp-core-update.php' );476 require( $this->plugin_dir . 'bp-core/bp-core-options.php' );477 require( $this->plugin_dir . 'bp-core/bp-core-taxonomy.php' );478 require( $this->plugin_dir . 'bp-core/bp-core-filters.php' );479 require( $this->plugin_dir . 'bp-core/bp-core-attachments.php' );480 require( $this->plugin_dir . 'bp-core/bp-core-avatars.php' );481 require( $this->plugin_dir . 'bp-core/bp-core-widgets.php' );482 require( $this->plugin_dir . 'bp-core/bp-core-template.php' );483 require( $this->plugin_dir . 'bp-core/bp-core-adminbar.php' );484 require( $this->plugin_dir . 'bp-core/bp-core-buddybar.php' );485 require( $this->plugin_dir . 'bp-core/bp-core-catchuri.php' );486 require( $this->plugin_dir . 'bp-core/bp-core-functions.php' );487 require( $this->plugin_dir . 'bp-core/bp-core-moderation.php' );488 require( $this->plugin_dir . 'bp-core/bp-core-loader.php' );489 require( $this->plugin_dir . 'bp-core/bp-core-customizer-email.php' );470 require( $this->plugin_dir . 'bp-core/bp-core-dependency.php' ); 471 require( $this->plugin_dir . 'bp-core/bp-core-actions.php' ); 472 require( $this->plugin_dir . 'bp-core/bp-core-caps.php' ); 473 require( $this->plugin_dir . 'bp-core/bp-core-cache.php' ); 474 require( $this->plugin_dir . 'bp-core/bp-core-cssjs.php' ); 475 require( $this->plugin_dir . 'bp-core/bp-core-update.php' ); 476 require( $this->plugin_dir . 'bp-core/bp-core-options.php' ); 477 require( $this->plugin_dir . 'bp-core/bp-core-taxonomy.php' ); 478 require( $this->plugin_dir . 'bp-core/bp-core-filters.php' ); 479 require( $this->plugin_dir . 'bp-core/bp-core-attachments.php' ); 480 require( $this->plugin_dir . 'bp-core/bp-core-avatars.php' ); 481 require( $this->plugin_dir . 'bp-core/bp-core-widgets.php' ); 482 require( $this->plugin_dir . 'bp-core/bp-core-template.php' ); 483 require( $this->plugin_dir . 'bp-core/bp-core-adminbar.php' ); 484 require( $this->plugin_dir . 'bp-core/bp-core-buddybar.php' ); 485 require( $this->plugin_dir . 'bp-core/bp-core-catchuri.php' ); 486 require( $this->plugin_dir . 'bp-core/bp-core-functions.php' ); 487 require( $this->plugin_dir . 'bp-core/bp-core-moderation.php' ); 488 require( $this->plugin_dir . 'bp-core/bp-core-loader.php' ); 489 require( $this->plugin_dir . 'bp-core/bp-core-customizer-email.php' ); 490 490 require( $this->plugin_dir . 'bp-core/bp-core-invitations-cache.php' ); 491 491 492 492 // Maybe load deprecated functionality (this double negative is proof positive!)