Пример #1
0
 /**
  *  displayWebForm
  *  Display the webform within OFuz.net so we can use all the ofuz / radria field type
  */
 function displayWebFormFields()
 {
     $out = '<table>';
     $do_webform_userfields = new WebFormUserField();
     $do_webform_userfields->query("SELECT wfu.name, wfu.label, wfu.required, wfu.size, wff.field_type \n\t\t                                 FROM webformfields as wff, webformuserfield as wfu \n\t\t\t\t\t\t\t\t\t\t WHERE wff.name=wfu.name\n\t\t\t\t\t\t\t\t\t\t   AND wfu.idwebformuser = "******"\n\t\t\t\t\t\t\t\t\t\t ORDER BY wff.display_order");
     $field_format = new Fields();
     while ($do_webform_userfields->next()) {
         $field_format->addField($do_webform_userfields->name, $do_webform_userfields->field_type);
         if ($do_webform_userfields->size) {
             if ($do_webform_userfields->field_type == 'FieldTypeText') {
                 $field_format->fields[$do_webform_userfields->name]->textarea = $do_webform_userfields->size;
             } else {
                 $field_format->fields[$do_webform_userfields->name]->size = $do_webform_userfields->size;
             }
         }
     }
     //print_r($field_format);
     $do_webform_userfields->first();
     //$do_webform_userfields->newForm();
     //$do_webform_userfields->setFields($field_format);
     //$do_webform_userfields->setApplyFieldFormating(true);
     while ($do_webform_userfields->next()) {
         $out .= "\n" . '<tr><td class="webform_row_label">' . $do_webform_userfields->label . '</td><td class="webform_row_field">' . $field_format->applyRegToForm($do_webform_userfields->name, '') . '</td></tr>';
     }
     $out .= '</table>';
     return $out;
 }
Пример #2
0
 /**
  * Fields initialization
  * This method set the initial fields descriptio for this DataObjec
  * Each property in the values array will be stored
  * in the model (database).
  * The Fields object let you assign to it FieldType and
  * manipulates the FieldType properties.
  * Field type define how a property value will display in a context of a Form
  * or general Display.
  * 
  * All the base FieldType are describe here:
  * http://radria.sqlfusion.com/documentation/core:registry:creating_new_field_types
  * You can create your own:
  * http://radria.sqlfusion.com/documentation/core:registry:creating_new_field_types
  * Some extra package add fieldtype from Dojo or other jquery frameworks.
  */
 function initFields()
 {
     $invoice_fields = new Fields();
     $invoice_fields->addField(new FieldTypeInt('idinvoice'));
     $invoice_fields->addField(new FieldTypeChar('num'));
     $invoice_fields->addField(new FieldTypeInt('iduser'));
     $invoice_fields->addField(new FieldTypeText('description'));
     $invoice_fields->addField(new FieldTypeFloat('amount'));
     $invoice_fields->addField(new FieldTypeDateSQL('datepaid'));
     $invoice_fields->addField(new FieldTypeDateSQL('datecreated'));
     $invoice_fields->addfield(new FieldTypeListBoxSmall('status'));
     $invoice_fields->idinvoice->hidden = 1;
     $invoice_fields->iduser->hidden = 1;
     $invoice_fields->description->rows = 10;
     $invoice_fields->description->cols = 40;
     $invoice_fields->amount->numberformat = '$:1:.:,:';
     $invoice_fields->status->listvalues = 'New:Sent:Paid';
     $invoice_fields->status->listlabels = 'new:sent:paid';
     $invoice_fields->status->emptydefault = 'no';
     $this->setFields($invoice_fields);
 }
