| | |
| | | use JVBase\rest\Rest; |
| | | use JVBase\rest\Route; |
| | | use JVBase\rest\PermissionHandler; |
| | | use JVBase\base\Site; |
| | | use JVBase\managers\CustomTable; |
| | | use WP_REST_Request; |
| | | use WP_REST_Response; |
| | |
| | | $total = $query->countResults(); |
| | | |
| | | $members = $query |
| | | ->orderBy('is_primary', 'DESC') |
| | | ->orderBy('is_primary') |
| | | ->orderBy('created_at', 'ASC') |
| | | ->limit($perPage, $offset) |
| | | ->getResults(ARRAY_A); |
| | |
| | | $total = $query->countResults(); |
| | | |
| | | $requests = $query |
| | | ->orderBy('created_date', 'DESC') |
| | | ->orderBy('created_date') |
| | | ->limit($perPage, $offset) |
| | | ->getResults(ARRAY_A); |
| | | |
| | |
| | | } |
| | | }); |
| | | |
| | | // Notify user |
| | | NotificationManager::getInstance()->addNotification( |
| | | $requestData['user_id'], |
| | | 'request_' . $status, |
| | | [ |
| | | 'term_id' => $requestData['term_id'], |
| | | 'taxonomy' => $this->taxonomy, |
| | | 'notes' => $notes |
| | | ] |
| | | ); |
| | | // Notify user TODO |
| | | // NotificationManager::getInstance()->notify( |
| | | // $requestData['user_id'], |
| | | // 'request_' . $status, |
| | | // [ |
| | | // 'term_id' => $requestData['term_id'], |
| | | // 'taxonomy' => $this->taxonomy, |
| | | // 'notes' => $notes |
| | | // ] |
| | | // ); |
| | | |
| | | $this->cache->flush(); |
| | | |
| | |
| | | |
| | | $term = get_term($termID, jvbCheckBase($this->taxonomy)); |
| | | |
| | | foreach ($managers as $managerID) { |
| | | NotificationManager::getInstance()->addNotification( |
| | | $managerID, |
| | | $notificationType, |
| | | [ |
| | | 'user_id' => $actingUserID, |
| | | 'term_id' => $termID, |
| | | 'term_name' => $term->name ?? 'Unknown', |
| | | 'taxonomy' => $this->taxonomy |
| | | ] |
| | | ); |
| | | } |
| | | //TODO |
| | | // foreach ($managers as $managerID) { |
| | | // NotificationManager::getInstance()->addNotification( |
| | | // $managerID, |
| | | // $notificationType, |
| | | // [ |
| | | // 'user_id' => $actingUserID, |
| | | // 'term_id' => $termID, |
| | | // 'term_name' => $term->name ?? 'Unknown', |
| | | // 'taxonomy' => $this->taxonomy |
| | | // ] |
| | | // ); |
| | | // } |
| | | } |
| | | } |