Copy over all project properties, except a few scm settings and very

project-specific ones, when a new project is based on another one.
This commit is contained in:
Thomas Keller
2012-05-21 23:33:38 +02:00
parent 839444cc8a
commit 64c6674762
3 changed files with 41 additions and 38 deletions

View File

@@ -44,9 +44,9 @@ class IDF_Conf extends Pluf_Model
array(
'type' => 'Pluf_DB_Field_Sequence',
//It is automatically added.
'blank' => true,
'blank' => true,
),
'project' =>
'project' =>
array(
'type' => 'Pluf_DB_Field_Foreignkey',
'model' => 'IDF_Project',
@@ -84,7 +84,7 @@ class IDF_Conf extends Pluf_Model
function initCache()
{
$this->datacache = new ArrayObject();
$this->datacache = array();
$sql = new Pluf_SQL('project=%s', $this->_project->id);
foreach ($this->getList(array('filter' => $sql->gen())) as $val) {
$this->datacache[$val->vkey] = $val->vdesc;
@@ -97,7 +97,7 @@ class IDF_Conf extends Pluf_Model
*/
function setVal($key, $value)
{
if (!is_null($this->getVal($key, null))
if (!is_null($this->getVal($key, null))
and $value == $this->getVal($key)) {
return;
}
@@ -129,4 +129,12 @@ class IDF_Conf extends Pluf_Model
$this->initCache();
}
}
function getKeys()
{
if ($this->datacache === null) {
$this->initCache();
}
return array_keys($this->datacache);
}
}