Commit c91b725a authored by Jeroen's avatar Jeroen

Fixed issue where no new employee could be added in editing a org

parent ac2f9b16
Pipeline #1344 passed with stage
in 2 seconds
......@@ -205,61 +205,97 @@ if ( $user->checkForAdminLogin( $_SESSION ) ) {
<?php
$employees = $o->getEmployees( $organisation );
$x = 0;
foreach ( $employees as $e ) {
$x++;
}
?>
<div class="panel panel-default">
<?php
if ( !empty($employees) ) {
$x = 0;
foreach ( $employees as $e ) {
$x++;
}
?>
<div class="panel-heading">
<h3><?php echo L::form_employee_information ?></h3>
<button type="button" class="btn btn-primary add_employee form-knop add_employee_button" onclick="addEmployee(<?php echo $x ?>)">ADD EMPLOYEE</button>
</div>
<div class="panel-body">
<div class="panel panel-default employees">
<?php
$n = 0;
foreach($employees as $e){
<div class="panel-body">
<div class="panel panel-default employees">
<?php
$n = 0;
foreach($employees as $e){
$expertiseIds = $o->getEmployeeExpertise( $e );
$parsed = array();
foreach ( $expertiseIds as $k ) {
$parsed[] = $o->parseSingleEmployeeExpertise( $k );
}
$expertise = implode(', ', $parsed);
$expertiseIds = $o->getEmployeeExpertise( $e );
$parsed = array();
foreach ( $expertiseIds as $k ) {
$parsed[] = $o->parseSingleEmployeeExpertise( $k );
}
$expertise = implode(', ', $parsed);
$info = $o->getEmployeeInfo( $e );
?>
<div class="panel-body employee-panel panel0">
<p><b><?php echo L::form_employee_name ?></b></p>
<input class="form-control" type="text" autocomplete="off" name="employee[<?php echo $n ?>][name]" value="<?php echo $info['name'] ?>"/>
<p><b><?php echo L::form_employee_nickname ?></b></p>
<input class="form-control" type="text" autocomplete="off" name="employee[<?php echo $n ?>][nickname]" value="<?php echo $info['nickname'] ?>"/>
<p><b><?php echo L::form_employee_email ?></b></p>
<input class="form-control" type="email" autocomplete="off" name="employee[<?php echo $n ?>][email]" value="<?php echo $info['email'] ?>"/>
<p><b><?php echo L::form_employee_pgp_id ?></b></p>
<input class="form-control" type="text" autocomplete="off" name="employee[<?php echo $n ?>][pgp-id]" value="<?php echo $info['pgp_id'] ?>"/>
<p><b><?php echo L::form_employee_expertise ?></b></p>
<i><b><?php echo L::form_employee_split_expertise ?></b></i>
<input class="form-control" type="text" autocomplete="off" name="employee[<?php echo $n ?>][expertise]" value="<?php echo $expertise ?>"/>
<p><b><?php echo L::form_employee_contract_hours ?></b></p>
<input class="form-control" type="number" autocomplete="off" name="employee[<?php echo $n ?>][contract_hours]" value="<?php echo $info['contract_hours_per_week'] ?>"/>
<p><b><?php echo L::form_employee_usual_hours ?></b></p>
<input class="form-control" type="number" autocomplete="off" name="employee[<?php echo $n ?>][usual_hours]" value="<?php echo $info['usual_hours_per_week'] ?>"/>
$info = $o->getEmployeeInfo( $e );
?>
<div class="panel-body employee-panel panel0">
<p><b><?php echo L::form_employee_name ?></b></p>
<input class="form-control" type="text" autocomplete="off" name="employee[<?php echo $n ?>][name]" value="<?php echo $info['name'] ?>"/>
<p><b><?php echo L::form_employee_nickname ?></b></p>
<input class="form-control" type="text" autocomplete="off" name="employee[<?php echo $n ?>][nickname]" value="<?php echo $info['nickname'] ?>"/>
<p><b><?php echo L::form_employee_email ?></b></p>
<input class="form-control" type="email" autocomplete="off" name="employee[<?php echo $n ?>][email]" value="<?php echo $info['email'] ?>"/>
<p><b><?php echo L::form_employee_pgp_id ?></b></p>
<input class="form-control" type="text" autocomplete="off" name="employee[<?php echo $n ?>][pgp-id]" value="<?php echo $info['pgp_id'] ?>"/>
<p><b><?php echo L::form_employee_expertise ?></b></p>
<i><b><?php echo L::form_employee_split_expertise ?></b></i>
<input class="form-control" type="text" autocomplete="off" name="employee[<?php echo $n ?>][expertise]" value="<?php echo $expertise ?>"/>
<p><b><?php echo L::form_employee_contract_hours ?></b></p>
<input class="form-control" type="number" autocomplete="off" name="employee[<?php echo $n ?>][contract_hours]" value="<?php echo $info['contract_hours_per_week'] ?>"/>
<p><b><?php echo L::form_employee_usual_hours ?></b></p>
<input class="form-control" type="number" autocomplete="off" name="employee[<?php echo $n ?>][usual_hours]" value="<?php echo $info['usual_hours_per_week'] ?>"/>
<input type="hidden" name="employee[<?php echo $n?>][id]" value="<?php echo $info['id'] ?>">
<hr></hr>
</div>
<?php
<input type="hidden" name="employee[<?php echo $n?>][id]" value="<?php echo $info['id'] ?>">
<hr></hr>
</div>
<?php
$n++;
$n++;
}
}
?>
</div>
</div>
<?php
} else {
$x = 1;
?>
<div class="panel-heading">
<h3><?php echo L::form_employee_information ?></h3>
<button type="button" class="btn btn-primary add_employee form-knop add_employee_button" onclick="addEmployee(<?php echo $x ?>)">ADD EMPLOYEE</button>
</div>
</div>
<div class="panel-body">
<div class="panel panel-default employees">
<div class="panel-body employee-panel panel0">
<p><?php echo L::form_employee_name ?></p>
<input class="form-control" type="text" autocomplete="off" name="employee[0][name]"/>
<p><?php echo L::form_employee_nickname ?></p>
<input class="form-control" type="text" autocomplete="off" name="employee[0][nickname]"/>
<p><?php echo L::form_employee_email ?></p>
<input class="form-control" type="email" autocomplete="off" name="employee[0][email]"/>
<p><?php echo L::form_employee_pgp_id ?></p>
<input class="form-control" type="text" autocomplete="off" name="employee[0][pgp-id]"/>
<p><?php echo L::form_employee_expertise ?></p>
<i><?php echo L::form_employee_split_expertise ?></i>
<input class="form-control" type="text" autocomplete="off" name="employee[0][expertise]"/>
<p><?php echo L::form_employee_contract_hours ?></p>
<input class="form-control" type="number" autocomplete="off" name="employee[0][contract_hours]"/>
<p><?php echo L::form_employee_usual_hours ?></p>
<input class="form-control" type="number" autocomplete="off" name="employee[0][usual_hours]"/>
<hr></hr>
</div>
</div>
</div>
<?php
}
?>
</form>
</div>
<?php
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment