Subversion Repositories eFlore/Applications.cel

Rev

Rev 3731 | Rev 3733 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3731 Rev 3732
Line 137... Line 137...
137
                        $obsAAjouter['date_published'] = $obsAAjouter['date_created'];
137
                        $obsAAjouter['date_published'] = $obsAAjouter['date_created'];
Line 138... Line 138...
138
 
138
 
139
                        $obsAAjouter['image_nom'] = $obs['image_nom'] ?? null;
139
                        $obsAAjouter['image_nom'] = $obs['image_nom'] ?? null;
Line 140... Line 140...
140
                        $obsAAjouter['image_b64'] = $obs['image_b64'] ?? null;
140
                        $obsAAjouter['image_b64'] = $obs['image_b64'] ?? null;
141
 
141
 
142
                        $obsAAjouter['certainty'] = ($this->project == "aDeterminer") ? 'à déterminer' : '';
142
                        $obsAAjouter['certainty'] = null;
143
                        if (isset($obs['certitude'])) {
143
                        if (isset($obs['certitude'])) {
144
                            switch ($obs['certitude']) {
144
                            switch ($obs['certitude']) {
145
                                case 'certaine':
145
                                case 'certaine':
Line 151... Line 151...
151
                                default:
151
                                default:
152
                                    $obsAAjouter['certainty'] = $obs['certitude'];
152
                                    $obsAAjouter['certainty'] = $obs['certitude'];
153
                                    break;
153
                                    break;
154
                            }
154
                            }
155
                        }
155
                        }
-
 
156
                        $obsAAjouter['certainty'] = ($this->project == "aDeterminer") ? 'à déterminer' : $obsAAjouter['certainty'];
156
                        $obsAAjouter['input_source'] = 'widget';
157
                        $obsAAjouter['input_source'] = 'widget';
157
                        $obsAAjouter['project_id'] = $this->projetId;
158
                        $obsAAjouter['project_id'] = $this->projetId;
158
                        $obsAAjouter['project'] = ($this->projectId == null) ? null : $this->projet;
159
                        $obsAAjouter['project'] = ($this->projectId == null) ? null : $this->projet;
159
                        if ($this->isFromPlantNet) {
160
                        if ($this->isFromPlantNet) {
160
                            $obsAAjouter['input_source'] = 'PlantNet';
161
                            $obsAAjouter['input_source'] = 'PlantNet';
Line 802... Line 803...
802
        return $ok;
803
        return $ok;
803
    }
804
    }
Line 804... Line 805...
804
 
805
 
805
    private function traiterEtRecupererIdImage($original_name, $id_obs) {
806
    private function traiterEtRecupererIdImage($original_name, $id_obs) {
-
 
807
        $original_name = Cel::db()->proteger($original_name);
806
        $original_name = Cel::db()->proteger($original_name);
808
        $id_obs = Cel::db()->proteger($id_obs);
807
 
809
        
808
        $requete = 'SELECT id '.
810
        $requete = 'SELECT id '.
809
            'FROM photo '.
811
            'FROM photo '.
810
            "WHERE occurrence_id = ".$idObs.
812
            "WHERE occurrence_id = ".$idObs.
811
            "	AND original_name = $original_name ";
813
            "	AND original_name = $original_name ";