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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
ce1cad28
Commit
ce1cad28
authored
10 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Plain Diff
Merge pull request #2207 from frederic34/patch-3
Enhance select_categories with select2
parents
6ca90ffd
56dd2765
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/core/class/html.formother.class.php
+12
-2
12 additions, 2 deletions
htdocs/core/class/html.formother.class.php
with
12 additions
and
2 deletions
htdocs/core/class/html.formother.class.php
+
12
−
2
View file @
ce1cad28
...
...
@@ -311,15 +311,25 @@ class FormOther
*/
function
select_categories
(
$type
,
$selected
=
0
,
$htmlname
=
'search_categ'
,
$nocateg
=
0
)
{
global
$langs
;
global
$conf
,
$langs
;
require_once
DOL_DOCUMENT_ROOT
.
'/categories/class/categorie.class.php'
;
// Load list of "categories"
$static_categs
=
new
Categorie
(
$this
->
db
);
$tab_categs
=
$static_categs
->
get_full_arbo
(
$type
);
$moreforfilter
=
''
;
$nodatarole
=
''
;
// Enhance with select2
if
(
$conf
->
use_javascript_ajax
)
{
include_once
DOL_DOCUMENT_ROOT
.
'/core/lib/ajax.lib.php'
;
$moreforfilter
.
=
ajax_combobox
(
'select_categ_'
.
$htmlname
);
$nodatarole
=
' data-role="none"'
;
}
// Print a select with each of them
$moreforfilter
=
'<select class="flat" id="select_categ_'
.
$htmlname
.
'" name="'
.
$htmlname
.
'">'
;
$moreforfilter
.
=
'<select class="flat" id="select_categ_'
.
$htmlname
.
'" name="'
.
$htmlname
.
'"
'
.
$nodatarole
.
'
>'
;
$moreforfilter
.
=
'<option value=""> </option>'
;
// Should use -1 to say nothing
if
(
is_array
(
$tab_categs
))
...
...
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