2
0
forked from Wavyzz/dolibarr

Fix look and feel v22 (must use formconsumeproduce for action form)

This commit is contained in:
ldestailleur
2025-08-09 13:14:48 +02:00
parent 9cbeff83a4
commit e33ae1afef
6 changed files with 20 additions and 22 deletions

View File

@@ -2861,9 +2861,10 @@ function dol_fiche_head($links = array(), $active = '0', $title = '', $notab = 0
* @param int $limittoshow Limit number of tabs to show. Use 0 to use automatic default value. * @param int $limittoshow Limit number of tabs to show. Use 0 to use automatic default value.
* @param string $moretabssuffix A suffix to use when you have several dol_get_fiche_head() in same page * @param string $moretabssuffix A suffix to use when you have several dol_get_fiche_head() in same page
* @param int $dragdropfile 0 (default) or 1. 1 enable a drop zone for file to be upload, 0 disable it * @param int $dragdropfile 0 (default) or 1. 1 enable a drop zone for file to be upload, 0 disable it
* @param string $morecssdiv More CSS on the div
* @return string * @return string
*/ */
function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab = 0, $picto = '', $pictoisfullpath = 0, $morehtmlright = '', $morecss = '', $limittoshow = 0, $moretabssuffix = '', $dragdropfile = 0) function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab = 0, $picto = '', $pictoisfullpath = 0, $morehtmlright = '', $morecss = '', $limittoshow = 0, $moretabssuffix = '', $dragdropfile = 0, $morecssdiv = '')
{ {
global $conf, $langs, $hookmanager; global $conf, $langs, $hookmanager;
@@ -3024,6 +3025,7 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
if (!$notab || $notab == -1 || $notab == -2 || $notab == -3 || $notab == -4) { if (!$notab || $notab == -1 || $notab == -2 || $notab == -3 || $notab == -4) {
$out .= "\n".'<div id="dragDropAreaTabBar" class="tabBar'.($notab == -1 ? '' : ($notab == -2 ? ' tabBarNoTop' : ((($notab == -3 || $notab == -4) ? ' noborderbottom' : '').($notab == -4 ? '' : ' tabBarWithBottom')))); $out .= "\n".'<div id="dragDropAreaTabBar" class="tabBar'.($notab == -1 ? '' : ($notab == -2 ? ' tabBarNoTop' : ((($notab == -3 || $notab == -4) ? ' noborderbottom' : '').($notab == -4 ? '' : ' tabBarWithBottom'))));
$out .= ($morecssdiv ? ' '.$morecssdiv : '');
$out .= '">'."\n"; $out .= '">'."\n";
} }
if (!empty($dragdropfile)) { if (!empty($dragdropfile)) {

View File

@@ -899,36 +899,27 @@ if ($order_id > 0 || !empty($ref)) {
print '<input type="hidden" name="origin" value="commande">'; print '<input type="hidden" name="origin" value="commande">';
print '<input type="hidden" name="origin_id" value="'.$object->id.'">'; print '<input type="hidden" name="origin_id" value="'.$object->id.'">';
print '<input type="hidden" name="projectid" value="'.$object->fk_project.'">'; print '<input type="hidden" name="projectid" value="'.$object->fk_project.'">';
//print '<table class="border centpercent">';
$langs->load("stocks"); $langs->load("stocks");
//print '<tr>'; print '<div class="center formconsumeproduce">';
if (isModEnabled('stock')) { if (isModEnabled('stock')) {
//print '<td>';
print $langs->trans("WarehouseSource"); print $langs->trans("WarehouseSource");
//print '</td>'; print $formproduct->selectWarehouses(empty($object->warehouse_id) ? 'ifone' : $object->warehouse_id, 'entrepot_id', '', 1, 0, 0, $langs->trans("Any"), 0, 0, array(), 'minwidth200');
//print '<td>';
print $formproduct->selectWarehouses(!empty($object->warehouse_id) ? $object->warehouse_id : 'ifone', 'entrepot_id', '', 1, 0, 0, '', 0, 0, array(), 'minwidth200');
if (count($formproduct->cache_warehouses) <= 0) { if (count($formproduct->cache_warehouses) <= 0) {
print ' &nbsp; '.$langs->trans("WarehouseSourceNotDefined").' <a href="'.DOL_URL_ROOT.'/product/stock/card.php?action=create">'.$langs->trans("AddOne").'</a>'; print ' &nbsp; '.$langs->trans("WarehouseSourceNotDefined").' <a href="'.DOL_URL_ROOT.'/product/stock/card.php?action=create">'.$langs->trans("AddOne").'</a>';
} }
//print '</td>';
} }
//print '<td class="center">'; print '<input type="submit" class="butAction marginbottomonly margintoponly" name="save" value="'.$langs->trans("CreateShipment").'">';
print '<input type="submit" class="butAction" named="save" value="'.$langs->trans("CreateShipment").'">';
if ($toBeShippedTotal <= 0) { if ($toBeShippedTotal <= 0) {
print ' '.img_warning($langs->trans("WarningNoQtyLeftToSend")); print ' '.img_warning($langs->trans("WarningNoQtyLeftToSend"));
} }
//print '</td></tr>'; print '<br><br>';
print '</div>';
//print "</table>";
print "</form>\n"; print "</form>\n";
print '</div>'; print '</div>';
$somethingshown = 1;
} else { } else {
print '<div class="tabsAction">'; print '<div class="tabsAction">';
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans("CreateShipment").'</a>'; print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans("CreateShipment").'</a>';

View File

@@ -1367,3 +1367,4 @@ ClickOnPlusToCreateOne=Click the "Plus" button to add one.
Free=Free Free=Free
ShowAsConversation=Show as conversation list ShowAsConversation=Show as conversation list
MessageListViewType=Show as table list MessageListViewType=Show as table list
Any=Any

View File

@@ -283,10 +283,10 @@ class FormProduct
* 'warehouseopen' = select products from open warehouses, * 'warehouseopen' = select products from open warehouses,
* 'warehouseclosed' = select products from closed warehouses, * 'warehouseclosed' = select products from closed warehouses,
* 'warehouseinternal' = select products from warehouses for internal correct/transfer only * 'warehouseinternal' = select products from warehouses for internal correct/transfer only
* @param int<0,1> $empty 1=Can be empty, 0 if not * @param int<0,1>|string $empty Use 1 or 'label'=Can be empty, 0 if not
* @param int<0,1> $disabled 1=Select is disabled * @param int<0,1> $disabled 1=Select is disabled
* @param int $fk_product Add quantity of stock in label for product with id fk_product. Nothing if 0. * @param int $fk_product Add quantity of stock in label for product with id fk_product. Nothing if 0.
* @param string $empty_label Empty label if needed (only if $empty=1) * @param string $empty_label Empty label if needed (deprecated, set the label into the field $empty)
* @param int<0,1> $showstock 1=Show stock count * @param int<0,1> $showstock 1=Show stock count
* @param int<0,1> $forcecombo 1=Force combo iso ajax select2 * @param int<0,1> $forcecombo 1=Force combo iso ajax select2
* @param array<array{method:string,url:string,htmlname:string,params:array<string,string>}> $events Events to add to select2 * @param array<array{method:string,url:string,htmlname:string,params:array<string,string>}> $events Events to add to select2
@@ -341,7 +341,7 @@ class FormProduct
//$out .= ' placeholder="todo"'; // placeholder for select2 must be added by setting the id+placeholder js param when calling select2 //$out .= ' placeholder="todo"'; // placeholder for select2 must be added by setting the id+placeholder js param when calling select2
$out .= '>'; $out .= '>';
if ($empty) { if ($empty) {
$out .= '<option value="-1">'.($empty_label ? $empty_label : '&nbsp;').'</option>'; $out .= '<option value="-1">'.(is_numeric($empty) ? ($empty_label ? $empty_label : '&nbsp;') : $empty).'</option>';
} }
foreach ($this->cache_warehouses as $id => $arraytypes) { foreach ($this->cache_warehouses as $id => $arraytypes) {
$label = ''; $label = '';

View File

@@ -46,7 +46,7 @@ if (empty($conf) || !is_object($conf)) {
?> ?>
<!-- BEGIN PHP TEMPLATE STOCKCORRECTION.TPL.PHP --> <!-- BEGIN PHP TEMPLATE PRODUCT/STOCK/TPL/STOCKCORRECTION.TPL.PHP -->
<?php <?php
$productref = ''; $productref = '';
@@ -148,7 +148,7 @@ print load_fiche_titre($langs->trans("StockCorrection"), '', 'generic');
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="post">'."\n"; print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="post">'."\n";
print dol_get_fiche_head(); print dol_get_fiche_head(array(), '', '', 0, '', 0, '', '', 0, '', 0, 'marginbottomonly');
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="correct_stock">'; print '<input type="hidden" name="action" value="correct_stock">';
@@ -277,6 +277,8 @@ print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">'; print '<input type="submit" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
print '</div>'; print '</div>';
print '<br>';
print '</form>'; print '</form>';
?> ?>
<!-- END PHP STOCKCORRECTION.TPL.PHP --> <!-- END PHP STOCKCORRECTION.TPL.PHP -->

View File

@@ -45,7 +45,7 @@ if (empty($conf) || !is_object($conf)) {
?> ?>
<!-- BEGIN PHP TEMPLATE STOCKTRANSFER.TPL.PHP --> <!-- BEGIN PHP TEMPLATE PRODUCT/STOCK/TPL/STOCKTRANSFER.TPL.PHP -->
<?php <?php
$productref = ''; $productref = '';
if ($object->element == 'product') { if ($object->element == 'product') {
@@ -76,7 +76,7 @@ print load_fiche_titre($langs->trans("StockTransfer"), '', 'generic');
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="post">'."\n"; print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="post">'."\n";
print dol_get_fiche_head(); print dol_get_fiche_head(array(), '', '', 0, '', 0, '', '', 0, '', 0, 'marginbottomonly');
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="transfert_stock">'; print '<input type="hidden" name="action" value="transfert_stock">';
@@ -168,6 +168,8 @@ print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">'; print '<input type="submit" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
print '</div>'; print '</div>';
print '<br>';
print '</form>'; print '</form>';
?> ?>
<!-- END PHP STOCKCORRECTION.TPL.PHP --> <!-- END PHP STOCKCORRECTION.TPL.PHP -->