--- /dev/null
+// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt
+
+/*
+ +--------------------------------------------------------------------+
+ | CiviCRM version 4.4 |
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC (c) 2004-2013 |
+ +--------------------------------------------------------------------+
+ | This file is a part of CiviCRM. |
+ | |
+ | CiviCRM is free software; you can copy, modify, and distribute it |
+ | under the terms of the GNU Affero General Public License |
+ | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
+ | |
+ | CiviCRM is distributed in the hope that it will be useful, but |
+ | WITHOUT ANY WARRANTY; without even the implied warranty of |
+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
+ | See the GNU Affero General Public License for more details. |
+ | |
+ | You should have received a copy of the GNU Affero General Public |
+ | License and the CiviCRM Licensing Exception along |
+ | with this program; if not, contact CiviCRM LLC |
+ | at info[AT]civicrm[DOT]org. If you have questions about the |
+ | GNU Affero General Public License or the licensing of CiviCRM, |
+ | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ +--------------------------------------------------------------------+
+ */
+
+/**
+ * @file: global functions for CiviCRM
+ * FIXME: We are moving away from using global functions. DO NOT ADD MORE.
+ * @see CRM object - the better alternative to adding global functions
+ */
+
+var CRM = CRM || {};
+var cj = jQuery;
+
+/**
+ * Short-named function for string translation, defined in global scope so it's available everywhere.
+ *
+ * @param $text string string for translating
+ * @param $params object key:value of additional parameters
+ *
+ * @return string the translated string
+ */
+function ts(text, params) {
+ "use strict";
+ text = CRM.strings[text] || text;
+ if (typeof(params) === 'object') {
+ for (var i in params) {
+ if (typeof(params[i]) === 'string' || typeof(params[i]) === 'number') {
+ // sprintf emulation: escape % characters in the replacements to avoid conflicts
+ text = text.replace(new RegExp('%' + i, 'g'), String(params[i]).replace(/%/g, '%-crmescaped-'));
+ }
+ }
+ return text.replace(/%-crmescaped-/g, '%');
+ }
+ return text;
+}
+
+/**
+ * This function is called by default at the bottom of template files which have forms that have
+ * conditionally displayed/hidden sections and elements. The PHP is responsible for generating
+ * a list of 'blocks to show' and 'blocks to hide' and the template passes these parameters to
+ * this function.
+ *
+ * @access public
+ * @param showBlocks Array of element Id's to be displayed
+ * @param hideBlocks Array of element Id's to be hidden
+ * @param elementType Value to set display style to for showBlocks (e.g. 'block' or 'table-row' or ...)
+ * @return none
+ */
+function on_load_init_blocks(showBlocks, hideBlocks, elementType) {
+ if (elementType == null) {
+ var elementType = 'block';
+ }
+
+ /* This loop is used to display the blocks whose IDs are present within the showBlocks array */
+ for (var i = 0; i < showBlocks.length; i++) {
+ var myElement = document.getElementById(showBlocks[i]);
+ /* getElementById returns null if element id doesn't exist in the document */
+ if (myElement != null) {
+ myElement.style.display = elementType;
+ }
+ else {
+ alert('showBlocks array item not in .tpl = ' + showBlocks[i]);
+ }
+ }
+
+ /* This loop is used to hide the blocks whose IDs are present within the hideBlocks array */
+ for (var i = 0; i < hideBlocks.length; i++) {
+ var myElement = document.getElementById(hideBlocks[i]);
+ /* getElementById returns null if element id doesn't exist in the document */
+ if (myElement != null) {
+ myElement.style.display = 'none';
+ }
+ else {
+ alert('showBlocks array item not in .tpl = ' + hideBlocks[i]);
+ }
+ }
+}
+
+/**
+ * This function is called when we need to show or hide a related form element (target_element)
+ * based on the value (trigger_value) of another form field (trigger_field).
+ *
+ * @access public
+ * @param trigger_field_id HTML id of field whose onchange is the trigger
+ * @param trigger_value List of integers - option value(s) which trigger show-element action for target_field
+ * @param target_element_id HTML id of element to be shown or hidden
+ * @param target_element_type Type of element to be shown or hidden ('block' or 'table-row')
+ * @param field_type Type of element radio/select
+ * @param invert Boolean - if true, we HIDE target on value match; if false, we SHOW target on value match
+ * @return none
+ */
+function showHideByValue(trigger_field_id, trigger_value, target_element_id, target_element_type, field_type, invert) {
+ if (target_element_type == null) {
+ var target_element_type = 'block';
+ }
+ else {
+ if (target_element_type == 'table-row') {
+ var target_element_type = '';
+ }
+ }
+
+ if (field_type == 'select') {
+ var trigger = trigger_value.split("|");
+ var selectedOptionValue = document.getElementById(trigger_field_id).options[document.getElementById(trigger_field_id).selectedIndex].value;
+
+ var target = target_element_id.split("|");
+ for (var j = 0; j < target.length; j++) {
+ if (invert) {
+ cj('#' + target[j]).show();
+ }
+ else {
+ cj('#' + target[j]).hide();
+ }
+ for (var i = 0; i < trigger.length; i++) {
+ if (selectedOptionValue == trigger[i]) {
+ if (invert) {
+ cj('#' + target[j]).hide();
+ }
+ else {
+ cj('#' + target[j]).show();
+ }
+ }
+ }
+ }
+
+ }
+ else {
+ if (field_type == 'radio') {
+ var target = target_element_id.split("|");
+ for (var j = 0; j < target.length; j++) {
+ if (document.getElementsByName(trigger_field_id)[0].checked) {
+ if (invert) {
+ cj('#' + target[j]).hide();
+ }
+ else {
+ cj('#' + target[j]).show();
+ }
+ }
+ else {
+ if (invert) {
+ cj('#' + target[j]).show();
+ }
+ else {
+ cj('#' + target[j]).hide();
+ }
+ }
+ }
+ }
+ }
+}
+
+/**
+ *
+ * Function for checking ALL or unchecking ALL check boxes in a resultset page.
+ *
+ * @access public
+ * @param fldPrefix - common string which precedes unique checkbox ID and identifies field as
+ * belonging to the resultset's checkbox collection
+ * @param object - checkbox
+ * Sample usage: onClick="javascript:changeCheckboxValues('chk_', cj(this) );"
+ *
+ * @return
+ */
+function toggleCheckboxVals(fldPrefix, object) {
+ if (object.id == 'toggleSelect' && cj(object).is(':checked')) {
+ cj('Input[id*="' + fldPrefix + '"],Input[id*="toggleSelect"]').attr('checked', true);
+ }
+ else {
+ cj('Input[id*="' + fldPrefix + '"],Input[id*="toggleSelect"]').attr('checked', false);
+ }
+ // change the class of selected rows
+ on_load_init_checkboxes(object.form.name);
+}
+
+function countSelectedCheckboxes(fldPrefix, form) {
+ fieldCount = 0;
+ for (i = 0; i < form.elements.length; i++) {
+ fpLen = fldPrefix.length;
+ if (form.elements[i].type == 'checkbox' && form.elements[i].name.slice(0, fpLen) == fldPrefix && form.elements[i].checked == true) {
+ fieldCount++;
+ }
+ }
+ return fieldCount;
+}
+
+/**
+ * Function to enable task action select
+ */
+function toggleTaskAction(status) {
+ var radio_ts = document.getElementsByName('radio_ts');
+ if (!radio_ts[1]) {
+ radio_ts[0].checked = true;
+ }
+ if (radio_ts[0].checked || radio_ts[1].checked) {
+ status = true;
+ }
+
+ var formElements = ['task', 'Go', 'Print'];
+ for (var i = 0; i < formElements.length; i++) {
+ var element = document.getElementById(formElements[i]);
+ if (element) {
+ if (status) {
+ element.disabled = false;
+ }
+ else {
+ element.disabled = true;
+ }
+ }
+ }
+}
+
+/**
+ * This function is used to check if any actio is selected and also to check if any contacts are checked.
+ *
+ * @access public
+ * @param fldPrefix - common string which precedes unique checkbox ID and identifies field as
+ * belonging to the resultset's checkbox collection
+ * @param form - name of form that checkboxes are part of
+ * Sample usage: onClick="javascript:checkPerformAction('chk_', myForm );"
+ *
+ */
+function checkPerformAction(fldPrefix, form, taskButton, selection) {
+ var cnt;
+ var gotTask = 0;
+
+ // taskButton TRUE means we don't need to check the 'task' field - it's a button-driven task
+ if (taskButton == 1) {
+ gotTask = 1;
+ }
+ else {
+ if (document.forms[form].task.selectedIndex) {
+ //force user to select all search contacts, CRM-3711
+ if (document.forms[form].task.value == 13 || document.forms[form].task.value == 14) {
+ var toggleSelect = document.getElementsByName('toggleSelect');
+ if (toggleSelect[0].checked || document.forms[form].radio_ts[0].checked) {
+ return true;
+ }
+ else {
+ alert("Please select all contacts for this action.\n\nTo use the entire set of search results, click the 'all records' radio button.");
+ return false;
+ }
+ }
+ gotTask = 1;
+ }
+ }
+
+ if (gotTask == 1) {
+ // If user wants to perform action on ALL records and we have a task, return (no need to check further)
+ if (document.forms[form].radio_ts[0].checked) {
+ return true;
+ }
+
+ cnt = (selection == 1) ? countSelections() : countSelectedCheckboxes(fldPrefix, document.forms[form]);
+ if (!cnt) {
+ alert("Please select one or more contacts for this action.\n\nTo use the entire set of search results, click the 'all records' radio button.");
+ return false;
+ }
+ }
+ else {
+ alert("Please select an action from the drop-down menu.");
+ return false;
+ }
+}
+
+/**
+ * This function changes the style for a checkbox block when it is selected.
+ *
+ * @access public
+ * @param chkName - it is name of the checkbox
+ * @return null
+ */
+function checkSelectedBox(chkName) {
+ var checkElement = cj('#' + chkName);
+ if (checkElement.attr('checked')) {
+ cj('input[value=ts_sel]:radio').attr('checked', true);
+ checkElement.parents('tr').addClass('crm-row-selected');
+ }
+ else {
+ checkElement.parents('tr').removeClass('crm-row-selected');
+ }
+}
+
+/**
+ * This function is to show the row with selected checkbox in different color
+ * @param form - name of form that checkboxes are part of
+ *
+ * @access public
+ * @return null
+ */
+function on_load_init_checkboxes(form) {
+ var formName = form;
+ var fldPrefix = 'mark_x';
+ for (i = 0; i < document.forms[formName].elements.length; i++) {
+ fpLen = fldPrefix.length;
+ if (document.forms[formName].elements[i].type == 'checkbox' && document.forms[formName].elements[i].name.slice(0, fpLen) == fldPrefix) {
+ checkSelectedBox(document.forms[formName].elements[i].name, formName);
+ }
+ }
+}
+
+/**
+ * Function to change the color of the class
+ *
+ * @param form - name of the form
+ * @param rowid - id of the <tr>, <div> you want to change
+ *
+ * @access public
+ * @return null
+ */
+function changeRowColor(rowid, form) {
+ switch (document.getElementById(rowid).className) {
+ case 'even-row' :
+ document.getElementById(rowid).className = 'selected even-row';
+ break;
+ case 'odd-row' :
+ document.getElementById(rowid).className = 'selected odd-row';
+ break;
+ case 'selected even-row' :
+ document.getElementById(rowid).className = 'even-row';
+ break;
+ case 'selected odd-row' :
+ document.getElementById(rowid).className = 'odd-row';
+ break;
+ case 'form-item' :
+ document.getElementById(rowid).className = 'selected';
+ break;
+ case 'selected' :
+ document.getElementById(rowid).className = 'form-item';
+ }
+}
+
+/**
+ * This function is to show the row with selected checkbox in different color
+ * @param form - name of form that checkboxes are part of
+ *
+ * @access public
+ * @return null
+ */
+function on_load_init_check(form) {
+ for (i = 0; i < document.forms[form].elements.length; i++) {
+ if (( document.forms[form].elements[i].type == 'checkbox'
+ && document.forms[form].elements[i].checked == true )
+ || ( document.forms[form].elements[i].type == 'hidden'
+ && document.forms[form].elements[i].value == 1 )) {
+ var ss = document.forms[form].elements[i].id;
+ var row = 'rowid' + ss;
+ changeRowColor(row, form);
+ }
+ }
+}
+
+/**
+ * reset all the radio buttons with a given name
+ *
+ * @param string fieldName
+ * @param object form
+ * @return null
+ */
+function unselectRadio(fieldName, form) {
+ for (i = 0; i < document.forms[form].elements.length; i++) {
+ if (document.forms[form].elements[i].name == fieldName) {
+ document.forms[form].elements[i].checked = false;
+ }
+ }
+ return;
+}
+
+/**
+ * Function to change button text and disable one it is clicked
+ *
+ * @param obj object - the button clicked
+ * @param formID string - the id of the form being submitted
+ * @param string procText - button text after user clicks it
+ * @return null
+ */
+var submitcount = 0;
+/* Changes button label on submit, and disables button after submit for newer browsers.
+ Puts up alert for older browsers. */
+function submitOnce(obj, formId, procText) {
+ // if named button clicked, change text
+ if (obj.value != null) {
+ obj.value = procText + " ...";
+ }
+ if (document.getElementById) { // disable submit button for newer browsers
+ obj.disabled = true;
+ document.getElementById(formId).submit();
+ return true;
+ }
+ else { // for older browsers
+ if (submitcount == 0) {
+ submitcount++;
+ return true;
+ }
+ else {
+ alert("Your request is currently being processed ... Please wait.");
+ return false;
+ }
+ }
+}
+
+function popUp(URL) {
+ day = new Date();
+ id = day.getTime();
+ eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=640,height=420,left = 202,top = 184');");
+}
+
+/**
+ * Function to show / hide the row in optionFields
+ *
+ * @param element name index, that whose innerHTML is to hide else will show the hidden row.
+ */
+function showHideRow(index) {
+ if (index) {
+ cj('tr#optionField_' + index).hide();
+ if (cj('table#optionField tr:hidden:first').length) {
+ cj('div#optionFieldLink').show();
+ }
+ }
+ else {
+ cj('table#optionField tr:hidden:first').show();
+ if (!cj('table#optionField tr:hidden:last').length) {
+ cj('div#optionFieldLink').hide();
+ }
+ }
+ return false;
+}
+
+CRM.strings = CRM.strings || {};
+CRM.validate = CRM.validate || {
+ params: {},
+ functions: []
+};
+
+(function ($, undefined) {
+ "use strict";
+ $(document).ready(function () {
+ $().crmtooltip();
+ $('.crm-container table.row-highlight').on('change', 'input.select-row, input.select-rows', function () {
+ var target, table = $(this).closest('table');
+ if ($(this).hasClass('select-rows')) {
+ target = $('tbody tr', table);
+ $('input.select-row', table).prop('checked', $(this).prop('checked'));
+ }
+ else {
+ target = $(this).closest('tr');
+ $('input.select-rows', table).prop('checked', $(".select-row:not(':checked')", table).length < 1);
+ }
+ target.toggleClass('crm-row-selected', $(this).is(':checked'));
+ });
+ $('#crm-container').live('click', function (event) {
+ if ($(event.target).is('.btn-slide')) {
+ var currentActive = $('#crm-container .btn-slide-active');
+ currentActive.children().hide();
+ currentActive.removeClass('btn-slide-active');
+ $(event.target).children().show();
+ $(event.target).addClass('btn-slide-active');
+ }
+ else {
+ $('.btn-slide .panel').hide();
+ $('.btn-slide-active').removeClass('btn-slide-active');
+ }
+ });
+ });
+
+ /**
+ * Function to make multiselect boxes behave as fields in small screens
+ */
+ function advmultiselectResize() {
+ var amswidth = $("#crm-container form:has(table.advmultiselect)").width();
+ if (amswidth < 700) {
+ $("form table.advmultiselect td").css('display', 'block');
+ }
+ else {
+ $("form table.advmultiselect td").css('display', 'table-cell');
+ }
+ var contactwidth = $('#crm-container #mainTabContainer').width();
+ if (contactwidth < 600) {
+ $('#crm-container #mainTabContainer').addClass('narrowpage');
+ $('#crm-container #mainTabContainer.narrowpage #contactTopBar td').each(function (index) {
+ if (index > 1) {
+ if (index % 2 == 0) {
+ $(this).parent().after('<tr class="narrowadded"></tr>');
+ }
+ var item = $(this);
+ $(this).parent().next().append(item);
+ }
+ });
+ }
+ else {
+ $('#crm-container #mainTabContainer.narrowpage').removeClass('narrowpage');
+ $('#crm-container #mainTabContainer #contactTopBar tr.narrowadded td').each(function () {
+ var nitem = $(this);
+ var parent = $(this).parent();
+ $(this).parent().prev().append(nitem);
+ if (parent.children().size() == 0) {
+ parent.remove();
+ }
+ });
+ $('#crm-container #mainTabContainer.narrowpage #contactTopBar tr.added').detach();
+ }
+ var cformwidth = $('#crm-container #Contact .contact_basic_information-section').width();
+
+ if (cformwidth < 720) {
+ $('#crm-container .contact_basic_information-section').addClass('narrowform');
+ $('#crm-container .contact_basic_information-section table.form-layout-compressed td .helpicon').parent().addClass('hashelpicon');
+ if (cformwidth < 480) {
+ $('#crm-container .contact_basic_information-section').addClass('xnarrowform');
+ }
+ else {
+ $('#crm-container .contact_basic_information-section.xnarrowform').removeClass('xnarrowform');
+ }
+ }
+ else {
+ $('#crm-container .contact_basic_information-section.narrowform').removeClass('narrowform');
+ $('#crm-container .contact_basic_information-section.xnarrowform').removeClass('xnarrowform');
+ }
+ }
+
+ advmultiselectResize();
+ $(window).resize(function () {
+ advmultiselectResize();
+ });
+
+ $.fn.crmtooltip = function () {
+ $(document)
+ .on('mouseover', 'a.crm-summary-link:not(.crm-processed)', function (e) {
+ $(this).addClass('crm-processed');
+ $(this).addClass('crm-tooltip-active');
+ var topDistance = e.pageY - $(window).scrollTop();
+ if (topDistance < 300 | topDistance < $(this).children('.crm-tooltip-wrapper').height()) {
+ $(this).addClass('crm-tooltip-down');
+ }
+ if (!$(this).children('.crm-tooltip-wrapper').length) {
+ $(this).append('<div class="crm-tooltip-wrapper"><div class="crm-tooltip"></div></div>');
+ $(this).children().children('.crm-tooltip')
+ .html('<div class="crm-loading-element"></div>')
+ .load(this.href);
+ }
+ })
+ .on('mouseout', 'a.crm-summary-link', function () {
+ $(this).removeClass('crm-processed');
+ $(this).removeClass('crm-tooltip-active crm-tooltip-down');
+ })
+ .on('click', 'a.crm-summary-link', false);
+ };
+
+ var h;
+ CRM.help = function (title, params, url) {
+ h && h.close && h.close();
+ var options = {
+ expires: 0
+ };
+ h = CRM.alert('...', title, 'crm-help crm-msg-loading', options);
+ params.class_name = 'CRM_Core_Page_Inline_Help';
+ params.type = 'page';
+ $.ajax(url || CRM.url('civicrm/ajax/inline'),
+ {
+ data: params,
+ dataType: 'html',
+ success: function (data) {
+ $('#crm-notification-container .crm-help .notify-content:last').html(data);
+ $('#crm-notification-container .crm-help').removeClass('crm-msg-loading').addClass('info');
+ },
+ error: function () {
+ $('#crm-notification-container .crm-help .notify-content:last').html('Unable to load help file.');
+ $('#crm-notification-container .crm-help').removeClass('crm-msg-loading').addClass('error');
+ }
+ }
+ );
+ };
+
+ /**
+ * @param string text Displayable message
+ * @param string title Displayable title
+ * @param string type 'alert'|'info'|'success'|'error' (default: 'alert')
+ * @param {object} options
+ * @return {*}
+ * @see http://wiki.civicrm.org/confluence/display/CRM/Notifications+in+CiviCRM
+ */
+ CRM.alert = function (text, title, type, options) {
+ type = type || 'alert';
+ title = title || '';
+ options = options || {};
+ if ($('#crm-notification-container').length) {
+ var params = {
+ text: text,
+ title: title,
+ type: type
+ };
+ // By default, don't expire errors and messages containing links
+ var extra = {
+ expires: (type == 'error' || text.indexOf('<a ') > -1) ? 0 : (text ? 10000 : 5000),
+ unique: true
+ };
+ options = $.extend(extra, options);
+ options.expires = options.expires === false ? 0 : parseInt(options.expires, 10);
+ if (options.unique && options.unique !== '0') {
+ $('#crm-notification-container .ui-notify-message').each(function () {
+ if (title === $('h1', this).html() && text === $('.notify-content', this).html()) {
+ $('.icon.ui-notify-close', this).click();
+ }
+ });
+ }
+ return $('#crm-notification-container').notify('create', params, options);
+ }
+ else {
+ if (title.length) {
+ text = title + "\n" + text;
+ }
+ alert(text);
+ return null;
+ }
+ };
+
+ /**
+ * Close whichever alert contains the given node
+ *
+ * @param node
+ */
+ CRM.closeAlertByChild = function (node) {
+ $(node).closest('.ui-notify-message').find('.icon.ui-notify-close').click();
+ };
+
+ /**
+ * Prompt the user for confirmation.
+ *
+ * @param buttons {object|function} key|value pairs where key == button label and value == callback function
+ * passing in a function instead of an object is a shortcut for a sinlgle button labeled "Continue"
+ * @param options {object|void} Override defaults, keys include 'title', 'message',
+ * see jQuery.dialog for full list of available params
+ */
+ CRM.confirm = function (buttons, options, cancelLabel) {
+ var dialog, callbacks = {};
+ cancelLabel = cancelLabel || ts('Cancel');
+ var settings = {
+ title: ts('Confirm Action'),
+ message: ts('Are you sure you want to continue?'),
+ resizable: false,
+ modal: true,
+ width: 'auto',
+ close: function () {
+ $(dialog).remove();
+ },
+ buttons: {}
+ };
+
+ settings.buttons[cancelLabel] = function () {
+ dialog.dialog('close');
+ };
+ options = options || {};
+ $.extend(settings, options);
+ if (typeof(buttons) === 'function') {
+ callbacks[ts('Continue')] = buttons;
+ }
+ else {
+ callbacks = buttons;
+ }
+ $.each(callbacks, function (label, callback) {
+ settings.buttons[label] = function () {
+ callback.call(dialog);
+ dialog.dialog('close');
+ };
+ });
+ dialog = $('<div class="crm-container crm-confirm-dialog"></div>')
+ .html(options.message)
+ .appendTo('body')
+ .dialog(settings);
+ return dialog;
+ };
+
+ /**
+ * Sets an error message
+ * If called for a form item, title and removal condition will be handled automatically
+ */
+ $.fn.crmError = function (text, title, options) {
+ title = title || '';
+ text = text || '';
+ options = options || {};
+
+ var extra = {
+ expires: 0
+ };
+ if ($(this).length) {
+ if (title == '') {
+ var label = $('label[for="' + $(this).attr('name') + '"], label[for="' + $(this).attr('id') + '"]').not('[generated=true]');
+ if (label.length) {
+ label.addClass('crm-error');
+ var $label = label.clone();
+ if (text == '' && $('.crm-marker', $label).length > 0) {
+ text = $('.crm-marker', $label).attr('title');
+ }
+ $('.crm-marker', $label).remove();
+ title = $label.text();
+ }
+ }
+ $(this).addClass('error');
+ }
+ var msg = CRM.alert(text, title, 'error', $.extend(extra, options));
+ if ($(this).length) {
+ var ele = $(this);
+ setTimeout(function () {
+ ele.one('change', function () {
+ msg && msg.close && msg.close();
+ ele.removeClass('error');
+ label.removeClass('crm-error');
+ });
+ }, 1000);
+ }
+ return msg;
+ };
+
+ // Display system alerts through js notifications
+ function messagesFromMarkup() {
+ $('div.messages:visible', this).not('.help').not('.no-popup').each(function () {
+ var text, title = '';
+ $(this).removeClass('status messages');
+ var type = $(this).attr('class').split(' ')[0] || 'alert';
+ type = type.replace('crm-', '');
+ $('.icon', this).remove();
+ if ($('.msg-text', this).length > 0) {
+ text = $('.msg-text', this).html();
+ title = $('.msg-title', this).html();
+ }
+ else {
+ text = $(this).html();
+ }
+ var options = $(this).data('options') || {};
+ $(this).remove();
+ // Duplicates were already removed server-side
+ options.unique = false;
+ CRM.alert(text, title, type, options);
+ });
+ // Handle qf form errors
+ $('form :input.error', this).one('blur', function() {
+ // ignore autocomplete fields
+ if ($(this).is('.ac_input')) {
+ return;
+ }
+
+ $('.ui-notify-message.error a.ui-notify-close').click();
+ $(this).removeClass('error');
+ $(this).next('span.crm-error').remove();
+ $('label[for="' + $(this).attr('name') + '"], label[for="' + $(this).attr('id') + '"]')
+ .removeClass('crm-error')
+ .find('.crm-error').removeClass('crm-error');
+ });
+ }
+
+ $(function () {
+ if ($('#crm-notification-container').length) {
+ // Initialize notifications
+ $('#crm-notification-container').notify();
+ messagesFromMarkup.call($('#crm-container'));
+ $('#crm-container').on('crmFormLoad', '*', messagesFromMarkup);
+ }
+
+ // bind the event for image popup
+ $('body').on('click', 'a.crm-image-popup', function() {
+ var o = $('<div class="crm-container crm-custom-image-popup"><img src=' + $(this).attr('href') + '></div>');
+
+ CRM.confirm('',
+ {
+ title: ts('Preview'),
+ message: o
+ },
+ ts('Done')
+ );
+ return false;
+ });
+ });
+
+ $.fn.crmAccordions = function (speed) {
+ var container = $('#crm-container');
+ if (speed === undefined) {
+ speed = 200;
+ }
+ if ($(this).length > 0) {
+ container = $(this);
+ }
+ if (container.length > 0 && !container.hasClass('crm-accordion-processed')) {
+ // Allow normal clicking of links
+ container.on('click', 'div.crm-accordion-header a', function (e) {
+ e.stopPropagation && e.stopPropagation();
+ });
+ container.on('click', '.crm-accordion-header, .crm-collapsible .collapsible-title', function () {
+ if ($(this).parent().hasClass('collapsed')) {
+ $(this).next().css('display', 'none').slideDown(speed);
+ }
+ else {
+ $(this).next().css('display', 'block').slideUp(speed);
+ }
+ $(this).parent().toggleClass('collapsed');
+ return false;
+ });
+ container.addClass('crm-accordion-processed');
+ }
+ };
+ $.fn.crmAccordionToggle = function (speed) {
+ $(this).each(function () {
+ if ($(this).hasClass('collapsed')) {
+ $('.crm-accordion-body', this).first().css('display', 'none').slideDown(speed);
+ }
+ else {
+ $('.crm-accordion-body', this).first().css('display', 'block').slideUp(speed);
+ }
+ $(this).toggleClass('collapsed');
+ });
+ };
+
+ /**
+ * Clientside currency formatting
+ * @param value
+ * @param format - currency representation of the number 1234.56
+ * @return string
+ * @see CRM_Core_Resources::addCoreResources
+ */
+ var currencyTemplate;
+ CRM.formatMoney = function(value, format) {
+ var decimal, separator, sign, i, j, result;
+ if (value === 'init' && format) {
+ currencyTemplate = format;
+ return;
+ }
+ format = format || currencyTemplate;
+ result = /1(.?)234(.?)56/.exec(format);
+ if (result === null) {
+ return 'Invalid format passed to CRM.formatMoney';
+ }
+ separator = result[1];
+ decimal = result[2];
+ sign = (value < 0) ? '-' : '';
+ //extracting the absolute value of the integer part of the number and converting to string
+ i = parseInt(value = Math.abs(value).toFixed(2)) + '';
+ j = ((j = i.length) > 3) ? j % 3 : 0;
+ result = sign + (j ? i.substr(0, j) + separator : '') + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + separator) + (2 ? decimal + Math.abs(value - i).toFixed(2).slice(2) : '');
+ return format.replace(/1.*234.*56/, result);
+ };
+})(jQuery);
+
+// @license-end
<h2>Past session</h2>
<ul>
-<li><a href="http://libreplanet.org/2014/program/grid_schedule.html">2014</a> </li>
-<li><p><a href="http://libreplanet.org/wiki/LibrePlanet:Conference/2013/Program">2013</a> </p>
-
-
+ <li><a href="http://libreplanet.org/2014/program/grid_schedule.html">2014</a></li>
+ <li><a href="http://libreplanet.org/wiki/LibrePlanet:Conference/2013/Program">2013</a></li>
</ul>
-<h2>Other ways to engage</h2></li>
+
+<h2>Other ways to engage</h2>
<p>There is also a place on the proposal form to indicate if you would like to participate in the conference in other ways in addition to your session – by framing and moderating a panel; facilitating a caucus space; sharing media-making skills; demonstrating something cool in the exhibit hall; or blogging about the conference. Please let us know about the community-building skills you have to share!</p>
- <form action="https://crm.fsf.org/civicrm/profile/create?gid=236&reset=1"
- class="form-horizontal margin-top" method="post" name="Edit"
+ <form action="https://crm.fsf.org/civicrm/profile/create?gid=325&reset=1"
+ class="form-horizontal margin-top" method="post" name="Edit"
id="Edit1" >
<div>
+ <input name="entryURL" type="hidden"
+ value="https://crm.fsf.org/civicrm/contact/view/delete?=&amp;reset=1&amp;delete=1&amp;cid=743827" />
<input name="postURL" type="hidden"
value="https://libreplanet.org/2014/call_for_sessions/confirmation.html" />
<input name="cancelURL" type="hidden"
<div class="col-sm-5">
<input name="first_name"
type="text" id="first_name"
- class="form-control" />
+ class="form-control" required>
</div>
</div>
class="radio-inline">
<input value="Individual
Presentation" type="radio" id="CIVICRM_QFID_Individual_Presentation_2"
- name="custom_117" />
+ name="custom_187" required />
Individual Presentation
</label>
<label for="CIVICRM_QFID_Panel_4"
class="radio-inline">
<input value="Panel" type="radio"
- id="CIVICRM_QFID_Panel_4" name="custom_117"
+ id="CIVICRM_QFID_Panel_4" name="custom_187"
/>
Panel
</label>
class="radio-inline">
<input value="Workshop"
type="radio" id="CIVICRM_QFID_Workshop_6"
- name="custom_117"
+ name="custom_187"
/>
Workshop
</label>
class="radio-inline">
<input
value="Strategic Action Session" type="radio"
- id="CIVICRM_QFID_Strategic_Action_Session_8" name="custom_117"
+ id="CIVICRM_QFID_Strategic_Action_Session_8" name="custom_187"
/>
Strategic Action Session
</label>
<div id="editrow-custom_118"
class="form-group">
- <label for="custom_118" class="col-sm-3 control-label">
+ <label for="custom_189" class="col-sm-3 control-label">
Session title
(no more than 80 characters, please)
<span class="field-required">*</span>
</label>
- <div class="col-sm-5">
- <input name="custom_118"
- type="text" id="custom_118"
- class="form-control" />
+ <div class="col-sm-7">
+ <textarea name="custom_189" rows="4"
+ id="custom_189"
+ class="form-control" required></textarea>
</div>
</div>
description.
</div>
- <div id="editrow-custom_139"
+ <div id="editrow-custom_188"
class="form-group">
- <label for="custom_139" class="col-sm-3 control-label">
+ <label for="custom_188" class="col-sm-3 control-label">
Session description
<span class="field-required">*</span>
</label>
<div class="col-sm-7">
<textarea rows="4"
- name="custom_139" id="custom_139"
- class="form-control"></textarea>
+ name="custom_188" id="custom_188"
+ class="form-control" required></textarea>
</div>
</div>
- <div id="editrow-custom_138"
+ <div id="editrow-custom_181"
class="form-group">
- <label for="custom_138" class="col-sm-3 control-label">
+ <label for="custom_181" class="col-sm-3 control-label">
Presenter bio(s)
<span class="field-required">*</span>
</label>
<div class="col-sm-7">
<textarea rows="4"
- name="custom_138" id="custom_138"
- class="form-control"></textarea>
+ name="custom_181" id="custom_181"
+ class="form-control" required></textarea>
</div>
</div>
- <div id="editrow-custom_142" class="form-group">
- <label for="custom_142" class="col-sm-3 control-label">
+ <div id="editrow-custom_183" class="form-group">
+ <label for="custom_183" class="col-sm-3 control-label">
Other ways to participate
</label>
<div class="col-sm-7">
<textarea
- rows="4" name="custom_142" id="custom_142"
+ rows="4" name="custom_183" id="custom_183"
class="form-control"></textarea>
</div>
</div>
affiliations, education, types of work, etc.</p>
</div>
- <div id="editrow-custom_140"
+ <div id="editrow-custom_186"
class="form-group">
- <label for="custom_140" class="col-sm-3 control-label">
+ <label for="custom_186" class="col-sm-3 control-label">
How do you self-identify?
</label>
<div class="col-sm-7">
<textarea
rows="4"
- name="custom_140" id="custom_140"
+ name="custom_186" id="custom_186"
class="form-control"></textarea></div>
</div>
- <div id="editrow-custom_137"
- class="form-group">
- <label class="col-sm-3 control-label">
- Age
- </label>
-
- <div class="col-sm-9">
- <label for="CIVICRM_QFID_20_or_under_10"
- class="radio-inline">
- <input value="20 or under" type="radio"
- id="CIVICRM_QFID_20_or_under_10"
- name="custom_137" />
- 20 or under
- </label>
-
- <label for="CIVICRM_QFID_21_30_12"
- class="radio-inline">
- <input value="21-30" type="radio"
- id="CIVICRM_QFID_21_30_12"
- name="custom_137" />
- 21-30
- </label>
-
- <label for="CIVICRM_QFID_31_40_14"
- class="radio-inline">
- <input value="31-40"
- type="radio" id="CIVICRM_QFID_31_40_14"
- name="custom_137"
- />
- 31-40
- </label>
- <label for="CIVICRM_QFID_41_50_16"
- class="radio-inline">
- <input value="41-50"
- type="radio"
- id="CIVICRM_QFID_41_50_16"
- name="custom_137"
- />
- 41-50
- </label>
-
- <label for="CIVICRM_QFID_51_60_18"
- class="radio-inline">
- <input value="51-60" type="radio"
- id="CIVICRM_QFID_51_60_18"
- name="custom_137" />
-
- 51-60
- </label>
-
- <label for="CIVICRM_QFID_61_20"
- class="radio-inline">
- <input value="61 +"
- type="radio" id="CIVICRM_QFID_61_20"
- name="custom_137" />
- 61 +
- </label>
-
- <span class="radio-clear-link">
- (<a href="#"
- title="unselect"
- onclick="unselectRadio('custom_137', 'Edit1'); return false;">clear</a>)
- </span>
- </div>
- </div>
-
-
- <div id="editrow-custom_122"
+ <div id="editrow-custom_185"
class="form-group">
- <label class="col-sm-3 control-label">
- Race/Ethnicity (check all that apply)
+ <label for="custom_185" class="col-sm-3 control-label">
+ Race/Ethnicity
</label>
- <div class="col-sm-9">
- <input type="hidden"
- name="custom_122[African]" value="" />
- <label class="checkbox-inline"
- for="custom_122_African">
- <input id="custom_122_African"
- name="custom_122[African]" type="checkbox"
- value="1" />
- African
- </label>
-
- <input type="hidden"
- name="custom_122[African American]" value="" />
- <label class="checkbox-inline"
- for="custom_122_AfricanAmerican">
- <input
- id="custom_122_AfricanAmerican"
- name="custom_122[African American]"
- type="checkbox" value="1" />
- African American
- </label>
-
-
- <input
- type="hidden" name="custom_122[Arab American]"
- value="" />
- <label class="checkbox-inline"
- for="custom_122_ArabAmerican">
- <input
- id="custom_122_ArabAmerican"
- name="custom_122[Arab American]"
- type="checkbox" value="1" class="form-checkbox" />
- Arab American
- </label>
-
- <input
- type="hidden" name="custom_122[Asian]" value="" />
- <label class="checkbox-inline"
- for="custom_122_Asian">
- <input
- id="custom_122_Asian" name="custom_122[Asian]"
- type="checkbox" value="1"/>
- Asian
- </label>
-
- <input type="hidden"
- name="custom_122[Asian American]" value="" />
- <label class="checkbox-inline"
- for="custom_122_AsianAmerican">
- <input id="custom_122_AsianAmerican" name="custom_122[Asian American]"
- type="checkbox" value="1"
- />
- Asian American
- </label>
-
- <input type="hidden" name="custom_122[Black]"
- value="" />
- <label class="checkbox-inline"
- for="custom_122_Black">
- <input id="custom_122_Black" name="custom_122[Black]"
- type="checkbox" value="1" />
- Black
- </label>
-
-
- <input type="hidden"
- name="custom_122[Caribbean]"
- value="" />
- <label class="checkbox-inline"
- for="custom_122_Caribbean">
- <input id="custom_122_Caribbean"
- name="custom_122[Caribbean]"
- type="checkbox" value="1"
- />
- Caribbean
- </label>
-
- <input type="hidden"
- name="custom_122[Caucasian]" value="" />
- <label class="checkbox-inline"
- for="custom_122_Caucasian">
- <input id="custom_122_Caucasian"
- name="custom_122[Caucasian]" type="checkbox" value="1"
- />
- Caucasian
- </label>
-
- <input type="hidden"
- name="custom_122[Indigenous]" value="" />
- <label class="checkbox-inline"
- for="custom_122_Indigenous">
- <input
- id="custom_122_Indigenous"
- name="custom_122[Indigenous]" type="checkbox"
- value="1" />
- Indigenous
- </label>
-
- <input type="hidden"
- name="custom_122[Latina/Latino]" value="" />
-
- <label class="checkbox-inline"
- for="custom_122_Latina/Latino">
- <input
- id="custom_122_Latina/Latino" name="custom_122[Latina/Latino]"
- type="checkbox" value="1" />
- Latina/Latino
- </label>
-
- <input
- type="hidden" name="custom_122[Middle Eastern]" value="" />
- <label class="checkbox-inline"
- for="custom_122_MiddleEastern">
- <input
- id="custom_122_MiddleEastern" name="custom_122[Middle Eastern]"
- type="checkbox" value="1" />
- Middle Eastern
- </label>
-
- <input
- type="hidden" name="custom_122[Native American]" value="" />
- <label class="checkbox-inline"
- for="custom_122_NativeAmerican">
- <input
- id="custom_122_NativeAmerican" name="custom_122[Native American]"
- type="checkbox" value="1" />
- Native American
- </label>
-
- <input
- type="hidden" name="custom_122[Pacific Islander]" value="" />
- <label class="checkbox-inline"
- for="custom_122_PacificIslander">
- <input
- id="custom_122_PacificIslander" name="custom_122[Pacific Islander]"
- type="checkbox" value="1" />
- Pacific Islander
- </label>
-
-
- <input
- type="hidden" name="custom_122[South Asian]" value="" />
- <label class="checkbox-inline"
- for="custom_122_SouthAsian">
- <input
- id="custom_122_SouthAsian" name="custom_122[South Asian]"
- type="checkbox" value="1" />
- South Asian
- </label>
-
- <input
- type="hidden" name="custom_122[White]" value="" />
- <label class="checkbox-inline"
- for="custom_122_White">
- <input
- id="custom_122_White" name="custom_122[White]"
- type="checkbox" value="1"
- />
- White
- </label>
-
- <input type="hidden"
- name="custom_122[None of these are accurate for me]" value="" />
- <label class="checkbox-inline"
- for="custom_122_Noneoftheseareaccurateforme">
- <input
- id="custom_122_Noneoftheseareaccurateforme"
- name="custom_122[None of these are accurate for me]"
- type="checkbox" value="1" />
- None of these are accurate for me
- </label>
+ <div class="col-sm-5">
+ <input name="custom_185"
+ type="text"
+ id="custom_185" class="form-control" />
</div>
</div>
- <div id="editrow-gender"
+ <div id="editrow-custom_184"
class="form-group">
- <label class="col-sm-3 control-label">
+ <label for="custom_184" class="col-sm-3 control-label">
Gender
</label>
- <div class="col-sm-9">
-
- <label class="checkbox-inline"
- for="CIVICRM_QFID_3_22">
- <input value="3" type="checkbox" id="CIVICRM_QFID_3_22"
- name="gender" />
- Transgender
- </label>
-
-
- <label class="checkbox-inline"
- for="CIVICRM_QFID_4_24">
- <input value="4"
- type="checkbox" id="CIVICRM_QFID_4_24"
- name="gender" class="form-radio"
- />
- Cisgender
- </label>
-
- <label class="checkbox-inline"
- for="CIVICRM_QFID_5_26">
- <input value="5"
- type="checkbox" id="CIVICRM_QFID_5_26"
- name="gender"
- />
- Genderqueer / Non-Conforming / Variant</label>
-
- <label class="checkbox-inline"
- for="CIVICRM_QFID_1_28">
- <input value="1" type="checkbox"
- id="CIVICRM_QFID_1_28" name="gender"
- />Woman</label>
-
- <label class="checkbox-inline"
- for="CIVICRM_QFID_2_30">
- <input value="2" type="checkbox"
- id="CIVICRM_QFID_2_30" name="gender"
- />Man</label>
-
- <label class="checkbox-inline"
- for="CIVICRM_QFID_6_32">
- <input value="6" type="checkbox"
- id="CIVICRM_QFID_6_32" name="gender"
- />
- None of these are accurate for me</label>
-
- <span class="radio-clear-link">
- (<a href="#"
- title="unselect" onclick="unselectRadio('gender', 'Edit1'); return false;">clear</a>)
- </span>
+ <div class="col-sm-5">
+ <input name="custom_184"
+ type="text"
+ id="custom_184" class="form-control" />
</div>
</div>
<h3>Miscellaneous</h3>
</div>
- <div id="editrow-custom_127"
+ <div id="editrow-custom_179"
class="form-group">
<label class="col-sm-3 control-label">
Have you come to the conference before?
<div class="col-sm-9">
<input type="hidden"
- name="custom_127[attended previous conference(s)]" value="" />
+ name="custom_179[attended previous conference(s)]" value="" />
<label class="checkbox-inline"
- for="custom_127_attended_previous_conference(s)">
+ for="custom_179_attended_previous_conference(s)">
<input
- id="custom_127_attended_previous_conference(s)"
- name="custom_127[attended previous conference(s)]"
+ id="custom_179_attended_previous_conference(s)"
+ name="custom_179[attended previous conference(s)]"
type="checkbox"
value="1" />
Attended previous conference(s)
<input type="hidden"
- name="custom_127[received travel stipend to attend previous conference(s)]"
+ name="custom_179[received travel stipend to attend previous conference(s)]"
value="" />
<label class="checkbox-inline"
- for="custom_127_received_travel_stipend_to_attend_previous_conference(s)">
- <input id="custom_127_received_travel_stipend_to_attend_previous_conference(s)"
- name="custom_127[received travel
+ for="custom_179_received_travel_stipend_to_attend_previous_conference(s)">
+ <input id="custom_179_received_travel_stipend_to_attend_previous_conference(s)"
+ name="custom_179[received travel
stipend to attend previous conference(s)]"
type="checkbox" value="1"
/>
previous conference(s)</label>
<input type="hidden"
- name="custom_127[presented at previous conference(s)]" value="" />
- <label class="checkbox-inline" for="custom_127_presented_at_previous_conference(s)">
+ name="custom_179[presented at previous conference(s)]" value="" />
+ <label class="checkbox-inline" for="custom_179_presented_at_previous_conference(s)">
<input
- id="custom_127_presented_at_previous_conference(s)"
- name="custom_127[presented at previous conference(s)]" type="checkbox"
+ id="custom_179_presented_at_previous_conference(s)"
+ name="custom_179[presented at previous conference(s)]" type="checkbox"
value="1" />Presented at previous conference(s)</label>
- <input type="hidden" name="custom_127[have
+ <input type="hidden" name="custom_179[have
not attended]" value="" />
<label class="checkbox-inline"
- for="custom_127_have_not_attended">
- <input id="custom_127_have_not_attended"
- name="custom_127[have not attended]" type="checkbox" value="1" />
+ for="custom_179_have_not_attended">
+ <input id="custom_179_have_not_attended"
+ name="custom_179[have not attended]" type="checkbox" value="1" />
Have not attended</label>
-
</div>
</div>
- <div id="editrow-custom_128"
+ <div id="editrow-custom_182"
class="form-group">
<label class="col-sm-3 control-label">
Do you require a travel scholarship?
<div class="col-sm-9">
<label class="radio-inline"
- for="CIVICRM_QFID_Yes_34">
+ for="CIVICRM_QFID_1_10">
<input
- value="Yes" type="radio" id="CIVICRM_QFID_Yes_34" name="custom_128"
+ value="Yes" type="radio" id="CIVICRM_QFID_1_10" name="custom_182"
/>Yes</label>
<label class="radio-inline"
- for="CIVICRM_QFID_No_36">
+ for="CIVICRM_QFID_0_12">
<input value="No"
- type="radio" id="CIVICRM_QFID_No_36" name="custom_128"
+ type="radio" id="CIVICRM_QFID_0_12" name="custom_182"
/>No</label>
- <label class="radio-inline"
- for="CIVICRM_QFID_Decline_to_answer_38">
- <input value="Decline to answer" type="radio"
- id="CIVICRM_QFID_Decline_to_answer_38"
- name="custom_128" />
- Decline to answer</label>
-
<span class="radio-clear-link">
(<a href="#"
title="unselect"
- onclick="unselectRadio('custom_128', 'Edit1'); return false;">clear</a>)
+ onclick="unselectRadio('custom_182', 'Edit1'); return false;">clear</a>)
</span>
</div>
</div>
</div>
</form>
<!--#include virtual="/2015/footer.html"-->
+<!--#include virtual="/server/2015/cfs_js.html"-->
+<!--#include virtual="/server/2015/close.html" -->