/trunk/widget/modules/saisie2/Saisie2.php |
---|
28,6 → 28,7 |
const PROJET_DEFAUT = 'base'; |
const WS_NOM = 'noms'; |
const EFLORE_API_VERSION = '0.1'; |
const WS_UPLOAD = 'CelWidgetUploadImageTemp'; |
private $cel_url_tpl = null; |
/** Si spécifié, on ajoute une barre de navigation inter-applications */ |
private $bar; |
92,6 → 93,7 |
$retour['donnees']['bar'] = $this->bar; |
$retour['donnees']['url_base'] = sprintf($this->config['chemins']['baseURLAbsoluDyn'], ''); |
$retour['donnees']['url_ws_annuaire'] = sprintf($this->config['chemins']['baseURLServicesAnnuaireTpl'], 'utilisateur/identite-par-courriel/'); |
$retour['donnees']['url_ws_upload'] = $widget['donnees']['url_ws_upload'] = sprintf($this->config['chemins']['baseURLServicesCelTpl'], self::WS_UPLOAD); |
$retour['donnees']['authTpl'] = $this->config['manager']['authTpl'].'?projet='.$this->parametres['projet'].'&langue='.$this->parametres['langue']; |
$retour['donnees']['mode'] = $mode; |
$squelette = dirname(__FILE__).self::DS.'squelettes'.self::DS.$retour['squelette'].'.tpl.html'; |
107,8 → 109,6 |
private function executerSaisie() { |
$retour = array(); |
$retour['squelette'] = 'saisie'; |
$retour['donnees']['general'] = I18n::get('General'); |
$retour['donnees']['aide'] = I18n::get('Aide'); |
$retour['donnees']['observateur'] = I18n::get('Observateur'); |
$retour['donnees']['observation'] = I18n::get('Observation'); |
$retour['donnees']['image'] = I18n::get('Image'); |
121,16 → 121,19 |
/* Recherche si le projet existe sinon va chercher les infos de base */ |
private function rechercherProjet() { |
// projet avec un squelette défini (et non juste un mot-clé d'observation) |
$estProjetDefini = true; $tab = array(); |
$estProjetDefini = true; |
$tab = array(); |
$url = $this->config['manager']['celUrlTpl'].'?projet='.$this->parametres['projet'].'&langue='.$this->parametres['langue']; |
$json = $this->getDao()->consulter($url); |
$tableau = json_decode($json, true); |
if ($tableau== array()) { |
if ( $json ) { |
$tab = $this->rechercherChampsSupp(); |
} else { |
$url = $this->config['manager']['celUrlTpl'].'?projet=base&langue='.$this->parametres['langue']; |
$json = $this->getDao()->consulter($url); |
$estProjetDefini = false; |
} else { |
$tab = $this->rechercherChampsSupp(); |
} |
$tableau = json_decode($json, true); |
$tableau = $this->traiterParametres($estProjetDefini, $tableau[0]); |
$tableau['especes'] = $this->rechercherInfosEspeces($tableau); |
if ($tableau['milieux'] != "") { |
139,6 → 142,7 |
$tableau['milieux'] = array(); |
} |
$tableau['chpSupp'] = $tab; |
$tableau['chemin_fichiers'] = sprintf( $this->config['chemins']['baseURLAbsoluDyn'], $this->config['manager']['dossierTmp'] . $tableau["projet"] . '/' ); |
return $tableau; |
} |
145,24 → 149,145 |
/* Recherche si un projet a des champs de saisie supplémentaire */ |
private function rechercherChampsSupp() { |
$retour = array(); |
$url = $this->config['manager']['celChpSupTpl'].'?projet='.$this->parametres['projet'].'&langue='.$this->parametres['langue']; |
$projet = $this->parametres['projet']; |
$url = $this->config['manager']['celChpSupTpl'] .'?projet=' . $projet . '&langue=' . $this->parametres['langue']; |
$json = $this->getDao()->consulter($url); |
$retour = (array) json_decode($json, true); |
foreach ($retour['sauvagessupp']['champs-supp'] as $key => $chsup) { |
$patterns = array( '/\@apos\@/' , '/\@quot\@/' ); |
$replacements = array( ''' , '"' ); |
foreach ( $retour[$projet]['champs-supp'] as $key => $chsup ) { |
$retour[$projet]['champs-supp'][$key]['name'] = preg_replace( $patterns, $replacements, $chsup['name'] ); |
$retour[$projet]['champs-supp'][$key]['description'] = preg_replace( $patterns, $replacements, $chsup['description']); |
$retour[$projet]['champs-supp'][$key]['unit'] = preg_replace( $patterns, $replacements, $chsup['unit'] ); |
if (isset($chsup['fieldValues'])) { |
$retour['sauvagessupp']['champs-supp'][$key]['fieldValues'] = json_decode($chsup['fieldValues'], true); |
if (isset($retour['sauvagessupp']['champs-supp'][$key]['fieldValues']["listValue"])) { |
foreach($retour['sauvagessupp']['champs-supp'][$key]['fieldValues']["listValue"] as $list_value) { |
$retour[$projet]['champs-supp'][$key]['fieldValues'] = json_decode( $chsup['fieldValues'], true ); |
if ( isset($retour[$projet]['champs-supp'][$key]['fieldValues']['placeholder'] ) ) { |
$retour[$projet]['champs-supp'][$key]['fieldValues']['placeholder'] = preg_replace( $patterns, $replacements, $retour[$projet]['champs-supp'][$key]['fieldValues']['placeholder'] ); |
} |
if ( isset( $retour[$projet]['champs-supp'][$key]['fieldValues']['listValue'] ) ) { |
foreach( $retour[$projet]['champs-supp'][$key]['fieldValues']['listValue'] as $list_key => $list_value ) { |
$list_value = preg_replace( $patterns, $replacements, $list_value ); |
$retour[$projet]['champs-supp'][$key]['fieldValues']['listValue'][$list_key] = $list_value; |
// Obtenir une liste de valeurs utilisables dans les attributs for id ou name par exemple |
$retour['sauvagessupp']['champs-supp'][$key]['fieldValues']['cleanListValue'][] = 'val-' . preg_replace('/[^A-Za-z0-9_\-]/', '',$this->remove_accents($list_value)); |
$retour[$projet]['champs-supp'][$key]['fieldValues']['cleanListValue'][] = 'val-' . preg_replace('/[^A-Za-z0-9_\-]/', '', $this->remove_accents($list_value)); |
} |
} |
} |
$retour['sauvagessupp']['champs-supp'][$key]['mandatory'] = intval($chsup['mandatory']); |
$retour[$projet]['champs-supp'][$key]['mandatory'] = intval( $chsup['mandatory'] ); |
} |
return $retour; |
} |
private function remove_accents($string) { |
if ( !preg_match('/[\x80-\xff]/', $string) ) |
return $string; |
$chars = array( |
// Decompositions for Latin-1 Supplement |
chr(195).chr(128) => 'A', chr(195).chr(129) => 'A', |
chr(195).chr(130) => 'A', chr(195).chr(131) => 'A', |
chr(195).chr(132) => 'A', chr(195).chr(133) => 'A', |
chr(195).chr(135) => 'C', chr(195).chr(136) => 'E', |
chr(195).chr(137) => 'E', chr(195).chr(138) => 'E', |
chr(195).chr(139) => 'E', chr(195).chr(140) => 'I', |
chr(195).chr(141) => 'I', chr(195).chr(142) => 'I', |
chr(195).chr(143) => 'I', chr(195).chr(145) => 'N', |
chr(195).chr(146) => 'O', chr(195).chr(147) => 'O', |
chr(195).chr(148) => 'O', chr(195).chr(149) => 'O', |
chr(195).chr(150) => 'O', chr(195).chr(153) => 'U', |
chr(195).chr(154) => 'U', chr(195).chr(155) => 'U', |
chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y', |
chr(195).chr(159) => 's', chr(195).chr(160) => 'a', |
chr(195).chr(161) => 'a', chr(195).chr(162) => 'a', |
chr(195).chr(163) => 'a', chr(195).chr(164) => 'a', |
chr(195).chr(165) => 'a', chr(195).chr(167) => 'c', |
chr(195).chr(168) => 'e', chr(195).chr(169) => 'e', |
chr(195).chr(170) => 'e', chr(195).chr(171) => 'e', |
chr(195).chr(172) => 'i', chr(195).chr(173) => 'i', |
chr(195).chr(174) => 'i', chr(195).chr(175) => 'i', |
chr(195).chr(177) => 'n', chr(195).chr(178) => 'o', |
chr(195).chr(179) => 'o', chr(195).chr(180) => 'o', |
chr(195).chr(181) => 'o', chr(195).chr(182) => 'o', |
chr(195).chr(182) => 'o', chr(195).chr(185) => 'u', |
chr(195).chr(186) => 'u', chr(195).chr(187) => 'u', |
chr(195).chr(188) => 'u', chr(195).chr(189) => 'y', |
chr(195).chr(191) => 'y', |
// Decompositions for Latin Extended-A |
chr(196).chr(128) => 'A', chr(196).chr(129) => 'a', |
chr(196).chr(130) => 'A', chr(196).chr(131) => 'a', |
chr(196).chr(132) => 'A', chr(196).chr(133) => 'a', |
chr(196).chr(134) => 'C', chr(196).chr(135) => 'c', |
chr(196).chr(136) => 'C', chr(196).chr(137) => 'c', |
chr(196).chr(138) => 'C', chr(196).chr(139) => 'c', |
chr(196).chr(140) => 'C', chr(196).chr(141) => 'c', |
chr(196).chr(142) => 'D', chr(196).chr(143) => 'd', |
chr(196).chr(144) => 'D', chr(196).chr(145) => 'd', |
chr(196).chr(146) => 'E', chr(196).chr(147) => 'e', |
chr(196).chr(148) => 'E', chr(196).chr(149) => 'e', |
chr(196).chr(150) => 'E', chr(196).chr(151) => 'e', |
chr(196).chr(152) => 'E', chr(196).chr(153) => 'e', |
chr(196).chr(154) => 'E', chr(196).chr(155) => 'e', |
chr(196).chr(156) => 'G', chr(196).chr(157) => 'g', |
chr(196).chr(158) => 'G', chr(196).chr(159) => 'g', |
chr(196).chr(160) => 'G', chr(196).chr(161) => 'g', |
chr(196).chr(162) => 'G', chr(196).chr(163) => 'g', |
chr(196).chr(164) => 'H', chr(196).chr(165) => 'h', |
chr(196).chr(166) => 'H', chr(196).chr(167) => 'h', |
chr(196).chr(168) => 'I', chr(196).chr(169) => 'i', |
chr(196).chr(170) => 'I', chr(196).chr(171) => 'i', |
chr(196).chr(172) => 'I', chr(196).chr(173) => 'i', |
chr(196).chr(174) => 'I', chr(196).chr(175) => 'i', |
chr(196).chr(176) => 'I', chr(196).chr(177) => 'i', |
chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij', |
chr(196).chr(180) => 'J', chr(196).chr(181) => 'j', |
chr(196).chr(182) => 'K', chr(196).chr(183) => 'k', |
chr(196).chr(184) => 'k', chr(196).chr(185) => 'L', |
chr(196).chr(186) => 'l', chr(196).chr(187) => 'L', |
chr(196).chr(188) => 'l', chr(196).chr(189) => 'L', |
chr(196).chr(190) => 'l', chr(196).chr(191) => 'L', |
chr(197).chr(128) => 'l', chr(197).chr(129) => 'L', |
chr(197).chr(130) => 'l', chr(197).chr(131) => 'N', |
chr(197).chr(132) => 'n', chr(197).chr(133) => 'N', |
chr(197).chr(134) => 'n', chr(197).chr(135) => 'N', |
chr(197).chr(136) => 'n', chr(197).chr(137) => 'N', |
chr(197).chr(138) => 'n', chr(197).chr(139) => 'N', |
chr(197).chr(140) => 'O', chr(197).chr(141) => 'o', |
chr(197).chr(142) => 'O', chr(197).chr(143) => 'o', |
chr(197).chr(144) => 'O', chr(197).chr(145) => 'o', |
chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe', |
chr(197).chr(148) => 'R',chr(197).chr(149) => 'r', |
chr(197).chr(150) => 'R',chr(197).chr(151) => 'r', |
chr(197).chr(152) => 'R',chr(197).chr(153) => 'r', |
chr(197).chr(154) => 'S',chr(197).chr(155) => 's', |
chr(197).chr(156) => 'S',chr(197).chr(157) => 's', |
chr(197).chr(158) => 'S',chr(197).chr(159) => 's', |
chr(197).chr(160) => 'S', chr(197).chr(161) => 's', |
chr(197).chr(162) => 'T', chr(197).chr(163) => 't', |
chr(197).chr(164) => 'T', chr(197).chr(165) => 't', |
chr(197).chr(166) => 'T', chr(197).chr(167) => 't', |
chr(197).chr(168) => 'U', chr(197).chr(169) => 'u', |
chr(197).chr(170) => 'U', chr(197).chr(171) => 'u', |
chr(197).chr(172) => 'U', chr(197).chr(173) => 'u', |
chr(197).chr(174) => 'U', chr(197).chr(175) => 'u', |
chr(197).chr(176) => 'U', chr(197).chr(177) => 'u', |
chr(197).chr(178) => 'U', chr(197).chr(179) => 'u', |
chr(197).chr(180) => 'W', chr(197).chr(181) => 'w', |
chr(197).chr(182) => 'Y', chr(197).chr(183) => 'y', |
chr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z', |
chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z', |
chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z', |
chr(197).chr(190) => 'z', chr(197).chr(191) => 's' |
); |
$string = strtr($string, $chars); |
return $string; |
} |
// remplace certains parametres définis en bd par les parametres définis dans l'url |
private function traiterParametres($estProjetDefini, $tableau) { |
$criteres = array('tag', 'motcle', 'projet', 'titre', 'logo'); |
179,7 → 304,8 |
private function rechercherInfosEspeces($infos_projets) { //print_r($infos_projets);exit; |
$retour = ""; $referentiel = $infos_projets['referentiel']; |
$retour = array(); |
$referentiel = $infos_projets['referentiel']; |
$urlWsNsTpl = $this->config['chemins']['baseURLServicesEfloreTpl']; |
$urlWsNs = sprintf($urlWsNsTpl, self::EFLORE_API_VERSION, $referentiel, self::WS_NOM); |
$urlWsNsSansRef = sprintf($urlWsNsTpl, self::EFLORE_API_VERSION, '{referentiel}', self::WS_NOM); |
188,12 → 314,15 |
$retour['ns_referentiel'] = $referentiel; |
if (isset($infos_projets['type_especes'])) { |
switch ($infos_projets['type_especes']) { |
case "referentiel" : $referentiel = $infos_projets['referentiel']; break; |
case "liste" : $referentiel = $infos_projets['referentiel']; break; |
case "fixe" : |
$retour['especes'] = $this->chargerInfosTaxon($infos_projets['referentiel'], $infos_projets['especes']); |
break; |
case "referentiel" : |
case "liste" : |
$referentiel = $infos_projets['referentiel']; |
break; |
} |
} else if (isset($infos_projets['referentiel'])) { |
$referentiel = $infos_projets['referentiel']; |
244,8 → 373,20 |
return $retour; |
} |
protected function getReferentielImpose() { |
$referentiel_impose = true; |
if (!empty($_GET['referentiel']) && $_GET['referentiel'] != "autre") { |
$this->ns_referentiel = $_GET['referentiel']; |
} else if (isset($this->configProjet['referentiel'])) { |
$this->ns_referentiel = $this->configProjet['referentiel']; |
} else if (isset($this->configMission['referentiel'])) { |
$this->ns_referentiel = $this->configMission['referentiel']; |
} else { |
$referentiel_impose = false; |
} |
return $referentiel_impose; |
} |
/** |
* Trie par nom français les taxons lus dans le fichier tsv |
*/ |
376,109 → 517,5 |
return $tableauJs; |
} |
private function remove_accents($string) { |
if ( !preg_match('/[\x80-\xff]/', $string) ) return $string; |
$chars = array( |
// Decompositions for Latin-1 Supplement |
chr(195).chr(128) => 'A', chr(195).chr(129) => 'A', |
chr(195).chr(130) => 'A', chr(195).chr(131) => 'A', |
chr(195).chr(132) => 'A', chr(195).chr(133) => 'A', |
chr(195).chr(135) => 'C', chr(195).chr(136) => 'E', |
chr(195).chr(137) => 'E', chr(195).chr(138) => 'E', |
chr(195).chr(139) => 'E', chr(195).chr(140) => 'I', |
chr(195).chr(141) => 'I', chr(195).chr(142) => 'I', |
chr(195).chr(143) => 'I', chr(195).chr(145) => 'N', |
chr(195).chr(146) => 'O', chr(195).chr(147) => 'O', |
chr(195).chr(148) => 'O', chr(195).chr(149) => 'O', |
chr(195).chr(150) => 'O', chr(195).chr(153) => 'U', |
chr(195).chr(154) => 'U', chr(195).chr(155) => 'U', |
chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y', |
chr(195).chr(159) => 's', chr(195).chr(160) => 'a', |
chr(195).chr(161) => 'a', chr(195).chr(162) => 'a', |
chr(195).chr(163) => 'a', chr(195).chr(164) => 'a', |
chr(195).chr(165) => 'a', chr(195).chr(167) => 'c', |
chr(195).chr(168) => 'e', chr(195).chr(169) => 'e', |
chr(195).chr(170) => 'e', chr(195).chr(171) => 'e', |
chr(195).chr(172) => 'i', chr(195).chr(173) => 'i', |
chr(195).chr(174) => 'i', chr(195).chr(175) => 'i', |
chr(195).chr(177) => 'n', chr(195).chr(178) => 'o', |
chr(195).chr(179) => 'o', chr(195).chr(180) => 'o', |
chr(195).chr(181) => 'o', chr(195).chr(182) => 'o', |
chr(195).chr(182) => 'o', chr(195).chr(185) => 'u', |
chr(195).chr(186) => 'u', chr(195).chr(187) => 'u', |
chr(195).chr(188) => 'u', chr(195).chr(189) => 'y', |
chr(195).chr(191) => 'y', |
// Decompositions for Latin Extended-A |
chr(196).chr(128) => 'A', chr(196).chr(129) => 'a', |
chr(196).chr(130) => 'A', chr(196).chr(131) => 'a', |
chr(196).chr(132) => 'A', chr(196).chr(133) => 'a', |
chr(196).chr(134) => 'C', chr(196).chr(135) => 'c', |
chr(196).chr(136) => 'C', chr(196).chr(137) => 'c', |
chr(196).chr(138) => 'C', chr(196).chr(139) => 'c', |
chr(196).chr(140) => 'C', chr(196).chr(141) => 'c', |
chr(196).chr(142) => 'D', chr(196).chr(143) => 'd', |
chr(196).chr(144) => 'D', chr(196).chr(145) => 'd', |
chr(196).chr(146) => 'E', chr(196).chr(147) => 'e', |
chr(196).chr(148) => 'E', chr(196).chr(149) => 'e', |
chr(196).chr(150) => 'E', chr(196).chr(151) => 'e', |
chr(196).chr(152) => 'E', chr(196).chr(153) => 'e', |
chr(196).chr(154) => 'E', chr(196).chr(155) => 'e', |
chr(196).chr(156) => 'G', chr(196).chr(157) => 'g', |
chr(196).chr(158) => 'G', chr(196).chr(159) => 'g', |
chr(196).chr(160) => 'G', chr(196).chr(161) => 'g', |
chr(196).chr(162) => 'G', chr(196).chr(163) => 'g', |
chr(196).chr(164) => 'H', chr(196).chr(165) => 'h', |
chr(196).chr(166) => 'H', chr(196).chr(167) => 'h', |
chr(196).chr(168) => 'I', chr(196).chr(169) => 'i', |
chr(196).chr(170) => 'I', chr(196).chr(171) => 'i', |
chr(196).chr(172) => 'I', chr(196).chr(173) => 'i', |
chr(196).chr(174) => 'I', chr(196).chr(175) => 'i', |
chr(196).chr(176) => 'I', chr(196).chr(177) => 'i', |
chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij', |
chr(196).chr(180) => 'J', chr(196).chr(181) => 'j', |
chr(196).chr(182) => 'K', chr(196).chr(183) => 'k', |
chr(196).chr(184) => 'k', chr(196).chr(185) => 'L', |
chr(196).chr(186) => 'l', chr(196).chr(187) => 'L', |
chr(196).chr(188) => 'l', chr(196).chr(189) => 'L', |
chr(196).chr(190) => 'l', chr(196).chr(191) => 'L', |
chr(197).chr(128) => 'l', chr(197).chr(129) => 'L', |
chr(197).chr(130) => 'l', chr(197).chr(131) => 'N', |
chr(197).chr(132) => 'n', chr(197).chr(133) => 'N', |
chr(197).chr(134) => 'n', chr(197).chr(135) => 'N', |
chr(197).chr(136) => 'n', chr(197).chr(137) => 'N', |
chr(197).chr(138) => 'n', chr(197).chr(139) => 'N', |
chr(197).chr(140) => 'O', chr(197).chr(141) => 'o', |
chr(197).chr(142) => 'O', chr(197).chr(143) => 'o', |
chr(197).chr(144) => 'O', chr(197).chr(145) => 'o', |
chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe', |
chr(197).chr(148) => 'R',chr(197).chr(149) => 'r', |
chr(197).chr(150) => 'R',chr(197).chr(151) => 'r', |
chr(197).chr(152) => 'R',chr(197).chr(153) => 'r', |
chr(197).chr(154) => 'S',chr(197).chr(155) => 's', |
chr(197).chr(156) => 'S',chr(197).chr(157) => 's', |
chr(197).chr(158) => 'S',chr(197).chr(159) => 's', |
chr(197).chr(160) => 'S', chr(197).chr(161) => 's', |
chr(197).chr(162) => 'T', chr(197).chr(163) => 't', |
chr(197).chr(164) => 'T', chr(197).chr(165) => 't', |
chr(197).chr(166) => 'T', chr(197).chr(167) => 't', |
chr(197).chr(168) => 'U', chr(197).chr(169) => 'u', |
chr(197).chr(170) => 'U', chr(197).chr(171) => 'u', |
chr(197).chr(172) => 'U', chr(197).chr(173) => 'u', |
chr(197).chr(174) => 'U', chr(197).chr(175) => 'u', |
chr(197).chr(176) => 'U', chr(197).chr(177) => 'u', |
chr(197).chr(178) => 'U', chr(197).chr(179) => 'u', |
chr(197).chr(180) => 'W', chr(197).chr(181) => 'w', |
chr(197).chr(182) => 'Y', chr(197).chr(183) => 'y', |
chr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z', |
chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z', |
chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z', |
chr(197).chr(190) => 'z', chr(197).chr(191) => 's' |
); |
$string = strtr($string, $chars); |
return $string; |
} |
} |
?> |
?> |
/trunk/widget/modules/saisie2/config.defaut.ini |
---|
6,4 → 6,4 |
celChpSupTpl = "http://localhost/service:cel:CelWidgetManager/ChampsEtendus" |
languesUrl = "http://api-test.tela-botanica.org/service:eflore:0.1/iso-639-1/langues" |
authTpl = "https://beta.tela-botanica.org/widget:reseau:auth?origine=http://localhost/cel/widget/saisie2" |
dossierTmp = "https://beta.tela-botanica.org/tmp/widget_saisie/" |
dossierTmp = "modules/manager/squelettes/img/images_projets/" |
/trunk/widget/modules/saisie2/squelettes/js/champs-supp.js |
---|
5,6 → 5,14 |
* des éléments "spéciaux" * |
*************************************/ |
// Volet de profil/déconnexion |
function connexionDprodownMenu() { |
$( '#utilisateur-connecte .volet-toggle, #profil-utilisateur a, #deconnexion a' ).click( function( event ) { |
event.preventDefault(); |
$( '#utilisateur-connecte .volet-menu' ).toggleClass( 'hidden' ); |
}); |
} |
// Logique d'affichage pour le input type=file |
function inputFile() { |
// Initialisation des variables |
16,62 → 24,6 |
$( '#' + $( this ).attr( 'for' ) + '.input-file' ).click(); |
} |
}); |
// // Affiche un retour visuel dès que input:file change |
// $('#form-supp').on( 'change', '.input-file', function( event ) { |
// // Il est possible de supprimer un fichier |
// // donc on vérifie que le 'change' est un ajout ou modification |
// if( !$.isEmptyObject( event.target.files[0] ) ) { |
// var file = event.target.files[0], |
// fileId = $( this ).attr( 'id' ), |
// $thisFile = $( this ).parent('.label-file.' + fileId ), |
// $imageContainer = $( '#miniatures' ), |
// $theReturn = $( '.' + fileId + 'Img') || false, |
// fileImgHtml = ''; |
// if( file.type.match( 'image' ) ) { |
// fileImgHtml = |
// '<div class="' + fileId + 'Img mb-1">'+ |
// '<p> ' + file.name + '</p>'+ |
// '<img src="' + URL.createObjectURL( file ) + '">'+ |
// '</div>'; |
// } |
// // Permettre d'enregistrer une nouvelle image |
// if( 0 < $theReturn.length ) { |
// // Changement du fichier |
// $theReturn.html( fileImgHtml ); |
// } else { |
// $imageContainer.append( fileImgHtml ); |
// $imageContainer.append( $thisFile ); |
// $( '#photos-conteneur' ).html( |
// '<label for="fichier' + countFiles + '" class="label-file btn btn-default fichier' + countFiles + '">'+ |
// '<i class="fas fa-download"></i> Ajouter une image'+ |
// '<input type="file" id="fichier' + countFiles + '" name="fichier' + countFiles + '" class="input-file" accept="image/jpeg">'+ |
// '<input type="hidden" name="MAX_FILE_SIZE" value="5242880">'+ |
// '</label>'+ |
// '<hr>' |
// ); |
// countFiles++; |
// } |
// // Changer le text |
// $thisFile.find( '.label-text').html( '<i class="fas fa-exchange-alt"></i> Changer cette image'); |
// $thisFile.css( 'background-color', '#ea9973' ); |
// $thisFile.hover( function() { |
// $( this ).css( 'background-color', 'rgba(234, 153, 115, 0.7)' ); |
// }); |
// $( '.' + fileId + 'Img img').attr( 'width', $thisFile.outerWidth() ); |
// } |
// }); |
// // Annuler le téléchargement |
// $( '.remove-file' ).click( function() { |
// var $thisFileInput = $( this ).prev( '.input-file-container' ).find( '.input-file' ); |
// $thisFileInput.wrap( '<form>' ).closest( 'form' ).get(0).reset(); |
// $thisFileInput.triggerHandler( 'change' ); |
// $thisFileInput.unwrap(); |
// $( this ).next( '.file-return' ).addClass( 'hidden' ).empty(); |
// }); |
} |
// Style et affichage des list-checkboxes |
104,21 → 56,21 |
// Style et affichage des input type="range" |
function inputRangeDisplayNumber() { |
$( '#zone-appli' ).on( 'input' , '.range input[type="range"]' , function () { |
$( this ).next( 'input[type="number"]' ).val ( $( this ).val() ); |
$( 'input[type="range"]' ).each( function() { |
$( this ).siblings( '.range-live-value' ).text( $( this ).val() ); |
}); |
$( '#zone-appli' ).on( 'input' , '.range input[type="number"]' , function () { |
$( this ).prev( 'input[type="range"]' ).val ( $( this ).val() ); |
$( '#zone-supp' ).on( 'input' , 'input[type="range"]' , function () { |
console.log( 'nello' ); |
$( this ).siblings( '.range-live-value' ).text( $( this ).val() ); |
}); |
} |
// Activation/Desactivation et contenu de la modale Bootstrap |
// https://getbootstrap.com/docs/3.3/javascript/#modals |
function previewFieldHelpModal() { |
function newFieldsHelpModal() { |
$( '#zone-appli' ).on( 'click' , '.help-button' , function ( event ) { |
var thisFieldKey = $( this ).data( 'key' ), |
// filePath ci dessous est un test, obtenir une vraie url une fois les fichiers d'aide accessibles |
filePath = 'https://beta.tela-botanica.org/tmp/eflore_v5_cache/pdf/Fabaceae-3497041375.pdf', |
fileMimeType = $( this ).data( 'mime-type' ); |
// Titre |
125,9 → 77,9 |
$( '#help-modal-label' ).text( 'Aide pour : ' + $( this ).data( 'name' ) ); |
if( fileMimeType.match( 'image' ) ) { |
$( '#print_content' ).append( '<img src="' + filePath + '" style="max-width:100%">' ); |
} else if( fileMimeType.match( 'pdf' ) ) { |
$( '#print_content' ).append( '<iframe src="' + filePath + '" width="100%" height="650" align="middle" scrolling="no" frameborder="0"></iframe>' ); |
var extention = fileMimeType.replace( /(?:imag)?e\/?/g , '' ); |
// var extention = 'jpg'; |
$( '#print_content' ).append( '<img src="' + CHEMIN_FICHIERS + thisFieldKey + '.' + extention + '" style="max-width:100%" alt="' + thisFieldKey + '" />' ); |
} |
// Sortie avec la touche escape |
150,6 → 102,44 |
}); |
} |
// Activation/Desactivation et contenu de la modale Bootstrap |
// https://getbootstrap.com/docs/3.3/javascript/#modals |
function projetHelpModale() { |
$( '#info-button' ).click( function ( event ) { |
var fileMimeType = $( this ).data( 'mime-info' ); |
// Titre |
$( '#help-modal-label' ).text( 'Aide du projet : ' + $( '#titre-projet' ).text() ); |
if( fileMimeType.match( 'image' ) ) { |
var extention = fileMimeType.replace( /(?:imag)?e\/?/g , '' ); |
$( '#print_content' ).append( '<img src="' + CHEMIN_FICHIERS + 'info.' + extention + '" style="max-width:100%" alt="info projet" />' ); |
} |
// Sortie avec la touche escape |
$( '#help-modal' ).modal( { keyboard : true } ); |
// Affichage |
$( '#help-modal' ).modal({ show: true }); |
// Remplacer l'autofocus qui ne fonctionne plus en HTML5 |
// Message dans la doc de bootstrap : |
// Due to how HTML5 defines its semantics, |
// the autofocus HTML attribute has no effect in Bootstrap modals. |
// To achieve the same effect, use some custom JavaScript |
$( '#help-modal' ).on( 'shown.bs.modal' , function () { |
$( '#myInput' ).trigger( 'focus' ); |
}) |
// Réinitialisation |
$( '#help-modal' ).on( 'hidden.bs.modal' , function () { |
$( '#help-modal-label' ).text(); |
$( '#print_content' ).empty(); |
}); |
}); |
} |
// Faire apparaitre un champ text "Autre" |
function onOtherOption() { |
253,18 → 243,28 |
/*************************** |
* Lancement des scripts * |
***************************/ |
const CHEMIN_FICHIERS = $( '#zone-appli' ).data('url-fichiers'); |
jQuery( document ).ready( function() { |
// Affichage des images ou nom des documents importés |
// Volet de profil/déconnexion |
connexionDprodownMenu(); |
// Modale "aide" du projet |
projetHelpModale(); |
// Affichage input file |
inputFile(); |
// Affichage des List-checkbox |
inputListCheckbox(); |
// // Affichage des Range |
// inputRangeDisplayNumber() |
// Affichage des Range |
inputRangeDisplayNumber() |
// Modale "aide" |
previewFieldHelpModal(); |
newFieldsHelpModal(); |
// Ajout/suppression d'un champ texte "Autre" |
onOtherOption(); |
// Récupérer les données entrées dans "Autre" |
collectOtherOption(); |
}); |
/trunk/widget/modules/saisie2/squelettes/js/WidgetSaisie.js |
---|
114,7 → 114,7 |
dataType: 'xml', // 'xml', 'script', or 'json' (expected server response type) |
resetForm: true // reset the form after successful submit |
}; |
$( '#miniature' ).append( '<img id="miniature-chargement" class="miniature" alt="chargement" src="' + this.chargementImageIconeUrl + '">' ); |
$( '#miniature' ).append( '<img id="miniature-chargement" class="miniature" alt="chargement" src="' + this.chargementImageIconeUrl + '"/>' ); |
$( '#ajouter-obs' ).attr( 'disabled', 'disabled' ); |
if( lthis.verifierFormat( $( '#fichier' ).val() ) ) { |
$( '#form-upload' ).ajaxSubmit( options ); |
201,7 → 201,7 |
var imgNom = $( 'image-nom', reponse ).text(); |
var html = |
'<div class="miniature mb-3 mr-3">'+ |
'<img class="miniature-img" class="miniature img-rounded" alt="' + imgNom + '" src="' + miniatureUrl + '">'+ |
'<img class="miniature-img" class="miniature img-rounded" alt="' + imgNom + '" src="' + miniatureUrl + '"/>'+ |
'<a class="effacer-miniature"><i class="far fa-trash-alt"></i></a>'+ |
'</div>' |
return html; |
495,8 → 495,8 |
WidgetSaisie.prototype.surChangementReferentiel = function() { |
this.nomSciReferentiel = $( '#referentiel' ).val(); |
$( '#taxon' ).val( '' ); |
//this.initialiserAutocompleteCommune(); |
//this.initialiserGoogleMap( false ); |
this.initialiserAutocompleteCommune(); |
this.initialiserGoogleMap( false ); |
}; |
WidgetSaisie.prototype.surChangementNbreObs = function() { |
/trunk/widget/modules/saisie2/squelettes/js/auth.js |
---|
24,8 → 24,8 |
urlWidgetNavigation : urlRacine + '/widget:cel:saisie2', |
urlBaseAuth : 'https://api.tela-botanica.test/service:annuaire:auth' |
} |
}; |
*/ |
};*/ |
/** |
* Charge la barre de navigation depuis le widget:reseau:navigation dans un <div id="tb-navigation"> , s'il existe |
* dans la page appelante. |
/trunk/widget/modules/saisie2/squelettes/saisie.tpl.html |
---|
27,19 → 27,19 |
<meta property="og:image:height" content="256" /> |
<meta property="og:locale" content="fr_FR" /> |
<!-- Favicones --> |
<!-- Favicone --> |
<link rel="shortcut icon" type="image/x-icon" href="https://resources.tela-botanica.org/tb/img/16x16/favicon.ico" /> |
<!-- CSS --> |
<!-- Jquery-ui custom css--> |
<link href="https://www.tela-botanica.org/commun/jquery/jquery-ui/1.8.18/css/smoothness/jquery-ui-1.8.18.custom.css" rel="stylesheet" type="text/css" media="screen" /> |
<!-- Bootstrap CSS --> |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous" /> |
<link rel="stylesheet" type="text/css" href="<?= $url_base; ?>modules/saisie2/squelettes/css/bootstrap-4/css/bootstrap.min.css" /> |
<!-- Fontawesome --> |
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.1/css/all.css" integrity="sha384-O8whS3fhG2OnA5Kas0Y9l3cfpmYjapjI0E4theH4iuMD+pLhbf6JI0jIMfYcK3yZ" crossorigin="anonymous" /> |
<!-- Carto --> |
<link href="<?= $url_base; ?>modules/saisie2/squelettes/js/tb-geoloc/styles.css" rel="stylesheet" type="text/css" media="screen" /> |
<!-- STYLE SAISIE --> |
<link href="<?= $url_base; ?>modules/saisie2/squelettes/css/saisie.css" rel="stylesheet" type="text/css" media="screen" /> |
<!-- carto --> |
<link href="<?= $url_base; ?>modules/saisie2/squelettes/js/tb-geoloc/styles.css" rel="stylesheet" type="text/css" media="screen" /> |
<!-- Google Analytics --> |
<?php if( $prod ): ?> |
<?php include "analytics.html"; ?> |
49,13 → 49,16 |
</head> |
<body> |
<?php |
echo ( $widget['image_fond'] ) ? '<div id="image-fond" style="' . htmlspecialchars( 'background:url("' . $widget['chemin_fichiers'] . 'image_fond.' . preg_replace( '/(?:imag)?e\/?/','',$widget['image_fond']) . '") no-repeat center center') . '"></div>': ''; |
?> |
<!-- <?php //var_dump($widget['especes']['url_ws_autocompletion_ns']); ?> --> |
<div id="zone-appli" class="container"> |
<div id="zone-appli" class="container" data-projet="<?= $widget['projet']; ?>" data-url-fichiers="<?= $widget['chemin_fichiers']; ?>"> |
<div class="layout-wrapper page"> |
<div class="media"> |
<img class="d-flex mr-3" src="<?= $widget['logo']; ?>" alt="logo<?= $widget['projet']; ?>" /> |
<img class="d-flex mr-3" src="<?php echo htmlspecialchars( $widget['chemin_fichiers'] . 'logo.' . preg_replace( '/(?:imag)?e\/?/','', $widget['logo'] ) ); ?>" alt="logo <?= $widget['projet']; ?>" /> |
<div class="media-body"> |
<h1 class="mt-0"><?= $widget['titre']; ?></h1> |
<h1 id="titre-projet" class="mt-0"><?php echo ( $widget['info'] ) ? $widget['titre'] . ' <div id="info-button" class="btn btn-outline-info btn-sm border-0" data-mime-info="' . $widget['info'] . '"><i class="fas fa-info-circle"></i></div>' : $widget['titre']; ?></h1> |
</div> |
</div> |
88,22 → 91,24 |
<!-- <div id="tb-navigation" data-courant="widget-cel-saisie2" data-squelette="navigation" data-mode="local"> --> |
<div class="navbar-default mb-3" id="tb-navbar"> |
<div class="nav navbar-nav navbar-right row"> |
<div id="bouton-connexion" class="dropdown col-md-6 col-sm-8"> |
<div id="bouton-connexion" class="volet col-md-6 col-sm-8"> |
<label for="bouton-connexion"><?= $observateur['compte']; ?></label> |
<a id="connexion" href="<?= $authTpl; ?>" class="btn btn-success mr-1 mb-1" taget="_blank"><?= $observateur['connexion']; ?></a> |
<a id="bouton-inscription" href="https://beta.tela-botanica.org/test/inscription" class="btn btn-primary mr-1 mb-1" taget="_blank"><?= $observateur['inscription']; ?></a> |
</div> |
<div id="creation-compte" class="dropdown col-md-6 col-sm-8"> |
<div id="creation-compte" class="volet col-md-6 col-sm-8"> |
<label for="creation-compte"><?= $observateur['noninscription']; ?></label> |
<a id="bouton-anonyme" href="#" class="btn btn-info mr-1 mb-1"><?= $observateur['nonconnexion']; ?></a> |
</div> |
<div id="utilisateur-connecte" class="dropdown hidden"> |
<div id="utilisateur-connecte" class="volet hidden"> |
<label for="utilisateur-connecte"><?= $observateur['bienvenue']; ?></label> |
<a href="#" class="list-tool btn btn-largee btn-primary dropdown-toggle" data-toggle="dropdown"> |
<span id="nom-complet"></span> |
<a href="#" class="list-tool btn btn-large btn-primary volet-toggle" data-toggle="volet"> |
<span id="nom-complet"></span> <!-- <i class="fas fa-caret-down"></i> --> |
</a> |
<div class="dropdown-menu"> |
<div id="profil-utilisateur"><a href="https://beta.tela-botanica.org/test/inscription" taget="_blank"><?= $observateur['profil']; ?></a></div> |
<div class="volet-menu hidden"> |
<div id="profil-utilisateur"> |
<a href="https://beta.tela-botanica.org/test/inscription" taget="_blank"><?= $observateur['profil']; ?></a> |
</div> |
<div id="deconnexion"><a href="#"><?= $observateur['deconnexion']; ?></a></div> |
</div> |
</div> |
178,6 → 183,7 |
<h2><?= $observation['titre']; ?></h2> |
<div id="zone-observation" class="row"> |
<div class="col-md-6"> |
<div class="control-group"> |
<label for="geolocalisation" class="col-sm-8 obligatoire" title="<?= $observateur['courriel-title']; ?>"> |
<i class="fa fa-street-view" aria-hidden="true"></i> |
188,6 → 194,7 |
<tb-geolocation-element id="tb-geolocation"></tb-geolocation-element> |
</div> |
</div> |
<div class="control-group"> |
<label for="milieu" class="col-sm-8"> |
<i class="fa fa-street-view" aria-hidden="true"></i> |
205,9 → 212,11 |
<?php endif; ?> |
</div> |
</div> |
</div> |
<div class="col-md-6"> |
<div class="control-group"> |
<label for="date_releve" class="col-sm-8 obligatoire" title=""> |
<i class="fa fa-calendar" aria-hidden="true"></i> |
218,7 → 227,7 |
</div> |
</div> |
<?php if(($widget['type_especes'] === 'referentiel' || $widget['type_especes'] == '') && $widget['referentiel'] == '' ) : ?> |
<?php if( ( $widget['type_especes'] === 'referentiel' || $widget['type_especes'] === '' ) && $widget['referentiel'] === '' ) : ?> |
<div class="control-group"> |
<label for="referentiel" class="col-sm-8 obligatoire" title=""> |
<i class="fa fa-book" aria-hidden="true"></i> |
266,7 → 275,6 |
</select> |
</div> |
</div> |
<div class="control-group"> |
<label for="notes" class="col-sm-8" title=""> |
<i class="fa fa-pen" aria-hidden="true"></i> |
273,9 → 281,7 |
<?= $observation['notes']; ?> |
</label> |
<div class="col-sm-8 mb-3"> |
<textarea id="notes" form="form-obs" class="form-control col-md-12" rows="7" name="notes" |
placeholder="<?= $observation['notes_ph']; ?>"></textarea> |
<textarea id="notes" form="form-obs" class="form-control col-md-12" rows="7" name="notes" placeholder="<?= $observation['notes_ph']; ?>"></textarea> |
</div> |
</div> |
283,33 → 289,14 |
</div> |
</form> |
<form id="form-upload" class="form-horizontal bloc-top" action="<?= $url_ws_upload ?>" method="post" enctype="multipart/form-data"> |
<h2><?= $image['titre']; ?></h2> |
<p class="miniature-info" class="discretion help-inline"> |
<?= $image['aide']; ?> |
</p> |
<div id ="photos-conteneur" class="control-group"> |
<div> |
<label for="fichier" class="label-file btn btn-large btn-info mb-3"> |
<span class="label-text"><i class="fas fa-download"></i> <?= $image['ajouter']; ?></span> |
<input type="file" id="fichier" name="fichier" class="input-file" accept="image/jpeg" multiple> |
<input type="hidden" name="MAX_FILE_SIZE" value="5242880"> |
</label> |
</div> |
<div id="miniatures"></div> |
<p class="miniature-msg" class="span12"> </p> |
</div> |
</form> |
<!-- Champs supplémentaires --> |
<?php if ( isset($widget['chpSupp'] ) && 0 < count( (array) $widget['chpSupp'] ) ) : ?> |
<form id="form-supp" role="form" autocomplete="on"> |
<form id="form-supp" class="bloc-top" role="form" autocomplete="on"> |
<h2><?= $chpsupp['titre']; ?></h2> |
<div id="zone-supp" class="row"> |
<div class="col-md-6"> |
<?php foreach( $widget['chpSupp']['sauvagessupp']['champs-supp'] as $champ ) :?> |
<?php foreach( $widget['chpSupp'][ $widget['projet'] ]['champs-supp'] as $champ ) : ?> |
<?php |
$min = ( $champ['fieldValues']['min'] )? ' min="' . $champ['fieldValues']['min'] . '"':''; |
$max = ( $champ['fieldValues']['max'] )? ' max="' . $champ['fieldValues']['max'] . '"':''; |
325,12 → 312,9 |
$help = ''; |
$help_button = ''; |
if( /*true*/$champ['help'] ) { |
if( $champ['help'] ) { |
$help = ' and-help'; |
// TODO récupérer un $champ['help_mime_type'] |
// $champ['help_mime_type'] = 'application/pdf'; |
$champ['help_mime_type'] = 'image.*'; |
$help_button = ' <div class="help-button help-' . $champ['key'] . ' btn btn-outline-info btn-sm border-0" data-key="' . $champ['key'] . '" data-name="' . $champ['name'] . '" data-mime-type="' . $champ['help_mime_type'] . '"><i class="fas fa-info-circle"></i></div>'; |
$help_button = ' <div class="help-button help-' . $champ['key'] . ' btn btn-outline-info btn-sm border-0" data-key="' . $champ['key'] . '" data-name="' . $champ['name'] . '" data-mime-type="' . $champ['help'] . '"><i class="fas fa-info-circle"></i></div>'; |
} |
if( $champ['mandatory'] ) { |
453,20 → 437,6 |
</div> |
<?php break; |
case 'file' : ?> |
<div class="control-group col-sm-8 mb-3"> |
<div class="input-file-container<?= $help; ?>"> |
<input type="<?= $champ['element']; ?>" name="<?= $champ['key']; ?>" class="<?php echo $champ['key'] . ' input-file'; ?> form-control" <?php echo $description . $placeholder . $required; ?> accept="application/pdf, image/*, video/*" data-label="<?= $champ['name']; ?>"> |
<label for="<?= $champ['key']; ?>" class="label-file<?= $mandatory; ?>" <?= $description; ?>><i class="fas fa-download" aria-hidden="true"></i> <?= $champ['name']; ?></label> |
<?php if ( !$champ['mandatory'] ) : ?> |
<div class="remove-file button" name="remove-file" title="Supprimer le fichier"><i class="fas fa-times" aria-hidden="true"></i></div> |
<?php endif; ?> |
</div> |
</div> |
<?php break; |
case 'textarea': ?> |
<div class="control-group"> |
<label for="<?= $champ['key']; ?>" class="col-sm-8<?php echo $help . $mandatory; ?>" <?= $description; ?>><?= $champ['name'] . $help_button; ?></label> |
479,8 → 449,39 |
case 'range': ?> |
<div class="control-group"> |
<label for="<?= $champ['key']; ?>" class="col-sm-8<?= $help . $mandatory; ?>" <?= $description; ?>><?= $champ['name'] . $help_button; ?></label> |
<div class="col-sm-8 mb-3"> |
<input type="<?= $champ['element']; ?>" name="<?= $champ['key']; ?>" class="<?= $champ['key'] . $help; ?> form-control" <?php echo $description . $placeholder . $step . $default . $min . $max . $required; ?> data-label="<?= $champ['name']; ?>"> |
<div class="col-sm-8 mb-3 <?php echo ($champ['fieldValues']['min'] || $champ['fieldValues']['max']) ? 'row' : '';?>"> |
<?php |
if ( $champ['fieldValues']['min'] || $champ['fieldValues']['max'] ) { |
$div_range_min_max = ''; |
if ( $champ['fieldValues']['min'] ) { |
$div_range_min_max = |
"<p class=\"col-sm-2 range-values text-center font-weight-bold\">". |
"Min " . $champ['fieldValues']['min'] . |
"</p>"; |
} |
$div_range_min_max .= '<div class="range-live-value range-values text-center font-weight-bold col-sm-'; |
if ( $champ['fieldValues']['min'] && $champ['fieldValues']['max'] ) { |
$div_range_min_max .= '8">'; |
} else { |
$div_range_min_max .= '10">'; |
} |
$div_range_min_max .= '</div>'; |
if( $champ['fieldValues']['max'] ) { |
$div_range_min_max .= |
"<p class=\"col-sm-2 range-values text-center font-weight-bold\">". |
"Max " . $champ['fieldValues']['max'] . |
"</p>"; |
} |
echo $div_range_min_max; |
} |
?> |
<input type="<?= $champ['element']; ?>" name="<?= $champ['key']; ?>" class="custom-range <?= $champ['key'] . $help; ?> form-control" <?= $description . $placeholder . $step . $default . $min . $max . $required; ?> data-label="<?= $champ['name']; ?>"> |
</div> |
</div> |
<?php break; |
514,16 → 515,32 |
</form> |
<?php endif; ?><!-- Fin champs supplémentaires --> |
<form id="form-upload" class="form-horizontal bloc-top" action="<?= $url_ws_upload ?>" method="post" enctype="multipart/form-data"> |
<h2><?= $image['titre']; ?></h2> |
<p class="miniature-info" class="discretion help-inline"> |
<?= $image['aide']; ?> |
</p> |
<div id ="photos-conteneur" class="control-group"> |
<div> |
<label for="fichier" class="label-file btn btn-large btn-info mb-3"> |
<span class="label-text"><i class="fas fa-download"></i> <?= $image['ajouter']; ?></span> |
<input type="file" id="fichier" name="fichier" class="input-file" accept="image/jpeg" multiple> |
<input type="hidden" name="MAX_FILE_SIZE" value="5242880"> |
</label> |
</div> |
<div id="miniatures"></div> |
<p class="miniature-msg" class="span12"> </p> |
</div> |
</form> |
<div id="image" class="row"></div> |
</div> |
<!-- Bouton cr&ation d'une obs --> |
<div class="row mb-3 bloc-bottom"> |
<div class="centre" title="Une fois les champs remplis, vous pouvez cliquer sur ce bouton pour |
ajouter votre observation à la liste à transmettre."> |
<a id="ajouter-obs" class="btn btn-primary"> |
<i class="fas fa-check-square"></i><?= $resume['creer']; ?> |
</a> |
<div class="centre" title="<?= $resume['creer-title']; ?>"> |
<a id="ajouter-obs" class="btn btn-primary"><i class="fas fa-check-square"></i> <?= $resume['creer']; ?></a> |
</div> |
</div> |
592,14 → 609,10 |
<!-- Templates HTML --> |
<div id="tpl-transmission-ok" class="hidden"> |
<p class="msg"> |
<?= $resume['transok']; ?> |
</p> |
<p class="msg"><?= $resume['transok']; ?></p> |
</div> |
<div id="tpl-transmission-ko" class="hidden"> |
<p class="msg"> |
<?= $resume['transko']; ?> |
</p> |
<p class="msg"><?= $resume['transko']; ?></p> |
</div> |
</div> |
</div> |
642,6 → 655,7 |
<!-- Jquery Form :nécessaire pour l'upload des images --> |
<script type="text/javascript" src="https://resources.tela-botanica.org/jquery/form/3.51/jquery.form.min.js"></script> |
<!-- Bootstrap --> |
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script> |
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script> |
<!-- Authentification --> |
<script type="text/javascript" src="<?= $url_base; ?>modules/saisie2/squelettes/js/auth.js"></script> |
673,11 → 687,11 |
widget.separationTagObs = "<?= isset($_GET['projet']) && isset($_GET['tag-obs']) ? ',' : ''; ?>"; |
widget.tagObs = <?= isset($_GET['projet']) ? "'".$_GET['projet']."' + widget.separationTagObs + widget.tagObs" : 'widget.tagObs'; ?>; |
// Précharger le formulaire avec les infos d'une observation |
widget.obsId = "<?=isset($_GET['id-obs']) ? $_GET['id-obs'] : ''?>"; |
widget.obsId = "<?= isset($_GET['id-obs']) ? $_GET['id-obs'] : ''; ?>"; |
// URL du web service réalisant l'insertion des données dans la base du CEL. |
widget.serviceSaisieUrl = "<?=$url_ws_saisie?>"; |
widget.serviceSaisieUrl = "<?= $url_ws_saisie; ?>"; |
// URL du web service permettant de récupérer les infos d'une observation du CEL. |
widget.serviceObsUrl = "<?=$url_ws_obs?>"; |
widget.serviceObsUrl = "<?= $url_ws_obs; ?>"; |
// |
// |
// |
687,13 → 701,13 |
// Squelette d'URL du web service de l'annuaire. |
widget.serviceAnnuaireIdUrl = "<?= $url_ws_annuaire; ?>"; |
// URL de l'icône du chargement en cours |
widget.chargementIconeUrl = "<?= $url_base?>modules/saisie/squelettes/defaut/img/icones/chargement.gif"; |
widget.chargementIconeUrl = "<?= $url_base; ?>modules/saisie/squelettes/defaut/img/icones/chargement.gif"; |
// URL de l'icône du chargement en cours d'une image |
widget.chargementImageIconeUrl = "<?= $url_base?>modules/saisie/squelettes/defaut/img/icones/chargement-image.gif"; |
widget.chargementImageIconeUrl = "<?= $url_base; ?>modules/saisie/squelettes/defaut/img/icones/chargement-image.gif"; |
// URL de l'icône du calendrier |
widget.calendrierIconeUrl = "<?= $url_base?>modules/saisie/squelettes/defaut/img/icones/calendrier.png"; |
widget.calendrierIconeUrl = "<?= $url_base; ?>modules/saisie/squelettes/defaut/img/icones/calendrier.png"; |
// URL de l'icône pour une photo manquante |
widget.pasDePhotoIconeUrl = "<?= $url_base?>modules/saisie/squelettes/defaut/img/icones/pasdephoto.png"; |
widget.pasDePhotoIconeUrl = "<?= $url_base; ?>modules/saisie/squelettes/defaut/img/icones/pasdephoto.png"; |
// Code du référentiel utilisé pour les nom scientifiques. |
widget.nomSciReferentiel = "<?= strtolower( $widget['referentiel'] ); ?>"; |
/trunk/widget/modules/saisie2/squelettes/css/saisie.css |
---|
6,6 → 6,13 |
font-weight: 300; |
} |
#zone-appli { |
padding: 2rem; |
border-radius: 0.3rem; |
background-color: rgba(255, 255, 255, 0.9); |
margin-top: 2rem; |
} |
h1, h2, h3, h4, h5 { |
font-family: Muli,sans-serif; |
} |
274,11 → 281,7 |
margin-bottom: 0; |
} |
.open > a { |
outline: 0; |
} |
.dropdown { |
.volet { |
height: 5rem; |
} |
286,10 → 289,6 |
height: auto; |
} |
#zone-courriel-confirmation { |
} |
#bouton-connexion, |
#creation-compte { |
display: -ms-flexbox; |
315,16 → 314,12 |
width: 100%; |
} |
.navbar-default .navbar-nav > .dropdown #bouton-anonyme, |
.navbar-default .navbar-nav > .dropdown #bouton-inscription { |
.navbar-default .navbar-nav > .volet #bouton-anonyme, |
.navbar-default .navbar-nav > .volet #bouton-inscription { |
width: auto; |
} |
.navbar-default .navbar-nav > .dropdown > a { |
/* width: auto; |
position: relative;*/ |
/* border: 1px solid #ccc; |
border: 1px solid rgba(0,0,0,.15);*/ |
.navbar-default .navbar-nav > .volet > a { |
margin-left: 0.2rem; |
} |
340,15 → 335,21 |
border-color: #9ab227; |
} |
.navbar-default .navbar-nav #utilisateur-connecte.dropdown { |
.navbar-default .navbar-nav #utilisateur-connecte.volet { |
padding-left: 2rem; |
} |
.navbar-default .navbar-nav #utilisateur-connecte.dropdown > a { |
.navbar-default .navbar-nav #utilisateur-connecte.volet > a { |
margin-left: 0; |
} |
.navbar-default .navbar-nav #utilisateur-connecte.dropdown.open .dropdown-menu a { |
.navbar-default .navbar-nav #utilisateur-connecte.volet #profil-utilisateur, |
.navbar-default .navbar-nav #utilisateur-connecte.volet #deconnexion { |
padding: 0 0.75rem; |
margin: 0.2rem 0; |
} |
.navbar-default .navbar-nav #utilisateur-connecte.volet .volet-menu a { |
font-size: 0.8rem; |
font-weight: 400; |
color: #606060; |
358,39 → 359,25 |
width: 100%; |
padding-left: 5px; |
line-height: 25px; |
outline: 0; |
} |
.navbar-default .navbar-nav #utilisateur-connecte.dropdown.open .dropdown-menu a:hover, |
.navbar-default .navbar-nav #utilisateur-connecte.dropdown.open .dropdown-menu a:focus { |
.navbar-default .navbar-nav #utilisateur-connecte.volet #profil-utilisateur:hover, |
.navbar-default .navbar-nav #utilisateur-connecte.volet #deconnexion:hover, |
.navbar-default .navbar-nav #utilisateur-connecte.volet #profil-utilisateur:focus, |
.navbar-default .navbar-nav #utilisateur-connecte.volet #deconnexion:focus { |
background: #1e90ff; |
color: #fff; |
} |
/*.navbar-default .navbar-nav .dropdown .dropdown-toggle::after { |
display: none; |
.navbar-default .navbar-nav #utilisateur-connecte.volet .volet-menu a:hover, |
.navbar-default .navbar-nav #utilisateur-connecte.volet .volet-menu a:focus { |
color: #fff; |
} |
*/ |
/*.navbar-default .navbar-nav > #utilisateur-connecte.open > a:focus, |
.navbar-default .navbar-nav > .dropdown#utilisateur-connecte > a:hover { |
border-right: 3px solid #92ad27; |
}*/ |
.navbar-right .dropdown-menu { |
/* left: auto; |
right: 0;*/ |
} |
.navbar-nav .open > .dropdown-menu { |
display: inline-block; |
} |
.navbar-nav .dropdown-menu { |
.navbar-nav .volet-menu { |
position: absolute; |
left: 0; |
right: 0; |
top: 100%; |
z-index: 1000; |
min-width: auto; |
margin-top: -10px; |
margin-left: 1.9rem; |
list-style: none; |
background-color: #fff; |
border: 1px solid #ccc; |
398,13 → 385,19 |
border-radius: 4px; |
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); |
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); |
background-clip: padding-box; |
} |
.dropdown-menu div a { |
.volet-menu div a { |
color: #222; |
} |
.navbar-default .navbar-nav #utilisateur-connecte .volet-toggle::after { |
font-family: "Font Awesome 5 Free"; |
font-size: 0.8rem; |
font-weight: 900; |
content: '\f0d7' |
} |
/*************************************************************************/ |
#zone-appli #formulaire #form-supp #zone-supp .multiselect.list-checkbox { |
509,6 → 502,15 |
/*************************************************************************/ |
.range-values { |
color: #606060; |
} |
.range-live-value { |
padding-top: 1rem; |
font-size: 1rem; |
} |
/*******************************************/ |
.label-file { |
660,6 → 662,10 |
color: #499fb7; |
} |
#zone-prenom-nom #prenom, |
#zone-prenom-nom #nom { |
z-index: 0; |
} |
#transmettre-obs{ |
text-align: right; |
677,6 → 683,23 |
float: right; |
} |
#image-fond { |
position: fixed; |
top:0; |
bottom: 0; |
left: 0; |
right: 0; |
z-index: -1; |
min-width: 100%; |
background-attachment: fixed; |
margin: 0; |
padding: 0; |
} |
.modal-open, body.modal-open { |
overflow: inherit !important; |
} |
/*************************************/ |
@media screen and ( max-width: 765px ) { |
/trunk/widget/modules/saisie2/i18n/en.ini |
---|
1,5 → 1,5 |
[General] |
obligatoire = "obligatoire" |
obligatoire = "required" |
[Aide] |
titre = "Help" |
8,14 → 8,14 |
Log in to find and modify your data in your <a target=\"_blank\" href=\"https://www.tela-botanica.org/appli:cel\"> |
Carnet en ligne</a>. Create up to 10 observations (10Mo max of pictures), save them and share them with the \"transmit\" button. |
<a target=\"_blank\" href=\"https://www.tela-botanica.org/wikini/AideCarnetEnLigne/wakka.php?wiki=AideWidgetSaisieCreerTransmettre\"> |
Under certain conditions</a>, your data can be displayed on our tools |
Provided some conditions</a>, your data can be displayed on our tools |
<a target=\"_blank\" href=\"https://www.tela-botanica.org/appli:identiplante\">IdentiPlante</a>, |
<a target=\"_blank\" href=\"https://www.tela-botanica.org/appli:pictoflora\">PictoFlora</a>, eFlore, |
<a target=\"_blank\" href=\"https://www.tela-botanica.org/widget:cel:cartoPoint\">map</a> and |
<a target=\"_blank\" href=\"https://www.tela-botanica.org/widget:cel:photos\">photo gallery</a>.<br /> |
En cas de question ou pour en savoir plus, |
<a target=\"_blank\" href=\"https://www.tela-botanica.org/wikini/AideCarnetEnLigne/wakka.php?wiki=AideWidgetSaisie\"> consultez l'aide</a> |
ou contactez-nous à cel_remarques@tela-botanica.org." |
For question or to know more, |
<a target=\"_blank\" href=\"https://www.tela-botanica.org/wikini/AideCarnetEnLigne/wakka.php?wiki=AideWidgetSaisie\"> see the help</a> |
or contact us at cel_remarques@tela-botanica.org." |
bouton="Inactive help" |
contact="For any questions," |
contact2="contact us." |
24,9 → 24,11 |
titre = "Observer" |
compte = "Use an account" |
connexion = "Log in" |
nonconnexion = "Observation without registration" |
inscription = "Create an account" |
noninscription = "I don't want use an account :" |
noninscription = "I don't want to use an account :" |
bienvenue = "Hello : " |
profil = "My profile" |
deconnexion = "Log out" |
courriel = "Email" |
courriel-confirmation = "Email ()" |
34,9 → 36,15 |
courriel-input-title = "Enter your Tela Botanica's inscription mail. If you are not registered, |
you can do it later to manage your data." |
prenom = "First name" |
nom = "Name" |
nom = "Last Name" |
alertcc-title = "Information : copy/paste" |
alertcc = "Please do not copy / paste your email. <br/> |
Double entry makes it possible to check for errors. " |
alertni-title = "Information : Observer not identified" |
alertni = "Your observation must be linked to either an account or an email.<br/> |
Please choose either to login, to register or to communicate an email address to identify yourself as the author of the observation.<br/> |
To find your observations in the <a target=\"_blank\" href=\"http://www.tela-botanica.org/appli:cel\">Online notebook</a>,<br/> |
it is necessary to <a target=\"_blank\" href=\"http://www.tela-botanica.org/page:inscription\">register to Tela Botanica</a>." |
[Observation] |
43,6 → 51,7 |
titre = "Observation" |
geolocalisation = "Geolocalisation" |
milieu = "Environment" |
milieu-ph = "wood, field, cliff, ..." |
date = "Date" |
referentiel = "Referential" |
espece = "Species" |
50,4 → 59,50 |
certCert = "Certain" |
certDout= "Dubious" |
certADet= "To be identified" |
notes = "Notes" |
notes = "Notes" |
notes-ph = "You can optionally add additional information to your observation." |
[Image] |
titre = "Picture(s) of this plant" |
aide = "Photos must be in JPEG format and must not exceed 5MB each." |
ajouter = "Add a picuture" |
[Chpsupp] |
titre = "Project specific information" |
[Resume] |
creer = "Create" |
creer-title = "Once the fields are filled, you can click on this button to add your observation to the list to transmit." |
alert10max = "Information : 10 observations maximum" |
alert10max-desc = "You've just added your 10th observation.<br/> |
If you wish to add ohers, these observations must be transmitted first by clicking the 'transmit' button above." |
alertchp = "Information : some fields have errors" |
alertchp-desc = "Some fields in this form are poorly filled.<br/> |
Please check your data." |
titre = "Observations to be transmitted :" |
trans-title = "Add the observations below to your Online Notebook and make them public." |
trans = "transmit" |
alert0obs = "Warning : no observation" |
alert0obs-desc = "Please enter observations to transfer them." |
info-trans = "Information : transmission of observations" |
alerttrans = "Error : transmission of observations" |
nbobs = "observations transmitted" |
transencours = "Transfer of observations in progress...<br /> |
This may take several minutes depending on the size of the images and the number of observations to be transferred." |
transok = "Your observations have been sent.<br /> |
They are now available through different visualization tools of the network ( |
<a href=\"https://www.tela-botanica.org/flore/\">eFlore</a>, |
<a href=\"https://www.tela-botanica.org/appli:pictoflora\">images galery</a>, |
<a href=\"https://www.tela-botanica.org/appli:identiplante\">identiplante</a>, |
<a href=\"https://www.tela-botanica.org/widget:cel:cartoPoint\">cartography (widget)</a>...)<br /> |
If you want to modify or delete them, you can find them by connecting to your |
<a href=\"https://www.tela-botanica.org/appli:cel\"> Online notebook</a>.<br /> |
Remember that it is necessary to |
<a href=\"https://beta.tela-botanica.org/test/page:inscription\"> register on Tela Botanica</a> |
beforehand, if you have not already done so." |
transko = "An error occurred while transmitting an observation (indicated in red).<br /> |
You can try to retransmit it by clicking again on the transmit button or delete it and pass on the following.<br /> |
Nevertheless, the observations no longer appearing in the \ "observations to be transmitted \" list, were sent during your previous attempt. <br /> |
If the problem remains, you can report the malfunction on <a href=\"<?php echo $url_remarques\; ?>?service=cel\&pageSource=<?php echo urlencode( 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'] )\; ?>\" target=\"_blank\" onclick=\"javascript: window.open( this.getAttribute( 'href' ), 'Tela Botanica - Remarques', config = 'height=700, width=640, scrollbars=yes, resizable=yes' )\; return false\;\">the error reporting form</a>." |
/trunk/widget/modules/saisie2/i18n/fr.ini |
---|
4,7 → 4,7 |
[Aide] |
titre = "Aide" |
description="Cet outil vous permet de partager simplement vos observations avec le réseau Tela Botanica |
(sous <a target=\"_blank\" href=\"https://www.tela-botanica.org/mentions-legales/#droit-de-reproduction\"> |
(sous <a target=\"_blank\" href=\"https://www.tela-botanica.org/mentions-legales/\#droit-de-reproduction\"> |
licence CC BY-SA 2.0 FR</a>).<br /> |
Identifiez-vous pour retrouver et gérer vos données dans votre <a target=\"_blank\" href=\"https://www.tela-botanica.org/appli:cel\"> |
Carnet en ligne</a>. Créez jusqu'à 10 observations (avec 10Mo max d'images) puis enregistrez-les et |
77,6 → 77,7 |
[Resume] |
creer = "Créer" |
creer-title = "Une fois les champs remplis, vous pouvez cliquer sur ce bouton pour ajouter votre observation à la liste à transmettre." |
alert10max = "Information : 10 observations maximum" |
alert10max-desc = "Vous venez d'ajouter votre 10ème observation.<br/> |
Pour en ajouter de nouvelles, il est nécessaire de les transmettre en cliquant sur le bouton ci-dessous." |
108,12 → 109,5 |
transko = "Une erreur est survenue lors de la transmission d'une observation (indiquée en rouge).<br /> |
Vous pouvez tenter de la retransmettre en cliquant à nouveau sur le bouton transmettre ou bien la supprimer |
et transmettre les suivantes.<br /> |
Néanmoins, les observations n'apparaissant plus dans la liste "observations à transmettre", ont bien été transmises lors de votre précédente tentative. <br /> |
Si le problème persiste, vous pouvez signaler le dysfonctionnement sur |
<a href=\"<?= $url_remarques; ?>?service=cel&pageSource=<?php echo urlencode( 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'] ); ?>\" target=\"_blank\" |
onclick=\" |
javascript: window.open( this.getAttribute( 'href' ), 'Tela Botanica - Remarques', config = 'height=700, width=640, scrollbars=yes, resizable=yes' ); |
return false; |
\">le formulaire de signalement d'erreurs</a>." |
Néanmoins, les observations n'apparaissant plus dans la liste \"observations à transmettre\", ont bien été transmises lors de votre précédente tentative. <br /> |
Si le problème persiste, vous pouvez signaler le dysfonctionnement sur <a href=\"<?php echo $url_remarques\; ?>?service=cel\&pageSource=<?php echo urlencode( 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'] )\; ?>\" target=\"_blank\" onclick=\"javascript: window.open( this.getAttribute( 'href' ), 'Tela Botanica - Remarques', config = 'height=700, width=640, scrollbars=yes, resizable=yes' )\; return false\;\">le formulaire de signalement d'erreurs</a>." |
/trunk/widget/modules/saisie2/i18n/nl.ini |
---|