Skip to content

Commit cb093e4

Browse files
authored
Merge branch 'main' into pluginupgrades
2 parents cebcb2d + 562f79d commit cb093e4

File tree

15 files changed

+251
-63
lines changed

15 files changed

+251
-63
lines changed

data/libraries.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@
627627
"copyrightHolders": [],
628628
"location": "lib/laravel/serializable-closure",
629629
"name": "Serializable Closure",
630-
"version": "1.3.2",
630+
"version": "1.3.3",
631631
"license": "MIT",
632632
"repository": "https://github.com/laravel/serializable-closure",
633633
"customised": false
@@ -984,7 +984,7 @@
984984
"location": "lib/psr/http-client",
985985
"name": "http-client",
986986
"description": "Provides an abstraction that describe the components of a HTTP Client.",
987-
"version": "1.0.0",
987+
"version": "1.0.3",
988988
"license": "MIT",
989989
"repository": "https://github.com/php-fig/http-client",
990990
"customised": false
@@ -1004,7 +1004,7 @@
10041004
"location": "lib/psr/http-message",
10051005
"name": "http-message",
10061006
"description": "Provide a set of common interfaces for HTTP messages as described in RFC 7230 and RFC 7231",
1007-
"version": "1.0.1",
1007+
"version": "2.0.0",
10081008
"license": "MIT",
10091009
"repository": "https://github.com/php-fig/http-message",
10101010
"customised": false
@@ -1068,7 +1068,7 @@
10681068
"location": "lib/symfony/deprecation-contracts",
10691069
"name": "Symfony Deprecation contracts",
10701070
"description": "A generic function and convention to trigger deprecation notices",
1071-
"version": "3.1.1",
1071+
"version": "3.5.0",
10721072
"license": "MIT",
10731073
"repository": "https://github.com/symfony/deprecation-contracts",
10741074
"customised": false

data/main/components.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
"privacy": "privacy",
110110
"question": "question",
111111
"rating": "rating",
112+
"report": "report",
112113
"reportbuilder": "reportbuilder",
113114
"repository": "repository",
114115
"rss": "rss",

data/migratedPages.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,11 @@ Course_formats:
137137
- filePath: "/docs/apis/plugintypes/format/index.md"
138138
slug: "/docs/apis/plugintypes/format"
139139
Creating_mobile_course_formats:
140-
- filePath: "/general/app/development/plugins-development-guide/examples/create-course-formats.md"
141-
slug: "/general/app/development/plugins-development-guide/examples/create-course-formats"
140+
- filePath: "/general/app/development/plugins-development-guide/examples/course-formats.md"
141+
slug: "/general/app/development/plugins-development-guide/examples/course-formats"
142+
Creating_mobile_question_types:
143+
- filePath: "/general/app/development/plugins-development-guide/examples/question-types.md"
144+
slug: "/general/app/development/plugins-development-guide/examples/question-types"
142145
Credits:
143146
- filePath: "/general/community/credits/index.md"
144147
slug: "/general/community/credits"
@@ -1402,17 +1405,14 @@ Moodle_App_Release_Notes:
14021405
- filePath: "/general/app_releases.md"
14031406
slug: "/general/app_releases"
14041407
Moodle_App_Release_Process:
1405-
- filePath: "/general/app/development/release-process.md"
1406-
slug: "/general/app/development/release-process"
1408+
- filePath: "/general/development/process-moodleapp/release.md"
1409+
slug: "/general/development/process-moodleapp/release"
14071410
Moodle_App_Remote_Themes:
14081411
- filePath: "/general/app/customisation/remote-themes.md"
14091412
slug: "/general/app/customisation/remote-themes"
14101413
Moodle_App_Remote_Themes_Upgrade_Guide:
14111414
- filePath: "/general/app/upgrading/remote-themes-upgrade-guide.md"
14121415
slug: "/general/app/upgrading/remote-themes-upgrade-guide"
1413-
Moodle_App_Scripts:_gulp_push:
1414-
- filePath: "/general/app/development/scripts/gulp-push.md"
1415-
slug: "/general/app/development/scripts/gulp-push"
14161416
Moodle_Development_kit:
14171417
- filePath: "/general/development/tools/mdk.md"
14181418
slug: "/general/development/tools/mdk"

