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
9a75d40d
Commit
9a75d40d
authored
9 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix switching between web sites
parent
525b2cf2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/websites/index.php
+17
-6
17 additions, 6 deletions
htdocs/websites/index.php
with
17 additions
and
6 deletions
htdocs/websites/index.php
+
17
−
6
View file @
9a75d40d
...
@@ -137,6 +137,8 @@ $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain
...
@@ -137,6 +137,8 @@ $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain
* Actions
* Actions
*/
*/
if
(
GETPOST
(
'refreshsite'
))
$pageid
=
0
;
// If we change the site, we reset the pageid.
// Add page
// Add page
if
(
$action
==
'add'
)
if
(
$action
==
'add'
)
{
{
...
@@ -476,7 +478,7 @@ if (count($object->records) > 0)
...
@@ -476,7 +478,7 @@ if (count($object->records) > 0)
}
}
$out
.
=
'</select>'
;
$out
.
=
'</select>'
;
print
$out
;
print
$out
;
print
'<input type="submit" class="button" name="refresh" value="'
.
$langs
->
trans
(
"Refresh"
)
.
'">'
;
print
'<input type="submit" class="button" name="refresh
site
" value="'
.
$langs
->
trans
(
"Refresh"
)
.
'">'
;
if
(
$website
)
if
(
$website
)
{
{
...
@@ -529,10 +531,19 @@ if (count($object->records) > 0)
...
@@ -529,10 +531,19 @@ if (count($object->records) > 0)
$out
.
=
'<select name="pageid">'
;
$out
.
=
'<select name="pageid">'
;
if
(
$atleastonepage
)
if
(
$atleastonepage
)
{
{
if
(
empty
(
$pageid
)
&&
$action
!=
'create'
)
// Page id is not defined, we try to take one
{
$firstpageid
=
0
;
$homepageid
=
0
;
foreach
(
$array
as
$key
=>
$valpage
)
foreach
(
$array
as
$key
=>
$valpage
)
{
{
if
(
empty
(
$pageid
)
&&
$action
!=
'create'
)
$pageid
=
$valpage
->
id
;
if
(
empty
(
$firstpageid
))
$firstpageid
=
$valpage
->
id
;
if
(
$object
->
fk_default_home
&&
$key
==
$object
->
fk_default_home
)
$homepageid
=
$valpage
->
id
;
}
$pageid
=
$homepageid
?
$homepageid
:
$firstpageid
;
// We choose home page and if not defined yet, we take first page
}
foreach
(
$array
as
$key
=>
$valpage
)
{
$out
.
=
'<option value="'
.
$key
.
'"'
;
$out
.
=
'<option value="'
.
$key
.
'"'
;
if
(
$pageid
>
0
&&
$pageid
==
$key
)
$out
.
=
' selected'
;
// To preselect a value
if
(
$pageid
>
0
&&
$pageid
==
$key
)
$out
.
=
' selected'
;
// To preselect a value
$out
.
=
'>'
;
$out
.
=
'>'
;
...
@@ -544,7 +555,7 @@ if (count($object->records) > 0)
...
@@ -544,7 +555,7 @@ if (count($object->records) > 0)
else
$out
.
=
'<option value="-1"> </option>'
;
else
$out
.
=
'<option value="-1"> </option>'
;
$out
.
=
'</select>'
;
$out
.
=
'</select>'
;
print
$out
;
print
$out
;
print
'<input type="submit" class="button" name="refresh" value="'
.
$langs
->
trans
(
"Refresh"
)
.
'"'
.
(
$atleastonepage
?
''
:
' disabled="disabled"'
)
.
'>'
;
print
'<input type="submit" class="button" name="refresh
page
" value="'
.
$langs
->
trans
(
"Refresh"
)
.
'"'
.
(
$atleastonepage
?
''
:
' disabled="disabled"'
)
.
'>'
;
print
'<input type="submit" class="buttonDelete" name="delete" value="'
.
$langs
->
trans
(
"Delete"
)
.
'"'
.
(
$atleastonepage
?
''
:
' disabled="disabled"'
)
.
'>'
;
print
'<input type="submit" class="buttonDelete" name="delete" value="'
.
$langs
->
trans
(
"Delete"
)
.
'"'
.
(
$atleastonepage
?
''
:
' disabled="disabled"'
)
.
'>'
;
//print $form->selectarray('page', $array);
//print $form->selectarray('page', $array);
...
...
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