Merge branch 'release-1.3' into develop

This commit is contained in:
Thomas Keller 2012-04-19 23:39:47 +02:00
commit b356625268
10 changed files with 259 additions and 195 deletions

View File

@ -22,6 +22,7 @@ Much appreciated contributors (in alphabetical order):
Janez Troha <http://www.dz0ny.info> - Slovenian translation Janez Troha <http://www.dz0ny.info> - Slovenian translation
Jean-Philippe Fleury <jpfleury> Jean-Philippe Fleury <jpfleury>
Jerry <lxb429@gmail.com> - Chinese translation Jerry <lxb429@gmail.com> - Chinese translation
Jonathan Aillet - French translation
Julien Issler <julien@issler.net> Julien Issler <julien@issler.net>
Litew <litew9@gmail.com> - Russian translation Litew <litew9@gmail.com> - Russian translation
Ludovic Bellière <xrogaan> Ludovic Bellière <xrogaan>

View File

@ -1,4 +1,14 @@
# InDefero 1.3 - Sun Apr 15 21:10 2011 UTC # InDefero 1.3.1 - xxx xxx xx xx:xx 2012 UTC
## Bugfixes
- Compatiblity fixes for PostgreSQL
## Language and Translations
- French translation updated (thanks to Jonathan Aillet!)
# InDefero 1.3 - Sun Apr 15 21:10 2012 UTC
This new major release of Indefero is possible thanks to the sponsor of This new major release of Indefero is possible thanks to the sponsor of
[Scilab Enterprises](http://www.scilab-enterprises.com/). [Scilab Enterprises](http://www.scilab-enterprises.com/).

View File

@ -141,7 +141,12 @@ class IDF_ActivityTaxonomy
$cache[$argIdent] = 0; $cache[$argIdent] = 0;
list($higher, $lower) = $dateBoundaries; list($higher, $lower) = $dateBoundaries;
$sql = new Pluf_SQL('model_class IN ("'.implode('","', $classes).'") '. $db = Pluf::db();
$classes_esc = array();
foreach ($classes as $class) {
$classes_esc[] = $db->esc($class);
}
$sql = new Pluf_SQL('model_class IN ('.implode(',', $classes_esc).') '.
'AND creation_dtime >= %s AND creation_dtime <= %s', 'AND creation_dtime >= %s AND creation_dtime <= %s',
array($lower, $higher)); array($lower, $higher));

View File

@ -53,7 +53,7 @@ class IDF_Forge
} }
public function getProjectLabelsWithCounts() { public function getProjectLabelsWithCounts() {
$sql = new Pluf_SQL('project=0'); $sql = new Pluf_SQL('project IS NULL');
$tagList = Pluf::factory('IDF_Tag')->getList(array( $tagList = Pluf::factory('IDF_Tag')->getList(array(
'filter' => $sql->gen(), 'filter' => $sql->gen(),
'view' => 'join_projects', 'view' => 'join_projects',
@ -92,4 +92,4 @@ class IDF_Forge
public function setCustomForgePageContent($content) { public function setCustomForgePageContent($content) {
$this->conf->setVal('custom_forge_page_content', $content); $this->conf->setVal('custom_forge_page_content', $content);
} }
} }

View File

@ -0,0 +1,46 @@
<?php
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
# ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application.
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
#
# InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# InDefero is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# ***** END LICENSE BLOCK ***** */
function IDF_Migrations_25NullableProjectInTag_up($params=null)
{
$engine = Pluf::f('db_engine');
$db = Pluf::db();
if ($engine === 'PostgreSQL') {
$db->execute('ALTER TABLE '.$db->pfx.'idf_tags ALTER COLUMN project DROP NOT NULL');
} else if ($engine === 'MySQL') {
$db->execute('ALTER TABLE '.$db->pfx.'idf_tags MODIFY project MEDIUMINT NULL');
// this is only needed for non-transactional setups where MySQL set 0 as default value
$db->execute('UPDATE '.$db->pfx.'idf_tags SET project=NULL WHERE project=0');
}
}
function IDF_Migrations_25NullableProjectInTag_down($params=null)
{
$db = Pluf::db();
if ($engine === 'PostgreSQL') {
$db->execute('ALTER TABLE '.$db->pfx.'idf_tags ALTER COLUMN project SET NOT NULL');
} else if ($engine === 'MySQL') {
$db->execute('ALTER TABLE '.$db->pfx.'idf_tags MODIFY project MEDIUMINT NOT NULL');
}
}

View File

@ -115,8 +115,7 @@ class IDF_Project extends Pluf_Model
array( array(
'join' => 'LEFT JOIN '.$activityTable.' ON current_activity='.$activityTable.'.id ' 'join' => 'LEFT JOIN '.$activityTable.' ON current_activity='.$activityTable.'.id '
.'LEFT JOIN '.$tagTable.' ON idf_project_id='.$this->getSqlTable().'.id', .'LEFT JOIN '.$tagTable.' ON idf_project_id='.$this->getSqlTable().'.id',
'select' => $this->getSelect().', date, value', 'select' => 'DISTINCT '.$this->getSelect().', date, value',
'group' => $this->getSqlTable().'.id',
'props' => array( 'props' => array(
'date' => 'current_activity_date', 'date' => 'current_activity_date',
'value' => 'current_activity_value' 'value' => 'current_activity_value'

View File

@ -48,7 +48,8 @@ class IDF_Tag extends Pluf_Model
array( array(
'type' => 'Pluf_DB_Field_Foreignkey', 'type' => 'Pluf_DB_Field_Foreignkey',
'model' => 'IDF_Project', 'model' => 'IDF_Project',
'blank' => false, 'blank' => true,
'is_null' => true,
'verbose' => __('project'), 'verbose' => __('project'),
), ),
'class' => 'class' =>
@ -76,13 +77,14 @@ class IDF_Tag extends Pluf_Model
); );
$table = $this->_con->pfx.'idf_project_idf_tag_assoc'; $table = $this->_con->pfx.'idf_project_idf_tag_assoc';
$cols = implode(', ', array_keys($this->_a['cols']));
$this->_a['views'] = array( $this->_a['views'] = array(
'join_projects' => 'join_projects' =>
array( array(
'join' => 'LEFT JOIN '.$table 'join' => 'LEFT JOIN '.$table
.' ON idf_tag_id=id', .' ON idf_tag_id=id',
'select' => $this->getSelect().',COUNT(idf_project_id) as project_count', 'select' => $this->getSelect().',COUNT(idf_project_id) as project_count',
'group' => 'idf_tag_id', 'group' => $cols,
'props' => array('project_count' => 'project_count'), 'props' => array('project_count' => 'project_count'),
), ),
); );
@ -146,7 +148,7 @@ class IDF_Tag extends Pluf_Model
$class = trim($class); $class = trim($class);
$name = trim($name); $name = trim($name);
$gtag = new IDF_Tag(); $gtag = new IDF_Tag();
$sql = new Pluf_SQL('class=%s AND lcname=%s AND project=0', $sql = new Pluf_SQL('class=%s AND lcname=%s AND project IS NULL',
array($class, mb_strtolower($name))); array($class, mb_strtolower($name)));
$tags = $gtag->getList(array('filter' => $sql->gen())); $tags = $gtag->getList(array('filter' => $sql->gen()));
if ($tags->count() < 1) { if ($tags->count() < 1) {
@ -154,6 +156,7 @@ class IDF_Tag extends Pluf_Model
$tag = new IDF_Tag(); $tag = new IDF_Tag();
$tag->name = $name; $tag->name = $name;
$tag->class = $class; $tag->class = $class;
$tag->project = null;
$tag->create(); $tag->create();
return $tag; return $tag;
} }

View File

@ -83,7 +83,7 @@ class IDF_Template_MarkdownForge extends Pluf_Template_Tag
$name = $class; $name = $class;
$class = IDF_TAG_DEFAULT_CLASS; $class = IDF_TAG_DEFAULT_CLASS;
} }
$sql = new Pluf_SQL('class=%s AND lcname=%s AND project=0', $sql = new Pluf_SQL('class=%s AND lcname=%s AND project IS NULL',
array(strtolower($class), mb_strtolower($name))); array(strtolower($class), mb_strtolower($name)));
$tag = Pluf::factory('IDF_Tag')->getOne(array('filter' => $sql->gen())); $tag = Pluf::factory('IDF_Tag')->getOne(array('filter' => $sql->gen()));
} }

View File

@ -382,14 +382,14 @@ class IDF_Views
{ {
$db =& Pluf::db(); $db =& Pluf::db();
$false = Pluf_DB_BooleanToDb(false, $db); $false = Pluf_DB_BooleanToDb(false, $db);
$sql = new Pluf_SQL(1); $sql = new Pluf_SQL('1=1');
if ($tag !== false) { if ($tag !== false) {
$sql->SAnd(new Pluf_SQL('idf_tag_id=%s', $tag->id)); $sql->SAnd(new Pluf_SQL('idf_tag_id=%s', $tag->id));
} }
if ($user->isAnonymous()) if ($user->isAnonymous())
{ {
$authSql = new Pluf_SQL('private=%s', $false); $authSql = new Pluf_SQL($db->qn('private').'='.$false);
$sql->SAnd($authSql); $sql->SAnd($authSql);
} else } else
if (!$user->administrator) { if (!$user->administrator) {
@ -403,7 +403,7 @@ class IDF_Views
$permSql = new Pluf_SQL("model_class='IDF_Project' AND owner_class='Pluf_User' AND owner_id=%s AND negative=".$false, $user->id); $permSql = new Pluf_SQL("model_class='IDF_Project' AND owner_class='Pluf_User' AND owner_id=%s AND negative=".$false, $user->id);
$rows = Pluf::factory('Pluf_RowPermission')->getList(array('filter' => $permSql->gen())); $rows = Pluf::factory('Pluf_RowPermission')->getList(array('filter' => $permSql->gen()));
$authSql = new Pluf_SQL('private=%s', $false); $authSql = new Pluf_SQL($db->qn('private').'='.$false);
if ($rows->count() > 0) { if ($rows->count() > 0) {
$ids = array(); $ids = array();
foreach ($rows as $row) { foreach ($rows as $row) {

File diff suppressed because it is too large Load Diff