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
92287ab1
Commit
92287ab1
authored
7 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix url suggested for bookmark did not always include params
parent
08af9bf3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
htdocs/bookmarks/bookmarks.lib.php
+22
-2
22 additions, 2 deletions
htdocs/bookmarks/bookmarks.lib.php
htdocs/bookmarks/card.php
+11
-9
11 additions, 9 deletions
htdocs/bookmarks/card.php
htdocs/core/menus/standard/auguria.lib.php
+10
-10
10 additions, 10 deletions
htdocs/core/menus/standard/auguria.lib.php
with
43 additions
and
21 deletions
htdocs/bookmarks/bookmarks.lib.php
+
22
−
2
View file @
92287ab1
...
...
@@ -40,7 +40,26 @@ function printBookmarksList($aDb, $aLangs)
$langs
->
load
(
"bookmarks"
);
$url
=
$_SERVER
[
"PHP_SELF"
]
.
(
dol_escape_htmltag
(
$_SERVER
[
"QUERY_STRING"
])
?
'?'
.
dol_escape_htmltag
(
$_SERVER
[
"QUERY_STRING"
])
:
''
);
$url
=
$_SERVER
[
"PHP_SELF"
];
if
(
!
empty
(
$_SERVER
[
"QUERY_STRING"
]))
{
$url
.
=
(
dol_escape_htmltag
(
$_SERVER
[
"QUERY_STRING"
])
?
'?'
.
dol_escape_htmltag
(
$_SERVER
[
"QUERY_STRING"
])
:
''
);
}
else
{
global
$sortfield
,
$sortorder
;
$tmpurl
=
''
;
// No urlencode, all param $url will be urlencoded later
if
(
$sortfield
)
$tmpurl
.
=
(
$tmpurl
?
'&'
:
''
)
.
'sortfield='
.
$sortfield
;
if
(
$sortorder
)
$tmpurl
.
=
(
$tmpurl
?
'&'
:
''
)
.
'sortorder='
.
$sortorder
;
foreach
(
$_POST
as
$key
=>
$val
)
{
if
(
preg_match
(
'/^search_/'
,
$key
)
&&
$val
!=
''
)
$tmpurl
.
=
(
$tmpurl
?
'&'
:
''
)
.
$key
.
'='
.
$val
;
}
$url
.
=
(
$tmpurl
?
'?'
.
$tmpurl
:
''
);
}
$ret
=
''
;
...
...
@@ -55,7 +74,8 @@ function printBookmarksList($aDb, $aLangs)
// Url to go on create new bookmark page
if
(
$user
->
rights
->
bookmark
->
creer
)
{
$urltoadd
=
DOL_URL_ROOT
.
'/bookmarks/card.php?action=create&urlsource='
.
urlencode
(
$url
)
.
'&url='
.
urlencode
(
$url
);
//$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url);
$urltoadd
=
DOL_URL_ROOT
.
'/bookmarks/card.php?action=create&url='
.
urlencode
(
$url
);
$ret
.
=
'<option value="newbookmark" class="optionblue" rel="'
.
dol_escape_htmltag
(
$urltoadd
)
.
'">'
.
dol_escape_htmltag
(
$langs
->
trans
(
'AddThisPageToBookmarks'
))
.
'...</option>'
;
}
// Menu with all bookmarks
...
...
This diff is collapsed.
Click to expand it.
htdocs/bookmarks/card.php
+
11
−
9
View file @
92287ab1
...
...
@@ -39,6 +39,7 @@ $id=GETPOST("id");
$action
=
GETPOST
(
"action"
,
"alpha"
);
$title
=
GETPOST
(
"title"
,
"alpha"
);
$url
=
GETPOST
(
"url"
,
"alpha"
);
$urlsource
=
GETPOST
(
"urlsource"
,
"alpha"
);
$target
=
GETPOST
(
"target"
,
"alpha"
);
$userid
=
GETPOST
(
"userid"
,
"int"
);
$position
=
GETPOST
(
"position"
,
"int"
);
...
...
@@ -64,7 +65,7 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
if
(
GETPOST
(
"cancel"
))
{
if
(
empty
(
$backtopage
))
$backtopage
=
(
GETPOST
(
"urlsource"
)
?
GETPOST
(
"
urlsource
"
)
:
((
!
empty
(
$url
))
?
$url
:
DOL_URL_ROOT
.
'/bookmarks/list.php'
));
if
(
empty
(
$backtopage
))
$backtopage
=
(
$urlsource
?
$
urlsource
:
((
!
empty
(
$url
))
?
$url
:
DOL_URL_ROOT
.
'/bookmarks/list.php'
));
header
(
"Location: "
.
$backtopage
);
exit
;
}
...
...
@@ -97,7 +98,7 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
if
(
$res
>
0
)
{
if
(
empty
(
$backtopage
))
$backtopage
=
(
GETPOST
(
"urlsource"
)
?
GETPOST
(
"urlsource"
)
:
DOL_URL_ROOT
.
'/bookmarks/list.php'
);
if
(
empty
(
$backtopage
))
$backtopage
=
(
$urlsource
?
$urlsource
:
((
!
empty
(
$url
))
?
$url
:
DOL_URL_ROOT
.
'/bookmarks/list.php'
)
)
;
header
(
"Location: "
.
$backtopage
);
exit
;
}
...
...
@@ -121,6 +122,7 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
}
}
/*
* View
*/
...
...
@@ -153,15 +155,15 @@ if ($action == 'create')
print
load_fiche_titre
(
$langs
->
trans
(
"NewBookmark"
));
dol_fiche_head
(
$head
,
$hselected
,
$langs
->
trans
(
"Bookmark"
),
0
,
'bookmark'
);
dol_fiche_head
(
$head
,
$hselected
,
$langs
->
trans
(
"Bookmark"
),
0
,
'bookmark'
);
print
'<table class="border" width="100%">'
;
print
'<tr><td class="titlefieldcreate fieldrequired">'
.
$langs
->
trans
(
"BookmarkTitle"
)
.
'</td><td><input id="titlebookmark" class="flat minwidth100" name="title" value="'
.
$title
.
'"></td><td class="hideonsmartphone">'
.
$langs
->
trans
(
"SetHereATitleForLink"
)
.
'</td></tr>'
;
dol_set_focus
(
'#titlebookmark'
);
// Url
print
'<tr><td class="fieldrequired">'
.
$langs
->
trans
(
"UrlOrLink"
)
.
'</td><td><input class="flat quatrevingtpercent" name="url" value="'
.
$url
.
'"></td><td class="hideonsmartphone">'
.
$langs
->
trans
(
"UseAnExternalHttpLinkOrRelativeDolibarrLink"
)
.
'</td></tr>'
;
print
'<tr><td class="fieldrequired">'
.
$langs
->
trans
(
"UrlOrLink"
)
.
'</td><td><input class="flat quatrevingtpercent" name="url" value="'
.
dol_escape_htmltag
(
$url
)
.
'"></td><td class="hideonsmartphone">'
.
$langs
->
trans
(
"UseAnExternalHttpLinkOrRelativeDolibarrLink"
)
.
'</td></tr>'
;
// Target
print
'<tr><td>'
.
$langs
->
trans
(
"BehaviourOnClick"
)
.
'</td><td>'
;
...
...
@@ -219,14 +221,14 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
}
dol_fiche_head
(
$head
,
$hselected
,
$langs
->
trans
(
"Bookmark"
),
0
,
'bookmark'
);
dol_fiche_head
(
$head
,
$hselected
,
$langs
->
trans
(
"Bookmark"
),
-
1
,
'bookmark'
);
$linkback
=
'<a href="'
.
DOL_URL_ROOT
.
'/bookmarks/list.php">'
.
$langs
->
trans
(
"BackToList"
)
.
'</a>'
;
dol_banner_tab
(
$object
,
'id'
,
$linkback
,
1
,
'rowid'
,
'ref'
,
''
,
''
,
0
,
''
,
''
,
0
);
print
'<div class="fichecenter">'
;
print
'<div class="underbanner clearboth"></div>'
;
print
'<table class="border" width="100%">'
;
...
...
@@ -304,7 +306,7 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
print
'</table>'
;
print
'</div>'
;
dol_fiche_end
();
if
(
$action
==
'edit'
)
...
...
This diff is collapsed.
Click to expand it.
htdocs/core/menus/standard/auguria.lib.php
+
10
−
10
View file @
92287ab1
...
...
@@ -301,6 +301,16 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
print
"<!-- End SearchForm -->
\n
"
;
}
if
(
is_array
(
$moredata
)
&&
!
empty
(
$moredata
[
'bookmarks'
]))
{
print
"
\n
"
;
print
"<!-- Begin Bookmarks -->
\n
"
;
print
'<div id="blockvmenubookmarks" class="blockvmenubookmarks">'
.
"
\n
"
;
print
$moredata
[
'bookmarks'
];
print
'</div>'
.
"
\n
"
;
print
"<!-- End Bookmarks -->
\n
"
;
}
// We update newmenu with entries found into database
$menuArbo
=
new
Menubase
(
$db
,
'auguria'
);
$newmenu
=
$menuArbo
->
menuLeftCharger
(
$newmenu
,
$mainmenu
,
$leftmenu
,(
$user
->
societe_id
?
1
:
0
),
'auguria'
,
$tabMenu
);
...
...
@@ -564,16 +574,6 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
if
(
$altok
)
print
'<div class="blockvmenuend"></div>'
;
// End menu block
}
if
(
is_array
(
$moredata
)
&&
!
empty
(
$moredata
[
'bookmarks'
]))
{
print
"
\n
"
;
print
"<!-- Begin Bookmarks -->
\n
"
;
print
'<div id="blockvmenubookmarks" class="blockvmenubookmarks">'
.
"
\n
"
;
print
$moredata
[
'bookmarks'
];
print
'</div>'
.
"
\n
"
;
print
"<!-- End Bookmarks -->
\n
"
;
}
return
count
(
$menu_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