@@ -153,7 +153,7 @@ public function close() {
153
153
throw new \moodle_exception ('cannotclosedraftconversation ' , 'dialogue ' );
154
154
}
155
155
// Permission check.
156
- $ canclose = (($ this ->_authorid == $ USER ->id ) or has_capability ('mod/dialogue:closeany ' , $ context ));
156
+ $ canclose = (($ this ->_authorid == $ USER ->id ) || has_capability ('mod/dialogue:closeany ' , $ context ));
157
157
if (!$ canclose ) {
158
158
throw new \moodle_exception ('nopermissiontoclose ' , 'dialogue ' );
159
159
}
@@ -187,7 +187,7 @@ public function delete() {
187
187
return true ;
188
188
}
189
189
// Permission to delete conversation.
190
- $ candelete = ((has_capability ('mod/dialogue:delete ' , $ context ) and $ USER ->id == $ this ->_authorid ) or
190
+ $ candelete = ((has_capability ('mod/dialogue:delete ' , $ context ) && $ USER ->id == $ this ->_authorid ) ||
191
191
has_capability ('mod/dialogue:deleteany ' , $ context ));
192
192
193
193
if (!$ candelete ) {
@@ -315,7 +315,7 @@ public function initialise_form() {
315
315
// Set bulk open bulk.
316
316
$ bulkopenrule = $ this ->bulkopenrule ; // Insure loaded by using magic.
317
317
318
- if (!empty ($ bulkopenrule ) and has_capability ('mod/dialogue:bulkopenrulecreate ' , $ context )) {
318
+ if (!empty ($ bulkopenrule ) && has_capability ('mod/dialogue:bulkopenrulecreate ' , $ context )) {
319
319
// Format for option item e.g. course-1, group-1.
320
320
$ groupinformation = $ bulkopenrule ['type ' ] . '- ' . $ bulkopenrule ['sourceid ' ];
321
321
$ form ->set_data (array ('groupinformation ' => $ groupinformation ));
@@ -339,7 +339,7 @@ public function initialise_form() {
339
339
// Set attachments.
340
340
$ form ->set_data (array ('attachments[itemid] ' => $ this ->_attachmentsdraftid ));
341
341
// Remove any unecessary buttons.
342
- if (($ USER ->id != $ this ->author ->id ) or is_null ($ this ->conversationid )) {
342
+ if (($ USER ->id != $ this ->author ->id ) || is_null ($ this ->conversationid )) {
343
343
$ form ->remove_from_group ('trash ' , 'actionbuttongroup ' );
344
344
}
345
345
// Attach initialised form to conversation class and return.
@@ -470,7 +470,7 @@ public function save() {
470
470
global $ DB , $ USER ;
471
471
472
472
$ admin = get_admin (); // Possible cronjob.
473
- if ($ USER ->id != $ admin ->id and $ USER ->id != $ this ->_authorid ) {
473
+ if ($ USER ->id != $ admin ->id && $ USER ->id != $ this ->_authorid ) {
474
474
throw new \moodle_exception ("This conversation doesn't belong to you! " );
475
475
}
476
476
@@ -651,8 +651,8 @@ public function send() {
651
651
$ cm = $ this ->dialogue ->cm ;
652
652
$ course = $ this ->dialogue ->course ;
653
653
654
- $ incomplete = ((empty ($ this ->_bulkopenrule ) and empty ($ this ->_participants )) or
655
- empty ($ this ->_subject ) or empty ($ this ->_body ));
654
+ $ incomplete = ((empty ($ this ->_bulkopenrule ) && empty ($ this ->_participants )) ||
655
+ empty ($ this ->_subject ) || empty ($ this ->_body ));
656
656
657
657
if ($ incomplete ) {
658
658
throw new \moodle_exception ("incompleteconversation " , 'mod_dialogue ' );
@@ -682,7 +682,7 @@ protected function set_bulk_open_rule($type = null, $sourceid = null, $includefu
682
682
/* Must have type (course, group) and sourceid (course->id, group->id) to
683
683
* be a rule, else is empty.
684
684
*/
685
- if (!is_null ($ type ) and !is_null ($ sourceid )) {
685
+ if (!is_null ($ type ) && !is_null ($ sourceid )) {
686
686
$ rule ['type ' ] = (string ) $ type ;
687
687
$ rule ['sourceid ' ] = (int ) $ sourceid ;
688
688
$ rule ['includefuturemembers ' ] = (int ) $ includefuturemembers ;
0 commit comments