javascript scripts for the gestion More...
Go to the source code of this file.
Functions | |
function | check_hour (p_ctl) |
check the format of the hour | |
function | errorRemoveDoc () |
error if a document if removed | |
function | errorRemoveStock () |
error if a document if removed | |
function | remove_action (p_dossier, p_id, ag_id) |
remove the concerned operation of an action | |
function | remove_comment (p_dossier, p_id) |
remove comment of an action | |
function | remove_document (p_dossier, p_id) |
remove an attached document of an action | |
function | remove_operation (p_dossier, p_id) |
remove the concerned operation of an action | |
function | removeStock (s_id, p_dossier) |
remove an attached document of an action | |
function | successRemoveComment (request, json) |
function | successRemoveDoc (request, json) |
success when removing a document | |
function | successRemoveOp (request, json) |
function | successRemoveStock (request, json) |
success when removing a document | |
function | update_document (p_dossier, p_id) |
update the description of an attached document of an action |
javascript scripts for the gestion
Definition in file gestion.js.
function check_hour | ( | p_ctl | ) |
check the format of the hour
p_ctl | is the control where the hour is encoded |
Definition at line 201 of file gestion.js.
function errorRemoveDoc | ( | ) |
error if a document if removed
Definition at line 177 of file gestion.js.
References alert().
Referenced by remove_comment(), remove_document(), remove_operation(), and update_document().
{ alert('Impossible d\'effacer ce document'); }
function errorRemoveStock | ( | ) |
error if a document if removed
Definition at line 244 of file gestion.js.
References alert().
Referenced by removeStock().
{ alert('Impossible d\'effacer '); }
function remove_action | ( | p_dossier, | |
p_id, | |||
ag_id | |||
) |
remove the concerned operation of an action
dossier | |
p_id | id pk action_comment_operation |
Definition at line 116 of file gestion.js.
References ag_id, ajax_misc_failure(), alert(), and style.
{ queryString="gDossier="+p_dossier+"&a=rmaction&id="+p_id+"&ag_id="+ag_id; var action=new Ajax.Request ( "show_document.php", { method:'get', parameters:queryString, onFailure:ajax_misc_failure, onSuccess:function(request,json) { try{ var answer=request.responseText.evalJSON(true); if ( answer.act_id == -1 ) { alert ('Effacement non autorisé');return;} var action="acact"+answer.act_id; $(action).innerHTML=""; var doc="act"+answer.act_id; $(doc).style.color="red"; $(doc).href="javascript:alert('Action Effacée')"; $(doc).style.textDecoration="line-through"; } catch (e){ alert(e.message);} } } ); }
function remove_comment | ( | p_dossier, | |
p_id | |||
) |
remove comment of an action
dossier | |
p_id | pk action_gestion_comment |
Definition at line 147 of file gestion.js.
References errorRemoveDoc(), and successRemoveComment().
{ queryString="gDossier="+p_dossier+"&a=rmcomment&id="+p_id; var action=new Ajax.Request ( "show_document.php", { method:'get', parameters:queryString, onFailure:errorRemoveDoc, onSuccess:successRemoveComment } ); }
function remove_document | ( | p_dossier, | |
p_id | |||
) |
remove an attached document of an action
dossier | |
dt_id | id of the document (pk document:d_id) |
Definition at line 34 of file gestion.js.
References errorRemoveDoc(), and successRemoveDoc().
{ var queryString="gDossier="+p_dossier+"&a=rm&d_id="+p_id; var action=new Ajax.Request ( "show_document.php", { method:'get', parameters:queryString, onFailure:errorRemoveDoc, onSuccess:successRemoveDoc } ); }
function remove_operation | ( | p_dossier, | |
p_id | |||
) |
remove the concerned operation of an action
dossier | |
p_id | id pk action_comment_operation |
Definition at line 80 of file gestion.js.
References errorRemoveDoc(), and successRemoveOp().
{ queryString="gDossier="+p_dossier+"&a=rmop&id="+p_id; var action=new Ajax.Request ( "show_document.php", { method:'get', parameters:queryString, onFailure:errorRemoveDoc, onSuccess:successRemoveOp } ); }
function removeStock | ( | s_id, | |
p_dossier | |||
) |
remove an attached document of an action
dossier | |
dt_id | id of the document (pk document:d_id) |
Definition at line 222 of file gestion.js.
References errorRemoveStock(), and successRemoveStock().
{ if ( ! confirm("Confirmez-vous l'effacement de cette entrée dans le stock?") ) { return; } queryString="gDossier="+p_dossier+"&op=rm_stock&s_id="+s_id; var action=new Ajax.Request ( "ajax_misc.php", { method:'get', parameters:queryString, onFailure:errorRemoveStock, onSuccess:successRemoveStock } ); }
function successRemoveComment | ( | request, | |
json | |||
) |
Definition at line 162 of file gestion.js.
References alert(), and style.
Referenced by remove_comment().
{ var answer=request.responseText.evalJSON(true); if ( answer.agc_id == -1 ) { alert ('Effacement non autorisé');return;} var action="accom"+answer.agc_id; $(action).innerHTML=""; var doc="com"+answer.agc_id; $(doc).style.color="red"; $(doc).href="javascript:alert('Commentaire Effacé')"; $(doc).style.textDecoration="line-through"; }
function successRemoveDoc | ( | request, | |
json | |||
) |
success when removing a document
Definition at line 184 of file gestion.js.
References alert(), and style.
Referenced by remove_document().
{ var answer=request.responseText.evalJSON(true); if ( answer.d_id == -1 ) { alert ('Effacement non autorisé');return;} var action="ac"+answer.d_id; $(action).innerHTML=""; var doc="doc"+answer.d_id; $(doc).style.color="red"; $(doc).href="javascript:alert('Document Effacé')"; $(doc).style.textDecoration="line-through"; $('desc'+answer.d_id).innerHTML=""; }
function successRemoveOp | ( | request, | |
json | |||
) |
Definition at line 95 of file gestion.js.
References alert(), and style.
Referenced by remove_operation().
{ try{ var answer=request.responseText.evalJSON(true); if ( answer.ago_id == -1 ) { alert ('Effacement non autorisé');return;} var action="acop"+answer.ago_id; $(action).innerHTML=""; var doc="op"+answer.ago_id; $(doc).style.color="red"; $(doc).href="javascript:alert('Commentaire Effacé')"; $(doc).style.textDecoration="line-through"; }catch(e){ alert(e.message); } }
function successRemoveStock | ( | request, | |
json | |||
) |
success when removing a document
Definition at line 251 of file gestion.js.
References alert(), and style.
Referenced by removeStock().
{ try { var answer=request.responseText.evalJSON(true); var doc="stock"+answer.d_id; var href="href"+answer.d_id; $(href).innerHTML=''; $(doc).style.color="red"; // $(doc).href="javascript:alert('Stock Effacé')"; $(doc).style.textDecoration="line-through"; } catch (e) { alert("success_box"+e.message); } }
function update_document | ( | p_dossier, | |
p_id | |||
) |
update the description of an attached document of an action
dossier | |
dt_id | id of the document (pk document:d_id) |
Definition at line 54 of file gestion.js.
References errorRemoveDoc(), hide, show, and value.
{ var queryString="gDossier="+p_dossier+"&a=upd_doc&d_id="+p_id; queryString+="&value="+$('input_desc_txt'+p_id).value; var action=new Ajax.Request ( "show_document.php", { method:'get', parameters:queryString, onFailure:errorRemoveDoc, onSuccess:function(req){ $('input_desc'+p_id).hide(); $('print_desc'+p_id).innerHTML=$('input_desc_txt'+p_id).value+'<a class="line" id="desc'+p_id+'" onclick="javascript:show_description('+p_id+')">Modifier</a>'; $('print_desc'+p_id).show(); } } ); return false; }