Revision 795,
1.1 KB
checked in by viani, 15 years ago
(diff) |
Ticket #488 - Inclusão do módulo workflow no ramo trunk do repositório Expresso.
|
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[795] | 1 | var cities = function(data) |
---|
| 2 | { |
---|
| 3 | if (typeof(data) == "string") |
---|
| 4 | { |
---|
| 5 | write_errors(data); |
---|
| 6 | return false; |
---|
| 7 | } |
---|
| 8 | else |
---|
| 9 | { |
---|
| 10 | var container = document.getElementById(data["target"]); |
---|
| 11 | container.innerHTML = ""; |
---|
| 12 | container.disabled = true; |
---|
| 13 | fill_combo(data["target"], data["cities"]); |
---|
| 14 | container.disabled = false; |
---|
| 15 | return true; |
---|
| 16 | } |
---|
| 17 | }; |
---|
| 18 | |
---|
| 19 | function draw_cities(target, state_id, callback, handleExpiredSessions) |
---|
| 20 | { |
---|
| 21 | cExecute("$this.bo_utils.get_cities", |
---|
| 22 | function (data) |
---|
| 23 | { |
---|
| 24 | if (data['error']) |
---|
| 25 | { |
---|
| 26 | alert(data['error'].replace(/<br \/>/gi, "\n")); |
---|
| 27 | if (data['url']) |
---|
| 28 | if (handleExpiredSessions) |
---|
| 29 | window.location = data['url'].replace(/\.\./gi, "."); |
---|
| 30 | |
---|
| 31 | return; |
---|
| 32 | } |
---|
| 33 | if (cities(data)) |
---|
| 34 | { |
---|
| 35 | if (callback) |
---|
| 36 | { |
---|
| 37 | callback(); |
---|
| 38 | } |
---|
| 39 | } |
---|
| 40 | } |
---|
| 41 | , "state_id=" + state_id + "&target=" + target); |
---|
| 42 | } |
---|
| 43 | |
---|
| 44 | function fill_combo(target, cities) |
---|
| 45 | { |
---|
| 46 | var container = document.getElementById(target); |
---|
| 47 | |
---|
| 48 | for (var i = 0; i < cities.length; i++) |
---|
| 49 | { |
---|
| 50 | var option = document.createElement("option"); |
---|
| 51 | option.innerHTML = cities[i].name; |
---|
| 52 | option.value = cities[i].id; |
---|
| 53 | container.appendChild(option); |
---|
| 54 | } |
---|
| 55 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.