Bugs fixed: Valid problem, missing numbers
authorStefanie Stamer <s.stamer@metaways.de>
Mon, 12 Sep 2011 09:57:17 +0000 (11:57 +0200)
committerMichael Spahn <m.spahn@metaways.de>
Thu, 4 Oct 2012 13:54:55 +0000 (15:54 +0200)
tine20/Inventory/Model/InventoryItem.php
tine20/Inventory/js/InventoryItemEditDialog.js
tine20/Inventory/translations/de.mo
tine20/Inventory/translations/de.po

index ed65036..af3c193 100644 (file)
@@ -99,11 +99,11 @@ class Inventory_Model_InventoryItem extends Tinebase_Record_Abstract
      */
     public function isValid($_throwExceptionOnInvalidData = false)
     {
-       $isValid = parent::isValid($_throwExceptionOnInvalidData);
+       //$isValid = parent::isValid($_throwExceptionOnInvalidData);
        
-       $isValid &= (int) $this->active_number > (int) $this->total_number;
+       $isValid = (int) $this->active_number > (int) $this->total_number;
        
-       if ($isValid && $_throwExceptionOnInvalidData) {
+       if ($isValid && $_throwExceptionOnInvalidData) {
                $e = new Tinebase_Exception_Record_Validation('active number must be equal or less than total number');
                Tinebase_Core::getLogger()->err(__METHOD__ . '::' . __LINE__ . ":\n" .
                print_r($this->_validationErrors,true). $e);
@@ -117,8 +117,10 @@ class Inventory_Model_InventoryItem extends Tinebase_Record_Abstract
      * (non-PHPdoc)
      * @see Tinebase/Record/Tinebase_Record_Abstract::setFromArray()
      */
+    /*
     public function setFromArray(array $_data)
     {
+       
         if (isset($_data['total_number']) && ! is_int($_data['total_number'])) {
                unset($_data['total_number']);
         }
@@ -129,7 +131,7 @@ class Inventory_Model_InventoryItem extends Tinebase_Record_Abstract
         
         return parent::setFromArray($_data);
     }
-    
+    */
     /**
      * fills a record from json data
      *
@@ -138,7 +140,16 @@ class Inventory_Model_InventoryItem extends Tinebase_Record_Abstract
      */
     public function setFromJson($_data)
     {
-        parent::setFromJson($_data);
+       
+        if (isset($_data['total_number']) && ! is_int($_data['total_number'])) {
+               unset($_data['total_number']);
+        }
+        
+        if (isset($_data['active_number']) && ! is_int($_data['active_number'])) {
+               unset($_data['active_number']);
+        }
+        
+       return parent::setFromJson($_data);
         
         // do something here if you like
     }
index 4610a6a..cf9d9ee 100644 (file)
@@ -71,6 +71,7 @@ Tine.Inventory.InventoryItemEditDialog = Ext.extend(Tine.widgets.dialog.EditDial
     /**
      * check validity of activ numer field
      */
+    
     isValid: function () {
         var form = this.getForm();
         var isValid = true;
@@ -172,7 +173,7 @@ Tine.Inventory.InventoryItemEditDialog = Ext.extend(Tine.widgets.dialog.EditDial
                             name: 'total_number',
                             //value: null,
                             value: 1,
-                            minValue: 1
+                            //minValue: 1
                             
                         },
                         {
@@ -182,7 +183,7 @@ Tine.Inventory.InventoryItemEditDialog = Ext.extend(Tine.widgets.dialog.EditDial
                             name: 'active_number',
                             //value: null,
                             value: 1,
-                            minValue: 0
+                            //minValue: 0
                             
                         }],
                         
index e328976..4a0d347 100644 (file)
Binary files a/tine20/Inventory/translations/de.mo and b/tine20/Inventory/translations/de.mo differ
index 7ae8945..f6f6276 100644 (file)
@@ -3,7 +3,7 @@ msgstr ""
 "Project-Id-Version: Tine 2.0 Inventory\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2011-09-09 15:25+0100\n"
-"PO-Revision-Date: 2011-09-09 15:25+0100\n"
+"PO-Revision-Date: 2011-09-12 11:53+0100\n"
 "Last-Translator: sstamer <s.stamer@metaways.de>\n"
 "Language-Team: \n"
 "Language: \n"
@@ -18,40 +18,48 @@ msgstr ""
 "X-Poedit-SourceCharset: utf-8\n"
 "X-Poedit-SearchPath-0: Inventory\n"
 
-#: js/InventoryItemGridPanel.js:83 js/Model.js:85
+#: js/InventoryItemGridPanel.js:83
+#: js/Model.js:85
 #: js/InventoryItemEditDialog.js:137
 msgid "ID"
 msgstr "ID"
 
-#: js/InventoryItemGridPanel.js:89 js/Model.js:77
+#: js/InventoryItemGridPanel.js:89
+#: js/Model.js:77
 #: js/InventoryItemEditDialog.js:121
 msgid "Name"
 msgstr "Name"
 
-#: js/InventoryItemGridPanel.js:95 js/Model.js:79
+#: js/InventoryItemGridPanel.js:95
+#: js/Model.js:79
 #: js/InventoryItemEditDialog.js:129
 msgid "Type"
 msgstr "Typ"
 
-#: js/InventoryItemGridPanel.js:102 js/Model.js:87
+#: js/InventoryItemGridPanel.js:102
+#: js/Model.js:87
 #: js/InventoryItemEditDialog.js:163
 msgid "Added"
 msgstr "Hinzugefügt"
 
-#: js/InventoryItemGridPanel.js:109 js/Model.js:86
+#: js/InventoryItemGridPanel.js:109
+#: js/Model.js:86
 #: js/InventoryItemEditDialog.js:155
 msgid "Location"
 msgstr "Standort"
 
-#: js/InventoryItemGridPanel.js:115 js/InventoryItemEditDialog.js:171
+#: js/InventoryItemGridPanel.js:115
+#: js/InventoryItemEditDialog.js:171
 msgid "Total number"
 msgstr "Anzahl"
 
-#: js/InventoryItemGridPanel.js:121 js/InventoryItemEditDialog.js:181
+#: js/InventoryItemGridPanel.js:121
+#: js/InventoryItemEditDialog.js:181
 msgid "Active number"
 msgstr "Verwendbare Anzahl"
 
-#: js/InventoryItemGridPanel.js:127 js/InventoryItemEditDialog.js:144
+#: js/InventoryItemGridPanel.js:127
+#: js/InventoryItemEditDialog.js:144
 msgid "Description"
 msgstr "Beschreibung"
 
@@ -67,7 +75,8 @@ msgstr "Budget"
 msgid "Show closed"
 msgstr "Zeige Geschlossene"
 
-#: js/Inventory.js:24 Setup/setup.xml:4
+#: js/Inventory.js:24
+#: Setup/setup.xml:4
 msgid "Inventory"
 msgstr "Inventar"
 
@@ -137,7 +146,7 @@ msgstr "Tastatur"
 
 #: Setup/Initialize.php:37
 msgid "unkown"
-msgstr ""
+msgstr "unbekannt"
 
 #: Controller.php:74
 #, python-format
@@ -156,16 +165,19 @@ msgstr ""
 #~ msgstr "unbekannt"
 
 #~ msgid "inventory item list"
+
 #~ msgid_plural "inventory item lists"
 #~ msgstr[0] "Inventar Gegenstandsliste"
 #~ msgstr[1] "Inventar Gegenstandslisten"
 
 #~ msgid "inventory item"
+
 #~ msgid_plural "inventory records"
 #~ msgstr[0] "Inventar Gegenstand"
 #~ msgstr[1] "Inventar Gegenstände"
 
 #~ msgid "inventory record list"
+
 #~ msgid_plural "inventory record lists"
 #~ msgstr[0] "Inventar Gegenstandsliste"
 #~ msgstr[1] "Inventar Gegenstandslisten"