Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 3514 Rev 3515
Line 12... Line 12...
12
 * @license    GPL v3 <http://www.gnu.org/licenses/gpl.txt>
12
 * @license    GPL v3 <http://www.gnu.org/licenses/gpl.txt>
13
 * @license    CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
13
 * @license    CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
14
 * @copyright  1999-2017 Tela Botanica <accueil@tela-botanica.org>
14
 * @copyright  1999-2017 Tela Botanica <accueil@tela-botanica.org>
15
 */
15
 */
16
class GestionWidget extends Cel {
16
class GestionWidget extends Cel {
-
 
17
    // le champ is_type / est_type est traité dans services/CelWidgetManager car traite les différentes valeurs anvoyés par l'interface
-
 
18
    private $champs_defaut_valeur = array("date_created" => "CURRENT_TIMESTAMP",
-
 
19
        "date_updated" => "CURRENT_TIMESTAMP",
-
 
20
        "taxo_restriction_type" => "referentiel",
-
 
21
        "taxo_restriction_value" => "bdtfx",
-
 
22
        "location_type" => "point");
-
 
23
    
Line 17... Line 24...
17
	
24
	
18
	/**
25
	/**
19
	 * Ajoute un paramètrage de widget de saisie
26
	 * Ajoute un paramètrage de widget de saisie
20
	 *
27
	 *
Line 53... Line 60...
53
		if ($resultat == array()) {
60
		if ($resultat == array()) {
54
		    $requete_id = "SELECT max(`id`) + 1 as idprojet FROM project_settings";
61
		    $requete_id = "SELECT max(`id`) + 1 as idprojet FROM project_settings";
55
		    $resultat = Cel::db()->requeter($requete_id);
62
		    $resultat = Cel::db()->requeter($requete_id);
56
		}
63
		}
57
		$project_id = $resultat[0]['idprojet']; 
64
		$project_id = $resultat[0]['idprojet']; 
-
 
65
		if (array_diff_key($this->champs_defaut_valeur, $parametres)) {
-
 
66
		    $parametres = array_merge($parametres, array_diff_key($this->champs_defaut_valeur, $parametres));
-
 
67
		}
58
	    $requete_insertion = 'INSERT INTO project_settings '.
68
	    $requete_insertion = 'INSERT INTO project_settings '.
59
	   	    '(project_id, '.implode(array_keys($parametres), ', ').') VALUES ("'.$project_id.'", "'.implode($parametres, '", "').'")';
69
	   	    '(project_id, '.implode(array_keys($parametres), ', ').') VALUES ("'.$project_id.'", "'.implode($parametres, '", "').'")';
60
		$resultat_ajout = Cel::db()->executer($requete_insertion);
70
		$resultat_ajout = Cel::db()->executer($requete_insertion);
61
		$retour = true;
71
		$retour = true;
62
		if ($resultat_ajout === false) {
72
		if ($resultat_ajout === false) {