changes
authorStefanie Stamer <s.stamer@metaways.de>
Thu, 8 Sep 2011 10:06:09 +0000 (12:06 +0200)
committerMichael Spahn <m.spahn@metaways.de>
Thu, 4 Oct 2012 13:54:55 +0000 (15:54 +0200)
tine20/Inventory/Frontend/Json.php
tine20/Inventory/Model/InventoryItemFilter.php
tine20/Inventory/js/InventoryItemEditDialog.js
tine20/Inventory/js/InventoryItemGridPanel.js
tine20/Inventory/js/Model.js

index 0191ae9..9a06288 100644 (file)
@@ -99,7 +99,7 @@ class Inventory_Frontend_Json extends Tinebase_Frontend_Json_Abstract
      * @param  string   $startswith
      * @return array
      */
      * @param  string   $startswith
      * @return array
      */
-    public function autoCompleteInventoryProperty($property, $startswith)
+    public function autoCompleteInventoryItemProperty($property, $startswith)
     {
         if (preg_match('/[^A-Za-z0-9_]/', $property)) {
             // NOTE: it would be better to ask the model for property presece, but we can't atm.
     {
         if (preg_match('/[^A-Za-z0-9_]/', $property)) {
             // NOTE: it would be better to ask the model for property presece, but we can't atm.
index 97aca32..2bef544 100644 (file)
@@ -32,7 +32,7 @@ class Inventory_Model_InventoryItemFilter extends Tinebase_Model_Filter_FilterGr
      * @var array filter model fieldName => definition
      */
     protected $_filterModel = array(
      * @var array filter model fieldName => definition
      */
     protected $_filterModel = array(
-        'query'          => array('filter' => 'Tinebase_Model_Filter_Query', 'options' => array('fields' => array('name', /*'...'*/))),
+        'query'          => array('filter' => 'Tinebase_Model_Filter_Query', 'options' => array('fields' => array('name', 'type', 'location'/*'...'*/))),
         'container_id'   => array('filter' => 'Tinebase_Model_Filter_Container', 'options' => array('applicationName' => 'Inventory')),
         'id'             => array('filter' => 'Tinebase_Model_Filter_Id'),
         'type'           => array('filter' => 'Tinebase_Model_Filter_Text'),
         'container_id'   => array('filter' => 'Tinebase_Model_Filter_Container', 'options' => array('applicationName' => 'Inventory')),
         'id'             => array('filter' => 'Tinebase_Model_Filter_Id'),
         'type'           => array('filter' => 'Tinebase_Model_Filter_Text'),
index fbae5c7..cd40659 100644 (file)
@@ -101,6 +101,8 @@ Tine.Inventory.InventoryItemEditDialog = Ext.extend(Tine.widgets.dialog.EditDial
                     },
                     items: [[{
                         columnWidth: 1,
                     },
                     items: [[{
                         columnWidth: 1,
+                        xtype: 'tine.widget.field.AutoCompleteField',
+                        recordClass: this.recordClass,
                         fieldLabel: this.app.i18n._('Name'),
                         name: 'name',
                         allowBlank: false
                         fieldLabel: this.app.i18n._('Name'),
                         name: 'name',
                         allowBlank: false
@@ -119,6 +121,8 @@ Tine.Inventory.InventoryItemEditDialog = Ext.extend(Tine.widgets.dialog.EditDial
                         }],
                         [{
                             columnWidth: 0.5,
                         }],
                         [{
                             columnWidth: 0.5,
+                            xtype: 'tine.widget.field.AutoCompleteField',
+                            recordClass: this.recordClass,
                             fieldLabel: this.app.i18n._('Location'),
                             name: 'location',
                             allowBlank: false
                             fieldLabel: this.app.i18n._('Location'),
                             name: 'location',
                             allowBlank: false
index cfa35cb..e656e39 100644 (file)
@@ -102,7 +102,8 @@ Tine.Inventory.InventoryItemGridPanel = Ext.extend(Tine.widgets.grid.GridPanel,
                 header: this.app.i18n._("Added"),
                 width: 50,
                 sortable: true,
                 header: this.app.i18n._("Added"),
                 width: 50,
                 sortable: true,
-                dataIndex: 'add_time'
+                dataIndex: 'add_time', 
+                renderer: Tine.Tinebase.common.dateRenderer
             },{
                 id: 'location',
                 header: this.app.i18n._("Location"),
             },{
                 id: 'location',
                 header: this.app.i18n._("Location"),
index c70384f..7413db1 100644 (file)
@@ -22,9 +22,9 @@ Tine.Inventory.Model.InventoryItem = Tine.Tinebase.data.Record.create(Tine.Tineb
     { name: 'inventory_id' },
     { name: 'location' },
     { name: 'description' },
     { name: 'inventory_id' },
     { name: 'location' },
     { name: 'description' },
-    { name: 'add_time' },
-    { name: 'total_number' },
-    { name: 'active_number' },
+    { name: 'add_time', type: 'date', dateFormat: Date.patterns.ISO8601Long},
+    { name: 'total_number', type: 'integer'},
+    { name: 'active_number', type: 'integer' },
     // TODO add more record fields here
     // tine 2.0 notes + tags
     { name: 'notes'},
     // TODO add more record fields here
     // tine 2.0 notes + tags
     { name: 'notes'},
@@ -73,6 +73,7 @@ Tine.Inventory.Model.InventoryItem.getFilterModel = function() {
     
     return [
         {label: _('Quick search'),    field: 'query',       operators: ['contains']},
     
     return [
         {label: _('Quick search'),    field: 'query',       operators: ['contains']},
+        {label: _('Name'),    field: 'name',       operators: ['contains']},
         {
             label: app.i18n._('Type'),
             field: 'type',
         {
             label: app.i18n._('Type'),
             field: 'type',
@@ -80,6 +81,9 @@ Tine.Inventory.Model.InventoryItem.getFilterModel = function() {
             app: app, 
             keyfieldName: 'inventoryType'
         },
             app: app, 
             keyfieldName: 'inventoryType'
         },
+        {label: _('ID'),    field: 'inventory_id',       operators: ['contains']},
+        {label: _('Location'),    field: 'location',       operators: ['contains']},
+        {label: app.i18n._('Added'),         field: 'add_time', valueType: 'date', pastOnly: true},
         {filtertype: 'tinebase.tag', app: app},
         {filtertype: 'tine.widget.container.filtermodel', app: app, recordClass: Tine.Inventory.Model.InventoryItem},
         {label: app.i18n._('Last modified'),                                            field: 'last_modified_time', valueType: 'date'},
         {filtertype: 'tinebase.tag', app: app},
         {filtertype: 'tine.widget.container.filtermodel', app: app, recordClass: Tine.Inventory.Model.InventoryItem},
         {label: app.i18n._('Last modified'),                                            field: 'last_modified_time', valueType: 'date'},