diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 6131b4414ce..8fd100b21c8 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -1220,7 +1220,7 @@ class Conf extends stdClass $this->contrat->services->inactifs->warning_delay = getDolGlobalInt('MAIN_DELAY_NOT_ACTIVATED_SERVICES') * 86400; $this->contrat->services->expires->warning_delay = getDolGlobalInt('MAIN_DELAY_RUNNING_SERVICES') * 86400; } - if (isset($this->commande)) { + if (isset($this->bank)) { $this->bank->rappro = new stdClass(); $this->bank->cheque = new stdClass(); $this->bank->rappro->warning_delay = getDolGlobalInt('MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE') * 86400; diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 2534c04a58c..dea64295d9e 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -67,23 +67,23 @@ class FormProjets extends Form /** * Output a combo list with projects qualified for a third party / user * - * @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id) - * @param string|Project $selected Id of preselected project or Project (or ''). Note: If you know the ref, you can also provide it into $selected_input_value to save one request in some cases. - * @param string $htmlname Name of HTML field - * @param int $maxlength Maximum length of label - * @param int $option_only Return only html options lines without the select tag + * @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id) + * @param int|string|Project $selected Id of preselected project or Project (or ''). Note: If you know the ref, you can also provide it into $selected_input_value to save one request in some cases. + * @param string $htmlname Name of HTML field + * @param int $maxlength Maximum length of label + * @param int $option_only Return only html options lines without the select tag * @param int|string $show_empty Add an empty line - * @param int $discard_closed Discard closed projects (0=Keep, 1=hide completely, 2=Disable). Use a negative value to not show the "discarded" tooltip. - * @param int $forcefocus Force focus on field (works with javascript only) - * @param int $disabled Disabled - * @param int $mode 0 for HTML mode and 1 for JSON mode - * @param string $filterkey Key to filter on ref or title - * @param int $nooutput No print output. Return it only. - * @param int $forceaddid Force to add project id in list, event if not qualified - * @param string $morecss More css - * @param string $htmlid Html id to use instead of htmlname, by example id="htmlid" - * @param string $morefilter More filters (Must be a sql sanitized string) - * @return string Return html content + * @param int $discard_closed Discard closed projects (0=Keep, 1=hide completely, 2=Disable). Use a negative value to not show the "discarded" tooltip. + * @param int $forcefocus Force focus on field (works with javascript only) + * @param int $disabled Disabled + * @param int $mode 0 for HTML mode and 1 for JSON mode + * @param string $filterkey Key to filter on ref or title + * @param int $nooutput No print output. Return it only. + * @param int $forceaddid Force to add project id in list, event if not qualified + * @param string $morecss More css + * @param string $htmlid Html id to use instead of htmlname, by example id="htmlid" + * @param string $morefilter More filters (Must be a sql sanitized string) + * @return string Return html content */ public function select_projects($socid = -1, $selected = '', $htmlname = 'projectid', $maxlength = 16, $option_only = 0, $show_empty = 1, $discard_closed = 0, $forcefocus = 0, $disabled = 0, $mode = 0, $filterkey = '', $nooutput = 0, $forceaddid = 0, $morecss = '', $htmlid = '', $morefilter = '') { @@ -104,7 +104,7 @@ class FormProjets extends Form if ($selected && empty($selected_input_value)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $project = new Project($this->db); - $project->fetch($selected); + $project->fetch((int) $selected); $selected_input_value = $project->ref; } $urloption = 'socid=' . ((int) $socid) . '&htmlname=' . urlencode($htmlname) . '&discardclosed=' . ((int) $discard_closed); diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index ab39e45d5cc..72a944be7c9 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -31,20 +31,20 @@ * The HTML field must be an input text with id=search_$htmlname. * This use the jQuery "autocomplete" function. If we want to use the select2, we must instead use input select into functions that call this method. * - * @param string $selected Preselected value - * @param string $htmlname HTML name of input field - * @param string $url Ajax Url to call for request: /path/page.php. Must return a json array ('key'=>id, 'value'=>String shown into input field once selected, 'label'=>String shown into combo list) - * @param string $urloption More parameters on URL request - * @param int $minLength Minimum number of chars to trigger that Ajax search - * @param int $autoselect Automatic selection if just one value (trigger("change") on field is done if search return only 1 result) + * @param string $selected Preselected value + * @param string|int $htmlname HTML name of input field + * @param string $url Ajax Url to call for request: /path/page.php. Must return a json array ('key'=>id, 'value'=>String shown into input field once selected, 'label'=>String shown into combo list) + * @param string $urloption More parameters on URL request + * @param int $minLength Minimum number of chars to trigger that Ajax search + * @param int $autoselect Automatic selection if just one value (trigger("change") on field is done if search return only 1 result) * @param array $ajaxoptions Multiple options array * - Ex: array('update'=>array('field1','field2'...)) will reset field1 and field2 once select done * - Ex: array('disabled'=> ) * - Ex: array('show'=> ) * - Ex: array('update_textarea'=> ) * - Ex: array('option_disabled'=> id to disable and warning to show if we select a disabled value (this is possible when using autocomplete ajax) - * @param string $moreparams More params provided to ajax call - * @return string Script + * @param string $moreparams More params provided to ajax call + * @return string Script */ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLength = 2, $autoselect = 0, $ajaxoptions = array(), $moreparams = '') { diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 645cf3ce34f..a10a8805a3e 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -273,6 +273,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') print load_fiche_titre($langs->trans("SendingsAndReceivingForSameOrder")); } + print '
'; print ''; print ''; //print ''; @@ -310,7 +311,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') print ''; // Sending id - print ''; @@ -401,7 +402,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') // Warehouse if (isModEnabled('stock')) { - print '
'.$langs->trans("QtyOrdered").'
'; + print ''; print $expedition->getNomUrl(1); //print ''.img_object($langs->trans("ShowSending"), 'sending').' '.$objp->exp_ref.''; print ''; + print ''; if ($objp->warehouse_id > 0) { $warehousestatic->fetch($objp->warehouse_id); print $warehousestatic->getNomUrl(1); @@ -485,6 +486,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') } print '
'; + print '
'; } $db->free($resql); } else { diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 8ecaf6c6021..05eb64b3972 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1024,19 +1024,19 @@ if ($action == 'create') { // Project if (isModEnabled('project') && is_object($formproject)) { - $projectid = GETPOSTINT('projectid') ? GETPOSTINT('projectid') : 0; + $projectid = GETPOSTINT('projectid'); if (empty($projectid) && !empty($object->fk_project)) { $projectid = $object->fk_project; } if ($origin == 'project') { - $projectid = ($originid ? $originid : 0); + $projectid = ($object->id ? $object->id : 0); } $langs->load("projects"); print ''; print ''.$langs->trans("Project").''; print img_picto('', 'project', 'class="pictofixedwidth"'); - $numprojet = $formproject->select_projects($soc->id, (string) $projectid, 'projectid', 0); + print $formproject->select_projects($soc->id, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, 'widthcentpercentminusxx'); print ' id).'">'; print ''; print ''; @@ -1105,7 +1105,7 @@ if ($action == 'create') { print ''; $expe->fetch_delivery_methods(); print img_picto('', 'dolly', 'class="pictofixedwidth"'); - print $form->selectarray("shipping_method_id", $expe->meths, GETPOSTINT('shipping_method_id'), 1, 0, 0, "", 1); + print $form->selectarray("shipping_method_id", $expe->meths, GETPOSTINT('shipping_method_id'), 1, 0, 0, "", 1, 0, 0, '', 'widthcentpercentminusxx'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } @@ -1149,7 +1149,7 @@ if ($action == 'create') { print "".$langs->trans("DefaultModel").""; print ''; print img_picto('', 'pdf', 'class="pictofixedwidth"'); - print $form->selectarray('model', $list, $conf->global->EXPEDITION_ADDON_PDF); + print $form->selectarray('model', $list, getDolGlobalString('EXPEDITION_ADDON_PDF'), 0, 0, 0, '', 0, 0, 0, '', 'widthcentpercentminusx'); print "\n"; } @@ -1896,11 +1896,9 @@ if ($action == 'create') { } } elseif ($object->id > 0) { '@phan-var-force Expedition $object'; // Need to force it (type overridden earlier) - /* *************************************************************************** */ - /* */ - /* Edit and view mode */ - /* */ - /* *************************************************************************** */ + + // Edit and view mode + $lines = $object->lines; $num_prod = count($lines); @@ -2049,7 +2047,7 @@ if ($action == 'create') { if (!empty($typeobject) && $typeobject == 'commande' && $object->origin_object->id && isModEnabled('order')) { print ''; print $langs->trans("RefOrder").''; - print ''; + print ''; print $objectsrc->getNomUrl(1, 'commande'); print "\n"; print ''; @@ -2057,15 +2055,15 @@ if ($action == 'create') { if (!empty($typeobject) && $typeobject == 'propal' && $object->origin_object->id && isModEnabled("propal")) { print ''; print $langs->trans("RefProposal").''; - print ''; + print ''; print $objectsrc->getNomUrl(1, 'expedition'); print "\n"; print ''; } // Date creation - print ''.$langs->trans("DateCreation").''; - print ''.dol_print_date($object->date_creation, "dayhour")."\n"; + print ''.$langs->trans("DateCreation").''; + print ''.dol_print_date($object->date_creation, "dayhour")."\n"; print ''; // Delivery date planned @@ -2077,7 +2075,7 @@ if ($action == 'create') { print 'id.'">'.img_edit($langs->trans('SetDeliveryDate'), 1).''; } print ''; - print ''; + print ''; if ($action == 'editdate_livraison') { print '
'; print ''; @@ -2100,7 +2098,7 @@ if ($action == 'create') { print 'id.'">'.img_edit($langs->trans('SetShippingDate'), 1).''; } print ''; - print ''; + print ''; if ($action == 'editdate_shipping') { print ''; print ''; @@ -2117,7 +2115,7 @@ if ($action == 'create') { // Weight print ''; print $form->editfieldkey("Weight", 'trueWeight', $object->trueWeight, $object, $user->hasRight('expedition', 'creer')); - print ''; + print ''; if ($action == 'edittrueWeight') { print ''; @@ -2147,13 +2145,13 @@ if ($action == 'create') { print ''; // Width - print ''.$form->editfieldkey("Width", 'trueWidth', $object->trueWidth, $object, $user->hasRight('expedition', 'creer')).''; + print ''.$form->editfieldkey("Width", 'trueWidth', $object->trueWidth, $object, $user->hasRight('expedition', 'creer')).''; print $form->editfieldval("Width", 'trueWidth', $object->trueWidth, $object, $user->hasRight('expedition', 'creer')); print ($object->trueWidth && $object->width_units != '') ? ' '.measuringUnitString(0, "size", $object->width_units) : ''; print ''; // Height - print ''.$form->editfieldkey("Height", 'trueHeight', $object->trueHeight, $object, $user->hasRight('expedition', 'creer')).''; + print ''.$form->editfieldkey("Height", 'trueHeight', $object->trueHeight, $object, $user->hasRight('expedition', 'creer')).''; if ($action == 'edittrueHeight') { print ''; print ''; @@ -2172,7 +2170,7 @@ if ($action == 'create') { print ''; // Depth - print ''.$form->editfieldkey("Depth", 'trueDepth', $object->trueDepth, $object, $user->hasRight('expedition', 'creer')).''; + print ''.$form->editfieldkey("Depth", 'trueDepth', $object->trueDepth, $object, $user->hasRight('expedition', 'creer')).''; print $form->editfieldval("Depth", 'trueDepth', $object->trueDepth, $object, $user->hasRight('expedition', 'creer')); print ($object->trueDepth && $object->depth_units != '') ? ' '.measuringUnitString(0, "size", $object->depth_units) : ''; print ''; @@ -2181,7 +2179,7 @@ if ($action == 'create') { print ''; print $langs->trans("Volume"); print ''; - print ''; + print ''; $calculatedVolume = 0; $volumeUnit = 0; if ($object->trueWidth && $object->trueHeight && $object->trueDepth) { @@ -2210,7 +2208,7 @@ if ($action == 'create') { print ''; // Other attributes - $cols = 2; + //$cols = 2; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; print ''; @@ -2222,7 +2220,7 @@ if ($action == 'create') { print ''; // Sending method - print ''; // Tracking Number - print ''; @@ -2271,7 +2269,7 @@ if ($action == 'create') { } print '
'; + print '
'; print ''; @@ -2231,7 +2229,7 @@ if ($action == 'create') { print ''; } print '
'; print $langs->trans('SendingMethod'); print 'id.'">'.img_edit($langs->trans('SetSendingMethod'), 1).'
'; - print '
'; + print ''; if ($action == 'editshipping_method_id') { print ''; print ''; @@ -2254,7 +2252,7 @@ if ($action == 'create') { print '
'.$form->editfieldkey("TrackingNumber", 'tracking_number', $object->tracking_number, $object, $user->hasRight('expedition', 'creer')).''; + print '
'.$form->editfieldkey("TrackingNumber", 'tracking_number', $object->tracking_number, $object, $user->hasRight('expedition', 'creer')).''; print $form->editfieldval("TrackingNumber", 'tracking_number', $object->tracking_url, $object, $user->hasRight('expedition', 'creer'), 'safehtmlstring', $object->tracking_number); print '
'; print ''; - print ''; + print ''; if ($action != 'editincoterm') { print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); } else { @@ -2281,7 +2279,7 @@ if ($action == 'create') { } // Other attributes - $parameters = array('colspan' => ' colspan="3"', 'cols' => '3'); + $parameters = array(); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -2594,7 +2592,7 @@ if ($action == 'create') { // Qty to ship or shipped print ''.$unit_order.''; // Warehouse source - print ''.$formproduct->selectWarehouses($lines[$i]->entrepot_id, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).''; + print ''.$formproduct->selectWarehouses($lines[$i]->entrepot_id, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1, 0, array(), 'minwidth200').''; // Batch number management print ''; if (isModEnabled('productbatch')) { @@ -2609,7 +2607,7 @@ if ($action == 'create') { // Qty to ship or shipped print ''.$unit_order.''; // Warehouse source - print ''.$formproduct->selectWarehouses($detail_entrepot->entrepot_id, 'entl'.$detail_entrepot->line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).''; + print ''.$formproduct->selectWarehouses($detail_entrepot->entrepot_id, 'entl'.$detail_entrepot->line_id, '', 1, 0, $lines[$i]->fk_product, '', 1, 0, array(), 'minwidth200').''; // Batch number management print ''; if (isModEnabled('productbatch')) { diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 987f0cd3c49..bfaecd73820 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -226,6 +226,7 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; } + /* * View */ @@ -599,7 +600,8 @@ if ($order_id > 0 || !empty($ref)) { * Lines or orders with quantity shipped and remain to ship * Note: Qty shipped are already available into $object->expeditions[fk_product] */ - print ''; + print '
'; + print '
'; $sql = "SELECT cd.rowid, cd.fk_product, cd.product_type as type, cd.label, cd.description,"; $sql .= " cd.price, cd.tva_tx, cd.subprice,"; @@ -838,14 +840,13 @@ if ($order_id > 0 || !empty($ref)) { $db->free($resql); if (!$num) { - print ''; } - - print "
'.$langs->trans("NoArticleOfTypeProduct").'
'; + print '
'.$langs->trans("NoArticleOfTypeProduct").'
"; } else { dol_print_error($db); } + print ""; print ''; diff --git a/htdocs/expedition/tpl/linkedobjectblock.tpl.php b/htdocs/expedition/tpl/linkedobjectblock.tpl.php index a5fdaf4982b..0114fbb6dd1 100644 --- a/htdocs/expedition/tpl/linkedobjectblock.tpl.php +++ b/htdocs/expedition/tpl/linkedobjectblock.tpl.php @@ -48,9 +48,9 @@ foreach ($linkedObjectBlock as $key => $objectlink) { } ?> trans("Shipment"); ?> - getNomUrl(1); ?> - ref_customer; ?> - date_delivery, 'day'); ?> + getNomUrl(1); ?> + ref_customer); ?> + date_delivery ? $objectlink->date_delivery : $objectlink->date_creation, 'day'); ?> hasRight('expedition', 'lire')) { $total += $objectlink->total_ht; diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 057e21ac347..1ea42ee784a 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -353,6 +353,7 @@ ErrorVariousPaymentOnBankAccountWithADifferentCurrencyNotYetSupported=Error, cre ErrorStreamMustBeEnabled=The PHP stream %s is not available. Check your PHP modules and Dolibarr parameter $dolibarr_main_stream_to_disable. ErrorYouTryToPayInvoicesWithDifferentCurrenciesInSamePayment=Error, you try to pay different invoices with different currencies in the same payment ErrorLinkNotFoundWithSharedLink=Error, link not found with this shared key +ErrorBadNumberOfLinesMustHaveAtLeastOneLinePlusTitle=Bad number of lines. The files must have at least 2 lines (1 line for title and 1 line for data) # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user. diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php index 0e55f337b9a..362cd716b9b 100644 --- a/htdocs/product/stock/massstockmove.php +++ b/htdocs/product/stock/massstockmove.php @@ -356,7 +356,8 @@ if ($action == 'importCSV' && $user->hasRight('stock', 'mouvement', 'creer')) { $labelsrecord = $importcsv->import_read_record(); if ($nblinesrecord < 1) { - setEventMessages($langs->trans("BadNumberOfLinesMustHaveAtLeastOneLinePlusTitle"), null, 'errors'); + $langs->load("errors"); + setEventMessages($langs->trans("ErrorBadNumberOfLinesMustHaveAtLeastOneLinePlusTitle"), null, 'errors'); } else { $i = 0; $data = array();