Indefero

Indefero Commit Details


Date:2012-05-21 16:33:38 (12 years 7 months ago)
Author:Thomas Keller
Branch:develop, release-1.3
Commit:64c66747626f8ea7fd3afbb5e33e623e2bde3f1e
Parents: 839444cc8a2548a68135db76ed7a9c56992a1d3c
Message:Copy over all project properties, except a few scm settings and very project-specific ones, when a new project is based on another one.

Changes:

File differences

NEWS.mdtext
2020
2121
2222
23
24
25
26
27
2328
2429
2530
foreign key relation. Adding project tags was not possible for a similar
reason. This has been fixed (issue 800, continued).
- If a project was created based on the settings of an existing project,
not all settings, like for example the new notification settings, have
been copied. This has been changed insofar that now all properties except
the project's URL, logo and individual SCM settings are copied by default.
# InDefero 1.3.2 - Wed May 09 20:05 2012 UTC
## Bugfixes
src/IDF/Conf.php
4444
4545
4646
47
47
4848
49
49
5050
5151
5252
......
8484
8585
8686
87
87
8888
8989
9090
......
9797
9898
9999
100
100
101101
102102
103103
......
129129
130130
131131
132
133
134
135
136
137
138
139
132140
                            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',
    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;
     */
    function setVal($key, $value)
    {
        if (!is_null($this->getVal($key, null))
        if (!is_null($this->getVal($key, null))
            and $value == $this->getVal($key)) {
            return;
        }
            $this->initCache();
        }
    }
    function getKeys()
    {
        if ($this->datacache === null) {
            $this->initCache();
        }
        return array_keys($this->datacache);
    }
}
src/IDF/Form/Admin/ProjectCreate.php
360360
361361
362362
363
364
365
366
367
368
369
363
370364
371365
372366
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
367
368
369
370
371
372
373
374
375
376
377
378
400379
401380
381
382
383
384
385
386
387
388
389
390
391
402392
403393
404394
        $conf = new IDF_Conf();
        $conf->setProject($project);
        $keys = array('scm', 'svn_remote_url', 'svn_username',
                      'svn_password', 'mtn_master_branch', 'external_project_url');
        foreach ($keys as $key) {
            $this->cleaned_data[$key] = (!empty($this->cleaned_data[$key])) ?
                $this->cleaned_data[$key] : '';
            $conf->setVal($key, $this->cleaned_data[$key]);
        }
        if ($this->cleaned_data['template'] != '--') {
            $tmplconf = new IDF_Conf();
            $tmplconf->setProject($tmpl);
            // We need to get all the configuration variables we want from
            // the old project and put them into the new project.
            $props = array(
                           'labels_download_predefined' => IDF_Form_UploadConf::init_predefined,
                           'labels_download_one_max' => IDF_Form_UploadConf::init_one_max,
                           'labels_wiki_predefined' => IDF_Form_WikiConf::init_predefined,
                           'labels_wiki_one_max' => IDF_Form_WikiConf::init_one_max,
                           'labels_issue_template' => IDF_Form_IssueTrackingConf::init_template,
                           'labels_issue_open' => IDF_Form_IssueTrackingConf::init_open,
                           'labels_issue_closed' => IDF_Form_IssueTrackingConf::init_closed,
                           'labels_issue_predefined' =>  IDF_Form_IssueTrackingConf::init_predefined,
                           'labels_issue_one_max' => IDF_Form_IssueTrackingConf::init_one_max,
                           'issue_relations' => IDF_Form_IssueTrackingConf::init_relations,
                           'webhook_url' => '',
                           'downloads_access_rights' => 'all',
                           'review_access_rights' => 'all',
                           'wiki_access_rights' => 'all',
                           'source_access_rights' => 'all',
                           'issues_access_rights' => 'all',
                           'downloads_notification_email' => '',
                           'review_notification_email' => '',
                           'wiki_notification_email' => '',
                           'source_notification_email' => '',
                           'issues_notification_email' => '',
                           );
            foreach ($props as $prop => $def) {
                $conf->setVal($prop, $tmplconf->getVal($prop, $def));
            $allKeys =  $tmplconf->getKeys();
            $scm = $this->cleaned_data['scm'];
            $ignoreKeys = array('scm', 'external_project_url', 'logo');
            // copy over all existing variables, except scm-related data and
            // the project url / logo
            foreach ($allKeys as $key) {
                if (in_array($key, $ignoreKeys) || strpos($key, $scm.'_') === 0) {
                    continue;
                }
                $conf->setVal($key, $tmplconf->getVal($key));
            }
        }
        $keys = array(
            'scm', 'svn_remote_url', 'svn_username',
            'svn_password', 'mtn_master_branch',
            'external_project_url'
        );
        foreach ($keys as $key) {
            $this->cleaned_data[$key] = !empty($this->cleaned_data[$key]) ?
                $this->cleaned_data[$key] : '';
            $conf->setVal($key, $this->cleaned_data[$key]);
        }
        $project->created();
        if ($this->cleaned_data['template'] == '--') {

Archive Download the corresponding diff file

Page rendered in 0.12155s using 13 queries.