Look: Modif esthétique mineure
This commit is contained in:
parent
4418d21a0a
commit
3101e5278c
@ -2183,8 +2183,9 @@ class Form
|
|||||||
* \param m 1=Affiche aussi les minutes
|
* \param m 1=Affiche aussi les minutes
|
||||||
* \param empty 0=Champ obligatoire, 1=Permet une saisie vide
|
* \param empty 0=Champ obligatoire, 1=Permet une saisie vide
|
||||||
* \param form_name Nom du formulaire de provenance. Utilisé pour les dates en popup style andre.
|
* \param form_name Nom du formulaire de provenance. Utilisé pour les dates en popup style andre.
|
||||||
|
* \param d 1=Affiche aussi les jours, mois, annees
|
||||||
*/
|
*/
|
||||||
function select_date($set_time='', $prefix='re', $h = 0, $m = 0, $empty=0, $form_name="")
|
function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
@ -2224,140 +2225,145 @@ class Form
|
|||||||
$smin = '';
|
$smin = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
if ($d)
|
||||||
* Affiche date en popup
|
|
||||||
*/
|
|
||||||
if ($conf->use_javascript && $conf->use_popup_calendar)
|
|
||||||
{
|
{
|
||||||
//print "e".$set_time." t ".$conf->format_date_short;
|
/*
|
||||||
if ($set_time > 0)
|
* Affiche date en popup
|
||||||
{
|
*/
|
||||||
$formated_date=dolibarr_print_date($set_time,$conf->format_date_short);
|
if ($conf->use_javascript && $conf->use_popup_calendar)
|
||||||
}
|
{
|
||||||
|
//print "e".$set_time." t ".$conf->format_date_short;
|
||||||
// Calendrier popup version eldy
|
if ($set_time > 0)
|
||||||
if ("$conf->use_popup_calendar" == "eldy") // Laisser conf->use_popup_calendar entre quote
|
{
|
||||||
{
|
$formated_date=dolibarr_print_date($set_time,$conf->format_date_short);
|
||||||
// Zone de saisie manuelle de la date
|
}
|
||||||
print '<input id="'.$prefix.'" name="'.$prefix.'" type="text" size="11" maxlength="11" value="'.$formated_date.'"';
|
|
||||||
print ' onChange="dpChangeDay(\''.$prefix.'\',\''.$conf->format_date_short_java.'\')"';
|
// Calendrier popup version eldy
|
||||||
print '> ';
|
if ("$conf->use_popup_calendar" == "eldy") // Laisser conf->use_popup_calendar entre quote
|
||||||
|
{
|
||||||
// Icone calendrier
|
// Zone de saisie manuelle de la date
|
||||||
print '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"';
|
print '<input id="'.$prefix.'" name="'.$prefix.'" type="text" size="11" maxlength="11" value="'.$formated_date.'"';
|
||||||
$base=DOL_URL_ROOT.'/lib/';
|
print ' onChange="dpChangeDay(\''.$prefix.'\',\''.$conf->format_date_short_java.'\')"';
|
||||||
print ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$conf->format_date_short_java.'\');">'.img_object($langs->trans("SelectDate"),'calendar').'</button>';
|
print '> ';
|
||||||
|
|
||||||
print '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n";
|
// Icone calendrier
|
||||||
print '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
|
print '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"';
|
||||||
print '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n";
|
$base=DOL_URL_ROOT.'/lib/';
|
||||||
}
|
print ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$conf->format_date_short_java.'\');">'.img_object($langs->trans("SelectDate"),'calendar').'</button>';
|
||||||
else
|
|
||||||
{
|
print '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n";
|
||||||
// Calendrier popup version defaut
|
print '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
|
||||||
if ($langs->defaultlang != "")
|
print '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n";
|
||||||
{
|
|
||||||
print '<script language="javascript" type="text/javascript">';
|
|
||||||
print 'selectedLanguage = "'.substr($langs->defaultlang,0,2).'"';
|
|
||||||
print '</script>';
|
|
||||||
}
|
}
|
||||||
print '<script language="javascript" type="text/javascript" src="'.DOL_URL_ROOT.'/lib/lib_calendar.js"></script>';
|
|
||||||
print '<input id="'.$prefix.'" type="text" name="'.$prefix.'" size="10" value="'.$formated_date.'"';
|
|
||||||
print ' onChange="dpChangeDay(\''.$prefix.'\',\''.$conf->format_date_short_java.'\')"';
|
|
||||||
print '> ';
|
|
||||||
print '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n";
|
|
||||||
print '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
|
|
||||||
print '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n";
|
|
||||||
if($form_name =="")
|
|
||||||
print '<A HREF="javascript:showCalendar(document.forms[3].'.$prefix.')">'.img_cal().'</a>';
|
|
||||||
else
|
else
|
||||||
print '<A HREF="javascript:showCalendar(document.forms[\''.$form_name.'\'].'.$prefix.')">'.img_cal().'</a>';
|
{
|
||||||
}
|
// Calendrier popup version defaut
|
||||||
}
|
if ($langs->defaultlang != "")
|
||||||
|
{
|
||||||
/*
|
print '<script language="javascript" type="text/javascript">';
|
||||||
* Affiche date en select
|
print 'selectedLanguage = "'.substr($langs->defaultlang,0,2).'"';
|
||||||
*/
|
print '</script>';
|
||||||
if (! $conf->use_javascript || ! $conf->use_popup_calendar)
|
}
|
||||||
{
|
print '<script language="javascript" type="text/javascript" src="'.DOL_URL_ROOT.'/lib/lib_calendar.js"></script>';
|
||||||
/*
|
print '<input id="'.$prefix.'" type="text" name="'.$prefix.'" size="10" value="'.$formated_date.'"';
|
||||||
if ($set_time == -1)
|
print ' onChange="dpChangeDay(\''.$prefix.'\',\''.$conf->format_date_short_java.'\')"';
|
||||||
{
|
print '> ';
|
||||||
$sday = 0;
|
print '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n";
|
||||||
$smonth = 0;
|
print '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
|
||||||
$syear = 0;
|
print '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n";
|
||||||
$shour = 0;
|
if($form_name =="")
|
||||||
$smin = 0;
|
print '<A HREF="javascript:showCalendar(document.forms[3].'.$prefix.')">'.img_cal().'</a>';
|
||||||
}
|
else
|
||||||
*/
|
print '<A HREF="javascript:showCalendar(document.forms[\''.$form_name.'\'].'.$prefix.')">'.img_cal().'</a>';
|
||||||
// Jour
|
}
|
||||||
print '<select class="flat" name="'.$prefix.'day">';
|
}
|
||||||
|
|
||||||
if ($empty || $set_time == -1)
|
/*
|
||||||
{
|
* Affiche date en select
|
||||||
print '<option value="0" selected="true"> </option>';
|
*/
|
||||||
}
|
if (! $conf->use_javascript || ! $conf->use_popup_calendar)
|
||||||
|
{
|
||||||
for ($day = 1 ; $day <= 31; $day++)
|
/*
|
||||||
{
|
if ($set_time == -1)
|
||||||
if ($day == $sday)
|
{
|
||||||
{
|
$sday = 0;
|
||||||
print "<option value=\"$day\" selected=\"true\">$day";
|
$smonth = 0;
|
||||||
}
|
$syear = 0;
|
||||||
else
|
$shour = 0;
|
||||||
{
|
$smin = 0;
|
||||||
print "<option value=\"$day\">$day";
|
}
|
||||||
}
|
*/
|
||||||
print "</option>";
|
// Jour
|
||||||
}
|
print '<select class="flat" name="'.$prefix.'day">';
|
||||||
|
|
||||||
print "</select>";
|
if ($empty || $set_time == -1)
|
||||||
|
{
|
||||||
print '<select class="flat" name="'.$prefix.'month">';
|
print '<option value="0" selected="true"> </option>';
|
||||||
if ($empty || $set_time == -1)
|
}
|
||||||
{
|
|
||||||
print '<option value="0" selected="true"> </option>';
|
for ($day = 1 ; $day <= 31; $day++)
|
||||||
}
|
{
|
||||||
|
if ($day == $sday)
|
||||||
// Mois
|
{
|
||||||
for ($month = 1 ; $month <= 12 ; $month++)
|
print "<option value=\"$day\" selected=\"true\">$day";
|
||||||
{
|
}
|
||||||
print '<option value="'.$month.'"'.($month == $smonth?' selected="true"':'').'>';
|
else
|
||||||
print dolibarr_print_date(mktime(1,1,1,$month,1,2000),"%b");
|
{
|
||||||
print "</option>";
|
print "<option value=\"$day\">$day";
|
||||||
}
|
}
|
||||||
print "</select>";
|
print "</option>";
|
||||||
|
}
|
||||||
// Année
|
|
||||||
if ($empty || $set_time == -1)
|
print "</select>";
|
||||||
{
|
|
||||||
print '<input class="flat" type="text" size="3" maxlength="4" name="'.$prefix.'year" value="'.$syear.'">';
|
print '<select class="flat" name="'.$prefix.'month">';
|
||||||
}
|
if ($empty || $set_time == -1)
|
||||||
else
|
{
|
||||||
{
|
print '<option value="0" selected="true"> </option>';
|
||||||
print '<select class="flat" name="'.$prefix.'year">';
|
}
|
||||||
|
|
||||||
for ($year = $syear - 5; $year < $syear + 10 ; $year++)
|
// Mois
|
||||||
{
|
for ($month = 1 ; $month <= 12 ; $month++)
|
||||||
if ($year == $syear)
|
{
|
||||||
{
|
print '<option value="'.$month.'"'.($month == $smonth?' selected="true"':'').'>';
|
||||||
print "<option value=\"$year\" selected=\"true\">$year";
|
print dolibarr_print_date(mktime(1,1,1,$month,1,2000),"%b");
|
||||||
}
|
print "</option>";
|
||||||
else
|
}
|
||||||
{
|
print "</select>";
|
||||||
print "<option value=\"$year\">$year";
|
|
||||||
}
|
// Année
|
||||||
print "</option>";
|
if ($empty || $set_time == -1)
|
||||||
}
|
{
|
||||||
print "</select>\n";
|
print '<input class="flat" type="text" size="3" maxlength="4" name="'.$prefix.'year" value="'.$syear.'">';
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
/*
|
print '<select class="flat" name="'.$prefix.'year">';
|
||||||
* Affiche heure en select
|
|
||||||
*/
|
for ($year = $syear - 5; $year < $syear + 10 ; $year++)
|
||||||
|
{
|
||||||
|
if ($year == $syear)
|
||||||
|
{
|
||||||
|
print "<option value=\"$year\" selected=\"true\">$year";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "<option value=\"$year\">$year";
|
||||||
|
}
|
||||||
|
print "</option>";
|
||||||
|
}
|
||||||
|
print "</select>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($d && $h) print ' ';
|
||||||
|
|
||||||
if ($h)
|
if ($h)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* Affiche heure en select
|
||||||
|
*/
|
||||||
print '<select class="flat" name="'.$prefix.'hour">';
|
print '<select class="flat" name="'.$prefix.'hour">';
|
||||||
if ($empty) print '<option value="-1"> </option>';
|
if ($empty) print '<option value="-1"> </option>';
|
||||||
for ($hour = 0; $hour < 24; $hour++)
|
for ($hour = 0; $hour < 24; $hour++)
|
||||||
@ -2379,11 +2385,11 @@ class Form
|
|||||||
print "H\n";
|
print "H\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Affiche min en select
|
|
||||||
*/
|
|
||||||
if ($m)
|
if ($m)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* Affiche min en select
|
||||||
|
*/
|
||||||
print '<select class="flat" name="'.$prefix.'min">';
|
print '<select class="flat" name="'.$prefix.'min">';
|
||||||
if ($empty) print '<option value="-1"> </option>';
|
if ($empty) print '<option value="-1"> </option>';
|
||||||
for ($min = 0; $min < 60 ; $min++)
|
for ($min = 0; $min < 60 ; $min++)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user