Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
993b5eef
Commit
993b5eef
authored
Mar 15, 2012
by
Regis Houssin
Browse files
Options
Downloads
Patches
Plain Diff
Fix: wrong blank space for jquery combobox
Fix: uniformize code
parent
8dc8297a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
htdocs/core/class/html.form.class.php
+1
-1
1 addition, 1 deletion
htdocs/core/class/html.form.class.php
htdocs/core/js/lib_head.js
+13
-13
13 additions, 13 deletions
htdocs/core/js/lib_head.js
htdocs/product/fournisseurs.php
+3
-3
3 additions, 3 deletions
htdocs/product/fournisseurs.php
with
17 additions
and
17 deletions
htdocs/core/class/html.form.class.php
+
1
−
1
View file @
993b5eef
...
@@ -668,7 +668,7 @@ class Form
...
@@ -668,7 +668,7 @@ class Form
}
}
$out
.
=
'<select id="'
.
$htmlname
.
'" class="flat" name="'
.
$htmlname
.
'">'
;
$out
.
=
'<select id="'
.
$htmlname
.
'" class="flat" name="'
.
$htmlname
.
'">'
;
if
(
$showempty
)
$out
.
=
'<option value="-1">
</option>'
;
if
(
$showempty
)
$out
.
=
'<option value="-1"></option>'
;
$num
=
$this
->
db
->
num_rows
(
$resql
);
$num
=
$this
->
db
->
num_rows
(
$resql
);
$i
=
0
;
$i
=
0
;
if
(
$num
)
if
(
$num
)
...
...
This diff is collapsed.
Click to expand it.
htdocs/core/js/lib_head.js
+
13
−
13
View file @
993b5eef
...
@@ -631,31 +631,31 @@ function hideMessage(fieldId,message) {
...
@@ -631,31 +631,31 @@ function hideMessage(fieldId,message) {
/* This is to allow to transform all select box into ajax autocomplete box
/* This is to allow to transform all select box into ajax autocomplete box
* with just one line:
jQuery
(function() {
jQuery
( "#listmotifcons" ).combobox(); });
* with just one line:
$
(function() {
$
( "#listmotifcons" ).combobox(); });
*/
*/
(
function
(
jQuery
)
{
(
function
(
$
)
{
jQuery
.
widget
(
"
ui.combobox
"
,
{
$
.
widget
(
"
ui.combobox
"
,
{
_create
:
function
()
{
_create
:
function
()
{
var
self
=
this
,
var
self
=
this
,
select
=
this
.
element
.
hide
(),
select
=
this
.
element
.
hide
(),
selected
=
select
.
children
(
"
:selected
"
),
selected
=
select
.
children
(
"
:selected
"
),
value
=
selected
.
val
()
?
selected
.
text
()
:
""
;
value
=
selected
.
val
()
?
selected
.
text
()
:
""
;
var
input
=
this
.
input
=
jQuery
(
"
<input>
"
)
var
input
=
this
.
input
=
$
(
"
<input>
"
)
.
insertAfter
(
select
)
.
insertAfter
(
select
)
.
val
(
value
)
.
val
(
value
)
.
autocomplete
({
.
autocomplete
({
delay
:
0
,
delay
:
0
,
minLength
:
0
,
minLength
:
0
,
source
:
function
(
request
,
response
)
{
source
:
function
(
request
,
response
)
{
var
matcher
=
new
RegExp
(
jQuery
.
ui
.
autocomplete
.
escapeRegex
(
request
.
term
),
"
i
"
);
var
matcher
=
new
RegExp
(
$
.
ui
.
autocomplete
.
escapeRegex
(
request
.
term
),
"
i
"
);
response
(
select
.
children
(
"
option
"
).
map
(
function
()
{
response
(
select
.
children
(
"
option
"
).
map
(
function
()
{
var
text
=
jQuery
(
this
).
text
();
var
text
=
$
(
this
).
text
();
if
(
this
.
value
&&
(
!
request
.
term
||
matcher
.
test
(
text
)
)
)
if
(
this
.
value
&&
(
!
request
.
term
||
matcher
.
test
(
text
)
)
)
return
{
return
{
label
:
text
.
replace
(
label
:
text
.
replace
(
new
RegExp
(
new
RegExp
(
"
(?![^&;]+;)(?!<[^<>]*)(
"
+
"
(?![^&;]+;)(?!<[^<>]*)(
"
+
jQuery
.
ui
.
autocomplete
.
escapeRegex
(
request
.
term
)
+
$
.
ui
.
autocomplete
.
escapeRegex
(
request
.
term
)
+
"
)(?![^<>]*>)(?![^&;]+;)
"
,
"
gi
"
"
)(?![^<>]*>)(?![^&;]+;)
"
,
"
gi
"
),
"
<strong>$1</strong>
"
),
),
"
<strong>$1</strong>
"
),
value
:
text
,
value
:
text
,
...
@@ -671,17 +671,17 @@ function hideMessage(fieldId,message) {
...
@@ -671,17 +671,17 @@ function hideMessage(fieldId,message) {
},
},
change
:
function
(
event
,
ui
)
{
change
:
function
(
event
,
ui
)
{
if
(
!
ui
.
item
)
{
if
(
!
ui
.
item
)
{
var
matcher
=
new
RegExp
(
"
^
"
+
jQuery
.
ui
.
autocomplete
.
escapeRegex
(
jQuery
(
this
).
val
()
)
+
"
$
"
,
"
i
"
),
var
matcher
=
new
RegExp
(
"
^
"
+
$
.
ui
.
autocomplete
.
escapeRegex
(
$
(
this
).
val
()
)
+
"
$
"
,
"
i
"
),
valid
=
false
;
valid
=
false
;
select
.
children
(
"
option
"
).
each
(
function
()
{
select
.
children
(
"
option
"
).
each
(
function
()
{
if
(
jQuery
(
this
).
text
().
match
(
matcher
)
)
{
if
(
$
(
this
).
text
().
match
(
matcher
)
)
{
this
.
selected
=
valid
=
true
;
this
.
selected
=
valid
=
true
;
return
false
;
return
false
;
}
}
});
});
if
(
!
valid
)
{
if
(
!
valid
)
{
// remove invalid value, as it didnt match anything
// remove invalid value, as it didnt match anything
jQuery
(
this
).
val
(
""
);
$
(
this
).
val
(
""
);
select
.
val
(
""
);
select
.
val
(
""
);
input
.
data
(
"
autocomplete
"
).
term
=
""
;
input
.
data
(
"
autocomplete
"
).
term
=
""
;
return
false
;
return
false
;
...
@@ -692,13 +692,13 @@ function hideMessage(fieldId,message) {
...
@@ -692,13 +692,13 @@ function hideMessage(fieldId,message) {
.
addClass
(
"
ui-widget ui-widget-content ui-corner-left dolibarrcombobox
"
);
.
addClass
(
"
ui-widget ui-widget-content ui-corner-left dolibarrcombobox
"
);
input
.
data
(
"
autocomplete
"
).
_renderItem
=
function
(
ul
,
item
)
{
input
.
data
(
"
autocomplete
"
).
_renderItem
=
function
(
ul
,
item
)
{
return
jQuery
(
"
<li></li>
"
)
return
$
(
"
<li></li>
"
)
.
data
(
"
item.autocomplete
"
,
item
)
.
data
(
"
item.autocomplete
"
,
item
)
.
append
(
"
<a>
"
+
item
.
label
+
"
</a>
"
)
.
append
(
"
<a>
"
+
item
.
label
+
"
</a>
"
)
.
appendTo
(
ul
);
.
appendTo
(
ul
);
};
};
this
.
button
=
jQuery
(
"
<button type=
\
'button
\
'> </button>
"
)
this
.
button
=
$
(
"
<button type=
\
'button
\
'> </button>
"
)
.
attr
(
"
tabIndex
"
,
-
1
)
.
attr
(
"
tabIndex
"
,
-
1
)
.
attr
(
"
title
"
,
"
Show All Items
"
)
.
attr
(
"
title
"
,
"
Show All Items
"
)
.
insertAfter
(
input
)
.
insertAfter
(
input
)
...
@@ -727,7 +727,7 @@ function hideMessage(fieldId,message) {
...
@@ -727,7 +727,7 @@ function hideMessage(fieldId,message) {
this
.
input
.
remove
();
this
.
input
.
remove
();
this
.
button
.
remove
();
this
.
button
.
remove
();
this
.
element
.
show
();
this
.
element
.
show
();
jQuery
.
Widget
.
prototype
.
destroy
.
call
(
this
);
$
.
Widget
.
prototype
.
destroy
.
call
(
this
);
}
}
});
});
})(
jQuery
);
})(
jQuery
);
This diff is collapsed.
Click to expand it.
htdocs/product/fournisseurs.php
+
3
−
3
View file @
993b5eef
...
@@ -261,7 +261,7 @@ if ($id || $ref)
...
@@ -261,7 +261,7 @@ if ($id || $ref)
print_fiche_titre
(
$langs
->
trans
(
"AddSupplierPrice"
));
print_fiche_titre
(
$langs
->
trans
(
"AddSupplierPrice"
));
}
}
print
'<form action="
fournisseurs.php
?id='
.
$product
->
id
.
'" method="
post
">'
;
print
'<form action="
'
.
$_SERVER
[
'PHP_SELF'
]
.
'
?id='
.
$product
->
id
.
'" method="
POST
">'
;
print
'<input type="hidden" name="token" value="'
.
$_SESSION
[
'newtoken'
]
.
'">'
;
print
'<input type="hidden" name="token" value="'
.
$_SESSION
[
'newtoken'
]
.
'">'
;
print
'<input type="hidden" name="action" value="updateprice">'
;
print
'<input type="hidden" name="action" value="updateprice">'
;
...
@@ -427,8 +427,8 @@ if ($id || $ref)
...
@@ -427,8 +427,8 @@ if ($id || $ref)
print
'<td align="center">'
;
print
'<td align="center">'
;
if
(
$user
->
rights
->
produit
->
creer
||
$user
->
rights
->
service
->
creer
)
if
(
$user
->
rights
->
produit
->
creer
||
$user
->
rights
->
service
->
creer
)
{
{
print
'<a href="
fournisseurs.php
?id='
.
$product
->
id
.
'&socid='
.
$productfourn
->
fourn_id
.
'&action=add_price&rowid='
.
$productfourn
->
product_fourn_price_id
.
'">'
.
img_edit
()
.
"</a>"
;
print
'<a href="
'
.
$_SERVER
[
'PHP_SELF'
]
.
'
?id='
.
$product
->
id
.
'&socid='
.
$productfourn
->
fourn_id
.
'&action=add_price&rowid='
.
$productfourn
->
product_fourn_price_id
.
'">'
.
img_edit
()
.
"</a>"
;
print
'<a href="
fournisseurs.php
?id='
.
$product
->
id
.
'&socid='
.
$productfourn
->
fourn_id
.
'&action=remove_pf&rowid='
.
$productfourn
->
product_fourn_price_id
.
'">'
.
img_picto
(
$langs
->
trans
(
"Remove"
),
'disable.png'
)
.
'</a>'
;
print
'<a href="
'
.
$_SERVER
[
'PHP_SELF'
]
.
'
?id='
.
$product
->
id
.
'&socid='
.
$productfourn
->
fourn_id
.
'&action=remove_pf&rowid='
.
$productfourn
->
product_fourn_price_id
.
'">'
.
img_picto
(
$langs
->
trans
(
"Remove"
),
'disable.png'
)
.
'</a>'
;
}
}
print
'</td>'
;
print
'</td>'
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment