Merge remote-tracking branch 'origin/3.5' into develop
Conflicts: htdocs/comm/action/fiche.php
This commit is contained in:
commit
b64a2b2718
@ -547,15 +547,12 @@ class Menubase
|
|||||||
$tmpcond=$menu['enabled'];
|
$tmpcond=$menu['enabled'];
|
||||||
if ($leftmenu == 'all') $tmpcond=preg_replace('/\$leftmenu\s*==\s*["\'a-zA-Z_]+/','1==1',$tmpcond); // Force part of condition to true
|
if ($leftmenu == 'all') $tmpcond=preg_replace('/\$leftmenu\s*==\s*["\'a-zA-Z_]+/','1==1',$tmpcond); // Force part of condition to true
|
||||||
$enabled = verifCond($tmpcond);
|
$enabled = verifCond($tmpcond);
|
||||||
if ($conf->use_javascript_ajax && ! empty($conf->global->MAIN_MENU_USE_JQUERY_ACCORDION) && preg_match('/^\$leftmenu/',$menu['enabled'])) $enabled=1;
|
//if ($conf->use_javascript_ajax && ! empty($conf->global->MAIN_MENU_USE_JQUERY_ACCORDION) && empty($conf->dol_use_jmobile) && preg_match('/^\$leftmenu/',$menu['enabled'])) $enabled=1;
|
||||||
//print "verifCond rowid=".$menu['rowid']." ".$tmpcond.":".$enabled."<br>\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define $title
|
// Define $title
|
||||||
if ($enabled)
|
if ($enabled)
|
||||||
{
|
{
|
||||||
//$tmp3=dol_microtime_float();
|
|
||||||
//print '>>> 2 '.($tmp3 - $tmp1).'<br>';
|
|
||||||
$title = $langs->trans($menu['titre']);
|
$title = $langs->trans($menu['titre']);
|
||||||
if ($title == $menu['titre']) // Translation not found
|
if ($title == $menu['titre']) // Translation not found
|
||||||
{
|
{
|
||||||
|
|||||||
@ -621,6 +621,37 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$posy=$pdf->GetY()+1;
|
$posy=$pdf->GetY()+1;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
// Show shipping date
|
||||||
|
if ($object->date_livraison)
|
||||||
|
{
|
||||||
|
$outputlangs->load("sendings");
|
||||||
|
$pdf->SetFont('','B', $default_font_size - 2);
|
||||||
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
|
$titre = $outputlangs->transnoentities("DateDeliveryPlanned").':';
|
||||||
|
$pdf->MultiCell(80, 4, $titre, 0, 'L');
|
||||||
|
$pdf->SetFont('','', $default_font_size - 2);
|
||||||
|
$pdf->SetXY($posxval, $posy);
|
||||||
|
$dlp=dol_print_date($object->date_livraison,"daytext",false,$outputlangs,true);
|
||||||
|
$pdf->MultiCell(80, 4, $dlp, 0, 'L');
|
||||||
|
|
||||||
|
$posy=$pdf->GetY()+1;
|
||||||
|
}
|
||||||
|
elseif ($object->availability_code || $object->availability) // Show availability conditions
|
||||||
|
{
|
||||||
|
$pdf->SetFont('','B', $default_font_size - 2);
|
||||||
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
|
$titre = $outputlangs->transnoentities("AvailabilityPeriod").':';
|
||||||
|
$pdf->MultiCell(80, 4, $titre, 0, 'L');
|
||||||
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
$pdf->SetFont('','', $default_font_size - 2);
|
||||||
|
$pdf->SetXY($posxval, $posy);
|
||||||
|
$lib_availability=$outputlangs->transnoentities("AvailabilityType".$object->availability_code)!=('AvailabilityType'.$object->availability_code)?$outputlangs->transnoentities("AvailabilityType".$object->availability_code):$outputlangs->convToOutputCharset($object->availability);
|
||||||
|
$lib_availability=str_replace('\n',"\n",$lib_availability);
|
||||||
|
$pdf->MultiCell(80, 4, $lib_availability, 0, 'L');
|
||||||
|
|
||||||
|
$posy=$pdf->GetY()+1;
|
||||||
|
}
|
||||||
|
|
||||||
// Show payment mode
|
// Show payment mode
|
||||||
if ($object->mode_reglement_code
|
if ($object->mode_reglement_code
|
||||||
&& $object->mode_reglement_code != 'CHQ'
|
&& $object->mode_reglement_code != 'CHQ'
|
||||||
|
|||||||
@ -180,7 +180,9 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
|
|||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
// Set if we used free entry or predefined product
|
// Set if we used free entry or predefined product
|
||||||
if (GETPOST('addline_libre'))
|
if (GETPOST('addline_libre')
|
||||||
|
|| (GETPOST('dp_desc') && ! GETPOST('addline_libre') && ! GETPOST('idprod', 'int')>0) // we push enter onto qty field
|
||||||
|
)
|
||||||
{
|
{
|
||||||
$predef='';
|
$predef='';
|
||||||
$idprod=0;
|
$idprod=0;
|
||||||
@ -188,7 +190,9 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
|
|||||||
$price_ht = GETPOST('price_ht');
|
$price_ht = GETPOST('price_ht');
|
||||||
$tva_tx=(GETPOST('tva_tx')?GETPOST('tva_tx'):0);
|
$tva_tx=(GETPOST('tva_tx')?GETPOST('tva_tx'):0);
|
||||||
}
|
}
|
||||||
if (GETPOST('addline_predefined'))
|
if (GETPOST('addline_predefined')
|
||||||
|
|| (! GETPOST('dp_desc') && ! GETPOST('addline_predefined') && GETPOST('idprod', 'int')>0) // we push enter onto qty field
|
||||||
|
)
|
||||||
{
|
{
|
||||||
$predef=(($conf->global->MAIN_FEATURES_LEVEL < 2) ? '_predef' : '');
|
$predef=(($conf->global->MAIN_FEATURES_LEVEL < 2) ? '_predef' : '');
|
||||||
$idprod=GETPOST('idprod', 'int');
|
$idprod=GETPOST('idprod', 'int');
|
||||||
|
|||||||
@ -523,7 +523,9 @@ elseif ($action == 'addline' && $user->rights->fournisseur->facture->creer)
|
|||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
// Set if we used free entry or predefined product
|
// Set if we used free entry or predefined product
|
||||||
if (GETPOST('addline_libre'))
|
if (GETPOST('addline_libre')
|
||||||
|
|| (GETPOST('dp_desc') && ! GETPOST('addline_libre') && ! GETPOST('idprod', 'int')>0) // we push enter onto qty field
|
||||||
|
)
|
||||||
{
|
{
|
||||||
$predef='';
|
$predef='';
|
||||||
$idprod=0;
|
$idprod=0;
|
||||||
@ -531,7 +533,9 @@ elseif ($action == 'addline' && $user->rights->fournisseur->facture->creer)
|
|||||||
$price_ht = GETPOST('price_ht');
|
$price_ht = GETPOST('price_ht');
|
||||||
$tva_tx=(GETPOST('tva_tx')?GETPOST('tva_tx'):0);
|
$tva_tx=(GETPOST('tva_tx')?GETPOST('tva_tx'):0);
|
||||||
}
|
}
|
||||||
if (GETPOST('addline_predefined'))
|
if (GETPOST('addline_predefined')
|
||||||
|
|| (! GETPOST('dp_desc') && ! GETPOST('addline_predefined') && GETPOST('idprod', 'int')>0) // we push enter onto qty field
|
||||||
|
)
|
||||||
{
|
{
|
||||||
$predef=(($conf->global->MAIN_FEATURES_LEVEL < 2) ? '_predef' : '');
|
$predef=(($conf->global->MAIN_FEATURES_LEVEL < 2) ? '_predef' : '');
|
||||||
$idprod=GETPOST('idprod', 'int');
|
$idprod=GETPOST('idprod', 'int');
|
||||||
|
|||||||
@ -1084,7 +1084,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/tablednd/jquery.tablednd.0.6.min.js'.($ext?'?'.$ext:'').'"></script>'."\n";
|
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/tablednd/jquery.tablednd.0.6.min.js'.($ext?'?'.$ext:'').'"></script>'."\n";
|
||||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/tiptip/jquery.tipTip.min.js'.($ext?'?'.$ext:'').'"></script>'."\n";
|
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/tiptip/jquery.tipTip.min.js'.($ext?'?'.$ext:'').'"></script>'."\n";
|
||||||
// jQuery Layout
|
// jQuery Layout
|
||||||
if (! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) || defined('REQUIRE_JQUERY_LAYOUT'))
|
if (empty($conf->dol_use_jmobile) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) || defined('REQUIRE_JQUERY_LAYOUT'))
|
||||||
{
|
{
|
||||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/layout/jquery.layout-latest.js'.($ext?'?'.$ext:'').'"></script>'."\n";
|
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/layout/jquery.layout-latest.js'.($ext?'?'.$ext:'').'"></script>'."\n";
|
||||||
}
|
}
|
||||||
@ -1293,7 +1293,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
|
|||||||
|
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
if (! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))
|
if (empty($conf->dol_use_jmobile) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))
|
||||||
{
|
{
|
||||||
print '<script type="text/javascript">
|
print '<script type="text/javascript">
|
||||||
jQuery(document).ready(function () {
|
jQuery(document).ready(function () {
|
||||||
@ -1347,7 +1347,8 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
|
|||||||
</script>';
|
</script>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_MENU_USE_JQUERY_ACCORDION))
|
/* This make menu bugged
|
||||||
|
if ($conf->use_javascript_ajax && ! empty($conf->global->MAIN_MENU_USE_JQUERY_ACCORDION) && empty($conf->dol_use_jmobile))
|
||||||
{
|
{
|
||||||
print "\n".'<script type="text/javascript">
|
print "\n".'<script type="text/javascript">
|
||||||
jQuery(document).ready(function () {
|
jQuery(document).ready(function () {
|
||||||
@ -1360,7 +1361,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
}
|
} */
|
||||||
|
|
||||||
// Wrapper to show tooltips
|
// Wrapper to show tooltips
|
||||||
print "\n".'<script type="text/javascript">
|
print "\n".'<script type="text/javascript">
|
||||||
@ -1377,7 +1378,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
|
|||||||
*/
|
*/
|
||||||
print "\n".'<!-- Start top horizontal -->'."\n";
|
print "\n".'<!-- Start top horizontal -->'."\n";
|
||||||
|
|
||||||
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print '<div class="ui-layout-north"> <!-- Begin top layout -->'."\n";
|
if (empty($conf->dol_use_jmobile) && ! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print '<div class="ui-layout-north"> <!-- Begin top layout -->'."\n";
|
||||||
|
|
||||||
if (empty($conf->dol_hide_topmenu))
|
if (empty($conf->dol_hide_topmenu))
|
||||||
{
|
{
|
||||||
@ -1496,11 +1497,11 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
|
|||||||
unset($form);
|
unset($form);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print "</div><!-- End top layout -->\n";
|
if (empty($conf->dol_use_jmobile) && ! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print "</div><!-- End top layout -->\n";
|
||||||
print '<div style="clear: both;"></div>';
|
print '<div style="clear: both;"></div>';
|
||||||
print "<!-- End top horizontal menu -->\n\n";
|
print "<!-- End top horizontal menu -->\n\n";
|
||||||
|
|
||||||
if (empty($conf->dol_hide_leftmenu) && (empty($conf->use_javascript_ajax) || empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))) print '<div id="id-container">';
|
if (empty($conf->dol_hide_leftmenu) && (empty($conf->use_javascript_ajax) || ! empty($conf->dol_use_jmobile) || empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))) print '<div id="id-container">';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1530,7 +1531,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
|
|||||||
// Instantiate hooks of thirdparty module
|
// Instantiate hooks of thirdparty module
|
||||||
$hookmanager->initHooks(array('searchform','leftblock'));
|
$hookmanager->initHooks(array('searchform','leftblock'));
|
||||||
|
|
||||||
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print "\n".'<div class="ui-layout-west"> <!-- Begin left layout -->'."\n";
|
if (empty($conf->dol_use_jmobile) && ! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print "\n".'<div class="ui-layout-west"> <!-- Begin left layout -->'."\n";
|
||||||
else print '<div id="id-left">';
|
else print '<div id="id-left">';
|
||||||
|
|
||||||
print "\n";
|
print "\n";
|
||||||
@ -1708,8 +1709,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
|
|||||||
$leftblock=$hookmanager->executeHooks('printLeftBlock',$parameters); // Note that $action and $object may have been modified by some hooks
|
$leftblock=$hookmanager->executeHooks('printLeftBlock',$parameters); // Note that $action and $object may have been modified by some hooks
|
||||||
print $leftblock;
|
print $leftblock;
|
||||||
|
|
||||||
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print '</div> <!-- End left layout -->'."\n";
|
if (empty($conf->dol_use_jmobile) && ! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print '</div> <!-- End left layout -->'."\n";
|
||||||
//XXX else print '</td>';
|
|
||||||
else print '</div>'; // End div id="id-left"
|
else print '</div>'; // End div id="id-left"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1731,12 +1731,10 @@ function main_area($title='')
|
|||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))
|
if (empty($conf->dol_use_jmobile) && ! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))
|
||||||
{
|
{
|
||||||
print '<div id="mainContent"><div class="ui-layout-center"> <!-- begin main layout -->'."\n";
|
print '<div id="mainContent"><div class="ui-layout-center"> <!-- begin main layout -->'."\n";
|
||||||
//print '<table width="100%" class="notopnoleftnoright" summary="centermenutable" id="undertopmenu"><tr>';
|
|
||||||
}
|
}
|
||||||
//XXX print '<td valign="top">'."\n";
|
|
||||||
if (empty($conf->dol_hide_leftmenu)) print '<div id="id-right">';
|
if (empty($conf->dol_hide_leftmenu)) print '<div id="id-right">';
|
||||||
|
|
||||||
print "\n";
|
print "\n";
|
||||||
@ -1864,8 +1862,7 @@ if (! function_exists("llxFooter"))
|
|||||||
print '</div> <!-- end div class="fiche" -->'."\n";
|
print '</div> <!-- end div class="fiche" -->'."\n";
|
||||||
if (! empty($conf->dol_use_jmobile)) print '</div>'; // end data-role="page"
|
if (! empty($conf->dol_use_jmobile)) print '</div>'; // end data-role="page"
|
||||||
|
|
||||||
//XXX print "\n".'</td></tr></table> <!-- end right area -->'."\n";
|
if (empty($conf->dol_use_jmobile) && ! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print '</div></div> <!-- end main layout -->'."\n";
|
||||||
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print '</div></div> <!-- end main layout -->'."\n";
|
|
||||||
if (empty($conf->dol_hide_leftmenu)) print '</div>'; // End div id-right
|
if (empty($conf->dol_hide_leftmenu)) print '</div>'; // End div id-right
|
||||||
|
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|||||||
@ -81,7 +81,10 @@ if ($action == 'order' && isset($_POST['valid']))
|
|||||||
$linecount = GETPOST('linecount', 'int');
|
$linecount = GETPOST('linecount', 'int');
|
||||||
$box = 0;
|
$box = 0;
|
||||||
unset($_POST['linecount']);
|
unset($_POST['linecount']);
|
||||||
if ($linecount > 0) {
|
if ($linecount > 0)
|
||||||
|
{
|
||||||
|
$db->begin();
|
||||||
|
|
||||||
$suppliers = array();
|
$suppliers = array();
|
||||||
for ($i = 0; $i < $linecount; $i++)
|
for ($i = 0; $i < $linecount; $i++)
|
||||||
{
|
{
|
||||||
@ -154,13 +157,22 @@ if ($action == 'order' && isset($_POST['valid']))
|
|||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
if (!$fail && $id) {
|
|
||||||
|
if (! $fail && $id)
|
||||||
|
{
|
||||||
|
$db->commit();
|
||||||
|
|
||||||
setEventMessage($langs->trans('OrderCreated'), 'mesgs');
|
setEventMessage($langs->trans('OrderCreated'), 'mesgs');
|
||||||
header('Location: replenishorders.php');
|
header('Location: replenishorders.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$db->rollback();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ($box == 0) {
|
if ($box == 0)
|
||||||
|
{
|
||||||
setEventMessage($langs->trans('SelectProductWithNotNullQty'), 'warnings');
|
setEventMessage($langs->trans('SelectProductWithNotNullQty'), 'warnings');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user