2
0
forked from Wavyzz/dolibarr

Merge branch '11.0' of https://github.com/dolibarr/dolibarr into 12.0

Conflicts:
	htdocs/product/composition/card.php
This commit is contained in:
Laurent Destailleur
2020-08-14 11:06:39 +02:00
7 changed files with 22 additions and 21 deletions

View File

@@ -6051,7 +6051,7 @@ class Form
$urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php'; $urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php';
// No immediate load of all database // No immediate load of all database
$urloption = 'htmlname='.$htmlname.'&outjson=1&objectdesc='.$objectdesc.'&filter='.urlencode($objecttmp->filter).($moreparams ? $moreparams : ''); $urloption = 'htmlname='.$htmlname.'&outjson=1&objectdesc='.$objectdesc.'&filter='.urlencode($objecttmp->filter);
// Activate the auto complete using ajax call. // Activate the auto complete using ajax call.
$out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, $conf->global->$confkeyforautocompletemode, 0, array()); $out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, $conf->global->$confkeyforautocompletemode, 0, array());
$out .= '<style type="text/css">.ui-autocomplete { z-index: 250; }</style>'; $out .= '<style type="text/css">.ui-autocomplete { z-index: 250; }</style>';

View File

@@ -25,25 +25,26 @@
/** /**
* Generic function that return javascript to add to a page to transform a common input field into an autocomplete field by calling an Ajax page (ex: /societe/ajaxcompanies.php). * Generic function that return javascript to add to a page to transform a common input field into an autocomplete field by calling an Ajax page (ex: /societe/ajaxcompanies.php).
* The HTML field must be an input text with id=search_$htmlname. * 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 also convert the input into select on funcntions that call this method. * This use the jQuery "autocomplete" function. If we want to use the select2, we must also convert the input into select on funcntions that call this method.
* *
* @param string $selected Preselected value * @param string $selected Preselected value
* @param string $htmlname HTML name of input field * @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 $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 string $urloption More parameters on URL request
* @param int $minLength Minimum number of chars to trigger that Ajax search * @param int $minLength Minimum number of chars to trigger that Ajax search
* @param int $autoselect Automatic selection if just one value * @param int $autoselect Automatic selection if just one value
* @param array $ajaxoptions Multiple options array * @param array $ajaxoptions Multiple options array
* - Ex: array('update'=>array('field1','field2'...)) will reset field1 and field2 once select done * - Ex: array('update'=>array('field1','field2'...)) will reset field1 and field2 once select done
* - Ex: array('disabled'=> ) * - Ex: array('disabled'=> )
* - Ex: array('show'=> ) * - Ex: array('show'=> )
* - Ex: array('update_textarea'=> ) * - 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) * - Ex: array('option_disabled'=> id to disable and warning to show if we select a disabled value (this is possible when using autocomplete ajax)
* @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()) function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLength = 2, $autoselect = 0, $ajaxoptions = array(), $moreparams = '')
{ {
if (empty($minLength)) $minLength = 1; if (empty($minLength)) $minLength = 1;
@@ -55,7 +56,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
// Input search_htmlname is original field // Input search_htmlname is original field
// Input htmlname is a second input field used when using ajax autocomplete. // Input htmlname is a second input field used when using ajax autocomplete.
$script = '<input type="hidden" name="'.$htmlname.'" id="'.$htmlname.'" value="'.$selected.'" />'; $script = '<input type="hidden" name="'.$htmlname.'" id="'.$htmlname.'" value="'.$selected.'" '.($moreparams ? $moreparams : '').' />';
$script .= '<!-- Javascript code for autocomplete of field '.$htmlname.' -->'."\n"; $script .= '<!-- Javascript code for autocomplete of field '.$htmlname.' -->'."\n";
$script .= '<script>'."\n"; $script .= '<script>'."\n";

View File

@@ -1752,7 +1752,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
if (empty($conf->global->PROJECT_HIDE_TASKS)) if (empty($conf->global->PROJECT_HIDE_TASKS))
{ {
// Project affected to user // Project affected to user
$newmenu->add("/projet/activity/index.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("Activities"), 0, $user->rights->projet->lire); $newmenu->add("/projet/activity/index.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("Activities"), 0, $user->rights->projet->lire, '', 'project', 'tasks');
$newmenu->add("/projet/tasks.php?leftmenu=tasks&action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer); $newmenu->add("/projet/tasks.php?leftmenu=tasks&action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
$newmenu->add("/projet/tasks/list.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->rights->projet->lire); $newmenu->add("/projet/tasks/list.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->rights->projet->lire);
$newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire); $newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire);

View File

@@ -353,8 +353,8 @@ PriceUTTC=U.P. (inc. tax)
Amount=Amount Amount=Amount
AmountInvoice=Invoice amount AmountInvoice=Invoice amount
AmountInvoiced=Amount invoiced AmountInvoiced=Amount invoiced
AmountInvoicedHT=Amount invoiced (incl. tax) AmountInvoicedHT=Amount invoiced (excl. tax)
AmountInvoicedTTC=Amount invoiced (excl. tax) AmountInvoicedTTC=Amount invoiced (inc. tax)
AmountPayment=Payment amount AmountPayment=Payment amount
AmountHTShort=Amount (excl.) AmountHTShort=Amount (excl.)
AmountTTCShort=Amount (inc. tax) AmountTTCShort=Amount (inc. tax)

View File

@@ -355,8 +355,8 @@ PriceUTTC=P.U TTC
Amount=Montant Amount=Montant
AmountInvoice=Montant facture AmountInvoice=Montant facture
AmountInvoiced=Montant facturé AmountInvoiced=Montant facturé
AmountInvoicedHT=Montant facturé (TTC) AmountInvoicedHT=Montant facturé (HT)
AmountInvoicedTTC=Montant facturé (HT) AmountInvoicedTTC=Montant facturé (TTC)
AmountPayment=Montant paiement AmountPayment=Montant paiement
AmountHTShort=Montant HT AmountHTShort=Montant HT
AmountTTCShort=Montant TTC AmountTTCShort=Montant TTC

View File

@@ -66,7 +66,7 @@ if ($id > 0 || !empty($ref))
if ($cancel) $action = ''; if ($cancel) $action = '';
// Action association d'un sousproduit // Add subproduct to product
if ($action == 'add_prod' && ($user->rights->produit->creer || $user->rights->service->creer)) if ($action == 'add_prod' && ($user->rights->produit->creer || $user->rights->service->creer))
{ {
$error = 0; $error = 0;

View File

@@ -63,7 +63,7 @@ $search_agenda_label = GETPOST('search_agenda_label');
$id = GETPOST("id", 'int'); $id = GETPOST("id", 'int');
$socid = 0; $socid = 0;
//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. //if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result = restrictedArea($user, 'projet', $id, ''); $result = restrictedArea($user, 'projet', $id, 'projet&project');
if (!$user->rights->projet->lire) accessforbidden(); if (!$user->rights->projet->lire) accessforbidden();