Fix HTML5 use of <br> is preferred to <br />

This commit is contained in:
Laurent Destailleur 2017-09-15 23:49:04 +02:00
parent ffb3823655
commit 8773a6860f
28 changed files with 156 additions and 157 deletions

View File

@ -289,7 +289,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
/*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base /*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base
{ {
$ok = 0; $ok = 0;
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br />'; $msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br>';
}*/ }*/
} }
if (isset($_POST["country"]) && ($_POST["country"]=='0') && ($id != 2)) if (isset($_POST["country"]) && ($_POST["country"]=='0') && ($id != 2))

View File

@ -185,7 +185,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
/*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base /*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base
{ {
$ok = 0; $ok = 0;
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br />'; $msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br>';
}*/ }*/
} }
if (isset($_POST["country"]) && ($_POST["country"] <= 0)) if (isset($_POST["country"]) && ($_POST["country"] <= 0))

View File

@ -174,7 +174,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
/*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base /*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base
{ {
$ok = 0; $ok = 0;
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br />'; $msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br>';
}*/ }*/
} }

View File

@ -315,7 +315,7 @@ while ($i < min($num, $limit))
// Affiche un lien vers la facture client/fournisseur // Affiche un lien vers la facture client/fournisseur
$doc_ref = preg_replace('/\(.*\)/', '', $line->doc_ref); $doc_ref = preg_replace('/\(.*\)/', '', $line->doc_ref);
print strlen(length_accounta($line->subledger_account)) == 0 ? '<td>' . $line->label_operation . '</td>' : '<td>' . $line->label_operation . '<br /><span style="font-size:0.8em">(' . length_accounta($line->subledger_account) . ')</span></td>'; print strlen(length_accounta($line->subledger_account)) == 0 ? '<td>' . $line->label_operation . '</td>' : '<td>' . $line->label_operation . '<br><span style="font-size:0.8em">(' . length_accounta($line->subledger_account) . ')</span></td>';
print '<td align="right">' . ($line->debit ? price($line->debit) :''). '</td>'; print '<td align="right">' . ($line->debit ? price($line->debit) :''). '</td>';

View File

@ -399,7 +399,7 @@ print '</table>';
print '<br /><br />'; print '<br><br>';
/* /*

View File

@ -162,7 +162,7 @@ foreach ($list as $key)
print "</table>\n"; print "</table>\n";
print '<br /><br /><div style="text-align:center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>'; print '<br><br><div style="text-align:center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>';
print '</form>'; print '</form>';
llxFooter(); llxFooter();

View File

@ -662,7 +662,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
/*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base /*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base
{ {
$ok = 0; $ok = 0;
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br />'; $msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br>';
}*/ }*/
} }
if (isset($_POST["country"]) && ($_POST["country"]=='0') && ($id != 2)) if (isset($_POST["country"]) && ($_POST["country"]=='0') && ($id != 2))

View File

@ -286,7 +286,7 @@ class PrestaShopWebservice
* $xml = $ws->get(array('resource' => 'orders', 'id' => 1)); * $xml = $ws->get(array('resource' => 'orders', 'id' => 1));
* // Here in $xml, a SimpleXMLElement object you can parse * // Here in $xml, a SimpleXMLElement object you can parse
* foreach ($xml->children()->children() as $attName => $attValue) * foreach ($xml->children()->children() as $attName => $attValue)
* echo $attName.' = '.$attValue.'<br />'; * echo $attName.' = '.$attValue.'<br>';
* } * }
* catch (PrestaShopWebserviceException $ex) * catch (PrestaShopWebserviceException $ex)
* { * {

View File

@ -23,7 +23,7 @@
*/ */
require '../main.inc.php'; require '../main.inc.php';
// Class // Class
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
@ -47,7 +47,7 @@ $list = array (
/* /*
* Actions * Actions
*/ */
if ($action == 'update') if ($action == 'update')
{ {
$error = 0; $error = 0;
@ -99,7 +99,7 @@ foreach ($list as $key)
print '<tr class="oddeven value">'; print '<tr class="oddeven value">';
// Param // Param
$label = $langs->trans($key); $label = $langs->trans($key);
print '<td><label for="'.$key.'">'.$label.'</label></td>'; print '<td><label for="'.$key.'">'.$label.'</label></td>';
// Value // Value
@ -120,7 +120,7 @@ print '</tr>';
print '</form>'; print '</form>';
print "</table>\n"; print "</table>\n";
print '<br /><div style="text-align:center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>'; print '<br><div style="text-align:center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>';
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -235,7 +235,7 @@ print '</td></tr>';
*/ */
print '</table>'; print '</table>';
print '<br />'; print '<br>';
if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION)) if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION))
{ {
@ -293,7 +293,7 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION))
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
print '<br />'; print '<br>';
} }

View File

@ -233,7 +233,7 @@ foreach ($dirmodels as $reldir)
print '</table>'; print '</table>';
print "<br />"; print "<br>";
print load_fiche_titre($langs->trans("OtherOptions"),'',''); print load_fiche_titre($langs->trans("OtherOptions"),'','');

View File

