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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
erp5
Commits
c0f6c7a7
Commit
c0f6c7a7
authored
Jan 16, 2017
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_travel_expense: group common functions and don't call several setSetting in rsvp.all
parent
8101fa34
Changes
15
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
443 additions
and
295 deletions
+443
-295
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_appcache.xml
...e/PathTemplateItem/web_page_module/gadget_hr_appcache.xml
+8
-18
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_view_html.html
...m/web_page_module/gadget_hr_expense_record_view_html.html
+1
-0
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_view_html.xml
...em/web_page_module/gadget_hr_expense_record_view_html.xml
+2
-2
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_view_js.js
...eItem/web_page_module/gadget_hr_expense_record_view_js.js
+0
-87
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_view_js.xml
...Item/web_page_module/gadget_hr_expense_record_view_js.xml
+2
-2
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_leave_request_view_html.html
...em/web_page_module/gadget_hr_leave_request_view_html.html
+1
-0
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_leave_request_view_html.xml
...tem/web_page_module/gadget_hr_leave_request_view_html.xml
+2
-2
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_leave_request_view_js.js
...teItem/web_page_module/gadget_hr_leave_request_view_js.js
+0
-89
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_leave_request_view_js.xml
...eItem/web_page_module/gadget_hr_leave_request_view_js.xml
+2
-2
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_mission_request_record_view_html.html
...ge_module/gadget_hr_mission_request_record_view_html.html
+1
-0
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_mission_request_record_view_html.xml
...age_module/gadget_hr_mission_request_record_view_html.xml
+2
-2
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_mission_request_record_view_js.js
...b_page_module/gadget_hr_mission_request_record_view_js.js
+0
-89
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_mission_request_record_view_js.xml
..._page_module/gadget_hr_mission_request_record_view_js.xml
+2
-2
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_tool_js.js
...nse/PathTemplateItem/web_page_module/gadget_hr_tool_js.js
+94
-0
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_tool_js.xml
...se/PathTemplateItem/web_page_module/gadget_hr_tool_js.xml
+326
-0
No files found.
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_appcache.xml
View file @
c0f6c7a7
...
...
@@ -66,10 +66,7 @@
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
contributor/person_module/1
</string>
<string>
contributor/person_module/2
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
@@ -200,12 +197,13 @@ chartist.min.js\n
chartist.min.css\n
gadget_hr_jio.html\n
gadget_hr_jio.js\n
gadget_officejs_jio_text_post.html\n
gadget_officejs_jio_text_post.js\n
gadget_common.js\n
gadget_officejs_page_calendar.js\n
gadget_officejs_page_calendar.html\n
gadget_hr_tool.js\n
\n
\n
\n
>
>>>>>> e7eb1b5... erp5_travel_expense: add calendar gadget to display events in a person agenda
NETWORK:\n
*
...
...
@@ -330,7 +328,7 @@ NETWORK:\n
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
supercedriclen
</string>
</value>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -344,11 +342,7 @@ NETWORK:\n
</item>
<item>
<key>
<string>
serial
</string>
</key>
<<<<<<
< HEAD
<value
>
<string>
955.64169.17995.61457
</string>
</value>
=======
<value>
<string>
956.35741.51905.15616
</string>
</value>
>>>>>>> e7eb1b5... erp5_travel_expense: add calendar gadget to display events in a person agenda
<value>
<string>
956.44619.55889.62941
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -366,11 +360,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<<<<<<
< HEAD
<float
>
1481818221.17
</float>
=======
<float>
1484044668.41
</float>
>>>>>>> e7eb1b5... erp5_travel_expense: add calendar gadget to display events in a person agenda
<float>
1484577398.16
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_view_html.html
View file @
c0f6c7a7
...
...
@@ -13,6 +13,7 @@
<script
src=
"gadget_global.js"
></script>
<script
src=
"handlebars.js"
></script>
<script
src=
"alertify.js"
></script>
<script
src=
"gadget_officejs_hr_tool.js"
></script>
<script
id=
"relation-listview-template"
type=
"text/x-handlebars-template"
>
...
...
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_view_html.xml
View file @
c0f6c7a7
...
...
@@ -246,7 +246,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
956.4
0028.61290.1433
</string>
</value>
<value>
<string>
956.4
4329.14852.21316
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -264,7 +264,7 @@
</tuple>
<state>
<tuple>
<float>
1484
312287.56
</float>
<float>
1484
576962.29
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_view_js.js
View file @
c0f6c7a7
...
...
@@ -64,17 +64,6 @@
return
doc
;
});
}
function
getWorkflowState
(
id
,
sync_flag
)
{
var
sync_state
;
if
(
id
.
indexOf
(
"
_module/
"
)
>
0
){
sync_state
=
"
Synced
"
;
}
else
if
(
sync_flag
){
sync_state
=
"
Not Synced
"
;
}
else
{
sync_state
=
"
Not Ready To Sync
"
;
}
return
sync_state
;
}
function
getTypeSelectList
(
gadget
,
doc
)
{
return
new
RSVP
.
Queue
()
...
...
@@ -104,82 +93,6 @@
});
}
function
geoLocationPromise
()
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
var
err
;
if
(
navigator
.
geolocation
)
{
navigator
.
geolocation
.
getCurrentPosition
(
function
(
result
)
{
resolve
(
result
);
},
function
(
error
)
{
switch
(
error
.
code
)
{
case
error
.
PERMISSION_DENIED
:
err
=
new
Error
(
"
User denied the request for Geolocation
"
);
break
;
case
error
.
POSITION_UNAVAILABLE
:
err
=
new
Error
(
"
Location information is unavailable
"
);
break
;
case
error
.
TIMEOUT
:
err
=
new
Error
(
"
The request to get user location timed out
"
);
break
;
default
:
err
=
new
Error
(
"
An unknown error occurred
"
);
break
;
}
reject
(
err
);
},
{
maximumAge
:
60000
,
timeout
:
20000
});
}
else
{
reject
(
new
Error
(
"
Geolocation is not supported by this browser
"
));
}
});
}
function
getSequentialID
(
gadget
,
record_type_prefix
){
var
last_sequential_id
,
prefix
,
date
=
new
Date
(),
date_text
=
date
.
getFullYear
()
+
(
'
0
'
+
(
date
.
getMonth
()
+
1
)).
slice
(
-
2
)
+
(
'
0
'
+
date
.
getDate
()).
slice
(
-
2
);
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
if
(
gadget
.
options
.
doc
.
source_reference
)
{
return
gadget
.
options
.
doc
.
source_reference
;
}
else
{
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
new
RSVP
.
all
([
gadget
.
getSetting
(
'
last_sequential_id
'
),
gadget
.
getSetting
(
'
sequential_id_prefix
'
)
]);
})
.
push
(
function
(
result_list
)
{
if
(
result_list
[
0
])
{
last_sequential_id
=
Number
(
result_list
[
0
]);
}
else
{
last_sequential_id
=
0
;
}
last_sequential_id
+=
1
;
if
(
result_list
[
1
])
{
prefix
=
result_list
[
1
];
}
else
{
prefix
=
getRandomPrefixForID
();
}
return
RSVP
.
all
([
gadget
.
setSetting
(
'
last_sequential_id
'
,
last_sequential_id
),
gadget
.
setSetting
(
'
sequential_id_prefix
'
,
prefix
)
]);
})
.
push
(
function
()
{
return
record_type_prefix
+
'
-
'
+
date_text
+
'
-
'
+
prefix
+
(
'
0000
'
+
last_sequential_id
).
slice
(
-
5
);
});
}
});
}
function
getRandomPrefixForID
(){
function
random
(){
return
65
+
Math
.
floor
(
Math
.
random
()
*
26
);
}
return
String
.
fromCharCode
(
random
())
+
String
.
fromCharCode
(
random
())
+
String
.
fromCharCode
(
random
());
}
gadget_klass
.
ready
(
function
(
g
)
{
...
...
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_view_js.xml
View file @
c0f6c7a7
...
...
@@ -242,7 +242,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
956.4
0024.27967.8789
</string>
</value>
<value>
<string>
956.4
4593.2775.8567
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>
1484
301997.49
</float>
<float>
1484
576848.98
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_leave_request_view_html.html
View file @
c0f6c7a7
...
...
@@ -12,6 +12,7 @@
<script
src=
"gadget_global.js"
></script>
<script
src=
"handlebars.js"
></script>
<script
src=
"alertify.js"
></script>
<script
src=
"gadget_officejs_hr_tool.js"
></script>
...
...
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_leave_request_view_html.xml
View file @
c0f6c7a7
...
...
@@ -246,7 +246,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
956.
37052.29099.3498
</string>
</value>
<value>
<string>
956.
44329.14852.21316
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -264,7 +264,7 @@
</tuple>
<state>
<tuple>
<float>
1484
240093.48
</float>
<float>
1484
576952.21
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_leave_request_view_js.js
View file @
c0f6c7a7
...
...
@@ -26,95 +26,6 @@
};
function
getWorkflowState
(
id
,
sync_flag
)
{
var
sync_state
;
if
(
id
.
indexOf
(
"
_module/
"
)
>
0
){
sync_state
=
"
Synced
"
;
}
else
if
(
sync_flag
){
sync_state
=
"
Not Synced
"
;
}
else
{
sync_state
=
"
Not Ready To Sync
"
;
}
return
sync_state
;
}
function
geoLocationPromise
()
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
var
err
;
if
(
navigator
.
geolocation
)
{
navigator
.
geolocation
.
getCurrentPosition
(
function
(
result
)
{
resolve
(
result
);
},
function
(
error
)
{
switch
(
error
.
code
)
{
case
error
.
PERMISSION_DENIED
:
err
=
new
Error
(
"
User denied the request for Geolocation
"
);
break
;
case
error
.
POSITION_UNAVAILABLE
:
err
=
new
Error
(
"
Location information is unavailable
"
);
break
;
case
error
.
TIMEOUT
:
err
=
new
Error
(
"
The request to get user location timed out
"
);
break
;
default
:
err
=
new
Error
(
"
An unknown error occurred
"
);
break
;
}
reject
(
err
);
},
{
maximumAge
:
60000
,
timeout
:
20000
});
}
else
{
reject
(
new
Error
(
"
Geolocation is not supported by this browser
"
));
}
});
}
function
getSequentialID
(
gadget
,
record_type_prefix
){
var
last_sequential_id
,
prefix
,
date
=
new
Date
(),
date_text
=
date
.
getFullYear
()
+
(
'
0
'
+
(
date
.
getMonth
()
+
1
)).
slice
(
-
2
)
+
(
'
0
'
+
date
.
getDate
()).
slice
(
-
2
);
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
if
(
gadget
.
options
.
doc
.
source_reference
)
{
return
gadget
.
options
.
doc
.
source_reference
;
}
else
{
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
new
RSVP
.
all
([
gadget
.
getSetting
(
'
last_sequential_id
'
),
gadget
.
getSetting
(
'
sequential_id_prefix
'
)
]);
})
.
push
(
function
(
result_list
)
{
if
(
result_list
[
0
])
{
last_sequential_id
=
Number
(
result_list
[
0
]);
}
else
{
last_sequential_id
=
0
;
}
last_sequential_id
+=
1
;
if
(
result_list
[
1
])
{
prefix
=
result_list
[
1
];
}
else
{
prefix
=
getRandomPrefixForID
();
}
return
RSVP
.
all
([
gadget
.
setSetting
(
'
last_sequential_id
'
,
last_sequential_id
),
gadget
.
setSetting
(
'
sequential_id_prefix
'
,
prefix
)
]);
})
.
push
(
function
()
{
return
record_type_prefix
+
'
-
'
+
date_text
+
'
-
'
+
prefix
+
(
'
0000
'
+
last_sequential_id
).
slice
(
-
5
);
});
}
});
}
function
getRandomPrefixForID
(){
function
random
(){
return
65
+
Math
.
floor
(
Math
.
random
()
*
26
);
}
return
String
.
fromCharCode
(
random
())
+
String
.
fromCharCode
(
random
())
+
String
.
fromCharCode
(
random
());
}
gadget_klass
.
ready
(
function
(
g
)
{
return
g
.
getElement
()
...
...
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_leave_request_view_js.xml
View file @
c0f6c7a7
...
...
@@ -244,7 +244,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
956.
38999.14763.58112
</string>
</value>
<value>
<string>
956.
44329.14852.21316
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -262,7 +262,7 @@
</tuple>
<state>
<tuple>
<float>
1484
240163.15
</float>
<float>
1484
576839.9
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_mission_request_record_view_html.html
View file @
c0f6c7a7
...
...
@@ -12,6 +12,7 @@
<script
src=
"gadget_global.js"
></script>
<script
src=
"handlebars.js"
></script>
<script
src=
"alertify.js"
></script>
<script
src=
"gadget_officejs_hr_tool.js"
></script>
...
...
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_mission_request_record_view_html.xml
View file @
c0f6c7a7
...
...
@@ -246,7 +246,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
956.
38978.20050.2259
6
</string>
</value>
<value>
<string>
956.
44329.14852.2131
6
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -264,7 +264,7 @@
</tuple>
<state>
<tuple>
<float>
1484
301861.21
</float>
<float>
1484
576937.72
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_mission_request_record_view_js.js
View file @
c0f6c7a7
...
...
@@ -42,95 +42,6 @@
});
}
function
getWorkflowState
(
id
,
sync_flag
)
{
var
sync_state
;
if
(
id
.
indexOf
(
"
_module/
"
)
>
0
){
sync_state
=
"
Synced
"
;
}
else
if
(
sync_flag
){
sync_state
=
"
Not Synced
"
;
}
else
{
sync_state
=
"
Not Ready To Sync
"
;
}
return
sync_state
;
}
function
geoLocationPromise
()
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
var
err
;
if
(
navigator
.
geolocation
)
{
navigator
.
geolocation
.
getCurrentPosition
(
function
(
result
)
{
resolve
(
result
);
},
function
(
error
)
{
switch
(
error
.
code
)
{
case
error
.
PERMISSION_DENIED
:
err
=
new
Error
(
"
User denied the request for Geolocation
"
);
break
;
case
error
.
POSITION_UNAVAILABLE
:
err
=
new
Error
(
"
Location information is unavailable
"
);
break
;
case
error
.
TIMEOUT
:
err
=
new
Error
(
"
The request to get user location timed out
"
);
break
;
default
:
err
=
new
Error
(
"
An unknown error occurred
"
);
break
;
}
reject
(
err
);
},
{
maximumAge
:
60000
,
timeout
:
20000
});
}
else
{
reject
(
new
Error
(
"
Geolocation is not supported by this browser
"
));
}
});
}
function
getSequentialID
(
gadget
,
record_type_prefix
){
var
last_sequential_id
,
prefix
,
date
=
new
Date
(),
date_text
=
date
.
getFullYear
()
+
(
'
0
'
+
(
date
.
getMonth
()
+
1
)).
slice
(
-
2
)
+
(
'
0
'
+
date
.
getDate
()).
slice
(
-
2
);
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
if
(
gadget
.
options
.
doc
.
doc_id
)
{
return
gadget
.
options
.
doc
.
doc_id
;
}
else
{
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
new
RSVP
.
all
([
gadget
.
getSetting
(
'
last_sequential_id
'
),
gadget
.
getSetting
(
'
sequential_id_prefix
'
)
]);
})
.
push
(
function
(
result_list
)
{
if
(
result_list
[
0
])
{
last_sequential_id
=
Number
(
result_list
[
0
]);
}
else
{
last_sequential_id
=
0
;
}
last_sequential_id
+=
1
;
if
(
result_list
[
1
])
{
prefix
=
result_list
[
1
];
}
else
{
prefix
=
getRandomPrefixForID
();
}
return
RSVP
.
all
([
gadget
.
setSetting
(
'
last_sequential_id
'
,
last_sequential_id
),
gadget
.
setSetting
(
'
sequential_id_prefix
'
,
prefix
)
]);
})
.
push
(
function
()
{
return
record_type_prefix
+
'
-
'
+
date_text
+
'
-
'
+
prefix
+
(
'
0000
'
+
last_sequential_id
).
slice
(
-
5
);
});
}
});
}
function
getRandomPrefixForID
(){
function
random
(){
return
65
+
Math
.
floor
(
Math
.
random
()
*
26
);
}
return
String
.
fromCharCode
(
random
())
+
String
.
fromCharCode
(
random
())
+
String
.
fromCharCode
(
random
());
}
gadget_klass
.
ready
(
function
(
g
)
{
return
g
.
getElement
()
...
...
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_mission_request_record_view_js.xml
View file @
c0f6c7a7
...
...
@@ -244,7 +244,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
956.4
0024.39635.59818
</string>
</value>
<value>
<string>
956.4
4329.14852.21316
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -262,7 +262,7 @@
</tuple>
<state>
<tuple>
<float>
1484
301994.5
</float>
<float>
1484
576818.21
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_tool_js.js
0 → 100644
View file @
c0f6c7a7
/*global window, RSVP, FileReader */
/*jslint indent: 2, maxerr: 3, unparam: true */
(
function
(
window
,
RSVP
)
{
"
use strict
"
;
window
.
getWorkflowState
=
function
(
id
,
sync_flag
)
{
var
sync_state
;
if
(
id
.
indexOf
(
"
_module/
"
)
>
0
){
sync_state
=
"
Synced
"
;
}
else
if
(
sync_flag
){
sync_state
=
"
Not Synced
"
;
}
else
{
sync_state
=
"
Not Ready To Sync
"
;
}
return
sync_state
;
};
window
.
getLocationPromise
=
function
()
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
var
err
;
if
(
navigator
.
geolocation
)
{
navigator
.
geolocation
.
getCurrentPosition
(
function
(
result
)
{
resolve
(
result
);
},
function
(
error
)
{
switch
(
error
.
code
)
{
case
error
.
PERMISSION_DENIED
:
err
=
new
Error
(
"
User denied the request for Geolocation
"
);
break
;
case
error
.
POSITION_UNAVAILABLE
:
err
=
new
Error
(
"
Location information is unavailable
"
);
break
;
case
error
.
TIMEOUT
:
err
=
new
Error
(
"
The request to get user location timed out
"
);
break
;
default
:
err
=
new
Error
(
"
An unknown error occurred
"
);
break
;
}
reject
(
err
);
},
{
maximumAge
:
60000
,
timeout
:
20000
});
}
else
{
reject
(
new
Error
(
"
Geolocation is not supported by this browser
"
));
}
});
};
window
.
getSequentialID
=
function
(
gadget
,
record_type_prefix
){
var
last_sequential_id
,
prefix
,
date
=
new
Date
(),
date_text
=
date
.
getFullYear
()
+
(
'
0
'
+
(
date
.
getMonth
()
+
1
)).
slice
(
-
2
)
+
(
'
0
'
+
date
.
getDate
()).
slice
(
-
2
);
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
if
(
gadget
.
options
.
doc
.
source_reference
)
{
return
gadget
.
options
.
doc
.
source_reference
;
}
else
{
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
new
RSVP
.
all
([
gadget
.
getSetting
(
'
last_sequential_id
'
),
gadget
.
getSetting
(
'
sequential_id_prefix
'
)
]);
})
.
push
(
function
(
result_list
)
{
if
(
result_list
[
0
])
{
last_sequential_id
=
Number
(
result_list
[
0
]);
}
else
{
last_sequential_id
=
0
;
}
last_sequential_id
+=
1
;
if
(
result_list
[
1
])
{
prefix
=
result_list
[
1
];
}
else
{
prefix
=
getRandomPrefixForID
();
}
return
gadget
.
setSetting
(
'
sequential_id_prefix
'
,
prefix
);
})
.
push
(
function
()
{
return
gadget
.
setSetting
(
'
last_sequential_id
'
,
last_sequential_id
);
})
.
push
(
function
()
{
return
record_type_prefix
+
'
-
'
+
date_text
+
'
-
'
+
prefix
+
(
'
0000
'
+
last_sequential_id
).
slice
(
-
5
);
});
}
});
};
window
.
getRandomPrefixForID
=
function
(){
function
random
(){
return
65
+
Math
.
floor
(
Math
.
random
()
*
26
);
}
return
String
.
fromCharCode
(
random
())
+
String
.
fromCharCode
(
random
())
+
String
.
fromCharCode
(
random
());
};
}(
window
,
RSVP
));
\ No newline at end of file
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_tool_js.xml
0 → 100644
View file @
c0f6c7a7
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