Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
preetwinder
erp5
Commits
10d594c4
Commit
10d594c4
authored
Aug 08, 2017
by
preetwinder
Committed by
preetwinder
Aug 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_officejs] Add document list.
parent
593084bf
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
508 additions
and
0 deletions
+508
-0
bt5/erp5_officejs/PathTemplateItem/web_page_module/ojs_fb_document_list_js.js
...thTemplateItem/web_page_module/ojs_fb_document_list_js.js
+145
-0
bt5/erp5_officejs/PathTemplateItem/web_page_module/ojs_fb_document_list_js.xml
...hTemplateItem/web_page_module/ojs_fb_document_list_js.xml
+363
-0
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/ojs_fb_document_list_js.js
0 → 100644
View file @
10d594c4
/*global window, rJS, RSVP, console */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
)
{
"
use strict
"
;
rJS
(
window
)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
getUrlParameter
"
,
"
getUrlParameter
"
)
.
declareAcquiredMethod
(
"
getUrlForAcquired
"
,
"
getUrlFor
"
)
.
declareAcquiredMethod
(
"
jio_allDocs
"
,
"
jio_allDocs
"
)
.
declareAcquiredMethod
(
"
jio_get
"
,
"
jio_get
"
)
.
declareAcquiredMethod
(
"
getSetting
"
,
"
getSetting
"
)
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.
allowPublicAcquisition
(
"
jio_allDocs
"
,
function
(
param_list
)
{
var
gadget
=
this
;
return
gadget
.
jio_allDocs
(
param_list
[
0
])
.
push
(
function
(
result
)
{
var
i
,
date
,
len
=
result
.
data
.
total_rows
;
for
(
i
=
0
;
i
<
len
;
i
+=
1
)
{
if
(
result
.
data
.
rows
[
i
].
value
.
hasOwnProperty
(
"
modification_date
"
))
{
date
=
new
Date
(
result
.
data
.
rows
[
i
].
value
.
modification_date
);
result
.
data
.
rows
[
i
].
value
.
modification_date
=
{
allow_empty_time
:
0
,
ampm_time_style
:
0
,
css_class
:
"
date_field
"
,
date_only
:
0
,
description
:
"
The Date
"
,
editable
:
0
,
hidden
:
0
,
hidden_day_is_last_day
:
0
,
default
:
date
.
toUTCString
(),
key
:
"
modification_date
"
,
required
:
0
,
timezone_style
:
0
,
title
:
"
Modification Date
"
,
type
:
"
DateTimeField
"
};
result
.
data
.
rows
[
i
].
value
[
"
listbox_uid:list
"
]
=
{
key
:
"
listbox_uid:list
"
,
value
:
2713
};
}
}
return
result
;
});
})
.
declareMethod
(
"
triggerSubmit
"
,
function
()
{
var
argument_list
=
arguments
;
return
this
.
getDeclaredGadget
(
'
form_list
'
)
.
push
(
function
(
gadget
)
{
return
gadget
.
triggerSubmit
.
apply
(
gadget
,
argument_list
);
});
})
.
allowPublicAcquisition
(
"
getUrlFor
"
,
function
(
param_list
)
{
var
gadget
=
this
;
if
(
param_list
[
0
].
command
==
'
index
'
)
{
return
gadget
.
jio_get
(
param_list
[
0
].
options
.
jio_key
)
.
push
(
function
(
result
)
{
if
(
result
.
link
)
{
return
result
.
link
;
}
return
window
.
location
.
href
;
});
}
return
this
.
getUrlForAcquired
.
apply
(
this
,
param_list
);
//return this.getUrlForAcquired(param_list);
})
.
declareMethod
(
"
render
"
,
function
()
{
var
gadget
=
this
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
RSVP
.
all
([
gadget
.
getDeclaredGadget
(
'
form_list
'
),
gadget
.
getSetting
(
"
portal_type
"
)
]);
})
.
push
(
function
(
result
)
{
var
column_list
=
[
[
'
message
'
,
'
Message
'
],
[
'
created_time
'
,
'
Creation Time
'
]
//['title', 'Title'],
//['reference', 'Reference'],
//['language', 'Language'],
//['description', 'Description'],
//['version', 'Version'],
//['modification_date', 'Modification Date']
];
return
result
[
0
].
render
({
erp5_document
:
{
"
_embedded
"
:
{
"
_view
"
:
{
"
listbox
"
:
{
"
column_list
"
:
column_list
,
"
show_anchor
"
:
0
,
"
default_params
"
:
{},
"
editable
"
:
1
,
"
editable_column_list
"
:
[],
"
key
"
:
"
field_listbox
"
,
"
lines
"
:
30
,
"
list_method
"
:
"
portal_catalog
"
,
//"query": "urn:jio:allDocs?query=portal_type%3A%22" +
// result[1] + "%22",
"
query
"
:
""
,
"
portal_type
"
:
[],
"
search_column_list
"
:
column_list
,
"
sort_column_list
"
:
column_list
,
"
sort
"
:
[[
'
modification_date
'
,
'
descending
'
]],
"
title
"
:
"
Documents
"
,
"
type
"
:
"
ListBox
"
}
}},
"
_links
"
:
{
"
type
"
:
{
// form_list display portal_type in header
name
:
""
}
}},
form_definition
:
{
group_list
:
[[
"
bottom
"
,
[[
"
listbox
"
]]
]]
}
});
})
.
push
(
function
()
{
return
gadget
.
getSetting
(
'
document_title_plural
'
);
})
.
push
(
function
(
result
)
{
return
gadget
.
updateHeader
({
page_title
:
result
,
filter_action
:
true
});
});
});
}(
window
,
rJS
,
RSVP
));
\ No newline at end of file
bt5/erp5_officejs/PathTemplateItem/web_page_module/ojs_fb_document_list_js.xml
0 → 100644
View file @
10d594c4
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment