Commits

Vladimir Mihailenco committed b1420a9

Fixes

Comments (0)

Files changed (7)

www/system/modules/collector/configs/_form.yml

+elements:
+  # Mandatory email field
+  email:
+    type: text
+    options:
+      label: E-mail
+      attribs:
+        size: 80
+      required: true
+      # check that email is valid and it's unique
+      validators:
+        email: { validator: SimpleEmailAddress }
+        unique: { validator: Doctrine_NotExists, options: { model: Collector_Registration, field: email } }
+
+  company_name:
+    type: text
+    options:
+      label: Company name
+      attribs:
+        size: 80
+      required: true
+
+  site:
+    type: text
+    options:
+      label: Company/personal website
+      attribs:
+        size: 80
+      required: true
+
+  contact_name:
+    type: text
+    options:
+      label: Owner/contact name
+      attribs:
+        size: 80
+      required: true
+
+  type:
+    type: select
+    options:
+      label: Type
+      multiOptions:
+        '': Choose type
+        type1: Type 1
+        type2: Type 2
+        type3: Type 3
+      required: true
+
+  address1:
+    type: text
+    options:
+      label: Address line #1
+      attribs:
+        size: 80
+      required: true
+
+  address2:
+    type: text
+    options:
+      label: Address line #2
+      attribs:
+        size: 80
+      required: true
+
+  city:
+    type: text
+    options:
+      label: Town/City
+      attribs:
+        size: 80
+      required: true
+
+  state:
+    type: text
+    options:
+      label: State/Province
+      attribs:
+        size: 80
+
+  zip:
+    type: text
+    options:
+      label: Zip/Postal code
+      required: true
+      attribs:
+        size: 80
+
+  country:
+    type: countriesSelect
+    options:
+      label: Country
+      required: true
+
+  additional:
+    type: textarea
+    options:
+      label: Additional information
+      required: true
+      attribs:
+        cols: 60
+        rows: 5
+
+  # Confirm
+  confirm:
+    type: multiCheckbox
+    options:
+      label: Confirm
+      multiOptions:
+        agree1: Yes, I agree
+        agree2: Yes, I agree 2
+      required: true
+
+  # Submit form
+  submit:
+    type: mySubmit
+    options:
+      label: Submit
+
+displayGroups:
+    first_group:
+      name: first_group
+      elements: [ email, company_name, site, contact_name, type, address1, address2, city, state, zip, country, additional ]
+      options:
+        legend: This is first group
+        order: 0

www/system/modules/collector/configs/doctrine/registration.yml

 Collector_Registration:
-  columns: { email: { type: string(255), notnull: true }, company_name: { type: string(255), notnull: true }, site: { type: string(255), notnull: true }, contact_name: { type: string(255), notnull: true }, type: { type: string(255), notnull: true }, address1: { type: string(255), notnull: true }, address2: { type: string(255), notnull: true }, city: { type: string(255), notnull: true }, state: { type: string(255) }, zip: { type: string(255), notnull: true }, country: { type: string(255), notnull: true }, additional: { type: string, notnull: true }, confirm_agree1: { type: integer(1) }, confirm_agree2: { type: integer(1) } }
+  columns: { email: { type: string(255), notnull: true }, test_text: { type: string(255), notnull: true }, test_radio: { type: string(255), notnull: true }, test_checkbox: { type: integer(1), notnull: true }, test_multiCheckbox_agree1: { type: integer(1) }, test_multiCheckbox_agree2: { type: integer(1) }, test_select: { type: string(255), notnull: true }, test_textarea: { type: string, notnull: true } }

www/system/modules/collector/configs/form.yml

-elements:
-  # Mandatory email field
-  email:
-    type: text
-    options:
-      label: E-mail
-      attribs:
-        size: 80
-      required: true
-      # check that email is valid and it's unique
-      validators:
-        email: { validator: SimpleEmailAddress }
-        unique: { validator: Doctrine_NotExists, options: { model: Collector_Registration, field: email } }
-
-  company_name:
-    type: text
-    options:
-      label: Company name
-      attribs:
-        size: 80
-      required: true
-
-  site:
-    type: text
-    options:
-      label: Company/personal website
-      attribs:
-        size: 80
-      required: true
-
-  contact_name:
-    type: text
-    options:
-      label: Owner/contact name
-      attribs:
-        size: 80
-      required: true
-
-  type:
-    type: select
-    options:
-      label: Type
-      multiOptions:
-        '': Choose type
-        type1: Type 1
-        type2: Type 2
-        type3: Type 3
-      required: true
-
-  address1:
-    type: text
-    options:
-      label: Address line #1
-      attribs:
-        size: 80
-      required: true
-
-  address2:
-    type: text
-    options:
-      label: Address line #2
-      attribs:
-        size: 80
-      required: true
-
-  city:
-    type: text
-    options:
-      label: Town/City
-      attribs:
-        size: 80
-      required: true
-
-  state:
-    type: text
-    options:
-      label: State/Province
-      attribs:
-        size: 80
-
-  zip:
-    type: text
-    options:
-      label: Zip/Postal code
-      required: true
-      attribs:
-        size: 80
-
-  country:
-    type: countriesSelect
-    options:
-      label: Country
-      required: true
-
-  additional:
-    type: textarea
-    options:
-      label: Additional information
-      required: true
-      attribs:
-        cols: 60
-        rows: 5
-
-  # Confirm
-  confirm:
-    type: multiCheckbox
-    options:
-      label: Confirm
-      multiOptions:
-        agree1: Yes, I agree
-        agree2: Yes, I agree 2
-      required: true
-
-  # Submit form
-  submit:
-    type: mySubmit
-    options:
-      label: Submit
-
-displayGroups:
-    first_group:
-      name: first_group
-      elements: [ email, company_name, site, contact_name, type, address1, address2, city, state, zip, country, additional ]
-      options:
-        legend: This is first group
-        order: 0

www/system/modules/collector/library/Base/Registration.php

              'notnull' => true,
              'length' => '255',
              ));
