houdini/client/js/tickets/new.js
Bradley M. Kuhn fc77ee76d6 Relicense Javascript code in accordance with project's new license
The primary license of the project is changing to:
  AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later

The Additional Permission is designed to permit publicly distributed
Javascript code to be relicensed under LGPL-3.0-or-later, but not server-side
Javascript code.  As such, we've relicensed here static Javscript files under
LGPL-3.0-or-later, and those that run as part of build and/or server side
under AGPL-3.0-or-later.

Note that in future, Javascript files may be updated to be stronger copyleft
license with the Additional Permission, particularly if they adapted to run
on server side and/or turned into templates.  Of course, we'd seek public
discussion with the contributor community about such changes.

This commit is one of the many steps to relicense the entire codebase.

Documentation granting permission for this relicensing (from all past
contributors who hold copyrights) is on file with Software Freedom
Conservancy, Inc.
2018-03-25 15:10:40 -04:00

32 lines
1 KiB
JavaScript

// License: LGPL-3.0-or-later
var path = '/nonprofits/' + app.nonprofit_id + '/events/' + appl.event_id + '/ticket_levels'
var indexTicketLevels = require('../ticket_levels/manage')
var formSerialize = require('form-serialize')
var request = require('../common/super-agent-promise')
require('../components/wizard')
require('./wizard')
appl.def('show_new_tickets', function(){
// indexes ticket levels before showing the new ticket modal
// so that ticket level quantites are up-to-date.
// indexTicketLevels takes the path and a callback
indexTicketLevels(path, show_new_modal)
})
appl.def('add_ticket_note', function(n) {
var data = formSerialize(appl.prev_elem(n), {hash: true})
appl.def('loading', true)
request.put('/nonprofits/' + app.nonprofit_id + '/events/' + app.event_id + '/tickets/' + appl.created_ticket_id + '/add_note')
.send({ticket: data})
.perform()
.then(function(resp) {
appl.def('loading', false)
appl.close_modal()
})
})
function show_new_modal(){
appl.open_modal('newTicketModal')
}