Fix url suggested for bookmark did not always include params
This commit is contained in:
parent
08af9bf365
commit
92287ab18d
@ -40,7 +40,26 @@ function printBookmarksList($aDb, $aLangs)
|
|||||||
|
|
||||||
$langs->load("bookmarks");
|
$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 = '';
|
$ret = '';
|
||||||
|
|
||||||
@ -55,7 +74,8 @@ function printBookmarksList($aDb, $aLangs)
|
|||||||
// Url to go on create new bookmark page
|
// Url to go on create new bookmark page
|
||||||
if ($user->rights->bookmark->creer)
|
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>';
|
$ret.= '<option value="newbookmark" class="optionblue" rel="'.dol_escape_htmltag($urltoadd).'">'.dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).'...</option>';
|
||||||
}
|
}
|
||||||
// Menu with all bookmarks
|
// Menu with all bookmarks
|
||||||
|
|||||||
@ -39,6 +39,7 @@ $id=GETPOST("id");
|
|||||||
$action=GETPOST("action","alpha");
|
$action=GETPOST("action","alpha");
|
||||||
$title=GETPOST("title","alpha");
|
$title=GETPOST("title","alpha");
|
||||||
$url=GETPOST("url","alpha");
|
$url=GETPOST("url","alpha");
|
||||||
|
$urlsource=GETPOST("urlsource","alpha");
|
||||||
$target=GETPOST("target","alpha");
|
$target=GETPOST("target","alpha");
|
||||||
$userid=GETPOST("userid","int");
|
$userid=GETPOST("userid","int");
|
||||||
$position=GETPOST("position","int");
|
$position=GETPOST("position","int");
|
||||||
@ -64,7 +65,7 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
|
|||||||
|
|
||||||
if (GETPOST("cancel"))
|
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);
|
header("Location: ".$backtopage);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -97,7 +98,7 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
|
|||||||
|
|
||||||
if ($res > 0)
|
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);
|
header("Location: ".$backtopage);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -121,6 +122,7 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -161,7 +163,7 @@ if ($action == 'create')
|
|||||||
dol_set_focus('#titlebookmark');
|
dol_set_focus('#titlebookmark');
|
||||||
|
|
||||||
// Url
|
// 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
|
// Target
|
||||||
print '<tr><td>'.$langs->trans("BehaviourOnClick").'</td><td>';
|
print '<tr><td>'.$langs->trans("BehaviourOnClick").'</td><td>';
|
||||||
@ -219,7 +221,7 @@ 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>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/bookmarks/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
|||||||
@ -301,6 +301,16 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
|
|||||||
print "<!-- End SearchForm -->\n";
|
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
|
// We update newmenu with entries found into database
|
||||||
$menuArbo = new Menubase($db,'auguria');
|
$menuArbo = new Menubase($db,'auguria');
|
||||||
$newmenu = $menuArbo->menuLeftCharger($newmenu,$mainmenu,$leftmenu,($user->societe_id?1:0),'auguria',$tabMenu);
|
$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 ($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);
|
return count($menu_array);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user