@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | defined('MOODLE_INTERNAL') || die(); |
25 | 25 | |
26 | -require_once($CFG->dirroot.'/local/relationship/lib.php'); |
|
26 | +require_once($CFG->dirroot . '/local/relationship/lib.php'); |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * Event handler for relationship local plugin. |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $idnumber = $DB->get_field('user', 'idnumber', array('id'=>$event->userid)); |
115 | 115 | if (!empty($idnumber)) { |
116 | 116 | $pessoas = \local_ufsc\pessoa::by_key('idpessoa', $idnumber); |
117 | - if(!empty($pessoas)) { |
|
117 | + if (!empty($pessoas)) { |
|
118 | 118 | $pessoa = reset($pessoas); |
119 | 119 | if (!empty($pessoa->cpf)) { |
120 | 120 | $where = 'rp.cpf = :cpf'; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | if (!empty($rec->relationshipcohortid) && !empty($rec->relationshipgroupid)) { |
131 | 131 | $massassign = new \local_relationship\mass_assign_processor($rec->relationshipcohortid, $rec->relationshipgroupid, false, $rec->allowallusers); |
132 | 132 | $result = $massassign->process_relationship($event->userid); |
133 | - if (in_array($result->summary,['assigneduser', 'alreadyingroup'])) { |
|
133 | + if (in_array($result->summary, ['assigneduser', 'alreadyingroup'])) { |
|
134 | 134 | $DB->delete_records('relationship_pendencies', array('id' => $rec->id)); |
135 | 135 | } |
136 | 136 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | defined('MOODLE_INTERNAL') || die(); |
27 | 27 | |
28 | -require_once($CFG->dirroot.'/cohort/lib.php'); |
|
28 | +require_once($CFG->dirroot . '/cohort/lib.php'); |
|
29 | 29 | |
30 | 30 | class mass_assign_processor { |
31 | 31 | |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | private $registerpendencies; |
37 | 37 | private $allowallusers; |
38 | 38 | |
39 | - public function __construct($relationshipcohortid, $relationshipgroupid, $registerpendencies=false, $allowallusers=false, $authtype='') { |
|
39 | + public function __construct($relationshipcohortid, $relationshipgroupid, $registerpendencies = false, $allowallusers = false, $authtype = '') { |
|
40 | 40 | global $DB; |
41 | 41 | |
42 | 42 | $this->relationshipcohort = relationship_get_cohort($relationshipcohortid); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | $this->relationshipgroup = $DB->get_record('relationship_groups', array('id' => $relationshipgroupid), '*', MUST_EXIST); |
48 | - if($this->relationshipgroup->uniformdistribution) { |
|
48 | + if ($this->relationshipgroup->uniformdistribution) { |
|
49 | 49 | throw new \moodle_exception('cantmassassign', 'local_relationship'); |
50 | 50 | } |
51 | 51 | |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | 'level' => 'error' |
416 | 416 | ]; |
417 | 417 | } else { |
418 | - $data = (object)$params; |
|
418 | + $data = (object) $params; |
|
419 | 419 | $data->timecreated = time(); |
420 | 420 | $DB->insert_record('relationship_pendencies', $data); |
421 | 421 | $result->summary = 'registeredaspending'; |
@@ -443,9 +443,9 @@ discard block |
||
443 | 443 | } else { |
444 | 444 | for ($t = 9; $t < 11; $t++) { |
445 | 445 | for ($d = 0, $c = 0; $c < $t; $c++) { |
446 | - $d += $cpf{$c} * (($t + 1) - $c); |
|
446 | + $d += $cpf{$c}*(($t+1)-$c); |
|
447 | 447 | } |
448 | - $d = ((10 * $d) % 11) % 10; |
|
448 | + $d = ((10*$d)%11)%10; |
|
449 | 449 | if ($cpf{$c} != $d) { |
450 | 450 | return false; |
451 | 451 | } |