Edit ad, not show 'new' field when all languages
authorGusa <gu.martinm@gmail.com>
Sun, 16 Dec 2012 04:07:44 +0000 (05:07 +0100)
committerGusa <gu.martinm@gmail.com>
Sun, 16 Dec 2012 04:07:44 +0000 (05:07 +0100)
If the current ad has a description for every available language in the system
do not show the new field.

lib/form/doctrine/AdForm.class.php

index ab3c8b6..c3105d6 100644 (file)
@@ -81,13 +81,13 @@ class AdForm extends BaseAdForm
     //i18n (Internationalization)
     $this->widgetSchema->getFormFormatter()->setTranslationCatalogue('ad_form');
 
-    // Ad creation form
-    $adDescription = new AdDescription();
-    $adDescription->Ad = $this->getObject();
-    $newAdDescriptionForm = new AdDescriptionForm($adDescription);
 
     if (!$this->isTheLanguageInformationComplete())
     {
+        // Ad creation form
+        $adDescription = new AdDescription();
+        $adDescription->Ad = $this->getObject();
+        $newAdDescriptionForm = new AdDescriptionForm($adDescription);
         $this->embedForm('new', $newAdDescriptionForm);
     }