Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

Term Query
 
Notifications
Clear all

Term Query

4 Posts
2 Users
0 Reactions
2,305 Views
(@antonio-grr)
Posts: 84
Active Member
Topic starter
 
[#3959]

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.


 
Posted : 22 Dec 2016 10H59
(@babynus)
Posts: 14952
Member Admin
 

I don't find a query build in /model/Term.php.
Could you point out line number ?


 
Posted : 22 Dec 2016 11H29
(@antonio-grr)
Posts: 84
Active Member
Topic starter
 

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= '" . $start . "'";
$where.=" and term.date 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 firstDayofWeek($paramWeek, $paramYear));
$end = GlbCalendar::istanza()->addDaysToDate($start, 6);
}
$where.=" AND ( ".$termAlias . ".date >= '" . $start . "'";
$where.=" and ". $termAlias . ".date getSqlElementsFromCriteria(null, false, $where);


 
Posted : 22 Dec 2016 11H50
(@babynus)
Posts: 14952
Member Admin
 

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.


 
Posted : 22 Dec 2016 12H29
Share:

Scroll to Top