Merge branch 'fouten/chartomvang&layoutlijst&flexibel' into develop

# Conflicts:
#	application/core/MY_Controller.php
This commit is contained in:
Monique
2022-03-28 13:43:05 +02:00
7 changed files with 73 additions and 50 deletions
+3 -1
View File
@@ -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";
@@ -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);
+19 -8
View File
@@ -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));
+33 -29
View File
@@ -48,52 +48,55 @@
<tr >
<td colspan = 2>
<!-- ko if: $parent.selectedOrgversion() && $parent.selectedOrgversion().toonOmschrijving()== false -->
<table style="width:100%">
<tr>
<th class="header2" style="width: 3%;padding-left: 2px;text-align:right"
data-bind="style: {backgroundColor: disabled() ? '#d9d9d9' : '#e7e2e5'}"> nr
</th>
<th class="header2" style="width: 50%;padding-left: 2px"
data-bind="style: {backgroundColor: disabled() ? '#d9d9d9' : '#e7e2e5'}">indicator
</th>
<th class="header2" style="width: 40%;padding-left: 2px;text-align:left"
data-bind="style: {backgroundColor: disabled() ? '#d9d9d9' : '#e7e2e5'}"> score
</th>
</tr>
<tbody data-bind="foreach: indicatorscores">
<tr style="border-bottom: 1px solid #ebebeb">
<td style="text-align:right;vertical-align:top" data-bind="text: nummer,
<table style="width:100%" data-bind="foreach: indicatorscores">
<thead data-bind="visible: $index() == 0">
<tr>
<th class="header2" style="width: 3%;padding-left: 2px;text-align:right"
data-bind="style: {backgroundColor: $parent.disabled() ? '#d9d9d9' : '#e7e2e5'} "> nr
</th>
<th class="header2" style="padding-left: 2px"
data-bind="style: {backgroundColor: $parent.disabled() ? '#d9d9d9' : '#e7e2e5'},
attr: {width: scoretype > 5 ? '65%': '72%' } ">
</th>
<th class="header2" style="padding-left: 2px;text-align:left"
data-bind="style: {backgroundColor: $parent.disabled() ? '#d9d9d9' : '#e7e2e5'},
attr: {width: scoretype > 5 ? '32%': '22%'} "> score
</th>
</tr>
</thead>
<tbody >
<tr style="border-bottom: 1px solid #ebebeb; ">
<td style="text-align:right;vertical-align:top; padding-top: 5px;" data-bind="text: nummer,
style: {color: $parent.disabled()? '#d9d9d9' : '#262626' }">
</td>
<td data-bind="text: omschrijving,
style: {color: $parent.disabled()? '#d9d9d9' : '#262626' }" style="vertical-align:top">
style: {color: $parent.disabled()? '#d9d9d9' : '#262626' }" style="vertical-align:top; padding-top: 5px;">
</td>
<td>
<div class="nietVoorPdf">
<span data-bind="visible: scoretype==1">
<td style="vertical-align:top; padding-top: 5px;" >
<span class="nietVoorPdf" data-bind="visible: scoretype==1">
<input class="rapport"
data-bind="textInput: score,
event:{input: $root.fUpdateScoretype12},
enable: $root.editok() && $parent.disabled() == false,
attr:{'id' : $index}" />
</span>
</div>
<div class="alleenVoorPdf">
<span data-bind="visible: scoretype==1 || scoretype == 2,
<span class="alleenVoorPdf" data-bind="visible: scoretype==1 || scoretype == 2,
text: score">
</span>
</div>
<div class="nietVoorPdf">
<span data-bind="visible: scoretype == 2">
<span class="nietVoorPdf"data-bind="visible: scoretype == 2">
<input class="integer"
data-bind="textInput: score,
event:{input: $root.fUpdateScoretype12},
visible: scoretype==2,
enable: $root.editok() && $parent.disabled() == false" /> %
</span>
</div>
<div data-bind="visible: scoretype==3 || scoretype == 4 || scoretype == 5 || scoretype == 6 || scoretype==7 ">
<span data-bind="visible: scoretype==3 || scoretype == 4 || scoretype == 5 || scoretype == 6 || scoretype==7 ">
<!-- ko if: $parent.disabled() == false -->
<!-- ko foreach: $root.scoreopties -->
<!-- ko if: $parent.scoretype == type -->
@@ -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() " />
<span style="vertical-align:top; display: inline-block; margin-left:5px;" data-bind="text: optie"> </span>
<span style="vertical-align:top; display: inline-block; margin-left:5px;margin-right: 20px;" data-bind="text: optie"> </span>
<!-- /ko -->
<!-- /ko -->
<!-- /ko -->
@@ -113,10 +116,11 @@
<input type='radio'
data-bind="checked: $parent.score(),
enable: false " />
<span style="vertical-align:top; display: inline-block; margin-left:5px;" data-bind="text: optie"> </span>
<span style="vertical-align:top; display: inline-block; margin-left:5px; margin-right: 20px;" data-bind="text: optie"> </span>
<!-- /ko -->
<!-- /ko -->
<!-- /ko -->
</span>
</td>
</tr>
</tbody>