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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Matevz Golob
erp5
Commits
749c2261
Commit
749c2261
authored
Feb 07, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: get rid of post view in discussion tool
parent
e36ea1cf
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
118 deletions
+81
-118
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.js
...e_module/gadget_officejs_controller_page_controller_js.js
+55
-84
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.xml
..._module/gadget_officejs_controller_page_controller_js.xml
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_discussion_tool_appcache.xml
..._page_module/gadget_officejs_discussion_tool_appcache.xml
+15
-17
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_post_js.xml
...page_module/gadget_officejs_erp5_page_ojs_add_post_js.xml
+3
-3
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_post_list_js.xml
...eb_page_module/gadget_officejs_erp5_page_post_list_js.xml
+1
-1
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_html_post_view_js.xml
...web_page_module/gadget_officejs_jio_html_post_view_js.xml
+5
-11
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.js
View file @
749c2261
/*global document, window, rJS */
/*global document, window, rJS
, RSVP
*/
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
document
,
window
,
rJS
)
{
(
function
(
document
,
window
,
rJS
,
RSVP
)
{
"
use strict
"
;
"
use strict
"
;
rJS
(
window
)
rJS
(
window
)
...
@@ -10,10 +10,10 @@
...
@@ -10,10 +10,10 @@
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
.
declareAcquiredMethod
(
"
jio_get
"
,
"
jio_get
"
)
.
declareAcquiredMethod
(
"
jio_get
"
,
"
jio_get
"
)
.
declareAcquiredMethod
(
"
jio_put
"
,
"
jio_put
"
)
.
declareAcquiredMethod
(
"
jio_put
"
,
"
jio_put
"
)
.
declareAcquiredMethod
(
"
redirect
"
,
"
redirect
"
)
.
declareAcquiredMethod
(
"
getUrlFor
"
,
"
getUrlFor
"
)
.
declareAcquiredMethod
(
"
getUrlFor
"
,
"
getUrlFor
"
)
.
declareAcquiredMethod
(
"
submitContent
"
,
"
submitContent
"
)
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
notifySubmitted
"
,
'
notifySubmitted
'
)
.
declareAcquiredMethod
(
"
notifySubmitting
"
,
"
notifySubmitting
"
)
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// declared methods
// declared methods
...
@@ -67,61 +67,55 @@
...
@@ -67,61 +67,55 @@
"
_links
"
:
{}
"
_links
"
:
{}
},
},
form_definition
:
form_definition
form_definition
:
form_definition
};
}
,
i
,
j
,
fields
,
field_info
,
my_element
,
element_id
;
for
(
var
i
=
0
;
i
<
form_definition
.
group_list
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
form_definition
.
group_list
.
length
;
i
+=
1
)
{
var
fields
=
form_definition
.
group_list
[
i
][
1
];
fields
=
form_definition
.
group_list
[
i
][
1
];
for
(
var
j
=
0
;
j
<
fields
.
length
;
j
++
)
{
for
(
j
=
0
;
j
<
fields
.
length
;
j
+=
1
)
{
var
my_element
=
fields
[
j
][
0
],
element_id
;
my_element
=
fields
[
j
][
0
]
;
if
(
my_element
.
startsWith
(
"
my_
"
))
{
if
(
my_element
.
startsWith
(
"
my_
"
))
{
element_id
=
my_element
.
replace
(
"
my_
"
,
""
);
element_id
=
my_element
.
replace
(
"
my_
"
,
""
);
}
}
var
field_info
=
form_definition
.
field_info_dict
[
my_element
];
field_info
=
form_definition
.
field_info_dict
[
my_element
];
if
(
document
&&
document
.
hasOwnProperty
(
element_id
))
{
if
(
document
&&
document
.
hasOwnProperty
(
element_id
))
{
field_info
[
"
default
"
]
=
document
[
element_id
];
field_info
[
"
default
"
]
=
document
[
element_id
];
}
}
form_json
.
erp5_document
.
_embedded
.
_view
[
my_element
]
=
field_info
;
form_json
.
erp5_document
.
_embedded
.
_view
[
my_element
]
=
field_info
;
}
}
}
}
//
form_json.erp5_document._embedded._view._actions = form_definition._actions;
form_json
.
erp5_document
.
_embedded
.
_view
.
_actions
=
form_definition
.
_actions
;
form_json
.
erp5_document
.
_links
=
form_definition
.
_links
;
form_json
.
erp5_document
.
_links
=
form_definition
.
_links
;
return
this
.
getUrlFor
({
command
:
"
change
"
,
options
:
{
"
page
"
:
"
ojs_add_post
"
}})
.
push
(
function
(
url
)
{
form_json
.
erp5_document
.
_embedded
.
_view
.
_actions
=
{
"
put
"
:
{
"
href
"
:
url
}
};
return
form_json
;
return
form_json
;
});
})
/*.allowPublicAcquisition('submitContent', function (options) {
console.log("CONTROLLER ADQUISITION OF submitContent. options");
console.log(options);
//return this.submitContent(options);
return this.getUrlFor({command: "change", options: {"page": "ojs_add_post"}})
.push(function (url) {
console.log("url");
console.log(url);
});
})*/
.
allowPublicAcquisition
(
'
notifySubmit
'
,
function
()
{
return
this
.
triggerSubmit
();
})
})
.
allowPublicAcquisition
(
'
updateDocument
'
,
function
(
param_list
)
{
.
allowPublicAcquisition
(
'
submitContent
'
,
function
(
options
)
{
var
gadget
=
this
,
content
=
param_list
[
0
];
var
gadget
=
this
,
return
gadget
.
jio_get
(
gadget
.
state
.
jio_key
)
jio_key
=
options
[
0
],
.
push
(
function
(
doc
)
{
//target_url = options[1],
content_dict
=
options
[
2
];
return
gadget
.
notifySubmitting
()
.
push
(
function
()
{
// this should be jio_getattachment (using target_url)
return
gadget
.
jio_get
(
jio_key
)
.
push
(
function
(
document
)
{
var
property
;
var
property
;
for
(
property
in
conten
t
)
{
for
(
property
in
content_dic
t
)
{
if
(
conten
t
.
hasOwnProperty
(
property
))
{
if
(
content_dic
t
.
hasOwnProperty
(
property
))
{
doc
[
property
]
=
conten
t
[
property
];
document
[
property
]
=
content_dic
t
[
property
];
}
}
}
}
return
gadget
.
jio_put
(
gadget
.
state
.
jio_key
,
doc
);
return
gadget
.
jio_put
(
jio_key
,
document
);
});
})
.
push
(
function
()
{
return
gadget
.
notifySubmitted
({
message
:
'
Data Updated
'
,
status
:
'
success
'
});
});
});
})
})
.
allowPublicAcquisition
(
'
notifySubmit
'
,
function
()
{
return
this
.
triggerSubmit
();
})
.
declareMethod
(
'
triggerSubmit
'
,
function
()
{
.
declareMethod
(
'
triggerSubmit
'
,
function
()
{
return
this
.
getDeclaredGadget
(
'
fg
'
)
return
this
.
getDeclaredGadget
(
'
fg
'
)
.
push
(
function
(
g
)
{
.
push
(
function
(
g
adget
)
{
return
g
.
triggerSubmit
();
return
g
adget
.
triggerSubmit
();
});
});
})
})
...
@@ -154,20 +148,16 @@
...
@@ -154,20 +148,16 @@
})
})
.
declareMethod
(
"
render
"
,
function
(
options
)
{
.
declareMethod
(
"
render
"
,
function
(
options
)
{
console
.
log
(
"
CONTROLLER. render method -options-
"
);
console
.
log
(
options
);
var
gadget
=
this
,
var
gadget
=
this
,
child_gadget_url
;
child_gadget_url
;
return
gadget
.
jio_get
(
options
.
jio_key
)
return
gadget
.
jio_get
(
options
.
jio_key
)
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
if
(
result
.
portal_type
!==
undefined
)
{
if
(
result
.
portal_type
!==
undefined
)
{
child_gadget_url
=
'
gadget_officejs_jio_
'
+
/*
child_gadget_url = 'gadget_officejs_jio_' +
result.portal_type.replace(/ /g, '_').toLowerCase() +
result.portal_type.replace(/ /g, '_').toLowerCase() +
'
_view.html
'
;
'_view.html';*/
// [HARDCODED] force to use form view editable
// [HARDCODED] force to use form view editable
//child_gadget_url = 'gadget_erp5_pt_form_view_editable.html'
child_gadget_url
=
'
gadget_erp5_pt_form_view_editable.html
'
;
}
else
{
}
else
{
throw
new
Error
(
'
Can not display document:
'
+
options
.
jio_key
);
throw
new
Error
(
'
Can not display document:
'
+
options
.
jio_key
);
}
}
...
@@ -186,26 +176,7 @@
...
@@ -186,26 +176,7 @@
});
});
})
})
.
onEvent
(
'
submit
'
,
function
()
{
console
.
log
(
"
CONTROLLER submit method
"
);
var
gadget
=
this
;
return
gadget
.
notifySubmitting
()
.
push
(
function
()
{
return
gadget
.
getDeclaredGadget
(
'
form_view
'
);
})
.
push
(
function
(
form_gadget
)
{
return
form_gadget
.
getContent
();
})
.
push
(
function
(
content
)
{
return
gadget
.
updateDocument
(
content
);
})
.
push
(
function
()
{
return
gadget
.
notifySubmitted
({
message
:
'
Data Updated
'
,
status
:
'
success
'
});
});
})
.
onStateChange
(
function
(
modification_dict
)
{
.
onStateChange
(
function
(
modification_dict
)
{
console
.
log
(
"
CONTROLLER. onStateChange method
"
);
var
fragment
=
document
.
createElement
(
'
div
'
),
var
fragment
=
document
.
createElement
(
'
div
'
),
gadget
=
this
;
gadget
=
this
;
return
gadget
.
generateJsonRenderForm
(
gadget
.
state
.
form_definition
,
gadget
.
state
.
doc
)
return
gadget
.
generateJsonRenderForm
(
gadget
.
state
.
form_definition
,
gadget
.
state
.
doc
)
...
@@ -228,4 +199,4 @@
...
@@ -228,4 +199,4 @@
});
});
});
});
}(
document
,
window
,
rJS
));
}(
document
,
window
,
rJS
,
RSVP
));
\ No newline at end of file
\ No newline at end of file
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.xml
View file @
749c2261
...
@@ -227,7 +227,7 @@
...
@@ -227,7 +227,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
973.3
2497.3392.28501
</string>
</value>
<value>
<string>
973.3
3799.59117.25480
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -245,7 +245,7 @@
...
@@ -245,7 +245,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1549
487174.88
</float>
<float>
1549
565293.34
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_discussion_tool_appcache.xml
View file @
749c2261
...
@@ -150,13 +150,6 @@ gadget_erp5_header.html\n
...
@@ -150,13 +150,6 @@ gadget_erp5_header.html\n
gadget_erp5_header.js\n
gadget_erp5_header.js\n
gadget_ojs_jio.html\n
gadget_ojs_jio.html\n
gadget_ojs_jio.js\n
gadget_ojs_jio.js\n
gadget_erp5_page_ojs_controller.html\n
gadget_erp5_page_ojs_controller.js\n
\n
#gadget_erp5_page_ojs_add_document.html\n
#gadget_erp5_page_ojs_add_document.js\n
gadget_erp5_page_ojs_add_post.html\n
gadget_erp5_page_ojs_add_post.js\n
\n
\n
gadget_erp5_page_ojs_configurator.html\n
gadget_erp5_page_ojs_configurator.html\n
gadget_erp5_page_ojs_configurator.js\n
gadget_erp5_page_ojs_configurator.js\n
...
@@ -169,11 +162,6 @@ gadget_erp5_page_ojs_dropbox_configurator.js\n
...
@@ -169,11 +162,6 @@ gadget_erp5_page_ojs_dropbox_configurator.js\n
gadget_erp5_page_ojs_sync.html\n
gadget_erp5_page_ojs_sync.html\n
gadget_erp5_page_ojs_sync.js\n
gadget_erp5_page_ojs_sync.js\n
\n
\n
#gadget_erp5_page_ojs_document_list.html\n
#gadget_erp5_page_ojs_document_list.js\n
gadget_erp5_page_ojs_post_list.html\n
gadget_erp5_page_ojs_post_list.js\n
\n
gadget_ojs_configurator_access.html\n
gadget_ojs_configurator_access.html\n
gadget_ojs_configurator_access.js\n
gadget_ojs_configurator_access.js\n
gadget_html5_input.html\n
gadget_html5_input.html\n
...
@@ -188,7 +176,6 @@ gadget_erp5_form.html\n
...
@@ -188,7 +176,6 @@ gadget_erp5_form.html\n
gadget_erp5_form.js\n
gadget_erp5_form.js\n
gadget_erp5_label_field.html\n
gadget_erp5_label_field.html\n
gadget_erp5_label_field.js\n
gadget_erp5_label_field.js\n
gadget_erp5_field_listbox.html\n
gadget_erp5_field_listbox.js\n
gadget_erp5_field_listbox.js\n
gadget_erp5_field_datetime.html\n
gadget_erp5_field_datetime.html\n
gadget_erp5_field_datetime.js\n
gadget_erp5_field_datetime.js\n
...
@@ -232,9 +219,20 @@ gadget_officejs_text_editor_install.json\n
...
@@ -232,9 +219,20 @@ gadget_officejs_text_editor_install.json\n
officejs_logo_text_editor.png\n
officejs_logo_text_editor.png\n
\n
\n
#discussion tool\n
#discussion tool\n
gadget_erp5_pt_form_view_editable.html\n
gadget_erp5_pt_form_view_editable.js\n
gadget_officejs_discussion_tool_router.html\n
gadget_officejs_discussion_tool_router.html\n
gadget_officejs_jio_html_post_view.html\n
gadget_erp5_page_ojs_controller.html\n
gadget_officejs_jio_html_post_view.js\n
gadget_erp5_page_ojs_controller.js\n
gadget_erp5_page_ojs_post_list.html\n
gadget_erp5_page_ojs_post_list.js\n
#gadget_officejs_jio_html_post_view.html\n
#gadget_officejs_jio_html_post_view.js\n
gadget_erp5_page_ojs_add_post.html\n
gadget_erp5_page_ojs_add_post.js\n
\n
gadget_erp5_field_listbox.html\n
gadget_erp5_field_listbox.js\n
\n
\n
#Ckeditor\n
#Ckeditor\n
ckeditor.gadget.html\n
ckeditor.gadget.html\n
...
@@ -716,7 +714,7 @@ NETWORK:\n
...
@@ -716,7 +714,7 @@ NETWORK:\n
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
973.
14544.10075.4932
</string>
</value>
<value>
<string>
973.
33828.18786.32665
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -734,7 +732,7 @@ NETWORK:\n
...
@@ -734,7 +732,7 @@ NETWORK:\n
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
154
8410072.15
</float>
<float>
154
9567442.36
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_post_js.xml
View file @
749c2261
...
@@ -224,7 +224,7 @@
...
@@ -224,7 +224,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
154
8320452.2
9
</float>
<float>
154
9566213.8
9
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
@@ -269,7 +269,7 @@
...
@@ -269,7 +269,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
973.
25023.19197.63385
</string>
</value>
<value>
<string>
973.
33806.29832.64307
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -287,7 +287,7 @@
...
@@ -287,7 +287,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1549
038779.7
</float>
<float>
1549
565698.61
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_post_list_js.xml
View file @
749c2261
...
@@ -287,7 +287,7 @@
...
@@ -287,7 +287,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1549
286006.65
</float>
<float>
1549
461300.51
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_html_post_view_js.xml
View file @
749c2261
...
@@ -10,11 +10,8 @@
...
@@ -10,11 +10,8 @@
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<value>
<tuple>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Manager
</string>
</tuple>
</tuple>
</value>
</value>
...
@@ -52,11 +49,8 @@
...
@@ -52,11 +49,8 @@
<key>
<string>
_View_Permission
</string>
</key>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<value>
<tuple>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Manager
</string>
</tuple>
</tuple>
</value>
</value>
...
@@ -165,7 +159,7 @@
...
@@ -165,7 +159,7 @@
<dictionary>
<dictionary>
<item>
<item>
<key>
<string>
action
</string>
</key>
<key>
<string>
action
</string>
</key>
<value>
<string>
publish_aliv
e
</string>
</value>
<value>
<string>
hid
e
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
actor
</string>
</key>
<key>
<string>
actor
</string>
</key>
...
@@ -191,7 +185,7 @@
...
@@ -191,7 +185,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
154
8258468.
7
</float>
<float>
154
9565688.0
7
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
@@ -200,7 +194,7 @@
...
@@ -200,7 +194,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
validation_state
</string>
</key>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
published_alive
</string>
</value>
<value>
<string>
hidden
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</list>
</list>
...
@@ -236,7 +230,7 @@
...
@@ -236,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
973.3
0699.43343.35106
</string>
</value>
<value>
<string>
973.3
3807.14910.57139
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -254,7 +248,7 @@
...
@@ -254,7 +248,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1549
379311.18
</float>
<float>
1549
565721.29
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
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