data/moodle-contributors.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ Hernández
448448
Herrmann
449449
Heywood
450450
Hien
451+
Hieu
451452
Hilton
452453
Hippisley
453454
Hiroto
@@ -903,6 +904,7 @@ Rasmussen
903904
Rawson
904905
Raymond
905906
Recio
907+
Reichert
906908
Reischmann
907909
Renaat
908910
Renaud

docs/apis/subsystems/sms/index.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
---
2+
title: SMS API
3+
---
4+
5+
<Since version="4.5" issueNumber="MDL-79808" />
6+
7+
The SMS API lets you send SMS messages using configured gateways, fetch messages that were previously sent, and check on their status.
8+
9+
## Sending an SMS
10+
11+
Messages can be sent using the `send()` method of the SMS Manager class, which should be fetched using Dependency Injection, for example:
12+
13+
```php title="Sending a message"
14+
$message = \core\di::get(\core_sms\manager::class)
15+
->send(
16+
recipientnumber: '+61987654321',
17+
content: 'This is the content of the message',
18+
component: 'mod_example',
19+
messagetype: 'demonstrationmessage',
20+
recipientuserid: $user->id,
21+
issensitive: false,
22+
async: false,
23+
);
24+
```
25+
26+
:::info Message lengths
27+
28+
A single SMS sent by the API may consist of up to 480 UTF-8 characters. It is up to the message _gateway_ plugin to determine how this message is sent to the recipient.
29+
30+
Any message longer than the maximum length will be immediately rejected.
31+
32+
:::
33+
34+
### Sending messages containing sensitive information
35+
36+
When sending a message containing something like a 2FA login token, you should make use of the `issensitive` flag.
37+
38+
Passing this flag prevents the SMS subsystem from storing the content of the message in the message log.
39+
40+
The `send()` method return an instance of `\core_sms\message` which can be used to check on the message status.
41+
42+
## Fetching messages
43+
44+
Every sent message is stored in the database for subsequent reporting, and to check statuses.
45+
46+
Messages can be fetched from the database by calling the `\core_sms\manager::get_message()` and `\core_sms\manager::get_messages()` methods and supplying a filter.
47+
48+
```php title="Fetching messages"
49+
$message = \core\di::get(\core_sms\manager::class)
50+
->get_message(['id' => $id]);
51+
52+
$messages = \core\di::get(\core_sms\manager::class)
53+
->get_messages(['recipientuserid' => $userid]);
54+
```
55+
56+
:::note Sensitive content
57+
58+
If the message was sent with the `issensitive` flag the message body will not be stored.
59+
60+
:::
61+
62+
## Checking the status of a message
63+
64+
Once a message is sent, a status is recorded against it. This can be used to determine whether the message was sent successfully.
65+
66+
:::info
67+
68+
The level of status information available will depend on individual message gateways and recipient regions. In some regions delivery status may be available, but not in others.
69+
70+
:::
71+
72+
Message status can be checked using the `\core_sms\message::$status` property.
73+
74+
Statuses are represented by a PHP Enum object with each status having a translatable description, and methods to determine whether the message was sent, is failed, or still in-progress.
75+
76+
```php title="Checking the status of a message"
77+
$message = \core\di::get(\core_sms\manager::class)
78+
->get_message(['id' => $id]);
79+
80+
// Check if the message is failed.
81+
$message->is_failed();
82+
83+
// Check if the message is still in transit.
84+
$message->is_in_progress();
85+
86+
// Check if the message is sent.
87+
$message->is_sent();
88+
89+
// Get the description of the state.
90+
$message->description();
91+
```
92+
93+
```mermaid
94+
graph TD
95+
96+
classDef failed fill:#f00,color:white,font-weight:bold,stroke:yellow
97+
classDef inprogress fill:orange
98+
classDef success fill:green,color:white,font-weight:bold
99+
100+
unknown["UNKNOWN"]
101+
MOS["MESSAGE_OVER_SIZE"]:::failed
102+
GNA["GATEWAY_NOT_AVAILABLE"]:::failed
103+
GQ["GATEWAY_QUEUED"]:::inprogress
104+
GS["GATEWAY_SENT"]:::success
105+
GF["GATEWAY_FAILED"]:::failed
106+
GR["GATEWAY_REJECTED"]:::failed
107+
MLC{Message length check}
108+
GWSEL{Gateway selection}
109+
110+
direction TB
111+
start[/Start/] --> |Initial state| unknown
112+
unknown --> |Initial message checks| MLC
113+
MLC --> |Message over length| MOS
114+
MLC --> |Message within limits| GWSEL
115+
116+
GWSEL --> |No gateway available to send this message| GNA
117+
GWSEL --> |Message passed to Gateway| Gateway
118+
119+
subgraph Gateway
120+
GQ --> |The gateway rejected the message| GR
121+
GQ --> |Sent to recipient by Gateway| GS
122+
GQ --> |Gateway failed to send the message| GF
123+
end
124+
```

docs/devupdate.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,26 @@ tags:
99

1010
This page highlights the important changes that are coming in Moodle 4.5 for developers.
1111

12+
## Badges
13+
14+
### Deprecated `badges/newbadge.php`
15+
16+
The `badges/newbadge.php` and `badges/edit.php` pages have been combined to make things easier to maintain since both were pretty similar (`newbadge.php` for creating badges and `edit.php` for editing them).
17+
18+
As a result, `badges/newbadge.php` is now deprecated and will be removed in Moodle 6.0. Please update your code to use badges/edit.php instead.
19+
20+
:::info
21+
22+
Visiting
23+
24+
https://yourmoodlesite/badges/newbadge.php?id=x
25+
26+
will now automatically redirect to
27+
28+
https://yourmoodlesite/badges/edit.php?courseid=x&mode=new
29+
30+
:::
31+
1232
## Core changes
1333

1434
### Autoloader
@@ -27,6 +47,10 @@ Please note that the same limitations regarding access to the Database, Session,
2747

2848
:::
2949

50+
### SMS API
51+
52+
A new SMS API was introduced. See the [SMS API documentation](./apis/subsystems/sms/index.md) for more information.
53+
3054
## Course
3155

3256
### Reset course page

general/app/development/plugins-development-guide/examples/course-formats.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,28 +53,30 @@ class mobile {
5353
```html handlebars title="templates/mobile_course.mustache"
5454
{{=<% %>=}}
5555
<core-dynamic-component [component]="coreCourseFormatComponent.allSectionsComponent" [data]="data" class="format-myformat">
56-
<ng-container *ngFor="let section of sections">
56+
@for (section of sections; track section.id) {
5757
<ion-item-divider>
5858
<ion-label>
5959
<core-format-text [text]="section.name" contextLevel="course" [contextInstanceId]="course.id">
6060
</core-format-text>
6161
</ion-label>
6262
</ion-item-divider>
6363

64-
<ion-item *ngIf="section.summary">
65-
<ion-label>
66-
<core-format-text [text]="section.summary" contextLevel="course" [contextInstanceId]="course.id">
67-
</core-format-text>
68-
</ion-label>
69-
</ion-item>
64+
@if (section.summary) {
65+
<ion-item>
66+
<ion-label>
67+
<core-format-text [text]="section.summary" contextLevel="course" [contextInstanceId]="course.id">
68+
</core-format-text>
69+
</ion-label>
70+
</ion-item>
71+
}
7072

71-
<ng-container *ngFor="let module of section.modules">
72-
<ng-container *ngIf="module.visibleoncoursepage !== 0">
73+
@for (module of section.modules; track module.id) {
74+
@if (module.visibleoncoursepage !== 0) {
7375
<core-course-module [module]="module" [section]="section" (completionChanged)="onCompletionChange()">
7476
</core-course-module>
75-
</ng-container>
76-
</ng-container>
77-
</ng-container>
77+
}
78+
}
79+
}
7880
</core-dynamic-component>
7981
```
8082

@@ -116,11 +118,11 @@ class mobile {
116118
Then filter the list of sections in your template:
117119

118120
```html
119-
<ng-container *ngFor="let section of sections">
120-
<ng-container *ngIf="section.id in CONTENT_OTHERDATA.displaysections">
121+
@for (section of sections; track $index) {
122+
@if (section.id in CONTENT_OTHERDATA.displaysections) {
121123
<!-- code to display the section goes here -->
122-
</ng-container>
123-
</ng-container>
124+
}
125+
}
124126
```
125127

126128
## Using JavaScript

general/app/development/testing/unit-testing.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Most services will be instantiated properly without mocks, but sometimes you may
128128
129129
## Testing components
130130
131-
Angular components have a strong graphical part, but that doesn't mean that you can't test their logic and markup rendering using unit tests with Jest. You can follow [Angular's best practices for testing components](https://angular.io/guide/testing-components-scenarios), and we also provide a couple of helpers that make things easier.
131+
Angular components have a strong graphical part, but that doesn't mean that you can't test their logic and markup rendering using unit tests with Jest. You can follow [Angular's best practices for testing components](https://angular.dev/guide/testing/components-scenarios), and we also provide a couple of helpers that make things easier.
132132
133133
Let's say you want to test the following component that render a list of user names:
134134
@@ -138,7 +138,9 @@ Let's say you want to test the following component that render a list of user na
138138
template: `
139139
<h1>Users List</h1>
140140
<ul>
141-
<li *ngFor="let user of users">{{ user }}</li>
141+
@for (user of users; track $index) {
142+
<li>{{ user }}</li>
143+
}
142144
</ul>
143145
`,
144146
})

general/app_releases.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ tags:
1010

1111
| **Version name** | **Date** |
1212
|---|---|
13+
| [Moodle App 4.4.1](./app_releases/v4/v4.4.1) | 9 July 2024 |
1314
| [Moodle App 4.4.0](./app_releases/v4/v4.4.0) | 28 June 2024 |
1415
| [Moodle App 4.3.0](./app_releases/v4/v4.3.0) | 10 November 2023 |
1516
| [Moodle App 4.2.0](./app_releases/v4/v4.2.0) | 9 June 2023 |

general/app_releases/v4/v4.4.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Release date: 28 June 2024
3838
### Task
3939

4040
- [MOBILE-3947](https://tracker.moodle.org/browse/MOBILE-3947) - Upgrade to Ionic 7 and to Angular 17
41-
- [MOBILE-4357](https://tracker.moodle.org/browse/MOBILE-4357) - Upgrade Cordova and Android SDK to 34, cordova-android to 12 and cordova-ios to 7
41+
- [MOBILE-4357](https://tracker.moodle.org/browse/MOBILE-4357) - Upgrade Cordova, cordova-android to 12 and cordova-ios to 7
4242
- [MOBILE-4449](https://tracker.moodle.org/browse/MOBILE-4449) - Use Android photo picker to avoid using READ_MEDIA_IMAGES and READ_MEDIA_VIDEO
4343
- [MOBILE-4465](https://tracker.moodle.org/browse/MOBILE-4465) - Remove deprecated 4.0 code
4444
- [MOBILE-4492](https://tracker.moodle.org/browse/MOBILE-4492) - Upgrade cordova-plugin-file to 8.0.1, cordova-plugin-media-capture and use cordova-plugin-camera

0 commit comments

Comments
 (0)