Add functionnality user bookmark
This commit is contained in:
parent
8e94e5b2e2
commit
d2efc320ed
3 changed files with 124 additions and 0 deletions
|
|
@ -582,6 +582,9 @@ EOF;
|
|||
case 'preference':
|
||||
require_once 'ajax_preference.php';
|
||||
break;
|
||||
case 'bookmark':
|
||||
require_once 'ajax_bookmark.php';
|
||||
break;
|
||||
default:
|
||||
var_dump($_GET);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1865,4 +1865,109 @@ function set_preference(p_dossier) {
|
|||
info_message(e.getMessage);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* @brief Display user's bookmark
|
||||
*
|
||||
*/
|
||||
function show_bookmark(p_dossier) {
|
||||
try {
|
||||
waiting_box();
|
||||
removeDiv('bookmark_div');
|
||||
var param=window.location.search;
|
||||
param=param.gsub('?','');
|
||||
var queryString="gDossier="+p_dossier+"&op=bookmark&"+param;
|
||||
var action = new Ajax.Request(
|
||||
"ajax_misc.php" ,
|
||||
{
|
||||
method:'get', parameters:queryString,
|
||||
onFailure:ajax_misc_failure,
|
||||
onSuccess:function(req){
|
||||
remove_waiting_box();
|
||||
add_div({id:'bookmark_div',style:'top:2em;left:20%;width:50%',cssclass:'inner_box',drag:1});
|
||||
$('bookmark_div').innerHTML=req.responseText;
|
||||
try
|
||||
{
|
||||
req.responseText.evalScripts();
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
alert("answer_box Impossible executer script de la reponse\n"+e.message);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
);
|
||||
} catch (e) {
|
||||
info_message(e.getMessage);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* @brief save the bookmark
|
||||
*/
|
||||
function save_bookmark() {
|
||||
try {
|
||||
waiting_box();
|
||||
var queryString="op=bookmark&"+$("bookmark_frm").serialize();
|
||||
var action = new Ajax.Request(
|
||||
"ajax_misc.php" ,
|
||||
{
|
||||
method:'get', parameters:queryString,
|
||||
onFailure:ajax_misc_failure,
|
||||
onSuccess:function(req){
|
||||
removeDiv('bookmark_div');
|
||||
remove_waiting_box();
|
||||
add_div({id:'bookmark_div',style:'top:2em;left:20%;width:50%',cssclass:'inner_box',drag:1});
|
||||
$('bookmark_div').innerHTML=req.responseText;
|
||||
try
|
||||
{
|
||||
req.responseText.evalScripts();
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
alert("answer_box Impossible executer script de la reponse\n"+e.message);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
);
|
||||
} catch (e) {
|
||||
info_message(e.getMessage);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* @brief remove selected bookmark
|
||||
*/
|
||||
function remove_bookmark() {
|
||||
try {
|
||||
waiting_box();
|
||||
var queryString="op=bookmark&"+$("bookmark_del_frm").serialize();
|
||||
var action = new Ajax.Request(
|
||||
"ajax_misc.php" ,
|
||||
{
|
||||
method:'get', parameters:queryString,
|
||||
onFailure:ajax_misc_failure,
|
||||
onSuccess:function(req){
|
||||
remove_waiting_box();
|
||||
removeDiv('bookmark_div');
|
||||
add_div({id:'bookmark_div',style:'top:2em;left:20%;width:50%',cssclass:'inner_box',drag:1});
|
||||
$('bookmark_div').innerHTML=req.responseText;
|
||||
try
|
||||
{
|
||||
req.responseText.evalScripts();
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
alert("answer_box Impossible executer script de la reponse\n"+e.message);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
);
|
||||
} catch (e) {
|
||||
info_message(e.getMessage);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -93,6 +93,14 @@ insert into profile_menu (me_code,me_code_dep,p_id,p_order, p_type_display,pm_de
|
|||
values
|
||||
('NAVI',null,1,90,'M',0), ('NAVI',null,2,90,'M',0);
|
||||
|
||||
insert into menu_ref(me_code,me_menu,me_file, me_url,me_description,me_parameter,me_javascript,me_type,me_description_etendue)
|
||||
values
|
||||
('BOOKMARK','Favori',null,null,'Raccourci vers vos menus préférés',null,'show_bookmark(<DOSSIER>)','ME','Ce menu vous présente un menu rapide des menus que vous utilisez le plus souvent');
|
||||
|
||||
insert into profile_menu (me_code,me_code_dep,p_id,p_order, p_type_display,pm_default)
|
||||
values
|
||||
('BOOKMARK',null,1,85,'M',0), ('BOOKMARK',null,2,85,'M',0);
|
||||
|
||||
update menu_ref set me_menu='Impression Journaux' where me_code='PRINTJRN';
|
||||
update menu_ref set me_description='Impression des journaux' where me_code='PRINTJRN';
|
||||
update menu_ref set me_description='Liste du Suivi' where me_code='FOLLOW';
|
||||
|
|
@ -127,3 +135,11 @@ CREATE OR REPLACE VIEW v_menu_description AS
|
|||
COMMENT ON VIEW v_menu_description
|
||||
IS 'Description des menus';
|
||||
|
||||
CREATE TABLE bookmark
|
||||
(
|
||||
b_id serial primary key,
|
||||
b_order integer default 1,
|
||||
b_action text,
|
||||
login text
|
||||
);
|
||||
comment on table bookmark is 'Bookmark of the connected user';
|
||||
Loading…
Add table
Add a link
Reference in a new issue