function Appointment_Form() { $name = "Appointments"; $this->swapper =& ElementSwapScript::instance(); $this->init($name); $schedule_set = AMPSystem_Lookup::instance('scheduleNames'); $this->addTranslation('schedule_id', '_locateActionSchedule', 'set'); foreach ($schedule_set as $schedule_id => $schedule_name) { $this->addTranslation('action_id_' . $schedule_id, '_placeInScheduleSet', 'set'); } $this->addTranslation('action_id', '_pullfromScheduleSet', 'get'); }
function _initSwapFields() { require_once 'AMP/Form/ElementSwapScript.inc.php'; $this->_fieldswapper =& ElementSwapScript::instance(); foreach ($this->_intro_text_set as $textfield) { $current_swap = $textfield . '_swap'; $this->_fieldswapper->addSwapper($current_swap); $this->_fieldswapper->setForm($this->getFormName(), $current_swap); $this->_fieldswapper->addSet('basic', array($textfield), $current_swap); $this->_fieldswapper->addSet('new', array($textfield . '_title', $textfield . '_text'), $current_swap); $this->_fieldswapper->setInitialValue('basic', $current_swap); } $this->registerJavascript($this->_fieldswapper->output()); }
function HTMLEditorSetup($checkbox_fieldname = 'html') { require_once 'AMP/Form/ElementSwapScript.inc.php'; $fieldswapper =& ElementSwapScript::instance(); $fieldswapper->addSwapper($this->_editor_fieldswap_object_id); $fieldswapper->setForm($this->formname, $this->_editor_fieldswap_object_id); $fieldswapper->addSet('no_editor', array($checkbox_fieldname), $this->_editor_fieldswap_object_id); $fieldswapper->setInitialValue('no_editor', $this->_editor_fieldswap_object_id); $this->registerJavascript($fieldswapper->output()); $editor =& AMPFormElement_HTMLEditor::instance(); $editor->register_config_action('ActivateSwap( window.' . $this->_editor_fieldswap_object_id . ', "" );'); $editor->register_config_action('document.forms["' . $this->formname . '"].elements["' . $checkbox_fieldname . '"].checked = true;'); $this->_configHTMLEditor($editor); }
function setupPaymentTypes($options = array()) { //if the payment type is already set //return only the fields from the relevent processor if ($selected_type = $this->getPaymentType()) { $this->setProcessor($selected_type); $selector_field['Payment_Type'] = $this->getPaymentSelect($options, $allow_select = false); $selector_field['Payment_Type']['default'] = $selected_type; return $selector_field + $this->processor->fields; } //Otherwise Return fields from all processor types $selector_field['Payment_Type'] = $this->getPaymentSelect($options); $fieldswapper =& ElementSwapScript::instance(); $fieldswapper->addSwapper($this->fieldswap_object_id); $fieldswapper->setForm($this->udm->name, $this->fieldswap_object_id); $paymentType_fields = array(); foreach ($this->getAllowedPaymentTypes($options) as $payment_type => $description) { $current =& new Payment($this->dbcon, $payment_type); if ($payment_type == 'Check') { $this->_setupCheck($current, $options); } $fieldswapper->addSet($payment_type, $this->convertFieldDefstoDOM($current->fields), $this->fieldswap_object_id); $paymentType_fields = array_merge($paymentType_fields, $current->fields); } $this->_register_javascript($fieldswapper->output()); return $selector_field + $paymentType_fields; }