Passed
Push — 25073_inscricao_massa ( ab43ec...84fee0 )
by
unknown
56s
created
index.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
  * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 23
  */
24 24
 
25
-require_once(__DIR__.'/../../config.php');
26
-require($CFG->dirroot.'/local/relationship/lib.php');
27
-require_once($CFG->dirroot.'/local/relationship/locallib.php');
25
+require_once(__DIR__ . '/../../config.php');
26
+require($CFG->dirroot . '/local/relationship/lib.php');
27
+require_once($CFG->dirroot . '/local/relationship/locallib.php');
28 28
 
29 29
 require_login();
30 30
 $contextid = required_param('contextid', PARAM_INT);
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
 $count = '';
62 62
 if ($relationships['allrelationships'] > 0) {
63 63
     if ($searchquery === '') {
64
-        $count = ' ('.$relationships['allrelationships'].')';
64
+        $count = ' (' . $relationships['allrelationships'] . ')';
65 65
     } else {
66
-        $count = ' ('.$relationships['totalrelationships'].'/'.$relationships['allrelationships'].')';
66
+        $count = ' (' . $relationships['totalrelationships'] . '/' . $relationships['allrelationships'] . ')';
67 67
     }
68 68
 }
69 69
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     if ($course_count > 0) {
98 98
         $url = new moodle_url('/local/relationship/index.php', array('contextid' => $contextid, 'relationshipid' => $relationship->id));
99 99
         $link = html_writer::link($url, get_string('list', 'local_relationship'));
100
-        $line[] = $course_count.' ('.$link.')';
100
+        $line[] = $course_count . ' (' . $link . ')';
101 101
     } else {
102 102
         $line[] = $course_count;
103 103
     }
Please login to merge, or discard this patch.
autogroup.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,10 +21,10 @@  discard block
 block discarded – undo
21 21
  * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22 22
  */
23 23
 
24
-require_once(__DIR__.'/../../config.php');
25
-require($CFG->dirroot.'/local/relationship/lib.php');
26
-require_once($CFG->dirroot.'/local/relationship/locallib.php');
27
-require_once($CFG->dirroot.'/group/lib.php');
24
+require_once(__DIR__ . '/../../config.php');
25
+require($CFG->dirroot . '/local/relationship/lib.php');
26
+require_once($CFG->dirroot . '/local/relationship/locallib.php');
27
+require_once($CFG->dirroot . '/group/lib.php');
28 28
 
29 29
 require_login();
30 30
 
@@ -104,9 +104,9 @@  discard block
 block discarded – undo
104 104
         $table->data = array();
