252,9 → 252,9 |
for (int i = 0; i < valeurs.length; i++) { |
if (i == (position - 1)) { |
if (valeurs[i].contains("##")) { |
sortie = valeurs[i].replaceFirst("^[^#]+##", ""); |
sortie = valeurs[i].replaceFirst("^[^#]+##", ""); |
} else { |
sortie = valeurs[i]; |
sortie = valeurs[i]; |
} |
break; |
} |
275,13 → 275,15 |
* @param valeur la valeur à remplacer à la position indiquée |
*/ |
protected void modifierChaineDenormaliseParPosition(String champ, int position, Object valeur) { |
if (valeur instanceof String) { |
if (valeur == null) { |
supprimerChaineDenormaliseParPosition(champ, position); |
} else if (valeur instanceof String) { |
String chaineExistante = renvoyerValeurCorrecte(champ); |
if (!chaineExistante.equals("")) { |
if (chaineExistante.equals("")) { |
this.set(champ, valeur); |
} else { |
String[] valeurs = chaineExistante.split(";;"); |
if (valeurs.length == 0) { |
this.set(champ, valeur); |
} else if (valeurs.length >= position) { |
if (valeurs.length >= position) { |
for (int i = 0; i < valeurs.length; i++) { |
if (i == (position - 1)) { |
valeurs[i] = (String) valeur; |
294,6 → 296,23 |
} |
} |
|
protected void supprimerChaineDenormaliseParPosition(String champ, int position) { |
String chaineExistante = renvoyerValeurCorrecte(champ); |
if (!chaineExistante.equals("")) { |
String[] valeurs = chaineExistante.split(";;"); |
HashMap<String,String> valeursModifiees = new HashMap<String,String>(); |
if (valeurs.length >= position) { |
for (int i = 0; i < valeurs.length; i++) { |
if (i != (position - 1)) { |
valeursModifiees.put(""+i, valeurs[i]); |
} |
} |
String[] tableauValeursModifiees = valeursModifiees.values().toArray(new String[valeursModifiees.size()]); |
this.set(champ, UtilArray.implode(tableauValeursModifiees, ";;")); |
} |
} |
} |
|
public String getDateModification() { |
return (String) renvoyerValeurCorrecte("cmhl_date_modification"); |
} |