Merge remote-tracking branch 'upstream/develop' into countactioncomm
This commit is contained in:
commit
a63daaa8e1
@ -41,6 +41,7 @@ FIX: #16135
|
|||||||
FIX: #16143
|
FIX: #16143
|
||||||
FIX: #16156
|
FIX: #16156
|
||||||
FIX: #16160
|
FIX: #16160
|
||||||
|
FIX: #16165 Create customer discount without vat
|
||||||
FIX: #16185
|
FIX: #16185
|
||||||
FIX: #16189, fix download/see check deposit PDF
|
FIX: #16189, fix download/see check deposit PDF
|
||||||
FIX: #16215
|
FIX: #16215
|
||||||
@ -75,6 +76,7 @@ FIX: ODT generation very slow
|
|||||||
FIX: amount in summary of report
|
FIX: amount in summary of report
|
||||||
FIX: vat value when code contains number
|
FIX: vat value when code contains number
|
||||||
FIX: payment term label on PDF
|
FIX: payment term label on PDF
|
||||||
|
FIX: date selector when using reduced year (like on smartphone)
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 13.0.0 compared to 12.0.0 *****
|
***** ChangeLog for 13.0.0 compared to 12.0.0 *****
|
||||||
|
|||||||
@ -780,7 +780,7 @@ if ($object->id > 0)
|
|||||||
$objp = $db->fetch_object($resql);
|
$objp = $db->fetch_object($resql);
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowraponall">';
|
||||||
$propal_static->id = $objp->propalid;
|
$propal_static->id = $objp->propalid;
|
||||||
$propal_static->ref = $objp->ref;
|
$propal_static->ref = $objp->ref;
|
||||||
$propal_static->ref_client = $objp->ref_client;
|
$propal_static->ref_client = $objp->ref_client;
|
||||||
@ -871,7 +871,7 @@ if ($object->id > 0)
|
|||||||
$commande_static->billed = $objp->billed;
|
$commande_static->billed = $objp->billed;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowraponall">';
|
||||||
print $commande_static->getNomUrl(1);
|
print $commande_static->getNomUrl(1);
|
||||||
print '</td><td class="right" width="80px">'.dol_print_date($db->jdate($objp->dc), 'day')."</td>\n";
|
print '</td><td class="right" width="80px">'.dol_print_date($db->jdate($objp->dc), 'day')."</td>\n";
|
||||||
print '<td class="right" style="min-width: 60px">'.price($objp->total_ht).'</td>';
|
print '<td class="right" style="min-width: 60px">'.price($objp->total_ht).'</td>';
|
||||||
@ -938,7 +938,7 @@ if ($object->id > 0)
|
|||||||
$sendingstatic->ref = $objp->ref;
|
$sendingstatic->ref = $objp->ref;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowraponall">';
|
||||||
print $sendingstatic->getNomUrl(1);
|
print $sendingstatic->getNomUrl(1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($objp->date_creation > 0) {
|
if ($objp->date_creation > 0) {
|
||||||
@ -1014,7 +1014,7 @@ if ($object->id > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowraponall">';
|
||||||
print $contrat->getNomUrl(1, 12);
|
print $contrat->getNomUrl(1, 12);
|
||||||
print $late;
|
print $late;
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
@ -1076,10 +1076,13 @@ if ($object->id > 0)
|
|||||||
$objp = $db->fetch_object($resql);
|
$objp = $db->fetch_object($resql);
|
||||||
|
|
||||||
$fichinter_static->id = $objp->id;
|
$fichinter_static->id = $objp->id;
|
||||||
|
$fichinter_static->ref = $objp->ref;
|
||||||
$fichinter_static->statut = $objp->fk_statut;
|
$fichinter_static->statut = $objp->fk_statut;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap"><a href="'.DOL_URL_ROOT.'/fichinter/card.php?id='.$objp->id.'">'.img_object($langs->trans("ShowPropal"), "propal").' '.$objp->ref.'</a></td>'."\n";
|
print '<td class="nowraponall">';
|
||||||
|
print $fichinter_static->getNomUrl(1);
|
||||||
|
print '</td>'."\n";
|
||||||
//print '<td class="right" width="80px">'.dol_print_date($db->jdate($objp->startdate)).'</td>'."\n";
|
//print '<td class="right" width="80px">'.dol_print_date($db->jdate($objp->startdate)).'</td>'."\n";
|
||||||
print '<td class="right" style="min-width: 60px">'.convertSecondToTime($objp->duration).'</td>'."\n";
|
print '<td class="right" style="min-width: 60px">'.convertSecondToTime($objp->duration).'</td>'."\n";
|
||||||
print '<td class="nowrap right" style="min-width: 60px">'.$fichinter_static->getLibStatut(5).'</td>'."\n";
|
print '<td class="nowrap right" style="min-width: 60px">'.$fichinter_static->getLibStatut(5).'</td>'."\n";
|
||||||
@ -1210,7 +1213,7 @@ if ($object->id > 0)
|
|||||||
$sql .= ', f.total as total_ht';
|
$sql .= ', f.total as total_ht';
|
||||||
$sql .= ', f.tva as total_tva';
|
$sql .= ', f.tva as total_tva';
|
||||||
$sql .= ', f.total_ttc';
|
$sql .= ', f.total_ttc';
|
||||||
$sql .= ', f.datef as df, f.datec as dc, f.paye as paye, f.fk_statut as statut';
|
$sql .= ', f.datef as df, f.datec as dc, f.paye as paye, f.fk_statut as status';
|
||||||
$sql .= ', s.nom, s.rowid as socid';
|
$sql .= ', s.nom, s.rowid as socid';
|
||||||
$sql .= ', SUM(pf.amount) as am';
|
$sql .= ', SUM(pf.amount) as am';
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
|
||||||
@ -1251,9 +1254,10 @@ if ($object->id > 0)
|
|||||||
$facturestatic->total_ht = $objp->total_ht;
|
$facturestatic->total_ht = $objp->total_ht;
|
||||||
$facturestatic->total_tva = $objp->total_tva;
|
$facturestatic->total_tva = $objp->total_tva;
|
||||||
$facturestatic->total_ttc = $objp->total_ttc;
|
$facturestatic->total_ttc = $objp->total_ttc;
|
||||||
|
$facturestatic->statut = $objp->status;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowraponall">';
|
||||||
print $facturestatic->getNomUrl(1);
|
print $facturestatic->getNomUrl(1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($objp->df > 0)
|
if ($objp->df > 0)
|
||||||
@ -1273,7 +1277,7 @@ if ($object->id > 0)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<td class="nowrap right" style="min-width: 60px">'.($facturestatic->LibStatut($objp->paye, $objp->statut, 5, $objp->am)).'</td>';
|
print '<td class="nowrap right" style="min-width: 60px">'.($facturestatic->LibStatut($objp->paye, $objp->status, 5, $objp->am)).'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4756,7 +4756,7 @@ if ($action == 'create')
|
|||||||
$paymentstatic->num_payment = $objp->num_payment;
|
$paymentstatic->num_payment = $objp->num_payment;
|
||||||
$paymentstatic->payment_code = $objp->payment_code;
|
$paymentstatic->payment_code = $objp->payment_code;
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td class="nowraponall">';
|
||||||
print $paymentstatic->getNomUrl(1);
|
print $paymentstatic->getNomUrl(1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@ -4785,7 +4785,7 @@ if ($action == 'create')
|
|||||||
$bankaccountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1);
|
$bankaccountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<td class="right">';
|
print '<td class="nowraponall">';
|
||||||
if ($bankaccountstatic->id)
|
if ($bankaccountstatic->id)
|
||||||
print $bankaccountstatic->getNomUrl(1, 'transactions');
|
print $bankaccountstatic->getNomUrl(1, 'transactions');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -508,19 +508,19 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
|||||||
print '<tr><td>'.$langs->trans('Numero');
|
print '<tr><td>'.$langs->trans('Numero');
|
||||||
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
|
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td><input name="num_paiement" type="text" value="'.$paymentnum.'"></td></tr>';
|
print '<td><input name="num_paiement" type="text" class="maxwidth200" value="'.$paymentnum.'"></td></tr>';
|
||||||
|
|
||||||
// Check transmitter
|
// Check transmitter
|
||||||
print '<tr><td class="'.(GETPOST('paiementcode') == 'CHQ' ? 'fieldrequired ' : '').'fieldrequireddyn">'.$langs->trans('CheckTransmitter');
|
print '<tr><td class="'.(GETPOST('paiementcode') == 'CHQ' ? 'fieldrequired ' : '').'fieldrequireddyn">'.$langs->trans('CheckTransmitter');
|
||||||
print ' <em>('.$langs->trans("ChequeMaker").')</em>';
|
print ' <em>('.$langs->trans("ChequeMaker").')</em>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td><input id="fieldchqemetteur" name="chqemetteur" size="30" type="text" value="'.GETPOST('chqemetteur', 'alphanohtml').'"></td></tr>';
|
print '<td><input id="fieldchqemetteur" class="maxwidth300" name="chqemetteur" type="text" value="'.GETPOST('chqemetteur', 'alphanohtml').'"></td></tr>';
|
||||||
|
|
||||||
// Bank name
|
// Bank name
|
||||||
print '<tr><td>'.$langs->trans('Bank');
|
print '<tr><td>'.$langs->trans('Bank');
|
||||||
print ' <em>('.$langs->trans("ChequeBank").')</em>';
|
print ' <em>('.$langs->trans("ChequeBank").')</em>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td><input name="chqbank" size="30" type="text" value="'.GETPOST('chqbank', 'alphanohtml').'"></td></tr>';
|
print '<td><input name="chqbank" class="maxwidth300" type="text" value="'.GETPOST('chqbank', 'alphanohtml').'"></td></tr>';
|
||||||
|
|
||||||
// Comments
|
// Comments
|
||||||
print '<tr><td>'.$langs->trans('Comments').'</td>';
|
print '<tr><td>'.$langs->trans('Comments').'</td>';
|
||||||
@ -578,6 +578,8 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
//print '<tr><td colspan="3">';
|
//print '<tr><td colspan="3">';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -786,7 +788,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
//print "</td></tr>\n";
|
print "</div>\n";
|
||||||
}
|
}
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -5700,6 +5700,9 @@ class Form
|
|||||||
if ($h == 3) $shour = '';
|
if ($h == 3) $shour = '';
|
||||||
if ($m == 3) $smin = '';
|
if ($m == 3) $smin = '';
|
||||||
|
|
||||||
|
$nowgmt = dol_now('gmt');
|
||||||
|
//var_dump(dol_print_date($nowgmt, 'dayhourinputnoreduce', 'tzuserrel'));
|
||||||
|
|
||||||
// You can set MAIN_POPUP_CALENDAR to 'eldy' or 'jquery'
|
// You can set MAIN_POPUP_CALENDAR to 'eldy' or 'jquery'
|
||||||
$usecalendar = 'combo';
|
$usecalendar = 'combo';
|
||||||
if (!empty($conf->use_javascript_ajax) && (empty($conf->global->MAIN_POPUP_CALENDAR) || $conf->global->MAIN_POPUP_CALENDAR != "none")) {
|
if (!empty($conf->use_javascript_ajax) && (empty($conf->global->MAIN_POPUP_CALENDAR) || $conf->global->MAIN_POPUP_CALENDAR != "none")) {
|
||||||
@ -5722,13 +5725,13 @@ class Form
|
|||||||
// Calendrier popup version eldy
|
// Calendrier popup version eldy
|
||||||
if ($usecalendar == "eldy")
|
if ($usecalendar == "eldy")
|
||||||
{
|
{
|
||||||
// Zone de saisie manuelle de la date
|
// Input area to enter date manually
|
||||||
$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
|
$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
|
||||||
$retstring .= ($disabled ? ' disabled' : '');
|
$retstring .= ($disabled ? ' disabled' : '');
|
||||||
$retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
|
$retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
|
||||||
$retstring .= '>';
|
$retstring .= '>';
|
||||||
|
|
||||||
// Icone calendar
|
// Icon calendar
|
||||||
$retstringbuttom = '';
|
$retstringbuttom = '';
|
||||||
if (!$disabled) {
|
if (!$disabled) {
|
||||||
$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"';
|
$retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"';
|
||||||
@ -5912,8 +5915,7 @@ class Form
|
|||||||
{
|
{
|
||||||
// Script which will be inserted in the onClick of the "Now" link
|
// Script which will be inserted in the onClick of the "Now" link
|
||||||
$reset_scripts = "";
|
$reset_scripts = "";
|
||||||
if ($addnowlink == 2) // local computer time
|
if ($addnowlink == 2) { // local computer time
|
||||||
{
|
|
||||||
// pad add leading 0 on numbers
|
// pad add leading 0 on numbers
|
||||||
$reset_scripts .= "Number.prototype.pad = function(size) {
|
$reset_scripts .= "Number.prototype.pad = function(size) {
|
||||||
var s = String(this);
|
var s = String(this);
|
||||||
@ -5924,14 +5926,12 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Generate the date part, depending on the use or not of the javascript calendar
|
// Generate the date part, depending on the use or not of the javascript calendar
|
||||||
if ($addnowlink == 1) // server time expressed in user time setup
|
if ($addnowlink == 1) { // server time expressed in user time setup
|
||||||
{
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date(dol_now(), 'day', 'tzuser').'\');';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date(dol_now(), '%d', 'tzuser').'\');';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date(dol_now(), '%m', 'tzuser').'\');';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date(dol_now(), '%Y', 'tzuser').'\');';
|
} elseif ($addnowlink == 2) {
|
||||||
} elseif ($addnowlink == 2)
|
|
||||||
{
|
|
||||||
/* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix.
|
/* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix.
|
||||||
* This break application for foreign languages.
|
* This break application for foreign languages.
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(d.toLocaleDateString(\''.str_replace('_', '-', $langs->defaultlang).'\'));';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(d.toLocaleDateString(\''.str_replace('_', '-', $langs->defaultlang).'\'));';
|
||||||
@ -5939,10 +5939,10 @@ class Form
|
|||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);';
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());';
|
||||||
*/
|
*/
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date(dol_now(), 'day', 'tzuser').'\');';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');';
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date(dol_now(), '%d', 'tzuser').'\');';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date(dol_now(), '%m', 'tzuser').'\');';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date(dol_now(), '%Y', 'tzuser').'\');';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
|
||||||
}
|
}
|
||||||
/*if ($usecalendar == "eldy")
|
/*if ($usecalendar == "eldy")
|
||||||
{
|
{
|
||||||
@ -5962,7 +5962,7 @@ class Form
|
|||||||
//$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); ';
|
//$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); ';
|
||||||
if ($addnowlink == 1)
|
if ($addnowlink == 1)
|
||||||
{
|
{
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date(dol_now(), '%H', 'tzuser').'\');';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();';
|
||||||
} elseif ($addnowlink == 2)
|
} elseif ($addnowlink == 2)
|
||||||
{
|
{
|
||||||
@ -5979,7 +5979,7 @@ class Form
|
|||||||
//$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); ';
|
//$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); ';
|
||||||
if ($addnowlink == 1)
|
if ($addnowlink == 1)
|
||||||
{
|
{
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date(dol_now(), '%M', 'tzuser').'\');';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();';
|
||||||
} elseif ($addnowlink == 2)
|
} elseif ($addnowlink == 2)
|
||||||
{
|
{
|
||||||
@ -6004,22 +6004,22 @@ class Form
|
|||||||
$reset_scripts = "";
|
$reset_scripts = "";
|
||||||
|
|
||||||
// Generate the date part, depending on the use or not of the javascript calendar
|
// Generate the date part, depending on the use or not of the javascript calendar
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date(dol_now(), 'day').'\');';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');';
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date(dol_now(), '%d').'\');';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');';
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date(dol_now(), '%m').'\');';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');';
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date(dol_now(), '%Y').'\');';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');';
|
||||||
// Update the hour part
|
// Update the hour part
|
||||||
if ($h)
|
if ($h)
|
||||||
{
|
{
|
||||||
if ($fullday) $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
|
if ($fullday) $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date(dol_now(), '%H').'\');';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');';
|
||||||
if ($fullday) $reset_scripts .= ' } ';
|
if ($fullday) $reset_scripts .= ' } ';
|
||||||
}
|
}
|
||||||
// Update the minute part
|
// Update the minute part
|
||||||
if ($m)
|
if ($m)
|
||||||
{
|
{
|
||||||
if ($fullday) $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
|
if ($fullday) $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
|
||||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date(dol_now(), '%M').'\');';
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');';
|
||||||
if ($fullday) $reset_scripts .= ' } ';
|
if ($fullday) $reset_scripts .= ' } ';
|
||||||
}
|
}
|
||||||
// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
|
// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
|
||||||
@ -6031,12 +6031,12 @@ class Form
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a "Plus one hour" link
|
// Add a link to set data
|
||||||
if ($conf->use_javascript_ajax && $adddateof)
|
if ($conf->use_javascript_ajax && $adddateof)
|
||||||
{
|
{
|
||||||
$tmparray = dol_getdate($adddateof);
|
$tmparray = dol_getdate($adddateof);
|
||||||
if (empty($labeladddateof)) $labeladddateof = $langs->trans("DateInvoice");
|
if (empty($labeladddateof)) $labeladddateof = $langs->trans("DateInvoice");
|
||||||
$retstring .= ' - <button class="dpInvisibleButtons datenowlink" id="dateofinvoice" type="button" name="_dateofinvoice" value="now" onclick="jQuery(\'#re\').val(\''.dol_print_date($adddateof, 'day').'\');jQuery(\'#reday\').val(\''.$tmparray['mday'].'\');jQuery(\'#remonth\').val(\''.$tmparray['mon'].'\');jQuery(\'#reyear\').val(\''.$tmparray['year'].'\');">'.$labeladddateof.'</a>';
|
$retstring .= ' - <button class="dpInvisibleButtons datenowlink" id="dateofinvoice" type="button" name="_dateofinvoice" value="now" onclick="console.log(\'Click on now link\'); jQuery(\'#re\').val(\''.dol_print_date($adddateof, 'dayinputnoreduce').'\');jQuery(\'#reday\').val(\''.$tmparray['mday'].'\');jQuery(\'#remonth\').val(\''.$tmparray['mon'].'\');jQuery(\'#reyear\').val(\''.$tmparray['year'].'\');">'.$labeladddateof.'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $retstring;
|
return $retstring;
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/core/class/html.formactions.class.php
|
* \file htdocs/core/class/html.formactions.class.php
|
||||||
* \ingroup core
|
* \ingroup core
|
||||||
* \brief Fichier de la classe des fonctions predefinie de composants html actions
|
* \brief File of class with predefined functions and HTML components
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -183,17 +183,18 @@ function getObjectFromID(id){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Called after selection of a date to save details into detailed fields
|
// Called after selection of a date to save details into detailed fields
|
||||||
function dpChangeDay(dateFieldID,format)
|
function dpChangeDay(dateFieldID, format)
|
||||||
{
|
{
|
||||||
//showDP.datefieldID=dateFieldID;
|
//showDP.datefieldID=dateFieldID;
|
||||||
console.log("Call dpChangeDay, we save date into detailed fields.");
|
console.log("Call dpChangeDay, we save date into detailed fields from format = "+format);
|
||||||
|
|
||||||
var thefield=getObjectFromID(dateFieldID);
|
var thefield=getObjectFromID(dateFieldID);
|
||||||
var thefieldday=getObjectFromID(dateFieldID+"day");
|
var thefieldday=getObjectFromID(dateFieldID+"day");
|
||||||
var thefieldmonth=getObjectFromID(dateFieldID+"month");
|
var thefieldmonth=getObjectFromID(dateFieldID+"month");
|
||||||
var thefieldyear=getObjectFromID(dateFieldID+"year");
|
var thefieldyear=getObjectFromID(dateFieldID+"year");
|
||||||
|
|
||||||
var date=getDateFromFormat(thefield.value,format);
|
var date=getDateFromFormat(thefield.value, format);
|
||||||
|
//console.log(date);
|
||||||
if (date)
|
if (date)
|
||||||
{
|
{
|
||||||
thefieldday.value=date.getDate();
|
thefieldday.value=date.getDate();
|
||||||
|
|||||||
@ -1970,7 +1970,7 @@ function dol_strftime($fmt, $ts = false, $is_gmt = false)
|
|||||||
* "%d/%m/%Y %H:%M",
|
* "%d/%m/%Y %H:%M",
|
||||||
* "%d/%m/%Y %H:%M:%S",
|
* "%d/%m/%Y %H:%M:%S",
|
||||||
* "%B"=Long text of month, "%A"=Long text of day, "%b"=Short text of month, "%a"=Short text of day
|
* "%B"=Long text of month, "%A"=Long text of day, "%b"=Short text of month, "%a"=Short text of day
|
||||||
* "day", "daytext", "dayhour", "dayhourldap", "dayhourtext", "dayrfc", "dayhourrfc", "...reduceformat"
|
* "day", "daytext", "dayhour", "dayhourldap", "dayhourtext", "dayrfc", "dayhourrfc", "...inputnoreduce", "...reduceformat"
|
||||||
* @param string $tzoutput true or 'gmt' => string is for Greenwich location
|
* @param string $tzoutput true or 'gmt' => string is for Greenwich location
|
||||||
* false or 'tzserver' => output string is for local PHP server TZ usage
|
* false or 'tzserver' => output string is for local PHP server TZ usage
|
||||||
* 'tzuser' => output string is for user TZ (current browser TZ with current dst) => In a future, we should have same behaviour than 'tzuserrel'
|
* 'tzuser' => output string is for user TZ (current browser TZ with current dst) => In a future, we should have same behaviour than 'tzuserrel'
|
||||||
@ -2014,13 +2014,17 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
|||||||
}
|
}
|
||||||
if (!is_object($outputlangs)) $outputlangs = $langs;
|
if (!is_object($outputlangs)) $outputlangs = $langs;
|
||||||
if (!$format) $format = 'daytextshort';
|
if (!$format) $format = 'daytextshort';
|
||||||
$reduceformat = (!empty($conf->dol_optimize_smallscreen) && in_array($format, array('day', 'dayhour'))) ? 1 : 0;
|
|
||||||
|
// Do we have to reduce the length of date (year on 2 chars) to save space.
|
||||||
|
// Note: dayinputnoreduce is same than day but no reduction of year length will be done
|
||||||
|
$reduceformat = (!empty($conf->dol_optimize_smallscreen) && in_array($format, array('day', 'dayhour'))) ? 1 : 0; // Test on original $format param.
|
||||||
|
$format = preg_replace('/inputnoreduce/', '', $format); // so format 'dayinputnoreduce' is processed like day
|
||||||
$formatwithoutreduce = preg_replace('/reduceformat/', '', $format);
|
$formatwithoutreduce = preg_replace('/reduceformat/', '', $format);
|
||||||
if ($formatwithoutreduce != $format) { $format = $formatwithoutreduce; $reduceformat = 1; } // so format 'dayreduceformat' is processed like day
|
if ($formatwithoutreduce != $format) { $format = $formatwithoutreduce; $reduceformat = 1; } // so format 'dayreduceformat' is processed like day
|
||||||
|
|
||||||
// Change predefined format into computer format. If found translation in lang file we use it, otherwise we use default.
|
// Change predefined format into computer format. If found translation in lang file we use it, otherwise we use default.
|
||||||
// TODO Add format daysmallyear and dayhoursmallyear
|
// TODO Add format daysmallyear and dayhoursmallyear
|
||||||
if ($format == 'day') $format = ($outputlangs->trans("FormatDateShort") != "FormatDateShort" ? $outputlangs->trans("FormatDateShort") : $conf->format_date_short);
|
if ($format == 'day') $format = ($outputlangs->trans("FormatDateShort") != "FormatDateShort" ? $outputlangs->trans("FormatDateShort") : $conf->format_date_short);
|
||||||
elseif ($format == 'hour') $format = ($outputlangs->trans("FormatHourShort") != "FormatHourShort" ? $outputlangs->trans("FormatHourShort") : $conf->format_hour_short);
|
elseif ($format == 'hour') $format = ($outputlangs->trans("FormatHourShort") != "FormatHourShort" ? $outputlangs->trans("FormatHourShort") : $conf->format_hour_short);
|
||||||
elseif ($format == 'hourduration') $format = ($outputlangs->trans("FormatHourShortDuration") != "FormatHourShortDuration" ? $outputlangs->trans("FormatHourShortDuration") : $conf->format_hour_short_duration);
|
elseif ($format == 'hourduration') $format = ($outputlangs->trans("FormatHourShortDuration") != "FormatHourShortDuration" ? $outputlangs->trans("FormatHourShortDuration") : $conf->format_hour_short_duration);
|
||||||
elseif ($format == 'daytext') $format = ($outputlangs->trans("FormatDateText") != "FormatDateText" ? $outputlangs->trans("FormatDateText") : $conf->format_date_text);
|
elseif ($format == 'daytext') $format = ($outputlangs->trans("FormatDateText") != "FormatDateText" ? $outputlangs->trans("FormatDateText") : $conf->format_date_text);
|
||||||
|
|||||||
@ -162,6 +162,10 @@ class ImportTest extends PHPUnit\Framework\TestCase
|
|||||||
// according to option
|
// according to option
|
||||||
$this->assertEquals(0, 0);
|
$this->assertEquals(0, 0);
|
||||||
|
|
||||||
|
// TODO Export and compare the file exported with the $file imported.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user