115,7 → 115,7 |
$aso_gestion['sj_'.$num]['jour'] = $j->thisDay(); |
$aso_gestion['sj_'.$num]['mois'] = $Calendrier->getNomMois($j->thisMonth()); |
$aso_gestion['sj_'.$num]['annee'] = $j->thisYear(); |
$aso_gestion['sj_'.$num]['mysql'] = $aso_gestion['sj_'.$num]['annee'].'-'.sprintf("%02s", $j->thisMonth()).'-'.$aso_gestion['sj_'.$num]['jour']; |
$aso_gestion['sj_'.$num]['mysql'] = $aso_gestion['sj_'.$num]['annee'].'-'.sprintf("%02s", $j->thisMonth()).'-'.sprintf("%02s", $aso_gestion['sj_'.$num]['jour']); |
$aso_jours[$aso_gestion['sj_'.$num]['mysql']] = $num; |
$aso_tps_w_vide[$num] = ''; |
} |
126,61 → 126,66 |
// Récupération des infos sur l'utilisateur |
$aso_gestion['conges_payes'] = $GLOBALS['_GTT_']['Utilisateur']->getCongesPayes(); |
$aso_gestion['rtt'] = $GLOBALS['_GTT_']['Utilisateur']->getQuotaHeuresSupp(); |
$aso_gestion['tps_w'] = $GLOBALS['_GTT_']['Utilisateur']->getTempsDeTravail(); |
$aso_gestion['tps_w'] = $GLOBALS['_GTT_']['Utilisateur']->getTempsDeTravailJour(); |
|
// Récupération des projets sur lesquels l'utilisateur travaille |
$UtilsateurAProjet = new UtilisateurAProjet(); |
$tab_uap = $UtilsateurAProjet->consulter(UtilisateurAProjet::GUAP_UTILISATEUR, $GLOBALS['_GTT_']['Utilisateur']->getIdUtilisateur()); |
$tab_projet_id = array(); |
foreach ($tab_uap as $uap) { |
$tab_projet_id[] = $uap->getIdProjet(); |
} |
// Si nous avons des données... |
$aso_gestion['bool_projets'] = false; |
if ($tab_uap && count($tab_uap) >= 1) { |
$aso_gestion['bool_projets'] = true; |
$tab_projet_id = array(); |
foreach ($tab_uap as $uap) { |
$tab_projet_id[] = $uap->getIdProjet(); |
} |
|
// Récupération du temps de travail pour un utilisateur à une date donnée |
$TravailProjet = new TravailProjet(); |
$cmd = TravailProjet::GTP_ID_UTILISATEUR_DATE_DEB_FIN; |
$param = array($GLOBALS['_GTT_']['Utilisateur']->getIdUtilisateur(), $aso_gestion['sj_1']['mysql'], $aso_gestion['sj_7']['mysql']); |
$tab_tp = $TravailProjet->consulter($cmd, $param); |
if ($tab_tp && count($tab_tp) == 1) { |
$tab_tp = array($tab_tp); |
} |
// Récupération du temps de travail pour un utilisateur à une date donnée |
$TravailProjet = new TravailProjet(); |
$cmd = TravailProjet::GTP_ID_UTILISATEUR_DATE_DEB_FIN; |
$param = array($GLOBALS['_GTT_']['Utilisateur']->getIdUtilisateur(), $aso_gestion['sj_1']['mysql'], $aso_gestion['sj_7']['mysql']); |
$tab_tp = $TravailProjet->consulter($cmd, $param); |
if ($tab_tp && count($tab_tp) == 1) { |
$tab_tp = array($tab_tp); |
} |
|
// Récupération des infos sur les projets de l'utilisateur |
$aso_gestion['totaux'] = $aso_tps_w_vide; |
$Projet = new Projet(); |
$tab_p = $Projet->consulter(Projet::GP_ID_LIST, array(implode(',', $tab_projet_id))); |
foreach ($tab_p as $Projet) { |
|
// Récupération de la catégorie du projet |
$ProjetCategorie = new ProjetCategorie(); |
$cmd = ProjetCategorie::GPC_ID; |
$param = $Projet->getCeCategorie(); |
$Categorie = $ProjetCategorie->consulter($cmd, $param); |
|
// Nous vérifions le temps de travail pour ce projet pour la semaine courrante |
$aso_tps_w = $aso_tps_w_vide; |
if (!isset($aso_gestion['categorie_totaux'][$Categorie->getLibelle()])) { |
$aso_gestion['categorie_totaux'][$Categorie->getLibelle()] = $aso_tps_w_vide; |
} |
if ($tab_tp) { |
foreach ($tab_tp as $TP) { |
if ($TP->getIdProjet() == $Projet->getIdProjet()) { |
$num = $aso_jours[$TP->getIdDateTravail()]; |
$aso_tps_w[$num] = $TP->getDuree(); |
$aso_gestion['categorie_totaux'][$Categorie->getLibelle()][$num] += $TP->getDuree(); |
$aso_gestion['totaux'][$num] += $TP->getDuree(); |
// Récupération des infos sur les projets de l'utilisateur |
$aso_gestion['totaux'] = $aso_tps_w_vide; |
$Projet = new Projet(); |
$tab_p = $Projet->consulter(Projet::GP_ID_LIST, array(implode(',', $tab_projet_id))); |
foreach ($tab_p as $Projet) { |
|
// Récupération de la catégorie du projet |
$ProjetCategorie = new ProjetCategorie(); |
$cmd = ProjetCategorie::GPC_ID; |
$param = $Projet->getCeCategorie(); |
$Categorie = $ProjetCategorie->consulter($cmd, $param); |
|
// Nous vérifions le temps de travail pour ce projet pour la semaine courrante |
$aso_tps_w = $aso_tps_w_vide; |
if (!isset($aso_gestion['categorie_totaux'][$Categorie->getLibelle()])) { |
$aso_gestion['categorie_totaux'][$Categorie->getLibelle()] = $aso_tps_w_vide; |
} |
if ($tab_tp) { |
foreach ($tab_tp as $TP) { |
if ($TP->getIdProjet() == $Projet->getIdProjet()) { |
$num = $aso_jours[$TP->getIdDateTravail()]; |
$aso_tps_w[$num] = $TP->getDuree(); |
$aso_gestion['categorie_totaux'][$Categorie->getLibelle()][$num] += $TP->getDuree(); |
$aso_gestion['totaux'][$num] += $TP->getDuree(); |
} |
} |
} |
|
// Stockage des infos nécessaire pour l'affichage |
$aso_gestion['preferences'][$Categorie->getLibelle()][] = array( |
'id' => $Projet->getIdProjet(), |
'valeur' => $Projet->getIdProjet(), |
'nom' => $Projet->getNomProjet(), |
'date' => $aso_tps_w); |
|
|
} |
|
// Stockage des infos nécessaire pour l'affichage |
$aso_gestion['preferences'][$Categorie->getLibelle()][] = array( |
'id' => $Projet->getIdProjet(), |
'valeur' => $Projet->getIdProjet(), |
'nom' => $Projet->getNomProjet(), |
'date' => $aso_tps_w); |
|
|
} |
//+-------------------------------------------------------------------------------------------------+ |
// GESTION DES ABSENCES |
198,10 → 203,10 |
$cmd = Absence::GA_ID_UTILISATEUR_DATE_DEB_FIN; |
$param = array($GLOBALS['_GTT_']['Utilisateur']->getIdUtilisateur(), $aso_gestion['sj_1']['mysql'], $aso_gestion['sj_7']['mysql']); |
$tab_a = $Absence->consulter($cmd, $param); |
// Si nous avons des absences... |
if ($tab_a && count($tab_a) == 1) { |
$tab_a = array($tab_a); |
} |
|
$aso_gestion['ab_total'] = $aso_tps_w_vide; |
if ($tab_am) { |
foreach ($tab_am as $AM) { |
219,7 → 224,7 |
} |
} |
} |
|
|
// Création de l'url de réponse du formulaire |
$aso_gestion['url_gestion_valider'] = 'index.php?action='.GTT_ACTION_GESTION_VALIDER.$url_sc_param_date; |
|
242,7 → 247,7 |
$aso_jours = array(); |
$aso_semaine = array(); |
foreach($Week->fetchAll() as $num => $j) { |
$aso_semaine[$num]['mysql'] = $j->thisYear().'-'.sprintf("%02s", $j->thisMonth()).'-'.$j->thisDay(); |
$aso_semaine[$num]['mysql'] = $j->thisYear().'-'.sprintf("%02s", $j->thisMonth()).'-'.sprintf("%02s", $j->thisDay()); |
$aso_jours[$aso_semaine[$num]['mysql']] = $num; |
} |
|