| @@ -107,8 +107,13 @@ | ||
| 107 | 107 | 'title' => __('Transactions', 'better-payment'), |
| 108 | 108 | 'capability' => 'manage_options', |
| 109 | 109 | 'callback' => [$this, 'render_react_admin_page'], |
| 110 | 110 | ), |
| 111 | + $this->page_slug_prefix . '-admin&tab=subscriptions' => array( | |
| 112 | + 'title' => __('Subscriptions', 'better-payment'), | |
| 113 | + 'capability' => 'manage_options', | |
| 114 | + 'callback' => [$this, 'render_react_admin_page'], | |
| 115 | + ), | |
| 111 | 116 | $this->page_slug_prefix . '-admin&tab=analytics' => array( |
| 112 | 117 | 'title' => __('Analytics', 'better-payment'), |
| 113 | 118 | 'capability' => 'manage_options', |
| 114 | 119 | 'callback' => [$this, 'render_react_admin_page'], |
| @@ -228,37 +233,8 @@ | ||
| 228 | 233 | .auto-fold .better-payment-admin { |
| 229 | 234 | margin-left: -2px; |
| 230 | 235 | } |
| 231 | 236 | } |
| 232 | - | |
| 233 | - @media print { | |
| 234 | - body { | |
| 235 | - transform: scale(1); | |
| 236 | - background: white !important; | |
| 237 | - } | |
| 238 | - | |
| 239 | - body, body *, .wpcontent { | |
| 240 | - visibility: hidden !important; | |
| 241 | - } | |
| 242 | - | |
| 243 | - .bp-invoice-body, | |
| 244 | - .bp-invoice-body * { | |
| 245 | - visibility: visible !important; | |
| 246 | - } | |
| 247 | - | |
| 248 | - /* Make modal fill the full page */ | |
| 249 | - .bp-invoice-body { | |
| 250 | - position: absolute !important; | |
| 251 | - left: 0; | |
| 252 | - top: 100; | |
| 253 | - width: 100% !important; | |
| 254 | - height: auto !important; | |
| 255 | - } | |
| 256 | - | |
| 257 | - .bp-button-wrapper { | |
| 258 | - display: none !important; | |
| 259 | - } | |
| 260 | - } | |
| 261 | 237 | </style> |
| 262 | 238 | <?php |
| 263 | 239 | } |
| 264 | 240 | |
| @@ -287,15 +263,41 @@ | ||
| 287 | 263 | 'name' => wp_get_current_user()->display_name, |
| 288 | 264 | 'email' => wp_get_current_user()->user_email |
| 289 | 265 | ], |
| 290 | 266 | 'currencies' => $this->get_currency_list(), |
| 267 | + 'userRoles' => $this->get_user_roles_list(), | |
| 291 | 268 | 'currencySymbol' => $this->get_currency_symbol( $settings['better_payment_settings_general_general_currency'] ), |
| 292 | - 'campaignTemplates' => array_values( TemplateManager::get_all() ), | |
| 269 | + // Picker-facing, so retired designs stay out of it. The renderer | |
| 270 | + // still needs get_all(); see TemplateManager::get_for_picker(). | |
| 271 | + 'campaignTemplates' => array_values( TemplateManager::get_for_picker() ), | |
| 293 | 272 | 'adminBaseUrl' => admin_url(), |
| 273 | + // How `payment_date` (UTC) is shown: the site's timezone, an IANA name or a | |
| 274 | + // fixed offset such as `+06:00` (never '' — the `timezone_string` option is | |
| 275 | + // empty on a site set to a manual UTC offset). | |
| 276 | + 'siteTimezone' => wp_timezone_string(), | |
| 294 | 277 | ]; |
| 295 | 278 | } |
| 296 | 279 | |
| 297 | 280 | /** |
| 281 | + * Get the site's user roles as a role_key => display_name map. | |
| 282 | + * | |
| 283 | + * Used by the Settings page (E-commerce > Subscription) role selects. | |
| 284 | + * | |
| 285 | + * @since 2.3.2 | |
| 286 | + * @return array | |
| 287 | + */ | |
| 288 | + private function get_user_roles_list() | |
| 289 | + { | |
| 290 | + $roles = []; | |
| 291 | + | |
| 292 | + foreach (wp_roles()->roles as $role_key => $role) { | |
| 293 | + $roles[$role_key] = translate_user_role($role['name']); | |
| 294 | + } | |
| 295 | + | |
| 296 | + return $roles; | |
| 297 | + } | |
| 298 | + | |
| 299 | + /** | |
| 298 | 300 | * Customize admin footer text and version display |
| 299 | 301 | * |
| 300 | 302 | * @since 1.5.0 |
| 301 | 303 | */ |
| @@ -300,10 +302,15 @@ | ||
| 300 | 302 | * @since 1.5.0 |
| 301 | 303 | */ |
| 302 | 304 | public function customize_admin_footer($hook) |
| 303 | 305 | { |
| 304 | - // Only apply to Better Payment admin pages | |
| 305 | - if (strpos($hook, $this->page_slug_prefix . '-admin') === false) { | |
| 306 | + // Only apply to Better Payment admin pages — including the campaign | |
| 307 | + // builder page, whose hook is suffixed with 'bp-campaign-builder' | |
| 308 | + // rather than the '-admin' slug, so it shares the same branded footer. | |
| 309 | + if ( | |
| 310 | + strpos($hook, $this->page_slug_prefix . '-admin') === false | |
| 311 | + && strpos($hook, 'bp-campaign-builder') === false | |
| 312 | + ) { | |
| 306 | 313 | return; |
| 307 | 314 | } |
| 308 | 315 | |
| 309 | 316 | add_filter('admin_footer_text', [$this, 'get_footer_text']); |
| @@ -394,8 +401,11 @@ | ||
| 394 | 401 | $admin_css_file, |
| 395 | 402 | [], |
| 396 | 403 | $this->file_version |
| 397 | 404 | ); |
| 405 | + | |
| 406 | + // Styles for the screens only Pro renders (receipt modal, Analytics, refund card, | |
| 407 | + // licence page) ship with Better Payment Pro, which depends on this handle. | |
| 398 | 408 | |
| 399 | 409 | // Campaign-list CSS contains the template-select modal styles needed on this page too. |
| 400 | 410 | $campaign_list_css = BETTER_PAYMENT_ASSETS . '/admin/campaign-list/campaign-list.min.css'; |
| 401 | 411 | if ( file_exists( BETTER_PAYMENT_PATH . '/assets/admin/campaign-list/campaign-list.min.css' ) ) { |