View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Supportez nous sur Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - Term Query - ProjeQtOr

Prochaines sessions de formation

Les prochaines formations et démonstrations sont ouvertes, inscrivez-vous rapidement !

 

Démonstration de ProjeQtOr

(gratuit, sur inscription)

Mardi 23 avril (10h30-12h)

Jeudi 16 mai (16h-17h30)

Jeudi 13 juin (10h30-12h)

 
 

Planifiez avec ProjeQtOr

3 et 4 avril (9h - 12h30)

 
 

Administrez avec ProjeQtOr

10 et 11 avril (9h - 12h30)

 

 

 
 

Term Query

More
22 Déc 2016 08:59 #1 by antonio.grr
Term Query was created by antonio.grr
Hi.
In term.php the query prepared to find Terms uses table name without prefix to specify fields. As elsewhere the method getDatabaseTableName() should be used.
Best wishes.

Please Connexion or Create an account to join the conversation.

More
22 Déc 2016 09:29 #2 by babynus
Replied by babynus on topic Term Query
I don't find a query build in /model/Term.php.
Could you point out line number ?

Babynus
Administrator of ProjeQtOr web site

Please Connexion or Create an account to join the conversation.

More
22 Déc 2016 09:50 - 22 Déc 2016 09:51 #3 by antonio.grr
Replied by antonio.grr on topic Term Query
Actually it's just the where clause
$where = '1=1';
if ($idProject) $where .= ' AND term.idProject = '.$idProject;
if ($periodType) {
$start=date('Y-m-d');
$end=date('Y-m-d');
if ($periodType=='year') {
$start=$paramYear . '-01-01';
$end=$paramYear . '-12-31';
} else if ($periodType=='month') {
$start=$paramYear . '-' . (($paramMonth<10)?'0':'') . $paramMonth . '-01';
$end=$paramYear . '-' . (($paramMonth<10)?'0':'') . $paramMonth . '-' . date('t',mktime(0,0,0,$paramMonth,1,$paramYear));
} if ($periodType=='week') {
$start=date('Y-m-d', firstDayofWeek($paramWeek, $paramYear));
$end=addDaysToDate($start,6);
}
$where.=" AND ( term.date >= '" . $start . "'";
$where.=" and term.date <='" . $end . "' )";
}

As you can see date and idProject are prefixed "term.".
My fix

//On construit la clause where
$term = new Term();
$termAlias = $term->getDatabaseTableName();
$where = '1=1';
if ($idProject)
$where .= " AND ".$termAlias . ".idProject = " . $idProject;
if ($periodType) {
$start = date('Y-m-d');
$end = date('Y-m-d');
if ($periodType == 'year') {
$start = $paramYear . '-01-01';
$end = $paramYear . '-12-31';
} else if ($periodType == 'month') {
$start = $paramYear . '-' . (($paramMonth < 10) ? '0' : '') . $paramMonth . '-01';
$end = $paramYear . '-' . (($paramMonth < 10) ? '0' : '') . $paramMonth . '-' . date('t', mktime(0, 0, 0, $paramMonth, 1, $paramYear));
} if ($periodType == 'week') {
$start = date('Y-m-d', GlbCalendar::istanza()->firstDayofWeek($paramWeek, $paramYear));
$end = GlbCalendar::istanza()->addDaysToDate($start, 6);
}
$where.=" AND ( ".$termAlias . ".date >= '" . $start . "'";
$where.=" and ". $termAlias . ".date <='" . $end . "' )";
}

$termList = $term->getSqlElementsFromCriteria(null, false, $where);
Last edit: 22 Déc 2016 09:51 by antonio.grr.
The following user(s) said Thank You: babynus

Please Connexion or Create an account to join the conversation.

More
22 Déc 2016 10:29 #4 by babynus
Replied by babynus on topic Term Query
OK !

So it's not in /modle/Term.php but in /report/term.php, I was not looking at the right file.

Thanks for your fix.
It will be included in next patch / version.

Babynus
Administrator of ProjeQtOr web site

Please Connexion or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.031 seconds

Paramétrages de cookies

×

Cookies fonctionnels

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Veuillez vous connecter pour voir vos activités!

Autres cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.