@ -246,7 +246,7 @@ $found++;
/*if (! $found) /*if (! $found)
{ {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td colspan="2">'.$langs->trans("NoModuleToManageStockDecrease").'</td>'; print '<td colspan="2">'.$langs->trans("NoModuleToManageStockDecrease").'</td>';
print "</tr>\n"; print "</tr>\n";
@ -329,7 +329,7 @@ $found++;
/*if (! $found) /*if (! $found)
{ {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td colspan="2">'.$langs->trans("NoModuleToManageStockIncrease").'</td>'; print '<td colspan="2">'.$langs->trans("NoModuleToManageStockIncrease").'</td>';
print "</tr>\n"; print "</tr>\n";
@ -433,7 +433,7 @@ if ($virtualdiffersfromphysical)
} }
print '<br />'; print '<br>';
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
{ {
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
@ -441,7 +441,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
print '<td>'.$langs->trans("Inventory").'</td>'."\n"; print '<td>'.$langs->trans("Inventory").'</td>'."\n";
print '<td align="center" width="20">&nbsp;</td>'; print '<td align="center" width="20">&nbsp;</td>';
print '<td align="center" width="100">&nbsp;</td>'."\n"; print '<td align="center" width="100">&nbsp;</td>'."\n";
// Example with a yes / no select // Example with a yes / no select
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("INVENTORY_DISABLE_VIRTUAL").'</td>'; print '<td>'.$langs->trans("INVENTORY_DISABLE_VIRTUAL").'</td>';
@ -454,7 +454,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</form>'; print '</form>';
print '</td></tr>'; print '</td></tr>';
// Example with a yes / no select // Example with a yes / no select
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("INVENTORY_USE_MIN_PA_IF_NO_LAST_PA").'</td>'; print '<td>'.$langs->trans("INVENTORY_USE_MIN_PA_IF_NO_LAST_PA").'</td>';
@ -467,7 +467,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</form>'; print '</form>';
print '</td></tr>'; print '</td></tr>';
// Example with a yes / no select // Example with a yes / no select
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("INVENTORY_USE_INVENTORY_DATE_FROM_DATEMVT").'</td>'; print '<td>'.$langs->trans("INVENTORY_USE_INVENTORY_DATE_FROM_DATEMVT").'</td>';
@ -480,7 +480,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</form>'; print '</form>';
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
} }
@ -492,7 +492,7 @@ print " <td align=\"right\" width=\"160\">&nbsp;</td>\n";
print '</tr>'."\n"; print '</tr>'."\n";
if (! empty($conf->fournisseur->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) { if (! empty($conf->fournisseur->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("UseDispatchStatus").'</td>'; print '<td width="60%">'.$langs->trans("UseDispatchStatus").'</td>';
print '<td width="160" align="right">'; print '<td width="160" align="right">';
@ -536,7 +536,7 @@ print '<br>';
If not used by a module, I still need to understand in which case user may need this now we can set rule on product page. If not used by a module, I still need to understand in which case user may need this now we can set rule on product page.
if ($conf->global->PRODUIT_SOUSPRODUITS) if ($conf->global->PRODUIT_SOUSPRODUITS)
{ {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("IndependantSubProductStock").'</td>'; print '<td width="60%">'.$langs->trans("IndependantSubProductStock").'</td>';

View File

@ -2084,7 +2084,7 @@ else
print '<td style="text-align:center;">'; print '<td style="text-align:center;">';
print '<input type="hidden" name="rowid" value="'.$line->rowid.'">'; print '<input type="hidden" name="rowid" value="'.$line->rowid.'">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans('Save').'">'; print '<input type="submit" class="button" name="save" value="'.$langs->trans('Save').'">';
print '<br /><input type="submit" class="button" name="cancel" value="'.$langs->trans('Cancel').'">'; print '<br><input type="submit" class="button" name="cancel" value="'.$langs->trans('Cancel').'">';
print '</td>'; print '</td>';
} }

View File

@ -823,7 +823,7 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
dol_fiche_head(); dol_fiche_head();
//print '<span>'.$langs->trans('DelayToRequestCP',$object->getConfCP('delayForRequest')).'</span><br /><br />'; //print '<span>'.$langs->trans('DelayToRequestCP',$object->getConfCP('delayForRequest')).'</span><br><br>';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tbody>'; print '<tbody>';
@ -1281,14 +1281,14 @@ else
} else { } else {
print '<div class="tabBar">'; print '<div class="tabBar">';
print $langs->trans('ErrorUserViewCP'); print $langs->trans('ErrorUserViewCP');
print '<br /><br /><input type="button" value="'.$langs->trans("ReturnCP").'" class="button" onclick="history.go(-1)" />'; print '<br><br><input type="button" value="'.$langs->trans("ReturnCP").'" class="button" onclick="history.go(-1)" />';
print '</div>'; print '</div>';
} }
} else { } else {
print '<div class="tabBar">'; print '<div class="tabBar">';
print $langs->trans('ErrorIDFicheCP'); print $langs->trans('ErrorIDFicheCP');
print '<br /><br /><input type="button" value="'.$langs->trans("ReturnCP").'" class="button" onclick="history.go(-1)" />'; print '<br><br><input type="button" value="'.$langs->trans("ReturnCP").'" class="button" onclick="history.go(-1)" />';
print '</div>'; print '</div>';
} }

View File

@ -365,7 +365,7 @@ else
print $langs->trans("InstallEasy")." "; print $langs->trans("InstallEasy")." ";
print $langs->trans("ChooseYourSetupMode"); print $langs->trans("ChooseYourSetupMode");
print '<br /><br />'; print '<br><br>';
$foundrecommandedchoice=0; $foundrecommandedchoice=0;
@ -534,13 +534,13 @@ else
if (count($notavailable_choices)) { if (count($notavailable_choices)) {
print '<br />'; print '<br>';
print '<div id="AShowChoices">'; print '<div id="AShowChoices">';
print '<img src="../theme/eldy/img/1downarrow.png"> <a href="#">'.$langs->trans('ShowNotAvailableOptions').'</a>'; print '<img src="../theme/eldy/img/1downarrow.png"> <a href="#">'.$langs->trans('ShowNotAvailableOptions').'</a>';
print '</div>'; print '</div>';
print '<div id="navail_choices" style="display:none">'; print '<div id="navail_choices" style="display:none">';
print '<br />'; print '<br>';
print '<table width="100%" class="listofchoices">'; print '<table width="100%" class="listofchoices">';
foreach ($notavailable_choices as $choice) { foreach ($notavailable_choices as $choice) {
print $choice; print $choice;

View File

@ -132,7 +132,7 @@ MaxNbOfLinesForBoxes=Max number of lines for widgets
PositionByDefault=Default order PositionByDefault=Default order
Position=Position Position=Position
MenusDesc=Menu managers set content of the two menu bars (horizontal and vertical). MenusDesc=Menu managers set content of the two menu bars (horizontal and vertical).
MenusEditorDesc=The menu editor allows you to define custom menu entries. Use it carefully to avoid instability and permanently unreachable menu entries.<br />Some modules add menu entries (in menu <b>All</b> mostly). If you remove some of these entries by mistake, you can restore them disabling and reenabling the module. MenusEditorDesc=The menu editor allows you to define custom menu entries. Use it carefully to avoid instability and permanently unreachable menu entries.<br>Some modules add menu entries (in menu <b>All</b> mostly). If you remove some of these entries by mistake, you can restore them disabling and reenabling the module.
MenuForUsers=Menu for users MenuForUsers=Menu for users
LangFile=.lang file LangFile=.lang file
System=System System=System

View File

@ -331,7 +331,7 @@ ListOfNextSituationInvoices=List of next situation invoices
FrequencyPer_d=Every %s days FrequencyPer_d=Every %s days
FrequencyPer_m=Every %s months FrequencyPer_m=Every %s months
FrequencyPer_y=Every %s years FrequencyPer_y=Every %s years
toolTipFrequency=Examples:<br /><b>Set 7, Day</b>: give a new invoice every 7 days<br /><b>Set 3, Month</b>: give a new invoice every 3 month toolTipFrequency=Examples:<br><b>Set 7, Day</b>: give a new invoice every 7 days<br><b>Set 3, Month</b>: give a new invoice every 3 month
NextDateToExecution=Date for next invoice generation NextDateToExecution=Date for next invoice generation
DateLastGeneration=Date of latest generation DateLastGeneration=Date of latest generation
MaxPeriodNumber=Max nb of invoice generation MaxPeriodNumber=Max nb of invoice generation

View File

@ -844,7 +844,7 @@ Select2NotFound=No result found
Select2Enter=Enter Select2Enter=Enter
Select2MoreCharacter=or more character Select2MoreCharacter=or more character
Select2MoreCharacters=or more characters Select2MoreCharacters=or more characters
Select2MoreCharactersMore=<strong>Search syntax:</strong><br /><kbd><strong> |</strong></kbd><kbd> OR</kbd> (a|b)<br /><kbd><strong>*</strong></kbd><kbd> Any character</kbd> (a*b)<br /><kbd><strong>^</strong></kbd><kbd> Start with</kbd> (^ab)<br /><kbd><strong>$</strong></kbd><kbd> End with</kbd> (ab$)<br /> Select2MoreCharactersMore=<strong>Search syntax:</strong><br><kbd><strong> |</strong></kbd><kbd> OR</kbd> (a|b)<br><kbd><strong>*</strong></kbd><kbd> Any character</kbd> (a*b)<br /><kbd><strong>^</strong></kbd><kbd> Start with</kbd> (^ab)<br /><kbd><strong>$</strong></kbd><kbd> End with</kbd> (ab$)<br />
Select2LoadingMoreResults=Loading more results... Select2LoadingMoreResults=Loading more results...
Select2SearchInProgress=Search in progress... Select2SearchInProgress=Search in progress...
SearchIntoThirdparties=Thirdparties SearchIntoThirdparties=Thirdparties

View File

@ -7,7 +7,7 @@ multicurrency_syncronize_error=Synchronisation error: %s
MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE=Use date of document to find currency rate, instead of using latest known rate MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE=Use date of document to find currency rate, instead of using latest known rate
multicurrency_useOriginTx=When an object is created from another, keep the original rate of source object (otherwise use the latest known rate) multicurrency_useOriginTx=When an object is created from another, keep the original rate of source object (otherwise use the latest known rate)
CurrencyLayerAccount=CurrencyLayer API CurrencyLayerAccount=CurrencyLayer API
CurrencyLayerAccount_help_to_synchronize=You sould create an account on their website to use this functionnality<br />Get your <b>API key</b><br />If you use a free account you can't change the <b>currency source</b> (USD by default)<br />But if your main currency isn't USD you can use the <b>alternate currency source</b> to force you main currency<br /><br />You are limited at 1000 synchronizations per month CurrencyLayerAccount_help_to_synchronize=You sould create an account on their website to use this functionnality<br>Get your <b>API key</b><br />If you use a free account you can't change the <b>currency source</b> (USD by default)<br />But if your main currency isn't USD you can use the <b>alternate currency source</b> to force you main currency<br /><br />You are limited at 1000 synchronizations per month
multicurrency_appId=API key multicurrency_appId=API key
multicurrency_appCurrencySource=Currency source multicurrency_appCurrencySource=Currency source
multicurrency_alternateCurrencySource=Alternate currency source multicurrency_alternateCurrencySource=Alternate currency source

View File

@ -3,7 +3,7 @@ SecurityCode=Security code
NumberingShort=N° NumberingShort=N°
Tools=Tools Tools=Tools
TMenuTools=Tools TMenuTools=Tools
ToolsDesc=All miscellaneous tools not included in other menu entries are collected here.<br /><br />All the tools can be reached in the left menu. ToolsDesc=All miscellaneous tools not included in other menu entries are collected here.<br><br>All the tools can be reached in the left menu.
Birthday=Birthday Birthday=Birthday
BirthdayDate=Birthday date BirthdayDate=Birthday date
DateToBirth=Date of birth DateToBirth=Date of birth
@ -162,9 +162,9 @@ SizeUnitinch=inch
SizeUnitfoot=foot SizeUnitfoot=foot
SizeUnitpoint=point SizeUnitpoint=point
BugTracker=Bug tracker BugTracker=Bug tracker
SendNewPasswordDesc=This form allows you to request a new password. It will be sent to your email address.<br />Change will become effective once you click on the confirmation link in the email.<br />Check your inbox. SendNewPasswordDesc=This form allows you to request a new password. It will be sent to your email address.<br>Change will become effective once you click on the confirmation link in the email.<br />Check your inbox.
BackToLoginPage=Back to login page BackToLoginPage=Back to login page
AuthenticationDoesNotAllowSendNewPassword=Authentication mode is <b>%s</b>.<br />In this mode, Dolibarr can't know nor change your password.<br />Contact your system administrator if you want to change your password. AuthenticationDoesNotAllowSendNewPassword=Authentication mode is <b>%s</b>.<br>In this mode, Dolibarr can't know nor change your password.<br />Contact your system administrator if you want to change your password.
EnableGDLibraryDesc=Install or enable GD library on your PHP installation to use this option. EnableGDLibraryDesc=Install or enable GD library on your PHP installation to use this option.
ProfIdShortDesc=<b>Prof Id %s</b> is an information depending on third party country.<br>For example, for country <b>%s</b>, it's code <b>%s</b>. ProfIdShortDesc=<b>Prof Id %s</b> is an information depending on third party country.<br>For example, for country <b>%s</b>, it's code <b>%s</b>.
DolibarrDemo=Dolibarr ERP/CRM demo DolibarrDemo=Dolibarr ERP/CRM demo

View File

@ -49,7 +49,7 @@ EnhancedValue=Value
PMPValue=Weighted average price PMPValue=Weighted average price
PMPValueShort=WAP PMPValueShort=WAP
EnhancedValueOfWarehouses=Warehouses value EnhancedValueOfWarehouses=Warehouses value
UserWarehouseAutoCreate=Create a warehouse automatically when creating a user UserWarehouseAutoCreate=Create a user warehouse automatically when creating a user
AllowAddLimitStockByWarehouse=Allow to add limit and desired stock per couple (product, warehouse) instead of per product AllowAddLimitStockByWarehouse=Allow to add limit and desired stock per couple (product, warehouse) instead of per product
IndependantSubProductStock=Product stock and subproduct stock are independant IndependantSubProductStock=Product stock and subproduct stock are independant
QtyDispatched=Quantity dispatched QtyDispatched=Quantity dispatched
@ -175,7 +175,7 @@ SelectFournisseur=Supplier filter
inventoryOnDate=Inventory inventoryOnDate=Inventory
INVENTORY_DISABLE_VIRTUAL=Allow to not destock child product from a kit on inventory INVENTORY_DISABLE_VIRTUAL=Allow to not destock child product from a kit on inventory
INVENTORY_USE_MIN_PA_IF_NO_LAST_PA=Use the buy price if no last buy price can be found INVENTORY_USE_MIN_PA_IF_NO_LAST_PA=Use the buy price if no last buy price can be found
INVENTORY_USE_INVENTORY_DATE_FROM_DATEMVT=Stock mouvment have date of inventory INVENTORY_USE_INVENTORY_DATE_FROM_DATEMVT=Stock movement have date of inventory
inventoryChangePMPPermission=Allow to change PMP value for a product inventoryChangePMPPermission=Allow to change PMP value for a product
ColumnNewPMP=New unit PMP ColumnNewPMP=New unit PMP
OnlyProdsInStock=Do not add product without stock OnlyProdsInStock=Do not add product without stock

View File

@ -600,7 +600,7 @@ if (GETPOST('ajoutsujet'))
} }
if ($user->rights->opensurvey->write) { if ($user->rights->opensurvey->write) {
print '<br />'.$langs->trans("PollAdminDesc", img_picto('','delete'), $langs->trans("Add")).'<br>'; print '<br>'.$langs->trans("PollAdminDesc", img_picto('','delete'), $langs->trans("Add")).'<br>';
} }
$nbcolonnes=substr_count($object->sujet,',')+1; $nbcolonnes=substr_count($object->sujet,',')+1;

View File

@ -178,11 +178,11 @@ print '<input type="checkbox" name="mailsonde" '.$cochemail.'> '. $langs->trans(
if ($_SESSION['allow_comments']) $allow_comments = 'checked'; if ($_SESSION['allow_comments']) $allow_comments = 'checked';
if (isset($_POST['allow_comments'])) $allow_comments=GETPOST('allow_comments')?'checked':''; if (isset($_POST['allow_comments'])) $allow_comments=GETPOST('allow_comments')?'checked':'';
print '<input type="checkbox" name="allow_comments" '.$allow_comments.'"> '.$langs->trans('CanComment').'<br />'."\n"; print '<input type="checkbox" name="allow_comments" '.$allow_comments.'"> '.$langs->trans('CanComment').'<br>'."\n";
if ($_SESSION['allow_spy']) $allow_spy = 'checked'; if ($_SESSION['allow_spy']) $allow_spy = 'checked';
if (isset($_POST['allow_spy'])) $allow_spy=GETPOST('allow_spy')?'checked':''; if (isset($_POST['allow_spy'])) $allow_spy=GETPOST('allow_spy')?'checked':'';
print '<input type="checkbox" name="allow_spy" '.$allow_spy.'> '.$langs->trans('CanSeeOthersVote').'<br />'."\n"; print '<input type="checkbox" name="allow_spy" '.$allow_spy.'> '.$langs->trans('CanSeeOthersVote').'<br>'."\n";
if (GETPOST('choix_sondage')) if (GETPOST('choix_sondage'))
{ {

View File

@ -1,12 +1,12 @@
<script type="text/javascript"> <script type="text/javascript">
function save_qty(k) { function save_qty(k) {
var $input = $('input[name="qty_to_add['+k+']"]'); var $input = $('input[name="qty_to_add['+k+']"]');
var fk_det_inventory = $('input[name=det_id_'+k+']').val(); var fk_det_inventory = $('input[name=det_id_'+k+']').val();
var qty = $input.val(); var qty = $input.val();
$('#a_save_qty_'+k).hide(); $('#a_save_qty_'+k).hide();
$.ajax({ $.ajax({
url:"ajax/ajax.inventory.php" url:"ajax/ajax.inventory.php"
,data:{ ,data:{
@ -14,28 +14,28 @@
,'qty': qty ,'qty': qty
,'put':'qty' ,'put':'qty'
} }
}).done(function(data) { }).done(function(data) {
$('#qty_view_'+k).html(data); $('#qty_view_'+k).html(data);
$input.val(0); $input.val(0);
$.jnotify("Quantité ajoutée : "+qty, "mesgs" ); $.jnotify("Quantité ajoutée : "+qty, "mesgs" );
$('#a_save_qty_'+k).show(); $('#a_save_qty_'+k).show();
hide_save_button(); hide_save_button();
}); });
} }
function save_pmp(k) { function save_pmp(k) {
var $input = $('input[name="new_pmp['+k+']"]'); var $input = $('input[name="new_pmp['+k+']"]');
var fk_det_inventory = $('input[name=det_id_'+k+']').val(); var fk_det_inventory = $('input[name=det_id_'+k+']').val();
var pmp = $input.val(); var pmp = $input.val();
$('#a_save_new_pmp_'+k).hide(); $('#a_save_new_pmp_'+k).hide();
$.ajax({ $.ajax({
url:"ajax/ajax.inventory.php" url:"ajax/ajax.inventory.php"
,data:{ ,data:{
@ -43,31 +43,31 @@
,'pmp': pmp ,'pmp': pmp
,'put':'pmp' ,'put':'pmp'
} }
}).done(function(data) { }).done(function(data) {
$input.css({"background-color":"#66ff66"}); $input.css({"background-color":"#66ff66"});
$.jnotify("PMP sauvegardé : "+pmp, "mesgs" ); $.jnotify("PMP sauvegardé : "+pmp, "mesgs" );
$('#a_save_new_pmp_'+k).show(); $('#a_save_new_pmp_'+k).show();
}); });
} }
function hide_save_button() { function hide_save_button() {
var nb = 0; var nb = 0;
$('input[name^="qty_to_add"]').each(function() { $('input[name^="qty_to_add"]').each(function() {
nb += $(this).val(); nb += $(this).val();
}); });
if(nb>0) { if(nb>0) {
$('input[name=modify]').show(); $('input[name=modify]').show();
} }
else{ else{
$('input[name=modify]').hide(); $('input[name=modify]').hide();
} }
} }
</script> </script>
@ -76,37 +76,37 @@
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input type="hidden" name="action" value="add_line" /> <input type="hidden" name="action" value="add_line" />
<input type="hidden" name="id" value="<?php echo $object->id; ?>" /> <input type="hidden" name="id" value="<?php echo $object->id; ?>" />
<?php echo inventorySelectProducts($object); ?> <?php echo inventorySelectProducts($object); ?>
<input class="button" type="submit" value="<?php echo $langs->trans('AddProduct'); ?>" /> <input class="button" type="submit" value="<?php echo $langs->trans('AddProduct'); ?>" />
</form><br> </form><br>
<?php } ?> <?php } ?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<?php if ($view['is_already_validate'] == 1) { ?> <?php if ($view['is_already_validate'] == 1) { ?>
<div class="warning">Cet inventaire est validé</div> <div class="warning">Cet inventaire est validé</div>
<?php } ?> <?php } ?>
<input type="hidden" name="action" value="save" /> <input type="hidden" name="action" value="save" />
<input type="hidden" name="id" value="<?php echo $object->id; ?>" /> <input type="hidden" name="id" value="<?php echo $object->id; ?>" />
<table width="100%" class="noborder workstation"> <table width="100%" class="noborder workstation">
<?php <?php
_headerList($view); _headerList($view);
$total_pmp = $total_pa = $total_pmp_actual = $total_pa_actual =$total_current_pa=$total_current_pa_actual = 0; $total_pmp = $total_pa = $total_pmp_actual = $total_pa_actual =$total_current_pa=$total_current_pa_actual = 0;
$i=1; $i=1;
foreach ($lines as $k=>$row) { foreach ($lines as $k=>$row) {
$total_pmp+=$row['pmp_stock']; $total_pmp+=$row['pmp_stock'];
$total_pa+=$row['pa_stock']; $total_pa+=$row['pa_stock'];
$total_pmp_actual+=$row['pmp_actual']; $total_pmp_actual+=$row['pmp_actual'];
$total_pa_actual+=$row['pa_actual']; $total_pa_actual+=$row['pa_actual'];
if($i%20 === 0) if($i%20 === 0)
{ {
_headerList($view); _headerList($view);
@ -126,18 +126,18 @@
if(!empty($conf->global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA)){ if(!empty($conf->global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA)){
echo '<td align="right" style="background-color: #e8e8ff;">'.price($row['current_pa_stock']).'</td>'; echo '<td align="right" style="background-color: #e8e8ff;">'.price($row['current_pa_stock']).'</td>';
$total_current_pa+=$row['current_pa_stock']; $total_current_pa+=$row['current_pa_stock'];
} }
?> ?>
<?php } ?> <?php } ?>
<td align="center"><?php echo $row['qty']; ?>&nbsp;&nbsp;<span id="qty_view_<?php echo $row['k']; ?>"><?php echo $row['qty_view']; ?></span> <td align="center"><?php echo $row['qty']; ?>&nbsp;&nbsp;<span id="qty_view_<?php echo $row['k']; ?>"><?php echo $row['qty_view']; ?></span>
<input type="hidden" name="det_id_<?php echo $row['k']; ?>" value="<?php echo $row['id']; ?>" /> <input type="hidden" name="det_id_<?php echo $row['k']; ?>" value="<?php echo $row['id']; ?>" />
</td> </td>
<?php if ($can_validate == 1) { ?> <?php if ($can_validate == 1) { ?>
<td align="right"><?php echo price($row['pmp_actual']); ?></td> <td align="right"><?php echo price($row['pmp_actual']); ?></td>
<?php <?php
if(!empty($user->rights->stock->changePMP)) { if(!empty($user->rights->stock->changePMP)) {
echo '<td align="right">'.$row['pmp_new'].'</td>'; echo '<td align="right">'.$row['pmp_new'].'</td>';
} }
?> ?>
<td align="right"><?php echo price($row['pa_actual']); ?></td> <td align="right"><?php echo price($row['pa_actual']); ?></td>
@ -145,8 +145,8 @@
if(!empty($conf->global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA)){ if(!empty($conf->global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA)){
echo '<td align="right">'.price($row['current_pa_actual']).'</td>'; echo '<td align="right">'.price($row['current_pa_actual']).'</td>';
$total_current_pa_actual+=$row['current_pa_actual']; $total_current_pa_actual+=$row['current_pa_actual'];
} }
?> ?>
<td align="center"><?php echo $row['qty_regulated']; ?></td> <td align="center"><?php echo $row['qty_regulated']; ?></td>
<?php } ?> <?php } ?>
@ -154,25 +154,25 @@
<td align="center" width="20%"><?php echo $row['action']; ?></td> <td align="center" width="20%"><?php echo $row['action']; ?></td>
<?php } ?> <?php } ?>
</tr> </tr>
<?php $i++; <?php $i++;
} }
_footerList($view,$total_pmp,$total_pmp_actual,$total_pa,$total_pa_actual, $total_current_pa,$total_current_pa_actual); _footerList($view,$total_pmp,$total_pmp_actual,$total_pa,$total_pa_actual, $total_current_pa,$total_current_pa_actual);
?> ?>
</table> </table>
<?php if ($object->status != 1) { ?> <?php if ($object->status != 1) { ?>
<div class="tabsAction" style="height:30px;"> <div class="tabsAction" style="height:30px;">
<?php if ($action!= 'edit') { ?> <?php if ($action!= 'edit') { ?>
<!-- <a href="<?php echo $view_url; ?>?id=<?php echo $object->id; ?>&action=exportCSV" class="butAction"><?php echo $langs->trans('ExportCSV') ?></a> --> <!-- <a href="<?php echo $view_url; ?>?id=<?php echo $object->id; ?>&action=exportCSV" class="butAction"><?php echo $langs->trans('ExportCSV') ?></a> -->
<a href="<?php echo $view_url; ?>?id=<?php echo $object->id; ?>&action=edit" class="butAction"><?php echo $langs->trans('Modify') ?></a> <a href="<?php echo $view_url; ?>?id=<?php echo $object->id; ?>&action=edit" class="butAction"><?php echo $langs->trans('Modify') ?></a>
<?php <?php
if(!empty($user->rights->stock->changePMP)) { if(!empty($user->rights->stock->changePMP)) {
echo '<a href="'.$view_url.'?id='.$object->id.'&action=changePMP" class="butAction">'.$langs->trans('ApplyPMP').'</a>'; echo '<a href="'.$view_url.'?id='.$object->id.'&action=changePMP" class="butAction">'.$langs->trans('ApplyPMP').'</a>';
} }
if ($can_validate == 1) { ?> if ($can_validate == 1) { ?>
<a href="<?php echo $view_url; ?>?id=<?php echo $object->id; ?>&action=regulate&token=" class="butAction"><?php echo $langs->trans('RegulateStock') ?></a> <a href="<?php echo $view_url; ?>?id=<?php echo $object->id; ?>&action=regulate&token=" class="butAction"><?php echo $langs->trans('RegulateStock') ?></a>
<?php } ?> <?php } ?>
@ -193,13 +193,13 @@
<!-- <a href="<?php echo $view_url; ?>?id=<?php echo $object->id; ?>&action=exportCSV" class="butAction"><?php echo $langs->trans('ExportCSV') ?></a> --> <!-- <a href="<?php echo $view_url; ?>?id=<?php echo $object->id; ?>&action=exportCSV" class="butAction"><?php echo $langs->trans('ExportCSV') ?></a> -->
<a href="#" title="<?php echo $langs->trans('InventoryAlreadyValidated'); ?>" class="butActionRefused"><?php echo $langs->trans('Delete') ?></a> <a href="#" title="<?php echo $langs->trans('InventoryAlreadyValidated'); ?>" class="butActionRefused"><?php echo $langs->trans('Delete') ?></a>
<?php } ?> <?php } ?>
</div> </div>
<?php } ?> <?php } ?>
</form> </form>
<p>Date de création : <?php echo $object->getDate('datec') ?> <p>Date de création : <?php echo $object->getDate('datec') ?>
<br />Dernière mise à jour : <?php echo $object->getDate('tms') ?></p> <br>Dernière mise à jour : <?php echo $object->getDate('tms') ?></p>

View File

@ -38,13 +38,13 @@ class MouvementStock extends CommonObject
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */
public $table_element = 'stock_mouvement'; public $table_element = 'stock_mouvement';
public $product_id; public $product_id;
public $warehouse_id; public $warehouse_id;
public $qty; public $qty;
public $type; public $type;
public $tms = ''; public $tms = '';
public $datem = ''; public $datem = '';
public $price; public $price;
@ -54,8 +54,8 @@ class MouvementStock extends CommonObject
public $origintype; public $origintype;
public $inventorycode; public $inventorycode;
public $batch; public $batch;
/** /**
* Constructor * Constructor
@ -67,7 +67,7 @@ class MouvementStock extends CommonObject
$this->db = $db; $this->db = $db;
} }
/** /**
* Add a movement of stock (in one direction only) * Add a movement of stock (in one direction only)
* *
@ -173,7 +173,7 @@ class MouvementStock extends CommonObject
{ {
$tmparray=dol_getdate($eatby, true); $tmparray=dol_getdate($eatby, true);
$eatbywithouthour=dol_mktime(0, 0, 0, $tmparray['mon'], $tmparray['mday'], $tmparray['year']); $eatbywithouthour=dol_mktime(0, 0, 0, $tmparray['mon'], $tmparray['mday'], $tmparray['year']);
if ($this->db->jdate($obj->eatby) != $eatby && $this->db->jdate($obj->eatby) != $eatbywithouthour) // We test date without hours and with hours for backward compatibility if ($this->db->jdate($obj->eatby) != $eatby && $this->db->jdate($obj->eatby) != $eatbywithouthour) // We test date without hours and with hours for backward compatibility
{ {
// If found and eatby/sellby defined into table and provided and differs, return error // If found and eatby/sellby defined into table and provided and differs, return error
$this->errors[]=$langs->trans("ThisSerialAlreadyExistWithDifferentDate", $batch, dol_print_date($this->db->jdate($obj->eatby), 'dayhour'), dol_print_date($eatby, 'dayhour')); $this->errors[]=$langs->trans("ThisSerialAlreadyExistWithDifferentDate", $batch, dol_print_date($this->db->jdate($obj->eatby), 'dayhour'), dol_print_date($eatby, 'dayhour'));
@ -201,7 +201,7 @@ class MouvementStock extends CommonObject
$this->errors = $productlot->errors; $this->errors = $productlot->errors;
$this->db->rollback(); $this->db->rollback();
return -5; return -5;
} }
} }
} }
if ($obj->sellby) if ($obj->sellby)
@ -241,7 +241,7 @@ class MouvementStock extends CommonObject
} }
} }
} }
$i++; $i++;
} }
} }
@ -270,7 +270,7 @@ class MouvementStock extends CommonObject
return -1; return -1;
} }
} }
// Define if we must make the stock change (If product type is a service or if stock is used also for services) // Define if we must make the stock change (If product type is a service or if stock is used also for services)
$movestock=0; $movestock=0;
if ($product->type != Product::TYPE_SERVICE || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) $movestock=1; if ($product->type != Product::TYPE_SERVICE || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) $movestock=1;
@ -297,7 +297,7 @@ class MouvementStock extends CommonObject
$this->errors[] = $langs->trans('qtyToTranferLotIsNotEnough'); $this->errors[] = $langs->trans('qtyToTranferLotIsNotEnough');
$this->db->rollback(); $this->db->rollback();
return -8; return -8;
} }
} }
else else
{ {
@ -310,8 +310,8 @@ class MouvementStock extends CommonObject
return -8; return -8;
} }
} }
} }
if ($movestock && $entrepot_id > 0) // Change stock for current product, change for subproduct is done after if ($movestock && $entrepot_id > 0) // Change stock for current product, change for subproduct is done after
{ {
if(!empty($this->origin)) { // This is set by caller for tracking reason if(!empty($this->origin)) { // This is set by caller for tracking reason
@ -467,7 +467,7 @@ class MouvementStock extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."product as p SET pmp = ".$newpmp.", "; $sql = "UPDATE ".MAIN_DB_PREFIX."product as p SET pmp = ".$newpmp.", ";
$sql.= " stock=(SELECT SUM(ps.reel) FROM ".MAIN_DB_PREFIX."product_stock as ps WHERE ps.fk_product = p.rowid)"; $sql.= " stock=(SELECT SUM(ps.reel) FROM ".MAIN_DB_PREFIX."product_stock as ps WHERE ps.fk_product = p.rowid)";
$sql.= " WHERE rowid = ".$fk_product; $sql.= " WHERE rowid = ".$fk_product;
dol_syslog(get_class($this)."::_create update AWP", LOG_DEBUG); dol_syslog(get_class($this)."::_create update AWP", LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if (! $resql) if (! $resql)
@ -476,7 +476,7 @@ class MouvementStock extends CommonObject
$error = -4; $error = -4;
} }
} }
// If stock is now 0, we can remove entry into llx_product_stock, but only if there is no child lines into llx_product_batch (detail of batch, because we can imagine // If stock is now 0, we can remove entry into llx_product_stock, but only if there is no child lines into llx_product_batch (detail of batch, because we can imagine
// having a lot1/qty=X and lot2/qty=-X, so 0 but we must not loose repartition of different lot. // having a lot1/qty=X and lot2/qty=-X, so 0 but we must not loose repartition of different lot.
$sql="DELETE FROM ".MAIN_DB_PREFIX."product_stock WHERE reel = 0 AND rowid NOT IN (SELECT fk_product_stock FROM ".MAIN_DB_PREFIX."product_batch as pb)"; $sql="DELETE FROM ".MAIN_DB_PREFIX."product_stock WHERE reel = 0 AND rowid NOT IN (SELECT fk_product_stock FROM ".MAIN_DB_PREFIX."product_batch as pb)";
@ -511,7 +511,7 @@ class MouvementStock extends CommonObject
} }
} }
/** /**
* Load object in memory from the database * Load object in memory from the database
@ -523,7 +523,7 @@ class MouvementStock extends CommonObject
public function fetch($id) public function fetch($id)
{ {
dol_syslog(__METHOD__, LOG_DEBUG); dol_syslog(__METHOD__, LOG_DEBUG);
$sql = 'SELECT'; $sql = 'SELECT';
$sql .= ' t.rowid,'; $sql .= ' t.rowid,';
$sql .= " t.tms,"; $sql .= " t.tms,";
@ -548,20 +548,20 @@ class MouvementStock extends CommonObject
//} else { //} else {
$sql .= ' AND t.rowid = ' . $id; $sql .= ' AND t.rowid = ' . $id;
//} //}
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) { if ($resql) {
$numrows = $this->db->num_rows($resql); $numrows = $this->db->num_rows($resql);
if ($numrows) { if ($numrows) {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->product_id = $obj->fk_product; $this->product_id = $obj->fk_product;
$this->warehouse_id = $obj->fk_entrepot; $this->warehouse_id = $obj->fk_entrepot;
$this->qty = $obj->value; $this->qty = $obj->value;
$this->type = $obj->type_mouvement; $this->type = $obj->type_mouvement;
$this->tms = $this->db->jdate($obj->tms); $this->tms = $this->db->jdate($obj->tms);
$this->datem = $this->db->jdate($obj->datem); $this->datem = $this->db->jdate($obj->datem);
$this->price = $obj->price; $this->price = $obj->price;
@ -574,18 +574,18 @@ class MouvementStock extends CommonObject
$this->eatby = $this->db->jdate($obj->eatby); $this->eatby = $this->db->jdate($obj->eatby);
$this->sellby = $this->db->jdate($obj->sellby); $this->sellby = $this->db->jdate($obj->sellby);
} }
// Retrieve all extrafields for invoice // Retrieve all extrafields for invoice
// fetch optionals attributes and labels // fetch optionals attributes and labels
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields=new ExtraFields($this->db); $extrafields=new ExtraFields($this->db);
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
$this->fetch_optionals($this->id,$extralabels); $this->fetch_optionals($this->id,$extralabels);
// $this->fetch_lines(); // $this->fetch_lines();
$this->db->free($resql); $this->db->free($resql);
if ($numrows) { if ($numrows) {
return 1; return 1;
} else { } else {
@ -594,13 +594,13 @@ class MouvementStock extends CommonObject
} else { } else {
$this->errors[] = 'Error ' . $this->db->lasterror(); $this->errors[] = 'Error ' . $this->db->lasterror();
dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR); dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
return - 1; return - 1;
} }
} }
/** /**
* Create movement in database for all subproducts * Create movement in database for all subproducts
@ -675,7 +675,7 @@ class MouvementStock extends CommonObject
function livraison($user, $fk_product, $entrepot_id, $qty, $price=0, $label='', $datem='', $eatby='', $sellby='', $batch='', $id_product_batch=0) function livraison($user, $fk_product, $entrepot_id, $qty, $price=0, $label='', $datem='', $eatby='', $sellby='', $batch='', $id_product_batch=0)
{ {
global $conf; global $conf;
$skip_batch = empty($conf->productbatch->enabled); $skip_batch = empty($conf->productbatch->enabled);
return $this->_create($user, $fk_product, $entrepot_id, (0 - $qty), 2, $price, $label, '', $datem, $eatby, $sellby, $batch, $skip_batch, $id_product_batch); return $this->_create($user, $fk_product, $entrepot_id, (0 - $qty), 2, $price, $label, '', $datem, $eatby, $sellby, $batch, $skip_batch, $id_product_batch);
@ -756,7 +756,7 @@ class MouvementStock extends CommonObject
/** /**
* Create or update batch record (update table llx_product_batch). No check is done here, done by parent. * Create or update batch record (update table llx_product_batch). No check is done here, done by parent.
* *
* @param array|int $dluo Could be either * @param array|int $dluo Could be either
* - int if row id of product_batch table * - int if row id of product_batch table
* - or complete array('fk_product_stock'=>, 'batchnumber'=>) * - or complete array('fk_product_stock'=>, 'batchnumber'=>)
* @param int $qty Quantity of product with batch number. May be a negative amount. * @param int $qty Quantity of product with batch number. May be a negative amount.
@ -765,13 +765,13 @@ class MouvementStock extends CommonObject
private function createBatch($dluo, $qty) private function createBatch($dluo, $qty)
{ {
global $user; global $user;
$pdluo=new Productbatch($this->db); $pdluo=new Productbatch($this->db);
$result=0; $result=0;
// Try to find an existing record with same batch number or id // Try to find an existing record with same batch number or id
if (is_numeric($dluo)) if (is_numeric($dluo))
{ {
$result=$pdluo->fetch($dluo); $result=$pdluo->fetch($dluo);
if (empty($pdluo->id)) if (empty($pdluo->id))
@ -782,21 +782,21 @@ class MouvementStock extends CommonObject
$result = -2; $result = -2;
} }
} }
else if (is_array($dluo)) else if (is_array($dluo))
{ {
if (isset($dluo['fk_product_stock'])) if (isset($dluo['fk_product_stock']))
{ {
$vfk_product_stock=$dluo['fk_product_stock']; $vfk_product_stock=$dluo['fk_product_stock'];
$vbatchnumber = $dluo['batchnumber']; $vbatchnumber = $dluo['batchnumber'];
$result = $pdluo->find($vfk_product_stock,'','',$vbatchnumber); // Search on batch number only (eatby and sellby are deprecated here) $result = $pdluo->find($vfk_product_stock,'','',$vbatchnumber); // Search on batch number only (eatby and sellby are deprecated here)
} }
else else
{ {
dol_syslog(get_class($this)."::createBatch array param dluo must contain at least key fk_product_stock".$error, LOG_ERR); dol_syslog(get_class($this)."::createBatch array param dluo must contain at least key fk_product_stock".$error, LOG_ERR);
$result = -1; $result = -1;
} }
} }
else else
{ {
dol_syslog(get_class($this)."::createBatch error invalid param dluo".$error, LOG_ERR); dol_syslog(get_class($this)."::createBatch error invalid param dluo".$error, LOG_ERR);
@ -810,7 +810,7 @@ class MouvementStock extends CommonObject
{ {
//print "Avant ".$pdluo->qty." Apres ".($pdluo->qty + $qty)."<br>"; //print "Avant ".$pdluo->qty." Apres ".($pdluo->qty + $qty)."<br>";
$pdluo->qty += $qty; $pdluo->qty += $qty;
if ($pdluo->qty == 0) if ($pdluo->qty == 0)
{ {
$result=$pdluo->delete($user,1); $result=$pdluo->delete($user,1);
} else { } else {
@ -824,7 +824,7 @@ class MouvementStock extends CommonObject
$pdluo->eatby = $veatby; $pdluo->eatby = $veatby;
$pdluo->sellby = $vsellby; $pdluo->sellby = $vsellby;
$pdluo->batch = $vbatchnumber; $pdluo->batch = $vbatchnumber;
$result=$pdluo->create($user,1); $result=$pdluo->create($user,1);
if ($result < 0) if ($result < 0)
{ {
@ -833,21 +833,21 @@ class MouvementStock extends CommonObject
} }
} }
} }
return $result; return $result;
} }
/** /**
* Return Url link of origin object * Return Url link of origin object
* *
* @param int $fk_origin Id origin * @param int $fk_origin Id origin
* @param int $origintype Type origin * @param int $origintype Type origin
* @return string * @return string
*/ */
function get_origin($fk_origin, $origintype) function get_origin($fk_origin, $origintype)
{ {
$origin=''; $origin='';
switch ($origintype) { switch ($origintype) {
case 'commande': case 'commande':
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
@ -888,20 +888,20 @@ class MouvementStock extends CommonObject
} }
if (empty($origin) || ! is_object($origin)) return ''; if (empty($origin) || ! is_object($origin)) return '';
if ($origin->fetch($fk_origin) > 0) { if ($origin->fetch($fk_origin) > 0) {
return $origin->getNomUrl(1); return $origin->getNomUrl(1);
} }
return ''; return '';
} }
/** /**
* Set attribute origin to object * Set attribute origin to object
* *
* @param string $origin_element type of element * @param string $origin_element type of element
* @param int $origin_id id of element * @param int $origin_id id of element
* *
* @return void * @return void
*/ */
function setOrigin($origin_element, $origin_id) function setOrigin($origin_element, $origin_id)
@ -940,7 +940,7 @@ class MouvementStock extends CommonObject
// There is no specific properties. All data into insert are provided as method parameter. // There is no specific properties. All data into insert are provided as method parameter.
} }
/** /**
* Return a link (with optionaly the picto) * Return a link (with optionaly the picto)
* Use this->id,this->lastname, this->firstname * Use this->id,this->lastname, this->firstname
@ -962,7 +962,7 @@ class MouvementStock extends CommonObject
$label = '<u>' . $langs->trans("Movement") . ' '.$this->id.'</u>'; $label = '<u>' . $langs->trans("Movement") . ' '.$this->id.'</u>';
$label.= '<div width="100%">'; $label.= '<div width="100%">';
$label.= '<b>' . $langs->trans('Label') . ':</b> ' . $this->label; $label.= '<b>' . $langs->trans('Label') . ':</b> ' . $this->label;
$label.= '<br /><b>' . $langs->trans('Qty') . ':</b> ' .$this->qty; $label.= '<br><b>' . $langs->trans('Qty') . ':</b> ' .$this->qty;
$label.= '</div>'; $label.= '</div>';
$link = '<a href="'.DOL_URL_ROOT.'/product/stock/mouvement.php?id='.$this->warehouse_id.'&msid='.$this->id.'"'; $link = '<a href="'.DOL_URL_ROOT.'/product/stock/mouvement.php?id='.$this->warehouse_id.'&msid='.$this->id.'"';
@ -978,7 +978,7 @@ class MouvementStock extends CommonObject
$result.= $link . $this->id . $linkend; $result.= $link . $this->id . $linkend;
return $result; return $result;
} }
/** /**
* Return label statut * Return label statut
* *
@ -989,7 +989,7 @@ class MouvementStock extends CommonObject
{ {
return $this->LibStatut($mode); return $this->LibStatut($mode);
} }
/** /**
* Renvoi le libelle d'un status donne * Renvoi le libelle d'un status donne
* *

View File

@ -946,7 +946,6 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE))
{ {
print '<br><br>'; print '<br><br>';
print_titre($langs->trans('AddNewProductStockWarehouse')); print_titre($langs->trans('AddNewProductStockWarehouse'));
//print '<br />';
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="action" value="addlimitstockwarehouse">'; print '<input type="hidden" name="action" value="addlimitstockwarehouse">';

View File

@ -195,7 +195,7 @@ function constructGanttLine($tarr,$task,$project_dependencies,$level=0,$project_
<dt>pGroup</dt><dd>(optional) indicates whether this is a group task (parent) - Numeric; 0 = normal task, 1 = standard group task, 2 = combined group task<a href='#combinedtasks' class="footnote">*</a></dd> <dt>pGroup</dt><dd>(optional) indicates whether this is a group task (parent) - Numeric; 0 = normal task, 1 = standard group task, 2 = combined group task<a href='#combinedtasks' class="footnote">*</a></dd>
<dt>pParent</dt><dd>(required) identifies a parent pID, this causes this task to be a child of identified task. Numeric, top level tasks should have pParent set to 0</dd> <dt>pParent</dt><dd>(required) identifies a parent pID, this causes this task to be a child of identified task. Numeric, top level tasks should have pParent set to 0</dd>
<dt>pOpen</dt><dd>(required) indicates whether a standard group task is open when chart is first drawn. Value must be set for all items but is only used by standard group tasks. Numeric, 1 = open, 0 = closed</dd> <dt>pOpen</dt><dd>(required) indicates whether a standard group task is open when chart is first drawn. Value must be set for all items but is only used by standard group tasks. Numeric, 1 = open, 0 = closed</dd>
<dt>pDepend</dt><dd>(optional) comma separated list of id&#39;s this task is dependent on. A line will be drawn from each listed task to this item<br />Each id can optionally be followed by a dependency type suffix. Valid values are:<blockquote>'FS' - Finish to Start (default if suffix is omitted)<br />'SF' - Start to Finish<br />'SS' - Start to Start<br />'FF' - Finish to Finish</blockquote>If present the suffix must be added directly to the id e.g. '123SS'</dd> <dt>pDepend</dt><dd>(optional) comma separated list of id&#39;s this task is dependent on. A line will be drawn from each listed task to this item<br>Each id can optionally be followed by a dependency type suffix. Valid values are:<blockquote>'FS' - Finish to Start (default if suffix is omitted)<br />'SF' - Start to Finish<br />'SS' - Start to Start<br />'FF' - Finish to Finish</blockquote>If present the suffix must be added directly to the id e.g. '123SS'</dd>
<dt>pCaption</dt><dd>(optional) caption that will be added after task bar if CaptionType set to "Caption"</dd> <dt>pCaption</dt><dd>(optional) caption that will be added after task bar if CaptionType set to "Caption"</dd>
<dt>pNotes</dt><dd>(optional) Detailed task information that will be displayed in tool tip for this task</dd> <dt>pNotes</dt><dd>(optional) Detailed task information that will be displayed in tool tip for this task</dd>
<dt>pGantt</dt><dd>(required) javascript JSGantt.GanttChart object from which to take settings. Defaults to &quot;g&quot; for backwards compatibility</dd> <dt>pGantt</dt><dd>(required) javascript JSGantt.GanttChart object from which to take settings. Defaults to &quot;g&quot; for backwards compatibility</dd>

View File

@ -238,13 +238,13 @@ else
} }
} }
$morehtmlref.='</div>'; $morehtmlref.='</div>';
dol_banner_tab($act, 'element_id', $linkback, ($user->societe_id?0:1), 'id', 'ref', $morehtmlref, '&element='.$element, 0, '', ''); dol_banner_tab($act, 'element_id', $linkback, ($user->societe_id?0:1), 'id', 'ref', $morehtmlref, '&element='.$element, 0, '', '');
print '<div class="fichecenter">'; print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Type // Type
@ -315,7 +315,7 @@ else
print '</table>'; print '</table>';
print '</div>'; print '</div>';
dol_fiche_end(); dol_fiche_end();
} }
} }
@ -364,16 +364,16 @@ else
$fichinter = new Fichinter($db); $fichinter = new Fichinter($db);
$fichinter->fetch($element_id, $element_ref); $fichinter->fetch($element_id, $element_ref);
$fichinter->fetch_thirdparty(); $fichinter->fetch_thirdparty();
if (is_object($fichinter)) if (is_object($fichinter))
{ {
$head=fichinter_prepare_head($fichinter); $head=fichinter_prepare_head($fichinter);
dol_fiche_head($head, 'resource', $langs->trans("InterventionCard"), -1, 'intervention'); dol_fiche_head($head, 'resource', $langs->trans("InterventionCard"), -1, 'intervention');
// Intervention card // Intervention card
$linkback = '<a href="'.DOL_URL_ROOT.'/fichinter/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/fichinter/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
$morehtmlref='<div class="refidno">'; $morehtmlref='<div class="refidno">';
// Ref customer // Ref customer
//$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); //$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
@ -414,9 +414,9 @@ else
} }
} }
$morehtmlref.='</div>'; $morehtmlref.='</div>';
dol_banner_tab($fichinter, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '&element='.$element, 0, '', '', 1); dol_banner_tab($fichinter, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '&element='.$element, 0, '', '', 1);
dol_fiche_end(); dol_fiche_end();
} }
} }
@ -440,7 +440,7 @@ else
{ {
$element_prop = getElementProperties($resource_obj); $element_prop = getElementProperties($resource_obj);
//print '/'.$modresources.'/class/'.$resource_obj.'.class.php<br />'; //print '/'.$modresources.'/class/'.$resource_obj.'.class.php<br>';
$path = ''; $path = '';
if(strpos($resource_obj,'@')) if(strpos($resource_obj,'@'))