@@ -21,9 +21,9 @@ discard block |
||
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'); |
|
24 | +require_once(__DIR__ . '/../../config.php'); |
|
25 | +require($CFG->dirroot . '/local/relationship/lib.php'); |
|
26 | +require_once($CFG->dirroot . '/local/relationship/locallib.php'); |
|
27 | 27 | |
28 | 28 | require_login(); |
29 | 29 | |
@@ -98,13 +98,13 @@ discard block |
||
98 | 98 | <td id="buttonscell"> |
99 | 99 | <div id="addcontrols"> |
100 | 100 | <input name="add" id="add" type="submit" |
101 | - value="<?php echo $OUTPUT->larrow().' '.s(get_string('add')); ?>" |
|
101 | + value="<?php echo $OUTPUT->larrow() . ' ' . s(get_string('add')); ?>" |
|
102 | 102 | title="<?php p(get_string('add')); ?>"/><br/> |
103 | 103 | </div> |
104 | 104 | |
105 | 105 | <div id="removecontrols"> |
106 | 106 | <input name="remove" id="remove" type="submit" |
107 | - value="<?php echo s(get_string('remove')).' '.$OUTPUT->rarrow(); ?>" |
|
107 | + value="<?php echo s(get_string('remove')) . ' ' . $OUTPUT->rarrow(); ?>" |
|
108 | 108 | title="<?php p(get_string('remove')); ?>"/> |
109 | 109 | </div> |
110 | 110 | </td> |
@@ -22,9 +22,9 @@ discard block |
||
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 |
||
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 |
||
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 | } |
@@ -21,10 +21,10 @@ discard block |
||
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 |
||
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 | } |
@@ -20,9 +20,9 @@ discard block |
||
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 |
||
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 |
||
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'); |
@@ -269,7 +269,7 @@ discard block |
||
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 |
||
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 |
||
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) { |
@@ -16,7 +16,6 @@ |
||
16 | 16 | |
17 | 17 | /** |
18 | 18 | * class based on core/admin/uu_progress_tracker by Petr Skoda |
19 | - |
|
20 | 19 | * @package local_relationship |
21 | 20 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
22 | 21 | */ |
@@ -57,16 +57,16 @@ |
||
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'])); |
@@ -21,11 +21,11 @@ |
||
21 | 21 | $settings->add(new admin_setting_heading('local_relationship/settings', get_string('massassignusers', 'local_relationship'), get_string('massassignusers_desc', 'local_relationship'))); |
22 | 22 | |
23 | 23 | $optionsauthtype = array(); |
24 | - foreach(get_enabled_auth_plugins(false) as $opt){ |
|
24 | + foreach (get_enabled_auth_plugins(false) as $opt) { |
|
25 | 25 | $optionsauthtype[$opt] = $opt; |
26 | 26 | } |
27 | 27 | $settings->add(new admin_setting_configselect('local_relationship/authtype', get_string('authtype', 'local_relationship'), |
28 | - get_string('authtype_desc', 'local_relationship') ,'manual', $optionsauthtype)); |
|
28 | + get_string('authtype_desc', 'local_relationship'), 'manual', $optionsauthtype)); |
|
29 | 29 | |
30 | 30 | $options = array(0=>get_string('no'), 1=>get_string('yes')); |
31 | 31 | $setting = new admin_setting_configselect('local_relationship/searchsccp', get_string('searchsccp', 'local_relationship'), |
@@ -25,14 +25,14 @@ discard block |
||
25 | 25 | defined('MOODLE_INTERNAL') || die(); |
26 | 26 | |
27 | 27 | use local_relationship\mass_assign_processor; |
28 | -require_once($CFG->dirroot.'/lib/formslib.php'); |
|
28 | +require_once($CFG->dirroot . '/lib/formslib.php'); |
|
29 | 29 | |
30 | 30 | class mass_assign extends \moodleform { |
31 | 31 | |
32 | 32 | /** |
33 | 33 | * Form Definition |
34 | 34 | */ |
35 | - function definition () { |
|
35 | + function definition() { |
|
36 | 36 | |
37 | 37 | $mform = $this->_form; |
38 | 38 | $relationshipgroup = $this->_customdata['data']; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $rcs = relationship_get_cohort_by_roleshortname($relationshipgroup->relationshipid, 'student'); |
49 | 49 | |
50 | 50 | $cohortrole = get_string('none'); |
51 | - if($rcs) { |
|
51 | + if ($rcs) { |
|
52 | 52 | $r = get_string('role'); |
53 | 53 | $cohortrole = "{$rcs->name} ({$r}: $rcs->rolename)"; |
54 | 54 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $mform->addHelpButton('allowallusers', 'allowallusers', 'local_relationship'); |
69 | 69 | } |
70 | 70 | |
71 | - if(mass_assign_processor::search_sccp()) { |
|
71 | + if (mass_assign_processor::search_sccp()) { |
|
72 | 72 | $mform->addElement('checkbox', 'registerpendencies', get_string('registerpendencies', 'local_relationship'), false); |
73 | 73 | $mform->addHelpButton('registerpendencies', 'registerpendencies', 'local_relationship'); |
74 | 74 | } |
@@ -22,9 +22,9 @@ discard block |
||
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 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | // Therefore, the mass assign only works in cohort without component. |
39 | 39 | // When uniform distribution is enabled, users are uniformly distribute to any group with uniformdistribution = 1 in the relationship, |
40 | 40 | // so uniform distribution needs to be disabled to mass assign users in a specific group. |
41 | -if(!empty($relationshipcohort->component) || $relationshipcohort->uniformdistribution || $relationshipgroup->uniformdistribution) { |
|
41 | +if (!empty($relationshipcohort->component) || $relationshipcohort->uniformdistribution || $relationshipgroup->uniformdistribution) { |
|
42 | 42 | print_error('cantmassassign', 'local_relationship'); |
43 | 43 | } |
44 | 44 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $rcs = relationship_get_cohort_by_roleshortname($relationshipgroup->relationshipid, 'student'); |
127 | 127 | |
128 | 128 | $cohortrole = get_string('none'); |
129 | - if($rcs) { |
|
129 | + if ($rcs) { |
|
130 | 130 | $r = get_string('role'); |
131 | 131 | $cohortrole = "{$rcs->name} ({$r}: $rcs->rolename)"; |
132 | 132 | } |
@@ -137,9 +137,9 @@ discard block |
||
137 | 137 | |
138 | 138 | $recs = $DB->get_records('relationship_pendencies', array('relationshipgroupid'=>$relationshipgroup->id, 'relationshipcohortid'=>$relationshipcohort->id), 'cpf'); |
139 | 139 | $table = new html_table(); |
140 | - $table->head = array('CPF', get_string('timecreated', 'local_relationship')); |
|
140 | + $table->head = array('CPF', get_string('timecreated', 'local_relationship')); |
|
141 | 141 | $table->data = array(); |
142 | - foreach($recs AS $rec) { |
|
142 | + foreach ($recs AS $rec) { |
|
143 | 143 | $line = array($rec->cpf, userdate($rec->timecreated)); |
144 | 144 | $baseurl->param('id', $rec->id); |
145 | 145 | $baseurl->param('delete', 1); |