Menu

#3 Periods mandatory?

open
nobody
None
5
2012-08-10
2012-08-10
No

The issue is, that periodes or frequencies don't habe to be defined, but it seems they are essential in the page listeAbsences.php in sql query at line
203 to 208. In my case I can't use fixed frequencies so I left them unset which results the query is always empty.

I changed the query from:

$requeteEmp = $db->query("SELECT conges_date,emp_id,conges_id,conges_demijournee,emp_secteur,emp_ent,emp_nom,emp_prenom,ent_ville,sect_nom,sect_intitule,type_nom,periodicite_libelle,conges_login_saisie,conges_date_saisie,STR_TO_DATE(REPLACE(conges_date,'-','.'),GET_FORMAT(DATE,'EUR')) AS date_format FROM abs_employe,abs_conges,abs_type,abs_entreprise,abs_secteur,abs_periodicite WHERE emp_actif = 1 AND conges_employe = emp_id AND conges_type = type_id AND ent_id = emp_ent AND sect_id = emp_secteur AND conges_debut = 0 AND conges_periodicite = periodicite_id".$where."ORDER BY date_format ASC, emp_nom ASC");

to:

$requeteEmp = $db->query("SELECT conges_date,emp_id,conges_id,conges_demijournee,emp_secteur,emp_ent,emp_nom,emp_prenom,ent_ville,sect_nom,sect_intitule,type_nom,conges_login_saisie,conges_date_saisie,STR_TO_DATE(REPLACE(conges_date,'-','.'),GET_FORMAT(DATE,'EUR')) AS date_format FROM abs_employe,abs_conges,abs_type,abs_entreprise,abs_secteur WHERE emp_actif = 1 AND conges_employe = emp_id AND conges_type = type_id AND ent_id = emp_ent AND sect_id = emp_secteur AND conges_debut = 0 ".$where."ORDER BY date_format ASC, emp_nom ASC");

which seemed to solve my issue.
Now I'll get the list as needed.

Perhaps it makes sense to make the query more dynamic for such a case or the period entry should be mandatory.

My best regards from Germany.
Planning absences is a very good piece of software.

Andreas

Discussion


Log in to post a comment.