-        $this->hasColumn('company_name', 'string', 255, array(
+        $this->hasColumn('test_text', 'string', 255, array(
              'type' => 'string',
              'notnull' => true,
              'length' => '255',
              ));
-        $this->hasColumn('site', 'string', 255, array(
+        $this->hasColumn('test_radio', 'string', 255, array(
              'type' => 'string',
              'notnull' => true,
              'length' => '255',
              ));
-        $this->hasColumn('contact_name', 'string', 255, array(
+        $this->hasColumn('test_checkbox', 'integer', 1, array(
+             'type' => 'integer',
+             'notnull' => true,
+             'length' => '1',
+             ));
+        $this->hasColumn('test_multiCheckbox_agree1', 'integer', 1, array(
+             'type' => 'integer',
+             'length' => '1',
+             ));
+        $this->hasColumn('test_multiCheckbox_agree2', 'integer', 1, array(
+             'type' => 'integer',
+             'length' => '1',
+             ));
+        $this->hasColumn('test_select', 'string', 255, array(
              'type' => 'string',
              'notnull' => true,
              'length' => '255',
              ));
-        $this->hasColumn('type', 'string', 255, array(
+        $this->hasColumn('test_textarea', 'string', null, array(
              'type' => 'string',
              'notnull' => true,
-             'length' => '255',
-             ));
-        $this->hasColumn('address1', 'string', 255, array(
-             'type' => 'string',
-             'notnull' => true,
-             'length' => '255',
-             ));
-        $this->hasColumn('address2', 'string', 255, array(
-             'type' => 'string',
-             'notnull' => true,
-             'length' => '255',
-             ));
-        $this->hasColumn('city', 'string', 255, array(
-             'type' => 'string',
-             'notnull' => true,
-             'length' => '255',
-             ));
-        $this->hasColumn('state', 'string', 255, array(
-             'type' => 'string',
-             'length' => '255',
-             ));
-        $this->hasColumn('zip', 'string', 255, array(
-             'type' => 'string',
-             'notnull' => true,
-             'length' => '255',
-             ));
-        $this->hasColumn('country', 'string', 255, array(
-             'type' => 'string',
-             'notnull' => true,
-             'length' => '255',
-             ));
-        $this->hasColumn('additional', 'string', null, array(
-             'type' => 'string',
-             'notnull' => true,
-             ));
-        $this->hasColumn('confirm_agree1', 'integer', 1, array(
-             'type' => 'integer',
-             'length' => '1',
-             ));
-        $this->hasColumn('confirm_agree2', 'integer', 1, array(
-             'type' => 'integer',
-             'length' => '1',
              ));
     }
 

www/system/modules/collector/library/Service/Registration.php

             ),
         );
 
-        IO_File::set(MODULES_DIR . "/collector/config/doctrine/registration.yml", sfYaml::dump($table));
+        IO_File::set(MODULES_DIR . "/collector/configs/doctrine/registration.yml", sfYaml::dump($table));
 
-        $migration = new Doctrine_Migration(MODULES_DIR . '/collector/migration');
+        $migration = new Doctrine_Migration(MODULES_DIR . '/collector/migrations');
         $migration->setCurrentVersion(0);
         try {
             $migration->migrate(1);

www/system/modules/collector/readme.txt

+All project files done for this job are stored in separate module at path:
+
+system/module/collector
+
+All configs are stored at:
+
+system/module/collector/config
+
+and use YAML format.
+
+Form config
+===========
+
+system/module/collector/config/form.yml
+
+It uses standard Zend_Form format and you can add elements, decorators, validators etc. to your form. You can check both examples at that file and at offical Zend_Form documentation:
+
+http://framework.zend.com/manual/en/zend.form.forms.html
+
+Invites config
+==============
+
+system/module/collector/config/invites.yml
+
+Format:
+
+- one invite per line
+- not used invite:
+    invite name: true
+- used invite (it will be marked so by system when user registration will be completed; I don't delete used invites to not allow add used invite in list by mistake):
+    invite name: false
+
+Module specific application config
+==================================
+
+system/module/collector/config/app.yml
+
+Among other options in this file at line 10 you can set confirmation link expiration time.
+
+Database schema
+===============
+
+I use only 1 table named "collector__registration" to store registration info. It will always have these fields:
+
+    id: { type: integer, primary: true, autoincrement: true }
+    email: { type: string(255), notnull: true, unique: true }
+    # invite used with this registration
+    invite: { type: string(255), notnull: true, unique: true }
+    # randomly generated secret string (md5 hash), used to confirm registration
+    secret: { type: string(32), fixed: true, notnull: true, unique: true }
+    # flag, which indicates confirmed accounts
+    is_confirmed: { type: boolean, notnull: true, default: false }
+
+Other fields will be added to the table when you regenerate the form.
+
+Form regeneration
+=================
+
+When you edit the form and want to regenerate it, you should log in:
+
+uri: /login
+login: admin
+password: test
+
+After this you will see new action at main menu named "Regenerate form". When you click it, old table will be backuped (just renamed to somethink like "collector_registration111111111") and the new one generated.

www/system/readme.txt

-All project files done for this job are stored in separate module at path:
-
-system/module/collector
-
-All configs are stored at:
-
-system/module/collector/config
-
-and use YAML format.
-
-Form config
-===========
-
-system/module/collector/config/form.yml
-
-It uses standard Zend_Form format and you can add elements, decorators, validators etc. to your form. You can check both examples at that file and at offical Zend_Form documentation:
-
-http://framework.zend.com/manual/en/zend.form.forms.html
-
-Invites config
-==============
-
-system/module/collector/config/invites.yml
-
-Format:
-
-- one invite per line
-- not used invite:
-    invite name: true
-- used invite (it will be marked so by system when user registration will be completed; I don't delete used invites to not allow add used invite in list by mistake):
-    invite name: false
-
-Module specific application config
-==================================
-
-system/module/collector/config/app.yml
-
-Among other options in this file at line 10 you can set confirmation link expiration time.
-
-Database schema
-===============
-
-I use only 1 table named "collector__registration" to store registration info. It will always have these fields:
-
-    id: { type: integer, primary: true, autoincrement: true }
-    email: { type: string(255), notnull: true, unique: true }
-    # invite used with this registration
-    invite: { type: string(255), notnull: true, unique: true }
-    # randomly generated secret string (md5 hash), used to confirm registration
-    secret: { type: string(32), fixed: true, notnull: true, unique: true }
-    # flag, which indicates confirmed accounts
-    is_confirmed: { type: boolean, notnull: true, default: false }
-
-Other fields will be added to the table when you regenerate the form.
-
-Form regeneration
-=================
-
-When you edit the form and want to regenerate it, you should log in:
-
-uri: /login
-login: admin
-password: test
-
-After this you will see new action at main menu named "Regenerate form". When you click it, old table will be backuped (just renamed to somethink like "collector_registration111111111") and the new one generated.