Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ecommerce-ui
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
nexedi
ecommerce-ui
Commits
1b1a7d15
Commit
1b1a7d15
authored
May 15, 2014
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app: add update_bip method to allow sticky put
parent
0359eb06
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
4 deletions
+73
-4
data/personal_data.json
data/personal_data.json
+1
-1
js/erp5_loader.js
js/erp5_loader.js
+72
-3
No files found.
data/personal_data.json
View file @
1b1a7d15
...
@@ -127,7 +127,7 @@
...
@@ -127,7 +127,7 @@
},
{
},
{
"type"
:
"input"
,
"type"
:
"input"
,
"direct"
:
{
"className"
:
"action translate"
},
"direct"
:
{
"className"
:
"action translate"
},
"attributes"
:
{
"type"
:
"submit"
,
"data-action"
:
"update"
,
"data-icon"
:
"carat-r"
,
"data-theme"
:
"active"
,
"data-i18n"
:
"[value]portal_type_dict.sales_order_dict.text_dict.proceed"
},
"attributes"
:
{
"type"
:
"submit"
,
"data-action"
:
"update
_bip
"
,
"data-icon"
:
"carat-r"
,
"data-theme"
:
"active"
,
"data-i18n"
:
"[value]portal_type_dict.sales_order_dict.text_dict.proceed"
},
"logic"
:
{
"wrapper_class_list"
:
" ui-last-child "
}
"logic"
:
{
"wrapper_class_list"
:
" ui-last-child "
}
}]
}]
}
}
...
...
js/erp5_loader.js
View file @
1b1a7d15
...
@@ -1632,7 +1632,8 @@
...
@@ -1632,7 +1632,8 @@
"
placeholder
"
:
captcha
,
"
placeholder
"
:
captcha
,
"
target
"
:
wrap
,
"
target
"
:
wrap
,
"
target_selector
"
:
"
first
"
,
"
target_selector
"
:
"
first
"
,
"
reverse
"
:
spec
.
reverse
||
null
"
reverse
"
:
spec
.
reverse
||
null
,
"
reference
"
:
spec
.
reference
};
};
};
};
...
@@ -2588,7 +2589,7 @@
...
@@ -2588,7 +2589,7 @@
"
direct
"
:
{
"
direct
"
:
{
"
id
"
:
"
select_
"
+
(
spec
.
id
||
id
),
"
id
"
:
"
select_
"
+
(
spec
.
id
||
id
),
"
name
"
:
"
select_
"
+
"
name
"
:
"
select_
"
+
(
is_type
?
(
spec
.
id
||
id
)
:
config
.
id
),
(
is_type
?
(
spec
.
id
||
id
)
:
(
spec
.
id
||
id
||
config
.
id
).
slice
(
0
,
-
2
)
),
"
className
"
:
spec
.
action
?
"
action
"
:
""
"
className
"
:
spec
.
action
?
"
action
"
:
""
},
},
"
attributes
"
:
input_dict
,
"
attributes
"
:
input_dict
,
...
@@ -3045,6 +3046,62 @@
...
@@ -3045,6 +3046,62 @@
storage
.
fetch
(
obj
);
storage
.
fetch
(
obj
);
},
},
/**
* PUT an object
* @method update
* @param {object} obj Action Object
**/
"
update_bip
"
:
function
(
obj
)
{
var
identifier
,
element_list
,
i
,
len
,
value
=
undefined
;
if
(
obj
.
form
)
{
element_list
=
obj
.
form
.
getElementsByTagName
(
"
input
"
);
for
(
i
=
0
,
len
=
element_list
.
length
;
i
<
len
;
i
+=
1
)
{
if
(
element_list
[
i
].
name
===
"
identifier
"
)
{
value
=
element_list
[
i
].
value
;
}
}
}
if
(
value
)
{
return
storage
.
fetch
({
"
query
"
:
{
"
_id
"
:
value
},
"
pass
"
:
obj
.
pass
||
{}
})
.
then
(
function
(
reply
)
{
obj
.
backpack
=
reply
.
response
.
data
.
rows
[
0
].
doc
;
})
.
then
(
function
()
{
return
storage
.
write
(
obj
)
.
then
(
function
(
response
)
{
app
.
util
.
loader
(
""
,
"
status_dict.saved
"
,
"
check
"
);
app
.
navigate
(
obj
,
response
);
})
.
fail
(
function
(
error
)
{
switch
(
error
.
status
)
{
case
408
:
app
.
util
.
loader
(
""
,
"
status_dict.timeout
"
,
"
clock-o
"
);
break
;
case
400
:
app
.
util
.
loader
(
""
,
"
validation_dict.general
"
,
"
ban
"
);
break
;
default
:
app
.
util
.
loader
(
""
,
"
status_dict.error
"
,
"
ban
"
);
break
;
}
});
})
.
fail
(
app
.
util
.
error
);
}
else
{
return
storage
.
write
(
obj
)
.
then
(
function
(
response
)
{
app
.
util
.
loader
(
""
,
"
status_dict.saved
"
,
"
check
"
);
app
.
navigate
(
obj
,
response
);
})
.
fail
(
function
(
error
)
{
switch
(
error
.
status
)
{
case
408
:
app
.
util
.
loader
(
""
,
"
status_dict.timeout
"
,
"
clock-o
"
);
break
;
case
400
:
app
.
util
.
loader
(
""
,
"
validation_dict.general
"
,
"
ban
"
);
break
;
default
:
app
.
util
.
loader
(
""
,
"
status_dict.error
"
,
"
ban
"
);
break
;
}
});
}
},
/**
/**
* PUT an object
* PUT an object
* @method update
* @method update
...
@@ -4092,6 +4149,8 @@
...
@@ -4092,6 +4149,8 @@
for
(
m
=
0
;
m
<
section_response_list
.
length
;
m
+=
1
)
{
for
(
m
=
0
;
m
<
section_response_list
.
length
;
m
+=
1
)
{
helper
.
children
.
push
(
section_response_list
[
m
]);
helper
.
children
.
push
(
section_response_list
[
m
]);
}
}
// HACK for Thierry
helper
.
reference
=
helper
.
property_dict
.
reference
=
spec
.
wrapper
.
reference
;
return
RSVP
.
resolve
(
helper
);
return
RSVP
.
resolve
(
helper
);
})
})
...
@@ -4248,6 +4307,11 @@
...
@@ -4248,6 +4307,11 @@
if
(
valid
)
{
if
(
valid
)
{
data
=
obj
.
sample_data
||
storage
.
parseForm
(
valid
,
prefix
,
true
);
data
=
obj
.
sample_data
||
storage
.
parseForm
(
valid
,
prefix
,
true
);
// HACK: Thierry
if
(
obj
.
backpack
)
{
data
=
util
.
mergeObject
(
obj
.
backpack
,
data
);
}
// TODO: remove, used for update scope, doesn't honor form definition
// TODO: remove, used for update scope, doesn't honor form definition
if
(
obj
.
force_data
)
{
if
(
obj
.
force_data
)
{
config
.
_force_data
=
true
;
config
.
_force_data
=
true
;
...
@@ -4545,7 +4609,7 @@
...
@@ -4545,7 +4609,7 @@
break
;
break
;
default
:
default
:
if
(
plain
)
{
if
(
plain
)
{
container
[
property
.
replace
(
clean
,
""
)]
=
value
;
container
[
property
.
replace
(
clean
,
""
)
.
replace
(
"
select_
"
,
""
)
]
=
value
;
}
else
{
}
else
{
container
.
append
(
property
.
replace
(
clean
,
""
),
value
);
container
.
append
(
property
.
replace
(
clean
,
""
),
value
);
}
}
...
@@ -6735,6 +6799,11 @@
...
@@ -6735,6 +6799,11 @@
}
}
}
}
// HACK for Thierry to pass reference into custom fields
if
(
wrapper
.
reference
)
{
kid
.
reference
=
wrapper
.
reference
;
}
// set classes
// set classes
if
(
is_html
)
{
if
(
is_html
)
{
kid
.
direct
.
className
=
(
kid
.
direct
.
className
||
""
)
+
kid
.
direct
.
className
=
(
kid
.
direct
.
className
||
""
)
+
...
...
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