Commit 968e4571 authored by Patrick Barroca's avatar Patrick Barroca 🐧

Merge branch 'hotline-master' into 'master'

Hotline master

See merge request !2268
parents b6e8763d cd7398e5
Pipeline #2171 passed with stage
in 13 minutes and 7 seconds
27/07/2017 - v7.9.34
- ticket #63041 : Affichage des notices : Correction des onglets qui ne se refermaient pas
- ticket #62244 : Administration : adaptation de l'iframe du tableau de bord Piwik pour pouvoir l'afficher dans sa totalité
- ticket #62616 : Administration : Correction de l'affichage du tableau de bord Piwik dans un Bokeh accédé en https
- ticket #60748 : Administration : Correction du composant de sélection des autorités dans la modification des domaines
- ticket #60174 : Correction d'une boucle infinie dans le choix des icônes de menu si le répertoire des icônes n'existe pas.
Correction des boutons de formulaires sur les ajouts / modifications de localisations bibliothèque
- ticket #60059 : Vue adaptive Smartphone : on peut faire défiler horizontalement les tableaux des prêts et des réservations
- ticket #62610 : Affichage d'une notice : Correction d'une erreur survenant lorsqu'un lien FRBR erroné était placé sur la notice
24/07/2017 - v7.9.33
- ticket #63133: Intégration MARC21: prise en charge des exemplaires en zone 995
......
......@@ -89,6 +89,7 @@ class Admin_BibController extends ZendAfi_Controller_Action {
return true;
}
public function addlocalisationAction() {
if (!$bib = $this->getBib())
return $this->_redirect('admin/bib');
......@@ -99,7 +100,7 @@ class Admin_BibController extends ZendAfi_Controller_Action {
$localisation->setAnimation($default_animation);
if ($this->_checkPost($localisation))
return $this->_redirect('admin/bib/plans/id_bib/'.$bib->getId());
return $this->_redirect('admin/bib/localisations/id_bib/'.$bib->getId());
$this->view->titre = $this->view->_("Nouvelle localisation");
$this->view->localisation = $localisation;
......@@ -122,13 +123,13 @@ class Admin_BibController extends ZendAfi_Controller_Action {
}
public function localisationsmajAction() {
public function localisationsmajAction() {
if ((!$bib = $this->getBib())
|| (!$localisation = $this->getLocalisation()))
return $this->_redirect('admin/bib');
$this->_checkPost($localisation);
$this->_checkPost($localisation);
// Plans
......
......@@ -3,10 +3,12 @@
<script type="text/javascript" src="<?php echo URL_ADMIN_JS?>slimbox/autoload_image_simple.js"> </script>
<?php
echo ('<center><div align="center"><br>'.$this->bouton('id=c_19','picto=add','texte='.$this->traduire('Ajouter une localisation').'','url='.BASE_URL.'/admin/bib/addlocalisation/id_bib/'.$this->id_bib,'largeur=230px').'</div></center>'); ?>
<br />
<?php
echo $this->button_New(
(new Class_Entity())->setText($this->_('Ajouter une localisation'))
->setUrl($this->url(['action' => 'addlocalisation',
'id_bib' => $this->id_bib])));
if($this->localisations)
{
?>
......
......@@ -125,7 +125,7 @@ Class_ScriptLoader::getInstance()->addTagSelection();
<tr>
<td class="droite"><?php echo $this->traduire('Animation'); ?></td>
<td class="gauche">
<?php echo $this->ChoixPictogramme("plan_animation","ANIMATION",0,$this->localisation->getAnimation()); ?>
<?php echo $this->ChoixPictogramme("plan_animation","ANIMATION",$this->localisation->getAnimation()); ?>
</td>
</tr>
......@@ -185,8 +185,16 @@ Class_ScriptLoader::getInstance()->addTagSelection();
<table>
<tr>
<td align="right" style="padding-right:5px;"><?php echo $this->bouton('type=V'); ?> </td>
<td align="left" style="padding-left:5px;"> <?php echo $this->bouton('id=29','picto=remove','texte=Annuler','url='.BASE_URL.'/admin/bib/localisations/id_bib/'.$this->id_bib,'largeur=120px'); ?></td>
<td align="right" style="padding-right:5px;">
<?php echo $this->button_Submit(); ?>
</td>
<td align="left" style="padding-left:5px;">
<?php
echo $this->button_Back(
(new Class_Entity())->setUrl($this->url(['action' => 'localisations',
'id_bib' => $this->id_bib])));
?>
</td>
</tr>
</table>
</form>
......
......@@ -17,7 +17,7 @@ foreach($this->genres as $genre)
echo '<tr class="'.$class.'" style="height:30px" width="30px">';
echo '<td align="center">';
if(!$genre["picto"]) $genre["picto"]="_vide.gif";
echo $this->ChoixPictogramme("genres","genre_".$genre["id_genre"],1,$genre["picto"]);
echo $this->ChoixPictogramme("genres","genre_".$genre["id_genre"],$genre["picto"]);
echo '</td>';
echo '<td>'.$genre["libelle"].'</td>';
print('</tr>');
......
<?php
Class_ScriptLoader::getInstance()
->addJQueryReady('var title = $(".modules h1");
var container_height = Math.round(window.innerHeight - title.position().top - title.height());
var container = $(".modules");
container.height(container_height);
$("iframe#piwik").height(container_height - title.height() - Math.round(container.css("padding-bottom").replace("px","")))');
if($this->error)
echo $this->tag('p', $this->error, ['class' => 'error']);
echo $this->tag('iframe', '', ['src' => $this->url,
'id' => 'piwik',
'frameborder' => '0',
'marginheight' => '0',
'marginwidth' => '0',
'width' => '100%',
'height' => '200%',
'scrolling' => 'no']);
'scrolling' => 'yes']);
?>
......@@ -50,28 +50,27 @@ class Class_AdminVar_JsStat {
public function getPiwikUrl() {
$script = Class_AdminVar::get('JS_STAT');
preg_match_all("/var u=.*(\/\/[^\"]+)\"/i", $script, $matches);
return isset($matches[1][0])
? ('http:' . trim($matches[1][0]))
: '';
return $this->_extractFromJsStat("/var u=.*(\/\/[^\"]+)\"/i", 1);
}
protected function _getGoogleAnalyticsId() {
$script = Class_AdminVar::get('JS_STAT');
preg_match_all("/(UA|MO)-[0-9]+-[0-9]/", $script, $matches);
return (isset($matches[0][0]))
? $matches[0][0]
: '';
return $this->_extractFromJsStat("/(UA|MO)-[0-9]+-[0-9]/", 0);
}
protected function _getPiwikSiteId() {
$script = Class_AdminVar::get('JS_STAT');
preg_match_all("/setSiteId\',([^\]]+)\]\)/i", $script, $matches);
return isset($matches[1][0]) ? trim($matches[1][0]) : '';
return $this->_extractFromJsStat("/setSiteId\',([^\]]+)\]\)/i", 1);
}
}
?>
\ No newline at end of file
protected function _extractFromJsStat($pattern, $match_index) {
preg_match($pattern,
Class_AdminVar::get('JS_STAT'),
$matches);
return isset($matches[$match_index])
? trim($matches[$match_index])
: '';
}
}
\ No newline at end of file
......@@ -22,6 +22,13 @@
class CodifThesaurusLoader extends Storm_Model_Loader {
use Trait_Translator;
const
SUGGEST_HIERARCHY_CONTAINS = 1,
SUGGEST_LABEL_STARTS_WITH = 2,
SUGGEST_LABEL_CONTAINS = 3,
SUGGEST_INDEX_STARTS_WITH = 4;
protected $_fixed = [];
public function __construct($class) {
......@@ -338,8 +345,73 @@ class CodifThesaurusLoader extends Storm_Model_Loader {
protected function getCustomFieldsFacetPrefix() {
return Class_CodifThesaurus::CODE_FACETTE
. Class_CodifThesaurus::fixedIdOf('CustomField');
return Class_CodifThesaurus::CODE_FACETTE . Class_CodifThesaurus::fixedIdOf('CustomField');
}
public function suggestFrom($recherche, $mode, $limite_resultat, $theme) {
if (!$req = $this->_suggestQueryFor((int)$mode, $theme, $recherche, $limite_resultat))
return [];
$resultat=fetchAll($req);
if (!$resultat)
return [];
foreach($resultat as $enreg) {
$thesaurus = Class_CodifThesaurus::find($enreg["id"]);
$libelle = Class_CodifThesaurus::getLibelleHierarchique($thesaurus);
$liste[] = [$enreg["id_thesaurus"],
$enreg["id_origine"]." : ".$libelle];
}
return $liste;
}
protected function _suggestQueryFor($mode, $parent, $term, $limit) {
$parent_clause = $this->_fieldStartsWith('id_thesaurus', $parent);
if (static::SUGGEST_HIERARCHY_CONTAINS == $mode) {
return (3 <= strlen($term))
? $this->_orderAndLimit("select distinct(id), id, id_thesaurus, id_origine "
."from codif_thesaurus where id_thesaurus regexp (select group_concat(concat(id_thesaurus,'.*') separator '|') from codif_thesaurus where ". $parent_clause ." and id_origine is not null and " . $this->_fieldContains('libelle', $term) . ")",
$limit)
: null;
}
$basic_select = "select id, id_thesaurus, id_origine from codif_thesaurus where ". $parent_clause;
if (static::SUGGEST_LABEL_STARTS_WITH == $mode)
return $this->_orderAndLimit($basic_select . ' and ' . $this->_fieldStartsWith('libelle', $term),
$limit);
if (static::SUGGEST_LABEL_CONTAINS == $mode)
return $this->_orderAndLimit($basic_select . ' and ' . $this->_fieldContains('libelle', $term),
$limit);
if (static::SUGGEST_INDEX_STARTS_WITH == $mode)
return $this->_orderAndLimit($basic_select . ' and ' . $this->_fieldStartsWith('id_origine', $term),
$limit);
}
protected function _orderAndLimit($sql, $limit) {
return $sql . ' order by id_thesaurus limit ' . $limit;
}
protected function _fieldStartsWith($field, $value) {
return $this->_like($field, addslashes($value) . '%');
}
protected function _fieldContains($field, $value) {
return $this->_like($field, '%' . addslashes($value) . '%');
}
protected function _like($field, $clause) {
return $field . ' like \''. $clause . '\'';
}
}
......@@ -355,12 +427,7 @@ class Class_CodifThesaurus extends Storm_Model_Abstract {
COLUMN_ORIGIN_SIZE = 20,
ID_KEY_LENGTH = 4,
CODE_FACETTE = 'H',
MODE_HIERARCHY_CONTAINS = 1,
MODE_LABEL_STARTS_WITH = 2,
MODE_LABEL_CONTAINS = 3,
MODE_INDEX_STARTS_WITH = 4;
CODE_FACETTE = 'H';
protected $_loader_class = 'CodifThesaurusLoader';
protected $_table_name = 'codif_thesaurus';
......@@ -370,41 +437,8 @@ class Class_CodifThesaurus extends Storm_Model_Abstract {
'id_origine' => null,
'rules' => null];
public function getListeSuggestion($recherche, $mode, $limite_resultat, $theme) {
switch ((int) $mode) {
case self::MODE_HIERARCHY_CONTAINS:
if (strlen($recherche) < 3)
return [];
$req = "select distinct(id),id_thesaurus,id_origine from codif_thesaurus where id_thesaurus regexp (select group_concat(concat(id_thesaurus,'.*') separator '|') from codif_thesaurus where id_thesaurus like '".$theme."%' and id_origine is not null and libelle like '%".$recherche."%') order by id_thesaurus";
break;
case self::MODE_LABEL_STARTS_WITH:
$req="select id,id_thesaurus,libelle,id_origine from codif_thesaurus where id_thesaurus like '".$theme."%' and libelle like'".addslashes($recherche)."%' order by id_thesaurus limit ".$limite_resultat;
break;
case self::MODE_LABEL_CONTAINS:
$req="select id,libelle,id_origine from codif_thesaurus where id_thesaurus like '".$theme."%' and libelle like'%".addslashes($recherche)."%' order by id_thesaurus limit ".$limite_resultat;
break;
case self::MODE_INDEX_STARTS_WITH:
$req="select id,id_thesaurus,libelle,id_origine from codif_thesaurus where id_thesaurus like '".$theme."%' and id_origine like '".$recherche."%' order by id_thesaurus limit ".$limite_resultat;
break;
}
$resultat=fetchAll($req);
if (!$resultat)
return [];
foreach($resultat as $enreg) {
$thesaurus = Class_CodifThesaurus::getLoader()->find($enreg["id"]);
$libelle = Class_CodifThesaurus::getLoader()->getLibelleHierarchique($thesaurus);
$liste[] = [$enreg["id_thesaurus"],
$enreg["id_origine"]." : ".$libelle];
}
return $liste;
public function getListeSuggestion($recherche, $mode, $limite_resultat, $theme) {
return $this->getLoader()->suggestFrom($recherche, $mode, $limite_resultat, $theme);
}
......
......@@ -27,7 +27,12 @@ class Class_Notice_Thumbnail_ProviderRecordWithAlbum
if (!$links = Class_FRBR_Link::findAllAlbumsFromNotice($this->_record))
return null;
$album = $links[0]->getEntityOfType(Class_FRBR_Link::TYPE_ALBUM);
foreach ($links as $link) {
if ($album = $link->getEntityOfType(Class_FRBR_Link::TYPE_ALBUM))
break;
}
if (!$album) return null;
if ($url = $album->getThumbnailUrl())
return $url;
......
......@@ -148,7 +148,7 @@ class ZendAfi_Form_Configuration_Domain extends ZendAfi_Form {
}
public function populate($datas) {
public function populate(array $datas) {
$this
->addElement('comboDomain',
'combo_domain',
......
......@@ -24,7 +24,6 @@ class ZendAfi_Form_Decorator_IcoPicker extends Zend_Form_Decorator_Abstract {
public function render($content) {
return $this->_element->getView()->ChoixPictogramme('menus',
$this->_element->getName(),
Class_Profil::getCurrentProfil()->getId(),
$this->_element->getValue());
}
}
......
......@@ -18,80 +18,58 @@
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
//////////////////////////////////////////////////////////////////////////////////////////
// OPAC3 : Tag de choix de pictogramme pour les menus
//////////////////////////////////////////////////////////////////////////////////////////
class ZendAfi_View_Helper_ChoixPictogramme extends ZendAfi_View_Helper_BaseHelper
// Icon selector in profile menu entry configuration
class ZendAfi_View_Helper_Admin_ChoixPictogramme extends ZendAfi_View_Helper_BaseHelper
{
private $hauteur_div="95px"; // Hauteur de la liste
private $largeur_div="180px"; // Largeur de la liste
private $nb_par_ligne=5; // Nombre de pictos par ligne
//---------------------------------------------------------------------
// Main routine
//---------------------------------------------------------------------
public function ChoixPictogramme($type,$name,$id_profil,$picto_selected,$scroll=false)
{
// Liste des pictos
$class_profil=Class_Profil::getCurrentProfil();
if($type=="menu") {
if ($class_profil->isTelephone()) {
$this->largeur_div="230px";
$this->hauteur_div="150px";
}
}
if($type=="plan_animation")
{
$path_ico='/public/admin/images/animation_plan/';
$this->largeur_div="500px";
$this->hauteur_div="500px";
}
else
$path_ico=$class_profil->getPathTheme()."images/".$type."/";
$dir=opendir(".".$path_ico);
while(false !== ($file = readdir($dir)))
{
$extension=substr($file,-4);
if($extension != ".gif" and $extension !=".png" and $extension !=".jpg") continue;
$pictos[]=$file;
}
closedir($dir);
sort($pictos);
$path_ico=BASE_URL.$path_ico;
public function ChoixPictogramme($type, $name, $picto_selected) {
$path_ico = ($type=="plan_animation")
? '/public/admin/images/animation_plan/'
: Class_Profil::getCurrentProfil()->getPathTheme()."images/".$type."/";
$pictos = $this->_readPictos($path_ico);
$url_ico = BASE_URL . $path_ico;
$html='<input type="hidden" id="'.$name.'" name="'.$name.'" value="'.$picto_selected.'"/>';
if($scroll==true)
$scroll='window.scrollTo(0,2000);';
$oListe = "var oListe = $(this).closest('form').find('#liste_picto_".$name."').get(0);";
$onclick= $oListe . "if(oListe.style.display=='block') oListe.style.display='none'; else oListe.style.display='block';" .
$scroll;
$onmouseout = '';//$oListe . "oListe.style.display='none'";
$onclick = $oListe . "if(oListe.style.display=='block') oListe.style.display='none'; else oListe.style.display='block';";
$html.= '<img id="select_'.$name.'" src="' . $path_ico . $picto_selected . '" style="cursor:pointer;padding-right:' . $this->largeur_div . '" onclick="' . $onclick . '" onmouseout="' . $onmouseout . '" alt="' . $name . '"/>';
$html.= '<img id="select_'.$name.'" src="' . $url_ico . $picto_selected . '" style="cursor:pointer" onclick="' . $onclick . '" alt="' . $name . '"/>';
$html.='<div id="liste_picto_'.$name.'" style="display:none;position:absolute;" onmouseover="this.style.display=\'block\'" >';
$html.='<div style="width:'.$this->largeur_div.';height:'.$this->hauteur_div.';border:1px solid #C8C8C8;background-color:#FFFFFF;overflow:auto;margin-bottom:10px">';
$html.='<table cellspacing="10"><tr>';
$html.='<div style="border:1px solid #C8C8C8;background-color:#FFFFFF;overflow:auto;margin-bottom:10px">';
$nb = 0;
foreach($pictos as $picto)
{
if($nb >= $this->nb_par_ligne) {$html.='</tr><tr>'; $nb=0;}
foreach($pictos as $picto) {
$name_value = " $(this).closest('form').find('#" . $name . "').val(this.id);";
$src_value = "$(this).closest('form').find('#select_" . $name . "').attr('src', this.src);";
$onclick= $name_value . $src_value . $oListe . "oListe.style.display='none';$(this).closest('form').find('input').first().change();";
$html.='<td align="center"><img id="'.$picto.'" src="'.$path_ico.$picto.'" onclick="'.$onclick.'" style="cursor:pointer" alt="'.$name.'"/></td>';
$nb++;
$html.='<img id="'.$picto.'" src="'.$url_ico.$picto.'" onclick="'.$onclick.'" style="cursor:pointer; margin:10px" alt="'.$name.'"/>';
}
$html.='</tr></table></div></div>';
$html.='</div></div>';
return $html;
}
protected function _readPictos($path_ico) {
if (!$dir = @opendir(".".$path_ico))
return [];
while (false !== ($file = readdir($dir)))
$pictos[]=$file;
closedir($dir);
sort($pictos);
return array_filter($pictos,
[$this, 'isPictoExtensionValid']);
}
public function isPictoExtensionValid($file) {
return in_array(substr($file,-3), ['gif', 'jpg', 'png']);
}
}
\ No newline at end of file
......@@ -82,7 +82,7 @@ class Bokeh_Engine {
function setupConstants() {
defineConstant('BOKEH_MAJOR_VERSION','7.9');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.33');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.34');
defineConstant('BOKEH_REMOTE_FILES', 'http://git.afi-sa.fr/afi/opacce/');
......
......@@ -339,6 +339,11 @@
}
table {
display:block;
overflow-x: auto;
}
table.exemplaires {
width: 100%;
display: table;
......
......@@ -85,23 +85,23 @@ if (undefined == window.blocNoticeAfterLoad)
function infos_bloc(sIdBloc,sIsbn,sType,sCherche,nNiveau,nPage, sUrl) {
if(sIdBloc.substr(0,1) == "I" ) sIdBloc=sIdBloc.substr(1,sIdBloc.length);
oImg=document.getElementById("I" + sIdBloc);
oContenu=document.getElementById(sIdBloc + "_contenu");
oParent = oImg.parentNode.parentNode;
if(oContenu.style.display =="block" && !sCherche) {
var oImg=document.getElementById("I" + sIdBloc);
var oParent = oImg.parentNode.parentNode;
var bloc = $('#'+sIdBloc + '_contenu');
if(bloc.is(':visible') && !sCherche) {
oImg.setAttribute("src", imagesUrl + "bouton/plus_carre.gif");
oParent.className = oParent.className.replace(/\b deplier\b/,'');
$(oContenu).slideUp();
bloc.slideUp();
return;
}
oImg.setAttribute("src", imagesUrl + "bouton/moins_carre.gif");
oParent.className= oParent.className+" deplier";
$(oContenu).slideDown();
nPos=sIdBloc.lastIndexOf("_");
nIdNotice=sIdBloc.substr(5,nPos-5);
bloc.slideDown();
var nPos=sIdBloc.lastIndexOf("_");
var nIdNotice=sIdBloc.substr(5,nPos-5);
if (sUrl == undefined)
sUrl=baseUrl + '/opac/noticeajax/'+ sType;
......@@ -109,7 +109,7 @@ function infos_bloc(sIdBloc,sIsbn,sType,sCherche,nNiveau,nPage, sUrl) {
if(sCherche) sUrl = sUrl + '&cherche=' + sCherche;
var bloc = $('#'+sIdBloc + '_contenu');
var width = bloc.width();
sUrl = sUrl + '&width='+width;
......
......@@ -18,19 +18,17 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
function ouvrirFermer(oImg,sId)
function ouvrirFermer(oImg, sId)
{
sImg = oImg.src;
if(sImg.indexOf("ouvrir") > 0 )
{
oImg.src=sImg.replace("ouvrir", "fermer");
getId(sId).style.display="block";
}
else
{
oImg.src=sImg.replace("fermer", "ouvrir");
getId(sId).style.display="none";
if (sImg.indexOf("ouvrir") > 0) {
oImg.src = sImg.replace("ouvrir", "fermer");
getId(sId).style.display = "block";
return;
}
oImg.src=sImg.replace("fermer", "ouvrir");
getId(sId).style.display = "none";
}
......@@ -102,72 +100,82 @@ function selectAll(sIdChamp,bMode,allSelectedAsNothingSelected)
function getSuggest(sRubrique,sChamp,sValeur,nMinCars)
{
if(sValeur.length < nMinCars)
{
getId(sChamp + "_liste").innerHTML="";
if(sValeur.length < nMinCars) {
getId(sChamp + "_liste").innerHTML = '';
return;
}
while(sValeur.indexOf(" ")>0)
{
sValeur=sValeur.replace(" ", "+");
}
sMode=getId("mode_" + sChamp).value;
sUrl=baseUrl + "/admin/ajax/listesuggestion?type_autorite=" + sRubrique + "&id_champ=" + sChamp + "&mode=" + sMode +"&valeur=" + sValeur;
$('#'+sChamp+'_liste').load(sUrl);
var params = {
type_autorite: sRubrique,
id_champ: sChamp,
mode: getId('mode_' + sChamp).value,
valeur: sValeur
};
$('#'+sChamp+'_liste')
.load(baseUrl + "/admin/ajax/listesuggestion?" + $.param(params));
}
function selectSuggest(sIdChamp, oItem)
{
// Handles
oChampCodes=getId(sIdChamp);
oChampAff=getId(sIdChamp +"_aff");
var oChampCodes = getId(sIdChamp);
var oChampAff = getId(sIdChamp + '_aff');
// Controle s'il est deja la
sClef=oItem.getAttribute("clef");
sCodes=oChampCodes.value;
sControle=";" + sCodes + ";";
if(sControle.indexOf(";" + sClef + ";") >=0 )
{
bRet=confirm("Cet élément a déjà été sélectionné.\n\nVoulez vous le supprimer ?");
if(bRet==true)
{
sControle=sControle.replace(";" + sClef + ";", ";");
if(sControle.substr(0,1)==";") sControle=sControle.substr(1);
if(sControle.substr(-1)==";") sControle=sControle.substr(0,sControle.length-1);
oChampCodes.value=sControle;
sAff=oChampAff.innerHTML;
sItemAff="«" + oItem.innerHTML + "»"
sAff=sAff.replace(sItemAff, "");
oChampAff.innerHTML=sAff;
}
var sClef = oItem.getAttribute('clef');
var sCodes = oChampCodes.value;
var sControle = ';' + sCodes + ';';
if (sControle.indexOf(';' + sClef + ';') >= 0) {
if(!confirm('Cet élément a déjà été sélectionné.\n\nVoulez vous le supprimer ?'))
return;
sControle = sControle.replace(';' + sClef + ';', ';');
if (sControle.substr(0,1) == ';')
sControle = sControle.substr(1);
if (sControle.substr(-1) == ';')
sControle = sControle.substr(0, sControle.length-1);
oChampCodes.value = sControle;
$(oChampAff).find('span[clef="' + sClef + '"]').remove();
$('#'+sIdChamp).change();
setFlagMaj(true);
return;
}
// Integration de 'item sélectionné
if(sCodes > "") sCodes+=";";
sCodes+=sClef;
oChampCodes.value=sCodes;
if(sCodes > '')
sCodes += ';';
sCodes += sClef;
oChampCodes.value = sCodes;
sAff = oChampAff.innerHTML;
if( sAff > '')
sAff += ' ';
sAff += '<span class="selected" clef="' + sClef + '">' + oItem.innerHTML + '</span>';
oChampAff.innerHTML = sAff;
sAff=oChampAff.innerHTML;
if( sAff > "") sAff +=" ";
sAff+='<span class="selected">' + oItem.innerHTML + "</span>"
oChampAff.innerHTML=sAff;
$('#' + sIdChamp).change();
setFlagMaj(true);
}
function suggestClear(sIdChamp)
{
oChampCodes=getId(sIdChamp);
if(oChampCodes.value=="")
{
alert("Il n'y a aucun élément à effacer.");
var oChampCodes = getId(sIdChamp);
if(oChampCodes.value == '')
return;
}
if(confirm("Etes vour sûr de vouloir effacer tous les élément sélectionnés ?")==false) return