Пример #3
0
 /**
  * Fields initialization
  * This method set the initial fields descriptio for this DataObjec
  * Each property in the values array will be stored
  * in the model (database).
  * The Fields object let you assign to it FieldType and
  * manipulates the FieldType properties.
  * Field type define how a property value will display in a context of a Form
  * or general Display.
  * 
  * All the base FieldType are describe here:
  * http://radria.sqlfusion.com/documentation/core:registry:creating_new_field_types
  * You can create your own:
  * http://radria.sqlfusion.com/documentation/core:registry:creating_new_field_types
  * Some extra package add fieldtype from Dojo or other jquery frameworks.
  */
 function initFields()
 {
     $user_fields = new Fields();
     $user_fields->addField(new FieldTypeChar('firstname'));
     $user_fields->firstname->required = 1;
     $user_fields->firstname->size = 20;
     $user_fields->addField(new FieldTypeChar('lastname'));
     $user_fields->lastname->size = 20;
     $user_fields->addField(new FieldTypeLogin('email'));
     $user_fields->email->textline = '20:30';
     $user_fields->email->required = 1;
     $user_fields->addField(new FieldTypePassword('password'));
     $user_fields->password->size = 10;
     $user_fields->addField(new FieldTypeListBoxSmall('status'));
     $user_fields->status->listvalues = 'Active:Inactive:Suspended:Paid';
     $user_fields->status->listlabels = 'active:inactive:suspend:paid';
     $user_fields->status->emptydefault = 'no';
     $user_fields->addField(new FieldTypeDateSQL('regdate'));
     $user_fields->regdate->hidden = 1;
     $user_fields->addField(new FieldTypeInt('iduser'));
     $user_fields->iduser->hidden = 1;
     $this->setFields($user_fields);
 }
Пример #4
0
 /**
  * formLogin
  * This method just call the login form.
  * Print out a login form for user identification
  * Having fun her as its nore very usefull to have a registry for such simple form
  */
 function formLogin($nextPage, $strWrongLoginPassword, $login_form_style = "", $errPage = "")
 {
     if (empty($login_form_style)) {
         $login_form_style = "formfield";
     }
     if (empty($errPage)) {
         $errPage = $_SERVER['PHP_SELF'];
     }
     if (empty($strWrongLoginPassword)) {
         $strWrongLoginPassword = _("Wrong Username or Password");
     }
     $form_fields = new Fields();
     $field_username = new FieldTypeChar($this->getUsernameField());
     $field_username->label = _("User name");
     $field_username->size = 20;
     $field_username->maxlenght = 40;
     $field_username->css_form_class = "formfield";
     $form_fields->addField($field_username);
     $field_password = new FieldTypePassword($this->getPasswordField());
     $field_password->label = _("Password");
     $field_password->size = 20;
     $field_password->maxlenght = 40;
     $field_password->loginform = true;
     $form_fields->addField($field_password);
     $this->setFields($form_fields);
     $login_form = $this->prepareForm();
     $login_form->setFormEvent($this->getObjectName() . "->eventSignIn");
     //$login_form->addEventAction($this->getObjectName()."->eventAuditLogin", 207);
     $login_form->addParam("goto", $nextPage);
     $login_form->addParam("errPage", $errPage);
     $login_form->setForm();
     $login_form->execute();
 }
Пример #5
0
 /**
  * While general registered user logs in for the first time with Twitter ask for 
  * login validation so that the fb_user_id can be stored in the DB
  * @param string $goto
  * @param string $errPage
  * @param string $tw_user_id
  * @param string $tw_screen_name
  * @param string $tw_token
  * 
  * @return the form for Twitter validation
  */
 function formTwLoginVerification($goto, $errPage, $tw_user_id, $tw_screen_name, $tw_token)
 {
     $form_fields = new Fields('', $this->getDbCon());
     $field_username = new FieldTypeChar($this->getUsernameField());
     $field_username->label = _('User name');
     $field_username->size = 20;
     $field_username->maxlenght = 40;
     $field_username->css_form_class = 'formfield';
     $form_fields->addField($field_username);
     $field_password = new OfuzFieldTypePassword($this->getPasswordField());
     $field_password->label = _('Password');
     $field_password->size = 20;
     $field_password->maxlenght = 40;
     $field_password->loginform = true;
     $form_fields->addField($field_password);
     $this->setFields($form_fields);
     $login_form = $this->prepareForm();
     $login_form->setFormEvent($this->getObjectName() . '->eventCheckIdentificationOnTwLogin');
     $login_form->addParam('goto', $goto);
     $login_form->addParam('errPage', $errPage);
     $login_form->addParam('tw_user_id', $tw_user_id);
     $login_form->addParam('tw_screen_name', $tw_screen_name);
     $login_form->addParam('tw_token', $tw_token);
     $login_form->setForm();
     $login_form->execute();
 }