@@ -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 | } |
@@ -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 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | private $authtype; |
| 36 | 36 | private $registerpendencies; |
| 37 | 37 | |
| 38 | - public function __construct($relationshipcohortid, $relationshipgroupid, $registerpendencies=false, $authtype='') { |
|
| 38 | + public function __construct($relationshipcohortid, $relationshipgroupid, $registerpendencies = false, $authtype = '') { |
|
| 39 | 39 | global $DB; |
| 40 | 40 | |
| 41 | 41 | $this->relationshipcohort = relationship_get_cohort($relationshipcohortid, false); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $this->tracker->total++; |
| 80 | 80 | |
| 81 | 81 | $moodleuserid = $this->process_user($value); |
| 82 | - if($moodleuserid) { |
|
| 82 | + if ($moodleuserid) { |
|
| 83 | 83 | $this->process_relationship($moodleuserid, $allowallusers); |
| 84 | 84 | } |
| 85 | 85 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | $this->tracker->track('status', get_string('morethanoneusersccp', 'local_relationship'), 'info'); |
| 113 | 113 | $this->tracker->invalid++; |
| 114 | 114 | return; |
| 115 | - } else if(count($pessoas) == 1) { |
|
| 115 | + } else if (count($pessoas) == 1) { |
|
| 116 | 116 | $pessoa = reset($pessoas); |
| 117 | 117 | $moodleuser = $this->find_user('idnumber', $cpf); |
| 118 | 118 | if (empty($moodleuser)) { |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | $this->tracker->alreadyregisteredaspending++; |
| 248 | 248 | return false; |
| 249 | 249 | } else { |
| 250 | - $data = (object)$params; |
|
| 250 | + $data = (object) $params; |
|
| 251 | 251 | $data->timecreated = time(); |
| 252 | 252 | $DB->insert_record('relationship_pendencies', $data); |
| 253 | 253 | $this->tracker->track('status', get_string('registeredaspending', 'local_relationship'), 'success'); |
@@ -270,9 +270,9 @@ discard block |
||
| 270 | 270 | } else { |
| 271 | 271 | for ($t = 9; $t < 11; $t++) { |
| 272 | 272 | for ($d = 0, $c = 0; $c < $t; $c++) { |
| 273 | - $d += $cpf{$c} * (($t + 1) - $c); |
|
| 273 | + $d += $cpf{$c}*(($t+1)-$c); |
|
| 274 | 274 | } |
| 275 | - $d = ((10 * $d) % 11) % 10; |
|
| 275 | + $d = ((10*$d)%11)%10; |
|
| 276 | 276 | if ($cpf{$c} != $d) { |
| 277 | 277 | return false; |
| 278 | 278 | } |