Line 35... |
Line 35... |
35 |
$this->mode_verbeux = $this->getParametre('v');
|
35 |
$this->mode_verbeux = $this->getParametre('v');
|
Line 36... |
Line 36... |
36 |
|
36 |
|
37 |
switch($cmd) {
|
37 |
switch($cmd) {
|
38 |
case 'tout' :
|
38 |
case 'tout' :
|
- |
|
39 |
$this->migrerObservations();
|
39 |
$this->migrerObservations();
|
40 |
$this->migrerProjet();
|
40 |
$this->migrerObsEtendusChampsUtilisateur();
|
41 |
$this->migrerObsEtendusChampsUtilisateur();
|
41 |
$this->migrerObsEtendusUtilisateur();
|
42 |
$this->migrerObsEtendusUtilisateur();
|
42 |
$this->migrerObsEtendusProjet();
|
43 |
$this->migrerObsEtendusProjet();
|
43 |
$this->migrerMotsClesObs();
|
44 |
$this->migrerMotsClesObs();
|
Line 48... |
Line 49... |
48 |
$this->ajouterIdProjet();
|
49 |
$this->ajouterIdProjet();
|
49 |
break;
|
50 |
break;
|
50 |
case 'obs':
|
51 |
case 'obs':
|
51 |
$this->migrerObservations();
|
52 |
$this->migrerObservations();
|
52 |
break;
|
53 |
break;
|
- |
|
54 |
case 'projet':
|
- |
|
55 |
$this->migrerProjet();
|
- |
|
56 |
break;
|
53 |
case 'obs_etendus':
|
57 |
case 'obs_etendus':
|
54 |
$this->migrerObsEtendusChampsUtilisateur();
|
58 |
$this->migrerObsEtendusChampsUtilisateur();
|
55 |
$this->migrerObsEtendusUtilisateur();
|
59 |
$this->migrerObsEtendusUtilisateur();
|
56 |
$this->migrerObsEtendusProjet();
|
60 |
$this->migrerObsEtendusProjet();
|
57 |
break;
|
61 |
break;
|
Line 73... |
Line 77... |
73 |
echo 'Méthode inconnue, les méthodes possibles sont obs et images'."\n";
|
77 |
echo 'Méthode inconnue, les méthodes possibles sont obs et images'."\n";
|
74 |
}
|
78 |
}
|
75 |
}
|
79 |
}
|
Line 76... |
Line 80... |
76 |
|
80 |
|
77 |
private function migrerObservations() {
|
81 |
private function migrerObservations() {
|
78 |
$requete = "ALTER TABLE ".$this->bd_new_cel.".`occurrence` ADD project varchar(50);";
|
82 |
$requete = "ALTER TABLE ".$this->bd_new_cel.".`occurrence` ADD IF NOT EXISTS project varchar(50);";
|
Line 79... |
Line 83... |
79 |
$this->bdd->requeter($requete);
|
83 |
$this->bdd->requeter($requete);
|
80 |
|
84 |
|
81 |
$requete = "INSERT INTO ".$this->bd_new_cel.".`occurrence`
|
85 |
$requete = "INSERT INTO ".$this->bd_new_cel.".`occurrence`
|
Line 87... |
Line 91... |
87 |
|
91 |
|
88 |
$this->bdd->requeter($requete);
|
92 |
$this->bdd->requeter($requete);
|
Line 89... |
Line 93... |
89 |
}
|
93 |
}
|
90 |
|
94 |
|
91 |
private function migrerObsEtendusChampsUtilisateur() {
|
95 |
private function migrerObsEtendusChampsUtilisateur() {
|
92 |
$requete = "ALTER TABLE ".$this->bd_new_cel.".`user_custom_field` ADD `field_id` VARCHAR(500) NOT NULL AFTER `default_value`;";
|
96 |
$requete = "ALTER TABLE ".$this->bd_new_cel.".`user_custom_field` ADD IF NOT EXISTS `field_id` VARCHAR(500) NOT NULL AFTER `default_value`;";
|
93 |
$this->bdd->requeter($requete);
|
97 |
$this->bdd->requeter($requete);
|
94 |
$requete = "INSERT INTO ".$this->bd_new_cel.".`user_custom_field`
|
98 |
$requete = "INSERT INTO ".$this->bd_new_cel.".`user_custom_field`
|
95 |
(name, data_type, default_value, field_id)
|
99 |
(name, data_type, default_value, field_id)
|
Line 118... |
Line 122... |
118 |
RIGHT JOIN ".$this->bd_new_cel.".`extended_field` ON field_id = cle
|
122 |
RIGHT JOIN ".$this->bd_new_cel.".`extended_field` ON field_id = cle
|
119 |
WHERE id_observation in (select id FROM ".$this->bd_new_cel.".`occurrence`)";
|
123 |
WHERE id_observation in (select id FROM ".$this->bd_new_cel.".`occurrence`)";
|
120 |
$this->bdd->requeter($requete);
|
124 |
$this->bdd->requeter($requete);
|
121 |
}
|
125 |
}
|
Line -... |
Line 126... |
- |
|
126 |
|
- |
|
127 |
private function migrerProjet() {
|
- |
|
128 |
$requete = "INSERT INTO ".$this->bd_new_cel.".`project_settings` (`id`, `project_id`, `project`, `language`, `title`, `logo`, `description`, `type`, `is_type`, `css_style`, `image_font`, `date_created`, `date_updated`, `taxo_restriction_type`, `taxo_restriction_value`, `location_type`, `location`, `published_location`, `environments`, `project_tag_name`, `info`)
|
- |
|
129 |
SELECT * FROM ".$this->bd_cel.".`project_settings`";
|
- |
|
130 |
$this->bdd->requeter($requete);
|
- |
|
131 |
$requete = "INSERT INTO ".$this->bd_new_cel.".`extended_field` (`id`, `project_id`, `field_id`, `project`, `data_type`, `is_visible`, `is_mandatory`, `min_value`, `max_value`, `regexp`, `unit`)
|
- |
|
132 |
SELECT * FROM ".$this->bd_cel.".`extended_field`";
|
- |
|
133 |
$this->bdd->requeter($requete);
|
- |
|
134 |
$requete = "INSERT INTO ".$this->bd_new_cel.".`extendedfield_translation`(`id`, `extended_field_id`, `project`, `label`, `description`, `default_value`, `error_message`, `language_iso_code`, `help`)
|
- |
|
135 |
SELECT * FROM ".$this->bd_cel.".`extendedfield_translation`";
|
- |
|
136 |
$this->bdd->requeter($requete);
|
- |
|
137 |
}
|
122 |
|
138 |
|
123 |
private function migrerMotsClesObs() {
|
139 |
private function migrerMotsClesObs() {
|
124 |
$requete = "INSERT INTO ".$this->bd_new_cel.".user_occurrence_tag
|
140 |
$requete = "INSERT INTO ".$this->bd_new_cel.".user_occurrence_tag
|
125 |
(id, user_id, name, path)
|
141 |
(id, user_id, name, path)
|
126 |
SELECT id_mot_cle, id_utilisateur, mot_cle, chemin
|
142 |
SELECT id_mot_cle, id_utilisateur, mot_cle, chemin
|