Fix select2 component go over parent container so we introduce option to
deal this.
This commit is contained in:
parent
127354f0af
commit
a0d11e157b
@ -175,7 +175,7 @@ if ($action == 'edit')
|
|||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="120px">'.$langs->trans("Value").'</td></tr>';
|
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||||
|
|
||||||
$var=!$var;
|
$var=false;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td>' .$form->selectyesno('MAIN_DISABLE_METEO',(isset($conf->global->MAIN_DISABLE_METEO)?1:0),1) . '</td></tr>';
|
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td>' .$form->selectyesno('MAIN_DISABLE_METEO',(isset($conf->global->MAIN_DISABLE_METEO)?1:0),1) . '</td></tr>';
|
||||||
|
|
||||||
@ -222,7 +222,7 @@ else
|
|||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="120px">'.$langs->trans("Value").'</td></tr>';
|
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||||
|
|
||||||
$var=!$var;
|
$var=false;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td>' . yn($conf->global->MAIN_DISABLE_METEO) . '</td></tr>';
|
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td>' . yn($conf->global->MAIN_DISABLE_METEO) . '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -240,7 +240,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
|||||||
// Company
|
// Company
|
||||||
print '<tr><td align="left">'.$langs->trans("ThirdParty").'</td><td align="left">';
|
print '<tr><td align="left">'.$langs->trans("ThirdParty").'</td><td align="left">';
|
||||||
$filter='s.client in (1,2,3)';
|
$filter='s.client in (1,2,3)';
|
||||||
print $form->select_company($socid,'socid',$filter,1);
|
print $form->select_company($socid,'socid',$filter,1,0,0,array(),0,'','style="width: 95%"');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
// User
|
// User
|
||||||
print '<tr><td align="left">'.$langs->trans("CreatedBy").'</td><td align="left">';
|
print '<tr><td align="left">'.$langs->trans("CreatedBy").'</td><td align="left">';
|
||||||
|
|||||||
@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php';
|
|||||||
if (!$user->rights->commande->lire) accessforbidden();
|
if (!$user->rights->commande->lire) accessforbidden();
|
||||||
|
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
|
$langs->load("bills");
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid=GETPOST('socid','int');
|
$socid=GETPOST('socid','int');
|
||||||
|
|||||||
@ -256,7 +256,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
|||||||
print '<tr><td align="left">'.$langs->trans("ThirdParty").'</td><td align="left">';
|
print '<tr><td align="left">'.$langs->trans("ThirdParty").'</td><td align="left">';
|
||||||
if ($mode == 'customer') $filter='s.client in (1,2,3)';
|
if ($mode == 'customer') $filter='s.client in (1,2,3)';
|
||||||
if ($mode == 'supplier') $filter='s.fournisseur = 1';
|
if ($mode == 'supplier') $filter='s.fournisseur = 1';
|
||||||
print $form->select_company($socid,'socid',$filter,1);
|
print $form->select_company($socid,'socid',$filter,1,0,0,array(),0,'','style="width: 95%"');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
// User
|
// User
|
||||||
print '<tr><td align="left">'.$langs->trans("CreatedBy").'</td><td align="left">';
|
print '<tr><td align="left">'.$langs->trans("CreatedBy").'</td><td align="left">';
|
||||||
|
|||||||
@ -237,7 +237,7 @@ print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->tra
|
|||||||
// Company
|
// Company
|
||||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
||||||
$filter='';
|
$filter='';
|
||||||
print $form->select_company($socid,'socid',$filter,1,1);
|
print $form->select_company($socid,'socid',$filter,1,1,0,array(),0,'','style="width: 95%"');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
// User
|
// User
|
||||||
print '<tr><td>'.$langs->trans("User").'</td><td>';
|
print '<tr><td>'.$langs->trans("User").'</td><td>';
|
||||||
|
|||||||
@ -240,7 +240,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
|||||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
||||||
if ($mode == 'customer') $filter='s.client in (1,2,3)';
|
if ($mode == 'customer') $filter='s.client in (1,2,3)';
|
||||||
if ($mode == 'supplier') $filter='s.fournisseur = 1';
|
if ($mode == 'supplier') $filter='s.fournisseur = 1';
|
||||||
print $form->selectarray('socid', $companies, $socid, 1, 0, 0, 'style="width: 100%"');
|
print $form->selectarray('socid', $companies, $socid, 1, 0, 0, 'style="width: 95%"', 0, 0, 0, '', '', 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
// User
|
// User
|
||||||
print '<tr><td>'.$langs->trans("CreatedBy").'</td><td>';
|
print '<tr><td>'.$langs->trans("CreatedBy").'</td><td>';
|
||||||
|
|||||||
@ -336,9 +336,11 @@ if ($id)
|
|||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
print "<tr>";
|
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/salaries/index.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
print "<tr>";
|
||||||
print '<td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
print '<td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||||
print $object->ref;
|
print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Employee
|
// Employee
|
||||||
|
|||||||
@ -898,9 +898,10 @@ class Form
|
|||||||
* @param array $events Ajax event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
|
* @param array $events Ajax event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
|
||||||
* @param int $limit Maximum number of elements
|
* @param int $limit Maximum number of elements
|
||||||
* @param string $morecss Add more css styles to the SELECT component
|
* @param string $morecss Add more css styles to the SELECT component
|
||||||
|
* @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container
|
||||||
* @return string HTML string with select box for thirdparty.
|
* @return string HTML string with select box for thirdparty.
|
||||||
*/
|
*/
|
||||||
function select_company($selected='', $htmlname='socid', $filter='', $showempty=0, $showtype=0, $forcecombo=0, $events=array(), $limit=0, $morecss='minwidth100')
|
function select_company($selected='', $htmlname='socid', $filter='', $showempty=0, $showtype=0, $forcecombo=0, $events=array(), $limit=0, $morecss='minwidth100', $moreparam='')
|
||||||
{
|
{
|
||||||
$out='';
|
$out='';
|
||||||
|
|
||||||
@ -934,7 +935,7 @@ class Form
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{*/
|
{*/
|
||||||
$out.=$this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss);
|
$out.=$this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
return $out;
|
return $out;
|
||||||
@ -954,9 +955,10 @@ class Form
|
|||||||
* @param int $outputmode 0=HTML select string, 1=Array
|
* @param int $outputmode 0=HTML select string, 1=Array
|
||||||
* @param int $limit Limit number of answers
|
* @param int $limit Limit number of answers
|
||||||
* @param string $morecss Add more css styles to the SELECT component
|
* @param string $morecss Add more css styles to the SELECT component
|
||||||
|
* @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container
|
||||||
* @return string HTML string with
|
* @return string HTML string with
|
||||||
*/
|
*/
|
||||||
function select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0, $events=array(), $filterkey='', $outputmode=0, $limit=0, $morecss='minwidth100')
|
function select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0, $events=array(), $filterkey='', $outputmode=0, $limit=0, $morecss='minwidth100', $moreparam='')
|
||||||
{
|
{
|
||||||
global $conf,$user,$langs;
|
global $conf,$user,$langs;
|
||||||
|
|
||||||
@ -1010,7 +1012,7 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Construct $out and $outarray
|
// Construct $out and $outarray
|
||||||
$out.= '<select id="'.$htmlname.'" class="flat'.($morecss?' '.$morecss:'').'" name="'.$htmlname.'"'.$nodatarole.'>'."\n";
|
$out.= '<select id="'.$htmlname.'" class="flat'.($morecss?' '.$morecss:'').'"'.($moreparam?' '.$moreparam:'').' name="'.$htmlname.'"'.$nodatarole.'>'."\n";
|
||||||
|
|
||||||
$textifempty='';
|
$textifempty='';
|
||||||
// Do not use textempty = ' ' or ' ' here, or search on key will search on ' key'.
|
// Do not use textempty = ' ' or ' ' here, or search on key will search on ' key'.
|
||||||
@ -4510,7 +4512,7 @@ class Form
|
|||||||
* @param int $show_empty 0 no empty value allowed, 1 to add an empty value into list (value is '' or ' '), <0 to add an empty value with key that is this value.
|
* @param int $show_empty 0 no empty value allowed, 1 to add an empty value into list (value is '' or ' '), <0 to add an empty value with key that is this value.
|
||||||
* @param int $key_in_label 1 pour afficher la key dans la valeur "[key] value"
|
* @param int $key_in_label 1 pour afficher la key dans la valeur "[key] value"
|
||||||
* @param int $value_as_key 1 to use value as key
|
* @param int $value_as_key 1 to use value as key
|
||||||
* @param string $moreparam Add more parameters onto the select tag
|
* @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container
|
||||||
* @param int $translate Translate and encode value
|
* @param int $translate Translate and encode value
|
||||||
* @param int $maxlen Length maximum for labels
|
* @param int $maxlen Length maximum for labels
|
||||||
* @param int $disabled Html select box is disabled
|
* @param int $disabled Html select box is disabled
|
||||||
|
|||||||
@ -241,7 +241,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
|||||||
print '<tr><td align="left">'.$langs->trans("ThirdParty").'</td><td align="left">';
|
print '<tr><td align="left">'.$langs->trans("ThirdParty").'</td><td align="left">';
|
||||||
if ($mode == 'customer') $filter='s.client in (1,2,3)';
|
if ($mode == 'customer') $filter='s.client in (1,2,3)';
|
||||||
if ($mode == 'supplier') $filter='s.fournisseur = 1';
|
if ($mode == 'supplier') $filter='s.fournisseur = 1';
|
||||||
print $form->select_company($socid,'socid',$filter,1);
|
print $form->select_company($socid,'socid',$filter,1,0,0,array(),0,'','style="width: 95%"');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
// User
|
// User
|
||||||
print '<tr><td align="left">'.$langs->trans("CreatedBy").'</td><td align="left">';
|
print '<tr><td align="left">'.$langs->trans("CreatedBy").'</td><td align="left">';
|
||||||
|
|||||||
@ -240,7 +240,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
|||||||
print '<tr><td align="left">'.$langs->trans("ThirdParty").'</td><td align="left">';
|
print '<tr><td align="left">'.$langs->trans("ThirdParty").'</td><td align="left">';
|
||||||
if ($mode == 'customer') $filter='s.client in (1,2,3)';
|
if ($mode == 'customer') $filter='s.client in (1,2,3)';
|
||||||
if ($mode == 'supplier') $filter='s.fournisseur = 1';
|
if ($mode == 'supplier') $filter='s.fournisseur = 1';
|
||||||
print $form->select_company($socid,'socid',$filter,1);
|
print $form->select_company($socid,'socid',$filter,1,0,0,array(),0,'','style="width: 95%"');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
// User
|
// User
|
||||||
print '<tr><td align="left">'.$langs->trans("CreatedBy").'</td><td align="left">';
|
print '<tr><td align="left">'.$langs->trans("CreatedBy").'</td><td align="left">';
|
||||||
|
|||||||
@ -218,7 +218,7 @@ print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->tra
|
|||||||
/*
|
/*
|
||||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
||||||
$filter='';
|
$filter='';
|
||||||
print $form->select_company($socid,'socid',$filter,1,1);
|
print $form->select_company($socid,'socid',$filter,1,1,0,array(),0,'','style="width: 95%"');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
*/
|
*/
|
||||||
// User
|
// User
|
||||||
|
|||||||
@ -283,7 +283,7 @@ print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->tra
|
|||||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
||||||
if ($mode == 'customer') $filter='s.client in (1,2,3)';
|
if ($mode == 'customer') $filter='s.client in (1,2,3)';
|
||||||
if ($mode == 'supplier') $filter='s.fournisseur = 1';
|
if ($mode == 'supplier') $filter='s.fournisseur = 1';
|
||||||
print $form->select_company($socid,'socid',$filter,1);
|
print $form->select_company($socid,'socid',$filter,1,0,0,array(),0,'','style="width: 95%"');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
// User
|
// User
|
||||||
/*print '<tr><td>'.$langs->trans("ProjectCommercial").'</td><td>';
|
/*print '<tr><td>'.$langs->trans("ProjectCommercial").'</td><td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user