Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Commit

Permalink
Vue pour le crédit de congés RH (#752)
Browse files Browse the repository at this point in the history
* Fixes w/ Stan

* Déplacement fonctions

* Préparation template

* Création template de base

* Première adaptation

* Crédit congés groupe

* Crédit congés all

* Crédit congés user

* Correction codacy

* Message crédit

* Long variables and true
  • Loading branch information
prytoegrian authored Dec 16, 2018
1 parent 1af395d commit ae8032d
Show file tree
Hide file tree
Showing 11 changed files with 382 additions and 384 deletions.
1 change: 1 addition & 0 deletions .bettercodehub.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
exclude:
- /vendor/.*
- /node_modules/.*
- /Public/Assets/.*
component_depth: 1
languages:
Expand Down
143 changes: 143 additions & 0 deletions App/Views/HautResponsable/CreditConges.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
<?php declare(strict_types = 1);
/**
* $titre
* $tab_all_users_du_hr
* $tab_all_users_du_grand_resp
* $list_group
* $groupes
* $tab_type_cong
* $tab_type_conges_exceptionnels
*/
?>
<h1><?= $titre ?></h1>
<?php if (empty($tab_all_users_du_hr) && empty($tab_all_users_du_grand_resp)) : ?>
<?= _('resp_etat_aucun_user') ?><br>
<?php else : ?>
<h2><?= _('resp_ajout_conges_ajout_all') ?></h2>
<form action="<?= $PHP_SELF ?>" method="POST">
<fieldset class="cal_saisie">
<div class="table-responsive">
<table class="table table-hover table-condensed table-striped">
<thead>
<tr>
<th colspan="2"><?= _('resp_ajout_conges_nb_jours_all_1') ?> <?= _('resp_ajout_conges_nb_jours_all_2') ?></th>
<th><?= _('resp_ajout_conges_calcul_prop') ?></th>
<th><?= _('divers_comment_maj_1') ?></th>
</tr>
</thead>
<?php foreach ($tab_type_cong as $id_conges => $libelle) : ?>
<tr>
<td><strong><?= $libelle ?><strong></td>
<td><input class="form-control" type="text" name="tab_new_nb_conges_all[<?= $id_conges ?>]" size="6" maxlength="6" value="0"></td>
<td><?= _('resp_ajout_conges_oui') ?>
<input type="checkbox" name="tab_calcul_proportionnel[<?= $id_conges ?>]" value="TRUE" checked>
</td>
<td><input class="form-control" type="text" name="tab_new_comment_all[<?= $id_conges ?>]" size="30" maxlength="200"></td>
</tr>
<?php endforeach ; ?>
</table>
</div>
<p><?= _('resp_ajout_conges_calcul_prop_arondi') ?> !</p>
<input class="btn" type="submit" value="<?= _('form_valid_global') ?>">
</fieldset>
<input type="hidden" name="ajout_global" value="true">
</form>
<br>
<?php if (!empty($list_group)) : ?>
<h2><?= _('resp_ajout_conges_ajout_groupe') ?></h2>
<form action="<?= $PHP_SELF ?>" method="POST">
<fieldset class="cal_saisie">
<div class="table-responsive">
<table class="table table-hover table-condensed table-striped">
<tr>
<td class="big"><?= _('resp_ajout_conges_choix_groupe') ?> : </td>
<td colspan="3">
<select name="choix_groupe">
<?php foreach ($groupes as $groupe) : ?>
<option value="<?= $groupe['g_gid'] ?>"><?= $groupe['g_groupename'] ?></option>
<?php endforeach ; ?>
</td>
</tr>
<tr>
<th colspan="2"><?= _('resp_ajout_conges_nb_jours_all_1') ?> <?= _('resp_ajout_conges_nb_jours_all_2') ?></th>
<th><?= _('resp_ajout_conges_calcul_prop') ?></th>
<th><?= _('divers_comment_maj_1') ?></th>
</tr>
<?php foreach ($tab_type_cong as $id_conges => $libelle) : ?>
<tr>
<td><strong><?= $libelle ?><strong></td>
<td><input class="form-control" type="text" name="tab_new_nb_conges_all[<?= $id_conges ?>]" size="6" maxlength="6" value="0"></td>
<td><?= _('resp_ajout_conges_oui') ?>
<input type="checkbox" name="tab_calcul_proportionnel[<?= $id_conges ?>]" value="TRUE" checked>
</td>
<td>
<input class="form-control" type="text" name="tab_new_comment_all[<?= $id_conges ?>]" size="30" maxlength="200">
</td>
</tr>
<?php endforeach ; ?>
</table>
</div>
<p><?= _('resp_ajout_conges_calcul_prop_arondi') ?> ! </p>
<input class="btn" type="submit" value="<?= _('form_valid_groupe') ?>">
</fieldset>
<input type="hidden" name="ajout_groupe" value="true">
</form>
<br>
<?php endif ; ?>

<h2>Ajout par utilisateur</h2>
<form action="<?= $PHP_SELF ?>" method="POST">
<div class="table-responsive">
<table class="table table-hover table-condensed table-striped">
<thead>
<tr align="center">
<th><?= _('divers_nom_maj_1') ?></th>
<th><?= _('divers_prenom_maj_1') ?></th>
<th><?= _('divers_quotite_maj_1') ?></th>
<?php foreach ($tab_type_cong as $libelle) : ?>
<th><?= $libelle ?><br><i>(<?= _('divers_solde') ?>)</i></th>
<th><?= $libelle ?><br><?= _('resp_ajout_conges_nb_jours_ajout') ?></th>
<?php endforeach ; ?>
<?php foreach ($tab_type_conges_exceptionnels as $libelle) : ?>
<th><?= $libelle ?><br><i>(<?= _('divers_solde') ?>)</i></th>
<th><?= $libelle ?><br><?= _('resp_ajout_conges_nb_jours_ajout') ?></th>
<?php endforeach ; ?>
<th><?= _('divers_comment_maj_1') ?><br></th>
</tr>
</thead>
<tbody>
<?php $i = true; ?>
<?php foreach ($tab_all_users_du_hr as $current_login => $tab_current_user) : ?>
<?php if ($tab_current_user['is_active'] != "Y") : ?>
<?php continue; ?>
<?php endif; ?>
<tr class="<?= ($i ? 'i' : 'p') ?>">
<?php $tab_conges = $tab_current_user['conges']; ?>
<td><?= $tab_current_user['nom'] ?></td>
<td><?= $tab_current_user['prenom'] ?></td>
<td><?= $tab_current_user['quotite'] ?>%</td>
<?php foreach ($tab_type_cong as $id_conges => $libelle) : ?>
<td><?= $tab_conges[$libelle]['nb_an'] ?? 0 ?> <i>(<?= $tab_conges[$libelle]['solde'] ?? 0 ?>)</i></td>
<td align="center" class="histo">
<input class="form-control" type="text" name="tab_champ_saisie[<?= $current_login ?>][<?= $id_conges ?>]" size="6" maxlength="6" value="0">
</td>
<?php endforeach ; ?>
<?php foreach ($tab_type_conges_exceptionnels as $id_conges => $libelle) : ?>
<td><i>(<?= $tab_conges[$libelle]['solde'] ?>)</i></td>
<td align="center" class="histo">
<input class="form-control" type="text" name="tab_champ_saisie[<?= $current_login ?>][ <?= $id_conges ?>]" size="6" maxlength="6" value="0">
</td>
<?php endforeach ; ?>
<td align="center" class="histo">
<input class="form-control" type="text" name="tab_commentaire_saisie[<?= $current_login ?>]" size="30" maxlength="200" value="">
</td>
</tr>
<?php $i = !$i; ?>
<?php endforeach ; ?>
</tbody>
</table>
<input type="hidden" name="ajout_conges" value="true">
<input class="btn" type="submit" value="<?= _('form_submit') ?>">
</form>
<br>
<?php endif ;
2 changes: 2 additions & 0 deletions Public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
'/config/type_absence',
'/hr/page_principale',
'/hr/jours_chomes',
'/hr/ajout_conges',
'/admin/db_sauve',
];

