diff --git a/application/config/email.php b/application/config/email.php index 22d3efe..6207905 100644 --- a/application/config/email.php +++ b/application/config/email.php @@ -24,4 +24,6 @@ $config['smtp_host'] = $_ENV['MAIL']['HOST']; $config['smtp_user'] = $_ENV['MAIL']['SMTP_USER']; $config['smtp_pass'] = $_ENV['MAIL']['SMTP_PASS']; $config['smtp_port'] = $_ENV['MAIL']['SMTP_PORT']; - +$config['mailtype']='html'; +$config['crlf']="\r\n"; +$config['newline']="\r\n"; diff --git a/application/controllers/shared/Organisaties.php b/application/controllers/shared/Organisaties.php index c375077..6e11c63 100644 --- a/application/controllers/shared/Organisaties.php +++ b/application/controllers/shared/Organisaties.php @@ -463,13 +463,12 @@ class Organisaties extends MY_Controller{ $orgID = $_POST['orgID']; $filename = $_FILES['file']['name']; - + $this->deleteOldBijlage($orgID); if ( ! $this->upload->do_upload('file')) $error = $this->upload->display_errors(); else { $error = FALSE; - $randomname = $this->upload->data('file_name')['file_name']; - $this->deleteOldBijlage($orgID); + $randomname = $this->upload->data('file_name'); $this->setNieuweBijlage($orgID, $randomname, $filename); } $this->json($error); diff --git a/application/controllers/shared/Users.php b/application/controllers/shared/Users.php index 67c9254..eaaa1f7 100644 --- a/application/controllers/shared/Users.php +++ b/application/controllers/shared/Users.php @@ -309,24 +309,27 @@ class Users extends MY_Controller{ } function SendNewWW(){ //TODO sanitize input - $userid = $this->uri->segment(4); - $ok = true; + $userid = $this->clean_input('userid'); + $orgid = $this->clean_input('orgid'); + $ok = true; $errortekst = ''; $user = $this->Users_model->get_record_by_id($userid); - $ww = random_string('alnum', 8); + $ww = random_string('alnum', 8); $saltedww = md5($user->zout.$ww); // update user $this->Users_model->update_record(array('wachtwoord'=>$saltedww),$userid); $data = array('username'=>$user->gnaam, 'password'=>$ww, 'fullname'=>$this->Users_model->get_fullname($userid)); - $html = $this->load->view( 'emails/newpassword_mail', $data, TRUE ); - if( $_ENV['ENVIRONMENT'] == 'production') + $html = $this->load->view( 'emails/newpassword_mail', $data, TRUE ); + $org = $this->getBijlage($orgid); + + if( $_ENV['ENVIRONMENT'] == 'production') { //Deze code wordt alleen op produktie gebruikt en stuurt de mail //naar Mailgun via een API (Codeigniter email library wordt niet gebruikt $mg = Mailgun::create( $_ENV['MAIL']['APIKEY'] ); - $mg->messages()->send( $_ENV['MAIL']['DOMAIN'], [ + $mailData = [ 'from' => 'info@monpas.nl', 'to' => $user->email, 'cc' => 'rfranke@framework-ed.nl', @@ -337,7 +340,12 @@ class Users extends MY_Controller{ 'filename' => 'monpasklein.png', 'filePath' => FCPATH . 'css/images/monpasklein.png'] ] - ] ); + ]; + if( $org->randomname ) $mailData['attachment'][0] = [ + 'filename' => $org->bijlagefile, + 'filePath' => MYROOTPATH. 'docs/'.$org->randomname ]; + + $mg->messages()->send( $_ENV['MAIL']['DOMAIN'], $mailData ); }else { $this->load->library( 'email' ); @@ -347,7 +355,10 @@ class Users extends MY_Controller{ $this->email->subject( 'Inloggegevens MonPas' ); $this->email->message( $html ); $this->email->bcc( "rfranke@framework-ed.nl" ); - $this->email->send(); + + $this->email->attach(MYROOTPATH. 'docs/'.$org->randomname,'attachment', $org->bijlagefile); + $this->email->send(); + $result = $this->email->print_debugger(); } echo json_encode(array('ok'=>$ok, 'errortekst'=>$errortekst)); diff --git a/application/views/monpas/pages/monitor.php b/application/views/monpas/pages/monitor.php index 5bfb7a2..45b6a2e 100644 --- a/application/views/monpas/pages/monitor.php +++ b/application/views/monpas/pages/monitor.php @@ -48,52 +48,55 @@ - - - - - - - - - + + + + + + + + + - diff --git a/docs/0c354386a88cefe0de14bf22fe0bf8397c6c16c8.jpg b/docs/0c354386a88cefe0de14bf22fe0bf8397c6c16c8.jpg deleted file mode 100644 index 3772c47..0000000 Binary files a/docs/0c354386a88cefe0de14bf22fe0bf8397c6c16c8.jpg and /dev/null differ diff --git a/public/js/monpas/models/gebruikersmodel.js b/public/js/monpas/models/gebruikersmodel.js index 517eea0..1891bc9 100644 --- a/public/js/monpas/models/gebruikersmodel.js +++ b/public/js/monpas/models/gebruikersmodel.js @@ -112,9 +112,9 @@ ls.initGebruikersModel = function(){ otherUsers : ko.observableArray([]), functies :ko.observableArray([]), zoekstring : ko.observable(''), - titel : ko.observable({title: ko.observable(), status: ko.observable()} ), + titel : ko.observable({title: ko.observable(), status: ko.observable()} ), autorisatieopties : ko.observableArray([]), - focusop : ko.observable(1), //werkt weer eens niet + focusop : ko.observable(1), //werkt weer eens niet bezig : ko.observable(false), initBindings :function(){ @@ -320,12 +320,19 @@ ls.initGebruikersModel = function(){ fSendNewWW: function(){ var self = ls.GebruikersModel; - $.post("index.php/shared/users/sendnewww/" + self.selectedUser().userid, function(result){ + + if (self.bezig()) return + let sd = {userid: self.selectedUser().userid, + orgid : self.selectedOrg().id} + self.bezig(true) + $.post("index.php/shared/users/SendNewWW" ,sd, function(result){ if (result) { apprise("Er is een e-mail verstuurd naar " +self.selectedUser().email() + " met daarin het nieuwe wachtwoord."); } + self.bezig(false) },'json'); }, + fToggleGeopend : function(){ this.geopend(!this.geopend()); }, diff --git a/public/js/monpas/models/omvangmodel.js b/public/js/monpas/models/omvangmodel.js index 8090ab1..5310359 100644 --- a/public/js/monpas/models/omvangmodel.js +++ b/public/js/monpas/models/omvangmodel.js @@ -372,8 +372,8 @@ mh.initOmvangModel = function(){ aantal.push(Number(o.aantalleerlingen)); var aantalsbo = 0; var aantalso = 0; - if(o.licht) aantalsbo = Number(o.licht); - if(o.zwaar) aantalsbo = aantalsbo + Number(o.zwaar); + if(o.licht()) aantalsbo = Number(o.licht()); + if(o.zwaar()) aantalsbo = aantalsbo + Number(o.zwaar()); datasbo.push(Number(aantalsbo) > 0 ? Number(aantalsbo) : null); if(o.laag()) aantalso = (Number(o.laag())); if(o.midden()) aantalso = aantalso + Number(o.midden()); @@ -644,7 +644,7 @@ mh.initOmvangModel = function(){ chart: { plotBackgroundColor: null, plotBorderWidth: null, - height: 800, + height: 850, plotShadow: false, type: 'pie', margin: [0, 0, 0, 0], @@ -683,10 +683,10 @@ mh.initOmvangModel = function(){ padding: 0, verticalAlign: 'top', floating: false, - x: -5, + x: 0, y: 260, - width: 350, - height: 500, + // width: 350, + // height: 500, itemWidth: breedte, itemDistance: 0,
nr - indicator - score -
+
nr + + score +
+ style: {color: $parent.disabled()? '#d9d9d9' : '#262626' }" style="vertical-align:top; padding-top: 5px;"> -
- +
+ + - -
- -
-
- + + + % -
-
+ + @@ -103,7 +106,7 @@ event:{click: $root.fUpdateScoretypeVanaf3.bind($data, $parent.id)}, attr: {'name': $parent.id , 'value': value, 'checked': value == $parent.score()}, enable: $root.editok() " /> - + @@ -113,10 +116,11 @@ - + +