2010-01-06 17:10:08 +00:00
|
|
|
/**
|
|
|
|
* @copyright 2010 City of Bloomington, Indiana
|
2011-06-14 13:29:37 +00:00
|
|
|
* @license http://www.gnu.org/licenses/agpl.txt GNU/AGPL, see LICENSE.txt
|
2010-01-06 17:10:08 +00:00
|
|
|
* @author Cliff Ingham <inghamn@bloomington.in.gov>
|
|
|
|
*/
|
|
|
|
var COB = {};
|
|
|
|
|
|
|
|
COB.populateSections = function(cemetery_id,select_id,BASE_URL) {
|
|
|
|
var url = BASE_URL + '/cemeteries/viewCemetery.php?format=json;cemetery_id=' + cemetery_id;
|
|
|
|
|
|
|
|
YAHOO.util.Connect.asyncRequest('GET',url,{
|
|
|
|
success : function (o) {
|
|
|
|
var select = document.getElementById(select_id);
|
|
|
|
select.innerHTML = '';
|
|
|
|
select.appendChild(document.createElement('option'));
|
|
|
|
|
|
|
|
var sections = YAHOO.lang.JSON.parse(o.responseText).sections
|
|
|
|
for (i in sections) {
|
|
|
|
var option = document.createElement('option');
|
|
|
|
option.setAttribute('value',sections[i].id);
|
|
|
|
option.appendChild(document.createTextNode(sections[i].code));
|
|
|
|
select.appendChild(option);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
failure : function (o) {
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2010-01-29 18:33:16 +00:00
|
|
|
|
|
|
|
/* A handy function for doing pop-up confirmations when deleting something */
|
|
|
|
COB.deleteConfirmation = function (url) {
|
|
|
|
if (confirm("Are you really sure you want to delete this?\n\nOnce deleted it will be gone forever.")) {
|
|
|
|
document.location.href = url;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
};
|