function buildQuickForm()
 {
     CRM_Utils_System::setTitle(ts('Donation Receipts - Settings', array('domain' => 'de.systopia.donrec')));
     // add profile selector + data
     $this->addElement('select', 'profile', ts('Profile', array('domain' => 'de.systopia.donrec')), CRM_Donrec_Logic_Profile::getAllNames(), array('class' => 'crm-select2'));
     $this->addElement('hidden', 'selected_profile', 'Default');
     $this->addElement('hidden', 'profile_data', json_encode(CRM_Donrec_Logic_Profile::getAllData()));
     // add all profile elements
     $this->addElement('text', 'draft_text', ts('Draft text', array('domain' => 'de.systopia.donrec')));
     $this->addElement('text', 'copy_text', ts('Copy text', array('domain' => 'de.systopia.donrec')));
     $this->addElement('text', 'id_pattern', ts('Receipt ID', array('domain' => 'de.systopia.donrec')));
     $this->addElement('checkbox', 'store_original_pdf');
     // actually inserted via template
     $this->addElement('select', 'financial_types', ts('Contribution Types', array('domain' => 'de.systopia.donrec')), CRM_Contribute_PseudoConstant::financialType(), array('multiple' => "multiple", 'class' => 'crm-select2'));
     $this->addElement('select', 'template', ts('Template', array('domain' => 'de.systopia.donrec')), CRM_Donrec_Logic_Settings::getAllTemplates(), array('class' => 'crm-select2'));
     // add profile location-type-selections
     $query = "SELECT `id`, `name` FROM `civicrm_location_type`";
     $result = CRM_Core_DAO::executeQuery($query);
     $options = array(0 => ts('primary address', array('domain' => 'de.systopia.donrec')));
     while ($result->fetch()) {
         $options[$result->id] = ts($result->name, array('domain' => 'de.systopia.donrec'));
     }
     $this->addElement('select', 'legal_address', ts('Legal Address-Type:', array('domain' => 'de.systopia.donrec')), $options);
     $this->addElement('select', 'postal_address', ts('Postal Address-Type:', array('domain' => 'de.systopia.donrec')), $options);
     $this->addElement('select', 'legal_address_fallback', ts('Fallback:', array('domain' => 'de.systopia.donrec')), $options);
     $this->addElement('select', 'postal_address_fallback', ts('Fallback:', array('domain' => 'de.systopia.donrec')), $options);
     // add generic elements
     $this->addElement('text', 'pdfinfo_path', ts('External Tool: path to <code>pdfinfo</code>', array('domain' => 'de.systopia.donrec')), CRM_Donrec_Logic_Settings::get('donrec_pdfinfo_path'));
     $this->addElement('text', 'packet_size', ts('Packet size', array('domain' => 'de.systopia.donrec')), CRM_Donrec_Logic_Settings::get('donrec_packet_size'));
     $this->addButtons(array(array('type' => 'next', 'name' => ts('Save', array('domain' => 'de.systopia.donrec')), 'isDefault' => TRUE), array('type' => 'cancel', 'name' => ts('Cancel', array('domain' => 'de.systopia.donrec')))));
     // add a custom form validation rule that allows only positive integers (i > 0)
     $this->registerRule('onlypositive', 'callback', 'onlyPositiveIntegers', 'CRM_Admin_Form_Setting_DonrecSettings');
 }