Adapt for prototype 1.9 and scriptaculous

This commit is contained in:
Dany De Bontridder 2011-10-29 20:59:04 +00:00
parent 726b4a0445
commit d1b42f6e97
19 changed files with 2713 additions and 1515 deletions

View file

@ -32,7 +32,7 @@ function update_predef(p_type,p_direct)
{
var jrn=g("p_jrn").value;
var dossier=g("gDossier").value;
var querystring='?&gDossier='+dossier+'&l='+jrn+'&t='+p_type+'&d='+p_direct;
var querystring='gDossier='+dossier+'&l='+jrn+'&t='+p_type+'&d='+p_direct;
g("p_jrn_predef").value=jrn;
var action=new Ajax.Request(
"get_predef.php",
@ -78,7 +78,7 @@ function update_pj()
{
var jrn=g("p_jrn").value;
var dossier=g("gDossier").value;
var querystring='?&gDossier='+dossier+'&l='+jrn;
var querystring='gDossier='+dossier+'&l='+jrn;
var action=new Ajax.Request(
"get_pj.php",
{
@ -96,7 +96,7 @@ function update_bank()
{
var jrn=g('p_jrn').value;
var dossier=g('gDossier').value;
var qs='?&gDossier='+dossier+'&op=bkname&p_jrn='+jrn;
var qs='gDossier='+dossier+'&op=bkname&p_jrn='+jrn;
var action=new Ajax.Request(
"ajax_misc.php",
{
@ -141,7 +141,7 @@ function get_last_date()
{
var jrn=g('p_jrn').value;
var dossier=g('gDossier').value;
var qs='?&gDossier='+dossier+'&op=lastdate&p_jrn='+jrn;
var qs='gDossier='+dossier+'&op=lastdate&p_jrn='+jrn;
var action=new Ajax.Request(
"ajax_misc.php",
{
@ -303,7 +303,7 @@ function compute_ledger(p_ctl_nb)
g('e_quant'+p_ctl_nb).value=trim(g('e_quant'+p_ctl_nb).value);
var quantity=g('e_quant'+p_ctl_nb).value;
var querystring='?&gDossier='+dossier+'&c='+qcode+'&t='+tva_id+'&p='+price+'&q='+quantity+'&n='+p_ctl_nb;
var querystring='gDossier='+dossier+'&c='+qcode+'&t='+tva_id+'&p='+price+'&q='+quantity+'&n='+p_ctl_nb;
$('sum').hide();
var action=new Ajax.Request(
"compute.php",
@ -591,7 +591,7 @@ function view_history_account(p_value,dossier)
id='det'+layer;
var popup={'id': id,'cssclass':'op_detail','html':loading(),'drag':true};
querystring='?gDossier='+dossier+'&act=de&pcm_val='+p_value+'&div='+id;
querystring='gDossier='+dossier+'&act=de&pcm_val='+p_value+'&div='+id;
add_div(popup);
var action=new Ajax.Request(
"ajax_history.php",
@ -610,7 +610,7 @@ function view_history_account(p_value,dossier)
function update_history_account(obj)
{
try{
var querystring="?div="+obj.div+"&gDossier="+obj.gDossier+"&pcm_val="+obj.pcm_val+"&ex="+obj.select.options[obj.select.selectedIndex].text;
var querystring="div="+obj.div+"&gDossier="+obj.gDossier+"&pcm_val="+obj.pcm_val+"&ex="+obj.select.options[obj.select.selectedIndex].text;
var action=new Ajax.Request(
"ajax_history.php",
{
@ -639,7 +639,7 @@ var popup={'id':
,'html':
loading(),'drag':
true};
querystring='?gDossier='+dossier+'&act=de&f_id='+p_value+'&div='+id;
querystring='gDossier='+dossier+'&act=de&f_id='+p_value+'&div='+id;
add_div(popup);
var action=new Ajax.Request(
"ajax_history.php",
@ -658,7 +658,7 @@ var popup={'id':
function update_history_card(obj)
{
try{
var querystring="?div="+obj.div+"&gDossier="+obj.gDossier+"&f_id="+obj.f_id+"&ex="+obj.select.options[obj.select.selectedIndex].text;
var querystring="div="+obj.div+"&gDossier="+obj.gDossier+"&f_id="+obj.f_id+"&ex="+obj.select.options[obj.select.selectedIndex].text;
var action=new Ajax.Request(
"ajax_history.php",
{
@ -682,7 +682,7 @@ function update_history_card(obj)
*/
function removeOperation(p_jr_id,dossier,div)
{
var qs="?gDossier="+dossier+"&act=rmop&div="+div+"&jr_id="+p_jr_id;
var qs="gDossier="+dossier+"&act=rmop&div="+div+"&jr_id="+p_jr_id;
var action=new Ajax.Request(
"ajax_ledger.php",
{
@ -701,7 +701,7 @@ function removeOperation(p_jr_id,dossier,div)
*/
function reverseOperation(obj)
{
var qs="?"+$(obj).serialize();
var qs=$(obj).serialize();
g('ext'+obj.divname).style.display='none';
g('bext'+obj.divname).style.display='none';
@ -730,7 +730,7 @@ function modifyOperation(p_value,dossier)
,'html':
loading(),'drag':
true};
querystring='?gDossier='+dossier+'&act=de&jr_id='+p_value+'&div='+id;
querystring='gDossier='+dossier+'&act=de&jr_id='+p_value+'&div='+id;
add_div(popup);
var action=new Ajax.Request(
"ajax_ledger.php",
@ -756,7 +756,7 @@ function viewOperation(p_value,p_dossier)
}
function dropLink(p_dossier,p_div,p_jr_id,p_jr_id2)
{
var querystring='?gDossier='+p_dossier;
var querystring='gDossier='+p_dossier;
querystring+='&div='+p_div;
querystring+='&jr_id='+p_jr_id;
querystring+='&act=rmr';
@ -800,7 +800,7 @@ function dsp_letter(obj)
{
try
{
var queryString='?gDossier='+obj.gDossier+'&j_id='+obj.j_id+'&op=dl'+'&ot='+this.obj_type;
var queryString='gDossier='+obj.gDossier+'&j_id='+obj.j_id+'&op=dl'+'&ot='+this.obj_type;
var action=new Ajax.Request(
"ajax_misc.php",
{
@ -893,14 +893,14 @@ function search_letter(obj)
}
}
/**
*@brief save an operation in ajax, it concerns only the
*@brief save an operation in ajax, it concerns only the
* comment, the pj and the rapt
* the form elements are access by their name
*@param form
*/
function op_save(obj)
{
var queryString='?'+$(obj).serialize();
var queryString=$(obj).serialize();
queryString+="&lib="+obj.lib.value;
queryString+="&gDossier="+obj.gDossier.value;
var rapt2="rapt"+obj.whatdiv.value;

View file

@ -80,7 +80,7 @@ function search_poste(obj)
var dossier=$('gDossier').value;
var queryString="?gDossier="+dossier;
var queryString="gDossier="+dossier;
queryString+="&op=sf";
try
@ -155,7 +155,7 @@ function search_poste(obj)
function search_get_poste(obj)
{
var dossier=$('gDossier').value;
var queryString="?gDossier="+dossier;
var queryString="gDossier="+dossier;
queryString+="&op=sf";

View file

@ -20,7 +20,7 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/*! \file
* \brief This file permit to use the AJAX function to fill up
* \brief This file permit to use the AJAX function to fill up
* info from fiche
*
*/
@ -91,7 +91,7 @@ function ajaxFid(p_ctl)
return;
}
}
var queryString="?FID="+trim($(p_ctl).value);
var queryString="FID="+trim($(p_ctl).value);
if ( $(p_ctl).label)
{
queryString+='&l='+$(p_ctl).label;
@ -129,7 +129,7 @@ function ajaxFid(p_ctl)
}
/*!\brief callback function for ajax
* \param request : object request
* \param json : json answer
* \param json : json answer
\verbatim
{"answer":"ok",
"flabel":"none",
@ -180,14 +180,14 @@ function ajax_error_saldo(request,json)
alert('erreur : ajax fiche');
}
/*!\brief this function get the saldo
* \param p_ctl the ctrl where we take the quick_code
* \param p_ctl the ctrl where we take the quick_code
*/
function ajax_saldo(p_ctl)
{
var gDossier=$('gDossier').value;
var ctl_value=trim($(p_ctl).value);
var jrn=$('p_jrn').value;
queryString="?FID="+ctl_value;
queryString="FID="+ctl_value;
queryString=queryString+'&gDossier='+gDossier+'&j='+jrn;
queryString=queryString+'&ctl='+ctl_value;
/* alert(queryString); */

View file

@ -120,7 +120,7 @@ function verify_ca(div)
function search_ca (p_dossier,p_target,p_source)
{
var pa_id=g(p_source).value;
var url="?gDossier="+p_dossier+"&c1="+p_target+"&c2="+pa_id;
var url="gDossier="+p_dossier+"&c1="+p_target+"&c2="+pa_id;
var a=window.open("search_ca.php"+url,"CA recherche",'statusbar=no,scrollbars=yes,toolbar=no');
a.focus();
}

View file

@ -1,6 +1,6 @@
// script.aculo.us builder.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009
// script.aculo.us builder.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
// Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/

View file

@ -76,7 +76,7 @@ function search_card(obj)
var div_style="top:"+sx+";width:60%;heigth:80%";
add_div({id:'search_card',cssclass:'op_detail',html:loading(),style:div_style,drag:true});
var action=new Ajax.Request ( 'ajax_card.php',
{
method:'get',
@ -95,13 +95,13 @@ function search_card(obj)
*@brief when you submit the form for searching a card
*@param obj form
*@note the same as search_card, except it answer to a FORM and not
* to a click event
* to a click event
*/
function search_get_card(obj)
{
var dossier=$('gDossier').value;
var queryString="?gDossier="+dossier;
var queryString="gDossier="+dossier;
queryString+="&op=fs";
if ( obj.elements['inp'] )
@ -315,15 +315,15 @@ function fill_ipopcard(obj)
}
// ctl=$(obj).id;
var queryString='?gDossier='+dossier;
var queryString='gDossier='+dossier;
queryString+='&qcode='+qcode;
queryString+='&ctl='+content;
queryString+='&op=dc'; // dc for detail card
if ( obj.readonly != undefined) {
if ( obj.readonly != undefined) {
queryString+='&ro';
}
if ( obj.nohistory != undefined) {
if ( obj.nohistory != undefined) {
queryString+='&nohistory';
}
@ -339,7 +339,7 @@ function fill_ipopcard(obj)
/**
*@brief
* \param request : object request
* \param json : json answer
* \param json : json answer
\code
\endcode
*/
@ -376,7 +376,7 @@ function successFill_ipopcard(req,json)
}
}
/**
*@brief show the ipopup for selecting a card type, it is a needed step before adding
*@brief show the ipopup for selecting a card type, it is a needed step before adding
* a card
*@param input field (obj) it must have the attribute ipopup
* possible attribute :
@ -387,7 +387,7 @@ function successFill_ipopcard(req,json)
*/
function select_card_type(obj)
{
var dossier=$('gDossier').value;
// give a filter, -1 if not
@ -414,7 +414,7 @@ function select_card_type(obj)
add_div(popup);
var queryString='?gDossier='+dossier;
var queryString='gDossier='+dossier;
queryString+='&ctl='+content;
queryString+='&op=st'; // st for selecting type
if ( $(obj).win_refresh!=undefined)
@ -478,7 +478,7 @@ function dis_blank_card(obj)
var dossier=$('gDossier').value;
var queryString='?gDossier='+dossier;
var queryString='gDossier='+dossier;
queryString+='&ctl='+content;
queryString+='&fd_id='+fd_id;
queryString+=ref;
@ -507,7 +507,7 @@ function save_card(obj)
$(content).innerHTML=loading();
var dossier=$('gDossier').value;
var queryString='?gDossier='+dossier;
var queryString='gDossier='+dossier;
queryString+='&ctl='+content;
queryString+=data;
queryString+='&op=sc'; // sc for save card
@ -532,7 +532,7 @@ function add_category(obj)
// show ipopup
showIPopup(obj.ipopup);
var dossier=$('gDossier').value;
var queryString='?gDossier='+dossier;
var queryString='gDossier='+dossier;
queryString+='&op=ac';
queryString+='&ctl='+obj.ipopup+'_content';
if ( obj.type_cat)
@ -581,7 +581,7 @@ function save_card_category(obj)
);
}
/**
*@brief Remove a definition of an attribut
*@brief Remove a definition of an attribut
*@param attr_def.ad_id
*@param gDossier
*@param table_id to rm the row
@ -590,7 +590,7 @@ function save_card_category(obj)
function removeCardAttribut(ad_id,gDossier,table_id,row)
{
var queryString='?gDossier='+gDossier;
var queryString='gDossier='+gDossier;
queryString+='&op=rmfa';
queryString+='&ctl=debug'; // debug id
queryString+='&ad_id='+ad_id;

11
html/js/controls.js vendored
View file

@ -1,8 +1,8 @@
// script.aculo.us controls.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009
// script.aculo.us controls.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
// Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// (c) 2005-2009 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
// (c) 2005-2009 Jon Tirsen (http://www.tirsen.com)
// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// (c) 2005-2010 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
// (c) 2005-2010 Jon Tirsen (http://www.tirsen.com)
// Contributors:
// Richard Livsey
// Rahul Bhargava
@ -67,6 +67,7 @@ Autocompleter.Base = Class.create({
update.style.position = 'absolute';
Position.clone(element, update, {
setHeight: false,
setWidth:true,
offsetTop: element.offsetHeight
});
}
@ -781,7 +782,7 @@ Ajax.InPlaceCollectionEditor = Class.create(Ajax.InPlaceEditor, {
onComplete: Prototype.emptyFunction,
onSuccess: function(transport) {
var js = transport.responseText.strip();
if (!/^\[.*\]$/.test(js))
if (!/^\[.*\]$/.test(js)) // TODO: improve sanity check
throw('Server returned an invalid collection representation.');
this._collection = eval(js);
this.checkForExternalText();

354
html/js/dragdrop.js vendored
View file

@ -1,8 +1,7 @@
// script.aculo.us dragdrop.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008
// script.aculo.us dragdrop.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// (c) 2005-2007 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz)
//
// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/
@ -21,8 +20,7 @@ var Droppables = {
var options = Object.extend({
greedy: true,
hoverclass: null,
tree: false,
scrollid: null
tree: false
}, arguments[1] || { });
// cache containers
@ -35,7 +33,7 @@ var Droppables = {
options._containers.push($(containment));
}
}
if(options.accept) options.accept = [options.accept].flatten();
Element.makePositioned(element); // fix IE
@ -43,43 +41,34 @@ var Droppables = {
this.drops.push(options);
},
findDeepestChild: function(drops) {
deepest = drops[0];
for (i = 1; i < drops.length; ++i)
if (Element.isParent(drops[i].element, deepest.element))
deepest = drops[i];
return deepest;
},
isContained: function(element, drop) {
var containmentNode;
if(drop.tree) {
containmentNode = element.treeNode;
containmentNode = element.treeNode;
} else {
containmentNode = element.parentNode;
}
return drop._containers.detect(function(c) { return containmentNode == c });
},
isAffected: function(point, element, drop) {
if( drop.scrollid ){
Position.includeScrollOffsets = true;
scrolling_element = $(drop.scrollid)
var container_off = Element.cumulativeOffset(scrolling_element);
if( point[1] < container_off[1] || point[1] > Element.getHeight(scrolling_element) + container_off[1])
{return false;}
else if( point[0] < container_off[0] || point[0] > Element.getWidth(scrolling_element) + container_off[0])
{return false;}
}
return (
(drop.element!=element) &&
((!drop._containers) ||
this.isContained(element, drop)) &&
((!drop.accept) ||
(Element.classNames(element).detect(
(Element.classNames(element).detect(
function(v) { return drop.accept.include(v) } ) )) &&
Position.within(drop.element, point[0], point[1]) );
},
@ -99,12 +88,12 @@ var Droppables = {
show: function(point, element) {
if(!this.drops.length) return;
var drop, affected = [];
this.drops.each( function(drop) {
if(Droppables.isAffected(point, element, drop))
affected.push(drop);
});
if(affected.length>0)
drop = Droppables.findDeepestChild(affected);
@ -113,7 +102,7 @@ var Droppables = {
Position.within(drop.element, point[0], point[1]);
if(drop.onHover)
drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element));
if (drop != this.last_active) Droppables.activate(drop);
}
},
@ -124,8 +113,8 @@ var Droppables = {
if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active))
if (this.last_active.onDrop) {
this.last_active.onDrop(element, this.last_active.element, event);
return true;
this.last_active.onDrop(element, this.last_active.element, event);
return true;
}
},
@ -133,25 +122,25 @@ var Droppables = {
if(this.last_active)
this.deactivate(this.last_active);
}
}
};
var Draggables = {
drags: [],
observers: [],
register: function(draggable) {
if(this.drags.length == 0) {
this.eventMouseUp = this.endDrag.bindAsEventListener(this);
this.eventMouseMove = this.updateDrag.bindAsEventListener(this);
this.eventKeypress = this.keyPress.bindAsEventListener(this);
Event.observe(document, "mouseup", this.eventMouseUp);
Event.observe(document, "mousemove", this.eventMouseMove);
Event.observe(document, "keypress", this.eventKeypress);
}
this.drags.push(draggable);
},
unregister: function(draggable) {
this.drags = this.drags.reject(function(d) { return d==draggable });
if(this.drags.length == 0) {
@ -160,24 +149,24 @@ var Draggables = {
Event.stopObserving(document, "keypress", this.eventKeypress);
}
},
activate: function(draggable) {
if(draggable.options.delay) {
this._timeout = setTimeout(function() {
Draggables._timeout = null;
window.focus();
Draggables.activeDraggable = draggable;
}.bind(this), draggable.options.delay);
if(draggable.options.delay) {
this._timeout = setTimeout(function() {
Draggables._timeout = null;
window.focus();
Draggables.activeDraggable = draggable;
}.bind(this), draggable.options.delay);
} else {
window.focus(); // allows keypress events if window isn't currently focused, fails for Safari
this.activeDraggable = draggable;
}
},
deactivate: function() {
this.activeDraggable = null;
},
updateDrag: function(event) {
if(!this.activeDraggable) return;
var pointer = [Event.pointerX(event), Event.pointerY(event)];
@ -185,36 +174,36 @@ var Draggables = {
// the same coordinates, prevent needless redrawing (moz bug?)
if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return;
this._lastPointer = pointer;
this.activeDraggable.updateDrag(event, pointer);
},
endDrag: function(event) {
if(this._timeout) {
clearTimeout(this._timeout);
this._timeout = null;
if(this._timeout) {
clearTimeout(this._timeout);
this._timeout = null;
}
if(!this.activeDraggable) return;
this._lastPointer = null;
this.activeDraggable.endDrag(event);
this.activeDraggable = null;
},
keyPress: function(event) {
if(this.activeDraggable)
this.activeDraggable.keyPress(event);
},
addObserver: function(observer) {
this.observers.push(observer);
this._cacheObserverCallbacks();
},
removeObserver: function(element) { // element instead of observer fixes mem leaks
this.observers = this.observers.reject( function(o) { return o.element==element });
this._cacheObserverCallbacks();
},
notify: function(eventName, draggable, event) { // 'onStart', 'onEnd', 'onDrag'
if(this[eventName+'Count'] > 0)
this.observers.each( function(o) {
@ -222,7 +211,7 @@ var Draggables = {
});
if(draggable.options[eventName]) draggable.options[eventName](draggable, event);
},
_cacheObserverCallbacks: function() {
['onStart','onEnd','onDrag'].each( function(eventName) {
Draggables[eventName+'Count'] = Draggables.observers.select(
@ -230,7 +219,7 @@ var Draggables = {
).length;
});
}
}
};
/*--------------------------------------------------------------------------*/
@ -246,12 +235,12 @@ var Draggable = Class.create({
},
endeffect: function(element) {
var toOpacity = Object.isNumber(element._opacity) ? element._opacity : 1.0;
new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity,
new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity,
queue: {scope:'_draggable', position:'end'},
afterFinish: function(){
Draggable._dragging[element] = false
afterFinish: function(){
Draggable._dragging[element] = false
}
});
});
},
zindex: 1000,
revert: false,
@ -262,57 +251,57 @@ var Draggable = Class.create({
snap: false, // false, or xy or [x,y] or function(x,y){ return [x,y] }
delay: 0
};
if(!arguments[1] || Object.isUndefined(arguments[1].endeffect))
Object.extend(defaults, {
starteffect: function(element) {
element._opacity = Element.getOpacity(element);
Draggable._dragging[element] = true;
new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7});
new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7});
}
});
var options = Object.extend(defaults, arguments[1] || { });
this.element = $(element);
if(options.handle && Object.isString(options.handle))
this.handle = this.element.down('.'+options.handle, 0);
if(!this.handle) this.handle = $(options.handle);
if(!this.handle) this.handle = this.element;
if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML) {
options.scroll = $(options.scroll);
this._isScrollChild = Element.childOf(this.element, options.scroll);
}
Element.makePositioned(this.element); // fix IE
Element.makePositioned(this.element); // fix IE
this.options = options;
this.dragging = false;
this.dragging = false;
this.eventMouseDown = this.initDrag.bindAsEventListener(this);
Event.observe(this.handle, "mousedown", this.eventMouseDown);
Draggables.register(this);
},
destroy: function() {
Event.stopObserving(this.handle, "mousedown", this.eventMouseDown);
Draggables.unregister(this);
},
currentDelta: function() {
return([
parseInt(Element.getStyle(this.element,'left') || '0'),
parseInt(Element.getStyle(this.element,'top') || '0')]);
},
initDrag: function(event) {
if(!Object.isUndefined(Draggable._dragging[this.element]) &&
Draggable._dragging[this.element]) return;
if(Event.isLeftClick(event)) {
if(Event.isLeftClick(event)) {
// abort on form elements, fixes a Firefox issue
var src = Event.element(event);
if((tag_name = src.tagName.toUpperCase()) && (
@ -321,34 +310,34 @@ var Draggable = Class.create({
tag_name=='OPTION' ||
tag_name=='BUTTON' ||
tag_name=='TEXTAREA')) return;
var pointer = [Event.pointerX(event), Event.pointerY(event)];
var pos = Position.cumulativeOffset(this.element);
var pos = this.element.cumulativeOffset();
this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) });
Draggables.activate(this);
Event.stop(event);
}
},
startDrag: function(event) {
this.dragging = true;
if(!this.delta)
this.delta = this.currentDelta();
if(this.options.zindex) {
this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0);
this.element.style.zIndex = this.options.zindex;
}
if(this.options.ghosting) {
this._clone = this.element.cloneNode(true);
this.element._originallyAbsolute = (this.element.getStyle('position') == 'absolute');
if (!this.element._originallyAbsolute)
this._originallyAbsolute = (this.element.getStyle('position') == 'absolute');
if (!this._originallyAbsolute)
Position.absolutize(this.element);
this.element.parentNode.insertBefore(this._clone, this.element);
}
if(this.options.scroll) {
if (this.options.scroll == window) {
var where = this._getWindowScroll(this.options.scroll);
@ -359,33 +348,33 @@ var Draggable = Class.create({
this.originalScrollTop = this.options.scroll.scrollTop;
}
}
Draggables.notify('onStart', this, event);
if(this.options.starteffect) this.options.starteffect(this.element);
},
updateDrag: function(event, pointer) {
if(!this.dragging) this.startDrag(event);
if(!this.options.quiet){
Position.prepare();
Droppables.show(pointer, this.element);
}
Draggables.notify('onDrag', this, event);
this.draw(pointer);
if(this.options.change) this.options.change(this);
if(this.options.scroll) {
this.stopScrolling();
var p;
if (this.options.scroll == window) {
with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; }
} else {
p = Position.page(this.options.scroll);
p = Position.page(this.options.scroll).toArray();
p[0] += this.options.scroll.scrollLeft + Position.deltaX;
p[1] += this.options.scroll.scrollTop + Position.deltaY;
p.push(p[0]+this.options.scroll.offsetWidth);
@ -398,16 +387,16 @@ var Draggable = Class.create({
if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[3]-this.options.scrollSensitivity);
this.startScrolling(speed);
}
// fix AppleWebKit rendering
if(Prototype.Browser.WebKit) window.scrollBy(0,0);
Event.stop(event);
},
finishDrag: function(event, success) {
this.dragging = false;
if(this.options.quiet){
Position.prepare();
var pointer = [Event.pointerX(event), Event.pointerY(event)];
@ -415,24 +404,24 @@ var Draggable = Class.create({
}
if(this.options.ghosting) {
if (!this.element._originallyAbsolute)
if (!this._originallyAbsolute)
Position.relativize(this.element);
delete this.element._originallyAbsolute;
delete this._originallyAbsolute;
Element.remove(this._clone);
this._clone = null;
}
var dropped = false;
if(success) {
dropped = Droppables.fire(event, this.element);
if (!dropped) dropped = false;
var dropped = false;
if(success) {
dropped = Droppables.fire(event, this.element);
if (!dropped) dropped = false;
}
if(dropped && this.options.onDropped) this.options.onDropped(this.element);
Draggables.notify('onEnd', this, event);
var revert = this.options.revert;
if(revert && Object.isFunction(revert)) revert = revert(this.element);
var d = this.currentDelta();
if(revert && this.options.reverteffect) {
if (dropped == 0 || revert != 'failure')
@ -445,67 +434,67 @@ var Draggable = Class.create({
if(this.options.zindex)
this.element.style.zIndex = this.originalZ;
if(this.options.endeffect)
if(this.options.endeffect)
this.options.endeffect(this.element);
Draggables.deactivate(this);
Droppables.reset();
},
keyPress: function(event) {
if(event.keyCode!=Event.KEY_ESC) return;
this.finishDrag(event, false);
Event.stop(event);
},
endDrag: function(event) {
if(!this.dragging) return;
this.stopScrolling();
this.finishDrag(event, true);
Event.stop(event);
},
draw: function(point) {
var pos = Position.cumulativeOffset(this.element);
var pos = this.element.cumulativeOffset();
if(this.options.ghosting) {
var r = Position.realOffset(this.element);
pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY;
}
var d = this.currentDelta();
pos[0] -= d[0]; pos[1] -= d[1];
if(this.options.scroll && (this.options.scroll != window && this._isScrollChild)) {
pos[0] -= this.options.scroll.scrollLeft-this.originalScrollLeft;
pos[1] -= this.options.scroll.scrollTop-this.originalScrollTop;
}
var p = [0,1].map(function(i){
return (point[i]-pos[i]-this.offset[i])
var p = [0,1].map(function(i){
return (point[i]-pos[i]-this.offset[i])
}.bind(this));
if(this.options.snap) {
if(Object.isFunction(this.options.snap)) {
p = this.options.snap(p[0],p[1],this);
} else {
if(Object.isArray(this.options.snap)) {
p = p.map( function(v, i) {
return (v/this.options.snap[i]).round()*this.options.snap[i] }.bind(this))
return (v/this.options.snap[i]).round()*this.options.snap[i] }.bind(this));
} else {
p = p.map( function(v) {
return (v/this.options.snap).round()*this.options.snap }.bind(this))
return (v/this.options.snap).round()*this.options.snap }.bind(this));
}
}}
var style = this.element.style;
if((!this.options.constraint) || (this.options.constraint=='horizontal'))
style.left = p[0] + "px";
if((!this.options.constraint) || (this.options.constraint=='vertical'))
style.top = p[1] + "px";
if(style.visibility=="hidden") style.visibility = ""; // fix gecko rendering
},
stopScrolling: function() {
if(this.scrollInterval) {
clearInterval(this.scrollInterval);
@ -513,14 +502,14 @@ var Draggable = Class.create({
Draggables._lastScrollPointer = null;
}
},
startScrolling: function(speed) {
if(!(speed[0] || speed[1])) return;
this.scrollSpeed = [speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed];
this.lastScrolled = new Date();
this.scrollInterval = setInterval(this.scroll.bind(this), 10);
},
scroll: function() {
var current = new Date();
var delta = current - this.lastScrolled;
@ -536,7 +525,7 @@ var Draggable = Class.create({
this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000;
this.options.scroll.scrollTop += this.scrollSpeed[1] * delta / 1000;
}
Position.prepare();
Droppables.show(Draggables._lastPointer, this.element);
Draggables.notify('onDrag', this);
@ -550,10 +539,10 @@ var Draggable = Class.create({
Draggables._lastScrollPointer[1] = 0;
this.draw(Draggables._lastScrollPointer);
}
if(this.options.change) this.options.change(this);
},
_getWindowScroll: function(w) {
var T, L, W, H;
with (w.document) {
@ -572,7 +561,7 @@ var Draggable = Class.create({
H = documentElement.clientHeight;
} else {
W = body.offsetWidth;
H = body.offsetHeight
H = body.offsetHeight;
}
}
return { top: T, left: L, width: W, height: H };
@ -589,11 +578,11 @@ var SortableObserver = Class.create({
this.observer = observer;
this.lastValue = Sortable.serialize(this.element);
},
onStart: function() {
this.lastValue = Sortable.serialize(this.element);
},
onEnd: function() {
Sortable.unmark();
if(this.lastValue != Sortable.serialize(this.element))
@ -603,11 +592,11 @@ var SortableObserver = Class.create({
var Sortable = {
SERIALIZE_RULE: /^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,
sortables: { },
_findRootElement: function(element) {
while (element.tagName.toUpperCase() != "BODY") {
while (element.tagName.toUpperCase() != "BODY") {
if(element.id && Sortable.sortables[element.id]) return element;
element = element.parentNode;
}
@ -618,22 +607,23 @@ var Sortable = {
if(!element) return;
return Sortable.sortables[element.id];
},
destroy: function(element){
var s = Sortable.options(element);
element = $(element);
var s = Sortable.sortables[element.id];
if(s) {
Draggables.removeObserver(s.element);
s.droppables.each(function(d){ Droppables.remove(d) });
s.draggables.invoke('destroy');
delete Sortable.sortables[s.element.id];
}
},
create: function(element) {
element = $(element);
var options = Object.extend({
var options = Object.extend({
element: element,
tag: 'li', // assumes li children, override with tag: 'tagname'
dropOnEmpty: false,
@ -647,17 +637,17 @@ var Sortable = {
delay: 0,
hoverclass: null,
ghosting: false,
quiet: false,
quiet: false,
scroll: false,
scrollSensitivity: 20,
scrollSpeed: 15,
format: this.SERIALIZE_RULE,
// these take arrays of elements or ids and can be
// these take arrays of elements or ids and can be
// used for better initialization performance
elements: false,
handles: false,
onChange: Prototype.emptyFunction,
onUpdate: Prototype.emptyFunction
}, arguments[1] || { });
@ -694,24 +684,24 @@ var Sortable = {
if(options.zindex)
options_for_draggable.zindex = options.zindex;
// build options for the droppables
// build options for the droppables
var options_for_droppable = {
overlap: options.overlap,
containment: options.containment,
tree: options.tree,
hoverclass: options.hoverclass,
onHover: Sortable.onHover
}
};
var options_for_tree = {
onHover: Sortable.onEmptyHover,
overlap: options.overlap,
containment: options.containment,
hoverclass: options.hoverclass
}
};
// fix for gecko engine
Element.cleanWhitespace(element);
Element.cleanWhitespace(element);
options.draggables = [];
options.droppables = [];
@ -724,14 +714,14 @@ var Sortable = {
(options.elements || this.findElements(element, options) || []).each( function(e,i) {
var handle = options.handles ? $(options.handles[i]) :
(options.handle ? $(e).select('.' + options.handle)[0] : e);
(options.handle ? $(e).select('.' + options.handle)[0] : e);
options.draggables.push(
new Draggable(e, Object.extend(options_for_draggable, { handle: handle })));
Droppables.add(e, options_for_droppable);
if(options.tree) e.treeNode = element;
options.droppables.push(e);
options.droppables.push(e);
});
if(options.tree) {
(Sortable.findTreeElements(element, options) || []).each( function(e) {
Droppables.add(e, options_for_tree);
@ -741,7 +731,7 @@ var Sortable = {
}
// keep reference
this.sortables[element.id] = options;
this.sortables[element.identify()] = options;
// for onupdate
Draggables.addObserver(new SortableObserver(element, options.onUpdate));
@ -753,7 +743,7 @@ var Sortable = {
return Element.findChildren(
element, options.only, options.tree ? true : false, options.tag);
},
findTreeElements: function(element, options) {
return Element.findChildren(
element, options.only, options.tree ? true : false, options.treeTag);
@ -770,7 +760,7 @@ var Sortable = {
var oldParentNode = element.parentNode;
element.style.visibility = "hidden"; // fix gecko rendering
dropon.parentNode.insertBefore(element, dropon);
if(dropon.parentNode!=oldParentNode)
if(dropon.parentNode!=oldParentNode)
Sortable.options(oldParentNode).onChange(element);
Sortable.options(dropon.parentNode).onChange(element);
}
@ -781,26 +771,26 @@ var Sortable = {
var oldParentNode = element.parentNode;
element.style.visibility = "hidden"; // fix gecko rendering
dropon.parentNode.insertBefore(element, nextElement);
if(dropon.parentNode!=oldParentNode)
if(dropon.parentNode!=oldParentNode)
Sortable.options(oldParentNode).onChange(element);
Sortable.options(dropon.parentNode).onChange(element);
}
}
},
onEmptyHover: function(element, dropon, overlap) {
var oldParentNode = element.parentNode;
var droponOptions = Sortable.options(dropon);
if(!Element.isParent(dropon, element)) {
var index;
var children = Sortable.findElements(dropon, {tag: droponOptions.tag, only: droponOptions.only});
var child = null;
if(children) {
var offset = Element.offsetSize(dropon, droponOptions.overlap) * (1.0 - overlap);
for (index = 0; index < children.length; index += 1) {
if (offset - Element.offsetSize (children[index], droponOptions.overlap) >= 0) {
offset -= Element.offsetSize (children[index], droponOptions.overlap);
@ -813,9 +803,9 @@ var Sortable = {
}
}
}
dropon.insertBefore(element, child);
Sortable.options(oldParentNode).onChange(element);
droponOptions.onChange(element);
}
@ -828,34 +818,34 @@ var Sortable = {
mark: function(dropon, position) {
// mark on ghosting only
var sortable = Sortable.options(dropon.parentNode);
if(sortable && !sortable.ghosting) return;
if(sortable && !sortable.ghosting) return;
if(!Sortable._marker) {
Sortable._marker =
Sortable._marker =
($('dropmarker') || Element.extend(document.createElement('DIV'))).
hide().addClassName('dropmarker').setStyle({position:'absolute'});
document.getElementsByTagName("body").item(0).appendChild(Sortable._marker);
}
var offsets = Position.cumulativeOffset(dropon);
}
var offsets = dropon.cumulativeOffset();
Sortable._marker.setStyle({left: offsets[0]+'px', top: offsets[1] + 'px'});
if(position=='after')
if(sortable.overlap == 'horizontal')
if(sortable.overlap == 'horizontal')
Sortable._marker.setStyle({left: (offsets[0]+dropon.clientWidth) + 'px'});
else
Sortable._marker.setStyle({top: (offsets[1]+dropon.clientHeight) + 'px'});
Sortable._marker.show();
},
_tree: function(element, options, parent) {
var children = Sortable.findElements(element, options) || [];
for (var i = 0; i < children.length; ++i) {
var match = children[i].id.match(options.format);
if (!match) continue;
var child = {
id: encodeURIComponent(match ? match[1] : null),
element: element,
@ -863,16 +853,16 @@ var Sortable = {
children: [],
position: parent.children.length,
container: $(children[i]).down(options.treeTag)
}
};
/* Get the element containing the children and recurse over it */
if (child.container)
this._tree(child.container, options, child)
this._tree(child.container, options, child);
parent.children.push (child);
}
return parent;
return parent;
},
tree: function(element) {
@ -885,15 +875,15 @@ var Sortable = {
name: element.id,
format: sortableOptions.format
}, arguments[1] || { });
var root = {
id: null,
parent: null,
children: [],
container: element,
position: 0
}
};
return Sortable._tree(element, options, root);
},
@ -909,7 +899,7 @@ var Sortable = {
sequence: function(element) {
element = $(element);
var options = Object.extend(this.options(element), arguments[1] || { });
return $(this.findElements(element, options) || []).map( function(item) {
return item.id.match(options.format) ? item.id.match(options.format)[1] : '';
});
@ -918,14 +908,14 @@ var Sortable = {
setSequence: function(element, new_sequence) {
element = $(element);
var options = Object.extend(this.options(element), arguments[2] || { });
var nodeMap = { };
this.findElements(element, options).each( function(n) {
if (n.id.match(options.format))
nodeMap[n.id.match(options.format)[1]] = [n, n.parentNode];
n.parentNode.removeChild(n);
});
new_sequence.each(function(ident) {
var n = nodeMap[ident];
if (n) {
@ -934,16 +924,16 @@ var Sortable = {
}
});
},
serialize: function(element) {
element = $(element);
var options = Object.extend(Sortable.options(element), arguments[1] || { });
var name = encodeURIComponent(
(arguments[1] && arguments[1].name) ? arguments[1].name : element.id);
if (options.tree) {
return Sortable.tree(element, arguments[1]).children.map( function (item) {
return [name + Sortable._constructIndex(item) + "[id]=" +
return [name + Sortable._constructIndex(item) + "[id]=" +
encodeURIComponent(item.id)].concat(item.children.map(arguments.callee));
}).flatten().join('&');
} else {
@ -952,16 +942,16 @@ var Sortable = {
}).join('&');
}
}
}
};
// Returns true if child is contained within element
Element.isParent = function(child, element) {
if (!child.parentNode || child == element) return false;
if (child.parentNode == element) return true;
return Element.isParent(child.parentNode, element);
}
};
Element.findChildren = function(element, only, recursive, tagName) {
Element.findChildren = function(element, only, recursive, tagName) {
if(!element.hasChildNodes()) return null;
tagName = tagName.toUpperCase();
if(only) only = [only].flatten();
@ -977,8 +967,8 @@ Element.findChildren = function(element, only, recursive, tagName) {
});
return (elements.length>0 ? elements.flatten() : []);
}
};
Element.offsetSize = function (element, type) {
return element['offset' + ((type=='vertical' || type=='height') ? 'Height' : 'Width')];
}
};

4
html/js/effects.js vendored
View file

@ -1,6 +1,6 @@
// script.aculo.us effects.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009
// script.aculo.us effects.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
// Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// Contributors:
// Justin Palmer (http://encytemedia.com/)
// Mark Pilgrim (http://diveintomark.org/)

View file

@ -31,7 +31,7 @@ function detail_extension(p_code)
{
var dossier=$("gDossier").value;
showIPopup("dtext");
var queryString='?gDossier='+dossier;
var queryString='gDossier='+dossier;
queryString+='&ex_id='+p_code;
queryString+='&action=de'; // de for detail extension
@ -51,7 +51,7 @@ function new_extension()
{
var dossier=$("gDossier").value;
showIPopup("dtext");
var queryString='?gDossier='+dossier;
var queryString='gDossier='+dossier;
queryString+='&action=ne'; // ne for new extension
var action=new Ajax.Request ( 'ajax_extension.php',
@ -106,7 +106,7 @@ function extension_save(p_obj_form)
try
{
var dossier=$("gDossier").value;
var queryString='?gDossier='+dossier;
var queryString='gDossier='+dossier;
queryString+='&action=se'; // se save extension
// Data must be taken here
try
@ -171,7 +171,7 @@ function successSave(req)
function extension_remove(ex_id)
{
var dossier=$("gDossier").value;
var queryString='?gDossier='+dossier;
var queryString='gDossier='+dossier;
queryString+='&ex_id='+ex_id;
queryString+='&action=re'; // re for remove extension
var action=new Ajax.Request ( 'ajax_extension.php',

View file

@ -33,7 +33,7 @@
*/
function remove_document(p_dossier,p_id)
{
queryString="?gDossier="+p_dossier+"&a=rm&d_id="+p_id;
queryString="gDossier="+p_dossier+"&a=rm&d_id="+p_id;
var action=new Ajax.Request (
"show_document.php",
{
@ -98,7 +98,7 @@ function removeStock(s_id,p_dossier)
{
return;
}
queryString="?gDossier="+p_dossier+"&op=rm_stock&s_id="+s_id;
queryString="gDossier="+p_dossier+"&op=rm_stock&s_id="+s_id;
var action=new Ajax.Request (
"ajax_misc.php",
{
@ -133,7 +133,7 @@ function successRemoveStock(request,json)
$(doc).style.color="red";
// $(doc).href="javascript:alert('Stock Effacé')";
$(doc).style.textDecoration="line-through";
} catch (e)
} catch (e)
{
alert("success_box"+e.message);
}

View file

@ -15,7 +15,7 @@ function modifyModeleDocument(p_value,dossier)
'style':style
};
querystring='?gDossier='+dossier+'&op=mod_doc&id='+p_value+'&div=mod_doc';
querystring='gDossier='+dossier+'&op=mod_doc&id='+p_value+'&div=mod_doc';
if ( ! $('mod_doc'))
{
add_div(popup);
@ -32,7 +32,7 @@ function modifyModeleDocument(p_value,dossier)
}
/**
*@brief receive answer from ajax and just display it into the IBox
* XML must contains at least 2 fields : code is the ID of the IBOX and
* XML must contains at least 2 fields : code is the ID of the IBOX and
* html which is the contain
*/
function modify_document_success_box(req,json)

3649
html/js/prototype.js vendored

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
// script.aculo.us scriptaculous.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009
// script.aculo.us scriptaculous.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
// Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@ -24,7 +24,7 @@
// For details, see the script.aculo.us web site: http://script.aculo.us/
var Scriptaculous = {
Version: '1.8.3',
Version: '1.9.0',
require: function(libraryName) {
try{
// inserting via DOM fails in Safari 2.0, so brute force approach
@ -37,7 +37,7 @@ var Scriptaculous = {
document.getElementsByTagName('head')[0].appendChild(script);
}
},
REQUIRED_PROTOTYPE: '1.6.1',
REQUIRED_PROTOTYPE: '1.6.0.3',
load: function() {
function convertVersionString(versionString) {
var v = versionString.replace(/_.*|\./g, '');
@ -54,7 +54,7 @@ var Scriptaculous = {
Scriptaculous.REQUIRED_PROTOTYPE);
var js = /scriptaculous\.js(\?.*)?$/;
$$('head script[src]').findAll(function(s) {
$$('script[src]').findAll(function(s) {
return s.src.match(js);
}).each(function(s) {
var path = s.src.replace(js, ''),
@ -65,4 +65,4 @@ var Scriptaculous = {
}
};
Scriptaculous.load();
Scriptaculous.load();

View file

@ -24,7 +24,7 @@
*
*/
/**
* callback function when we just need to update a hidden div with an info
* callback function when we just need to update a hidden div with an info
* message
*/
function infodiv(req,json)
@ -378,13 +378,13 @@ function change_month(obj)
}
/**
*@brief basic answer to ajax on success, it will fill the DOMID code with
*@brief basic answer to ajax on success, it will fill the DOMID code with
* the code. In that case, you need to create the object before the Ajax.Request
*The difference with success box is that
*The difference with success box is that
*@see add_div removeDiv success_box is that the width and height are not changed ajax_misc.php
*@parameter code is the ID of the object containing the html (div, button...)
*@parameter value is the html code, with it you fill the ctl element
*/
*/
function success_misc(req)
{
@ -466,7 +466,7 @@ function success_cat_doc_remove(req)
}
/**
*@brief display the popup with vat and explanation
*@param obj with 4 attributes gdossier, ctl,popup
*@param obj with 4 attributes gdossier, ctl,popup
*/
function popup_select_tva(obj)
{
@ -533,7 +533,7 @@ function success_popup_select_tva(req)
/**
*@brief display the popup with vat and explanation
*@param obj with 4 attributes gdossier, ctl,popup
*@param obj with 4 attributes gdossier, ctl,popup
*/
function set_tva_label(obj)
{
@ -595,7 +595,7 @@ function set_wait(name)
}
/**
*@brief add dynamically a object for AJAX
*@param obj.
*@param obj.
* the attributes are
* - style to add style
* - id to add an id
@ -650,7 +650,7 @@ new Draggable(obj.id,{starteffect:function()
}
/**
* remove a object created with add_div
* @param elt id of the elt
* @param elt id of the elt
*/
function removeDiv(elt)
{
@ -704,7 +704,7 @@ function show_box(obj)
}
/**
*@brief receive answer from ajax and just display it into the IBox
* XML must contains at least 2 fields : ctl is the ID of the IBOX and
* XML must contains at least 2 fields : ctl is the ID of the IBOX and
* code is the HTML to put in it
*@see fill_box
*/
@ -913,7 +913,7 @@ function display_periode(p_dossier,p_id)
{
alert("display_periode "+e.message);
}
}
function success_display_periode(req)
{ try
@ -951,7 +951,7 @@ function save_periode(obj)
{
try
{
var queryString="?"+$(obj).serialize()+"&op=save_per";
var queryString=$(obj).serialize()+"&op=save_per";
var action = new Ajax.Request(
"ajax_misc.php" ,
@ -971,13 +971,13 @@ function save_periode(obj)
return false;
}
/**
*@brief basic answer to ajax on success, it will fill the ctl with
*@brief basic answer to ajax on success, it will fill the ctl with
* the code. In that case, you need to create the object before the Ajax.Request
*The difference with success box is that
*The difference with success box is that
*@see add_div removeDiv success_box is that the width and height are not changed
*@parameter ctl is the ID of the object containing the html (div, button...)
*@parameter code is the html code, with it you fill the ctl element
*/
*/
function fill_box(req)
{
try{
@ -989,7 +989,7 @@ function fill_box(req)
var code_html=getNodeText(html[0]); // Firefox ne prend que les 4096 car.
code_html=unescape_xml(code_html);
$(name_ctl).innerHTML=code_html;
}
}
catch (e) {
alert(e.message);}
try{
@ -1001,13 +1001,13 @@ function fill_box(req)
}
/**
*display a popin to let you modified a predefined operation
*@param dossier_id
*@param dossier_id
*@param od_id from table op_predef
*/
function mod_predf_op(dossier_id,od_id)
{
var target="mod_predf_op";
if ( $(target))
if ( $(target))
{
removeDiv(target);
}
@ -1016,11 +1016,11 @@ function mod_predf_op(dossier_id,od_id)
var str_style="top:"+sx+";left:"+sy;
var div={id:target, cssclass:'op_detail',style:str_style,html:loading(),drag:1};
add_div(div);
var qs="?gDossier="+dossier_id+'&op=mod_predf&id='+od_id;
var qs="gDossier="+dossier_id+'&op=mod_predf&id='+od_id;
var action=new Ajax.Request ( 'ajax_misc.php',
{
method:'get',
@ -1034,7 +1034,7 @@ function mod_predf_op(dossier_id,od_id)
function save_predf_op(obj)
{
var querystring="?"+$(obj).serialize()+'&op=save_predf';
var querystring=$(obj).serialize()+'&op=save_predf';
// Create a ajax request to get all the person
var action = new Ajax.Request ('ajax_misc.php',
{
@ -1045,5 +1045,5 @@ function save_predf_op(obj)
}
);
return false;
return false;
}

View file

@ -1,6 +1,6 @@
// script.aculo.us slider.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009
// script.aculo.us slider.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
// Copyright (c) 2005-2009 Marty Haught, Thomas Fuchs
// Copyright (c) 2005-2010 Marty Haught, Thomas Fuchs
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/

View file

@ -1,6 +1,6 @@
// script.aculo.us sound.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009
// script.aculo.us sound.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
// Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
//
// Based on code created by Jules Gravinese (http://www.webveteran.com/)
//

View file

@ -1,8 +1,8 @@
// script.aculo.us unittest.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009
// script.aculo.us unittest.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
// Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// (c) 2005-2009 Jon Tirsen (http://www.tirsen.com)
// (c) 2005-2009 Michael Schuerig (http://www.schuerig.de/michael/)
// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// (c) 2005-2010 Jon Tirsen (http://www.tirsen.com)
// (c) 2005-2010 Michael Schuerig (http://www.schuerig.de/michael/)
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/

View file

@ -41,8 +41,8 @@
*
* Set the hidden field or input field to be set by javascript with the function set_attribute
* call the input method. After selecting a value the update_value function is called. If you need
* to modify the queryString before the request is sent, you'll use the set_callback; the first
* parameter is the INPUT field and the second the queryString, the function must returns a
* to modify the queryString before the request is sent, you'll use the set_callback; the first
* parameter is the INPUT field and the second the queryString, the function must returns a
* queryString
*\code
// insert all the javascript files
@ -50,8 +50,8 @@
echo js_include('scriptaculous.js');
echo js_include('effects.js');
echo js_include('controls.js');
//
//
$W1=new ICard();
$W1->label="Client ".HtmlInput::infobulle(0) ;
$W1->name="e_client";
@ -60,18 +60,18 @@
$W1->table=0;
// If double click call the javascript fill_ipopcard
$W1->set_dblclick("fill_ipopcard(this);");
// Type of card : deb, cred or all
$W1->set_attribute('typecard','deb');
$W1->extra='deb';
// Add the callback function to filter the card on the jrn
$W1->set_callback('filter_card');
// when value selected in the autcomplete
$W1->set_function('fill_data');
// when the data change
$W1->javascript=sprintf(' onchange="fill_data_onchange(\'%s\');" ',
$W1->name);
@ -83,9 +83,9 @@
$f_client=$client_label->input("e_client_label",$e_client_label);
$f_client_qcode=$W1->input();
// Search button for card
$f_client_bt=$W1->search();
$f_client_bt=$W1->search();
* \endcode
For searching a card, you need a popup, the script card.js and set
the values for card, popup filter_card callback
@ -95,10 +95,10 @@ $card->name="acc";
$card->extra="all";
$card->set_attribute('typecard','all');
$card->set_callback('filter_card');
echo $card->input();
echo $card->search();
// example 2
// example 2
$w=new ICard("av_text".$attr->ad_id);
// filter on frd_id
$sql=' select fd_id from fiche_def where frd_id in ('.FICHE_TYPE_CLIENT.','.FICHE_TYPE_FOURNISSEUR.','.FICHE_TYPE_ADM_TAX.')';
@ -107,7 +107,7 @@ $w->set_attribute('ipopup','ipopcard');
$w->set_attribute('typecard',$filter);
$w->set_attribute('inp',"av_text".$attr->ad_id);
$w->set_attribute('label',"av_text".$attr->ad_id."_label");
$w->extra=$filter;
$w->extra2=0;
$label=new ISpan();
@ -129,8 +129,8 @@ class ICard extends HtmlInput
$this->javascript='';
}
/*!\brief set the javascript callback function
* by default it is update_value called BEFORE the querystring is send
*
* by default it is update_value called BEFORE the querystring is send
*
*\param $p_name callback function name
*/
function set_callback($p_name)
@ -214,7 +214,7 @@ class ICard extends HtmlInput
'</span>',
$this->name);
$div=sprintf('<div id="%s_choices" class="autocomplete"></div>',
$div=sprintf('<div id="%s_choices" class="autocomplete"></div>',
$this->name);
$query=dossier::get().'&e='.urlencode($this->typecard);
@ -249,7 +249,7 @@ class ICard extends HtmlInput
/**
*@brief return a string containing the button for displaying
* a search form. When clicking on the result, update the input text file
* the common used attribute as
* the common used attribute as
* - jrn the ledger
* - label the field to update
* - name name of the input text
@ -346,7 +346,7 @@ class ICard extends HtmlInput
ajaxFid(text);
}
</script>
EOF;
echo "<form>";
$l=new IText('ctl_label');