Company category: create and edit
authorGustavo Martin Morcuende <gu.martinm@gmail.com>
Sun, 3 Jun 2012 17:35:47 +0000 (19:35 +0200)
committerGustavo Martin Morcuende <gu.martinm@gmail.com>
Sun, 3 Jun 2012 17:35:47 +0000 (19:35 +0200)
apps/companyfront/modules/category/templates/_form.php
lib/form/doctrine/CompanyCategoryDescriptionForm.class.php

index ada3fd8..47c8792 100644 (file)
@@ -5,19 +5,83 @@
 <?php if (!$form->getObject()->isNew()): ?>
 <input type="hidden" name="sf_method" value="put" />
 <?php endif; ?>
+  <fieldset>
+  <legend><?php echo __('GENERAL CATEGORY AND PARENT COMPANY CATEGORY') ?></legend>
   <table>
-    <tfoot>
-      <tr>
-        <td colspan="2">
-          <?php echo $form->renderHiddenFields(false) ?>
-          &nbsp;<a href="<?php echo url_for('category/index') ?>"><?php echo __('Back to list') ?></a>
-          <input type="submit" value="Update" />
-        </td>
-      </tr>
-    </tfoot>
     <tbody>
-      <?php echo $form->renderGlobalErrors(false) ?>
-      <?php echo $form ?>
+            <?php echo $form['general_categ_id']->renderRow(array('class' => 'validate-selection')) ?>
+            <?php echo $form['general_categ_id']->renderError() ?>
+            <?php echo $form['parent_category']->renderRow(array('class' => 'validate-selection')) ?>
+            <?php echo $form['parent_category']->renderError() ?>
     </tbody>
   </table>
+  </fieldset>
+  <fieldset>
+  <legend class="optional"><?php echo __('INTERNATIONALIZATION') ?></legend>
+  <table id="rounded-cornergus">
+  <thead>
+    <tr>
+        <th> </th>
+        <th scope="col" class="rounded-companygus"><?php echo __('Language') ?></th>
+        <th scope="col" class="rounded-companygus"><?php echo __('Category Name and Description') ?></th>
+        <th scope="col" class="rounded-q4gus"><?php echo __('Remove') ?></th>
+    </tr>
+  </thead>
+  <tbody>
+  <?php if (isset($form['new'])): ?>
+     <tr>
+    <td><?php echo __('New Entry:') ?></td>
+    <td>
+        <?php echo $form['new']['language_id']->render(array('class' => 'validate-selection')) ?>
+        <?php echo $form['new']['language_id']->renderError() ?>
+    </td>
+    <td>
+        <?php echo $form['new']['company_categ_name']->render(array('class' => 'required')) ?>
+        <?php echo $form['new']['company_categ_name']->renderError() ?>
+        <?php echo $form['new']['company_categ_description']->render(array('class' => 'required')) ?>
+        <?php echo $form['new']['company_categ_description']->renderError() ?>
+        <?php echo $form['new']['id'] ?>
+        <?php echo $form['new']['id']->renderError() ?>
+    </td>
+    <td></td>
+    </tr>
+  <?php endif; ?>
+  <?php foreach ($form['CompanyCategoryDescription'] as $companyCategDescription): ?>
+    <tr>
+    <td><?php echo __('Current Entry:') ?></td>
+    <td>
+        <?php echo $companyCategDescription['language_id']->render(array('class' => 'validate-selection')) ?>
+        <?php echo $companyCategDescription['language_id']->renderError() ?>
+    </td>
+    <td>
+        <?php echo $companyCategDescription['company_categ_name']->render(array('class' => 'required')) ?>
+        <?php echo $companyCategDescription['company_categ_name']->renderError() ?>
+        <?php echo $companyCategDescription['company_categ_description']->render(array('class' => 'required')) ?>
+        <?php echo $companyCategDescription['company_categ_description']->renderError() ?>
+    </td>
+    <td>
+        <?php echo $companyCategDescription['delete'] ?>
+        <?php echo $companyCategDescription['delete']->renderError() ?>
+        <?php echo $companyCategDescription['id'] ?>
+        <?php echo $companyCategDescription['id']->renderError() ?>
+    </td>
+    </tr>
+  <?php endforeach; ?>
+  </tbody>
+  </table>
+  <?php echo $form->renderHiddenFields(false) ?>
+  </fieldset>
+  &nbsp;
+  <table align="right">
+        <tbody>
+            <tr>
+            <td>
+                <a href="<?php echo url_for('category/index?page=') ?>" class="bt_red"><strong><?php echo __('Back to list') ?></strong></a>
+            </td>
+            <td>
+                <input type="submit" value="<?php echo __('Update') ?>" class="NFButton">
+            </td>
+            </tr>
+        </tbody>
+   </table>
 </form>
index 6b0c289..a8e4dbc 100644 (file)
@@ -14,6 +14,8 @@ class CompanyCategoryDescriptionForm extends BaseCompanyCategoryDescriptionForm
   {
     unset($this['company_categ_id']);
 
+    $this->widgetSchema['company_categ_description'] = new sfWidgetFormTextarea();
+
     if ($this->object->exists())
     {
       $this->widgetSchema['delete'] = new sfWidgetFormInputCheckbox();