Expand All @@ -33,6 +34,7 @@
case 'hr':
$_GET['onglet'] = $resource;
require_once ROOT_PATH . 'hr/hr_index.php';
break;
case 'admin':
$_GET['onglet'] = $resource;
require_once ROOT_PATH . 'admin/admin_index.php';
Expand Down
2 changes: 1 addition & 1 deletion Public/template/menu_header.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function sousmenuHR()
if ($config->canUserSaisieDemande()) {
$return .= '<a class="secondary" href="' . ROOT_PATH . 'hr/hr_index.php?onglet=traitement_demandes">Validation de congés</a>';
}
$return .= '<a class="secondary" href="' . ROOT_PATH . 'hr/hr_index.php?onglet=ajout_conges">Crédit de congés</a>
$return .= '<a class="secondary" href="' . ROOT_PATH . 'hr/ajout_conges">Crédit de congés</a>
<a class="secondary" href="' . ROOT_PATH . 'hr/jours_chomes">Jours fériés</a>
<a class="secondary" href="' . ROOT_PATH . 'hr/hr_index.php?onglet=cloture_year">Exercices</a>
<a class="secondary" href="' . ROOT_PATH . 'hr/hr_index.php?onglet=liste_planning">Plannings</a>
Expand Down
Loading

0 comments on commit ae8032d

Please sign in to comment.