| @@ 197-204 (lines=8) @@ | ||
| 194 | // Donation reports errors. |
|
| 195 | if ( current_user_can( 'view_give_reports' ) ) { |
|
| 196 | switch ( $_GET['give-message'] ) { |
|
| 197 | case 'donation_deleted' : |
|
| 198 | Give()->notices->register_notice( array( |
|
| 199 | 'id' => 'give-donation-deleted', |
|
| 200 | 'type' => 'updated', |
|
| 201 | 'description' => __( 'The donation has been deleted.', 'give' ), |
|
| 202 | 'show' => true, |
|
| 203 | ) ); |
|
| 204 | break; |
|
| 205 | case 'email_sent' : |
|
| 206 | Give()->notices->register_notice( array( |
|
| 207 | 'id' => 'give-payment-sent', |
|
| @@ 205-212 (lines=8) @@ | ||
| 202 | 'show' => true, |
|
| 203 | ) ); |
|
| 204 | break; |
|
| 205 | case 'email_sent' : |
|
| 206 | Give()->notices->register_notice( array( |
|
| 207 | 'id' => 'give-payment-sent', |
|
| 208 | 'type' => 'updated', |
|
| 209 | 'description' => __( 'The donation receipt has been resent.', 'give' ), |
|
| 210 | 'show' => true, |
|
| 211 | ) ); |
|
| 212 | break; |
|
| 213 | case 'refreshed-reports' : |
|
| 214 | Give()->notices->register_notice( array( |
|
| 215 | 'id' => 'give-refreshed-reports', |
|
| @@ 213-220 (lines=8) @@ | ||
| 210 | 'show' => true, |
|
| 211 | ) ); |
|
| 212 | break; |
|
| 213 | case 'refreshed-reports' : |
|
| 214 | Give()->notices->register_notice( array( |
|
| 215 | 'id' => 'give-refreshed-reports', |
|
| 216 | 'type' => 'updated', |
|
| 217 | 'description' => __( 'The reports cache has been cleared.', 'give' ), |
|
| 218 | 'show' => true, |
|
| 219 | ) ); |
|
| 220 | break; |
|
| 221 | case 'donation-note-deleted' : |
|
| 222 | Give()->notices->register_notice( array( |
|
| 223 | 'id' => 'give-donation-note-deleted', |
|
| @@ 221-228 (lines=8) @@ | ||
| 218 | 'show' => true, |
|
| 219 | ) ); |
|
| 220 | break; |
|
| 221 | case 'donation-note-deleted' : |
|
| 222 | Give()->notices->register_notice( array( |
|
| 223 | 'id' => 'give-donation-note-deleted', |
|
| 224 | 'type' => 'updated', |
|
| 225 | 'description' => __( 'The donation note has been deleted.', 'give' ), |
|
| 226 | 'show' => true, |
|
| 227 | ) ); |
|
| 228 | break; |
|
| 229 | } |
|
| 230 | } |
|
| 231 | ||
| @@ 235-242 (lines=8) @@ | ||
| 232 | // Give settings notices and errors. |
|
| 233 | if ( current_user_can( 'manage_give_settings' ) ) { |
|
| 234 | switch ( $_GET['give-message'] ) { |
|
| 235 | case 'settings-imported' : |
|
| 236 | Give()->notices->register_notice( array( |
|
| 237 | 'id' => 'give-settings-imported', |
|
| 238 | 'type' => 'updated', |
|
| 239 | 'description' => __( 'The settings have been imported.', 'give' ), |
|
| 240 | 'show' => true, |
|
| 241 | ) ); |
|
| 242 | break; |
|
| 243 | case 'api-key-generated' : |
|
| 244 | Give()->notices->register_notice( array( |
|
| 245 | 'id' => 'give-api-key-generated', |
|
| @@ 243-250 (lines=8) @@ | ||
| 240 | 'show' => true, |
|
| 241 | ) ); |
|
| 242 | break; |
|
| 243 | case 'api-key-generated' : |
|
| 244 | Give()->notices->register_notice( array( |
|
| 245 | 'id' => 'give-api-key-generated', |
|
| 246 | 'type' => 'updated', |
|
| 247 | 'description' => __( 'API keys have been generated.', 'give' ), |
|
| 248 | 'show' => true, |
|
| 249 | ) ); |
|
| 250 | break; |
|
| 251 | case 'api-key-exists' : |
|
| 252 | Give()->notices->register_notice( array( |
|
| 253 | 'id' => 'give-api-key-exists', |
|
| @@ 251-258 (lines=8) @@ | ||
| 248 | 'show' => true, |
|
| 249 | ) ); |
|
| 250 | break; |
|
| 251 | case 'api-key-exists' : |
|
| 252 | Give()->notices->register_notice( array( |
|
| 253 | 'id' => 'give-api-key-exists', |
|
| 254 | 'type' => 'updated', |
|
| 255 | 'description' => __( 'The specified user already has API keys.', 'give' ), |
|
| 256 | 'show' => true, |
|
| 257 | ) ); |
|
| 258 | break; |
|
| 259 | case 'api-key-regenerated' : |
|
| 260 | Give()->notices->register_notice( array( |
|
| 261 | 'id' => 'give-api-key-regenerated', |
|
| @@ 259-266 (lines=8) @@ | ||
| 256 | 'show' => true, |
|
| 257 | ) ); |
|
| 258 | break; |
|
| 259 | case 'api-key-regenerated' : |
|
| 260 | Give()->notices->register_notice( array( |
|
| 261 | 'id' => 'give-api-key-regenerated', |
|
| 262 | 'type' => 'updated', |
|
| 263 | 'description' => __( 'API keys have been regenerated.', 'give' ), |
|
| 264 | 'show' => true, |
|
| 265 | ) ); |
|
| 266 | break; |
|
| 267 | case 'api-key-revoked' : |
|
| 268 | Give()->notices->register_notice( array( |
|
| 269 | 'id' => 'give-api-key-revoked', |
|
| @@ 267-274 (lines=8) @@ | ||
| 264 | 'show' => true, |
|
| 265 | ) ); |
|
| 266 | break; |
|
| 267 | case 'api-key-revoked' : |
|
| 268 | Give()->notices->register_notice( array( |
|
| 269 | 'id' => 'give-api-key-revoked', |
|
| 270 | 'type' => 'updated', |
|
| 271 | 'description' => __( 'API keys have been revoked.', 'give' ), |
|
| 272 | 'show' => true, |
|
| 273 | ) ); |
|
| 274 | break; |
|
| 275 | case 'sent-test-email' : |
|
| 276 | Give()->notices->register_notice( array( |
|
| 277 | 'id' => 'give-sent-test-email', |
|
| @@ 275-282 (lines=8) @@ | ||
| 272 | 'show' => true, |
|
| 273 | ) ); |
|
| 274 | break; |
|
| 275 | case 'sent-test-email' : |
|
| 276 | Give()->notices->register_notice( array( |
|
| 277 | 'id' => 'give-sent-test-email', |
|
| 278 | 'type' => 'updated', |
|
| 279 | 'description' => __( 'The test email has been sent.', 'give' ), |
|
| 280 | 'show' => true, |
|
| 281 | ) ); |
|
| 282 | break; |
|
| 283 | case 'matched-success-failure-page': |
|
| 284 | Give()->notices->register_notice( array( |
|
| 285 | 'id' => 'give-matched-success-failure-page', |
|
| @@ 283-290 (lines=8) @@ | ||
| 280 | 'show' => true, |
|
| 281 | ) ); |
|
| 282 | break; |
|
| 283 | case 'matched-success-failure-page': |
|
| 284 | Give()->notices->register_notice( array( |
|
| 285 | 'id' => 'give-matched-success-failure-page', |
|
| 286 | 'type' => 'updated', |
|
| 287 | 'description' => __( 'You cannot set the success and failed pages to the same page', 'give' ), |
|
| 288 | 'show' => true, |
|
| 289 | ) ); |
|
| 290 | break; |
|
| 291 | } |
|
| 292 | } |
|
| 293 | // Payments errors. |
|
| @@ 296-303 (lines=8) @@ | ||
| 293 | // Payments errors. |
|
| 294 | if ( current_user_can( 'edit_give_payments' ) ) { |
|
| 295 | switch ( $_GET['give-message'] ) { |
|
| 296 | case 'note-added' : |
|
| 297 | Give()->notices->register_notice( array( |
|
| 298 | 'id' => 'give-note-added', |
|
| 299 | 'type' => 'updated', |
|
| 300 | 'description' => __( 'The donation note has been added.', 'give' ), |
|
| 301 | 'show' => true, |
|
| 302 | ) ); |
|
| 303 | break; |
|
| 304 | case 'payment-updated' : |
|
| 305 | Give()->notices->register_notice( array( |
|
| 306 | 'id' => 'give-payment-updated', |
|
| @@ 304-311 (lines=8) @@ | ||
| 301 | 'show' => true, |
|
| 302 | ) ); |
|
| 303 | break; |
|
| 304 | case 'payment-updated' : |
|
| 305 | Give()->notices->register_notice( array( |
|
| 306 | 'id' => 'give-payment-updated', |
|
| 307 | 'type' => 'updated', |
|
| 308 | 'description' => __( 'The donation has been updated.', 'give' ), |
|
| 309 | 'show' => true, |
|
| 310 | ) ); |
|
| 311 | break; |
|
| 312 | } |
|
| 313 | } |
|
| 314 | ||
| @@ 318-325 (lines=8) @@ | ||
| 315 | // Donor Notices. |
|
| 316 | if ( current_user_can( 'edit_give_payments' ) ) { |
|
| 317 | switch ( $_GET['give-message'] ) { |
|
| 318 | case 'donor-deleted' : |
|
| 319 | Give()->notices->register_notice( array( |
|
| 320 | 'id' => 'give-donor-deleted', |
|
| 321 | 'type' => 'updated', |
|
| 322 | 'description' => __( 'The donor has been deleted.', 'give' ), |
|
| 323 | 'show' => true, |
|
| 324 | ) ); |
|
| 325 | break; |
|
| 326 | ||
| 327 | case 'email-added' : |
|
| 328 | Give()->notices->register_notice( array( |
|
| @@ 327-334 (lines=8) @@ | ||
| 324 | ) ); |
|
| 325 | break; |
|
| 326 | ||
| 327 | case 'email-added' : |
|
| 328 | Give()->notices->register_notice( array( |
|
| 329 | 'id' => 'give-donor-email-added', |
|
| 330 | 'type' => 'updated', |
|
| 331 | 'description' => __( 'Donor email added.', 'give' ), |
|
| 332 | 'show' => true, |
|
| 333 | ) ); |
|
| 334 | break; |
|
| 335 | ||
| 336 | case 'email-removed' : |
|
| 337 | Give()->notices->register_notice( array( |
|
| @@ 336-343 (lines=8) @@ | ||
| 333 | ) ); |
|
| 334 | break; |
|
| 335 | ||
| 336 | case 'email-removed' : |
|
| 337 | Give()->notices->register_notice( array( |
|
| 338 | 'id' => 'give-donor-email-removed', |
|
| 339 | 'type' => 'updated', |
|
| 340 | 'description' => __( 'Donor email removed.', 'give' ), |
|
| 341 | 'show' => true, |
|
| 342 | ) ); |
|
| 343 | break; |
|
| 344 | ||
| 345 | case 'email-remove-failed' : |
|
| 346 | Give()->notices->register_notice( array( |
|
| @@ 345-352 (lines=8) @@ | ||
| 342 | ) ); |
|
| 343 | break; |
|
| 344 | ||
| 345 | case 'email-remove-failed' : |
|
| 346 | Give()->notices->register_notice( array( |
|
| 347 | 'id' => 'give-donor-email-remove-failed', |
|
| 348 | 'type' => 'updated', |
|
| 349 | 'description' => __( 'Failed to remove donor email.', 'give' ), |
|
| 350 | 'show' => true, |
|
| 351 | ) ); |
|
| 352 | break; |
|
| 353 | ||
| 354 | case 'primary-email-updated' : |
|
| 355 | Give()->notices->register_notice( array( |
|
| @@ 354-361 (lines=8) @@ | ||
| 351 | ) ); |
|
| 352 | break; |
|
| 353 | ||
| 354 | case 'primary-email-updated' : |
|
| 355 | Give()->notices->register_notice( array( |
|
| 356 | 'id' => 'give-donor-primary-email-updated', |
|
| 357 | 'type' => 'updated', |
|
| 358 | 'description' => __( 'Primary email updated for donor.', 'give' ), |
|
| 359 | 'show' => true, |
|
| 360 | ) ); |
|
| 361 | break; |
|
| 362 | ||
| 363 | case 'primary-email-failed' : |
|
| 364 | Give()->notices->register_notice( array( |
|
| @@ 363-370 (lines=8) @@ | ||
| 360 | ) ); |
|
| 361 | break; |
|
| 362 | ||
| 363 | case 'primary-email-failed' : |
|
| 364 | Give()->notices->register_notice( array( |
|
| 365 | 'id' => 'give-donor-primary-email-failed', |
|
| 366 | 'type' => 'updated', |
|
| 367 | 'description' => __( 'Failed to set primary email.', 'give' ), |
|
| 368 | 'show' => true, |
|
| 369 | ) ); |
|
| 370 | break; |
|
| 371 | } |
|
| 372 | } |
|
| 373 | } |
|