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
Amer
erp5
Commits
d97ff654
Commit
d97ff654
authored
5 years ago
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: get rid of add post gadget
- use action instead
parent
d31e8c3a
No related merge requests found
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
85 additions
and
64 deletions
+85
-64
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_discussion_tool_appcache.xml
..._page_module/gadget_officejs_discussion_tool_appcache.xml
+4
-4
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_any_document_js.js
...dule/gadget_officejs_erp5_page_ojs_add_any_document_js.js
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_any_document_js.xml
...ule/gadget_officejs_erp5_page_ojs_add_any_document_js.xml
+5
-11
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_post_list_js.js
...web_page_module/gadget_officejs_erp5_page_post_list_js.js
+2
-1
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
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_offline_js.xml
...eb_page_module/gadget_officejs_page_action_offline_js.xml
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_js.js
.../web_page_module/gadget_officejs_page_handle_action_js.js
+66
-40
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_js.xml
...web_page_module/gadget_officejs_page_handle_action_js.xml
+2
-2
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_discussion_tool_appcache.xml
View file @
d97ff654
...
...
@@ -232,8 +232,8 @@ gadget_erp5_page_ojs_controller.html\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_erp5_page_ojs_add_any_document.html\n
gadget_erp5_page_ojs_add_any_document.js\n
#
gadget_erp5_page_ojs_add_any_document.html\n
#
gadget_erp5_page_ojs_add_any_document.js\n
\n
#needed for appcachestorage sync\n
/\n
...
...
@@ -740,7 +740,7 @@ NETWORK:\n
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
974.60
349.22499.1160
</string>
</value>
<value>
<string>
974.60
462.54910.65109
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -758,7 +758,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>
1554
837914.89
</float>
<float>
1554
905710.65
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_any_document_js.js
View file @
d97ff654
/*global window, rJS, RSVP */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
,
Blob
)
{
(
function
(
window
,
rJS
,
RSVP
)
{
"
use strict
"
;
rJS
(
window
)
...
...
@@ -51,4 +51,4 @@
});
});
});
}(
window
,
rJS
,
RSVP
,
Blob
));
}(
window
,
rJS
,
RSVP
));
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_any_document_js.xml
View file @
d97ff654
...
...
@@ -10,11 +10,8 @@
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
</tuple>
</value>
...
...
@@ -52,11 +49,8 @@
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
</tuple>
</value>
...
...
@@ -198,7 +192,7 @@
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
publish_aliv
e
</string>
</value>
<value>
<string>
hid
e
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
...
...
@@ -224,7 +218,7 @@
</tuple>
<state>
<tuple>
<float>
1554
830683.98
</float>
<float>
1554
903150.06
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
@@ -233,7 +227,7 @@
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
published_alive
</string>
</value>
<value>
<string>
hidden
</string>
</value>
</item>
</dictionary>
</list>
...
...
@@ -269,7 +263,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
974.603
34.56052.51848
</string>
</value>
<value>
<string>
974.603
40.48045.57105
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -287,7 +281,7 @@
</tuple>
<state>
<tuple>
<float>
155483
0395.26
</float>
<float>
155483
6734.22
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_post_list_js.js
View file @
d97ff654
...
...
@@ -53,7 +53,8 @@
},
action
:
"
Base_edit
"
,
update_action
:
""
,
_links
:
{
"
type
"
:
{
name
:
""
},
"
action_object_new_content_action
"
:
{
page
:
"
ojs_add_any_document
"
,
my_source_reference
:
fake_thread_uid
}
}
//hardcoded action for new post. TODO: create corresponding configuration
_links
:
{
"
type
"
:
{
name
:
""
},
"
action_object_new_content_action
"
:
{
page
:
"
handle_action
"
,
action
:
"
new_post
"
,
my_source_reference
:
fake_thread_uid
}
}
},
form_json
=
{
erp5_document
:
{
...
...
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_post_list_js.xml
View file @
d97ff654
...
...
@@ -269,7 +269,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
974.6
0338.53030.59
904
</string>
</value>
<value>
<string>
974.6
1547.62474.32
904
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -287,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>
1554
834814.11
</float>
<float>
1554
903652.9
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_offline_js.xml
View file @
d97ff654
...
...
@@ -228,7 +228,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
974.6
0153.5925.35891
</string>
</value>
<value>
<string>
974.6
1546.47138.31283
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>
1554
819442.65
</float>
<float>
1554
903359.26
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_js.js
View file @
d97ff654
...
...
@@ -19,51 +19,77 @@
// declared methods
/////////////////////////////////////////////////////////////////
.
declareMethod
(
"
handleAction
"
,
function
(
jio_key
)
{
var
gadget
=
this
,
action_reference
;
return
gadget
.
getUrlParameter
(
"
action
"
)
.
push
(
function
(
action_parameter
)
{
action_reference
=
action_parameter
;
return
gadget
.
jio_get
(
jio_key
);
})
.
push
(
function
(
document
)
{
// This is the custom code to handle this specific reply action
if
(
action_reference
==
"
reply
"
)
{
var
doc
,
title
=
document
.
title
;
if
(
!
title
.
startsWith
(
"
Re:
"
))
{
title
=
"
Re:
"
+
document
.
title
;
}
doc
=
{
title
:
title
,
//thread parent: same as base post
source_reference
:
document
.
source_reference
,
portal_type
:
document
.
portal_type
,
parent_relative_url
:
document
.
parent_relative_url
};
return
gadget
.
jio_post
(
doc
)
.
push
(
function
(
id
)
{
return
[
id
,
action_reference
];
});
}
return
[
jio_key
,
action_reference
];
});
})
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
gadget
=
this
;
var
gadget
=
this
,
action_reference
;
return
RSVP
.
Queue
()
.
push
(
function
()
{
return
gadget
.
handleAction
(
options
.
jio_key
);
return
RSVP
.
all
([
gadget
.
getUrlParameter
(
"
action
"
),
gadget
.
getSetting
(
'
portal_type
'
),
gadget
.
getSetting
(
'
parent_relative_url
'
)
]);
})
.
push
(
function
(
action_result
)
{
return
gadget
.
redirect
({
command
:
'
change
'
,
options
:
{
page
:
undefined
,
jio_key
:
action_result
[
0
],
view
:
action_result
[
1
]
.
push
(
function
(
result
)
{
action_reference
=
result
[
0
];
// This is the custom code to handle each specific action
// TODO: move to specific gadgets by name? e.g. page: "action_" + portal_type + action_ref
if
(
action_reference
===
"
new_post
"
)
{
//TODO refactor doc creation to be reused by other actions (e.g. reply action)
// move to a js script?
var
doc
=
{
title
:
"
Untitled Document
"
,
portal_type
:
result
[
1
],
parent_relative_url
:
result
[
2
]
},
key
,
doc_key
;
for
(
key
in
options
)
{
if
(
options
.
hasOwnProperty
(
key
))
{
if
(
key
.
startsWith
(
"
my_
"
))
{
doc_key
=
key
.
replace
(
"
my_
"
,
""
);
doc
[
doc_key
]
=
options
[
key
];
}
}
}
return
gadget
.
jio_post
(
doc
)
.
push
(
function
(
id
)
{
return
gadget
.
redirect
({
command
:
'
display
'
,
options
:
{
jio_key
:
id
,
editable
:
true
}
});
});
}
if
(
action_reference
==
"
reply
"
)
{
return
gadget
.
jio_get
(
options
.
jio_key
)
.
push
(
function
(
document
)
{
var
doc
,
title
=
document
.
title
;
if
(
!
title
.
startsWith
(
"
Re:
"
))
{
title
=
"
Re:
"
+
document
.
title
;
}
doc
=
{
title
:
title
,
//thread parent: same as base post
source_reference
:
document
.
source_reference
,
portal_type
:
document
.
portal_type
,
parent_relative_url
:
document
.
parent_relative_url
};
return
gadget
.
jio_post
(
doc
)
.
push
(
function
(
id
)
{
return
gadget
.
redirect
({
command
:
"
change
"
,
options
:
{
page
:
undefined
,
jio_key
:
id
,
view
:
action_reference
}
});
});
});
}
else
{
throw
"
Action
"
+
action_reference
+
"
not implemented yet
"
;
}
});
});
});
}(
window
,
rJS
,
RSVP
));
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_js.xml
View file @
d97ff654
...
...
@@ -269,7 +269,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
974.6
0145.32757.53879
</string>
</value>
<value>
<string>
974.6
1589.61140.4744
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -287,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>
1554
818976.22
</float>
<float>
1554
905840.94
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
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