diff --git a/html/js/acc_currency.js b/html/js/acc_currency.js
index 5c6d238d1..1b2b9735d 100644
--- a/html/js/acc_currency.js
+++ b/html/js/acc_currency.js
@@ -45,7 +45,7 @@ function CurrencyRateDelete(p_dossier, p_id)
if ( answer['status'] == 'NOK') {
smoke.alert(answer['content']);
} else {
- $('currency_rate_'+p_id).hide();
+ id$('currency_rate_'+p_id).hide();
alternate_row_color("currency_rate_table");
}
}
@@ -64,11 +64,11 @@ function CurrencyUpdateValue(p_dossier,p_code,p_update)
new Ajax.Request("ajax_misc.php",{
method:"get",
asynchronous:false,
- parameters:{p_code:$(p_code).value,gDossier:p_dossier,op:'CurrencyRate'},
+ parameters:{p_code:id$(p_code).value,gDossier:p_dossier,op:'CurrencyRate'},
onSuccess:function (req) {
var answer=req.responseText.evalJSON();
if ( answer.status == "OK") {
- $(p_update).value=answer.content;
+ id$(p_update).value=answer.content;
} else {
smoke.alert(answer.content);
}
@@ -84,11 +84,11 @@ function CurrencyUpdateCode(p_dossier,p_code,p_update)
{
new Ajax.Request("ajax_misc.php",{
method:"get",
- parameters:{p_code:$(p_code).value,gDossier:p_dossier,op:'CurrencyCode'},
+ parameters:{p_code:id$(p_code).value,gDossier:p_dossier,op:'CurrencyCode'},
onSuccess:function (req) {
var answer=req.responseText.evalJSON();
if ( answer.status == "OK") {
- $(p_update).innerHTML=answer.content;
+ id$(p_update).innerHTML=answer.content;
} else {
smoke.alert(answer.content);
}
@@ -104,22 +104,22 @@ function CurrencyCompute(p_rate,p_update)
{
var tvac=1;
- if ($('tvac')) {
- tvac=$('tvac').innerHTML;
- } else if ($("htva")) {
- tvac=$('htva').innerHTML;
+ if (id$('tvac')) {
+ tvac=id$('tvac').innerHTML;
+ } else if (id$("htva")) {
+ tvac=id$('htva').innerHTML;
}
if ( isNaN(tvac)) {
tvac=1;
}
- var rate=$(p_rate).value;
+ var rate=id$(p_rate).value;
if ( isNaN(rate)) {
rate=1;
}
var tot=tvac/rate;
tot=Math.round(tot*100)/100;
- $(p_update).innerHTML=tot;
+ id$(p_update).innerHTML=tot;
}
/**
@@ -131,8 +131,8 @@ function CurrencyCompute(p_rate,p_update)
*/
function CurrencyComputeMisc(p_rate,p_update)
{
- var debAmount=$('totalDeb').innerHTML;
- var credAmount=$('totalCred').innerHTML;
+ var debAmount=id$('totalDeb').innerHTML;
+ var credAmount=id$('totalCred').innerHTML;
if ( isNaN(debAmount)) {
debAmount=0;
@@ -140,17 +140,17 @@ function CurrencyComputeMisc(p_rate,p_update)
if ( isNaN(credAmount)) {
credAmount=0;
}
- var rate=$(p_rate).value;
+ var rate=id$(p_rate).value;
if ( isNaN(rate) || parseFloat(rate) == 0) {
rate=1;
}
var totDeb=debAmount/rate;
totDeb=Math.round(totDeb*100)/100;
- $('default_currency_deb').innerHTML=totDeb;
+ id$('default_currency_deb').innerHTML=totDeb;
var totCred=credAmount/rate;
totCred=Math.round(totCred*100)/100;
- $('default_currency_cred').innerHTML=totCred;
+ id$('default_currency_cred').innerHTML=totCred;
}
@@ -166,10 +166,10 @@ function CurrencyComputeMisc(p_rate,p_update)
function LedgerCurrencyUpdate(p_dossier,p_code,p_update,p_rate,p_eur_amount)
{
// Hide or show the row of the table with the amount in EUR
- if ($(p_code).value != 0) {
- $('row_currency').show();
+ if (id$(p_code).value != 0) {
+ id$('row_currency').show();
}else {
- $('row_currency').hide();
+ id$('row_currency').hide();
}
CurrencyUpdateValue(p_dossier,p_code,p_rate);
CurrencyUpdateCode(p_dossier,p_code,p_update);
@@ -189,10 +189,10 @@ function LedgerCurrencyUpdate(p_dossier,p_code,p_update,p_rate,p_eur_amount)
function LedgerCurrencyUpdateMisc(p_dossier,p_code,p_update,p_rate,p_eur_amount)
{
// Hide or show the row of the table with the amount in EUR (= default currency)
- if ($(p_code).value != -1) {
- $('row_currency').show();
+ if (id$(p_code).value != -1) {
+ id$('row_currency').show();
}else {
- $('row_currency').hide();
+ id$('row_currency').hide();
}
CurrencyUpdateValue(p_dossier,p_code,p_rate);
CurrencyUpdateCode(p_dossier,p_code,p_update);
diff --git a/html/js/acc_ledger.js b/html/js/acc_ledger.js
index c4891fa53..3fbb3671d 100644
--- a/html/js/acc_ledger.js
+++ b/html/js/acc_ledger.js
@@ -32,10 +32,10 @@ var layer = 1;
* \brief update the list of available predefined operation when we change the ledger.
*/
function update_predef(p_type, p_direct, p_ac) {
- var jrn = g("p_jrn").value;
- var dossier = g("gDossier").value;
+ var jrn = id$("p_jrn").value;
+ var dossier = id$("gDossier").value;
var querystring = 'gDossier=' + dossier + '&l=' + jrn + '&t=' + p_type + '&d=' + p_direct + "&op=up_predef&ac=" + p_ac;
- g("p_jrn_predef").value = jrn;
+ id$("p_jrn_predef").value = jrn;
var action = new Ajax.Request(
"ajax_misc.php",
{
@@ -44,7 +44,7 @@ function update_predef(p_type, p_direct, p_ac) {
onFailure: error_get_predef,
onSuccess: function (req) {
try {
- $('info_div').innerHTML = "ok";
+ id$('info_div').innerHTML = "ok";
var answer = req.responseXML;
var a = answer.getElementsByTagName('code');
var html = answer.getElementsByTagName('value');
@@ -55,9 +55,9 @@ function update_predef(p_type, p_direct, p_ac) {
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
// document.getElementsByName(name_ctl)[0].value = code_html;
- $('modele_op_div').innerHTML = code_html;
+ id$('modele_op_div').innerHTML = code_html;
} catch (e) {
- $('info_div').innerHTML = e.message;
+ id$('info_div').innerHTML = e.message;
}
}
}
@@ -69,8 +69,8 @@ function update_predef(p_type, p_direct, p_ac) {
*/
function update_pay_method() {
waiting_box();
- var jrn = g("p_jrn").value;
- var dossier = g("gDossier").value;
+ var jrn = id$("p_jrn").value;
+ var dossier = id$("gDossier").value;
var querystring = 'gDossier=' + dossier + '&l=' + jrn + "&op=up_pay_method";
var action = new Ajax.Request(
"ajax_misc.php",
@@ -81,7 +81,7 @@ function update_pay_method() {
onSuccess: function (req) {
remove_waiting_box();
var answer = req.responseText;
- $('payment').innerHTML = answer;
+ id$('payment').innerHTML = answer;
}
}
);
@@ -92,8 +92,8 @@ function update_pay_method() {
*/
function update_other_tax() {
waiting_box();
- var jrn = g("p_jrn").value;
- var dossier = g("gDossier").value;
+ var jrn = id$("p_jrn").value;
+ var dossier = id$("gDossier").value;
var querystring = {gDossier: dossier, jrn_id: jrn, op: "up_other_tax"};
var action = new Ajax.Request(
"ajax_misc.php",
@@ -105,7 +105,7 @@ function update_other_tax() {
remove_waiting_box();
var answer = req.responseText;
answer.evalScripts();
- $('additional_tax_div').innerHTML = answer;
+ id$('additional_tax_div').innerHTML = answer;
}
}
);
@@ -115,8 +115,8 @@ function update_other_tax() {
* update ctl id =jrn_name with the value of p_jrn
*/
function update_name() {
- var jrn_id = $('p_jrn').value;
- var dossier = g("gDossier").value;
+ var jrn_id = id$('p_jrn').value;
+ var dossier = id$("gDossier").value;
var querystring = 'gDossier=' + dossier + '&l=' + jrn_id + "&op=ledger_description";
var action = new Ajax.Request(
"ajax_misc.php",
@@ -125,7 +125,7 @@ function update_name() {
parameters: querystring,
onFailure: error_get_pj,
onSuccess: function (req) {
- $('jrn_name_div').innerHTML = req.responseText;
+ id$('jrn_name_div').innerHTML = req.responseText;
}
}
);
@@ -144,8 +144,8 @@ function error_get_predef(request, json) {
* update the list of available predefined operation when we change the ledger.
*/
function update_pj() {
- var jrn = g("p_jrn").value;
- var dossier = g("gDossier").value;
+ var jrn = id$("p_jrn").value;
+ var dossier = id$("gDossier").value;
var querystring = 'gDossier=' + dossier + '&l=' + jrn + "&op=upd_receipt";
var action = new Ajax.Request(
"ajax_misc.php",
@@ -162,8 +162,8 @@ function update_pj() {
* ask the name, quick_code of the bank for the ledger
*/
function update_bank() {
- var jrn = g('p_jrn').value;
- var dossier = g('gDossier').value;
+ var jrn = id$('p_jrn').value;
+ var dossier = id$('gDossier').value;
var qs = 'gDossier=' + dossier + '&op=bkname&p_jrn=' + jrn;
var action = new Ajax.Request(
"ajax_misc.php",
@@ -186,10 +186,10 @@ function update_row(ctl) {
if (ctl === 'quick_item') {
row_to_keep = 1;
} /* for ODS , only 1 rows to keep */
- var jrn = g('p_jrn').value;
- var dossier = g('gDossier').value;
+ var jrn = id$('p_jrn').value;
+ var dossier = id$('gDossier').value;
var qs = encodeURI('gDossier=' + dossier + '&op=minrow&j=' + jrn + '&ctl=' + ctl);
- var current_row = parseFloat($('nb_item').value);
+ var current_row = parseFloat(id$('nb_item').value);
var action = new Ajax.Request(
"ajax_misc.php",
{
@@ -201,11 +201,11 @@ function update_row(ctl) {
var answer = request.responseText.evalJSON(true);
var row = parseFloat(answer.row);
- var table_to_update = $(ctl);
+ var table_to_update = id$(ctl);
if (current_row > row) {
// Too many row, we always must keep 2 rows for the sum
- var delta = $('nb_item').value - row;
- var idx = $('nb_item').value;
+ var delta = id$('nb_item').value - row;
+ var idx = id$('nb_item').value;
for (var i = 0; i < delta; i++) {
var pos_row = table_to_update.rows.length;
var cell0 = table_to_update.rows[pos_row - row_to_keep].cells[0];
@@ -239,7 +239,7 @@ function update_row(ctl) {
}
}
- $('nb_item').value = table_to_update.rows.length - row_to_keep;
+ id$('nb_item').value = table_to_update.rows.length - row_to_keep;
}
if (current_row < row) {
// We need to add rows
@@ -271,8 +271,8 @@ function update_row(ctl) {
* @brief hide or show the column quantity
*/
function update_visibility_quantity() {
- var jrn = g("p_jrn").value;
- var dossier = g("gDossier").value;
+ var jrn = id$("p_jrn").value;
+ var dossier = id$("gDossier").value;
var querystring = 'gDossier=' + dossier + '&l=' + jrn + "&op=update_visibility_quantity";
var action = new Ajax.Request(
"ajax_misc.php",
@@ -321,7 +321,7 @@ function success_update_bank(req) {
var name_ctl = a[0].firstChild.nodeValue;
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
- $(name_ctl).innerHTML = code_html;
+ id$(name_ctl).innerHTML = code_html;
} catch (e) {
alert_box("success_update_bank" + e.message);
}
@@ -331,8 +331,8 @@ function success_update_bank(req) {
* call ajax, ask what is the last date for the current ledger
*/
function get_last_date() {
- var jrn = g('p_jrn').value;
- var dossier = g('gDossier').value;
+ var jrn = id$('p_jrn').value;
+ var dossier = id$('gDossier').value;
var qs = 'gDossier=' + dossier + '&op=lastdate&p_jrn=' + jrn;
var action = new Ajax.Request(
"ajax_misc.php",
@@ -372,12 +372,12 @@ function success_get_last_date(req) {
function success_get_pj(request, json) {
var answer = request.responseText.evalJSON(true);
- var obj = g("e_pj");
+ var obj = id$("e_pj");
obj.value = '';
if (answer.length == 0)
return;
obj.value = answer.pj;
- g("e_pj_suggest").value = answer.pj;
+ id$("e_pj_suggest").value = answer.pj;
}
/**
@@ -392,10 +392,10 @@ function error_get_pj(request, json) {
*/
function ledger_fin_add_row() {
var style = 'class="input_text"';
- var mytable = g("fin_item").tBodies[0];
+ var mytable = id$("fin_item").tBodies[0];
var line = mytable.rows.length;
var row = mytable.insertRow(line);
- var nb = g("nb_item");
+ var nb = id$("nb_item");
var rowToCopy = mytable.rows[1];
var nNumberCell = rowToCopy.cells.length;
for (var e = 0; e < nNumberCell; e++) {
@@ -415,15 +415,15 @@ function ledger_fin_add_row() {
newCell.className = rowToCopy.cells[e].className;
new_tt.evalScripts();
}
- g("e_other" + nb.value).value = "";
- g("e_other_name" + nb.value).value = "";
- g("e_other" + nb.value + '_amount').value = "0";
- g("e_other" + nb.value + '_comment').value = "";
- g("e_concerned" + nb.value).value = "";
+ id$("e_other" + nb.value).value = "";
+ id$("e_other_name" + nb.value).value = "";
+ id$("e_other" + nb.value + '_amount').value = "0";
+ id$("e_other" + nb.value + '_comment').value = "";
+ id$("e_concerned" + nb.value).value = "";
- var ch = $('chdate').options[$('chdate').selectedIndex].value;
+ var ch = id$('chdate').options[id$('chdate').selectedIndex].value;
if (ch == 1) {
- $('tdchdate' + nb.value).hide();
+ id$('tdchdate' + nb.value).hide();
}
nb.value++;
}
@@ -433,11 +433,11 @@ function ledger_fin_add_row() {
* @param string p_elid is the id of element with the number of rows to add, and p_elid+"_ledger" is the type of ledger : M : Misc Operation O : Sales or purchase and F for financial
*/
function ledger_add_multiple(p_elid) {
- var nbrow = $(p_elid).value;
+ var nbrow = id$(p_elid).value;
if (nbrow == NaN) {
nbrow = 1;
}
- var type_ledger = $(p_elid + "_ledger").value;
+ var type_ledger = id$(p_elid + "_ledger").value;
var i = 0;
for (i = 0; i < nbrow; i++) {
if (type_ledger == 'O') {
@@ -464,12 +464,12 @@ function ledger_add_multiple(p_elid) {
function ledger_add_row() {
try {
style = 'class="input_text"';
- var mytable = g("sold_item").tBodies[0];
+ var mytable = id$("sold_item").tBodies[0];
var ofirstRow = mytable.rows[1];
var line = mytable.rows.length;
var nCell = mytable.rows[1].cells.length;
var row = mytable.insertRow(line);
- var nb = g("nb_item");
+ var nb = id$("nb_item");
for (var e = 0; e < nCell; e++) {
var newCell = row.insertCell(e);
var tt = ofirstRow.cells[e].innerHTML;
@@ -483,13 +483,13 @@ function ledger_add_row() {
new_tt.evalScripts();
}
- $("e_march" + nb.value + "_label").innerHTML = '';
- $("e_march" + nb.value + "_label").value = '';
- $("e_march" + nb.value + "_price").value = '0';
- $("e_march" + nb.value).value = "";
- $("e_quant" + nb.value).value = "1";
- if ($("e_march" + nb.value + "_tva_amount"))
- $("e_march" + nb.value + "_tva_amount").value = 0;
+ id$("e_march" + nb.value + "_label").innerHTML = '';
+ id$("e_march" + nb.value + "_label").value = '';
+ id$("e_march" + nb.value + "_price").value = '0';
+ id$("e_march" + nb.value).value = "";
+ id$("e_quant" + nb.value).value = "1";
+ if (id$("e_march" + nb.value + "_tva_amount"))
+ id$("e_march" + nb.value + "_tva_amount").value = 0;
nb.value++;
@@ -505,17 +505,17 @@ function ledger_add_row() {
* @param the number of the changed ctrl
*/
function compute_ledger(p_ctl_nb) {
- var dossier = g("gDossier").value;
+ var dossier = id$("gDossier").value;
var a = -1;
if (document.getElementById("e_march" + p_ctl_nb + '_tva_amount')) {
- a = trim(g("e_march" + p_ctl_nb + '_tva_amount').value);
- g("e_march" + p_ctl_nb + '_tva_amount').value = a;
+ a = trim(id$("e_march" + p_ctl_nb + '_tva_amount').value);
+ id$("e_march" + p_ctl_nb + '_tva_amount').value = a;
}
if (!document.getElementById("e_march" + p_ctl_nb)) {
return;
}
- g("e_march" + p_ctl_nb).value = trim(g("e_march" + p_ctl_nb).value);
- var qcode = g("e_march" + p_ctl_nb).value;
+ id$("e_march" + p_ctl_nb).value = trim(id$("e_march" + p_ctl_nb).value);
+ var qcode = id$("e_march" + p_ctl_nb).value;
if (qcode.length == 0) {
clean_ledger(p_ctl_nb);
@@ -526,19 +526,19 @@ function compute_ledger(p_ctl_nb) {
* if tva_id is empty send a value of -1
*/
var tva_id = -1;
- if (g('e_march' + p_ctl_nb + '_tva_id')) {
- tva_id = g('e_march' + p_ctl_nb + '_tva_id').value;
+ if (id$('e_march' + p_ctl_nb + '_tva_id')) {
+ tva_id = id$('e_march' + p_ctl_nb + '_tva_id').value;
if (trim(tva_id) == '') {
tva_id = -1;
}
}
- g('e_march' + p_ctl_nb + '_price').value = trim(g('e_march' + p_ctl_nb + '_price').value);
- var price = g('e_march' + p_ctl_nb + '_price').value;
+ id$('e_march' + p_ctl_nb + '_price').value = trim(id$('e_march' + p_ctl_nb + '_price').value);
+ var price = id$('e_march' + p_ctl_nb + '_price').value;
- g('e_quant' + p_ctl_nb).value = trim(g('e_quant' + p_ctl_nb).value);
- var quantity = g('e_quant' + p_ctl_nb).value;
- let other_tax = g("other_tax");
+ id$('e_quant' + p_ctl_nb).value = trim(id$('e_quant' + p_ctl_nb).value);
+ var quantity = id$('e_quant' + p_ctl_nb).value;
+ let other_tax = id$("other_tax");
let other_tax_id = (other_tax && other_tax.checked) ? other_tax.value : -1;
var querystring = {
@@ -569,26 +569,26 @@ function refresh_ledger() {
var htva = 0;
var tvac = 0;
- nb_item = g("nb_item").value;
+ nb_item = id$("nb_item").value;
for (var i = 0; i < nb_item; i++) {
- if (g('tva_march' + i))
- tva += g('tva_march' + i).value * 1;
- if (g('htva_march' + i))
- htva += g('htva_march' + i).value * 1;
- if (g('tvac_march' + i))
- tvac += g('tvac_march' + i).value * 1;
+ if (id$('tva_march' + i))
+ tva += id$('tva_march' + i).value * 1;
+ if (id$('htva_march' + i))
+ htva += id$('htva_march' + i).value * 1;
+ if (id$('tvac_march' + i))
+ tvac += id$('tvac_march' + i).value * 1;
}
- id_tva = g("tva");
- id_htva = g("htva");
- id_tvac = g("tvac");
- id_other_tax = g("other_tax_amount");
+ id_tva = id$("tva");
+ id_htva = id$("htva");
+ id_tvac = id$("tvac");
+ id_other_tax = id$("other_tax_amount");
if (id_tva)
id_tva.innerHTML = Math.round(tva * 100) / 100;
if (id_htva)
id_htva.innerHTML = Math.round(htva * 100) / 100;
if (id_other_tax) {
let total_operation = tvac + parseFloat(id_other_tax.value);
- $('total_operation_other_tax').innerHTML = Math.round(total_operation * 100) / 100;
+ id$('total_operation_other_tax').innerHTML = Math.round(total_operation * 100) / 100;
}
if (id_tvac)
id_tvac.innerHTML = Math.round(tvac * 100) / 100;
@@ -607,15 +607,15 @@ function success_compute_ledger(request, json) {
var rtva = answer.tva;
var rhtva = answer.htva;
var rtvac = answer.tvac;
- let other_tax = g("other_tax_amount")
+ let other_tax = id$("other_tax_amount")
if (other_tax) {
other_tax.value = answer.other_tax;
}
if (rtva == 'NA') {
var rhtva = answer.htva * 1;
- g('htva_march' + ctl).value = rhtva;
- g('tvac_march' + ctl).value = rtvac;
- g('sum').show();
+ id$('htva_march' + ctl).value = rhtva;
+ id$('tvac_march' + ctl).value = rtvac;
+ id$('sum').show();
refresh_ledger();
CurrencyCompute('p_currency_rate', 'p_currency_euro');
@@ -624,17 +624,17 @@ function success_compute_ledger(request, json) {
rtva = answer.tva * 1;
- g('sum').show();
- if (g('e_march' + ctl + '_tva_amount').value == "" || g('e_march' + ctl + '_tva_amount').value == 0) {
- g('tva_march' + ctl).value = rtva;
- g('e_march' + ctl + '_tva_amount').value = rtva;
+ id$('sum').show();
+ if (id$('e_march' + ctl + '_tva_amount').value == "" || id$('e_march' + ctl + '_tva_amount').value == 0) {
+ id$('tva_march' + ctl).value = rtva;
+ id$('e_march' + ctl + '_tva_amount').value = rtva;
} else {
- g('tva_march' + ctl).value = g('e_march' + ctl + '_tva_amount').value;
+ id$('tva_march' + ctl).value = id$('e_march' + ctl + '_tva_amount').value;
}
- g('htva_march' + ctl).value = Math.round(parseFloat(rhtva) * 100) / 100;
- var tmp1 = Math.round(parseFloat(g('htva_march' + ctl).value) * 100) / 100;
- var tmp2 = Math.round(parseFloat(g('tva_march' + ctl).value) * 100) / 100;
- g('tvac_march' + ctl).value = Math.round((tmp1 + tmp2) * 100) / 100;
+ id$('htva_march' + ctl).value = Math.round(parseFloat(rhtva) * 100) / 100;
+ var tmp1 = Math.round(parseFloat(id$('htva_march' + ctl).value) * 100) / 100;
+ var tmp2 = Math.round(parseFloat(id$('tva_march' + ctl).value) * 100) / 100;
+ id$('tvac_march' + ctl).value = Math.round((tmp1 + tmp2) * 100) / 100;
refresh_ledger();
CurrencyCompute('p_currency_rate', 'p_currency_euro');
@@ -649,7 +649,7 @@ function error_compute_ledger(request, json) {
function compute_all_ledger() {
var loop = 0;
- let nb_item = g("nb_item").value;
+ let nb_item = id$("nb_item").value;
for (loop = 0; loop < nb_item; loop++) {
compute_ledger(loop);
}
@@ -658,53 +658,53 @@ function compute_all_ledger() {
var tvac = 0;
for (var i = 0; i < nb_item; i++) {
- if (g('tva_march'))
- tva += g('tva_march' + i).value * 1;
- if (g('htva_march' + i))
- htva += g('htva_march' + i).value * 1;
- if (g('tvac_march' + i))
- tvac += g('tvac_march' + i).value * 1;
+ if (id$('tva_march'))
+ tva += id$('tva_march' + i).value * 1;
+ if (id$('htva_march' + i))
+ htva += id$('htva_march' + i).value * 1;
+ if (id$('tvac_march' + i))
+ tvac += id$('tvac_march' + i).value * 1;
}
- id_other_tax = g("other_tax_amount");
- if (g('tva'))
- g('tva').innerHTML = Math.round(tva * 100) / 100;
- if (g('htva'))
- g('htva').innerHTML = Math.round(htva * 100) / 100;
+ id_other_tax = id$("other_tax_amount");
+ if (id$('tva'))
+ id$('tva').innerHTML = Math.round(tva * 100) / 100;
+ if (id$('htva'))
+ id$('htva').innerHTML = Math.round(htva * 100) / 100;
if (id_other_tax) {
tvac += id_other_tax.value;
}
- if (g('tvac'))
- g('tvac').innerHTML = Math.round(tvac * 100) / 100;
+ if (id$('tvac'))
+ id$('tvac').innerHTML = Math.round(tvac * 100) / 100;
}
function clean_tva(p_ctl) {
- if (g('e_march' + p_ctl + '_tva_amount'))
- g('e_march' + p_ctl + '_tva_amount').value = 0;
+ if (id$('e_march' + p_ctl + '_tva_amount'))
+ id$('e_march' + p_ctl + '_tva_amount').value = 0;
}
function clean_ledger(p_ctl_nb) {
- if (g("e_march" + p_ctl_nb)) {
- g("e_march" + p_ctl_nb).value = trim(g("e_march" + p_ctl_nb).value);
+ if (id$("e_march" + p_ctl_nb)) {
+ id$("e_march" + p_ctl_nb).value = trim(id$("e_march" + p_ctl_nb).value);
}
- if (g('e_march' + p_ctl_nb + '_price')) {
- g('e_march' + p_ctl_nb + '_price').value = '';
+ if (id$('e_march' + p_ctl_nb + '_price')) {
+ id$('e_march' + p_ctl_nb + '_price').value = '';
}
- if (g('e_quant' + p_ctl_nb)) {
- g('e_quant' + p_ctl_nb).value = '1';
+ if (id$('e_quant' + p_ctl_nb)) {
+ id$('e_quant' + p_ctl_nb).value = '1';
}
- if (g('tva_march' + p_ctl_nb + '_show')) {
- g('tva_march' + p_ctl_nb + '_show').value = '0';
+ if (id$('tva_march' + p_ctl_nb + '_show')) {
+ id$('tva_march' + p_ctl_nb + '_show').value = '0';
}
- if (g('tva_march' + p_ctl_nb)) {
- g('tva_march' + p_ctl_nb).value = 0;
+ if (id$('tva_march' + p_ctl_nb)) {
+ id$('tva_march' + p_ctl_nb).value = 0;
}
- if (g('htva_march' + p_ctl_nb)) {
- g('htva_march' + p_ctl_nb).value = 0;
+ if (id$('htva_march' + p_ctl_nb)) {
+ id$('htva_march' + p_ctl_nb).value = 0;
}
- if (g('tvac_march' + p_ctl_nb)) {
- g('tvac_march' + p_ctl_nb).value = 0;
+ if (id$('tvac_march' + p_ctl_nb)) {
+ id$('tvac_march' + p_ctl_nb).value = 0;
}
}
@@ -714,12 +714,12 @@ function clean_ledger(p_ctl_nb) {
*/
function quick_writing_add_row() {
style = 'class="input_text"';
- var mytable = g("quick_item").tBodies[0];
+ var mytable = id$("quick_item").tBodies[0];
var nNumberRow = mytable.rows.length;
var oRow = mytable.insertRow(nNumberRow);
var rowToCopy = mytable.rows[1];
var nNumberCell = rowToCopy.cells.length;
- var nb = g("nb_item");
+ var nb = id$("nb_item");
var oNewRow = mytable.insertRow(nNumberRow);
for (var e = 0; e < nNumberCell; e++) {
@@ -735,17 +735,17 @@ function quick_writing_add_row() {
new_tt.evalScripts();
}
- var ck = $('ck' + nb.value);
+ var ck = id$('ck' + nb.value);
ck.addEventListener('click', function (event) {
display_range_dcside(event, ck);
display_dcside(ck);
});
- $("qc_" + nb.value).value = "";
- $("amount" + nb.value).value = "";
- $("poste" + nb.value).value = "";
- $("ld" + nb.value).value = "";
+ id$("qc_" + nb.value).value = "";
+ id$("amount" + nb.value).value = "";
+ id$("poste" + nb.value).value = "";
+ id$("ld" + nb.value).value = "";
nb.value++;
@@ -805,7 +805,7 @@ function view_history_account(p_value, dossier, p_exercice) {
add_div(popup);
success_box(req, xml);
- $(idbox).style.top = calcy(140 + (layer * 3)) + "px";
+ id$(idbox).style.top = calcy(140 + (layer * 3)) + "px";
}
}
);
@@ -845,8 +845,8 @@ function view_history_anc_account(p_value, dossier, p_exercice) {
if (req.responseText === 'NOCONX') { reconnect();return;}
add_div(popup);
- $(idbox).innerHTML = req.responseText;
- $(idbox).style.top = calcy(140 + (layer * 3)) + "px";
+ id$(idbox).innerHTML = req.responseText;
+ id$(idbox).style.top = calcy(140 + (layer * 3)) + "px";
}
}
);
@@ -881,7 +881,7 @@ function update_history_account(obj) {
if (req.responseText === 'NOCONX') { reconnect();return;}
success_box(req, xml);
- g(obj.div).style.top = calcy(140 + (layer * 3)) + "px";
+ id$(obj.div).style.top = calcy(140 + (layer * 3)) + "px";
}
});
} catch (e) {
@@ -925,7 +925,7 @@ function view_history_card(p_value, dossier, p_exercice) {
add_div(popup);
success_box(req, xml);
- g(idbox).style.top = calcy(140 + (layer * 3)) + "px";
+ id$(idbox).style.top = calcy(140 + (layer * 3)) + "px";
}
}
);
@@ -962,8 +962,8 @@ function view_followup_card(p_value, dossier) {
if (req.responseText === 'NOCONX') { reconnect();return;}
add_div(popup);
- $(idbox).update(req.responseText);
- g(idbox).style.top = calcy(140 + (layer * 3)) + "px";
+ id$(idbox).update(req.responseText);
+ id$(idbox).style.top = calcy(140 + (layer * 3)) + "px";
}
}
);
@@ -997,7 +997,7 @@ function update_history_card(obj) {
remove_waiting_box();
success_box(req, xml);
- g(obj.div).style.top = calcy(140 + (layer * 3)) + "px";
+ id$(obj.div).style.top = calcy(140 + (layer * 3)) + "px";
}
});
} catch (e) {
@@ -1039,8 +1039,8 @@ function removeOperation(p_jr_id, dossier, div) {
*@param pointer to the FORM
*/
function reverseOperation(obj) {
- var qs = $(obj).serialize() + "&op=ledger";
- g('ext' + obj.divname).style.display = 'none';
+ var qs = id$(obj).serialize() + "&op=ledger";
+ id$('ext' + obj.divname).style.display = 'none';
waiting_box();
new Ajax.Request(
"ajax_misc.php",
@@ -1112,8 +1112,8 @@ function modifyOperation(p_value, dossier) {
remove_waiting_box();
add_div(popup);
success_box(xml, txt);
- $(id_div).style.position = "absolute";
- $(id_div).style.top = calcy(100 + (layer * 3)) + "px";
+ id$(id_div).style.position = "absolute";
+ id$(id_div).style.top = calcy(100 + (layer * 3)) + "px";
}
}
);
@@ -1154,9 +1154,9 @@ function dropLink(p_dossier, p_div, p_jr_id, p_jr_id2) {
*@see ICard::input
*/
function filter_card(obj, queryString) {
- jrn = $('p_jrn').value;
+ jrn = id$('p_jrn').value;
if (jrn == -1) {
- type = $('ledger_type').value;
+ type = id$('ledger_type').value;
queryString = queryString + '&type=' + type;
} else {
queryString = queryString + '&j=' + jrn;
@@ -1182,10 +1182,10 @@ function dsp_letter(obj) {
onSuccess: success_dsp_letter
}
);
- g('search').style.display = 'none';
- g('list').style.display = 'none';
- $('detail').innerHTML = loading();
- g('detail').style.display = 'block';
+ id$('search').style.display = 'none';
+ id$('list').style.display = 'none';
+ id$('detail').innerHTML = loading();
+ id$('detail').style.display = 'block';
} catch (e) {
alert_box('dsp_letter failed ' + e.message);
}
@@ -1203,7 +1203,7 @@ function success_dsp_letter(req) {
var name_ctl = a[0].firstChild.nodeValue;
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
- $('detail').innerHTML = code_html;
+ id$('detail').innerHTML = code_html;
} catch (e) {
alert_box(e.message);
}
@@ -1251,10 +1251,10 @@ function search_letter(obj) {
onSuccess: success_dsp_letter
}
);
- $('list').hide();
- $('search').hide();
- $('detail').innerHTML = loading();
- $('detail').show();
+ id$('list').hide();
+ id$('search').hide();
+ id$('detail').innerHTML = loading();
+ id$('detail').show();
} catch (e) {
alert_box('search_letter ' + e.message);
}
@@ -1268,10 +1268,10 @@ function search_letter(obj) {
*/
function op_save(obj) {
try {
- var queryString = $(obj).serialize(true);
+ var queryString = id$(obj).serialize(true);
queryString ["gDossier"] = obj.gDossier.value;
var rapt2 = "rapt" + obj.whatdiv.value;
- queryString ["rapt"] = g(rapt2).value;
+ queryString ["rapt"] = id$(rapt2).value;
queryString ["jr_id"] = obj.jr_id.value;
var jr_id = obj.jr_id.value;
queryString ["div"] = obj.whatdiv.value;
@@ -1283,7 +1283,7 @@ function op_save(obj) {
/*
* Operation detail is in a new window
*/
- if (g('inpopup')) {
+ if (id$('inpopup')) {
var action = new Ajax.Request('ajax_misc.php',
{
method: 'post',
@@ -1327,8 +1327,8 @@ function op_save(obj) {
try {
var answer = xml.responseXML;
var html = answer.getElementsByTagName('code');
- $(divid).innerHTML = unescape(getNodeText(html[0]));
- $(divid).innerHTML.evalScripts();
+ id$(divid).innerHTML = unescape(getNodeText(html[0]));
+ id$(divid).innerHTML.evalScripts();
remove_waiting_box();
} catch (e) {
console.error("D1. op_save")
@@ -1348,8 +1348,8 @@ function op_save(obj) {
}
function get_history_account(ctl, dossier) {
- if ($(ctl).value != '') {
- view_history_account($(ctl).value, dossier);
+ if (id$(ctl).value != '') {
+ view_history_account(id$(ctl).value, dossier);
}
}
@@ -1398,12 +1398,12 @@ function show_reconcile(p_div, p_let) {
function gestion_add_row() {
try {
style = 'class="input_text"';
- var mytable = g("art").tBodies[0];
+ var mytable = id$("art").tBodies[0];
var ofirstRow = mytable.rows[1];
var line = mytable.rows.length;
var nCell = mytable.rows[1].cells.length;
var row = mytable.insertRow(line);
- var nb = g("nb_item");
+ var nb = id$("nb_item");
for (var e = 0; e < nCell; e++) {
var newCell = row.insertCell(e);
var tt = ofirstRow.cells[e].innerHTML;
@@ -1421,14 +1421,14 @@ function gestion_add_row() {
new_tt.evalScripts();
}
- g("e_march" + nb.value + "_label").innerHTML = ' ';
- g("e_march" + nb.value + "_label").value = '';
- g("e_march" + nb.value + "_price").value = '0';
- g("e_march" + nb.value).value = "";
- g("e_quant" + nb.value).value = "1";
- g('tvac_march' + nb.value).value = "0";
- if ($("e_march" + nb.value + "_tva_amount"))
- g("e_march" + nb.value + "_tva_amount").value = 0;
+ id$("e_march" + nb.value + "_label").innerHTML = ' ';
+ id$("e_march" + nb.value + "_label").value = '';
+ id$("e_march" + nb.value + "_price").value = '0';
+ id$("e_march" + nb.value).value = "";
+ id$("e_quant" + nb.value).value = "1";
+ id$('tvac_march' + nb.value).value = "0";
+ if (id$("e_march" + nb.value + "_tva_amount"))
+ id$("e_march" + nb.value + "_tva_amount").value = 0;
nb.value++;
@@ -1446,7 +1446,7 @@ function document_remove(p_dossier, p_div, p_jrid) {
{
parameters: {"op": "ledger", "gDossier": p_dossier, "div": p_div, "p_jrid": p_jrid, 'act': 'rmf'},
onSuccess: function (x) {
- $('receipt' + p_div).innerHTML = x.responseText;
+ id$('receipt' + p_div).innerHTML = x.responseText;
}
})
}
@@ -1481,7 +1481,7 @@ function manage_search_filter(p_obj) {
'style': 'top:' + y + 'px;left:' + x + 'px;position:absolute;width:400px',
drag: 1
});
- $('boxfilter' + p_obj.div).show();
+ id$('boxfilter' + p_obj.div).show();
}
});
}
@@ -1503,11 +1503,11 @@ function save_filter(p_div, p_dossier) {
eltValue['gDossier'] = p_dossier;
eltValue['op'] = "save_filter";
eltValue['div'] = p_div;
- eltValue['filter_name'] = $(p_div + "filter_new").value;
+ eltValue['filter_name'] = id$(p_div + "filter_new").value;
// Get all elt from the form
for (var i = 0; i < elt.length; i++) {
var idx = elt[i];
- eltValue[idx] = $(p_div + elt[i]).value;
+ eltValue[idx] = id$(p_div + elt[i]).value;
}
if (eltValue['amount_min'] == "") eltValue["amount_min"] = 0;
@@ -1518,7 +1518,7 @@ function save_filter(p_div, p_dossier) {
eltValue['r_jrn'] = [];
for (i = 0; i < eltValue['nb_jrn']; i++) {
var idx = p_div + 'r_jrn[' + i + ']';
- eltValue['r_jrn' + i] = $(idx).value
+ eltValue['r_jrn' + i] = id$(idx).value
}
}
@@ -1539,8 +1539,8 @@ function save_filter(p_div, p_dossier) {
var new_item = document.createElement('li');
new_item.innerHTML = answer.filter_name;
new_item.setAttribute("id", "manageli" + p_div + "_" + answer.filter_id);
- $('manage' + p_div).appendChild(new_item);
- $(p_div + "filter_new").value = "";
+ id$('manage' + p_div).appendChild(new_item);
+ id$(p_div + "filter_new").value = "";
} else {
throw answer.message;
}
@@ -1570,10 +1570,10 @@ function load_filter(p_div, p_dossier, p_filter_id) {
, 'p_currency_code', 'tva_id_search'];
for (var i = 0; i < elt.length; i++) {
var idx = elt[i];
- $(p_div + idx).value = answer[elt[i]];
+ id$(p_div + idx).value = answer[elt[i]];
}
// fillup the r_jrn array
- var eltLedgerId = $("ledger_id" + p_div);
+ var eltLedgerId = id$("ledger_id" + p_div);
eltLedgerId.innerHTML = "";
var eltHidden = document.createElement("input");
eltHidden.setAttribute("name", p_div + "nb_jrn");
@@ -1599,7 +1599,7 @@ function load_filter(p_div, p_dossier, p_filter_id) {
uf_tag: answer.uf_tag
},
onSuccess: function (req) {
- $(p_div + 'tag_choose_td').update(req.responseText);
+ id$(p_div + 'tag_choose_td').update(req.responseText);
}
})
@@ -1629,9 +1629,9 @@ function delete_filter(p_div, p_dossier, p_filter_id) {
try {
var answer = req.evalJSON;
- var child = $("manageli" + p_div + "_" + p_filter_id);
+ var child = id$("manageli" + p_div + "_" + p_filter_id);
if (child) {
- $("manage" + p_div).removeChild(child);
+ id$("manage" + p_div).removeChild(child);
}
} catch (e) {
console.log(e.message)
@@ -1651,16 +1651,16 @@ function reset_filter(p_div) {
var elt = ['date_start', 'date_end', 'date_paid_start', 'date_paid_end', 'desc', 'amount_min', 'amount_max', 'qcode', 'accounting', 'tva_id_search'];
for (var i = 0; i < elt.length; i++) {
var idx = elt[i];
- $(p_div + idx).value = "";
+ id$(p_div + idx).value = "";
}
- if ($(p_div + "date_start_hidden")) {
- $(p_div + "date_start").value = $(p_div + "date_start_hidden").value;
+ if (id$(p_div + "date_start_hidden")) {
+ id$(p_div + "date_start").value = id$(p_div + "date_start_hidden").value;
}
- if ($(p_div + "date_end_hidden")) {
- $(p_div + "date_end").value = $(p_div + "date_end_hidden").value;
+ if (id$(p_div + "date_end_hidden")) {
+ id$(p_div + "date_end").value = id$(p_div + "date_end_hidden").value;
}
// clean all the selected ledger
- var eltLedgerId = $("ledger_id" + p_div);
+ var eltLedgerId = id$("ledger_id" + p_div);
eltLedgerId.innerHTML = "";
var eltHidden = document.createElement("input");
eltHidden.setAttribute("name", p_div + "nb_jrn");
@@ -1670,7 +1670,7 @@ function reset_filter(p_div) {
eltLedgerId.appendChild(eltHidden);
// By default , unpaid is uncked
- $(p_div + "operation_filter").value = "all";
+ id$(p_div + "operation_filter").value = "all";
}
function display_list_filter(p_dossier,access_code,ledger_type)
{
@@ -1744,7 +1744,7 @@ function tax_detail_view (dossier_id,date_from,date_to,nLedger_id,nTva_id)
removeDiv(dgbox);
// For form , most of the parameters are in the FORM
// method is then POST
- //var queryString=$(p_form_id).serialize(true);
+ //var queryString=id$(p_form_id).serialize(true);
var queryString = {
op: 'tax_detail',
@@ -1771,7 +1771,7 @@ function tax_detail_view (dossier_id,date_from,date_to,nLedger_id,nTva_id)
var y=calcy(15);
var div_style="position:absolute;"+";top:"+y+"px";
add_div({id:dgbox,cssclass:'inner_box',html:loading(),style:div_style,drag:true});
- $(dgbox).update(req.responseText);
+ id$(dgbox).update(req.responseText);
}
}
@@ -1791,7 +1791,7 @@ var operation_exercice = {
waiting_box();
var queryString = {
op: 'operation_exercice+update_periode',
- folder: $('dos_id').value,
+ folder: id$('dos_id').value,
gDossier: dossier_id
};
var action = new Ajax.Request(
@@ -1807,7 +1807,7 @@ var operation_exercice = {
return;
}
- $("select_exercice_id").update(req.responseText);
+ id$("select_exercice_id").update(req.responseText);
}
}
@@ -1823,13 +1823,13 @@ var operation_exercice = {
removeDiv(dgbox);
// For form , most of the parameters are in the FORM
// method is then POST
- //var queryString=$(p_form_id).serialize(true);
+ //var queryString=id$(p_form_id).serialize(true);
console.debug(row_operation_exercice);
var queryString = {
op: 'operation_exercice+modify_row',
oe_id: oe_id,
row_id: row_operation_exercice,
- gDossier: $('gDossier').value
+ gDossier: id$('gDossier').value
};
var action = new Ajax.Request(
"ajax_misc.php",
@@ -1847,7 +1847,7 @@ var operation_exercice = {
var y = calcy(15);
var div_style = "position:absolute;" + ";top:" + y + "px";
add_div({id: dgbox, cssclass: 'inner_box', html: loading(), style: div_style, drag: true});
- $(dgbox).update(req.responseText);
+ id$(dgbox).update(req.responseText);
}
}
);
@@ -1865,9 +1865,9 @@ var operation_exercice = {
// For form , most of the parameters are in the FORM
// method is then POST
- //var queryString=$(p_form_id).serialize(true);
+ //var queryString=id$(p_form_id).serialize(true);
- var queryString = $('operation_exercice_input_row_frm').serialize(true);
+ var queryString = id$('operation_exercice_input_row_frm').serialize(true);
var action = new Ajax.Request(
"ajax_misc.php",
@@ -1890,24 +1890,24 @@ var operation_exercice = {
row.setAttribute("oed_id", rowid);
row.setAttribute("oe_id", req.responseJSON['oe_id']);
row.update(req.responseJSON['content']);
- $("operation_exercice_tb").appendChild(row);
+ id$("operation_exercice_tb").appendChild(row);
row.addEventListener("click", function (event) {
operation_exercice.click_modify_row(row)
})
} else {
- $("oe_" + rowid).update(req.responseJSON['content']);
+ id$("oe_" + rowid).update(req.responseJSON['content']);
}
new Effect.Highlight("oe_" + req.responseJSON['row_id'], {
startcolor: '#FAD4D4',
endcolor: '#F78082'
});
operation_exercice.display_total(rowid)
- $(dgbox).remove();
+ id$(dgbox).remove();
return;
}
- $(dgbox).update(req.responseText);
+ id$(dgbox).update(req.responseText);
}
}
@@ -1925,7 +1925,7 @@ var operation_exercice = {
var queryString = {
op: 'operation_exercice+display_total',
row_id: row_id,
- gDossier: $('gDossier').value
+ gDossier: id$('gDossier').value
};
var action = new Ajax.Request(
"ajax_misc.php",
@@ -1940,7 +1940,7 @@ var operation_exercice = {
return;
}
- $(dgbox).update(req.responseText);
+ id$(dgbox).update(req.responseText);
}
}
@@ -1957,7 +1957,7 @@ var operation_exercice = {
var queryString = {
op: 'operation_exercice+delete_row',
row_id: row_id,
- gDossier: $('gDossier').value
+ gDossier: id$('gDossier').value
};
var action = new Ajax.Request(
"ajax_misc.php",
@@ -1974,8 +1974,8 @@ var operation_exercice = {
if (req.responseJSON["row_id"] != "") {
operation_exercice.display_total(req.responseJSON["row_id"])
}
- $('oe_' + queryString['row_id']).remove();
- $('operation_exercice_bx').remove();
+ id$('oe_' + queryString['row_id']).remove();
+ id$('operation_exercice_bx').remove();
}
}
);
@@ -1994,7 +1994,7 @@ var operation_exercice = {
var dgbox = "oe_transfer_div";
waiting_box();
- var queryString = $("operation_exercice_transfer_frm").serialize(true);
+ var queryString = id$("operation_exercice_transfer_frm").serialize(true);
var action = new Ajax.Request(
"ajax_misc.php",
{
@@ -2009,7 +2009,7 @@ var operation_exercice = {
}
var answer=req.responseJSON;
- $('operation_exercice_transfer_info').update(answer.content);
+ id$('operation_exercice_transfer_info').update(answer.content);
}
diff --git a/html/js/accounting_item.js b/html/js/accounting_item.js
index 20db90d03..019234b8b 100644
--- a/html/js/accounting_item.js
+++ b/html/js/accounting_item.js
@@ -49,7 +49,7 @@ function search_accounting(obj)
removeDiv('search_account');
add_div({id:'search_account',cssclass:'inner_box',html:loading(),style:div_style,drag:false});
- var dossier=$('gDossier').value;
+ var dossier=id$('gDossier').value;
var queryString="gDossier="+dossier;
@@ -61,8 +61,8 @@ function search_accounting(obj)
{
queryString+="&j="+obj.jrn;
}else {
- if ($("p_jrn")) {
- queryString+="&j="+$("p_jrn").value;
+ if (id$("p_jrn")) {
+ queryString+="&j="+id$("p_jrn").value;
}
}
if ( obj.account)
@@ -97,10 +97,10 @@ function search_accounting(obj)
}
else
{
- if ($(obj).account)
+ if (id$(obj).account)
{
- var e=$(obj).account;
- var str_account=$(e).value;
+ var e=id$(obj).account;
+ var str_account=id$(e).value;
queryString+="&q="+str_account;
}
}
@@ -130,7 +130,7 @@ function search_accounting(obj)
*/
function search_get_poste(obj)
{
- var dossier=$('gDossier').value;
+ var dossier=id$('gDossier').value;
var queryString="gDossier="+dossier;
queryString+="&op=account";
@@ -169,7 +169,7 @@ function search_get_poste(obj)
queryString+="&bracket";
}
- $('asearch').innerHTML=loading();
+ id$('asearch').innerHTML=loading();
var action=new Ajax.Request ( 'ajax_misc.php',
{
method:'get',
@@ -201,7 +201,7 @@ function result_poste_search(req)
var nodeXml=html[0];
var code_html=getNodeText(nodeXml);
code_html=unescape_xml(code_html);
- $('search_account').innerHTML=code_html;
+ id$('search_account').innerHTML=code_html;
}
catch (e)
{
diff --git a/html/js/admin.js b/html/js/admin.js
index 6c4643e32..83c5b26df 100644
--- a/html/js/admin.js
+++ b/html/js/admin.js
@@ -33,8 +33,8 @@ function folder_display(p_user)
*
*/
var p_filter = "";
- if ($('database_filter_input')) {
- p_filter = $('database_filter_input').value;
+ if (id$('database_filter_input')) {
+ p_filter = id$('database_filter_input').value;
}
/*
* Ajax request to display the folder
@@ -46,11 +46,11 @@ function folder_display(p_user)
// table id = database_list
var folder = {};
var create = false;
- if (!$('folder_list_div')) {
+ if (!id$('folder_list_div')) {
folder = create_div({'id': 'folder_list_div', 'cssclass': "inner_box", 'style': 'width:90%,right:5%;top:100px'});
create = true;
}
- folder = $('folder_list_div');
+ folder = id$('folder_list_div');
// Analyze XML answer
var answer = p_xml.responseXML;
var a = answer.getElementsByTagName('status');
@@ -66,7 +66,7 @@ function folder_display(p_user)
folder.innerHTML.evalScripts();
// show it
folder.show();
- $('database_filter_input').focus();
+ id$('database_filter_input').focus();
}
});
}
@@ -123,7 +123,7 @@ function folder_add(p_user, p_dossier)
}
var content = getNodeText(html[0]);
- var nb = $('database_list').rows.length + 1;
+ var nb = id$('database_list').rows.length + 1;
var row = new Element('tr', {'id': 'row' + p_dossier});
if (nb % 2 == 0) {
row.addClassName('even');
@@ -131,8 +131,8 @@ function folder_add(p_user, p_dossier)
row.addClassName('odd');
}
row.innerHTML = unescape_xml(content);
- $('database_list').appendChild(row);
- $('row_db_'+p_dossier).hide();
+ id$('database_list').appendChild(row);
+ id$('row_db_'+p_dossier).hide();
remove_waiting_box();
}
});
@@ -157,16 +157,16 @@ function display_admin_answer(p_dossier,p_action)
var folder;
var create = false;
- if (!$(div_display)) {
+ if (!id$(div_display)) {
folder = create_div({'id': div_display, 'cssclass': "inner_box", style: 'width:90%;right:5%;top:100px'});
create = true;
}
- folder=$(div_display);
+ folder=id$(div_display);
var content = getNodeText(html[0]);
folder.innerHTML=unescape_xml(content);
var pos=calcy(250);
- $(div_display).setStyle({top:pos+'px'});
+ id$(div_display).setStyle({top:pos+'px'});
folder.show();
remove_waiting_box();
diff --git a/html/js/ajax_fiche.js b/html/js/ajax_fiche.js
index 03415c18a..67ae5ae68 100644
--- a/html/js/ajax_fiche.js
+++ b/html/js/ajax_fiche.js
@@ -35,21 +35,21 @@ function clean_Fid(p_ctl)
nTvaAmount=p_ctl+"_tva_amount";
nBuy=p_ctl+"_price";
nTva_id=p_ctl+"_tva_id";
- if ( $(nSell) )
+ if ( id$(nSell) )
{
- $(nSell).value="";
+ id$(nSell).value="";
}
- if ( $(nBuy) )
+ if ( id$(nBuy) )
{
- $(nBuy).value="";
+ id$(nBuy).value="";
}
- if ( $(nTva_id) )
+ if ( id$(nTva_id) )
{
- $(nTva_id).value="-1";
+ id$(nTva_id).value="-1";
}
- if ( $(nTvaAmount))
+ if ( id$(nTvaAmount))
{
- $(nTvaAmount).value=0;
+ id$(nTvaAmount).value=0;
}
}
function errorFid(request,json)
@@ -70,51 +70,51 @@ function ajaxFid(p_ctl)
{
try
{
- var gDossier=$('gDossier').value;
- var jrn=$(p_ctl).jrn;
- $(p_ctl).value=$(p_ctl).value.toUpperCase();
+ var gDossier=id$('gDossier').value;
+ var jrn=id$(p_ctl).jrn;
+ id$(p_ctl).value=id$(p_ctl).value.toUpperCase();
if ( jrn == undefined )
{
- if ($('p_jrn')!=undefined)
+ if (id$('p_jrn')!=undefined)
{
- jrn=$('p_jrn').value;
+ jrn=id$('p_jrn').value;
}
}
if ( jrn == undefined )
{
jrn=-1;
}
- if ( trim($(p_ctl).value)=="" )
+ if ( trim(id$(p_ctl).value)=="" )
{
- nLabel=$(p_ctl).label;
- if ($(nLabel) )
+ nLabel=id$(p_ctl).label;
+ if (id$(nLabel) )
{
- $(nLabel).value="";
- $(nLabel).innerHTML=" ";
+ id$(nLabel).value="";
+ id$(nLabel).innerHTML=" ";
clean_Fid(p_ctl);
return;
}
}
- var queryString="FID="+trim($(p_ctl).value);
- if ( $(p_ctl).label)
+ var queryString="FID="+trim(id$(p_ctl).value);
+ if ( id$(p_ctl).label)
{
- queryString+='&l='+$(p_ctl).label;
+ queryString+='&l='+id$(p_ctl).label;
}
- if ( $(p_ctl).tvaid)
+ if ( id$(p_ctl).tvaid)
{
- queryString+='&t='+$(p_ctl).tvaid;
+ queryString+='&t='+id$(p_ctl).tvaid;
}
- if ( $(p_ctl).price)
+ if ( id$(p_ctl).price)
{
- queryString+='&p='+$(p_ctl).price;
+ queryString+='&p='+id$(p_ctl).price;
}
- if ( $(p_ctl).purchase)
+ if ( id$(p_ctl).purchase)
{
- queryString+='&b='+$(p_ctl).purchase;
+ queryString+='&b='+id$(p_ctl).purchase;
}
- if ( $(p_ctl).typecard)
+ if ( id$(p_ctl).typecard)
{
- queryString+='&d='+$(p_ctl).typecard;
+ queryString+='&d='+id$(p_ctl).typecard;
}
queryString=queryString+"&j="+jrn+'&gDossier='+gDossier;
queryString=queryString+'&ctl='+p_ctl.id;
@@ -196,9 +196,9 @@ function ajax_error_saldo(request,json)
*/
function ajax_saldo(p_ctl)
{
- var gDossier=$('gDossier').value;
- var ctl_value=trim($(p_ctl).value);
- var jrn=$('p_jrn').value;
+ var gDossier=id$('gDossier').value;
+ var ctl_value=trim(id$(p_ctl).value);
+ var jrn=id$('p_jrn').value;
queryString="FID="+ctl_value+"&op=saldo";
queryString=queryString+'&gDossier='+gDossier+'&j='+jrn;
queryString=queryString+'&ctl='+ctl_value;
@@ -221,7 +221,7 @@ function ajax_saldo(p_ctl)
function ajax_success_saldo(request,json)
{
var answer=request.responseText.evalJSON(true);
- $('first_sold').value=answer.saldo;
+ id$('first_sold').value=answer.saldo;
}
@@ -231,8 +231,8 @@ function ajax_success_saldo(request,json)
function ajax_get_success(request,json)
{
var answer=request.responseText.evalJSON(false);
- $(answer.ctl).show();
- $(answer.ctl).innerHTML=answer.html;
+ id$(answer.ctl).show();
+ id$(answer.ctl).innerHTML=answer.html;
}
/*!\brief callback function for ajax_get when fails
*/
@@ -252,7 +252,7 @@ var category_card={};
* @param string p_object_name , name of the prefix for id
*/
category_card.add_attribut=function (p_dossier,p_fiche_def_ref,p_object_name) {
- var select=$("sel"+p_object_name);
+ var select=id$("sel"+p_object_name);
var selected_attr=select.value;
new Ajax.Request("ajax_misc.php",{
method:"post",
@@ -268,7 +268,7 @@ category_card.add_attribut=function (p_dossier,p_fiche_def_ref,p_object_name) {
if ( answer.status == 'OK') {
var newli = document.createElement("li")
- $(p_object_name + "_list").append(newli);
+ id$(p_object_name + "_list").append(newli);
newli.replace(answer.content);
document.getElementById('attribut_order').value = Sortable.serialize(p_object_name + "_list");
select.remove(select.selectedIndex);
@@ -304,11 +304,11 @@ category_card.remove_attribut=function (p_dossier,p_fiche_def_ref,p_object_name,
onSuccess:function(req) {
var answer=req.responseText.evalJSON();
if ( answer.status == 'OK') {
- $(p_object_name+"_elt"+p_attribute_id).remove();
+ id$(p_object_name+"_elt"+p_attribute_id).remove();
var option=document.createElement("option");
option.text=answer['content'];
option.value=p_attribute_id;
- $('sel'+p_object_name).add(option);
+ id$('sel'+p_object_name).add(option);
} else {
smoke.alert(answer.message);
}
@@ -328,11 +328,11 @@ category_card.check_vatnumber=function(p_domid) {
// For form , most of the parameters are in the FORM
// method is then POST
- //var queryString=$(p_form_id).serialize(true);
+ //var queryString=id$(p_form_id).serialize(true);
var queryString = {
op: 'check_vatnumber',
- vatnr:$(p_domid).value,
+ vatnr:id$(p_domid).value,
boxid: dgbox,
p_domid:p_domid
};
@@ -352,14 +352,14 @@ category_card.check_vatnumber=function(p_domid) {
if ( answer.status == 'OK')
{
- $(dgbox).update(answer.html);
- $(p_domid).value=answer.vat;
- $(p_domid).removeClassName("notice")
- $(p_domid).addClassName("valid")
+ id$(dgbox).update(answer.html);
+ id$(p_domid).value=answer.vat;
+ id$(p_domid).removeClassName("notice")
+ id$(p_domid).addClassName("valid")
} else {
- $(p_domid).addClassName("notice");
- $(p_domid).removeClassName("valid");
- $(dgbox).update(answer.html);
+ id$(p_domid).addClassName("notice");
+ id$(p_domid).removeClassName("valid");
+ id$(dgbox).update(answer.html);
}
}
diff --git a/html/js/anc_script.js b/html/js/anc_script.js
index f238ad35f..26d1c72f8 100644
--- a/html/js/anc_script.js
+++ b/html/js/anc_script.js
@@ -31,7 +31,7 @@
*/
function add_row(p_table, p_seq)
{
- var mytable = g(p_table).tBodies[0];
+ var mytable = id$(p_table).tBodies[0];
if (!mytable)
{
return;
@@ -120,14 +120,14 @@ function anc_refresh_remain(p_table, p_seq)
var remain = tot_line - tot_table;
remain = Math.round(remain * 100) / 100;
- $('remain' + p_table).innerHTML = remain;
+ id$('remain' + p_table).innerHTML = remain;
if (remain == 0)
{
- $('remain' + p_table).style.color = "green"
+ id$('remain' + p_table).style.color = "green"
}
else
{
- $('remain' + p_table).style.color = "red"
+ id$('remain' + p_table).style.color = "red"
}
} catch (a)
{
@@ -152,7 +152,7 @@ function verify_ca(div)
while (idx < 50)
{
var table = div + 't' + idx;
- if (g(table))
+ if (id$(table))
{
var total_amount = 0;
// table is found compute the different val[]
@@ -182,12 +182,12 @@ function verify_ca(div)
var diff = amount*100 - total_amount*100;
if (Math.round(diff/100) != 0.0)
{
- g(table).style.backgroundColor = 'red';
+ id$(table).style.backgroundColor = 'red';
amount_error++;
}
else
{
- g(table).style.backgroundColor = 'lightgreen';
+ id$(table).style.backgroundColor = 'lightgreen';
}
idx++;
@@ -216,7 +216,7 @@ function verify_ca(div)
*/
function search_ca(p_dossier, p_target, p_source)
{
- var pa_id = g(p_source).value;
+ var pa_id = id$(p_source).value;
waiting_box();
removeDiv('search_anc');
var qs = "op=openancsearch&gDossier=" + p_dossier + "&ctl=searchanc";
@@ -237,7 +237,7 @@ function search_ca(p_dossier, p_target, p_source)
cssclass: "inner_box",
style: pos
});
- $('searchanc').innerHTML = req.responseText;
+ id$('searchanc').innerHTML = req.responseText;
} catch (e) {
alert_box(e.message);
@@ -251,7 +251,7 @@ function search_anc_form(obj)
{
var qs = "op=resultancsearch&ctl=searchanc&";
var name = obj.id;
- qs += $(name).serialize(false);
+ qs += id$(name).serialize(false);
waiting_box();
var action = new Ajax.Request('ajax_misc.php',
{
@@ -261,7 +261,7 @@ function search_anc_form(obj)
onSuccess: function(req) {
try {
remove_waiting_box();
- $('searchanc').innerHTML = req.responseText;
+ id$('searchanc').innerHTML = req.responseText;
req.responseText.evalScripts();
} catch (e) {
@@ -281,16 +281,16 @@ function caod_checkTotal()
}// Ajouter getElementById par document.all[str]
var total_deb = 0.0;
var total_cred = 0.0;
- var nb_item = g('nbrow').value;
+ var nb_item = id$('nbrow').value;
for (var i = 0; i < nb_item; i++)
{
- var doc_amount = g("pamount" + i);
+ var doc_amount = id$("pamount" + i);
if (!doc_amount)
{
return;
}
- var side = g("pdeb" + i);
+ var side = id$("pdeb" + i);
if (!side)
{
return;
@@ -316,22 +316,22 @@ function caod_checkTotal()
var r_total_cred = Math.round(total_cred * 100) / 100;
var r_total_deb = Math.round(total_deb * 100) / 100;
- g('totalDeb').innerHTML = r_total_deb;
- g('totalCred').innerHTML = r_total_cred;
+ id$('totalDeb').innerHTML = r_total_deb;
+ id$('totalCred').innerHTML = r_total_cred;
if (r_total_deb != r_total_cred)
{
- g("totalDiff").style.color = "red";
- g("totalDiff").style.fontWeight = "bold";
- g("totalDiff").innerHTML = "Différence";
+ id$("totalDiff").style.color = "red";
+ id$("totalDiff").style.fontWeight = "bold";
+ id$("totalDiff").innerHTML = "Différence";
var diff = total_deb - total_cred;
diff = Math.round(diff * 100) / 100;
- g("totalDiff").innerHTML = diff;
+ id$("totalDiff").innerHTML = diff;
}
else
{
- g("totalDiff").innerHTML = "0.0";
+ id$("totalDiff").innerHTML = "0.0";
}
}
@@ -352,7 +352,7 @@ function anc_remove_operation(p_dossier, p_oa_group)
var queryString = encodeJSON(obj);
var e = new Ajax.Request("ajax_misc.php",
{method: 'get', parameters: queryString,onSuccess:function req() {
- $("tr"+p_oa_group).remove();
+ id$("tr"+p_oa_group).remove();
}
});
@@ -370,12 +370,12 @@ function anc_remove_operation(p_dossier, p_oa_group)
function anc_add_row(tableid)
{
var style = 'class="input_text"';
- var mytable = g(tableid).tBodies[0];
+ var mytable = id$(tableid).tBodies[0];
var nNumberRow = mytable.rows.length;
var oRow = mytable.insertRow(nNumberRow);
var rowToCopy = mytable.rows[1];
var nNumberCell = rowToCopy.cells.length;
- var nb = g("nbrow");
+ var nb = id$("nbrow");
var oNewRow = mytable.insertRow(nNumberRow);
for (var e = 0; e < nNumberCell; e++)
{
@@ -388,7 +388,7 @@ function anc_add_row(tableid)
newCell.innerHTML = new_tt;
new_tt.evalScripts();
}
- $("pamount" + nb.value).value = "0";
+ id$("pamount" + nb.value).value = "0";
nb.value++;
}
/**
@@ -438,7 +438,7 @@ function anc_key_compute(p_dossier, p_table, p_amount, p_key_id)
var code_html = getNodeText(html[0]); // Firefox ne prend que les 4096 car.
code_html = unescape_xml(code_html);
- $(name_ctl).innerHTML = code_html;
+ id$(name_ctl).innerHTML = code_html;
code_html.evalScripts();
removeDiv('div_anc_key_choice');
} catch (e)
@@ -491,7 +491,7 @@ function anc_key_choice(p_dossier, p_table, p_amount,p_ledger)
code_html = unescape_xml(code_html);
var position=fixed_position(50,120);
add_div({id: name_ctl, cssclass: 'inner_box', style: position, drag: 1});
- $(name_ctl).innerHTML = code_html;
+ id$(name_ctl).innerHTML = code_html;
} catch (e)
{
error_message(e.message);
@@ -540,7 +540,7 @@ function anc_key_clean(p_dossier, p_table, p_amount,p_ledger,p_jrnx_id,p_sequenc
var code_html = getNodeText(html[0]); // Firefox ne prend que les 4096 car.
code_html = unescape_xml(code_html);
- $(p_table+"t"+p_sequence).innerHTML=code_html;
+ id$(p_table+"t"+p_sequence).innerHTML=code_html;
} catch (e)
{
error_message(e.message);
@@ -561,7 +561,7 @@ function anc_key_clean(p_dossier, p_table, p_amount,p_ledger,p_jrnx_id,p_sequenc
*/
function add_row_key(p_table)
{
- var mytable = g(p_table).tBodies[0];
+ var mytable = id$(p_table).tBodies[0];
if (!mytable)
{
return;
@@ -595,7 +595,7 @@ function add_row_key(p_table)
cell.innerHTML = txt;
}
}
- $('total_key').innerHTML="?";
+ id$('total_key').innerHTML="?";
}
function anc_key_compute_table()
{
@@ -615,7 +615,7 @@ function anc_key_compute_table()
}
tot=tot+Math.round(value*100)/100;
}
- $('total_key').innerHTML=Math.round(tot*100)/100;
+ id$('total_key').innerHTML=Math.round(tot*100)/100;
}
@@ -627,7 +627,7 @@ function anc_detail_op(p_oa_group,gDossier) {
parameters:{"gDossier":gDossier,"op":"anc_detail_op","oa_group":p_oa_group},
onSuccess:function (req) {
add_div({"id":"anc_detail_op_div","cssclass":"inner_box","style":"position:fixed;top:5%"});
- $('anc_detail_op_div').update(req.responseText);
+ id$('anc_detail_op_div').update(req.responseText);
remove_waiting_box();
}
});
diff --git a/html/js/card.js b/html/js/card.js
index c3e17db9a..e65637fda 100644
--- a/html/js/card.js
+++ b/html/js/card.js
@@ -34,7 +34,7 @@ function boxsearch_card(p_dossier)
{
waiting_box();
removeDiv('boxsearch_card_div');
- var queryString="gDossier="+p_dossier+"&op=cardsearch"+"&card="+encodeURI($("card_search").value);
+ var queryString="gDossier="+p_dossier+"&op=cardsearch"+"&card="+encodeURI(id$("card_search").value);
var action = new Ajax.Request(
"ajax_misc.php" ,
{
@@ -49,8 +49,8 @@ function boxsearch_card(p_dossier)
var y=calcy(15);
var div_style="position:absolute;"+";top:"+y+"px";
add_div({id:'boxsearch_card_div',cssclass:'inner_box',html:loading(),style:div_style,drag:true});
- $('boxsearch_card_div').innerHTML=req.responseText;
- sorttable.makeSortable($('tb_fiche'));
+ id$('boxsearch_card_div').innerHTML=req.responseText;
+ sorttable.makeSortable(id$('tb_fiche'));
}
}
);
@@ -76,9 +76,9 @@ function search_card(obj)
{
try
{
- var gDossier=$('gDossier').value;
+ var gDossier=id$('gDossier').value;
var inp=obj.inp;
- var string_to_search=$(inp).value;
+ var string_to_search=id$(inp).value;
var label=obj.label;
var typecard=obj.typecard;
var price=obj.price;
@@ -93,8 +93,8 @@ function search_card(obj)
}
if ( jrn==undefined)
{
- if ( g('p_jrn')) {
- jrn=$('p_jrn').value;
+ if ( id$('p_jrn')) {
+ jrn=id$('p_jrn').value;
}
else {
jrn=-1;
@@ -114,7 +114,7 @@ function search_card(obj)
'amount_from_type':amount_from_type,
'inactive_card':inactive_card
});
- if ( $('search_card') ) {
+ if ( id$('search_card') ) {
removeDiv('search_card');
}
@@ -164,7 +164,7 @@ function action_concerned_save_card(obj)
var nodeXml = html[0];
var code_html = getNodeText(nodeXml);
code_html = unescape_xml(code_html);
- $(namectl).update(code_html);
+ id$(namectl).update(code_html);
removeDiv('search_card');
/* if dialog box exist with list other card, then refresh it */
if ( document.getElementById("action_concerned_list_dv") ) {
@@ -222,7 +222,7 @@ function action_concerned_list(p_obj) {
code_html = unescape_xml(code_html);
- $('action_concerned_list_dv').innerHTML = code_html;
+ id$('action_concerned_list_dv').innerHTML = code_html;
} catch (e) {
alert_box(e.message);
}
@@ -336,9 +336,9 @@ function action_concerned_search_card(obj)
sx = document.body.scrollTop + 60;
}
var div_style = "top:" + sx + "px;height:52rem";
- if ( ! $('search_card')) { add_div({id: 'search_card', cssclass: 'inner_box', html: "", style: div_style, drag: true}); }
- $('search_card').innerHTML = code_html;
- $('query').focus();
+ if ( ! id$('search_card')) { add_div({id: 'search_card', cssclass: 'inner_box', html: "", style: div_style, drag: true}); }
+ id$('search_card').innerHTML = code_html;
+ id$('query').focus();
activate_checkbox_range('select_card_ck');
}catch (e) {
alert_box(e.message);
@@ -363,7 +363,7 @@ function action_concerned_search_card(obj)
*/
function search_get_card(obj)
{
- var dossier=$('gDossier').value;
+ var dossier=id$('gDossier').value;
var queryString="gDossier="+dossier;
queryString+="&op2=fs&op=card";
@@ -417,7 +417,7 @@ function search_get_card(obj)
}
queryString=encodeURI(queryString);
- $('asearch').innerHTML=loading();
+ id$('asearch').innerHTML=loading();
var action=new Ajax.Request ( 'ajax_misc.php',
{
@@ -466,9 +466,9 @@ function result_card_search(req)
var div_style="top:"+sx+"px;min-height:80%;height:auto";
add_div({id:'search_card',cssclass:'inner_box',html:"",style:div_style,drag:false,effect:'blinddown'});
- $('search_card').innerHTML=code_html;
+ id$('search_card').innerHTML=code_html;
- if ($('query')) { $('query').focus();}
+ if (id$('query')) { id$('query').focus();}
}
catch (e)
{
@@ -500,12 +500,12 @@ function result_card_search(req)
*/
function setCtrl(p_ctrl,p_quickcode,p_ctrlname,p_label)
{
- var ctrl=g(p_ctrl);
+ var ctrl=id$(p_ctrl);
if ( ctrl )
{
ctrl.value=p_quickcode;
}
- var ctrl_name=g(p_ctrlname);
+ var ctrl_name=id$(p_ctrlname);
if ( ctrl_name )
{
ctrl_name.value=p_label;
@@ -523,17 +523,17 @@ function clean_Fid(p_ctl)
nSell=p_ctl+"_price";
nBuy=p_ctl+"_price";
nTva_id=p_ctl+"_tva_id";
- if ( $(nSell) )
+ if ( id$(nSell) )
{
- $(nSell).value="";
+ id$(nSell).value="";
}
- if ( $(nBuy) )
+ if ( id$(nBuy) )
{
- $(nBuy).value="";
+ id$(nBuy).value="";
}
- if ( $(nTva_id) )
+ if ( id$(nTva_id) )
{
- $(nTva_id).value="-1";
+ id$(nTva_id).value="-1";
}
}
@@ -583,7 +583,7 @@ function fill_fin_data_onchange(ctl)
function fill_fin_data(text,li)
{
ajaxFid(text);
- ajax_saldo($(text.id));
+ ajax_saldo(id$(text.id));
}
/**
* show the ipopup window and display the details of a card,
@@ -611,17 +611,17 @@ function fill_ipopcard(obj)
var popup={'id': content,'cssclass':'inner_box2','style':str_style,'html':"",'drag':false};
add_div(popup);
- var dossier=$('gDossier').value;
+ var dossier=id$('gDossier').value;
var qcode='';
- if ( $(obj).qcode != undefined )
+ if ( id$(obj).qcode != undefined )
{
qcode=obj.qcode;
}
else
{
- qcode=$(obj).value;
+ qcode=id$(obj).value;
}
- // ctl=$(obj).id;
+ // ctl=id$(obj).id;
var queryString='gDossier='+dossier;
queryString+='&qcode='+qcode;
@@ -671,7 +671,7 @@ function successFill_ipopcard(req,json)
var code_html=getNodeText(html[0]);
code_html=unescape_xml(code_html);
- $(name_ctl).innerHTML=code_html;
+ id$(name_ctl).innerHTML=code_html;
}
catch (e)
{
@@ -698,16 +698,16 @@ function successFill_ipopcard(req,json)
*/
function select_card_type(obj)
{
- var dossier=$('gDossier').value;
+ var dossier=id$('gDossier').value;
var elementId="";
// give a filter, -1 if not
- var filter=$(obj).filter;
+ var filter=id$(obj).filter;
if ( filter==undefined)
{
filter=-1;
}
var content="select_card_div";
- if ( $(content)){removeDiv(content);}
+ if ( id$(content)){removeDiv(content);}
var sx=0;
sx=calcy(160);
@@ -721,25 +721,25 @@ function select_card_type(obj)
queryString+='&ctl='+content;
queryString+='&op2=st'; // st for selecting type
queryString+='&op=card'; // st for selecting type
- if ( $(obj).win_refresh!=undefined)
+ if ( id$(obj).win_refresh!=undefined)
{
queryString+='&ref';
}
/* if an element id must be updated after creating a new card */
- if ( $(obj).elementId) {
- var elementId=$(obj).elementId;
+ if ( id$(obj).elementId) {
+ var elementId=id$(obj).elementId;
queryString+="&eltid="+elementId;
}
queryString+='&fil='+filter;
// filter on the ledger, -1 if not
- var oledger=$(obj).jrn;
+ var oledger=id$(obj).jrn;
if (oledger==undefined)
{
ledger=-1;
}
else
{
- ledger=$(obj).jrn;
+ ledger=id$(obj).jrn;
}
queryString+='&ledger='+ledger;
@@ -773,7 +773,7 @@ function select_card_type(obj)
return;
}
fill_box(req);
- $('lk_cat_card_table').focus();
+ id$('lk_cat_card_table').focus();
}
}
);
@@ -810,7 +810,7 @@ function dis_blank_card(obj)
add_div(popup);
if ( obj.gDossier.value != undefined ) {
- var dossier=$('gDossier').value;
+ var dossier=id$('gDossier').value;
} else {
var dossier=obj.gDossier;
}
@@ -848,11 +848,11 @@ function form_blank_card(obj)
var str_style="top:"+nTop+"px;left:"+nLeft+"px;width:60em;height:auto";
var popup={'id': content,'cssclass':'inner_box','style':str_style,'html':loading(),'drag':true};
- if ( $(content)) {removeDiv(content);}
+ if ( id$(content)) {removeDiv(content);}
add_div(popup);
- var dossier=$('gDossier').value;
+ var dossier=id$('gDossier').value;
var queryString='gDossier='+dossier;
queryString+='&ctl='+content;
@@ -878,8 +878,8 @@ function form_blank_card(obj)
*/
function save_card(obj)
{
- var content=$(obj).ipopup;
- var accounting= $(obj)['av_text5'];
+ var content=id$(obj).ipopup;
+ var accounting= id$(obj)['av_text5'];
if ( accounting && accounting.value.length > 40 ) {
smoke.alert('Poste comptable trop grand');
return false;
@@ -887,9 +887,9 @@ function save_card(obj)
// Data must be taken here
- var data=$('save_card').serialize(false);
+ var data=id$('save_card').serialize(false);
waiting_box();
- var dossier=$('gDossier').value;
+ var dossier=id$('gDossier').value;
var queryString='gDossier='+dossier;
queryString+='&ctl='+content;
queryString+=data;
@@ -922,7 +922,7 @@ function save_card(obj)
// if status == OK and after_save == 1
// then add a row to the table
if ( status_value == 'OK' && after_save == 1) {
- var table_card=$('fiche_tb_id');
+ var table_card=id$('fiche_tb_id');
f_id=getNodeText(req.responseXML.getElementsByTagName("f_id")[0]);
var row=new Element('tr');
row.id="row_card"+f_id;
@@ -943,9 +943,9 @@ function save_card(obj)
var eltid=getNodeText(elt[0]);
if ( eltid !="") {
var eltvalue=req.responseXML.getElementsByTagName("elt_value");
- $(eltid).value=getNodeText(eltvalue[0]);
+ id$(eltid).value=getNodeText(eltvalue[0]);
fill_data_onchange(eltid);
- $(eltid).focus();
+ id$(eltid).focus();
}
}
if (status_value == "OK") {
@@ -984,12 +984,12 @@ function add_category(obj)
// show ipopup
var div={id:obj.ipopup,
cssclass:"inner_box",drag:1,style:div_style};
- if ( $(div) ) {
+ if ( id$(div) ) {
removeDiv(div);
}
add_div(div);
waiting_box();
- var dossier=$('gDossier').value;
+ var dossier=id$('gDossier').value;
var queryString='gDossier='+dossier;
queryString+='&op2=ac';
queryString+='&op=card';
@@ -1014,15 +1014,15 @@ function add_category(obj)
*/
function save_card_category(obj)
{
- if ( ! $(obj).ipopup)
+ if ( ! id$(obj).ipopup)
{
alert_box('Erreur pas d\' attribut ipopup '+obj.id);
return;
};
try {
// Data must be taken here
- data=$('newcat').serialize(false);
- var dossier=$('gDossier').value;
+ data=id$('newcat').serialize(false);
+ var dossier=id$('gDossier').value;
var queryString='ctl='+obj.ipopup+'&';
queryString+=data;
queryString+='&op2=scc'; // sc for save card
@@ -1124,7 +1124,7 @@ function action_save_concerned(p_form_id) {
var code_html = getNodeText(nodeXml);
code_html = unescape_xml(code_html);
removeDiv('search_card');
- $('concerned_card_td').innerHTML = code_html;
+ id$('concerned_card_td').innerHTML = code_html;
} catch (e) {
}
@@ -1156,10 +1156,10 @@ function action_remove_concerned(p_dossier,p_fiche_id,p_action_id)
var nodeXml=html[0];
var code_html = getNodeText(nodeXml);
code_html = unescape_xml(code_html);
- $('concerned_card_td').innerHTML = code_html;
+ id$('concerned_card_td').innerHTML = code_html;
removeDiv('search_card');
- $(namectl).remove();
+ id$(namectl).remove();
} catch (e) {
if ( console) { console.log('Erreur ') + e.message;}
@@ -1234,7 +1234,7 @@ function modify_card(p_fiche_id)
console.error("card_gdossier error");
throw ("card_gdossier not set");
}
- var dossier = $('card_gdossier').value;
+ var dossier = id$('card_gdossier').value;
var action = new Ajax.Request('ajax_misc.php',
@@ -1262,8 +1262,8 @@ function delete_card_id(p_fiche_id)
console.error("card_gdossier error");
throw ("card_gdossier not set");
}
- $(row).addClassName("background-selected");
- var dossier = $('card_gdossier').value;
+ id$(row).addClassName("background-selected");
+ var dossier = id$('card_gdossier').value;
smoke.confirm(content[47], function (e) {
if (e) {
waiting_box();
@@ -1272,7 +1272,7 @@ function delete_card_id(p_fiche_id)
parameters: {'gDossier':dossier,"op":'card',"op2":"rm_card","f_id":p_fiche_id,'ctl':row} ,
onSuccess: function (req) {
remove_waiting_box();
- var table_card=$('fiche_tb_id');
+ var table_card=id$('fiche_tb_id');
var answer = req.responseXML;
var a = answer.getElementsByTagName('ctl');
if (a.length == 0)
@@ -1288,7 +1288,7 @@ function delete_card_id(p_fiche_id)
if ((code_html) == "OK") {
Effect.Fade(row, {duration: 0.1});
- table_card.tBodies[0].removeChild($(row));
+ table_card.tBodies[0].removeChild(id$(row));
alternate_row_color("fiche_tb_id");
} else {
smoke.alert(code_html);
@@ -1298,7 +1298,7 @@ function delete_card_id(p_fiche_id)
});
} else{
- $(row).removeClassName("background-selected");
+ id$(row).removeClassName("background-selected");
}
});
@@ -1338,11 +1338,11 @@ function card_update_row(obj)
if ( document.getElementById(name_ctl)) {
// update the row
- $(name_ctl).innerHTML = code_html;
+ id$(name_ctl).innerHTML = code_html;
new Effect.Highlight(name_ctl ,{startcolor: '#FAD4D4',endcolor: '#F78082' });
}
- $(a[0].firstChild.nodeValue).remove();
+ id$(a[0].firstChild.nodeValue).remove();
} catch (e) {
@@ -1391,7 +1391,7 @@ function linked_card_option(p_action_person_id,p_dossier) {
onSuccess:function(req) {
remove_waiting_box();
add_div({ "id":"d_linked_card_option",cssclass:"inner_box",style:"position:fixed;top:30%;min-width:20rem;width:auto;",drag:0});
- $("d_linked_card_option").update(req.responseText);
+ id$("d_linked_card_option").update(req.responseText);
}
});
@@ -1414,7 +1414,7 @@ function save_linked_card_option(obj)
onSuccess:function(req) {
remove_waiting_box();
removeDiv("d_linked_card_option");
- $("other_"+obj.action_person_id.value).update(req.responseText);
+ id$("other_"+obj.action_person_id.value).update(req.responseText);
new Effect.Highlight("other_"+obj.action_person_id.value,{startcolor: '#FAD4D4',endcolor: '#F78082' });
}
});
@@ -1503,10 +1503,10 @@ CategoryCardDefinition.prototype.add_attribut = function (attribut_id) {
// if successfull add id on existing_list and remove from available_list
// remove from available_list
- $('avail_attr_' + attribut_id).remove();
+ id$('avail_attr_' + attribut_id).remove();
var parser = new DOMParser();
var element = parser.parseFromString(req.responseText, 'text/html');
- $(here.existing_list).appendChild(element.body.firstChild);
+ id$(here.existing_list).appendChild(element.body.firstChild);
new Effect.Highlight('existing_attr_' + attribut_id, {
startcolor: '#FAD4D4',
endcolor: '#F78082'
@@ -1551,10 +1551,10 @@ CategoryCardDefinition.prototype.remove_attribut = function (attribut_id) {
// if successfull add id on existing_list and remove from available_list
// remove from available_list
- $('existing_attr_' + attribut_id).remove();
+ id$('existing_attr_' + attribut_id).remove();
var parser = new DOMParser();
var element = parser.parseFromString(req.responseText, 'text/html');
- $(here.available_list).appendChild(element.body.firstChild);
+ id$(here.available_list).appendChild(element.body.firstChild);
alternate_row_color_list(here.available_list);
Sortable.create('attribut_card', {tag: 'li', hoverclass: inner_box});
diff --git a/html/js/infobulle.js b/html/js/infobulle.js
index e2d054392..37c52a547 100644
--- a/html/js/infobulle.js
+++ b/html/js/infobulle.js
@@ -81,9 +81,9 @@ function displaySelectBox(p_name) {
newDiv.id="select_box_content"+p_name;
document.body.appendChild(newDiv);
newDiv.addClassName("select_box");
- $("select_box_content"+p_name).onmouseleave=function() {
+ id$("select_box_content"+p_name).onmouseleave=function() {
try {
- var newDiv=$("select_box_content"+p_name);
+ var newDiv=id$("select_box_content"+p_name);
newDiv.setStyle({display:"none"});
} catch(e) {
alert(e.message);
@@ -92,7 +92,7 @@ function displaySelectBox(p_name) {
} else {
newDiv=document.getElementById("select_box_content"+p_name);
}
- newDiv.innerHTML=$("select_box"+p_name).innerHTML;
+ newDiv.innerHTML=id$("select_box"+p_name).innerHTML;
var viewport = document.viewport.getDimensions();
var locPosY=posY;
if ( posY+offsetY+ newDiv.getHeight() > window.innerHeight -3) {
@@ -103,12 +103,12 @@ function displaySelectBox(p_name) {
newDiv.style.left=document.getElementById(p_name+"_bt").offsetLeft+"px";
newDiv.setStyle({display:"block",position:"absolute","z-index":999});
- if ( $("search_"+p_name+"_list") ) {
+ if ( id$("search_"+p_name+"_list") ) {
var sTmp = newDiv.innerHTML;
var regex=new RegExp(p_name+"_list","g");
sTmp = sTmp.replace(regex,p_name+"_t_list");
newDiv.innerHTML=sTmp;
- $("search_"+p_name+"_t_list").focus();
+ id$("search_"+p_name+"_t_list").focus();
}
} catch(e) {
alert(e.message);
diff --git a/html/js/modele_document.js b/html/js/modele_document.js
index 6bbf8d12f..6872f2e6e 100644
--- a/html/js/modele_document.js
+++ b/html/js/modele_document.js
@@ -71,8 +71,8 @@ function modify_document_success_box(req,json)
var code_html=getNodeText(html[0]);
code_html=unescape_xml(code_html);
- g(name_ctl).innerHTML=code_html;
- g(name_ctl).style.height='auto';
+ id$(name_ctl).innerHTML=code_html;
+ id$(name_ctl).style.height='auto';
}
catch (e)
{
diff --git a/html/js/noalyss_script.js b/html/js/noalyss_script.js
index e4d4e7070..69df81e2c 100644
--- a/html/js/noalyss_script.js
+++ b/html/js/noalyss_script.js
@@ -73,7 +73,7 @@ function infodiv(req, json) {
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
- g(name_ctl + "info").innerHTML = code_html;
+ id$(name_ctl + "info").innerHTML = code_html;
} catch (e) {
alert_box("success_box" + e.message);
}
@@ -95,7 +95,7 @@ function deleteRow(tb, obj) {
var td = obj.parentNode;
var tr = td.parentNode;
var lidx = tr.rowIndex;
- g(tb).deleteRow(lidx);
+ id$(tb).deleteRow(lidx);
} else {
return;
@@ -106,7 +106,7 @@ function deleteRow(tb, obj) {
function deleteRowRec(tb, obj) {
var tr = obj;
var lidx = tr.rowIndex;
- g(tb).deleteRow(lidx);
+ id$(tb).deleteRow(lidx);
}
/*!\brief remove trailing and heading space
@@ -122,12 +122,13 @@ function trim(s) {
* @param ID is a string
* @return the found object of undefined if not found
*/
-function g(ID) {
+function id$(ID) {
if (document.getElementById) {
return this.document.getElementById(ID);
} else if (document.all) {
return document.all[ID];
} else {
+ console.error(`id$ ${ID}`)
return undefined;
}
}
@@ -136,18 +137,18 @@ function g(ID) {
* enable the type of periode
*/
function enable_type_periode() {
- if ($("type_periode").options[$("type_periode").selectedIndex].value == 0) {
- $('from_periode').enable();
- $('to_periode').enable();
- $('from_date').disable();
- $('to_date').disable();
- $('p_step').enable();
+ if (id$("type_periode").options[id$("type_periode").selectedIndex].value == 0) {
+ id$('from_periode').enable();
+ id$('to_periode').enable();
+ id$('from_date').disable();
+ id$('to_date').disable();
+ id$('p_step').enable();
} else {
- $('from_periode').disable();
- $('to_periode').disable();
- $('from_date').enable();
- $('to_date').enable();
- $('p_step').disable();
+ id$('from_periode').disable();
+ id$('to_periode').disable();
+ id$('from_date').enable();
+ id$('to_date').enable();
+ id$('p_step').disable();
}
}
@@ -188,11 +189,11 @@ function encodeJSON(obj) {
}
function hide(p_param) {
- g(p_param).style.display = 'none';
+ id$(p_param).style.display = 'none';
}
function show(p_param) {
- g(p_param).style.display = 'block';
+ id$(p_param).style.display = 'block';
}
/**
@@ -201,7 +202,7 @@ function show(p_param) {
*@param selectIt : the value selected in case of Field is a object select, numeric
*/
function SetFocus(Field, SelectIt) {
- var elem = g(Field);
+ var elem = id$(Field);
if (elem) {
elem.focus();
}
@@ -226,21 +227,21 @@ function set_inparent(p_ctl, p_value, p_add) {
@param p_add if we don't replace the current value but we add something
*/
function set_value(p_ctl, p_value, p_add) {
- if (g(p_ctl)) {
- var g_ctrl = g(p_ctl);
+ if (id$(p_ctl)) {
+ var g_ctrl = id$(p_ctl);
if (p_add != undefined && p_add === 1) {
if (g_ctrl.value) {
p_value = g_ctrl.value + ',' + p_value;
}
}
if (g_ctrl.tagName === 'INPUT') {
- g(p_ctl).value = p_value;
+ id$(p_ctl).value = p_value;
}
if (g_ctrl.tagName === 'SPAN') {
- g(p_ctl).innerHTML = p_value;
+ id$(p_ctl).innerHTML = p_value;
}
if (g_ctrl.tagName === 'SELECT') {
- g(p_ctl).value = p_value;
+ id$(p_ctl).value = p_value;
}
}
}
@@ -302,7 +303,7 @@ function format_number(obj, p_prec) {
value = Math.round(value * arrondi) / arrondi;
- $(obj).value = value;
+ id$(obj).value = value;
}
/**
@@ -340,37 +341,37 @@ function format_date(p_object) {
* @param rotate : if true with rotate the object of p_button otherwise
*/
function toggleHideShow(p_obj, p_button, rotate) {
- var div_obj = g(p_obj);
+ var div_obj = id$(p_obj);
var stat = div_obj.style.display;
- var str = (g(p_button)) ? g(p_button).value : "";
+ var str = (id$(p_button)) ? id$(p_button).value : "";
if (stat === 'none') {
// specific for the DIV id search_form
if (div_obj.id == 'search_form') {
show(p_obj);
} else {
- $(p_obj).show()
+ id$(p_obj).show()
}
str = str.replace(/Afficher/, content[62]);
- g(p_button).value = str;
+ id$(p_button).value = str;
} else {
// specific for the DIV di search_form
if (!div_obj.id == 'search_form') {
hide(p_obj);
} else {
- $(p_obj).hide()
+ id$(p_obj).hide()
}
str = str.replace(/Cacher/, content[63]);
- g(p_button).value = str;
+ id$(p_button).value = str;
}
if (!rotate) return;
if (stat == "none") {
- g(p_button).addClassName("icon-up-open-1")
- g(p_button).removeClassName(" icon-down-open-2")
+ id$(p_button).addClassName("icon-up-open-1")
+ id$(p_button).removeClassName(" icon-down-open-2")
} else {
- g(p_button).removeClassName("icon-up-open-1")
- g(p_button).addClassName(" icon-down-open-2")
+ id$(p_button).removeClassName("icon-up-open-1")
+ id$(p_button).addClassName(" icon-down-open-2")
}
@@ -459,7 +460,7 @@ function success_misc(req) {
var nodeXml = html[0];
var code_html = getNodeText(nodeXml);
code_html = unescape_xml(code_html);
- $("user_cal").innerHTML = code_html;
+ id$("user_cal").innerHTML = code_html;
} catch (e) {
alert_box(e.message);
}
@@ -523,9 +524,9 @@ function cat_doc_remove(p_dt_id, p_dossier) {
alert_box('erreur
' + message_text);
return;
}
- $('row' + row_id).style.textDecoration = "line-through";
- $('X' + row_id).style.display = 'none';
- $('M' + row_id).style.display = 'none';
+ id$('row' + row_id).style.textDecoration = "line-through";
+ id$('X' + row_id).style.display = 'none';
+ id$('M' + row_id).style.display = 'none';
} catch (e) {
alert_box(e.message);
}
@@ -553,7 +554,7 @@ function cat_doc_change(p_dt_id, p_dossier) {
onSuccess: function (req) {
remove_waiting_box();
add_div({id: 'change_doc_div', style: str_style, cssclass: 'inner_box', drag: "1"});
- $('change_doc_div').innerHTML = req.responseText;
+ id$('change_doc_div').innerHTML = req.responseText;
}
}
@@ -567,7 +568,7 @@ function cat_doc_change(p_dt_id, p_dossier) {
*/
function popup_select_tva(obj, p_function_callback) {
try {
- if ($('tva_select')) {
+ if (id$('tva_select')) {
removeDiv('tva_select');
}
@@ -612,8 +613,8 @@ function popup_select_tva(obj, p_function_callback) {
'drag': false
};
add_div(popup);
- $('lk_tva_select_table').focus();
- sorttable.makeSortable($('tva_select_table'));
+ id$('lk_tva_select_table').focus();
+ sorttable.makeSortable(id$('tva_select_table'));
if (p_function_callback) {
p_function_callback.call(null);
}
@@ -694,10 +695,10 @@ function create_div(obj) {
try {
var top = document;
var elt = null;
- if (!$(obj.id)) {
+ if (!id$(obj.id)) {
elt = top.createElement('div');
} else {
- elt = $(obj.id);
+ elt = id$(obj.id);
}
if (obj.id) {
elt.setAttribute('id', obj.id);
@@ -766,8 +767,8 @@ function add_div(obj) {
* @param elt id of the elt
*/
function removeDiv(elt) {
- if (g(elt)) {
- document.body.removeChild(g(elt));
+ if (id$(elt)) {
+ document.body.removeChild(id$(elt));
}
// if reloaded if asked the window will be reloaded when
// the box is closed
@@ -778,8 +779,8 @@ function removeDiv(elt) {
}
function waiting_node() {
- $('info_div').innerHTML = 'Un instant';
- $('info_div').style.display = "block";
+ id$('info_div').innerHTML = 'Un instant';
+ id$('info_div').style.display = "block";
}
/**
@@ -793,7 +794,7 @@ function waiting_box() {
};
var y = fixed_position(10, 250)
obj.style = y + ";width:20%;margin-left:40%;";
- if ($('wait_box')) {
+ if (id$('wait_box')) {
removeDiv('wait_box');
}
waiting_node();
@@ -817,7 +818,7 @@ function waiting_box() {
function show_box(obj) {
add_div(obj);
if (!obj.fixed) {
- g(obj.id).style.top = calcy(40) + "px";
+ id$(obj.id).style.top = calcy(40) + "px";
show(obj.id);
} else {
show(obj.id);
@@ -852,11 +853,11 @@ function success_box(req, json) {
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
- g(name_ctl).innerHTML = code_html;
- g(name_ctl).style.height = 'auto';
+ id$(name_ctl).innerHTML = code_html;
+ id$(name_ctl).style.height = 'auto';
if (name_ctl == 'popup')
- g(name_ctl).style.width = 'auto';
+ id$(name_ctl).style.width = 'auto';
} catch (e) {
alert_box("success_box" + e.message);
}
@@ -879,10 +880,10 @@ function show_ledger_choice(json_obj) {
waiting_box();
var i = 0;
var query = "gDossier=" + json_obj.dossier + '&type=' + json_obj.type + '&div=' + json_obj.div + '&op=ledger_show';
- query = query + '&nbjrn=' + $(json_obj.div + 'nb_jrn').value;
+ query = query + '&nbjrn=' + id$(json_obj.div + 'nb_jrn').value;
query = query + '&all_type=' + json_obj.all_type;
- for (i = 0; i < $(json_obj.div + 'nb_jrn').value; i++) {
- query = query + "&r_jrn[]=" + $(json_obj.div + 'r_jrn[' + i + ']').value;
+ for (i = 0; i < id$(json_obj.div + 'nb_jrn').value; i++) {
+ query = query + "&r_jrn[]=" + id$(json_obj.div + 'r_jrn[' + i + ']').value;
}
query = encodeURI(query);
var action = new Ajax.Request(
@@ -926,7 +927,7 @@ function show_ledger_choice(json_obj) {
code_html = unescape_xml(code_html);
remove_waiting_box();
- g(obj.id).innerHTML = code_html;
+ id$(obj.id).innerHTML = code_html;
} catch (e) {
alert_box("show_ledger_callback" + e.message);
@@ -951,10 +952,10 @@ function show_ledger_choice(json_obj) {
*/
function hide_ledger_choice(p_frm_search) {
try {
- var nb = $(p_frm_search).nb_jrn.value;
+ var nb = id$(p_frm_search).nb_jrn.value;
var div = "";
- if ($(p_frm_search).div) {
- div = $(p_frm_search).div.value;
+ if (id$(p_frm_search).div) {
+ div = id$(p_frm_search).div.value;
}
var i = 0;
var str = "";
@@ -964,13 +965,13 @@ function hide_ledger_choice(p_frm_search) {
for (i = 0; i < nb; i++) {
n_name = div + "r_jrn[" + sel + "]";
name = div + "r_jrn" + i;
- if ($(name).checked) {
- str += '';
+ if (id$(name).checked) {
+ str += '';
sel++;
}
}
str += '';
- $('ledger_id' + div).innerHTML = str;
+ id$('ledger_id' + div).innerHTML = str;
removeDiv(div + 'jrn_search');
return false;
} catch (e) {
@@ -984,14 +985,14 @@ function hide_ledger_choice(p_frm_search) {
* show the cat of ledger choice
*/
function show_cat_choice() {
- g('div_cat').style.visibility = 'visible';
+ id$('div_cat').style.visibility = 'visible';
}
/**
* hide the cat of ledger choice
*/
function hide_cat_choice() {
- g('div_cat').style.visibility = 'hidden';
+ id$('div_cat').style.visibility = 'hidden';
}
/**
@@ -999,12 +1000,12 @@ function hide_cat_choice() {
*/
function for_add_row(tableid) {
style = 'class="input_text"';
- var mytable = g(tableid).tBodies[0];
+ var mytable = id$(tableid).tBodies[0];
var nNumberRow = mytable.rows.length;
var oRow = mytable.insertRow(nNumberRow);
var rowToCopy = mytable.rows[1];
var nNumberCell = rowToCopy.cells.length;
- var nb = g("nbrow");
+ var nb = id$("nbrow");
var oNewRow = mytable.insertRow(nNumberRow);
for (var e = 0; e < nNumberCell; e++) {
var newCell = oRow.insertCell(e);
@@ -1019,10 +1020,10 @@ function for_add_row(tableid) {
newCell.innerHTML = new_tt;
new_tt.evalScripts();
}
- $("an_cat_acc" + nb.value).value = "";
- $("an_qc" + nb.value).value = "";
- $("an_label" + nb.value).value = "";
- $("an_cat_amount" + nb.value).value = "0";
+ id$("an_cat_acc" + nb.value).value = "";
+ id$("an_qc" + nb.value).value = "";
+ id$("an_label" + nb.value).value = "";
+ id$("an_cat_amount" + nb.value).value = "0";
nb.value++;
}
@@ -1031,7 +1032,7 @@ function for_add_row(tableid) {
* @param form_id id of the form
*/
function toggle_checkbox(form_id) {
- var form = g(form_id);
+ var form = id$(form_id);
for (var i = 0; i < form.length; i++) {
var e = form.elements[i];
if (e.type === 'checkbox') {
@@ -1049,7 +1050,7 @@ function toggle_checkbox(form_id) {
* @param form_id id of the form
*/
function select_checkbox(form_id) {
- var form = $(form_id);
+ var form = id$(form_id);
for (var i = 0; i < form.length; i++) {
var e = form.elements[i];
if (e.type === 'checkbox') {
@@ -1066,7 +1067,7 @@ function select_checkbox(form_id) {
* @param attribute value
*/
function select_checkbox_attribute(form_id, p_attribute_name, p_attribute_value) {
- var form = $(form_id);
+ var form = id$(form_id);
for (var i = 0; i < form.length; i++) {
var e = form.elements[i];
if (e.type === 'checkbox' && e.getAttribute(p_attribute_name) == p_attribute_value) {
@@ -1080,7 +1081,7 @@ function select_checkbox_attribute(form_id, p_attribute_name, p_attribute_value)
* @param form_id id of the form
*/
function unselect_checkbox(form_id) {
- var form = $(form_id);
+ var form = id$(form_id);
for (var i = 0; i < form.length; i++) {
var e = form.elements[i];
if (e.type === 'checkbox') {
@@ -1093,7 +1094,7 @@ function unselect_checkbox(form_id) {
* show the calculator
*/
function show_calc() {
- if (g('calc1')) {
+ if (id$('calc1')) {
this.document.getElementById('inp').value = "";
this.document.getElementById('inp').focus();
return;
@@ -1126,7 +1127,7 @@ function display_periode(p_dossier, p_id) {
'style': 'width:30em',
'drag': true
};
- if (!$('mod_periode')) {
+ if (!id$('mod_periode')) {
add_div(popup);
}
var action = new Ajax.Request(
@@ -1138,8 +1139,8 @@ function display_periode(p_dossier, p_id) {
onSuccess: success_display_periode
}
);
- $('mod_periode').style.top = (posY - 70) + "px";
- $('mod_periode').style.left = (posX - 70) + "px";
+ id$('mod_periode').style.top = (posY - 70) + "px";
+ id$('mod_periode').style.left = (posX - 70) + "px";
} catch (e) {
alert_box("display_periode " + e.message);
}
@@ -1160,7 +1161,7 @@ function success_display_periode(req) {
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
- $('mod_periode').innerHTML = code_html;
+ id$('mod_periode').innerHTML = code_html;
} catch (e) {
alert_box("success_display_periode".e.message);
}
@@ -1174,7 +1175,7 @@ function success_display_periode(req) {
function save_periode(obj) {
try {
- var queryString = $(obj).serialize() + "&op=save_per";
+ var queryString = id$(obj).serialize() + "&op=save_per";
var action = new Ajax.Request(
"ajax_misc.php",
@@ -1219,7 +1220,7 @@ function fill_box(req) {
var name_ctl = a[0].firstChild.nodeValue;
var code_html = getNodeText(html[0]); // Firefox ne prend que les 4096 car.
code_html = unescape_xml(code_html);
- $(name_ctl).innerHTML = code_html;
+ id$(name_ctl).innerHTML = code_html;
} catch (e) {
alert_box(e.message);
if (console) {
@@ -1269,7 +1270,7 @@ function mod_predf_op(dossier_id, od_id, p_ledger) {
function save_predf_op(obj) {
waiting_box();
- var querystring = $(obj).serialize() + '&op=save_predf';
+ var querystring = id$(obj).serialize() + '&op=save_predf';
// Create a ajax request to get all the person
var action = new Ajax.Request('ajax_misc.php',
{
@@ -1297,12 +1298,12 @@ function save_predf_op(obj) {
function search_reconcile(dossier, ctl_concern, amount_id, ledger, p_id_target, p_tiers) {
if (amount_id === undefined) {
amount_id = 0;
- } else if ($(amount_id)) {
- if ($(amount_id).value) {
- amount_id = $(amount_id).value;
+ } else if (id$(amount_id)) {
+ if (id$(amount_id).value) {
+ amount_id = id$(amount_id).value;
} else if
- ($(amount_id).innerHTML) {
- amount_id = $(amount_id).innerHTML;
+ (id$(amount_id).innerHTML) {
+ amount_id = id$(amount_id).innerHTML;
}
}
var tiers = "";
@@ -1318,8 +1319,8 @@ function search_reconcile(dossier, ctl_concern, amount_id, ledger, p_id_target,
var str_style = fixed_position(77, 99);
str_style += ";width:92%;overflow:auto;";
waiting_box();
- var hide_operation = $(ctl_concern).getAttribute("hide_operation");
- var single_operation = $(ctl_concern).getAttribute("single_operation");
+ var hide_operation = id$(ctl_concern).getAttribute("hide_operation");
+ var single_operation = id$(ctl_concern).getAttribute("single_operation");
var param_send = {
gDossier: dossier,
@@ -1345,7 +1346,7 @@ function search_reconcile(dossier, ctl_concern, amount_id, ledger, p_id_target,
remove_waiting_box();
var div = {id: target, cssclass: 'inner_box', style: str_style, drag: 0};
add_div(div);
- $(target).innerHTML = req.responseText;
+ id$(target).innerHTML = req.responseText;
req.responseText.evalScripts();
}
}
@@ -1357,11 +1358,11 @@ function search_reconcile(dossier, ctl_concern, amount_id, ledger, p_id_target,
*/
function search_operation(obj) {
try {
- var dossier = g('gDossier').value;
+ var dossier = id$('gDossier').value;
waiting_box();
var target = "search" + layer;
- if ($(obj)["target"]) {
- target = $(obj)["target"].value;
+ if (id$(obj)["target"]) {
+ target = id$(obj)["target"].value;
}
var qs = Form.serialize('search_form_ajx') + "&op=search_op";
var action = new Ajax.Request('ajax_misc.php',
@@ -1371,7 +1372,7 @@ function search_operation(obj) {
onFailure: null,
onSuccess: function (req) {
remove_waiting_box();
- $(target).innerHTML = req.responseText;
+ id$(target).innerHTML = req.responseText;
req.responseText.evalScripts();
}
}
@@ -1405,13 +1406,13 @@ function set_reconcile(obj) {
if (elmt.checked === true) {
var str_name = elmt.name;
var nValue = str_name.replace("jr_concerned", "");
- if ($(ctlc.value).value != '') {
- $(ctlc.value).value += ',';
+ if (id$(ctlc.value).value != '') {
+ id$(ctlc.value).value += ',';
} else {
if (tiers && tiers.value != "") {
- $(tiers.value).value = elmt.value;
+ id$(tiers.value).value = elmt.value;
/* set the name */
new Ajax.Request("fid.php", {
method: "get",
@@ -1423,15 +1424,15 @@ function set_reconcile(obj) {
var num = tiers_card.replace("e_other", "");
var tiers_name_id = "e_other" + "_name" + num;
var answer = req.responseText.evalJSON();
- $(tiers_name_id).value = answer["name"];
+ id$(tiers_name_id).value = answer["name"];
}
});
}
}
if (single_operation == 0) {
- $(ctlc.value).value += nValue;
+ id$(ctlc.value).value += nValue;
} else {
- $(ctlc.value).value = nValue;
+ id$(ctlc.value).value = nValue;
}
}
@@ -1444,13 +1445,13 @@ function set_reconcile(obj) {
}
function remove_waiting_node() {
- $('info_div').innerHTML = "";
- $('info_div').style.display = "none";
+ id$('info_div').innerHTML = "";
+ id$('info_div').style.display = "none";
}
function remove_waiting_box() {
- if ($('wait_box')) {
+ if (id$('wait_box')) {
Effect.Fade('wait_box', {duration: 0.6});
}
@@ -1474,10 +1475,10 @@ function get_profile_detail(gDossier, profile_id) {
onFailure: null,
onSuccess: function (req) {
remove_waiting_box();
- $('list_profile').hide();
- $('detail_profile').innerHTML = req.responseText;
+ id$('list_profile').hide();
+ id$('detail_profile').innerHTML = req.responseText;
req.responseText.evalScripts();
- $('detail_profile').show();
+ id$('detail_profile').show();
if (profile_id != "-1")
profile_show('profile_gen_div');
}
@@ -1539,7 +1540,7 @@ function mod_menu(gdossier, pm_id) {
try {
remove_waiting_box();
add_div({id: "divdm" + pm_id, drag: 1, cssclass: "inner_box", style: pos});
- $('divdm' + pm_id).innerHTML = req.responseText;
+ id$('divdm' + pm_id).innerHTML = req.responseText;
} catch (e) {
alert_box(e.message);
}
@@ -1571,13 +1572,13 @@ function display_sub_menu(p_dossier, p_profile, p_dep, p_level) {
onSuccess: function (req) {
try {
remove_waiting_box();
- if ($('menu_table').rows.length > p_level) {
- $('menu_table').rows[1].remove();
+ if (id$('menu_table').rows.length > p_level) {
+ id$('menu_table').rows[1].remove();
}
- $('sub' + p_dep).addClassName("selectedmenu");
+ id$('sub' + p_dep).addClassName("selectedmenu");
var new_row = document.createElement('TR');
new_row.innerHTML = req.responseText;
- $('menu_table').appendChild(new_row);
+ id$('menu_table').appendChild(new_row);
} catch (e) {
alert_box(e.message);
}
@@ -1605,9 +1606,9 @@ function remove_sub_menu(p_dossier, profile_menu_id) {
onSuccess: function (req) {
try {
remove_waiting_box();
- $('sub' + profile_menu_id).remove();
- if ($('menu_table').rows.length > 1) {
- $('menu_table').rows[1].remove();
+ id$('sub' + profile_menu_id).remove();
+ if (id$('menu_table').rows.length > 1) {
+ id$('menu_table').rows[1].remove();
}
} catch (e) {
@@ -1655,7 +1656,7 @@ function add_menu(obj) {
try {
remove_waiting_box();
add_div({id: "divdm" + p_id, drag: 1, "cssclass": "inner_box", "style": pos});
- $('divdm' + p_id).innerHTML = req.responseText;
+ id$('divdm' + p_id).innerHTML = req.responseText;
} catch (e) {
alert_box(e.message);
}
@@ -1685,7 +1686,7 @@ function add_plugin(p_dossier) {
remove_waiting_box();
var pos = fixed_position(250, 150) + ";width:30%";
add_div({id: "divplugin", drag: 1, cssclass: "inner_box", style: pos});
- $('divplugin').innerHTML = req.responseText;
+ id$('divplugin').innerHTML = req.responseText;
} catch (e) {
alert_box(e.message);
}
@@ -1715,7 +1716,7 @@ function mod_plugin(p_dossier, me_code) {
remove_waiting_box();
var pos = fixed_position(250, 150) + ";width:30%";
add_div({id: "divplugin", drag: 1, cssclass: "inner_box", style: pos});
- $('divplugin').innerHTML = req.responseText;
+ id$('divplugin').innerHTML = req.responseText;
} catch (e) {
alert_box(e.message);
@@ -1745,7 +1746,7 @@ function create_menu(p_dossier) {
cssclass: "inner_box",
style: pos
});
- $('divmenu').innerHTML = req.responseText;
+ id$('divmenu').innerHTML = req.responseText;
} catch (e) {
alert_box(e.message);
}
@@ -1774,7 +1775,7 @@ function modify_menu(p_dossier, me_code) {
cssclass: "inner_box",
style: pos
});
- $('divmenu').innerHTML = req.responseText;
+ id$('divmenu').innerHTML = req.responseText;
} catch (e) {
alert_box(e.message);
@@ -1799,7 +1800,7 @@ function get_properties(obj) {
*/
function rapport_add_row(p_dossier) {
style = 'style="border: 1px solid blue;"';
- var table = $("rap1");
+ var table = id$("rap1");
var line = table.rows.length;
var row = table.insertRow(line);
@@ -1818,7 +1819,7 @@ function rapport_add_row(p_dossier) {
cellbutton.innerHTML = but_html;
but_html.evalScripts();
- g('form' + line).value = '';
+ id$('form' + line).value = '';
}
/**
@@ -1827,7 +1828,7 @@ function rapport_add_row(p_dossier) {
function search_action(dossier, ctl_concern) {
try {
waiting_box();
- var dossier = g('gDossier').value;
+ var dossier = id$('gDossier').value;
var target = "search_action_div";
removeDiv(target);
@@ -1854,7 +1855,7 @@ function search_action(dossier, ctl_concern) {
try {
remove_waiting_box();
add_div(div);
- $('search_action_div').innerHTML = req.responseText;
+ id$('search_action_div').innerHTML = req.responseText;
req.responseText.evalScripts();
} catch (e) {
alert_box(e.message);
@@ -1869,7 +1870,7 @@ function search_action(dossier, ctl_concern) {
function result_search_action(obj) {
try {
- var queryString = $(obj).serialize() + "&op=search_action";
+ var queryString = id$(obj).serialize() + "&op=search_action";
var action = new Ajax.Request(
"ajax_misc.php",
{
@@ -1879,7 +1880,7 @@ function result_search_action(obj) {
onSuccess: function (req) {
try {
remove_waiting_box();
- $('search_action_div').innerHTML = req.responseText;
+ id$('search_action_div').innerHTML = req.responseText;
req.responseText.evalScripts();
} catch (e) {
alert_box(e.message);
@@ -1898,7 +1899,7 @@ function result_search_action(obj) {
function set_action_related(p_obj) {
try {
- var obj = $(p_obj);
+ var obj = id$(p_obj);
var ctlc = obj.elements['ctlc'];
for (var e = 0; e < obj.elements.length; e++) {
@@ -1908,10 +1909,10 @@ function set_action_related(p_obj) {
if (elmt.checked === true) {
var str_name = elmt.name;
var nValue = elmt.value;
- if ($(ctlc.value).value != '') {
- $(ctlc.value).value += ',';
+ if (id$(ctlc.value).value != '') {
+ id$(ctlc.value).value += ',';
}
- $(ctlc.value).value += nValue;
+ id$(ctlc.value).value += nValue;
}
}
}
@@ -1944,7 +1945,7 @@ function stock_repo_change(p_dossier, r_id) {
onSuccess: function (req) {
remove_waiting_box();
add_div({id: 'change_stock_repo_div', style: str_style, cssclass: 'inner_box', drag: "1"});
- $('change_stock_repo_div').innerHTML = req.responseText;
+ id$('change_stock_repo_div').innerHTML = req.responseText;
}
}
@@ -1967,7 +1968,7 @@ function stock_inv_detail(p_dossier, p_id) {
onSuccess: function (req) {
remove_waiting_box();
add_div({id: 'view_mod_stock_div', style: str_style, cssclass: 'inner_box', drag: "1"});
- $('view_mod_stock_div').innerHTML = req.responseText;
+ id$('view_mod_stock_div').innerHTML = req.responseText;
req.responseText.evalScripts();
}
}
@@ -1976,23 +1977,23 @@ function stock_inv_detail(p_dossier, p_id) {
function show_fin_chdate(obj_id) {
try {
- var ch = $(obj_id).options[$(obj_id).selectedIndex].value;
+ var ch = id$(obj_id).options[id$(obj_id).selectedIndex].value;
if (ch == 2) {
- $('chdate_ext').hide();
- $('thdate').show();
+ id$('chdate_ext').hide();
+ id$('thdate').show();
}
if (ch == 1) {
- $('chdate_ext').show();
- $('thdate').hide();
+ id$('chdate_ext').show();
+ id$('thdate').hide();
}
- var nb = $('nb_item').value;
+ var nb = id$('nb_item').value;
for (i = 0; i < nb; i++) {
- if ($('tdchdate' + i)) {
+ if (id$('tdchdate' + i)) {
if (ch == 2) {
- $('tdchdate' + i).show();
+ id$('tdchdate' + i).show();
}
if (ch == 1) {
- $('tdchdate' + i).hide();
+ id$('tdchdate' + i).hide();
}
}
@@ -2009,18 +2010,18 @@ function profile_show(p_div) {
try {
var div = ['profile_gen_div', 'profile_menu_div', 'profile_print_div', 'profile_gestion_div', 'profile_repo_div', 'profile_menu_mobile_div'];
for (var r = 0; r < div.length; r++) {
- $(div[r]).hide();
+ id$(div[r]).hide();
}
- $(p_div).show();
+ id$(p_div).show();
} catch (e) {
alert_box(e.message);
}
}
function detail_category_show(p_div, p_dossier, p_id) {
- $(p_div).show();
+ id$(p_div).show();
waiting_box();
- $('detail_category_div').innerHTML = "";
+ id$('detail_category_div').innerHTML = "";
var queryString = "gDossier=" + p_dossier + "&id=" + p_id + "&op=fddetail";
var action = new Ajax.Request(
"ajax_misc.php",
@@ -2029,9 +2030,9 @@ function detail_category_show(p_div, p_dossier, p_id) {
onFailure: ajax_misc_failure,
onSuccess: function (req) {
remove_waiting_box();
- $('list_cat_div').hide();
- $('detail_category_div').innerHTML = req.responseText;
- $('detail_category_div').show();
+ id$('list_cat_div').hide();
+ id$('detail_category_div').innerHTML = req.responseText;
+ id$('detail_category_div').show();
req.responseText.evalScripts();
}
}
@@ -2043,7 +2044,7 @@ function detail_category_show(p_div, p_dossier, p_id) {
*/
function check_new_category()
{
- if ( $('nom_mod_id').value.trim()=="") {
+ if ( id$('nom_mod_id').value.trim()=="") {
new Effect.Highlight('nom_mod_id',{startcolor:"#ff0000"});
smoke.alert('Nom catégorie obligatoire');
return false;
@@ -2085,7 +2086,7 @@ function check_date(p_str_date) {
* @see check_date
*/
function check_date_id(p_id_date) {
- var str_date = $(p_id_date).value;
+ var str_date = id$(p_id_date).value;
return check_date(str_date);
}
@@ -2133,7 +2134,7 @@ function view_action(ag_id, dossier, modify) {
cssclass: "inner_box",
style: pos
});
- $(id).innerHTML = code_html;
+ id$(id).innerHTML = code_html;
if (ctl_txt == 'ok') {
// compute detail
var detail = in_child(id, "follow_up_detail");
@@ -2162,9 +2163,9 @@ function view_action(ag_id, dossier, modify) {
* @see HtmlInput::filter_table
*/
function filter_table(phrase, _id, colnr, start_row) {
- $('info_div').innerHTML = content[65];
- $('info_div').style.display = "block";
- var words = $(phrase).value.toLowerCase();
+ id$('info_div').innerHTML = content[65];
+ id$('info_div').style.display = "block";
+ var words = id$(phrase).value.toLowerCase();
var table = document.getElementById(_id);
// if colnr contains a comma then check several columns
@@ -2196,20 +2197,20 @@ function filter_table(phrase, _id, colnr, start_row) {
} else {
table.rows[r].style.display = 'none';
}
- $('info_div').style.display = "none";
- $('info_div').innerHTML = "";
+ id$('info_div').style.display = "none";
+ id$('info_div').innerHTML = "";
}
if (tot_found == 0) {
- if ($('info_' + _id)) {
- $('info_' + _id).innerHTML = content[69];
+ if (id$('info_' + _id)) {
+ id$('info_' + _id).innerHTML = content[69];
}
} else {
- if ($('info_' + _id)) {
- $('info_' + _id).innerHTML = " ";
+ if (id$('info_' + _id)) {
+ id$('info_' + _id).innerHTML = " ";
}
}
- $('info_div').style.display = "none";
- $('info_div').innerHTML = "";
+ id$('info_div').style.display = "none";
+ id$('info_div').innerHTML = "";
}
/**
@@ -2220,9 +2221,9 @@ function filter_table(phrase, _id, colnr, start_row) {
* @see HtmlInput::filter_list
*/
function filter_list(phrase, _id) {
- $('info_div').innerHTML = content[65];
- $('info_div').style.display = "block";
- var words = $(phrase).value.toLowerCase();
+ id$('info_div').innerHTML = content[65];
+ id$('info_div').style.display = "block";
+ var words = id$(phrase).value.toLowerCase();
var l_list = document.getElementById(_id);
@@ -2252,16 +2253,16 @@ function filter_list(phrase, _id) {
}
if (tot_found == 0) {
- if ($('info_' + _id)) {
- $('info_' + _id).innerHTML = content[69];
+ if (id$('info_' + _id)) {
+ id$('info_' + _id).innerHTML = content[69];
}
} else {
- if ($('info_' + _id)) {
- $('info_' + _id).innerHTML = " ";
+ if (id$('info_' + _id)) {
+ id$('info_' + _id).innerHTML = " ";
}
}
- $('info_div').style.display = "none";
- $('info_div').innerHTML = "";
+ id$('info_div').style.display = "none";
+ id$('info_div').innerHTML = "";
}
/**
@@ -2272,9 +2273,9 @@ function filter_list(phrase, _id) {
* @see HtmlInput::filter_list
*/
function filter_multiselect(phrase, _id) {
- $('info_div').innerHTML = content[65];
- $('info_div').style.display = "block";
- var words = $(phrase).value.toLowerCase();
+ id$('info_div').innerHTML = content[65];
+ id$('info_div').style.display = "block";
+ var words = id$(phrase).value.toLowerCase();
var l_list = document.getElementById(_id);
var tot_found = 0;
@@ -2289,16 +2290,16 @@ function filter_multiselect(phrase, _id) {
} else {
l_list.options[r].style.display = 'none';
}
- $('info_div').style.display = "none";
- $('info_div').innerHTML = "";
+ id$('info_div').style.display = "none";
+ id$('info_div').innerHTML = "";
}
if (tot_found == 0) {
- if ($('info_' + _id)) {
- $('info_' + _id).innerHTML = content[69];
+ if (id$('info_' + _id)) {
+ id$('info_' + _id).innerHTML = content[69];
}
} else {
- if ($('info_' + _id)) {
- $('info_' + _id).innerHTML = " ";
+ if (id$('info_' + _id)) {
+ id$('info_' + _id).innerHTML = " ";
}
}
}
@@ -2309,10 +2310,10 @@ function filter_multiselect(phrase, _id) {
*/
function display_task(p_id) {
- $(p_id).style.top = posY + 'px';
- $(p_id).style.left = "10%";
- $(p_id).style.width = "80%";
- $(p_id).style.display = 'block';
+ id$(p_id).style.top = posY + 'px';
+ id$(p_id).style.left = "10%";
+ id$(p_id).style.width = "80%";
+ id$(p_id).style.display = 'block';
}
@@ -2321,15 +2322,15 @@ function display_task(p_id) {
* Set a message in the info
*/
function info_message(p_message) {
- $('info_div').innerHTML = p_message;
- $('info_div').style.display = "block";
+ id$('info_div').innerHTML = p_message;
+ id$('info_div').style.display = "block";
}
/**
* hide the info box
*/
function info_hide() {
- $('info_div').style.display = "none";
+ id$('info_div').style.display = "none";
}
/**
@@ -2349,10 +2350,10 @@ function ask_navigator(p_dossier) {
onSuccess: function (req) {
remove_waiting_box();
add_div({id: 'navi_div', style: 'top:2em;', cssclass: 'inner_box'});
- $('navi_div').innerHTML = req.responseText;
+ id$('navi_div').innerHTML = req.responseText;
try {
req.responseText.evalScripts();
- sorttable.makeSortable($("navi_tb"));
+ sorttable.makeSortable(id$("navi_tb"));
} catch (e) {
alert_box("answer_box Impossible executer script de la reponse\n" + e.message);
}
@@ -2387,7 +2388,7 @@ function set_preference(p_dossier) {
return;
}
add_div({id: 'preference_div', drag: 1});
- $('preference_div').innerHTML = req.responseText;
+ id$('preference_div').innerHTML = req.responseText;
try {
req.responseText.evalScripts();
} catch (e) {
@@ -2422,7 +2423,7 @@ function show_bookmark(p_dossier) {
onSuccess: function (req) {
remove_waiting_box();
add_div({id: 'bookmark_div', cssclass: 'inner_box', drag: 1});
- $('bookmark_div').innerHTML = req.responseText;
+ id$('bookmark_div').innerHTML = req.responseText;
try {
req.responseText.evalScripts();
} catch (e) {
@@ -2444,7 +2445,7 @@ function show_bookmark(p_dossier) {
function save_bookmark() {
try {
waiting_box();
- var queryString = "op=bookmark&" + $("bookmark_frm").serialize();
+ var queryString = "op=bookmark&" + id$("bookmark_frm").serialize();
var action = new Ajax.Request(
"ajax_misc.php",
{
@@ -2454,7 +2455,7 @@ function save_bookmark() {
remove_waiting_box();
// removeDiv('bookmark_div');
//
- $('bookmark_div').innerHTML = req.responseText;
+ id$('bookmark_div').innerHTML = req.responseText;
try {
req.responseText.evalScripts();
} catch (e) {
@@ -2476,7 +2477,7 @@ function save_bookmark() {
function remove_bookmark() {
try {
waiting_box();
- var queryString = "op=bookmark&" + $("bookmark_del_frm").serialize();
+ var queryString = "op=bookmark&" + id$("bookmark_del_frm").serialize();
var action = new Ajax.Request(
"ajax_misc.php",
{
@@ -2484,7 +2485,7 @@ function remove_bookmark() {
onFailure: ajax_misc_failure,
onSuccess: function (req) {
remove_waiting_box();
- $('bookmark_div').innerHTML = req.responseText;
+ id$('bookmark_div').innerHTML = req.responseText;
try {
req.responseText.evalScripts();
} catch (e) {
@@ -2506,8 +2507,8 @@ function remove_bookmark() {
*@note there is no protection
*/
function error_message(message) {
- $('error_content_div').innerHTML = message;
- $('error_div').style.visibility = 'visible';
+ id$('error_content_div').innerHTML = message;
+ id$('error_div').style.visibility = 'visible';
}
/**
@@ -2534,7 +2535,7 @@ function show_tag(p_dossier, p_ac, p_tag_id, p_post) {
remove_waiting_box();
var posy = calcy(250);
add_div({id: 'tag_div', cssclass: 'inner_box', drag: 0, style: "position:fixed;top:15%;"});
- $('tag_div').innerHTML = code_html;
+ id$('tag_div').innerHTML = code_html;
try {
code_html.evalScripts();
} catch (e) {
@@ -2555,7 +2556,7 @@ function show_tag(p_dossier, p_ac, p_tag_id, p_post) {
function save_tag() {
try {
waiting_box();
- var queryString = "op=tag_save&" + $("tag_detail_frm").serialize();
+ var queryString = "op=tag_save&" + id$("tag_detail_frm").serialize();
var action = new Ajax.Request(
"ajax_misc.php",
{
@@ -2604,7 +2605,7 @@ function action_tag_select(p_dossier, ag_id) {
add_div({id: 'tag_div', style: pos, cssclass: 'inner_box tag', drag: 0});
remove_waiting_box();
- $('tag_div').innerHTML = code_html;
+ id$('tag_div').innerHTML = code_html;
}
}
);
@@ -2639,7 +2640,7 @@ function action_tag_add(p_dossier, ag_id, t_id, p_isgroup) {
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
remove_waiting_box();
- $('action_tag_td').innerHTML = code_html;
+ id$('action_tag_td').innerHTML = code_html;
removeDiv('tag_div');
}
}
@@ -2675,7 +2676,7 @@ function action_tag_remove(p_dossier, ag_id, t_id) {
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
remove_waiting_box();
- $('action_tag_td').innerHTML = code_html;
+ id$('action_tag_td').innerHTML = code_html;
}
}
@@ -2701,8 +2702,8 @@ function activate_tag(p_dossier, p_tag_id) {
remove_waiting_box();
var answer = req.responseText.evalJSON();
var tagId = "tag_onoff" + p_tag_id;
- $(tagId).update(answer.code);
- $(tagId).setStyle(answer.style);
+ id$(tagId).update(answer.code);
+ id$(tagId).setStyle(answer.style);
remove_waiting_box();
}
})
@@ -2737,10 +2738,10 @@ function search_display_tag(p_dossier, p_prefix, p_object) {
code_html = unescape_xml(code_html);
remove_waiting_box();
add_div({id: p_prefix + 'tag_div', style: 'left:10%;width:70%', cssclass: 'inner_box', drag: 1});
- $(p_prefix + 'tag_div').style.top = calcy(200) + "px"
- $(p_prefix + 'tag_div').style.left = 20 + "%";
+ id$(p_prefix + 'tag_div').style.top = calcy(200) + "px"
+ id$(p_prefix + 'tag_div').style.left = 20 + "%";
remove_waiting_box();
- $(p_prefix + 'tag_div').innerHTML = code_html;
+ id$(p_prefix + 'tag_div').innerHTML = code_html;
code_html.evalScripts();
}
}
@@ -2762,7 +2763,7 @@ function search_add_tag(p_dossier, p_tag_id, p_prefix, p_obj) {
try {
var clear_button = 0;
if (tag_choose === '' && p_prefix === 'search') {
- tag_choose = $(p_prefix + 'tag_choose_td').innerHTML;
+ tag_choose = id$(p_prefix + 'tag_choose_td').innerHTML;
clear_button = 1;
}
waiting_box();
@@ -2782,7 +2783,7 @@ function search_add_tag(p_dossier, p_tag_id, p_prefix, p_obj) {
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
remove_waiting_box();
- $(p_prefix + 'tag_choose_td').innerHTML = $(p_prefix + 'tag_choose_td').innerHTML + code_html;
+ id$(p_prefix + 'tag_choose_td').innerHTML = id$(p_prefix + 'tag_choose_td').innerHTML + code_html;
removeDiv(p_prefix + 'tag_div');
}
}
@@ -2798,7 +2799,7 @@ function search_add_tag(p_dossier, p_tag_id, p_prefix, p_obj) {
*/
function search_clear_tag(p_dossier, p_prefix) {
if (p_prefix != 'search') {
- $(p_prefix + 'tag_choose_td').innerHTML = "";
+ id$(p_prefix + 'tag_choose_td').innerHTML = "";
return;
}
try {
@@ -2817,7 +2818,7 @@ function search_clear_tag(p_dossier, p_prefix) {
}
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
- $(p_prefix + 'tag_choose_td').innerHTML = code_html;
+ id$(p_prefix + 'tag_choose_td').innerHTML = code_html;
tag_choose = "";
}
}
@@ -2856,8 +2857,8 @@ function calendar_zoom(obj) {
var per_periode = null;
var notitle = 0;
var from = 0;
- if ($(obj.invalue)) {
- per_periode = $(obj.invalue).value;
+ if (id$(obj.invalue)) {
+ per_periode = id$(obj.invalue).value;
}
if (obj.notitle && obj.notitle == 1) {
notitle = 1;
@@ -2895,7 +2896,7 @@ function calendar_zoom(obj) {
if (obj.outdiv === undefined) {
obj.outdiv = 'calendar_zoom_div';
}
- if ($(obj.outdiv) == undefined) {
+ if (id$(obj.outdiv) == undefined) {
var str_style = 'top:10%;min-height:60rem';
// var str_style = fixed_position(0, 120);
add_div({
@@ -2906,8 +2907,8 @@ function calendar_zoom(obj) {
});
}
remove_waiting_box();
- $(obj.outdiv).innerHTML = code_html;
- $(obj.outdiv).show();
+ id$(obj.outdiv).innerHTML = code_html;
+ id$(obj.outdiv).show();
}
}
);
@@ -2924,12 +2925,12 @@ function calendar_zoom(obj) {
function stock_add_row() {
try {
style = 'class="input_text"';
- var mytable = g("stock_tb").tBodies[0];
+ var mytable = id$("stock_tb").tBodies[0];
var ofirstRow = mytable.rows[1];
var line = mytable.rows.length;
var nCell = mytable.rows[1].cells.length;
var row = mytable.insertRow(line);
- var nb = g("row");
+ var nb = id$("row");
for (var e = 0; e < nCell; e++) {
var newCell = row.insertCell(e);
if (mytable.rows[1].cells[e].hasClassName('num')) {
@@ -2944,10 +2945,10 @@ function stock_add_row() {
new_tt.evalScripts();
}
- g("sg_code" + nb.value).innerHTML = ' ';
- g("sg_code" + nb.value).value = '';
- g("label" + nb.value).innerHTML = '';
- g("sg_quantity" + nb.value).value = '0';
+ id$("sg_code" + nb.value).innerHTML = ' ';
+ id$("sg_code" + nb.value).value = '';
+ id$("label" + nb.value).innerHTML = '';
+ id$("sg_quantity" + nb.value).value = '0';
nb.value++;
@@ -2959,8 +2960,8 @@ function stock_add_row() {
}
function show_description(p_id) {
- $('print_desc' + p_id).hide();
- $('input_desc' + p_id).show();
+ id$('print_desc' + p_id).hide();
+ id$('input_desc' + p_id).show();
}
@@ -2996,9 +2997,9 @@ function show_tabs(a_tabs, p_display_tab) {
}
var i = 0;
for (i = 0; i < a_tabs.length; i++) {
- $(a_tabs[i]).hide();
+ id$(a_tabs[i]).hide();
}
- $(p_display_tab).show();
+ id$(p_display_tab).show();
} catch (e) {
alert_box(e.message);
}
@@ -3050,8 +3051,8 @@ function create_anchor_up() {
newElt.setAttribute('id', 'up_top');
newElt.innerHTML = '';
- var parent = $('info_div').parentNode;
- parent.insertBefore(newElt, $('info_div'));
+ var parent = id$('info_div').parentNode;
+ parent.insertBefore(newElt, id$('info_div'));
}
@@ -3074,13 +3075,13 @@ function init_scroll() {
}
;
if (document.viewport.getScrollOffsets().top > 0) {
- if ($('go_up').visible() == false) {
- $('go_up').setOpacity(0.65);
- $('go_up').show();
- $('go_up').style.zIndex = 99;
+ if (id$('go_up').visible() == false) {
+ id$('go_up').setOpacity(0.65);
+ id$('go_up').show();
+ id$('go_up').style.zIndex = 99;
}
} else {
- $('go_up').hide();
+ id$('go_up').hide();
}
}
@@ -3142,7 +3143,7 @@ function confirm_box(p_obj, p_message, p_callback_true, p_waiting) {
if (p_waiting) {
waiting_box();
}
- $(name).submit();
+ id$(name).submit();
}
});
} else {
@@ -3174,7 +3175,7 @@ function alert_box(p_message) {
* @param string p_table id of the table
*/
function alternate_row_color(p_table) {
- var table_colored = $(p_table);
+ var table_colored = id$(p_table);
if (!table_colored.tBodies[0]) return;
var len = table_colored.tBodies[0].rows.length;
@@ -3197,7 +3198,7 @@ function alternate_row_color(p_table) {
* @param p_list {string} DOM id of the list
*/
function alternate_row_color_list(p_list) {
- var list_colored = $(p_list);
+ var list_colored = id$(p_list);
if ( list_colored.children.length==0 ) return;
var len = list_colored.children.length;
@@ -3225,7 +3226,7 @@ function pin(object_id) {
if (aDraggableElement[object_id]) {
aDraggableElement[object_id].destroy();
aDraggableElement[object_id] = undefined;
- $('pin_' + object_id).innerHTML = "";
+ id$('pin_' + object_id).innerHTML = "";
} else {
aDraggableElement[object_id] = new Draggable(object_id, {
starteffect: function () {
@@ -3233,7 +3234,7 @@ function pin(object_id) {
}
}
);
- $('pin_' + object_id).innerHTML = "";
+ id$('pin_' + object_id).innerHTML = "";
}
}
@@ -3245,10 +3246,10 @@ function pin(object_id) {
* @param p_attribute_value the value of the attribute we want to show
*/
function show_only_row(p_table_id, p_attribute_name, p_attribute_value) {
- if (!$(p_table_id)) {
+ if (!id$(p_table_id)) {
throw "Invalide table id"
}
- var mTable = $(p_table_id);
+ var mTable = id$(p_table_id);
var ncount = mTable.rows.length
for (var i = 0; i < ncount; i++) {
var mRow = mTable.rows[i];
@@ -3265,10 +3266,10 @@ function show_only_row(p_table_id, p_attribute_name, p_attribute_value) {
* @param p_table_id table id
*/
function show_all_row(p_table_id) {
- if (!$(p_table_id)) {
+ if (!id$(p_table_id)) {
throw "Invalide table id"
}
- var mTable = $(p_table_id);
+ var mTable = id$(p_table_id);
var ncount = mTable.rows.length
for (var i = 0; i < ncount; i++) {
var mRow = mTable.rows[i];
@@ -3349,7 +3350,7 @@ var Periode = function (p_ledger) {
var answer = req.responseText.evalJSON();
remove_waiting_box();
if (answer.status == "OK") {
- $("row_per_" + p_periode_id).remove();
+ id$("row_per_" + p_periode_id).remove();
alternate_row_color("periode_tbl");
} else {
smoke.alert(answer.content);
@@ -3398,7 +3399,7 @@ var Periode = function (p_ledger) {
"cssclass": "inner_box",
'html': "wait"
});
- $('mod_periode').update(json.content);
+ id$('mod_periode').update(json.content);
}
});
};
@@ -3452,7 +3453,7 @@ var Periode = function (p_ledger) {
remove_waiting_box();
var json = req.responseText.evalJSON();
if (json.status == 'OK') {
- $('row_per_' + p_periode_id).update(json.content);
+ id$('row_per_' + p_periode_id).update(json.content);
new Effect.Highlight('row_per_' + p_periode_id, {startcolor: '#FAD4D4', endcolor: '#F78082'});
} else {
smoke.alert(json.content);
@@ -3492,7 +3493,7 @@ var Periode = function (p_ledger) {
remove_waiting_box();
var json = req.responseText.evalJSON();
if (json.status == 'OK') {
- $('row_per_' + p_periode_id).update(json.content);
+ id$('row_per_' + p_periode_id).update(json.content);
new Effect.Highlight('row_per_' + p_periode_id, {
startcolor: '#FAD4D4',
endcolor: '#F78082'
@@ -3511,7 +3512,7 @@ var Periode = function (p_ledger) {
* @returns {Boolean}
*/
this.save = function (p_frm) {
- var js_param = $(p_frm).serialize(true);
+ var js_param = id$(p_frm).serialize(true);
waiting_box();
js_param["js_var"] = this.js_obj_name;
js_param["act"] = "save";
@@ -3525,7 +3526,7 @@ var Periode = function (p_ledger) {
var answer = req.responseText.evalJSON();
remove_waiting_box();
if (answer.status == "OK") {
- $('row_per_' + js_param['periode_id']).update(answer.content);
+ id$('row_per_' + js_param['periode_id']).update(answer.content);
removeDiv('mod_periode');
new Effect.Highlight('row_per_' + js_param['periode_id'], {
startcolor: '#FAD4D4',
@@ -3582,7 +3583,7 @@ var Periode = function (p_ledger) {
*/
this.insert_periode = function () {
var p_frm = 'insert_periode_frm';
- var js_param = $(p_frm).serialize(true);
+ var js_param = id$(p_frm).serialize(true);
waiting_box();
js_param["js_var"] = this.js_obj_name;
js_param["act"] = "insert_periode";
@@ -3598,11 +3599,11 @@ var Periode = function (p_ledger) {
remove_waiting_box();
if (answer.status == "OK") {
var new_row = document.createElement("tr");
- $('periode_tbl').append(new_row);
+ id$('periode_tbl').append(new_row);
new_row.replace(answer.content);
// hide the form
- $('periode_add').hide();
+ id$('periode_add').hide();
new Effect.Highlight('row_per_' + answer.p_id, {startcolor: '#FAD4D4', endcolor: '#F78082'});
alternate_row_color('periode_tbl');
} else {
@@ -3619,8 +3620,8 @@ var Periode = function (p_ledger) {
* @param p_table_id DOM ID of the table
*/
Periode.filter_exercice = function (p_table_id) {
- var rows = $(p_table_id).rows;
- var selected_value = $('p_exercice_sel').value;
+ var rows = id$(p_table_id).rows;
+ var selected_value = id$('p_exercice_sel').value;
for (var i = 1; i < rows.length; i++) {
var exercice = rows[i].getAttribute("per_exercice");
if (selected_value == -1) {
@@ -3661,7 +3662,7 @@ function progress_bar_start(p_taskid, p_message) {
cssclass: "inner_box",
style: "z-index:1000;position:fixed;top:30%;width:40%;left:30%"
});
- $("message" + progressIdx).update('