@@ -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 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | private $authtype; |
| 35 | 35 | private $registerpendencies; |
| 36 | 36 | |
| 37 | - public function __construct($relationshipcohortid, $relationshipgroupid, $registerpendencies=false, $authtype='') { |
|
| 37 | + public function __construct($relationshipcohortid, $relationshipgroupid, $registerpendencies = false, $authtype = '') { |
|
| 38 | 38 | global $DB; |
| 39 | 39 | |
| 40 | 40 | $this->relationshipcohort = relationship_get_cohort($relationshipcohortid, false); |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | 'desc' => get_string('morethanoneusersccp', 'local_relationship'), |
| 130 | 130 | 'level' => 'error' |
| 131 | 131 | ]; |
| 132 | - } else if(count($pessoas) == 1) { |
|
| 132 | + } else if (count($pessoas) == 1) { |
|
| 133 | 133 | $pessoa = reset($pessoas); |
| 134 | 134 | $moodleuser = $this->find_user('idnumber', $pessoa->idpessoa); |
| 135 | 135 | if (empty($moodleuser)) { |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | if (empty($result->summary)) { |
| 321 | - $data = (object)$params; |
|
| 321 | + $data = (object) $params; |
|
| 322 | 322 | $data->timecreated = time(); |
| 323 | 323 | $DB->insert_record('relationship_pendencies', $data); |
| 324 | 324 | $result->summary = 'registeredaspending'; |
@@ -345,9 +345,9 @@ discard block |
||
| 345 | 345 | } else { |
| 346 | 346 | for ($t = 9; $t < 11; $t++) { |
| 347 | 347 | for ($d = 0, $c = 0; $c < $t; $c++) { |
| 348 | - $d += $cpf{$c} * (($t + 1) - $c); |
|
| 348 | + $d += $cpf{$c}*(($t+1)-$c); |
|
| 349 | 349 | } |
| 350 | - $d = ((10 * $d) % 11) % 10; |
|
| 350 | + $d = ((10*$d)%11)%10; |
|
| 351 | 351 | if ($cpf{$c} != $d) { |
| 352 | 352 | return false; |
| 353 | 353 | } |