mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-14 08:54:21 +01:00
Merge branch 'develop' into fix_element_type_part_05
This commit is contained in:
@@ -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>';
|
||||
|
||||
@@ -331,6 +331,7 @@ return [
|
||||
// Dolibarr uses a lot of internal deprecated stuff, not reporting
|
||||
'PhanDeprecatedProperty',
|
||||
'PhanDeprecatedFunction',
|
||||
'PhanCompatibleNegativeStringOffset',
|
||||
// Dolibarr has quite a few strange noop assignments like $abc=$abc;
|
||||
'PhanPluginDuplicateExpressionAssignment',
|
||||
// Nulls are likely mostly false positives
|
||||
|
||||
@@ -326,6 +326,8 @@ return [
|
||||
// Add any issue types (such as 'PhanUndeclaredMethod')
|
||||
// here to inhibit them from being reported
|
||||
'suppress_issue_types' => [
|
||||
'PhanCompatibleNegativeStringOffset', // return false positive
|
||||
|
||||
'PhanPluginWhitespaceTab', // Dolibarr used tabs
|
||||
'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility
|
||||
'PhanPluginShortArray', // Dolibarr uses array()
|
||||
@@ -335,6 +337,7 @@ return [
|
||||
'PhanPluginCanUseReturnType', // Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string)
|
||||
'PhanPluginCanUseNullableParamType', // Fixer - Report/Add nullable parameter types in the function definition
|
||||
'PhanPluginCanUseNullableReturnType', // Fixer - Report/Add nullable return types in the function definition
|
||||
|
||||
'PhanPluginNonBoolBranch', // Not essential - 31240+ occurrences
|
||||
'PhanPluginNumericalComparison', // Not essential - 19870+ occurrences
|
||||
'PhanTypeMismatchArgument', // Not essential - 12300+ occurrences
|
||||
|
||||
@@ -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>
|
||||
*/
|
||||
@@ -176,6 +177,8 @@ return [
|
||||
// Add any issue types (such as 'PhanUndeclaredMethod')
|
||||
// here to inhibit them from being reported
|
||||
'suppress_issue_types' => [
|
||||
'PhanCompatibleNegativeStringOffset', // return false positive
|
||||
|
||||
'PhanPluginWhitespaceTab', // Dolibarr used tabs
|
||||
'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility
|
||||
'PhanPluginShortArray', // Dolibarr uses array()
|
||||
|
||||
175
dev/tools/phan/plugins/SelectDateFixer.php
Normal file
175
dev/tools/phan/plugins/SelectDateFixer.php
Normal 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
|
||||
);
|
||||
});
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -2704,7 +2704,7 @@ class Propal extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
// Status self::STATUS_REFUSED by default
|
||||
$modelpdf = getDolGlobalString('PROPALE_ADDON_PDF_ODT_CLOSED') ? $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED : $this->model_pdf;
|
||||
$modelpdf = getDolGlobalString('PROPALE_ADDON_PDF_ODT_CLOSED', $this->model_pdf);
|
||||
$trigger_name = 'PROPAL_CLOSE_REFUSED'; // used later in call_trigger()
|
||||
|
||||
if ($status == self::STATUS_SIGNED) { // Status self::STATUS_SIGNED
|
||||
@@ -2814,7 +2814,7 @@ class Propal extends CommonObject
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$modelpdf = $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED ? $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED : $this->model_pdf;
|
||||
$modelpdf = getDolGlobalString('PROPALE_ADDON_PDF_ODT_CLOSED', $this->model_pdf);
|
||||
|
||||
if (!getDolGlobalString('MAIN_DISABLE_PDF_AUTOUPDATE')) {
|
||||
// Define output language
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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>';
|
||||
|
||||
@@ -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 ' ';
|
||||
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 ' ';
|
||||
print '<a class="ajaxforbankoperationchange" href="'.$_SERVER['PHP_SELF'].'?action=dvprev&id='.$objp->fk_account.'&rowid='.$objp->rowid.'&token='.newToken().'">';
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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),
|
||||
);
|
||||
@@ -680,7 +680,7 @@ if ($id) {
|
||||
if (getDolGlobalString('ACCOUNTANCY_COMBO_FOR_AUX')) {
|
||||
print $formaccounting->formAccountingAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->subledger_account, 'subledger_account', 1, 1, '', 1);
|
||||
} else {
|
||||
print $form->editfieldval('SubledgerAccount', 'subledger_account', $object->subledger_account, $object, (!$alreadyaccounted && $permissiontoadd), 'string', '', 0, null, '', 1, 'lengthAccounta');
|
||||
print $form->editfieldval('SubledgerAccount', 'subledger_account', $object->subledger_account, $object, (!$alreadyaccounted && $permissiontoadd), 'string', '', null, null, '', 1, 'lengthAccounta');
|
||||
}
|
||||
} else {
|
||||
print length_accounta($object->subledger_account);
|
||||
@@ -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>';
|
||||
|
||||
@@ -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>";
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1820,7 +1820,7 @@ if (empty($reshook)) {
|
||||
$date_end,
|
||||
0,
|
||||
$lines[$i]->info_bits,
|
||||
$lines[$i]->fk_remise_except,
|
||||
isset($lines[$i]->fk_remise_except) ? $lines[$i]->fk_remise_except : null,
|
||||
'HT',
|
||||
0,
|
||||
$product_type,
|
||||
@@ -1829,7 +1829,7 @@ if (empty($reshook)) {
|
||||
$object->origin,
|
||||
$lines[$i]->rowid,
|
||||
$fk_parent_line,
|
||||
$lines[$i]->fk_fournprice,
|
||||
isset($lines[$i]->fk_fournprice) ? $lines[$i]->fk_fournprice : null,
|
||||
$lines[$i]->pa_ht,
|
||||
$label,
|
||||
$array_options,
|
||||
@@ -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>';
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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>';
|
||||
|
||||
|
||||
@@ -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>';
|
||||
|
||||
|
||||
@@ -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>';
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>';
|
||||
|
||||
@@ -434,10 +434,10 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO
|
||||
setEventMessages($mesg, null, 'mesgs');
|
||||
|
||||
$moreparam = '';
|
||||
if (isset($paramname2) || isset($paramval2)) {
|
||||
if (isset($paramval2)) {
|
||||
$moreparam .= '&'.($paramname2 ? $paramname2 : 'mid').'='.$paramval2;
|
||||
}
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname ? $paramname : 'id').'='.(is_object($object) ? $object->id : '').$moreparam);
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname ?? 'id').'='.(is_object($object) ? $object->id : '').$moreparam);
|
||||
exit;
|
||||
} else {
|
||||
$langs->load("other");
|
||||
|
||||
@@ -111,7 +111,7 @@ class Form
|
||||
*/
|
||||
public function editfieldkey($text, $htmlname, $preselected, $object, $perm, $typeofdata = 'string', $moreparam = '', $fieldrequired = 0, $notabletag = 0, $paramid = 'id', $help = '')
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $langs;
|
||||
|
||||
$ret = '';
|
||||
|
||||
@@ -199,13 +199,13 @@ class Form
|
||||
* @param string $text Text of label (not used in this function)
|
||||
* @param string $htmlname Name of select field
|
||||
* @param string $value Value to show/edit
|
||||
* @param object $object Object (that we want to show)
|
||||
* @param CommonObject $object Object (that we want to show)
|
||||
* @param boolean $perm Permission to allow button to edit parameter
|
||||
* @param string $typeofdata Type of data ('string' by default, 'checkbox', 'email', 'phone', 'amount:99', 'numeric:99',
|
||||
* 'text' or 'textarea:rows:cols%', 'safehtmlstring', 'restricthtml',
|
||||
* 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datehourpicker', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select;xkey:xval,ykey:yval,...')
|
||||
* @param string $editvalue When in edit mode, use this value as $value instead of value (for example, you can provide here a formatted price instead of numeric value, or a select combo). Use '' to use same than $value
|
||||
* @param object $extObject External object ???
|
||||
* @param ?CommonObject $extObject External object ???
|
||||
* @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
|
||||
* @param string $moreparam More param to add on the form on action href URL parameter
|
||||
* @param int $notabletag Do no output table tags
|
||||
@@ -478,20 +478,18 @@ class Form
|
||||
/**
|
||||
* Output edit in place form
|
||||
*
|
||||
* @param object $object Object
|
||||
* @param CommonObject $object Object
|
||||
* @param string $value Value to show/edit
|
||||
* @param string $htmlname DIV ID (field name)
|
||||
* @param int $condition Condition to edit
|
||||
* @param string $inputType Type of input ('string', 'numeric', 'datepicker' ('day' do not work, don't know why), 'textarea:rows:cols', 'ckeditor:dolibarr_zzz:width:height:?:1:rows:cols', 'select:loadmethod:savemethod:buttononly')
|
||||
* @param string $editvalue When in edit mode, use this value as $value instead of value
|
||||
* @param object $extObject External object
|
||||
* @param ?CommonObject $extObject External object
|
||||
* @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
|
||||
* @return string HTML edit in place
|
||||
*/
|
||||
protected function editInPlace($object, $value, $htmlname, $condition, $inputType = 'textarea', $editvalue = null, $extObject = null, $custommsg = null)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$out = '';
|
||||
|
||||
// Check parameters
|
||||
|
||||
@@ -9957,8 +9957,7 @@ function dol_eval($s, $returnvalue = 1, $hideerrors = 1, $onlysimplestring = '1'
|
||||
if ($hideerrors) {
|
||||
ob_start(); // An evaluation has no reason to output data
|
||||
$tmps = @eval('return '.$s.';');
|
||||
$tmpo = ob_get_contents();
|
||||
ob_clean(); // End of interception of data
|
||||
$tmpo = ob_get_clean();
|
||||
if ($tmpo) {
|
||||
print 'Bad string syntax to evaluate. Some data were output when it should not when evaluating: '.$s;
|
||||
}
|
||||
@@ -9966,8 +9965,7 @@ function dol_eval($s, $returnvalue = 1, $hideerrors = 1, $onlysimplestring = '1'
|
||||
} else {
|
||||
ob_start(); // An evaluation has no reason to output data
|
||||
$tmps = eval('return '.$s.';');
|
||||
$tmpo = ob_get_contents();
|
||||
ob_clean(); // End of interception of data
|
||||
$tmpo = ob_get_clean();
|
||||
if ($tmpo) {
|
||||
print 'Bad string syntax to evaluate. Some data were output when it should not when evaluating: '.$s;
|
||||
}
|
||||
|
||||
@@ -267,6 +267,7 @@ function dol_json_decode($json, $assoc = false)
|
||||
} else {
|
||||
$out .= $json[$i];
|
||||
}
|
||||
// @phan-suppress-next-line PhanCompatibleNegativeStringOffset
|
||||
if ($i >= 1 && $json[$i] == '"' && $json[$i - 1] != "\\") {
|
||||
$comment = !$comment;
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ class modAgenda extends DolibarrModules
|
||||
// 'langs'=>'mylangfile', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
// 'position'=>100,
|
||||
// 'enabled'=>'1', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
|
||||
// 'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
// 'perms'=>'1', // Use 'perms'=>'$user->hasRights('mymodule', 'level1', 'level2') if you want your menu with a permission rules
|
||||
// 'target'=>'',
|
||||
// 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
// $r++;
|
||||
|
||||
@@ -167,8 +167,8 @@ class modAi extends DolibarrModules
|
||||
// Array to add new pages in new tabs
|
||||
$this->tabs = array();
|
||||
// Example:
|
||||
// $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@ai:$user->rights->ai->read:/ai/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1
|
||||
// $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@ai:$user->rights->othermodule->read:/ai/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
|
||||
// $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@ai:$user->hasRight('ai','read'):/ai/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1
|
||||
// $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@ai:$user->hasRight('othermodule','read'):/ai/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
|
||||
// $this->tabs[] = array('data'=>'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname
|
||||
//
|
||||
// Where objecttype can be
|
||||
|
||||
@@ -95,8 +95,8 @@ class modApi extends DolibarrModules
|
||||
$this->const = array();
|
||||
|
||||
// Array to add new pages in new tabs
|
||||
// Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@api:$user->rights->api->read:/api/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1
|
||||
// 'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@api:$user->rights->othermodule->read:/api/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
|
||||
// Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@api:$user->hasRight('api','read'):/api/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1
|
||||
// 'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@api:$user->hasRight('othermodule','read'):/api/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
|
||||
// 'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname
|
||||
// where objecttype can be
|
||||
// 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
|
||||
@@ -144,8 +144,8 @@ class modApi extends DolibarrModules
|
||||
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Generate/modify users API key'; // Permission label
|
||||
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'apikey'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$this->rights[$r][5] = 'generate'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$this->rights[$r][4] = 'apikey'; // In php code, permission will be checked by test if ($user->hasRight('permkey','level1','level2'))
|
||||
$this->rights[$r][5] = 'generate'; // In php code, permission will be checked by test if ($user->hasRight('permkey','level1','level2'))
|
||||
$r++;
|
||||
|
||||
|
||||
|
||||
@@ -133,8 +133,8 @@ class modBlockedLog extends DolibarrModules
|
||||
'url'=>'/blockedlog/admin/blockedlog_list.php?mainmenu=tools&leftmenu=blockedlogbrowser',
|
||||
'langs'=>'blockedlog', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>200,
|
||||
'enabled'=>'$conf->blockedlog->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'$user->rights->blockedlog->read', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
'enabled'=>'isModEnabled("blockedlog")', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'$user->hasRight("blockedlog", "read")', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
|
||||
);
|
||||
|
||||
@@ -118,7 +118,7 @@ class modCollab extends DolibarrModules
|
||||
'langs'=>'collab', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>100,
|
||||
'enabled'=>'$conf->collab->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
'perms'=>'1', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2 // 0=Menu for internal users, 1=external users, 2=both
|
||||
);
|
||||
|
||||
@@ -142,7 +142,7 @@ class modCron extends DolibarrModules
|
||||
'langs'=>'cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>500,
|
||||
'enabled'=>'$conf->cron->enabled && preg_match(\'/^(admintools|all)/\', $leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'$user->rights->cron->read', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
'perms'=>'$user->rights->cron->read', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
$r++;
|
||||
|
||||
@@ -175,7 +175,7 @@ class modEmailCollector extends DolibarrModules
|
||||
'langs'=>'admin', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>400,
|
||||
'enabled'=>'isModEnabled("emailcollector") && preg_match(\'/^(admintools|all)/\', $leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'$user->admin', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
'perms'=>'$user->admin', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
$r++;
|
||||
|
||||
@@ -129,7 +129,7 @@ class modGravatar extends DolibarrModules
|
||||
// 'langs'=>'mylangfile', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
// 'position'=>100,
|
||||
// 'enabled'=>'1', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
|
||||
// 'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
// 'perms'=>'1', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
|
||||
// 'target'=>'',
|
||||
// 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
// $r++;
|
||||
@@ -143,7 +143,7 @@ class modGravatar extends DolibarrModules
|
||||
// 'langs'=>'mylangfile', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
// 'position'=>100,
|
||||
// 'enabled'=>'1', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
|
||||
// 'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
// 'perms'=>'1', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
|
||||
// 'target'=>'',
|
||||
// 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
// $r++;
|
||||
@@ -157,7 +157,7 @@ class modGravatar extends DolibarrModules
|
||||
// 'langs'=>'mylangfile', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
// 'position'=>100,
|
||||
// 'enabled'=>'1', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
|
||||
// 'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
// 'perms'=>'1', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
|
||||
// 'target'=>'',
|
||||
// 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
// $r++;
|
||||
|
||||
@@ -125,7 +125,7 @@ class modPaybox extends DolibarrModules
|
||||
// 'url'=>'/mymodule/pagetop.php',
|
||||
// 'langs'=>'mylangfile', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
// 'position'=>100,
|
||||
// 'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
// 'perms'=>'1', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
|
||||
// 'target'=>'',
|
||||
// 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
// $r++;
|
||||
@@ -138,7 +138,7 @@ class modPaybox extends DolibarrModules
|
||||
// 'url'=>'/mymodule/pagelevel1.php',
|
||||
// 'langs'=>'mylangfile', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
// 'position'=>100,
|
||||
// 'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
// 'perms'=>'1', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
|
||||
// 'target'=>'',
|
||||
// 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
// $r++;
|
||||
@@ -151,7 +151,7 @@ class modPaybox extends DolibarrModules
|
||||
// 'url'=>'/mymodule/pagelevel2.php',
|
||||
// 'langs'=>'mylangfile', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
// 'position'=>100,
|
||||
// 'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
// 'perms'=>'1', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
|
||||
// 'target'=>'',
|
||||
// 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
// $r++;
|
||||
|
||||
@@ -117,7 +117,7 @@ class modPaypal extends DolibarrModules
|
||||
'langs'=>'paypal', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>501,
|
||||
'enabled'=>'$conf->paypal->enabled && isModEnabled("banque") && $conf->global->MAIN_FEATURES_LEVEL >= 2', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'$user->rights->banque->consolidate', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
'perms'=>'$user->rights->banque->consolidate', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
); // 0=Menu for internal users, 1=external users, 2=both
|
||||
@@ -132,7 +132,7 @@ class modPaypal extends DolibarrModules
|
||||
// 'url'=>'/mymodule/pagetop.php',
|
||||
// 'langs'=>'mylangfile', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
// 'position'=>100,
|
||||
// 'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
// 'perms'=>'1', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
|
||||
// 'target'=>'',
|
||||
// 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
// $r++;
|
||||
@@ -145,7 +145,7 @@ class modPaypal extends DolibarrModules
|
||||
// 'url'=>'/mymodule/pagelevel1.php',
|
||||
// 'langs'=>'mylangfile', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
// 'position'=>100,
|
||||
// 'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
// 'perms'=>'1', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
|
||||
// 'target'=>'',
|
||||
// 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
// $r++;
|
||||
@@ -158,7 +158,7 @@ class modPaypal extends DolibarrModules
|
||||
// 'url'=>'/mymodule/pagelevel2.php',
|
||||
// 'langs'=>'mylangfile', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
// 'position'=>100,
|
||||
// 'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
// 'perms'=>'1', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
|
||||
// 'target'=>'',
|
||||
// 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
// $r++;
|
||||
|
||||
@@ -169,7 +169,7 @@ class modProduct extends DolibarrModules
|
||||
'langs'=>'products', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>300,
|
||||
'enabled'=>'isModEnabled("product") && preg_match(\'/^(admintools|all)/\',$leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
'perms'=>'1', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>0); // 0=Menu for internal users, 1=external users, 2=both
|
||||
$r++;
|
||||
|
||||
@@ -135,7 +135,7 @@ class modService extends DolibarrModules
|
||||
'langs'=>'products', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>300,
|
||||
'enabled'=>'isModEnabled("product") && preg_match(\'/^(admintools|all)/\',$leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
'perms'=>'1', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>0); // 0=Menu for internal users, 1=external users, 2=both
|
||||
$r++;
|
||||
|
||||
@@ -102,7 +102,7 @@ class modStripe extends DolibarrModules
|
||||
'langs'=>'stripe', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>500,
|
||||
'enabled'=>'$conf->stripe->enabled && isModEnabled("banque") && $conf->global->MAIN_FEATURES_LEVEL >= 2', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'$user->rights->banque->modifier', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
'perms'=>'$user->rights->banque->modifier', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
); // 0=Menu for internal users, 1=external users, 2=both
|
||||
|
||||
@@ -123,7 +123,7 @@ class modWebsite extends DolibarrModules
|
||||
'langs'=>'website', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>100,
|
||||
'enabled'=>'$conf->website->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'$user->rights->website->read', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
'perms'=>'$user->rights->website->read', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
$r++;
|
||||
|
||||
@@ -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>";
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -97,7 +97,7 @@ $upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ?
|
||||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
$isdraft = (($object->status== $object::STATUS_DRAFT) ? 1 : 0);
|
||||
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||
$result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_soc', 'id', $isdraft);
|
||||
|
||||
if (!$permissiontoread) {
|
||||
@@ -186,7 +186,7 @@ if (!empty($projectstatic->socid)) {
|
||||
$projectstatic->fetch_thirdparty();
|
||||
}
|
||||
|
||||
$withProjectUrl='';
|
||||
$withProjectUrl = '';
|
||||
$object->project = clone $projectstatic;
|
||||
|
||||
if (!empty($withproject)) {
|
||||
@@ -339,7 +339,7 @@ if (!empty($withproject)) {
|
||||
$htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp");
|
||||
print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
|
||||
print '</td><td class="valuefield">';
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '1', $projectstatic, 0, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '1', $projectstatic, 0, $typeofdata, '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td class="valuefield">';
|
||||
@@ -347,25 +347,25 @@ if (!empty($withproject)) {
|
||||
$htmltext = $langs->trans("AllowUnknownPeopleSuggestBoothHelp");
|
||||
print $form->editfieldkey('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
|
||||
print '</td><td class="valuefield">';
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '1', $projectstatic, 0, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '1', $projectstatic, 0, $typeofdata, '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td class="valuefield">';
|
||||
print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
|
||||
print '</td><td class="valuefield">';
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td class="valuefield">';
|
||||
print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
|
||||
print '</td><td class="valuefield">';
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td class="titlefield">';
|
||||
print $form->editfieldkey($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', '', $project, $permissiontoadd, 'integer:3', '', 0, 0, 'projectid');
|
||||
print '</td><td class="valuefield">';
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', $project->max_attendees, $project, $permissiontoadd, 'integer:3', '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', $project->max_attendees, $project, $permissiontoadd, 'integer:3', '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td class="titlefield valignmiddle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
|
||||
@@ -571,7 +571,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
//$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
|
||||
//unset($object->fields['fk_project']); // Hide field already shown in banner
|
||||
//unset($object->fields['fk_soc']); // Hide field already shown in banner
|
||||
$keyforbreak='num_vote';
|
||||
$keyforbreak = 'num_vote';
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
|
||||
|
||||
@@ -643,7 +643,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
$object->fetchObjectLinked();
|
||||
|
||||
if (is_array($object->linkedObjects) && count($object->linkedObjects)>0 && array_key_exists("facture", $object->linkedObjects)) {
|
||||
if (is_array($object->linkedObjects) && count($object->linkedObjects) > 0 && array_key_exists("facture", $object->linkedObjects)) {
|
||||
foreach ($object->linkedObjects["facture"] as $fac) {
|
||||
if (empty($fac->paye)) {
|
||||
$key = 'paymentlink_'.$fac->id;
|
||||
|
||||
@@ -74,7 +74,7 @@ if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$isdraft = (($object->status== $object::STATUS_DRAFT) ? 1 : 0);
|
||||
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||
$result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
|
||||
|
||||
$permissiontoread = $user->hasRight('eventorganization', 'read');
|
||||
@@ -88,7 +88,7 @@ $upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ?
|
||||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
$isdraft = (($object->status== $object::STATUS_DRAFT) ? 1 : 0);
|
||||
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||
$result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
|
||||
|
||||
if (!$permissiontoread) {
|
||||
@@ -166,7 +166,7 @@ if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($pro
|
||||
if (!empty($projectstatic->socid)) {
|
||||
$projectstatic->fetch_thirdparty();
|
||||
}
|
||||
$withProjectUrl='';
|
||||
$withProjectUrl = '';
|
||||
$object->project = clone $projectstatic;
|
||||
|
||||
if (!empty($withproject)) {
|
||||
@@ -298,7 +298,7 @@ if (!empty($withproject)) {
|
||||
$htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp");
|
||||
print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
|
||||
print '</td><td>';
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '1', $projectstatic, 0, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '1', $projectstatic, 0, $typeofdata, '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td>';
|
||||
@@ -306,19 +306,19 @@ if (!empty($withproject)) {
|
||||
$htmltext = $langs->trans("AllowUnknownPeopleSuggestBoothHelp");
|
||||
print $form->editfieldkey('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
|
||||
print '</td><td>';
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '1', $projectstatic, 0, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '1', $projectstatic, 0, $typeofdata, '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td valign="middle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
|
||||
|
||||
@@ -102,7 +102,7 @@ $upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ?
|
||||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
$isdraft = (($object->status== $object::STATUS_DRAFT) ? 1 : 0);
|
||||
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||
$result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_soc', 'id', $isdraft);
|
||||
|
||||
if (!$permissiontoread) {
|
||||
@@ -141,7 +141,7 @@ if (!empty($projectstatic->socid)) {
|
||||
$projectstatic->fetch_thirdparty();
|
||||
}
|
||||
|
||||
$withProjectUrl='';
|
||||
$withProjectUrl = '';
|
||||
$object->project = clone $projectstatic;
|
||||
|
||||
if (!empty($withproject)) {
|
||||
@@ -271,7 +271,7 @@ if (!empty($withproject)) {
|
||||
$htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp");
|
||||
print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
|
||||
print '</td><td>';
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '1', $projectstatic, 0, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '1', $projectstatic, 0, $typeofdata, '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td>';
|
||||
@@ -279,19 +279,19 @@ if (!empty($withproject)) {
|
||||
$htmltext = $langs->trans("AllowUnknownPeopleSuggestBoothHelp");
|
||||
print $form->editfieldkey('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
|
||||
print '</td><td>';
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '1', $projectstatic, 0, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '1', $projectstatic, 0, $typeofdata, '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td valign="middle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
|
||||
|
||||
@@ -120,11 +120,11 @@ foreach ($object->fields as $key => $val) {
|
||||
if (!empty($val['visible'])) {
|
||||
$visible = (int) dol_eval($val['visible'], 1);
|
||||
$arrayfields['t.'.$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'] : ''
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -159,15 +159,15 @@ if (!$permissiontoread) {
|
||||
|
||||
if (preg_match('/^set/', $action) && ($projectid > 0 || $projectref) && $user->hasRight('eventorganization', 'write')) {
|
||||
//If "set" fields keys is in projects fields
|
||||
$project_attr=preg_replace('/^set/', '', $action);
|
||||
$project_attr = preg_replace('/^set/', '', $action);
|
||||
if (array_key_exists($project_attr, $project->fields)) {
|
||||
$result = $project->fetch($projectid, $projectref);
|
||||
if ($result < 0) {
|
||||
setEventMessages(null, $project->errors, 'errors');
|
||||
} else {
|
||||
$projectid = $project->id;
|
||||
$project->{$project_attr}=GETPOST($project_attr);
|
||||
$result=$project->update($user);
|
||||
$project->{$project_attr} = GETPOST($project_attr);
|
||||
$result = $project->update($user);
|
||||
if ($result < 0) {
|
||||
setEventMessages(null, $project->errors, 'errors');
|
||||
}
|
||||
@@ -245,7 +245,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
} else {
|
||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -408,10 +408,10 @@ if ($projectid > 0) {
|
||||
// Date start - end of event
|
||||
print '<tr><td>'.$langs->trans("Dates").' ('.$langs->trans("Event").')</td><td>';
|
||||
$start = dol_print_date($project->date_start_event, 'day', 'tzuserrel');
|
||||
print ($start ? '<span title="'.dol_print_date($project->date_start_event, 'dayhour', 'tzuserrel').'">'.$start.'</span>' : '?');
|
||||
print($start ? '<span title="'.dol_print_date($project->date_start_event, 'dayhour', 'tzuserrel').'">'.$start.'</span>' : '?');
|
||||
$end = dol_print_date($project->date_end_event, 'day', 'tzuserrel');
|
||||
print ' - ';
|
||||
print ($end ? '<span title="'.dol_print_date($project->date_end_event, 'dayhour', 'tzuserrel').'">'.$end.'</span>' : '?');
|
||||
print($end ? '<span title="'.dol_print_date($project->date_end_event, 'dayhour', 'tzuserrel').'">'.$end.'</span>' : '?');
|
||||
if ($object->hasDelay()) {
|
||||
print img_warning("Late");
|
||||
}
|
||||
@@ -454,7 +454,7 @@ if ($projectid > 0) {
|
||||
$htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp");
|
||||
print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', ($project->accept_conference_suggestions ? 1 : 0), $project, $permissiontoadd, $typeofdata, '', 0, 0, 'projectid', $htmltext);
|
||||
print '</td><td class="valuefield">';
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', ($project->accept_conference_suggestions ? 1 : 0), $project, $permissiontoadd, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', ($project->accept_conference_suggestions ? 1 : 0), $project, $permissiontoadd, $typeofdata, '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td class="titlefield">';
|
||||
@@ -462,25 +462,25 @@ if ($projectid > 0) {
|
||||
$htmltext = $langs->trans("AllowUnknownPeopleSuggestBoothHelp");
|
||||
print $form->editfieldkey('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', ($project->accept_booth_suggestions ? 1 : 0), $project, $permissiontoadd, $typeofdata, '', 0, 0, 'projectid', $htmltext);
|
||||
print '</td><td class="valuefield">';
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', ($project->accept_booth_suggestions ? 1 : 0), $project, $permissiontoadd, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', ($project->accept_booth_suggestions ? 1 : 0), $project, $permissiontoadd, $typeofdata, '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td class="titlefield">';
|
||||
print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', '', $project, $permissiontoadd, 'amount', '', 0, 0, 'projectid');
|
||||
print '</td><td class="valuefield">';
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $project->price_booth, $project, $permissiontoadd, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $project->price_booth, $project, $permissiontoadd, 'amount', '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td class="titlefield">';
|
||||
print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', '', $project, $permissiontoadd, 'amount', '', 0, 0, 'projectid');
|
||||
print '</td><td class="valuefield">';
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $project->price_registration, $project, $permissiontoadd, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $project->price_registration, $project, $permissiontoadd, 'amount', '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td class="titlefield">';
|
||||
print $form->editfieldkey($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', '', $project, $permissiontoadd, 'integer:3', '', 0, 0, 'projectid');
|
||||
print '</td><td class="valuefield">';
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', $project->max_attendees, $project, $permissiontoadd, 'integer:3', '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', $project->max_attendees, $project, $permissiontoadd, 'integer:3', '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
// Link to ICS for the event
|
||||
@@ -733,7 +733,7 @@ $arrayofmassactions = array(
|
||||
//'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
|
||||
//'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").' ('.$langs->trans("ToSpeakers").')',
|
||||
'presend' => img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail").' ('.$langs->trans("ToSpeakers").')',
|
||||
//'presend_attendees'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail").' - '.$langs->trans("Attendees"),
|
||||
);
|
||||
if (!empty($permissiontodelete)) {
|
||||
@@ -763,8 +763,8 @@ print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
|
||||
$newcardbutton = '';
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.(!empty($project->id) ? '&withproject=1&fk_project='.$project->id : '').(!empty($project->socid) ? '&fk_soc='.$project->socid : '').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'.(!empty($project->id) ? '&withproject=1&fk_project='.$project->id : '').(!empty($project->socid) ? '&fk_soc='.$project->socid : '').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'.(!empty($project->id) ? '&withproject=1&fk_project='.$project->id : '').(!empty($project->socid) ? '&fk_soc='.$project->socid : '').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'.(!empty($project->id) ? '&withproject=1&fk_project='.$project->id : '').(!empty($project->socid) ? '&fk_soc='.$project->socid : '').preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition'));
|
||||
$newcardbutton .= dolGetButtonTitleSeparator();
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorbooth_card.php?action=create'.(!empty($project->id) ? '&withproject=1&fk_project='.$project->id : '').(!empty($project->socid) ? '&fk_soc='.$project->socid : '').'&backtopage='.urlencode($_SERVER['PHP_SELF']).(!empty($project->id) ? '?projectid='.$project->id : ''), '', $permissiontoadd);
|
||||
|
||||
@@ -884,7 +884,7 @@ foreach ($object->fields as $key => $val) {
|
||||
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, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
@@ -927,7 +927,7 @@ foreach ($object->fields as $key => $val) {
|
||||
// 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, 'totalarray'=>&$totalarray);
|
||||
$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
@@ -1056,7 +1056,7 @@ while ($i < $imaxinloop) {
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
|
||||
$parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
@@ -1098,7 +1098,7 @@ if ($num == 0) {
|
||||
|
||||
$db->free($resql);
|
||||
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||
$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
|
||||
@@ -343,7 +343,7 @@ if (!empty($withproject)) {
|
||||
$htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp");
|
||||
print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
|
||||
print '</td><td>';
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '1', $projectstatic, 0, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '1', $projectstatic, 0, $typeofdata, '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td>';
|
||||
@@ -351,19 +351,19 @@ if (!empty($withproject)) {
|
||||
$htmltext = $langs->trans("AllowUnknownPeopleSuggestBoothHelp");
|
||||
print $form->editfieldkey('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
|
||||
print '</td><td>';
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '1', $projectstatic, 0, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '1', $projectstatic, 0, $typeofdata, '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td valign="middle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
|
||||
|
||||
@@ -63,7 +63,7 @@ $withproject = GETPOSTINT('withproject');
|
||||
$fk_project = GETPOSTINT('fk_project') ? GETPOSTINT('fk_project') : GETPOSTINT('projectid');
|
||||
$projectid = $fk_project;
|
||||
|
||||
$withProjectUrl='';
|
||||
$withProjectUrl = '';
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
|
||||
@@ -128,11 +128,11 @@ foreach ($object->fields as $key => $val) {
|
||||
if (!empty($val['visible'])) {
|
||||
$visible = (int) dol_eval($val['visible'], 1);
|
||||
$arrayfields['t.'.$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'] : ''
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -169,14 +169,14 @@ if (!$permissiontoread) {
|
||||
if (preg_match('/^set/', $action) && $projectid > 0 && $user->hasRight('eventorganization', 'write')) {
|
||||
$project = new Project($db);
|
||||
//If "set" fields keys is in projects fields
|
||||
$project_attr=preg_replace('/^set/', '', $action);
|
||||
$project_attr = preg_replace('/^set/', '', $action);
|
||||
if (array_key_exists($project_attr, $project->fields)) {
|
||||
$result = $project->fetch($projectid);
|
||||
if ($result < 0) {
|
||||
setEventMessages(null, $project->errors, 'errors');
|
||||
} else {
|
||||
$project->{$project_attr}=GETPOST($project_attr);
|
||||
$result=$project->update($user);
|
||||
$project->{$project_attr} = GETPOST($project_attr);
|
||||
$result = $project->update($user);
|
||||
if ($result < 0) {
|
||||
setEventMessages(null, $project->errors, 'errors');
|
||||
}
|
||||
@@ -402,7 +402,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
|
||||
$projectstatic->fetch_thirdparty();
|
||||
}
|
||||
|
||||
$withProjectUrl='';
|
||||
$withProjectUrl = '';
|
||||
$object->project = clone $projectstatic;
|
||||
|
||||
if (!empty($withproject)) {
|
||||
@@ -554,7 +554,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
|
||||
$htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp");
|
||||
print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
|
||||
print '</td><td>';
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '1', $projectstatic, 0, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '1', $projectstatic, 0, $typeofdata, '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td>';
|
||||
@@ -562,25 +562,25 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
|
||||
$htmltext = $langs->trans("AllowUnknownPeopleSuggestBoothHelp");
|
||||
print $form->editfieldkey('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
|
||||
print '</td><td>';
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '1', $projectstatic, 0, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '1', $projectstatic, 0, $typeofdata, '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', null, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td class="titlefield">';
|
||||
print $form->editfieldkey($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', '', $projectstatic, $permissiontoadd, 'integer:3', '&withproject=1', 0, 0, 'projectid');
|
||||
print '</td><td class="valuefield">';
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', $projectstatic->max_attendees, $projectstatic, $permissiontoadd, 'integer:3', '', 0, 0, '&withproject=1', 0, '', 'projectid');
|
||||
print $form->editfieldval($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', $projectstatic->max_attendees, $projectstatic, $permissiontoadd, 'integer:3', '', null, 0, '&withproject=1', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td valign="middle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
|
||||
@@ -725,7 +725,7 @@ $arrayofmassactions = array(
|
||||
//'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
|
||||
//'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"),
|
||||
'presend' => img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||
);
|
||||
if (!empty($permissiontodelete)) {
|
||||
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||
@@ -751,7 +751,7 @@ print '<input type="hidden" name="fk_project" value="'.$fk_project.'">';
|
||||
print '<input type="hidden" name="page_y" value="">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
$params = array('morecss'=>'reposition');
|
||||
$params = array('morecss' => 'reposition');
|
||||
|
||||
$urlnew = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id) ? '&conforboothid='.$confOrBooth->id : '').(!empty($projectstatic->id) ? '&fk_project='.$projectstatic->id : '').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.(empty($confOrBooth->id) ? '' : '&conforboothid='.$confOrBooth->id).$withProjectUrl);
|
||||
|
||||
@@ -859,7 +859,7 @@ foreach ($object->fields as $key => $val) {
|
||||
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, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
@@ -902,7 +902,7 @@ foreach ($object->fields as $key => $val) {
|
||||
// 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, 'totalarray'=>&$totalarray);
|
||||
$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
@@ -1007,7 +1007,7 @@ while ($i < $imaxinloop) {
|
||||
} elseif ($key == 'ref') {
|
||||
$optionLink = (!empty($withproject) ? 'conforboothidproject' : 'conforboothid');
|
||||
if (empty($confOrBooth->id)) {
|
||||
$optionLink='projectid';
|
||||
$optionLink = 'projectid';
|
||||
}
|
||||
print $object->getNomUrl(1, $optionLink);
|
||||
} else {
|
||||
@@ -1034,7 +1034,7 @@ while ($i < $imaxinloop) {
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
|
||||
$parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
@@ -1076,7 +1076,7 @@ if ($num == 0) {
|
||||
|
||||
$db->free($resql);
|
||||
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||
$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"> </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"> </td>'; // Supplier ref + Qty ordered + qty already dispatched
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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>';
|
||||
|
||||
|
||||
@@ -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"> ';
|
||||
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"> ';
|
||||
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>';
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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"> </td>'; // Supplier ref + Qty ordered + qty already dispatched
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -9,6 +9,7 @@ ActionsOnResource=Events about this resource
|
||||
ResourcePageIndex=Resources list
|
||||
ResourceSingular=Resource
|
||||
ResourceCard=Resource card
|
||||
NewResource=New resource
|
||||
AddResource=Create a resource
|
||||
ResourceFormLabel_ref=Resource name
|
||||
ResourceType=Resource type
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -501,21 +501,23 @@ class Loan extends CommonObject
|
||||
$langs->loadLangs(array("customers", "bills"));
|
||||
|
||||
unset($this->labelStatus); // Force to reset the array of status label, because label can change depending on parameters
|
||||
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
|
||||
global $langs;
|
||||
$this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv('Unpaid');
|
||||
$this->labelStatus[self::STATUS_PAID] = $langs->transnoentitiesnoconv('Paid');
|
||||
$this->labelStatus[self::STATUS_STARTED] = $langs->transnoentitiesnoconv("BillStatusStarted");
|
||||
if ($status == 0 && $alreadypaid > 0) {
|
||||
$this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted");
|
||||
}
|
||||
$this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv('Unpaid');
|
||||
$this->labelStatusShort[self::STATUS_PAID] = $langs->transnoentitiesnoconv('Paid');
|
||||
$this->labelStatusShort[self::STATUS_STARTED] = $langs->transnoentitiesnoconv("BillStatusStarted");
|
||||
if ($status == 0 && $alreadypaid > 0) {
|
||||
$this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted");
|
||||
}
|
||||
// Always true because of 'unset':
|
||||
// if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
|
||||
global $langs;
|
||||
$this->labelStatus = array();
|
||||
$this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv('Unpaid');
|
||||
$this->labelStatus[self::STATUS_PAID] = $langs->transnoentitiesnoconv('Paid');
|
||||
$this->labelStatus[self::STATUS_STARTED] = $langs->transnoentitiesnoconv("BillStatusStarted");
|
||||
if ($status == 0 && $alreadypaid > 0) {
|
||||
$this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted");
|
||||
}
|
||||
$this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv('Unpaid');
|
||||
$this->labelStatusShort[self::STATUS_PAID] = $langs->transnoentitiesnoconv('Paid');
|
||||
$this->labelStatusShort[self::STATUS_STARTED] = $langs->transnoentitiesnoconv("BillStatusStarted");
|
||||
if ($status == 0 && $alreadypaid > 0) {
|
||||
$this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted");
|
||||
}
|
||||
// } // End of empty(labelStatus,labelStatusShort)
|
||||
|
||||
$statusType = 'status1';
|
||||
if (($status == 0 && $alreadypaid > 0) || $status == self::STATUS_STARTED) {
|
||||
@@ -594,7 +596,7 @@ class Loan extends CommonObject
|
||||
|
||||
global $action;
|
||||
$hookmanager->initHooks(array($this->element . 'dao'));
|
||||
$parameters = array('id'=>$this->id, 'getnomurl' => &$result);
|
||||
$parameters = array('id' => $this->id, 'getnomurl' => &$result);
|
||||
$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook > 0) {
|
||||
$result = $hookmanager->resPrint;
|
||||
|
||||
@@ -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>';
|
||||
|
||||
|
||||
@@ -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')).'" />';
|
||||
|
||||
@@ -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" />';
|
||||
|
||||
@@ -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')).'" />';
|
||||
|
||||
@@ -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')).'" />';
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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>';
|
||||
|
||||
@@ -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>';
|
||||
|
||||
@@ -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>';
|
||||
|
||||
@@ -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>';
|
||||
|
||||
|
||||
@@ -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), '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"> </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"> </td>'; // Supplier ref + Qty ordered + qty already dispatched
|
||||
|
||||
@@ -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>';
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -753,7 +753,7 @@ if (empty($reshook)) {
|
||||
|
||||
|
||||
// Update linked member
|
||||
if (!$error && $object->fk_soc > 0) {
|
||||
if (!$error && isset($object->fk_soc) && $object->fk_soc > 0) {
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent";
|
||||
$sql .= " SET fk_soc = NULL WHERE fk_soc = ".((int) $socid);
|
||||
if (!$object->db->query($sql)) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -1227,33 +1227,43 @@ class FunctionsLibTest extends CommonClassTest
|
||||
$this->assertEquals(getServerTimeZoneInt('now') * 3600, ($nowtzserver - $now));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Data provider for testVerifCond
|
||||
*
|
||||
* @return array<string,array{0:string,1:bool}>
|
||||
*/
|
||||
public function verifCondDataProvider(): array
|
||||
{
|
||||
return [
|
||||
'Test a true comparison' => ['1==1', true,],
|
||||
'Test a false comparison' => ['1==2', false,],
|
||||
'Test that the conf property of a module reports true when enabled' => ['isModEnabled("facture")', true,],
|
||||
'Test that the conf property of a module reports false when disabled' => ['isModEnabled("moduledummy")', false,],
|
||||
'Test that verifConf(0) returns false' => [0, false,],
|
||||
'Test that verifConf("0") returns false' => ["0", false,],
|
||||
'Test that verifConf("") returns false (special case)' => ['', true,],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* testVerifCond
|
||||
*
|
||||
* @dataProvider verifCondDataProvider
|
||||
*
|
||||
* @param string $cond Condition to test using verifCond
|
||||
* @param string $expected Expected outcome of verifCond
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testVerifCond()
|
||||
public function testVerifCond($cond, $expected)
|
||||
{
|
||||
$verifcond = verifCond('1==1');
|
||||
$this->assertTrue($verifcond, 'Test a true comparison');
|
||||
|
||||
$verifcond = verifCond('1==2');
|
||||
$this->assertFalse($verifcond, 'Test a false comparison');
|
||||
|
||||
$verifcond = verifCond('isModEnabled("facture")');
|
||||
$this->assertTrue($verifcond, 'Test that the conf property of a module reports true when enabled');
|
||||
|
||||
$verifcond = verifCond('isModEnabled("moduledummy")');
|
||||
$this->assertFalse($verifcond, 'Test that the conf property of a module reports false when disabled');
|
||||
|
||||
$verifcond = verifCond(0);
|
||||
$this->assertFalse($verifcond, 'Test that verifConf(0) return False');
|
||||
|
||||
$verifcond = verifCond("0");
|
||||
$this->assertFalse($verifcond, 'Test that verifConf("0") return False');
|
||||
|
||||
$verifcond = verifCond('');
|
||||
$this->assertTrue($verifcond, 'Test that verifConf("") return False (special case)');
|
||||
if ($expected) {
|
||||
$this->assertTrue(verifCond($cond));
|
||||
} else {
|
||||
$this->assertFalse(verifCond($cond));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user