forked from Wavyzz/dolibarr
New: Possibilit de choisir le gestionnaire de popup date
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -117,12 +117,31 @@ function closeDPBox()
|
|||||||
function dpChangeDay(dateFieldID,format)
|
function dpChangeDay(dateFieldID,format)
|
||||||
{
|
{
|
||||||
showDP.datefieldID=dateFieldID;
|
showDP.datefieldID=dateFieldID;
|
||||||
var thefield=getObjectFromID(dateFieldID);
|
|
||||||
|
var thefield=getObjectFromID(showDP.datefieldID);
|
||||||
|
var thefieldday=getObjectFromID(showDP.datefieldID+"day");
|
||||||
|
var thefieldmonth=getObjectFromID(showDP.datefieldID+"month");
|
||||||
|
var thefieldyear=getObjectFromID(showDP.datefieldID+"year");
|
||||||
|
|
||||||
var date=getDateFromFormat(thefield.value,format);
|
var date=getDateFromFormat(thefield.value,format);
|
||||||
|
if (date)
|
||||||
if (date) dpClickDay(date.getFullYear(),date.getMonth()+1,date.getDate(),format)
|
{
|
||||||
else dpClickDay(0,0,0,format);
|
thefieldday.value=date.getDate();
|
||||||
|
if(thefieldday.onchange) thefieldday.onchange.call(thefieldday);
|
||||||
|
thefieldmonth.value=date.getMonth()+1;
|
||||||
|
if(thefieldmonth.onchange) thefieldmonth.onchange.call(thefieldmonth);
|
||||||
|
thefieldyear.value=date.getFullYear();
|
||||||
|
if(thefieldyear.onchange) thefieldyear.onchange.call(thefieldyear);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
thefieldday.value='';
|
||||||
|
if(thefieldday.onchange) thefieldday.onchange.call(thefieldday);
|
||||||
|
thefieldmonth.value='';
|
||||||
|
if(thefieldmonth.onchange) thefieldmonth.onchange.call(thefieldmonth);
|
||||||
|
thefieldyear.value='';
|
||||||
|
if(thefieldyear.onchange) thefieldyear.onchange.call(thefieldyear);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function dpClickDay(year,month,day,format)
|
function dpClickDay(year,month,day,format)
|
||||||
@@ -138,7 +157,7 @@ function dpClickDay(year,month,day,format)
|
|||||||
dt.setDate(day);
|
dt.setDate(day);
|
||||||
|
|
||||||
thefield.value=formatDate(dt,format);
|
thefield.value=formatDate(dt,format);
|
||||||
// if(thefield.onchange) thefield.onchange.call(thefield);
|
if(thefield.onchange) thefield.onchange.call(thefield);
|
||||||
|
|
||||||
thefieldday.value=day;
|
thefieldday.value=day;
|
||||||
if(thefieldday.onchange) thefieldday.onchange.call(thefieldday);
|
if(thefieldday.onchange) thefieldday.onchange.call(thefieldday);
|
||||||
|
|||||||
Reference in New Issue
Block a user