Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0) (#28718)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* Qual: Update selectDate '' arguments h, m and empty to match PHPdoc (set to 0)

* New: Fixer for selectDate '' arguments h, m and empty

* Qual: Update codespell exceptions
This commit is contained in:
MDW 2024-03-09 01:04:15 +01:00 committed by GitHub
parent d13d661754
commit 3b57795895
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
55 changed files with 377 additions and 200 deletions

View File

@ -178,6 +178,7 @@
if (empty($this->datea)) {
if (in_array('01', $TWeek) && in_array('52', $TWeek) && $weekNb == '01') {
print $form->selectDate(strtotime(date('Y-m-d', $object->datee)), 'end', '', '', 0, '', 1, 0);
print $form->selectDate(strtotime(date('Y-m-d', $object->datee)), 'end', 0, 0, 0, '', 1, 0);
print $object->datee ? dol_print_date($object->datee, 'daytext') : ' ';
print '<input type="hidden" name="action" value="addin">';
print '<tr><td>'.$langs->trans("AddIn").'</td><td>';

View File

@ -5,6 +5,7 @@
//require_once __DIR__.'/plugins/DeprecatedModuleNameFixer.php';
//require_once __DIR__.'/plugins/PriceFormFixer.php';
//require_once __DIR__.'/plugins/UrlEncodeStringifyFixer.php';
require_once __DIR__.'/plugins/SelectDateFixer.php';
/* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*/

View File

@ -0,0 +1,175 @@
<?php
/* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* For 'price()', replace $form parameter that is '' with 0.
*/
declare(strict_types=1);
use ast\flags;
use Microsoft\PhpParser\Node\Expression\CallExpression;
use Microsoft\PhpParser\Node\QualifiedName;
use Phan\AST\TolerantASTConverter\NodeUtils;
use Phan\CodeBase;
use Phan\IssueInstance;
use Phan\Library\FileCacheEntry;
use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit;
use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet;
use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer;
use Microsoft\PhpParser\Node\Expression\ArgumentExpression;
use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList;
use Microsoft\PhpParser\Node\StringLiteral;
use Microsoft\PhpParser\Node\ReservedWord;
use Microsoft\PhpParser\Token;
/**
* This is a prototype, there are various features it does not implement.
*/
call_user_func(static function (): void {
/**
* @param $code_base @unused-param
* @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function
*/
$fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet {
// Argument {INDEX} (${PARAMETER}) is {CODE} of type {TYPE}{DETAILS} but
// {FUNCTIONLIKE} takes {TYPE}{DETAILS} defined at {FILE}:{LINE} (the inferred real argument type has nothing in common with the parameter's phpdoc type)
//htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 3 ($h) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type)
//htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 4 ($m) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type)
$argument_index = (string) $instance->getTemplateParameters()[0];
$argument_name = (string) $instance->getTemplateParameters()[1];
$argument_code = (string) $instance->getTemplateParameters()[2];
$argument_type = (string) $instance->getTemplateParameters()[3];
$details = (string) $instance->getTemplateParameters()[4];
$functionlike = (string) $instance->getTemplateParameters()[5];
$expected_functionlike = "\\Form::selectDate()";
$expected_name = "selectDate";
if ($functionlike !== $expected_functionlike) {
print "$functionlike != '$expected_functionlike'".PHP_EOL;
return null;
}
// Check if we fix any of this
if (
($argument_name === 'h' && $argument_code === "''")
|| ($argument_name === 'm' && $argument_code === "''")
|| ($argument_name === 'empty' && $argument_code === "''")
) {
$replacement = '0';
$argIdx = ($argument_index - 1) * 2;
$expectedStringValue = "";
} else {
print "ARG$argument_index:$argument_name CODE:$argument_code".PHP_EOL;
return null;
}
// At this point we established that the notification
// matches some we fix.
$line = $instance->getLine();
$edits = [];
foreach ($contents->getNodesAtLine($line) as $node) {
if (!$node instanceof ArgumentExpressionList) {
continue;
}
$arguments = $node->children;
if (count($arguments) <= $argIdx) {
// print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL;
continue;
}
$is_actual_call = $node->parent instanceof CallExpression;
if (!$is_actual_call) {
// print "Not actual call - Skip $instance".PHP_EOL;
continue;
}
print "Actual call - $instance".PHP_EOL;
$callable = $node->parent;
$callableExpression = $callable->callableExpression;
if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) {
$actual_name = $callableExpression->getResolvedName();
} elseif ($callableExpression instanceof Microsoft\PhpParser\Node\Expression\MemberAccessExpression) {
$memberNameToken = $callableExpression->memberName;
$actual_name = (new NodeUtils($contents->getContents()))->tokenToString($memberNameToken);
} else {
print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL;
continue;
}
if ((string) $actual_name !== (string) $expected_name) {
// print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL;
continue;
}
foreach ($arguments as $i => $argument) {
if ($argument instanceof ArgumentExpression) {
print "Type$i: ".get_class($argument->expression).PHP_EOL;
}
}
$stringValue = null;
$arg = $arguments[$argIdx];
if (
$arg instanceof ArgumentExpression
&& $arg->expression instanceof StringLiteral
) {
// Get the string value of the StringLiteral
$stringValue = $arg->expression->getStringContentsText();
print "String is '$stringValue'".PHP_EOL;
} elseif ($arg instanceof ArgumentExpression && $arg->expression instanceof ReservedWord) {
$child = $arg->expression->children;
if (!$child instanceof Token) {
continue;
}
$token_str = (new NodeUtils($contents->getContents()))->tokenToString($child);
print "$token_str KIND:".($child->kind ?? 'no kind')." ".get_class($child).PHP_EOL;
if ($token_str !== 'null') {
continue;
}
$stringValue = ''; // Fake empty
} else {
print "Expression is not string or null ".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL;
continue;
}
if ($stringValue !== $expectedStringValue) {
print "Not replacing $argument_name which is '$stringValue'/".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL;
continue;
}
print "Fixture elem on $line - $actual_name(...'$stringValue'...) - $instance".PHP_EOL;
// Get the first argument (delimiter)
$argument_to_replace = $arg;
$arg_start_pos = $argument_to_replace->getStartPosition();
$arg_end_pos = $argument_to_replace->getEndPosition();
// Set edit instruction
$edits[] = new FileEdit($arg_start_pos, $arg_end_pos, $replacement);
}
if ($edits) {
return new FileEditSet($edits);
}
return null;
};
IssueFixer::registerFixerClosure(
'PhanTypeMismatchArgumentProbablyReal',
$fix
);
});

View File

@ -374,7 +374,7 @@ if ($action == 'create') {
print '<tr>';
print '<td class="titlefieldcreate fieldrequired">'.$langs->trans("Docdate").'</td>';
print '<td>';
print $form->selectDate('', 'doc_date', '', '', '', "create_mvt", 1, 1);
print $form->selectDate('', 'doc_date', 0, 0, 0, "create_mvt", 1, 1);
print '</td>';
print '</tr>';
@ -459,7 +459,7 @@ if ($action == 'create') {
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdate">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
print $form->selectDate($object->doc_date ? $object->doc_date : - 1, 'doc_date', '', '', '', "setdate");
print $form->selectDate($object->doc_date ? $object->doc_date : - 1, 'doc_date', 0, 0, 0, "setdate");
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
print '</form>';
} else {

View File

@ -1118,7 +1118,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Birth Date
print "<tr><td>".$langs->trans("DateOfBirth")."</td><td>\n";
print img_picto('', 'object_calendar', 'class="pictofixedwidth"').$form->selectDate(($object->birth ? $object->birth : -1), 'birth', '', '', 1, 'formsoc');
print img_picto('', 'object_calendar', 'class="pictofixedwidth"').$form->selectDate(($object->birth ? $object->birth : -1), 'birth', 0, 0, 1, 'formsoc');
print "</td></tr>\n";
// Public profil
@ -1365,7 +1365,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Birth Date
print "<tr><td>".$langs->trans("DateOfBirth")."</td><td>\n";
print img_picto('', 'object_calendar', 'class="pictofixedwidth"').$form->selectDate(($object->birth ? $object->birth : -1), 'birth', '', '', 1, 'formsoc');
print img_picto('', 'object_calendar', 'class="pictofixedwidth"').$form->selectDate(($object->birth ? $object->birth : -1), 'birth', 0, 0, 1, 'formsoc');
print "</td></tr>\n";
// Default language

View File

@ -996,7 +996,7 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h
$datefrom = dol_get_first_day(dol_print_date($datefrom, "%Y"));
}
}
print $form->selectDate($datefrom, '', '', '', '', "subscription", 1, 1);
print $form->selectDate($datefrom, '', 0, 0, 0, "subscription", 1, 1);
print "</td></tr>";
// Date end subscription
@ -1013,7 +1013,7 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h
}
}
print '<tr><td>'.$langs->trans("DateEndSubscription").'</td><td>';
print $form->selectDate($dateto, 'end', '', '', '', "subscription", 1, 0);
print $form->selectDate($dateto, 'end', 0, 0, 0, "subscription", 1, 0);
print "</td></tr>";
if ($adht->subscription) {

View File

@ -222,8 +222,8 @@ if ($action != 'edit') {
echo '<td class="linecoltype">' . $form->selectExpense('', 'fk_c_type_fees', 0, 1, 1) . '</td>';
echo '<td class="linecoltyperule">' . $form->selectarray('code_expense_rules_type', $tab_rules_type, '', 0) . '</td>';
echo '<td class="linecoldatestart">' . $form->selectDate(strtotime(date('Y-m-01', dol_now())), 'start', '', '', 0, '', 1, 0) . '</td>';
echo '<td class="linecoldateend">' . $form->selectDate(strtotime(date('Y-m-t', dol_now())), 'end', '', '', 0, '', 1, 0) . '</td>';
echo '<td class="linecoldatestart">' . $form->selectDate(strtotime(date('Y-m-01', dol_now())), 'start', 0, 0, 0, '', 1, 0) . '</td>';
echo '<td class="linecoldateend">' . $form->selectDate(strtotime(date('Y-m-t', dol_now())), 'end', 0, 0, 0, '', 1, 0) . '</td>';
echo '<td class="linecolamount"><input type="text" value="" class="maxwidth100" name="amount" class="amount right" /></td>';
echo '<td class="linecolrestrictive">' . $form->selectyesno('restrictive', 0, 1) . '</td>';
echo '<td class="right linecolbutton"><input type="submit" class="button button-add" value="' . $langs->trans('Add') . '" /></td>';
@ -308,7 +308,7 @@ foreach ($rules as $rule) {
echo '<td class="linecoldatestart">';
if ($action == 'edit' && $object->id == $rule->id) {
print $form->selectDate(strtotime(date('Y-m-d', $object->dates)), 'start', '', '', 0, '', 1, 0);
print $form->selectDate(strtotime(date('Y-m-d', $object->dates)), 'start', 0, 0, 0, '', 1, 0);
} else {
echo dol_print_date($rule->dates, 'day');
}
@ -317,7 +317,7 @@ foreach ($rules as $rule) {
echo '<td class="linecoldateend">';
if ($action == 'edit' && $object->id == $rule->id) {
print $form->selectDate(strtotime(date('Y-m-d', $object->datee)), 'end', '', '', 0, '', 1, 0);
print $form->selectDate(strtotime(date('Y-m-d', $object->datee)), 'end', 0, 0, 0, '', 1, 0);
} else {
echo dol_print_date($rule->datee, 'day');
}

View File

@ -1971,7 +1971,7 @@ if ($action == 'create') {
// Date
print '<tr class="field_addprop"><td class="titlefieldcreate fieldrequired">'.$langs->trans('DatePropal').'</td><td class="valuefieldcreate">';
print img_picto('', 'action', 'class="pictofixedwidth"');
print $form->selectDate('', '', '', '', '', "addprop", 1, 1);
print $form->selectDate('', '', 0, 0, 0, "addprop", 1, 1);
print '</td></tr>';
// Validaty duration
@ -2042,9 +2042,9 @@ if ($action == 'create') {
$syear = date("Y", $tmpdte);
$smonth = date("m", $tmpdte);
$sday = date("d", $tmpdte);
print $form->selectDate($syear."-".$smonth."-".$sday, 'date_livraison', '', '', '', "addprop");
print $form->selectDate($syear."-".$smonth."-".$sday, 'date_livraison', 0, 0, 0, "addprop");
} else {
print $form->selectDate(-1, 'date_livraison', '', '', '', "addprop", 1, 1);
print $form->selectDate(-1, 'date_livraison', 0, 0, 0, "addprop", 1, 1);
}
print '</td></tr>';
@ -2582,7 +2582,7 @@ if ($action == 'create') {
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdate">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
print $form->selectDate($object->date, 're', '', '', 0, "editdate");
print $form->selectDate($object->date, 're', 0, 0, 0, "editdate");
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
print '</form>';
} else {
@ -2610,7 +2610,7 @@ if ($action == 'create') {
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setecheance">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
print $form->selectDate($object->fin_validite, 'ech', '', '', '', "editecheance");
print $form->selectDate($object->fin_validite, 'ech', 0, 0, 0, "editecheance");
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
print '</form>';
} else {

View File

@ -1915,7 +1915,7 @@ if ($action == 'create' && $usercancreate) {
// Date
print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td>';
print img_picto('', 'action', 'class="pictofixedwidth"');
print $form->selectDate('', 're', '', '', '', "crea_commande", 1, 1); // Always autofill date with current date
print $form->selectDate('', 're', 0, 0, 0, "crea_commande", 1, 1); // Always autofill date with current date
print '</td></tr>';
// Date delivery planned
@ -2546,7 +2546,7 @@ if ($action == 'create' && $usercancreate) {
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdate">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
print $form->selectDate($object->date, 'order_', '', '', '', "setdate");
print $form->selectDate($object->date, 'order_', 0, 0, 0, "setdate");
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
print '</form>';
} else {
@ -2568,7 +2568,7 @@ if ($action == 'create' && $usercancreate) {
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdate_livraison">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
print $form->selectDate($object->delivery_date ? $object->delivery_date : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0);
print $form->selectDate($object->delivery_date ? $object->delivery_date : -1, 'liv_', 1, 1, 0, "setdate_livraison", 1, 0);
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
print '</form>';
} else {

View File

@ -1413,7 +1413,7 @@ if ($massaction == 'createbills') {
print $langs->trans('DateInvoice');
print '</td>';
print '<td>';
print $form->selectDate('', '', '', '', '', '', 1, 1);
print $form->selectDate('', '', 0, 0, 0, '', 1, 1);
print '</td>';
print '</tr>';
print '<tr>';

View File

@ -546,7 +546,7 @@ if ($result) {
print '<tr><td>'.$langs->trans("DateOperation").'</td>';
if ($user->hasRight('banque', 'modifier') || $user->hasRight('banque', 'consolidate')) {
print '<td>';
print $form->selectDate($db->jdate($objp->do), 'dateo', '', '', '', 'update', 1, 0, $objp->rappro);
print $form->selectDate($db->jdate($objp->do), 'dateo', 0, 0, 0, 'update', 1, 0, $objp->rappro);
if (!$objp->rappro) {
print ' &nbsp; ';
print '<a class="ajaxforbankoperationchange" href="'.$_SERVER['PHP_SELF'].'?action=doprev&id='.$objp->fk_account.'&rowid='.$objp->rowid.'&token='.newToken().'">';
@ -566,7 +566,7 @@ if ($result) {
print "<tr><td>".$langs->trans("DateValue")."</td>";
if ($user->hasRight('banque', 'modifier') || $user->hasRight('banque', 'consolidate')) {
print '<td>';
print $form->selectDate($db->jdate($objp->dv), 'datev', '', '', '', 'update', 1, 0, $objp->rappro);
print $form->selectDate($db->jdate($objp->dv), 'datev', 0, 0, 0, 'update', 1, 0, $objp->rappro);
if (!$objp->rappro) {
print ' &nbsp; ';
print '<a class="ajaxforbankoperationchange" href="'.$_SERVER['PHP_SELF'].'?action=dvprev&id='.$objp->fk_account.'&rowid='.$objp->rowid.'&token='.newToken().'">';

View File

@ -335,7 +335,7 @@ for ($i = 1 ; $i < $MAXLINES; $i++) {
// Date
print '<td class="nowraponall">';
print $form->selectDate((!empty($dateo[$i]) ? $dateo[$i] : ''), $i.'_', '', '', '', 'add');
print $form->selectDate((!empty($dateo[$i]) ? $dateo[$i] : ''), $i.'_', 0, 0, 0, 'add');
print "</td>\n";
// Description

View File

@ -415,13 +415,13 @@ if ($action == 'create') {
// Date payment
print '<tr><td class="titlefieldcreate">';
print $form->editfieldkey('DatePayment', 'datep', '', $object, 0, 'string', '', 1).'</td><td>';
print $form->selectDate((empty($datep) ? -1 : $datep), "datep", '', '', '', 'add', 1, 1);
print $form->selectDate((empty($datep) ? -1 : $datep), "datep", 0, 0, 0, 'add', 1, 1);
print '</td></tr>';
// Date value for bank
print '<tr><td>';
print $form->editfieldkey('DateValue', 'datev', '', $object, 0).'</td><td>';
print $form->selectDate((empty($datev) ? -1 : $datev), "datev", '', '', '', 'add', 1, 1);
print $form->selectDate((empty($datev) ? -1 : $datev), "datev", 0, 0, 0, 'add', 1, 1);
print '</td></tr>';
// Label
@ -561,9 +561,9 @@ if ($id) {
$formquestion = array(
array('type' => 'text', 'name' => 'clone_label', 'label' => $langs->trans("Label"), 'value' => $langs->trans("CopyOf").' '.$object->label),
array('type' => 'date', 'tdclass'=>'fieldrequired', 'name' => 'clone_date_payment', 'label' => $langs->trans("DatePayment"), 'value' => -1),
array('type' => 'date', 'tdclass' => 'fieldrequired', 'name' => 'clone_date_payment', 'label' => $langs->trans("DatePayment"), 'value' => -1),
array('type' => 'date', 'name' => 'clone_date_value', 'label' => $langs->trans("DateValue"), 'value' => -1),
array('type' => 'other', 'tdclass'=>'fieldrequired', 'name' => 'clone_accountid', 'label' => $langs->trans("BankAccount"), 'value' => $form->select_comptes($object->fk_account, "accountid", 0, '', 1, '', 0, 'minwidth200', 1)),
array('type' => 'other', 'tdclass' => 'fieldrequired', 'name' => 'clone_accountid', 'label' => $langs->trans("BankAccount"), 'value' => $form->select_comptes($object->fk_account, "accountid", 0, '', 1, '', 0, 'minwidth200', 1)),
array('type' => 'text', 'name' => 'clone_amount', 'label' => $langs->trans("Amount"), 'value' => price($object->amount)),
array('type' => 'select', 'name' => 'clone_sens', 'label' => $langs->trans("Sens").' '.$set_value_help, 'values' => $sensarray, 'default' => $object->sens),
);
@ -712,7 +712,7 @@ if ($id) {
}
// Other attributes
$parameters = array('socid'=>$object->id);
$parameters = array('socid' => $object->id);
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
print '</table>';

View File

@ -221,7 +221,7 @@ if ($action == 'create') {
print "<tr>";
print '<td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
print $form->selectDate($datec ? $datec : -1, '', '', '', '', 'add', 1, 1);
print $form->selectDate($datec ? $datec : -1, '', 0, 0, 0, 'add', 1, 1);
print '</td></tr>';
// Km
@ -451,7 +451,7 @@ if ($action == 'create') {
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
// Other attributes
$parameters = array('socid'=>$object->id);
$parameters = array('socid' => $object->id);
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
print "</table><br>";

View File

@ -1135,7 +1135,7 @@ if ($action == 'create') {
// Date next run
print "<tr><td>".$langs->trans('NextDateToExecution')."</td><td>";
$date_next_execution = isset($date_next_execution) ? $date_next_execution : (GETPOST('remonth') ? dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')) : -1);
print $form->selectDate($date_next_execution, '', 1, 1, '', "add", 1, 1);
print $form->selectDate($date_next_execution, '', 1, 1, 0, "add", 1, 1);
print "</td></tr>";
// Number max of generation

View File

@ -3843,14 +3843,14 @@ if ($action == 'create') {
// Date invoice
print '<tr><td class="fieldrequired">'.$langs->trans('DateInvoice').'</td><td colspan="2">';
print img_picto('', 'action', 'class="pictofixedwidth"');
print $form->selectDate($newdateinvoice ? $newdateinvoice : $dateinvoice, '', '', '', '', "add", 1, 1);
print $form->selectDate($newdateinvoice ? $newdateinvoice : $dateinvoice, '', 0, 0, 0, "add", 1, 1);
print '</td></tr>';
// Date point of tax
if (getDolGlobalString('INVOICE_POINTOFTAX_DATE')) {
print '<tr><td class="fieldrequired">'.$langs->trans('DatePointOfTax').'</td><td colspan="2">';
print img_picto('', 'action', 'class="pictofixedwidth"');
print $form->selectDate($date_pointoftax ? $date_pointoftax : -1, 'date_pointoftax', '', '', '', "add", 1, 1);
print $form->selectDate($date_pointoftax ? $date_pointoftax : -1, 'date_pointoftax', 0, 0, 0, "add", 1, 1);
print '</td></tr>';
}

View File

@ -164,12 +164,12 @@ if ($action == 'create') {
// Date of payment
print "<tr>";
print '<td class="titlefieldcreate fieldrequired">'.$langs->trans("DatePayment").'</td><td>';
print $form->selectDate($datep, "datep", '', '', '', 'add', 1, 1);
print $form->selectDate($datep, "datep", 0, 0, 0, 'add', 1, 1);
print '</td></tr>';
// End date of period
print '<tr><td class="fieldrequired">'.$form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")).'</td><td>';
print $form->selectDate($datev, "datev", '', '', '', 'add', 1, 1);
print $form->selectDate($datev, "datev", 0, 0, 0, 'add', 1, 1);
print '</td></tr>';
// Label

View File

@ -90,7 +90,7 @@ $result = restrictedArea($user, 'facture', $object->id, '', '', 'fk_soc', $field
* Actions
*/
$parameters = array('socid'=>$socid);
$parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@ -490,7 +490,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '<tr><td><span class="fieldrequired">'.$langs->trans('Date').'</span></td><td>';
$datepayment = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'));
$datepayment = ($datepayment == '' ? (!getDolGlobalString('MAIN_AUTOFILL_DATE') ? -1 : '') : $datepayment);
print $form->selectDate($datepayment, '', '', '', 0, "add_paiement", 1, 1, 0, '', '', $facture->date);
print $form->selectDate($datepayment, '', 0, 0, 0, "add_paiement", 1, 1, 0, '', '', $facture->date);
print '</td></tr>';
// Payment mode

View File

@ -628,7 +628,7 @@ if ($action == 'new') {
print '<form name="setdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdate">';
print $form->selectDate($object->date_bordereau, 'datecreate_', '', '', '', "setdate");
print $form->selectDate($object->date_bordereau, 'datecreate_', 0, 0, 0, "setdate");
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
print '</form>';
} else {

View File

@ -204,7 +204,7 @@ if ($action == 'create') {
print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
$datepaye = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear"));
$datepayment = !getDolGlobalString('MAIN_AUTOFILL_DATE') ? (GETPOSTISSET("remonth") ? $datepaye : -1) : '';
print $form->selectDate($datepayment, '', '', '', 0, "add_payment", 1, 1, 0, '', '', $charge->date_ech, '', 1, $langs->trans("DateOfSocialContribution"));
print $form->selectDate($datepayment, '', 0, 0, 0, "add_payment", 1, 1, 0, '', '', $charge->date_ech, '', 1, $langs->trans("DateOfSocialContribution"));
print "</td>";
print '</tr>';

View File

@ -203,7 +203,7 @@ if ($action == 'create') {
print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
$datepaye = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear"));
$datepayment = !getDolGlobalString('MAIN_AUTOFILL_DATE') ? (GETPOSTINT("remonth") ? $datepaye : -1) : 0;
print $form->selectDate($datepayment, '', '', '', '', "add_payment", 1, 1);
print $form->selectDate($datepayment, '', 0, 0, 0, "add_payment", 1, 1);
print "</td>";
print '</tr>';

View File

@ -236,7 +236,7 @@ if ($id > 0 || $ref) {
print '<form name="setdate_trans" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdate_trans">';
print $form->selectDate($object->date_trans ? $object->date_trans : -1, 'date_trans', 0, '', "setdate_trans");
print $form->selectDate($object->date_trans ? $object->date_trans : -1, 'date_trans', 0, 0, "setdate_trans");
print '<input type="submit" class="button button-edit smallpaddingimp valign middle" value="'.$langs->trans('Modify').'">';
print '</form>';
} else {
@ -383,7 +383,7 @@ if ($id > 0 || $ref) {
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("NotifyTransmision").'</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("TransData").'</td><td>';
print $form->selectDate('', '', '', '', '', "userfile", 1, 1);
print $form->selectDate('', '', 0, 0, 0, "userfile", 1, 1);
print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("TransMetod").'</td><td>';
print $form->selectarray("methode", $object->methodes_trans);
@ -403,7 +403,7 @@ if ($id > 0 || $ref) {
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("NotifyCredit").'</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans('CreditDate').'</td><td>';
print $form->selectDate(-1, '', '', '', '', "infocredit", 1, 1);
print $form->selectDate(-1, '', 0, 0, 0, "infocredit", 1, 1);
print '</td></tr>';
print '</table>';
print '<br><div class="center"><span class="opacitymedium">'.$langs->trans("ThisWillAlsoAddPaymentOnInvoice").'</span></div>';

View File

@ -233,7 +233,7 @@ if ($id) {
//Date
print '<tr><td class="fieldrequired valid">'.$langs->trans("RefusedData").'</td>';
print '<td class="valid">';
print $form->selectDate('', '', '', '', '', "confirm_rejet");
print $form->selectDate('', '', 0, 0, 0, "confirm_rejet");
print '</td></tr>';
//Reason

View File

@ -223,7 +223,7 @@ if (empty($reshook)) {
$paiement = new PaymentVAT($db);
$paiement->chid = $object->id;
$paiement->datepaye = $datep;
$paiement->amounts = array($object->id=>$amount); // Tableau de montant
$paiement->amounts = array($object->id => $amount); // Tableau de montant
$paiement->paiementtype = GETPOST("type_payment", 'alphanohtml');
$paiement->num_payment = GETPOST("num_payment", 'alphanohtml');
$paiement->note = GETPOST("note", 'restricthtml');
@ -460,7 +460,7 @@ if ($action == 'create') {
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Label").'</td><td><input class="minwidth300" name="label" id="label" value="'.(GETPOSTISSET("label") ? GETPOST("label", '', 2) : $label).'" autofocus></td></tr>';
print '<tr><td class="titlefieldcreate fieldrequired">'.$form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")).'</td><td>';
print $form->selectDate((GETPOSTINT("datevmonth") ? $datev : -1), "datev", '', '', '', 'add', 1, 1);
print $form->selectDate((GETPOSTINT("datevmonth") ? $datev : -1), "datev", 0, 0, 0, 'add', 1, 1);
print '</td></tr>';
// Amount
@ -474,7 +474,7 @@ if ($action == 'create') {
print '<tr class="hide_if_no_auto_create_payment">';
print '<td class="fieldrequired">'.$langs->trans("DatePayment").'</td><td>';
print $form->selectDate($datep, "datep", '', '', '', 'add', 1, 1);
print $form->selectDate($datep, "datep", 0, 0, 0, 'add', 1, 1);
print '</td></tr>';
// Type payment

View File

@ -380,7 +380,7 @@ if (empty($reshook)) {
$lines[$i]->pa_ht,
$array_options,
$lines[$i]->fk_unit,
$num+1
$num + 1
);
if ($result < 0) {
@ -1245,7 +1245,7 @@ if ($action == 'create') {
print '<tr><td><span class="fieldrequired">'.$langs->trans("Date").'</span></td><td>';
print img_picto('', 'action', 'class="pictofixedwidth"');
print $form->selectDate($datecontrat, '', 0, 0, '', "contrat");
print $form->selectDate($datecontrat, '', 0, 0, 0, "contrat");
print "</td></tr>";
// Project
@ -1352,7 +1352,7 @@ if ($action == 'create') {
$formquestion = array(
array('type' => 'date', 'name' => 'd_start', 'label' => $langs->trans("DateServiceActivate"), 'value' => dol_now()),
array('type' => 'date', 'name' => 'd_end', 'label' => $langs->trans("DateEndPlanned"), /*'value' => $form->selectDate('', "end", $usehm, $usehm, '', "active", 1, 0),*/ '', ''),
array('type' => 'text', 'name' => 'comment', 'label' => $langs->trans("Comment"), 'value' => '', '', '', 'class' => 'minwidth300', 'moreattr'=>'autofocus')
array('type' => 'text', 'name' => 'comment', 'label' => $langs->trans("Comment"), 'value' => '', '', '', 'class' => 'minwidth300', 'moreattr' => 'autofocus')
);
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id, $langs->trans("ActivateAllOnContract"), $langs->trans("ConfirmActivateAllOnContract"), "confirm_activate", $formquestion, 'yes', 1, 280);
} elseif ($action == 'clone') {
@ -1730,7 +1730,7 @@ if ($action == 'create') {
$line = new ContratLigne($db);
$line->id = $objp->rowid;
$line->fetch_optionals();
print $line->showOptionals($extrafields, 'view', array('class'=>'oddeven', 'style'=>$moreparam, 'colspan'=>$colspan), '', '', 1);
print $line->showOptionals($extrafields, 'view', array('class' => 'oddeven', 'style' => $moreparam, 'colspan' => $colspan), '', '', 1);
}
} else {
// Line in mode update
@ -1834,7 +1834,7 @@ if ($action == 'create') {
$line = new ContratLigne($db);
$line->id = $objp->rowid;
$line->fetch_optionals();
print $line->showOptionals($extrafields, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan), '', '', 1);
print $line->showOptionals($extrafields, 'edit', array('style' => 'class="oddeven"', 'colspan' => $colspan), '', '', 1);
}
}
@ -1992,10 +1992,10 @@ if ($action == 'create') {
print '<tr class="oddeven">';
print '<td class="nohover">'.$langs->trans("DateServiceActivate").'</td><td class="nohover">';
print $form->selectDate($dateactstart, 'start', $usehm, $usehm, '', "active", 1, 0);
print $form->selectDate($dateactstart, 'start', $usehm, $usehm, 0, "active", 1, 0);
print '</td>';
print '<td class="nohover">'.$langs->trans("DateEndPlanned").'</td><td class="nohover">';
print $form->selectDate($dateactend, "end", $usehm, $usehm, '', "active", 1, 0);
print $form->selectDate($dateactend, "end", $usehm, $usehm, 0, "active", 1, 0);
print '</td>';
print '<td class="center nohover">';
print '</td>';

View File

@ -492,7 +492,7 @@ if (($action == "create") || ($action == "edit")) {
print "<tr><td>";
print $langs->trans('CronDtStart')."</td><td>";
if (!empty($object->datestart)) {
print $form->selectDate($object->datestart, 'datestart', 1, 1, '', "cronform");
print $form->selectDate($object->datestart, 'datestart', 1, 1, 0, "cronform");
} else {
print $form->selectDate(-1, 'datestart', 1, 1, 1, "cronform");
}
@ -504,7 +504,7 @@ if (($action == "create") || ($action == "edit")) {
print "<tr><td>";
print $langs->trans('CronDtEnd')."</td><td>";
if (!empty($object->dateend)) {
print $form->selectDate($object->dateend, 'dateend', 1, 1, '', "cronform");
print $form->selectDate($object->dateend, 'dateend', 1, 1, 0, "cronform");
} else {
print $form->selectDate(-1, 'dateend', 1, 1, 1, "cronform");
}
@ -542,9 +542,9 @@ if (($action == "create") || ($action == "edit")) {
//print ' ('.$langs->trans('CronFrom').')';
print "</td><td>";
if (!empty($object->datenextrun)) {
print $form->selectDate($object->datenextrun, 'datenextrun', 1, 1, '', "cronform");
print $form->selectDate($object->datenextrun, 'datenextrun', 1, 1, 0, "cronform");
} else {
print $form->selectDate(-1, 'datenextrun', 1, 1, '', "cronform", 1, 1);
print $form->selectDate(-1, 'datenextrun', 1, 1, 0, "cronform", 1, 1);
}
print "</td>";
print "<td>";

View File

@ -430,7 +430,7 @@ if ($action == 'create') {
print '<form name="setdate_delivery" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdate_delivery">';
print $form->selectDate($object->date_delivery ? $object->date_delivery : -1, 'liv_', 1, 1, '', "setdate_delivery", 1, 1);
print $form->selectDate($object->date_delivery ? $object->date_delivery : -1, 'liv_', 1, 1, 0, "setdate_delivery", 1, 1);
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
print '</form>';
} else {

View File

@ -490,7 +490,7 @@ if ($action == 'create') {
// Date
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Date").'</td><td>';
print $form->selectDate($donation_date ? $donation_date : -1, '', '', '', '', "add", 1, 1);
print $form->selectDate($donation_date ? $donation_date : -1, '', 0, 0, 0, "add", 1, 1);
print '</td>';
// Amount
@ -623,7 +623,7 @@ if (!empty($id) && $action == 'edit') {
// Date
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Date").'</td><td>';
print $form->selectDate($object->date, '', '', '', '', "update");
print $form->selectDate($object->date, '', 0, 0, 0, "update");
print '</td>';
// Amount

View File

@ -274,7 +274,7 @@ if (empty($reshook)) {
$stockLocation = "ent1".$i."_0";
$qty = "qtyl".$i;
$is_batch_or_serial=0;
$is_batch_or_serial = 0;
if (!empty($objectsrc->lines[$i]->fk_product)) {
$resultFetch = $product->fetch($objectsrc->lines[$i]->fk_product, '', '', '', 1, 1, 1);
if ($resultFetch < 0) {
@ -300,9 +300,9 @@ if (empty($reshook)) {
//var_dump($sub_qty[$j]['id_batch']);
//var_dump($qty);var_dump($batch);var_dump($sub_qty[$j]['q']);var_dump($sub_qty[$j]['id_batch']);
if ($is_batch_or_serial==2 && $sub_qty[$j]['q']>1) {
if ($is_batch_or_serial == 2 && $sub_qty[$j]['q'] > 1) {
setEventMessages($langs->trans("TooManyQtyForSerialNumber", $product->ref, ''), null, 'errors');
$totalqty=0;
$totalqty = 0;
break 2;
}
$j++;
@ -351,7 +351,7 @@ if (empty($reshook)) {
// check qty shipped not greater than ordered
if (getDolGlobalInt("MAIN_DONT_SHIP_MORE_THAN_ORDERED") && $subtotalqty > $objectsrc->lines[$i]->qty) {
setEventMessages($langs->trans("ErrorTooMuchShipped", $i+1), null, 'errors');
setEventMessages($langs->trans("ErrorTooMuchShipped", $i + 1), null, 'errors');
$error++;
continue;
}
@ -679,7 +679,7 @@ if (empty($reshook)) {
setEventMessages($line->error, $line->errors, 'errors');
$error++;
} else {
$update_done=true;
$update_done = true;
}
} else {
setEventMessages($lotStock->error, $lotStock->errors, 'errors');
@ -723,7 +723,7 @@ if (empty($reshook)) {
setEventMessages($line->error, $line->errors, 'errors');
$error++;
} else {
$update_done=true;
$update_done = true;
}
} else {
setEventMessages($line->error, $line->errors, 'errors');
@ -742,7 +742,7 @@ if (empty($reshook)) {
setEventMessages($object->error, $object->errors, 'errors');
$error++;
} else {
$update_done=true;
$update_done = true;
}
}
} else {
@ -794,7 +794,7 @@ if (empty($reshook)) {
setEventMessages($line->error, $line->errors, 'errors');
$error++;
} else {
$update_done=true;
$update_done = true;
}
}
unset($_POST[$stockLocation]);
@ -810,7 +810,7 @@ if (empty($reshook)) {
setEventMessages($line->error, $line->errors, 'errors');
$error++;
} else {
$update_done=true;
$update_done = true;
}
unset($_POST[$qty]);
}
@ -824,7 +824,7 @@ if (empty($reshook)) {
setEventMessages($line->error, $line->errors, 'errors');
$error++;
} else {
$update_done=true;
$update_done = true;
}
unset($_POST[$qty]);
}
@ -1604,7 +1604,7 @@ if ($action == 'create') {
$nbofsuggested = 0;
foreach ($product->stock_warehouse as $warehouse_id => $stock_warehouse) {
if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) {
$nbofsuggested+=count($stock_warehouse->detail_batch);
$nbofsuggested += count($stock_warehouse->detail_batch);
}
}
@ -1749,7 +1749,7 @@ if ($action == 'create') {
$expLine->array_options = array_merge($expLine->array_options, $srcLine->array_options);
print $expLine->showOptionals($extrafields, 'edit', array('style'=>'class="drag drop oddeven"', 'colspan'=>$colspan), $indiceAsked, '', 1);
print $expLine->showOptionals($extrafields, 'edit', array('style' => 'class="drag drop oddeven"', 'colspan' => $colspan), $indiceAsked, '', 1);
}
}
@ -1957,7 +1957,7 @@ if ($action == 'create') {
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdate_livraison">';
print $form->selectDate($object->date_delivery ? $object->date_delivery : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0);
print $form->selectDate($object->date_delivery ? $object->date_delivery : -1, 'liv_', 1, 1, 0, "setdate_livraison", 1, 0);
print '<input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans('Modify').'">';
print '</form>';
} else {
@ -2266,9 +2266,9 @@ if ($action == 'create') {
if ($obj) {
// $obj->rowid is rowid in $origin."det" table
$alreadysent[$obj->rowid][$obj->shipmentline_id] = array(
'shipment_ref'=>$obj->shipment_ref, 'shipment_id'=>$obj->shipment_id, 'warehouse'=>$obj->fk_entrepot, 'qty_shipped'=>$obj->qty_shipped,
'product_tosell'=>$obj->product_tosell, 'product_tobuy'=>$obj->product_tobuy, 'product_tobatch'=>$obj->product_tobatch,
'date_valid'=>$db->jdate($obj->date_valid), 'date_delivery'=>$db->jdate($obj->date_delivery));
'shipment_ref' => $obj->shipment_ref, 'shipment_id' => $obj->shipment_id, 'warehouse' => $obj->fk_entrepot, 'qty_shipped' => $obj->qty_shipped,
'product_tosell' => $obj->product_tosell, 'product_tobuy' => $obj->product_tobuy, 'product_tobatch' => $obj->product_tobatch,
'date_valid' => $db->jdate($obj->date_valid), 'date_delivery' => $db->jdate($obj->date_delivery));
}
$i++;
}
@ -2608,9 +2608,9 @@ if ($action == 'create') {
// TODO Show all in same line by setting $display_type = 'line'
if ($action == 'editline' && $line->id == $line_id) {
print $lines[$i]->showOptionals($extrafields, 'edit', array('colspan'=>$colspan), !empty($indiceAsked) ? $indiceAsked : '', '', 0, 'card');
print $lines[$i]->showOptionals($extrafields, 'edit', array('colspan' => $colspan), !empty($indiceAsked) ? $indiceAsked : '', '', 0, 'card');
} else {
print $lines[$i]->showOptionals($extrafields, 'view', array('colspan'=>$colspan), !empty($indiceAsked) ? $indiceAsked : '', '', 0, 'card');
print $lines[$i]->showOptionals($extrafields, 'view', array('colspan' => $colspan), !empty($indiceAsked) ? $indiceAsked : '', '', 0, 'card');
}
}
}

View File

@ -51,7 +51,7 @@ if (isModEnabled('productbatch')) {
$langs->load('productbatch');
}
// Security check
// Security check
$id = GETPOSTINT("id");
$ref = GETPOST('ref');
$lineid = GETPOSTINT('lineid');
@ -510,7 +510,7 @@ if ($object->id > 0 || !empty($object->ref)) {
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdate_livraison">';
print $form->selectDate($object->date_delivery ? $object->date_delivery : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0);
print $form->selectDate($object->date_delivery ? $object->date_delivery : -1, 'liv_', 1, 1, 0, "setdate_livraison", 1, 0);
print '<input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans('Modify').'">';
print '</form>';
} else {
@ -677,7 +677,7 @@ if ($object->id > 0 || !empty($object->ref)) {
$nbfreeproduct = 0; // Nb of lins of free products/services
$nbproduct = 0; // Nb of predefined product lines to dispatch (already done or not) if SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED is off (default)
// or nb of line that remain to dispatch if SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED is on.
// or nb of line that remain to dispatch if SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED is on.
$conf->cache['product'] = array();
@ -838,13 +838,13 @@ if ($object->id > 0 || !empty($object->ref)) {
if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
print '<td class="nowraponall">';
$dlcdatesuffix = !empty($objd->sellby) ? dol_stringtotime($objd->sellby) : dol_mktime(0, 0, 0, GETPOST('dlc'.$suffix.'month'), GETPOST('dlc'.$suffix.'day'), GETPOST('dlc'.$suffix.'year'));
print $form->selectDate($dlcdatesuffix, 'dlc'.$suffix, '', '', 1, '');
print $form->selectDate($dlcdatesuffix, 'dlc'.$suffix, 0, 0, 1, '');
print '</td>';
}
if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
print '<td class="nowraponall">';
$dluodatesuffix = !empty($objd->eatby) ? dol_stringtotime($objd->eatby) : dol_mktime(0, 0, 0, GETPOST('dluo'.$suffix.'month'), GETPOST('dluo'.$suffix.'day'), GETPOST('dluo'.$suffix.'year'));
print $form->selectDate($dluodatesuffix, 'dluo'.$suffix, '', '', 1, '');
print $form->selectDate($dluodatesuffix, 'dluo'.$suffix, 0, 0, 1, '');
print '</td>';
}
print '<td colspan="2">&nbsp;</td>'; // Supplier ref + Qty ordered + qty already dispatched
@ -895,10 +895,10 @@ if ($object->id > 0 || !empty($object->ref)) {
print '<td>';
if (isModEnabled('productbatch') && $objp->tobatch > 0) {
$type = 'batch';
print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" '.($numd != $j+1 ? 'style="display:none"' : '').' onClick="addDispatchLine('.$i.', \''.$type.'\')"');
print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" '.($numd != $j + 1 ? 'style="display:none"' : '').' onClick="addDispatchLine('.$i.', \''.$type.'\')"');
} else {
$type = 'dispatch';
print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" '.($numd != $j+1 ? 'style="display:none"' : '').' onClick="addDispatchLine('.$i.', \''.$type.'\')"');
print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" '.($numd != $j + 1 ? 'style="display:none"' : '').' onClick="addDispatchLine('.$i.', \''.$type.'\')"');
}
print '</td>';
@ -983,13 +983,13 @@ if ($object->id > 0 || !empty($object->ref)) {
if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
print '<td class="nowraponall">';
$dlcdatesuffix = dol_mktime(0, 0, 0, GETPOST('dlc'.$suffix.'month'), GETPOST('dlc'.$suffix.'day'), GETPOST('dlc'.$suffix.'year'));
print $form->selectDate($dlcdatesuffix, 'dlc'.$suffix, '', '', 1, '');
print $form->selectDate($dlcdatesuffix, 'dlc'.$suffix, 0, 0, 1, '');
print '</td>';
}
if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
print '<td class="nowraponall">';
$dluodatesuffix = dol_mktime(0, 0, 0, GETPOST('dluo'.$suffix.'month'), GETPOST('dluo'.$suffix.'day'), GETPOST('dluo'.$suffix.'year'));
print $form->selectDate($dluodatesuffix, 'dluo'.$suffix, '', '', 1, '');
print $form->selectDate($dluodatesuffix, 'dluo'.$suffix, 0, 0, 1, '');
print '</td>';
}
print '<td colspan="2">&nbsp;</td>'; // Supplier ref + Qty ordered + qty already dispatched

View File

@ -368,7 +368,7 @@ if ($id > 0 || !empty($ref)) {
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdatedelivery">';
print $form->selectDate($object->delivery_date ? $object->delivery_date : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0);
print $form->selectDate($object->delivery_date ? $object->delivery_date : -1, 'liv_', 1, 1, 0, "setdate_livraison", 1, 0);
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
print '</form>';
} else {

View File

@ -238,7 +238,7 @@ if ($action == 'create' || empty($action)) {
print '<tr><td class="titlefield fieldrequired">'.$langs->trans("Date").'</td><td colspan="2">';
$datepaid = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear"));
$datepayment = ($datepaid == '' ? (!getDolGlobalString('MAIN_AUTOFILL_DATE') ? -1 : '') : $datepaid);
print $form->selectDate($datepayment, '', '', '', 0, "add_payment", 1, 1);
print $form->selectDate($datepayment, '', 0, 0, 0, "add_payment", 1, 1);
print "</td>";
print '</tr>';

View File

@ -97,17 +97,17 @@ $extrafields = new ExtraFields($db);
$arrayfields = array(
'f.titre'=>array('label'=>"Ref", 'checked'=>1),
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1),
'f.fk_contrat'=>array('label'=>"Contract", 'checked'=>1),
'f.duree'=>array('label'=>"Duration", 'checked'=>1),
'f.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>1),
'f.frequency'=>array('label'=>"RecurringInvoiceTemplate", 'checked'=>1),
'f.nb_gen_done'=>array('label'=>"NbOfGenerationDoneShort", 'checked'=>1),
'f.date_last_gen'=>array('label'=>"DateLastGeneration", 'checked'=>1),
'f.date_when'=>array('label'=>"NextDateToExecution", 'checked'=>1),
'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
'f.titre' => array('label' => "Ref", 'checked' => 1),
's.nom' => array('label' => "ThirdParty", 'checked' => 1),
'f.fk_contrat' => array('label' => "Contract", 'checked' => 1),
'f.duree' => array('label' => "Duration", 'checked' => 1),
'f.total_ttc' => array('label' => "AmountTTC", 'checked' => 1),
'f.frequency' => array('label' => "RecurringInvoiceTemplate", 'checked' => 1),
'f.nb_gen_done' => array('label' => "NbOfGenerationDoneShort", 'checked' => 1),
'f.date_last_gen' => array('label' => "DateLastGeneration", 'checked' => 1),
'f.date_when' => array('label' => "NextDateToExecution", 'checked' => 1),
'f.datec' => array('label' => "DateCreation", 'checked' => 0, 'position' => 500),
'f.tms' => array('label' => "DateModificationShort", 'checked' => 0, 'position' => 500),
);
@ -378,7 +378,7 @@ if ($action == 'create') {
print $form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency'));
print "</td><td>";
print '<input type="text" name="frequency" value="'.GETPOSTINT('frequency').'" size="4">&nbsp;';
print $form->selectarray('unit_frequency', array('d'=>$langs->trans('Day'), 'm'=>$langs->trans('Month'), 'y'=>$langs->trans('Year')), (GETPOST('unit_frequency') ? GETPOST('unit_frequency') : 'm'));
print $form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), (GETPOST('unit_frequency') ? GETPOST('unit_frequency') : 'm'));
print "</td></tr>";
// First date of execution for cron
@ -386,7 +386,7 @@ if ($action == 'create') {
if (empty($date_next_execution)) {
$date_next_execution = (GETPOST('remonth') ? dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')) : -1);
}
print $form->selectDate($date_next_execution, '', 1, 1, '', "add", 1, 1);
print $form->selectDate($date_next_execution, '', 1, 1, 0, "add", 1, 1);
print "</td></tr>";
// Number max of generation
@ -625,7 +625,7 @@ if ($action == 'create') {
print '<table class="nobordernopadding">';
print '<tr><td>';
print '<input type="text" name="frequency" value="'.$object->frequency.'" size="5">&nbsp;';
print $form->selectarray('unit_frequency', array('d'=>$langs->trans('Day'), 'm'=>$langs->trans('Month'), 'y'=>$langs->trans('Year')), ($object->unit_frequency ? $object->unit_frequency : 'm'));
print $form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), ($object->unit_frequency ? $object->unit_frequency : 'm'));
print '</td>';
print '<td class="left"><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'"></td>';
print '</tr></table></form>';

View File

@ -1769,7 +1769,7 @@ if ($action == 'create') {
$usehourmin = 1;
}
print img_picto('', 'action', 'class="pictofixedwidth"');
print $form->selectDate($datelivraison ? $datelivraison : -1, 'liv_', $usehourmin, $usehourmin, '', "set");
print $form->selectDate($datelivraison ? $datelivraison : -1, 'liv_', $usehourmin, $usehourmin, 0, "set");
print '</td></tr>';
// Bank Account
@ -2289,7 +2289,7 @@ if ($action == 'create') {
if (getDolGlobalString('SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE')) {
$usehourmin = 1;
}
print $form->selectDate($object->delivery_date ? $object->delivery_date : -1, 'liv_', $usehourmin, $usehourmin, '', "setdate_livraison");
print $form->selectDate($object->delivery_date ? $object->delivery_date : -1, 'liv_', $usehourmin, $usehourmin, 0, "setdate_livraison");
print '<input type="submit" class="button button-edit smallpaddingimp valign middle" value="'.$langs->trans('Modify').'">';
print '</form>';
} else {
@ -2695,7 +2695,7 @@ if ($action == 'create') {
//print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("ToOrder").'</td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("OrderDate").'</td><td>';
$date_com = dol_mktime(GETPOSTINT('rehour'), GETPOSTINT('remin'), GETPOSTINT('resec'), GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'));
print $form->selectDate($date_com ?: '', '', 0, 0, '', "commande", 1, 1);
print $form->selectDate($date_com ?: '', '', 0, 0, 0, "commande", 1, 1);
print '</td></tr>';
// Force mandatory order method
@ -2756,7 +2756,7 @@ if ($action == 'create') {
//print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Receive").'</td></tr>';
print '<tr><td>'.$langs->trans("DeliveryDate").'</td><td>';
$datepreselected = dol_now();
print $form->selectDate($datepreselected, '', 1, 1, '', "commande", 1, 1);
print $form->selectDate($datepreselected, '', 1, 1, 0, "commande", 1, 1);
print "</td></tr>\n";
print '<tr><td class="fieldrequired">'.$langs->trans("Delivery")."</td><td>\n";

View File

@ -794,7 +794,7 @@ if ($id > 0 || !empty($ref)) {
$nbfreeproduct = 0; // Nb of lins of free products/services
$nbproduct = 0; // Nb of predefined product lines to dispatch (already done or not) if SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED is off (default)
// or nb of line that remain to dispatch if SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED is on.
// or nb of line that remain to dispatch if SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED is on.
$conf->cache['product'] = array();
@ -937,13 +937,13 @@ if ($id > 0 || !empty($ref)) {
if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
print '<td class="nowraponall">';
$dlcdatesuffix = dol_mktime(0, 0, 0, GETPOST('dlc'.$suffix.'month'), GETPOST('dlc'.$suffix.'day'), GETPOST('dlc'.$suffix.'year'));
print $form->selectDate($dlcdatesuffix, 'dlc'.$suffix, '', '', 1, '');
print $form->selectDate($dlcdatesuffix, 'dlc'.$suffix, 0, 0, 1, '');
print '</td>';
}
if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
print '<td class="nowraponall">';
$dluodatesuffix = dol_mktime(0, 0, 0, GETPOST('dluo'.$suffix.'month'), GETPOST('dluo'.$suffix.'day'), GETPOST('dluo'.$suffix.'year'));
print $form->selectDate($dluodatesuffix, 'dluo'.$suffix, '', '', 1, '');
print $form->selectDate($dluodatesuffix, 'dluo'.$suffix, 0, 0, 1, '');
print '</td>';
}
print '<td colspan="3">&nbsp;</td>'; // Supplier ref + Qty ordered + qty already dispatched

View File

@ -181,28 +181,28 @@ $checkedtypetiers = 0;
// Definition of array of fields for columns
$arrayfields = array(
'u.login'=>array('label'=>"AuthorRequest", 'enabled'=>1, 'position'=>41),
's.name_alias'=>array('label'=>"AliasNameShort", 'position'=>51, 'checked'=>0),
's.town'=>array('label'=>"Town", 'enabled'=>1, 'position'=>55, 'checked'=>1),
's.zip'=>array('label'=>"Zip", 'enabled'=>1, 'position'=>56, 'checked'=>1),
'state.nom'=>array('label'=>"StateShort", 'enabled'=>1, 'position'=>57),
'country.code_iso'=>array('label'=>"Country", 'enabled'=>1, 'position'=>58),
'typent.code'=>array('label'=>"ThirdPartyType", 'enabled'=>$checkedtypetiers, 'position'=>59),
'cf.total_localtax1'=>array('label'=>$langs->transcountry("AmountLT1", $mysoc->country_code), 'checked'=>0, 'enabled'=>($mysoc->localtax1_assuj == "1"), 'position'=>140),
'cf.total_localtax2'=>array('label'=>$langs->transcountry("AmountLT2", $mysoc->country_code), 'checked'=>0, 'enabled'=>($mysoc->localtax2_assuj == "1"), 'position'=>145),
'cf.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES')), 'position'=>750),
'cf.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'position'=>760),
'u.login' => array('label' => "AuthorRequest", 'enabled' => 1, 'position' => 41),
's.name_alias' => array('label' => "AliasNameShort", 'position' => 51, 'checked' => 0),
's.town' => array('label' => "Town", 'enabled' => 1, 'position' => 55, 'checked' => 1),
's.zip' => array('label' => "Zip", 'enabled' => 1, 'position' => 56, 'checked' => 1),
'state.nom' => array('label' => "StateShort", 'enabled' => 1, 'position' => 57),
'country.code_iso' => array('label' => "Country", 'enabled' => 1, 'position' => 58),
'typent.code' => array('label' => "ThirdPartyType", 'enabled' => $checkedtypetiers, 'position' => 59),
'cf.total_localtax1' => array('label' => $langs->transcountry("AmountLT1", $mysoc->country_code), 'checked' => 0, 'enabled' => ($mysoc->localtax1_assuj == "1"), 'position' => 140),
'cf.total_localtax2' => array('label' => $langs->transcountry("AmountLT2", $mysoc->country_code), 'checked' => 0, 'enabled' => ($mysoc->localtax2_assuj == "1"), 'position' => 145),
'cf.note_public' => array('label' => 'NotePublic', 'checked' => 0, 'enabled' => (!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES')), 'position' => 750),
'cf.note_private' => array('label' => 'NotePrivate', 'checked' => 0, 'enabled' => (!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'position' => 760),
);
foreach ($object->fields as $key => $val) {
// If $val['visible']==0, then we never show the field
if (!empty($val['visible'])) {
$visible = (int) dol_eval($val['visible'], 1);
$arrayfields['cf.'.$key] = array(
'label'=>$val['label'],
'checked'=>(($visible < 0) ? 0 : 1),
'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)),
'position'=>$val['position'],
'help'=> isset($val['help']) ? $val['help'] : ''
'label' => $val['label'],
'checked' => (($visible < 0) ? 0 : 1),
'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)),
'position' => $val['position'],
'help' => isset($val['help']) ? $val['help'] : ''
);
}
}
@ -244,7 +244,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
$massaction = '';
}
$parameters = array('socid'=>$socid, 'arrayfields'=>&$arrayfields);
$parameters = array('socid' => $socid, 'arrayfields' => &$arrayfields);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@ -380,7 +380,7 @@ if (empty($reshook)) {
$db->begin();
$default_ref_supplier=dol_print_date(dol_now(), '%Y%m%d%H%M%S');
$default_ref_supplier = dol_print_date(dol_now(), '%Y%m%d%H%M%S');
foreach ($orders as $id_order) {
$cmd = new CommandeFournisseur($db);
@ -405,7 +405,7 @@ if (empty($reshook)) {
$objecttmp->fk_project = $cmd->fk_project;
$objecttmp->multicurrency_code = $cmd->multicurrency_code;
$objecttmp->ref_supplier = !empty($cmd->ref_supplier) ? $cmd->ref_supplier : $default_ref_supplier;
$default_ref_supplier+=1;
$default_ref_supplier += 1;
$datefacture = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'));
if (empty($datefacture)) {
@ -1181,9 +1181,9 @@ if ($resql) {
// List of mass actions available
$arrayofmassactions = array(
'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
'generate_doc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
'builddoc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
'presend' => img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
);
if ($permissiontovalidate) {
@ -1211,8 +1211,8 @@ if ($resql) {
$url .= '&backtopage='.urlencode(DOL_URL_ROOT.'/fourn/commande/list.php?socid='.((int) $socid));
}
$newcardbutton = '';
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition'));
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition'));
$newcardbutton .= dolGetButtonTitleSeparator();
$newcardbutton .= dolGetButtonTitle($langs->trans('NewSupplierOrderShort'), '', 'fa fa-plus-circle', $url, '', $permissiontoadd);
@ -1252,7 +1252,7 @@ if ($resql) {
print $langs->trans('DateInvoice');
print '</td>';
print '<td>';
print $form->selectDate('', '', '', '', '', '', 1, 1);
print $form->selectDate('', '', 0, 0, 0, '', 1, 1);
print '</td>';
print '</tr>';
print '<tr>';
@ -1479,7 +1479,7 @@ if ($resql) {
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields);
$parameters = array('arrayfields' => $arrayfields);
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
@ -1646,7 +1646,7 @@ if ($resql) {
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder);
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (!empty($arrayfields['cf.date_creation']['checked'])) {
@ -1738,7 +1738,7 @@ if ($resql) {
$thirdpartytmp->client = $obj->client;
$thirdpartytmp->fournisseur = $obj->fournisseur;
// Output Kanban
print $objectstatic->getKanbanView('', array('thirdparty'=>$thirdpartytmp->getNomUrl('supplier', 0, 0, -1), 'selected' => in_array($objectstatic->id, $arrayofselected)));
print $objectstatic->getKanbanView('', array('thirdparty' => $thirdpartytmp->getNomUrl('supplier', 0, 0, -1), 'selected' => in_array($objectstatic->id, $arrayofselected)));
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
@ -1988,7 +1988,7 @@ if ($resql) {
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$parameters = array('arrayfields' => $arrayfields, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
@ -2102,7 +2102,7 @@ if ($resql) {
$db->free($resql);
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;

View File

@ -1044,7 +1044,7 @@ if ($action == 'create') {
// Date next run
print "<tr><td>" . $langs->trans('NextDateToExecution') . "</td><td>";
$date_next_execution = isset($date_next_execution) ? $date_next_execution : (GETPOST('remonth') ? dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')) : -1);
print $form->selectDate($date_next_execution, '', 1, 1, '', "add", 1, 1);
print $form->selectDate($date_next_execution, '', 1, 1, 0, "add", 1, 1);
print "</td></tr>";
// Number max of generation

View File

@ -2645,7 +2645,7 @@ if ($action == 'create') {
// Date invoice
print '<tr><td class="fieldrequired">'.$langs->trans('DateInvoice').'</td><td>';
print img_picto('', 'action', 'class="pictofixedwidth"');
print $form->selectDate($dateinvoice, '', '', '', '', "add", 1, 1);
print $form->selectDate($dateinvoice, '', 0, 0, 0, "add", 1, 1);
print '</td></tr>';
// Payment term
@ -2658,7 +2658,7 @@ if ($action == 'create') {
// Due date
print '<tr><td>'.$langs->trans('DateMaxPayment').'</td><td>';
print img_picto('', 'action', 'class="pictofixedwidth"');
print $form->selectDate($datedue, 'ech', '', '', '', "add", 1, 1);
print $form->selectDate($datedue, 'ech', 0, 0, 0, "add", 1, 1);
print '</td></tr>';
// Payment mode

View File

@ -140,7 +140,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$search_array_options = array();
}
$parameters = array('socid'=>$socid);
$parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@ -513,9 +513,9 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td>';
// $object is default vendor invoice
$adddateof = array(array('adddateof'=>$object->date));
$adddateof[] = array('adddateof'=>$object->date_echeance, 'labeladddateof'=>$langs->transnoentities('DateDue'));
print $form->selectDate($dateinvoice, '', '', '', 0, "addpaiement", 1, 1, 0, '', '', $adddateof);
$adddateof = array(array('adddateof' => $object->date));
$adddateof[] = array('adddateof' => $object->date_echeance, 'labeladddateof' => $langs->transnoentities('DateDue'));
print $form->selectDate($dateinvoice, '', 0, 0, 0, "addpaiement", 1, 1, 0, '', '', $adddateof);
print '</td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans('PaymentMode').'</td><td>';
$form->select_types_paiements(!GETPOST('paiementid') ? $obj->fk_mode_reglement : GETPOST('paiementid'), 'paiementid');
@ -536,7 +536,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print dol_get_fiche_end();
$parameters = array('facid'=>$facid, 'ref'=>$ref, 'objcanvas'=>$objcanvas);
$parameters = array('facid' => $facid, 'ref' => $ref, 'objcanvas' => $objcanvas);
$reshook = $hookmanager->executeHooks('paymentsupplierinvoices', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
$error = $hookmanager->error;
$errors = $hookmanager->errors;

View File

@ -306,13 +306,13 @@ if ($action == 'create') {
// Date Start
print "<tr>";
print '<td class="fieldrequired">'.$langs->trans("DateStart").'</td><td>';
print $form->selectDate(!empty($datestart) ? $datestart : -1, 'start', '', '', '', 'add', 1, 1);
print $form->selectDate(!empty($datestart) ? $datestart : -1, 'start', 0, 0, 0, 'add', 1, 1);
print '</td></tr>';
// Date End
print "<tr>";
print '<td class="fieldrequired">'.$langs->trans("DateEnd").'</td><td>';
print $form->selectDate(!empty($dateend) ? $dateend : -1, 'end', '', '', '', 'add', 1, 1);
print $form->selectDate(!empty($dateend) ? $dateend : -1, 'end', 0, 0, 0, 'add', 1, 1);
print '</td></tr>';
// Number of terms

View File

@ -289,7 +289,7 @@ if ($action == 'create') {
} else {
$datepayment = $datepaid;
}
print $form->selectDate($datepayment, '', '', '', '', "add_payment", 1, 1);
print $form->selectDate($datepayment, '', 0, 0, 0, "add_payment", 1, 1);
print "</td>";
print '</tr>';

View File

@ -129,11 +129,11 @@ print '</td></tr>';
// Start date
print '<td>'.$langs->trans('DateStart').' ('.$langs->trans("DateValidation").')</td>';
print '<td>';
print $form->selectDate($startdate, 'startdate', '', '', 1, "sel", 1, 1);
print $form->selectDate($startdate, 'startdate', 0, 0, 1, "sel", 1, 1);
print '</td>';
print '<td>'.$langs->trans('DateEnd').' ('.$langs->trans("DateValidation").')</td>';
print '<td>';
print $form->selectDate($enddate, 'enddate', '', '', 1, "sel", 1, 1);
print $form->selectDate($enddate, 'enddate', 0, 0, 1, "sel", 1, 1);
print '</td>';
print '<td style="text-align: center;">';
print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans('Refresh')).'" />';

View File

@ -190,11 +190,11 @@ print '<table class="border centpercent">';
print '<tr><td class="titlefield">'.$langs->trans('DateStart').' ('.$langs->trans("DateValidation").')</td>';
print '<td>';
print $form->selectDate($startdate, 'startdate', '', '', 1, "sel", 1, 1);
print $form->selectDate($startdate, 'startdate', 0, 0, 1, "sel", 1, 1);
print '</td>';
print '<td>'.$langs->trans('DateEnd').' ('.$langs->trans("DateValidation").')</td>';
print '<td>';
print $form->selectDate($enddate, 'enddate', '', '', 1, "sel", 1, 1);
print $form->selectDate($enddate, 'enddate', 0, 0, 1, "sel", 1, 1);
print '</td>';
print '<td style="text-align: center;">';
print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans('Refresh')).'" name="button_search" />';

View File

@ -170,11 +170,11 @@ print '</tr>';
// Start date
print '<td>'.$langs->trans('DateStart').' ('.$langs->trans("DateValidation").')</td>';
print '<td>';
print $form->selectDate($startdate, 'startdate', '', '', 1, "sel", 1, 1);
print $form->selectDate($startdate, 'startdate', 0, 0, 1, "sel", 1, 1);
print '</td>';
print '<td>'.$langs->trans('DateEnd').' ('.$langs->trans("DateValidation").')</td>';
print '<td>';
print $form->selectDate($enddate, 'enddate', '', '', 1, "sel", 1, 1);
print $form->selectDate($enddate, 'enddate', 0, 0, 1, "sel", 1, 1);
print '</td>';
print '<td style="text-align: center;">';
print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans('Refresh')).'" />';

View File

@ -134,11 +134,11 @@ print '</tr>';
print '<tr>';
print '<td class="titlefield">'.$langs->trans('DateStart').' ('.$langs->trans("DateValidation").')</td>';
print '<td>';
print $form->selectDate($startdate, 'startdate', '', '', 1, "sel", 1, 1);
print $form->selectDate($startdate, 'startdate', 0, 0, 1, "sel", 1, 1);
print '</td>';
print '<td>'.$langs->trans('DateEnd').' ('.$langs->trans("DateValidation").')</td>';
print '<td>';
print $form->selectDate($enddate, 'enddate', '', '', 1, "sel", 1, 1);
print $form->selectDate($enddate, 'enddate', 0, 0, 1, "sel", 1, 1);
print '</td>';
print '<td style="text-align: center;">';
print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans('Refresh')).'" />';

View File

@ -151,7 +151,7 @@ print '</tr>'."\n";
print '<tr><td class="fieldrequired">'.$langs->trans("ExpireDate").'</td><td>';
print $form->selectDate($champdatefin ? $champdatefin : -1, 'champdatefin', '', '', '', "add", 1, 0);
print $form->selectDate($champdatefin ? $champdatefin : -1, 'champdatefin', 0, 0, 0, "add", 1, 0);
print '</tr>'."\n";
print '</table>'."\n";

View File

@ -144,7 +144,7 @@ if ($cancel) {
$action = '';
}
$parameters = array('id'=>$id, 'ref'=>$ref, 'objcanvas'=>$objcanvas);
$parameters = array('id' => $id, 'ref' => $ref, 'objcanvas' => $objcanvas);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@ -1147,12 +1147,12 @@ if (!$variants || getDolGlobalString('VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PA
print '<td class="right" width="10%"><input type="text" name="batch_number" value="'.$pdluo->batch.'"></td>';
if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
print '<td class="center" width="10%">';
print $form->selectDate($pdluo->sellby, 'sellby', '', '', 1, '', 1, 0);
print $form->selectDate($pdluo->sellby, 'sellby', 0, 0, 1, '', 1, 0);
print '</td>';
}
if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
print '<td class="center" width="10%">';
print $form->selectDate($pdluo->eatby, 'eatby', '', '', 1, '', 1, 0);
print $form->selectDate($pdluo->eatby, 'eatby', 0, 0, 1, '', 1, 0);
print '</td>';
}
print '<td class="right" colspan="3">'.$pdluo->qty.($pdluo->qty < 0 ? ' '.img_warning() : '').'</td>';

View File

@ -105,7 +105,7 @@ print '<script type="text/javascript">
});';
if ($disableSellBy == 0 || $disableEatBy == 0) {
print '
print '
var disableSellBy = '.dol_escape_js($disableSellBy).';
var disableEatBy = '.dol_escape_js($disableSellBy).';
jQuery("#batch_number").change(function(event) {
@ -206,14 +206,14 @@ if (isModEnabled('productbatch') &&
print '<td'.($sellByCss ? ' class="'.$sellByCss.'"' : '').'>'.$langs->trans("SellByDate").'</td><td>';
$sellbyselected = dol_mktime(0, 0, 0, GETPOST('sellbymonth'), GETPOST('sellbyday'), GETPOST('sellbyyear'));
// If form was opened for a specific pdluoid, field is disabled
print $form->selectDate(($pdluo->id > 0 ? $pdluo->sellby : $sellbyselected), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0));
print $form->selectDate(($pdluo->id > 0 ? $pdluo->sellby : $sellbyselected), 'sellby', 0, 0, 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0));
print '</td>';
}
if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
print '<td'.($eatByCss ? ' class="'.$eatByCss.'"' : '').'>'.$langs->trans("EatByDate").'</td><td>';
$eatbyselected = dol_mktime(0, 0, 0, GETPOST('eatbymonth'), GETPOST('eatbyday'), GETPOST('eatbyyear'));
// If form was opened for a specific pdluoid, field is disabled
print $form->selectDate(($pdluo->id > 0 ? $pdluo->eatby : $eatbyselected), 'eatby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0));
print $form->selectDate(($pdluo->id > 0 ? $pdluo->eatby : $eatbyselected), 'eatby', 0, 0, 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0));
print '</td>';
}
print '</tr>';

View File

@ -112,12 +112,12 @@ if (isModEnabled('productbatch') &&
print '<tr>';
if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
print '<td>'.$langs->trans("SellByDate").'</td><td>';
print $form->selectDate((!empty($d_sellby) ? $d_sellby : $pdluo->sellby), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
print $form->selectDate((!empty($d_sellby) ? $d_sellby : $pdluo->sellby), 'sellby', 0, 0, 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
print '</td>';
}
if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
print '<td>'.$langs->trans("EatByDate").'</td><td>';
print $form->selectDate((!empty($d_eatby) ? $d_eatby : $pdluo->eatby), 'eatby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
print $form->selectDate((!empty($d_eatby) ? $d_eatby : $pdluo->eatby), 'eatby', 0, 0, 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
print '</td>';
}
print '</tr>';

View File

@ -1418,7 +1418,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
print $langs->trans('DateInvoice');
print '</td>';
print '<td>';
print $form->selectDate('', '', '', '', '', '', 1, 1);
print $form->selectDate('', '', 0, 0, 0, '', 1, 1);
print '</td>';
print '</tr>';

View File

@ -919,7 +919,7 @@ if ($action == 'create') {
print "</td></tr>\n";
// Other attributes
$parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'cols' => '3', 'socid'=>$socid);
$parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'cols' => '3', 'socid' => $socid);
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $recept, $action); // Note that $action and $objectsrc may have been modified by hook
print $hookmanager->resPrint;
@ -985,7 +985,7 @@ if ($action == 'create') {
$ent = "entrepot_" . $paramSuffix;
$pu = "pu_" . $paramSuffix; // This is unit price including discount
$fk_commandefourndet = "fk_commandefourndet_" . $paramSuffix;
$dispatchLines[$numAsked] = array('paramSuffix'=>$paramSuffix, 'prod' => GETPOSTINT($prod), 'qty' => price2num(GETPOST($qty), 'MS'), 'ent' => GETPOSTINT($ent), 'pu' => price2num(GETPOST($pu), 'MU'), 'comment' => GETPOST('comment'), 'fk_commandefourndet' => GETPOSTINT($fk_commandefourndet));
$dispatchLines[$numAsked] = array('paramSuffix' => $paramSuffix, 'prod' => GETPOSTINT($prod), 'qty' => price2num(GETPOST($qty), 'MS'), 'ent' => GETPOSTINT($ent), 'pu' => price2num(GETPOST($pu), 'MU'), 'comment' => GETPOST('comment'), 'fk_commandefourndet' => GETPOSTINT($fk_commandefourndet));
}
// with batch module enabled and product with lot/serial
@ -1006,7 +1006,7 @@ if ($action == 'create') {
$dDLUO = dol_mktime(12, 0, 0, GETPOSTINT('dluo_'.$paramSuffix.'month'), GETPOSTINT('dluo_'.$paramSuffix.'day'), GETPOSTINT('dluo_'.$paramSuffix.'year'));
$dDLC = dol_mktime(12, 0, 0, GETPOSTINT('dlc_'.$paramSuffix.'month'), GETPOSTINT('dlc_'.$paramSuffix.'day'), GETPOSTINT('dlc_'.$paramSuffix.'year'));
$fk_commandefourndet = 'fk_commandefourndet_'.$paramSuffix;
$dispatchLines[$numAsked] = array('paramSuffix'=>$paramSuffix, 'prod' => GETPOSTINT($prod), 'qty' => price2num(GETPOST($qty), 'MS'), 'ent' => GETPOSTINT($ent), 'pu' => price2num(GETPOST($pu), 'MU'), 'comment' => GETPOST('comment'), 'fk_commandefourndet' => GETPOSTINT($fk_commandefourndet), 'DLC'=> $dDLC, 'DLUO'=> $dDLUO, 'lot'=> GETPOSTINT($lot));
$dispatchLines[$numAsked] = array('paramSuffix' => $paramSuffix, 'prod' => GETPOSTINT($prod), 'qty' => price2num(GETPOST($qty), 'MS'), 'ent' => GETPOSTINT($ent), 'pu' => price2num(GETPOST($pu), 'MU'), 'comment' => GETPOST('comment'), 'fk_commandefourndet' => GETPOSTINT($fk_commandefourndet), 'DLC' => $dDLC, 'DLUO' => $dDLUO, 'lot' => GETPOSTINT($lot));
}
// If create form is coming from same page, it means that post was sent but an error occurred
@ -1028,7 +1028,7 @@ if ($action == 'create') {
$dDLUO = dol_mktime(12, 0, 0, GETPOSTINT('dluo'.$paramSuffix.'month'), GETPOSTINT('dluo'.$paramSuffix.'day'), GETPOSTINT('dluo'.$paramSuffix.'year'));
$dDLC = dol_mktime(12, 0, 0, GETPOSTINT('dlc'.$paramSuffix.'month'), GETPOSTINT('dlc'.$paramSuffix.'day'), GETPOSTINT('dlc'.$paramSuffix.'year'));
$fk_commandefourndet = 'fk_commandefournisseurdet'.$paramSuffix;
$dispatchLines[$numAsked] = array('prod' => GETPOSTINT($prod), 'qty' => price2num(GETPOST($qty), 'MS'), 'ent' =>GETPOSTINT($ent), 'pu' => price2num(GETPOST($pu), 'MU'), 'comment' =>GETPOST($comment), 'fk_commandefourndet' => GETPOSTINT($fk_commandefourndet), 'DLC'=> $dDLC, 'DLUO'=> $dDLUO, 'lot'=> GETPOSTINT($lot));
$dispatchLines[$numAsked] = array('prod' => GETPOSTINT($prod), 'qty' => price2num(GETPOST($qty), 'MS'), 'ent' => GETPOSTINT($ent), 'pu' => price2num(GETPOST($pu), 'MU'), 'comment' => GETPOST($comment), 'fk_commandefourndet' => GETPOSTINT($fk_commandefourndet), 'DLC' => $dDLC, 'DLUO' => $dDLUO, 'lot' => GETPOSTINT($lot));
}
}
@ -1100,7 +1100,7 @@ if ($action == 'create') {
// $objectsrc->lines contains the line of the purchase order
// $dispatchLines is list of lines with dispatching detail (with product, qty and warehouse). One purchase order line may have n of this dispatch lines.
$arrayofpurchaselinealreadyoutput= array();
$arrayofpurchaselinealreadyoutput = array();
// $_POST contains fk_commandefourndet_X_Y where Y is num of product line and X is number of split lines
$indiceAsked = 1;
@ -1271,12 +1271,12 @@ if ($action == 'create') {
print '<td><input name="batch'.$indiceAsked.'" value="'.$dispatchLines[$indiceAsked]['lot'].'"></td>';
if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
print '<td class="nowraponall">';
print $form->selectDate($dispatchLines[$indiceAsked]['DLC'], 'dlc'.$indiceAsked, '', '', 1, "");
print $form->selectDate($dispatchLines[$indiceAsked]['DLC'], 'dlc'.$indiceAsked, 0, 0, 1, "");
print '</td>';
}
if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
print '<td class="nowraponall">';
print $form->selectDate($dispatchLines[$indiceAsked]['DLUO'], 'dluo'.$indiceAsked, '', '', 1, "");
print $form->selectDate($dispatchLines[$indiceAsked]['DLUO'], 'dluo'.$indiceAsked, 0, 0, 1, "");
print '</td>';
}
} else {
@ -1313,7 +1313,7 @@ if ($action == 'create') {
}
$recLine->array_options = array_merge($recLine->array_options, $srcLine->array_options);
print $recLine->showOptionals($extrafields, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan), $indiceAsked, '', 1);
print $recLine->showOptionals($extrafields, 'edit', array('style' => 'class="oddeven"', 'colspan' => $colspan), $indiceAsked, '', 1);
}
$indiceAsked++;
@ -1524,7 +1524,7 @@ if ($action == 'create') {
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdate_livraison">';
print $form->selectDate($object->date_delivery ? $object->date_delivery : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0);
print $form->selectDate($object->date_delivery ? $object->date_delivery : -1, 'liv_', 1, 1, 0, "setdate_livraison", 1, 0);
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
print '</form>';
} else {
@ -1840,7 +1840,7 @@ if ($action == 'create') {
$obj = $db->fetch_object($resql);
if ($obj) {
// $obj->rowid is rowid in $origin."det" table
$alreadysent[$obj->rowid][$obj->receptionline_id] = array('reception_ref'=>$obj->reception_ref, 'reception_id'=>$obj->reception_id, 'warehouse'=>$obj->fk_entrepot, 'qty'=>$obj->qty, 'date_valid'=>$obj->date_valid, 'date_delivery'=>$obj->date_delivery);
$alreadysent[$obj->rowid][$obj->receptionline_id] = array('reception_ref' => $obj->reception_ref, 'reception_id' => $obj->reception_id, 'warehouse' => $obj->fk_entrepot, 'qty' => $obj->qty, 'date_valid' => $obj->date_valid, 'date_delivery' => $obj->date_delivery);
}
$i++;
}
@ -1976,11 +1976,11 @@ if ($action == 'create') {
print '<td class="nowraponall left"><input name="batch'.$line_id.'" id="batch'.$line_id.'" type="text" value="'.$lines[$i]->batch.'"><br>';
if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
print $langs->trans('SellByDate').' : ';
print $form->selectDate($lines[$i]->sellby, 'dlc'.$line_id, '', '', 1, "").'</br>';
print $form->selectDate($lines[$i]->sellby, 'dlc'.$line_id, 0, 0, 1, "").'</br>';
}
if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
print $langs->trans('EatByDate').' : ';
print $form->selectDate($lines[$i]->eatby, 'dluo'.$line_id, '', '', 1, "");
print $form->selectDate($lines[$i]->eatby, 'dluo'.$line_id, 0, 0, 1, "");
}
print '</td>';
}
@ -2107,9 +2107,9 @@ if ($action == 'create') {
$line->fetch_optionals();
if ($action == 'editline' && $lines[$i]->id == $line_id) {
print $line->showOptionals($extrafields, 'edit', array('colspan'=>$colspan), '');
print $line->showOptionals($extrafields, 'edit', array('colspan' => $colspan), '');
} else {
print $line->showOptionals($extrafields, 'view', array('colspan'=>$colspan), '');
print $line->showOptionals($extrafields, 'view', array('colspan' => $colspan), '');
}
}
}

View File

@ -49,7 +49,7 @@ if (isModEnabled('productbatch')) {
$langs->load('productbatch');
}
// Security check
// Security check
$id = GETPOSTINT("id");
$ref = GETPOST('ref');
$lineid = GETPOSTINT('lineid');
@ -586,7 +586,7 @@ if ($id > 0 || !empty($ref)) {
$nbfreeproduct = 0; // Nb of lins of free products/services
$nbproduct = 0; // Nb of predefined product lines to dispatch (already done or not) if SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED is off (default)
// or nb of line that remain to dispatch if SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED is on.
// or nb of line that remain to dispatch if SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED is on.
$conf->cache['product'] = array();
@ -747,13 +747,13 @@ if ($id > 0 || !empty($ref)) {
if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
print '<td class="nowraponall">';
$dlcdatesuffix = !empty($objd->sellby) ? dol_stringtotime($objd->sellby) : dol_mktime(0, 0, 0, GETPOST('dlc'.$suffix.'month'), GETPOST('dlc'.$suffix.'day'), GETPOST('dlc'.$suffix.'year'));
print $form->selectDate($dlcdatesuffix, 'dlc'.$suffix, '', '', 1, '');
print $form->selectDate($dlcdatesuffix, 'dlc'.$suffix, 0, 0, 1, '');
print '</td>';
}
if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
print '<td class="nowraponall">';
$dluodatesuffix = !empty($objd->eatby) ? dol_stringtotime($objd->eatby) : dol_mktime(0, 0, 0, GETPOST('dluo'.$suffix.'month'), GETPOST('dluo'.$suffix.'day'), GETPOST('dluo'.$suffix.'year'));
print $form->selectDate($dluodatesuffix, 'dluo'.$suffix, '', '', 1, '');
print $form->selectDate($dluodatesuffix, 'dluo'.$suffix, 0, 0, 1, '');
print '</td>';
}
print '<td colspan="3">&nbsp;</td>'; // Supplier ref + Qty ordered + qty already dispatched
@ -808,10 +808,10 @@ if ($id > 0 || !empty($ref)) {
print '<td>';
if (isModEnabled('productbatch') && $objp->tobatch > 0) {
$type = 'batch';
print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" '.($numd != $j+1 ? 'style="display:none"' : '').' onClick="addDispatchLine('.$i.', \''.$type.'\')"');
print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" '.($numd != $j + 1 ? 'style="display:none"' : '').' onClick="addDispatchLine('.$i.', \''.$type.'\')"');
} else {
$type = 'dispatch';
print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" '.($numd != $j+1 ? 'style="display:none"' : '').' onClick="addDispatchLine('.$i.', \''.$type.'\')"');
print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" '.($numd != $j + 1 ? 'style="display:none"' : '').' onClick="addDispatchLine('.$i.', \''.$type.'\')"');
}
print '</td>';
@ -920,13 +920,13 @@ if ($id > 0 || !empty($ref)) {
if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
print '<td class="nowraponall">';
$dlcdatesuffix = dol_mktime(0, 0, 0, GETPOST('dlc'.$suffix.'month'), GETPOST('dlc'.$suffix.'day'), GETPOST('dlc'.$suffix.'year'));
print $form->selectDate($dlcdatesuffix, 'dlc'.$suffix, '', '', 1, '');
print $form->selectDate($dlcdatesuffix, 'dlc'.$suffix, 0, 0, 1, '');
print '</td>';
}
if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
print '<td class="nowraponall">';
$dluodatesuffix = dol_mktime(0, 0, 0, GETPOST('dluo'.$suffix.'month'), GETPOST('dluo'.$suffix.'day'), GETPOST('dluo'.$suffix.'year'));
print $form->selectDate($dluodatesuffix, 'dluo'.$suffix, '', '', 1, '');
print $form->selectDate($dluodatesuffix, 'dluo'.$suffix, 0, 0, 1, '');
print '</td>';
}
print '<td colspan="3">&nbsp;</td>'; // Supplier ref + Qty ordered + qty already dispatched

View File

@ -899,7 +899,7 @@ if ($massaction == 'createbills') {
print $langs->trans('DateInvoice');
print '</td>';
print '<td>';
print $form->selectDate('', '', '', '', '', '', 1, 1);
print $form->selectDate('', '', 0, 0, 0, '', 1, 1);
print '</td>';
print '</tr>';
print '<tr>';

View File

@ -302,7 +302,7 @@ if ($action == 'add' && empty($cancel)) {
$paiement->chid = $object->id; // deprecated
$paiement->datep = $datep;
$paiement->datev = $datev;
$paiement->amounts = array($object->id=>$amount); // Tableau de montant
$paiement->amounts = array($object->id => $amount); // Tableau de montant
$paiement->fk_typepayment = $type_payment;
$paiement->num_payment = GETPOST("num_payment", 'alphanohtml');
$paiement->note_private = GETPOST("note", 'restricthtml');
@ -580,13 +580,13 @@ if ($action == 'create' && $permissiontoadd) {
// Date start period
print '<tr><td>';
print $form->editfieldkey('DateStartPeriod', 'datesp', '', $object, 0, 'string', '', 1).'</td><td>';
print $form->selectDate($datesp, "datesp", '', '', '', 'add');
print $form->selectDate($datesp, "datesp", 0, 0, 0, 'add');
print '</td></tr>';
// Date end period
print '<tr><td>';
print $form->editfieldkey('DateEndPeriod', 'dateep', '', $object, 0, 'string', '', 1).'</td><td>';
print $form->selectDate($dateep, "dateep", '', '', '', 'add');
print $form->selectDate($dateep, "dateep", 0, 0, 0, 'add');
print '</td></tr>';
// Amount
@ -646,7 +646,7 @@ if ($action == 'create' && $permissiontoadd) {
// Date value for bank
print '<tr class="hide_if_no_auto_create_payment"><td>';
print $form->editfieldkey('DateValue', 'datev', '', $object, 0).'</td><td>';
print $form->selectDate((empty($datev) ? -1 : $datev), "datev", '', '', '', 'add', 1, 1);
print $form->selectDate((empty($datev) ? -1 : $datev), "datev", 0, 0, 0, 'add', 1, 1);
print '</td></tr>';
// Number

View File

@ -704,7 +704,7 @@ if (empty($reshook)) {
//If text set in desc is the same as product descpription (as now it's preloaded) we add it only one time
if (trim($product_desc) == trim($desc) && getDolGlobalString('PRODUIT_AUTOFILL_DESC')) {
$product_desc='';
$product_desc = '';
}
if (!empty($product_desc) && getDolGlobalString('MAIN_NO_CONCAT_DESCRIPTION')) {
@ -1345,9 +1345,9 @@ if ($action == 'create') {
$syear = date("Y", $tmpdte);
$smonth = date("m", $tmpdte);
$sday = date("d", $tmpdte);
print $form->selectDate($syear."-".$smonth."-".$sday, 'liv_', '', '', '', "addask");
print $form->selectDate($syear."-".$smonth."-".$sday, 'liv_', 0, 0, 0, "addask");
} else {
print $form->selectDate($datedelivery ? $datedelivery : -1, 'liv_', '', '', '', "addask", 1, 1);
print $form->selectDate($datedelivery ? $datedelivery : -1, 'liv_', 0, 0, 0, "addask", 1, 1);
}
print '</td></tr>';
@ -1702,7 +1702,7 @@ if ($action == 'create') {
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdate_livraison">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
print $form->selectDate($object->delivery_date, 'liv_', '', '', '', "editdate_livraison");
print $form->selectDate($object->delivery_date, 'liv_', 0, 0, 0, "editdate_livraison");
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
print '</form>';
} else {