Пример #1
0
	/**
	 * Setup the CMS Fields for the User Defined Form
	 * 
	 * @return FieldSet
	 */
	public function getCMSFields() {
		$fields = parent::getCMSFields();

		// field editor
		$fields->addFieldToTab("Root.Content."._t('UserDefinedForm.FORM', 'Form'), new FieldEditor("Fields", 'Fields', "", $this ));
		
		// view the submissions
		$fields->addFieldToTab("Root.Content."._t('UserDefinedForm.SUBMISSIONS','Submissions'), new SubmittedFormReportField( "Reports", _t('UserDefinedForm.RECEIVED', 'Received Submissions'), "", $this ) );

		// who do we email on submission
		$emailRecipients = new ComplexTableField(
			$this,
	    	'EmailRecipients',
	    	'UserDefinedForm_EmailRecipient',
	    	array(
				'EmailAddress' => 'Email',
				'EmailSubject' => 'Subject',
				'EmailFrom' => 'From'
	    	),
	    	'getCMSFields_forPopup',
			"FormID = '$this->ID'"
		);
		$emailRecipients->setAddTitle(_t('UserDefinedForm.AEMAILRECIPIENT', 'A Email Recipient'));
		
		$fields->addFieldToTab("Root.Content."._t('UserDefinedForm.EMAILRECIPIENTS', 'Email Recipients'), $emailRecipients);
	
		// text to show on complete
		$onCompleteFieldSet = new FieldSet(
			new HtmlEditorField( "OnCompleteMessage", _t('UserDefinedForm.ONCOMPLETELABEL', 'Show on completion'),3,"",_t('UserDefinedForm.ONCOMPLETEMESSAGE', $this->OnCompleteMessage), $this )
		);
		
		$fields->addFieldsToTab("Root.Content."._t('UserDefinedForm.ONCOMPLETE','On complete'), $onCompleteFieldSet);
		
		return $fields;
	}
Пример #2
0
 /**
  * Setup the CMS Fields for the User Defined Form
  * 
  * @return FieldSet
  */
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     // define tabs
     $fields->findOrMakeTab('Root.Content.Form', _t('UserDefinedForm.FORM', 'Form'));
     $fields->findOrMakeTab('Root.Content.EmailRecipients', _t('UserDefinedForm.EMAILRECIPIENTS', 'Email Recipients'));
     $fields->findOrMakeTab('Root.Content.OnComplete', _t('UserDefinedForm.ONCOMPLETE', 'On Complete'));
     $fields->findOrMakeTab('Root.Content.Submissions', _t('UserDefinedForm.SUBMISSIONS', 'Submissions'));
     // field editor
     $fields->addFieldToTab("Root.Content.Form", new FieldEditor("Fields", 'Fields', "", $this));
     // view the submissions
     $fields->addFieldToTab("Root.Content.Submissions", new CheckboxField('DisableSaveSubmissions', _t('UserDefinedForm.SAVESUBMISSIONS', "Disable Saving Submissions to Server")));
     $fields->addFieldToTab("Root.Content.Submissions", new SubmittedFormReportField("Reports", _t('UserDefinedForm.RECEIVED', 'Received Submissions'), "", $this));
     // who do we email on submission
     $emailRecipients = new ComplexTableField($this, 'EmailRecipients', 'UserDefinedForm_EmailRecipient', array('EmailAddress' => _t('UserDefinedForm.EMAILADDRESS', 'Email'), 'EmailSubject' => _t('UserDefinedForm.EMAILSUBJECT', 'Subject'), 'EmailFrom' => _t('UserDefinedForm.EMAILFROM', 'From')), 'getCMSFields_forPopup', "\"FormID\" = '{$this->ID}'");
     $emailRecipients->setAddTitle(_t('UserDefinedForm.AEMAILRECIPIENT', 'A Email Recipient'));
     $fields->addFieldToTab("Root.Content.EmailRecipients", $emailRecipients);
     // text to show on complete
     $onCompleteFieldSet = new FieldSet(new HtmlEditorField("OnCompleteMessage", _t('UserDefinedForm.ONCOMPLETELABEL', 'Show on completion'), 3, "", _t('UserDefinedForm.ONCOMPLETEMESSAGE', $this->OnCompleteMessage), $this));
     $fields->addFieldsToTab("Root.Content.OnComplete", $onCompleteFieldSet);
     return $fields;
 }
 /**
  * Get products table
  * @return ComplexTableField
  */
 public function getCMSProductsTable()
 {
     $table = new ComplexTableField($this, 'OrderItems', 'RepeatOrder_OrderItem', array('Product.Title' => 'Title', 'Quantity' => 'Qty'));
     $table->setShowPagination(false);
     $table->setAddTitle('Product');
     $table->setPermissions(array('add', 'edit', 'delete'));
     return $table;
 }