105 105
         foreach ($new_groups as $group) {
106 106
             if ($group['exists']) {
107
-                $text = html_writer::tag('span', $group['name'], array('style' => 'color:red; font-weight: bold;')).get_string('alreadyexists', 'local_relationship');
107
+                $text = html_writer::tag('span', $group['name'], array('style' => 'color:red; font-weight: bold;')) . get_string('alreadyexists', 'local_relationship');
108 108
             } else if ($group['exists_external']) {
109
-                $text = html_writer::tag('span', $group['name'], array('style' => 'color:red; font-weight: bold;')).get_string('alreadyexistsexternal', 'local_relationship');
109
+                $text = html_writer::tag('span', $group['name'], array('style' => 'color:red; font-weight: bold;')) . get_string('alreadyexistsexternal', 'local_relationship');
110 110
             } else {
111 111
                 $text = $group['name'];
112 112
             }
Please login to merge, or discard this patch.
edit_cohort.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@  discard block
 block discarded – undo
20 20
  * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
21 21
  */
22 22
 
23
-require_once(__DIR__.'/../../config.php');
24
-require($CFG->dirroot.'/local/relationship/lib.php');
25
-require_once($CFG->dirroot.'/local/relationship/locallib.php');
23
+require_once(__DIR__ . '/../../config.php');
24
+require($CFG->dirroot . '/local/relationship/lib.php');
25
+require_once($CFG->dirroot . '/local/relationship/locallib.php');
26 26
 
27 27
 require_login();
28 28
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 relationship_set_header($context, $baseurl, $relationship, 'cohorts');
59 59
 
60 60
 if (optional_param('delete', 0, PARAM_BOOL) && $relationshipcohort->id) {
61
-    $desc = format_string($relationshipcohort->role_name.'/'.$relationshipcohort->cohort->name);
61
+    $desc = format_string($relationshipcohort->role_name . '/' . $relationshipcohort->cohort->name);
62 62
     relationship_set_title($relationship, 'deletecohort', $desc);
63 63
     echo $OUTPUT->notification(get_string('deletecohortwarning', 'local_relationship'));
64 64
     $yesurl = new moodle_url('/local/relationship/edit_cohort.php', array('relationshipcohortid' => $relationshipcohort->id, 'relationshipid' => $relationship->id, 'delete' => 1, 'confirmedelete' => 1, 'sesskey' => sesskey()));
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 }
83 83
 
84 84
 if ($relationshipcohort->id) {
85
-    $desc = format_string($relationshipcohort->role_name.'/'.$relationshipcohort->cohort->name);
85
+    $desc = format_string($relationshipcohort->role_name . '/' . $relationshipcohort->cohort->name);
86 86
     relationship_set_title($relationship, 'editcohort', $desc);
87 87
 } else {
88 88
     relationship_set_title($relationship, 'addcohort');
Please login to merge, or discard this patch.
edit.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,10 +21,10 @@  discard block
 block discarded – undo
21 21
  * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22 22
  */
23 23
 
24
-require_once(__DIR__.'/../../config.php');
25
-require_once($CFG->libdir.'/filelib.php');
26
-require($CFG->dirroot.'/local/relationship/lib.php');
27
-require_once($CFG->dirroot.'/local/relationship/locallib.php');
24
+require_once(__DIR__ . '/../../config.php');
25
+require_once($CFG->libdir . '/filelib.php');
26
+require($CFG->dirroot . '/local/relationship/lib.php');
27
+require_once($CFG->dirroot . '/local/relationship/locallib.php');
28 28
 
29 29
 require_login();
30 30
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 
54 54
 if (optional_param('confirmdelete', 0, PARAM_BOOL) && confirm_sesskey() && $relationship->id) {
55 55
     $res = relationship_delete_relationship($relationship);
56
-    if($res === -1) {
56
+    if ($res === -1) {
57 57
         print_string('has_cohorts', 'local_relationship');
58 58
    }
59 59
     redirect($returnurl);
Please login to merge, or discard this patch.
lib.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
             'relationship',
270 270
             $relationship->id,
271 271
             context::instance_by_id($relationship->contextid),
272
-            $relationship->tags) ;
272
+            $relationship->tags);
273 273
 
274 274
         $event = \local_relationship\event\relationship_created::create(array(
275 275
                 'context' => context::instance_by_id($relationship->contextid),
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
             'relationship',
302 302
             $relationship->id,
303 303
             context::instance_by_id($relationship->contextid),
304
-            $relationship->tags) ;
304
+            $relationship->tags);
305 305
 
306 306
         $event = \local_relationship\event\relationship_updated::create(array(
307 307
                 'context' => context::instance_by_id($relationship->contextid),
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 
329 329
     $cohorts = $DB->get_records('relationship_cohorts', array('relationshipid' => $relationship->id));
330 330
 
331
-    if(count($cohorts) == 0) {
331
+    if (count($cohorts) == 0) {
332 332
 
333 333
         $relationshipgroups = $DB->get_records('relationship_groups', array('relationshipid' => $relationship->id));
334 334
         foreach ($relationshipgroups AS $g) {
Please login to merge, or discard this patch.
classes/form/mass_assign.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,14 +24,14 @@  discard block
 block discarded – undo
24 24
 namespace local_relationship\form;
25 25
 defined('MOODLE_INTERNAL') || die();
26 26
 
27
-require_once($CFG->dirroot.'/lib/formslib.php');
27
+require_once($CFG->dirroot . '/lib/formslib.php');
28 28
 
29 29
 class mass_assign extends \moodleform {
30 30
 
31 31
     /**
32 32
      * Form Definition
33 33
      */
34
-    function definition () {
34
+    function definition() {
35 35
 
36 36
         $mform = $this->_form;
37 37
         $relationshipgroup = $this->_customdata['data'];
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         $rcs = relationship_get_cohort_by_roleshortname($relationshipgroup->relationshipid, 'student');
48 48
 
49 49
         $cohortrole = get_string('none');
50
-        if($rcs) {
50
+        if ($rcs) {
51 51
             $r = get_string('role');
52 52
             $cohortrole = "{$rcs->name}  ({$r}: $rcs->rolename)";
53 53
         }
Please login to merge, or discard this patch.
classes/progress_tracker.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,16 +57,16 @@
 block discarded – undo
57 57
         $table->tablealign = 'center';
58 58
 
59 59
         $table->head = array(get_string('titleline', 'local_relationship'));
60
-        $table->align = array ('right');
61
-        foreach($this->columns AS $col) {
62
-            $table->head[] = get_string('title'.$col, 'local_relationship');
60
+        $table->align = array('right');
61
+        foreach ($this->columns AS $col) {
62
+            $table->head[] = get_string('title' . $col, 'local_relationship');
63 63
             $table->align[] = 'left';
64 64
         }
65 65
 
66 66
         $table->data = array();
67 67
         foreach ($this->rows AS $linenum => $r) {
68 68
             $row = array($linenum . '.');
69
-            foreach($r AS $col=>$occurs) {
69
+            foreach ($r AS $col=>$occurs) {
70 70
                 $text = '';
71 71
                 foreach ($occurs AS $occur) {
72 72
                     $msg = html_writer::tag('div', $occur['msg'], array('class' => 'alert-' . $occur['level']));
Please login to merge, or discard this patch.
groups.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -21,10 +21,10 @@  discard block
 block discarded – undo
21 21
  * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22 22
  */
23 23
 
24
-require_once(__DIR__.'/../../config.php');
25
-require($CFG->dirroot.'/local/relationship/lib.php');
26
-require_once($CFG->dirroot.'/local/relationship/locallib.php');
27
-require_once($CFG->libdir.'/adminlib.php');
24
+require_once(__DIR__ . '/../../config.php');
25
+require($CFG->dirroot . '/local/relationship/lib.php');
26
+require_once($CFG->dirroot . '/local/relationship/locallib.php');
27
+require_once($CFG->libdir . '/adminlib.php');
28 28
 
29 29
 require_login();
30 30
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     }
66 66
     if ($editable) {
67 67
         $url = new moodle_url('/local/relationship/edit_group.php', array('relationshipgroupid' => $relationshipgroup->id, 'uniformdistribution' => $uniformdistribution));
68
-        $line[] = $status.' ('.html_writer::link($url, $text).')';
68
+        $line[] = $status . ' (' . html_writer::link($url, $text) . ')';
69 69
     } else {
70 70
         $line[] = $status;
71 71
     }
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     if ($manager || $canassign) {
81 81
         $buttons[] = html_writer::link(new moodle_url('/local/relationship/assign.php', array('relationshipgroupid' => $relationshipgroup->id)),
82 82
                 html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/assignroles'), 'alt' => get_string('assign', 'local_relationship'), 'title' => get_string('assign', 'local_relationship'), 'class' => 'iconsmall')));
83
-        if($relationshipcohort && empty($relationshipcohort->component) && !$relationshipcohort->uniformdistribution) {
83
+        if ($relationshipcohort && empty($relationshipcohort->component) && !$relationshipcohort->uniformdistribution) {
84 84
             $buttons[] = html_writer::link(new moodle_url('/local/relationship/mass_assign.php', array('relationshipgroupid' => $relationshipgroup->id)),
85 85
                 html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/add'), 'alt' => get_string('massassign', 'local_relationship'), 'title' => get_string('massassign', 'local_relationship'), 'class' => 'iconsmall')));
86 86
         }
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
 $table = new html_table();
93 93
 $table->head = array(get_string('name', 'local_relationship'),
94 94
         get_string('memberscount', 'local_relationship'),
95
-        get_string('limit', 'local_relationship').$OUTPUT->help_icon('userlimit', 'local_relationship'),
96
-        get_string('uniformdistribute', 'local_relationship').$OUTPUT->help_icon('uniformdistribute', 'local_relationship'),
95
+        get_string('limit', 'local_relationship') . $OUTPUT->help_icon('userlimit', 'local_relationship'),
96
+        get_string('uniformdistribute', 'local_relationship') . $OUTPUT->help_icon('uniformdistribute', 'local_relationship'),
97 97
         get_string('edit'));
98 98
 $table->colclasses = array('leftalign name',
99 99
         'leftalign size',
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
     $addgroup = new single_button(new moodle_url('/local/relationship/edit_group.php', array('relationshipid' => $relationshipid)), get_string('addgroup', 'local_relationship'));
142 142
     $addgroups = new single_button(new moodle_url('/local/relationship/autogroup.php', array('relationshipid' => $relationshipid)), get_string('autogroup', 'local_relationship'));
143
-    echo html_writer::tag('div', $OUTPUT->render($addgroup).$OUTPUT->render($addgroups), array('class' => 'buttons'));
143
+    echo html_writer::tag('div', $OUTPUT->render($addgroup) . $OUTPUT->render($addgroups), array('class' => 'buttons'));
144 144
 } else if ($manager) {
145 145
     echo $OUTPUT->heading(get_string('noeditable', 'local_relationship'));
146 146
 }
Please login to merge, or discard this patch.
mass_assign.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
  * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 23
  */
24 24
 
25
-require_once(__DIR__.'/../../config.php');
26
-require_once($CFG->dirroot.'/course/lib.php');
27
-require_once($CFG->dirroot.'/cohort/lib.php');
28
-require($CFG->dirroot.'/local/relationship/lib.php');
29
-require_once($CFG->dirroot.'/local/relationship/locallib.php');
25
+require_once(__DIR__ . '/../../config.php');
26
+require_once($CFG->dirroot . '/course/lib.php');
27
+require_once($CFG->dirroot . '/cohort/lib.php');
28
+require($CFG->dirroot . '/local/relationship/lib.php');
29
+require_once($CFG->dirroot . '/local/relationship/locallib.php');
30 30
 
31 31
 require_login();
32 32
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 // Therefore, the mass assign only works in cohort without component.
41 41
 // When uniform distribution is enabled, users are assigned to any group in the relationship,
42 42
 // so uniform distribution needs to be disabled to mass assign users in a specific group.
43
-if(!empty($relationshipcohort->component) || $relationshipcohort->uniformdistribution) {
43
+if (!empty($relationshipcohort->component) || $relationshipcohort->uniformdistribution) {
44 44
     print_error('cantmassassign', 'local_relationship');
45 45
 }
46 46
 
Please login to merge, or discard this patch.