fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [11020] property: inventory


From: Sigurd Nes
Subject: [Fmsystem-commits] [11020] property: inventory
Date: Tue, 02 Apr 2013 10:32:07 +0000

Revision: 11020
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11020
Author:   sigurdne
Date:     2013-04-02 10:32:06 +0000 (Tue, 02 Apr 2013)
Log Message:
-----------
property: inventory

Modified Paths:
--------------
    trunk/property/inc/class.boentity.inc.php
    trunk/property/inc/class.soentity.inc.php
    trunk/property/inc/class.uientity.inc.php
    trunk/property/js/yahoo/entity.edit.js

Modified: trunk/property/inc/class.boentity.inc.php
===================================================================
--- trunk/property/inc/class.boentity.inc.php   2013-04-01 14:16:50 UTC (rev 
11019)
+++ trunk/property/inc/class.boentity.inc.php   2013-04-02 10:32:06 UTC (rev 
11020)
@@ -690,6 +690,8 @@
                        {
                                $link_info = 
$interlink->get_location_link($entry['p_location_id'], $entry['p_id'],'view');
                                $entry['where'] = "<a 
href='{$link_info['link']}'>{$link_info['name']}</a>";
+                               $entry['location_id'] = $location_id;
+                               $entry['id'] = $id;
                        }
 
                        return $values;

Modified: trunk/property/inc/class.soentity.inc.php
===================================================================
--- trunk/property/inc/class.soentity.inc.php   2013-04-01 14:16:50 UTC (rev 
11019)
+++ trunk/property/inc/class.soentity.inc.php   2013-04-02 10:32:06 UTC (rev 
11020)
@@ -2377,7 +2377,7 @@
                        {
                                $inventory[] = array
                                (
-                                       'id'                    => 
$this->db->f('id'),
+                                       'inventory_id'  => $this->db->f('id'),
                                        'inventory'             => 
$this->db->f('inventory'),
                                        'unit_id'               => 
$this->db->f('unit_id'),
                                        'unit'                  => 
$this->db->f('unit', true),

Modified: trunk/property/inc/class.uientity.inc.php
===================================================================
--- trunk/property/inc/class.uientity.inc.php   2013-04-01 14:16:50 UTC (rev 
11019)
+++ trunk/property/inc/class.uientity.inc.php   2013-04-02 10:32:06 UTC (rev 
11020)
@@ -48,20 +48,21 @@
 
                var $public_functions = array
                        (
-                               'columns'               => true,
-                               'download'              => true,
-                               'view'                  => true,
-                               'edit'                  => true,
-                               'delete'                => true,
-                               'view_file'             => true,
-                               'attrib_history'=> true,
-                               'attrib_help'   => true,
-                               'print_pdf'             => true,
-                               'index'                 => true,
-                               'addfiles'              => true,
-                               'get_files'             => true,
-                               'get_inventory' => true,
-                               'add_inventory' => true
+                               'columns'                       => true,
+                               'download'                      => true,
+                               'view'                          => true,
+                               'edit'                          => true,
+                               'delete'                        => true,
+                               'view_file'                     => true,
+                               'attrib_history'        => true,
+                               'attrib_help'           => true,
+                               'print_pdf'                     => true,
+                               'index'                         => true,
+                               'addfiles'                      => true,
+                               'get_files'                     => true,
+                               'get_inventory'         => true,
+                               'add_inventory'         => true,
+                               'edit_inventory'        => true
                        );
 
                function property_uientity()
@@ -2156,6 +2157,9 @@
                                                                array('key' => 
'bookable','label'=>lang('bookable'),'sortable'=>false,'resizeable'=>true, 
'formatter' => 'FormatterCenter'),
                                                                array('key' => 
'calendar','label'=>lang('calendar'),'sortable'=>false,'resizeable'=>true),
                                                                array('key' => 
'remark','label'=>lang('remark'),'sortable'=>false,'resizeable'=>true),
+                                                               array('key' => 
'location_id','hidden'=>true),
+                                                               array('key' => 
'id','hidden'=>true),
+                                                               array('key' => 
'inventory_id','hidden'=>true),
                                                        )
                                                )
                                        );
@@ -2888,6 +2892,24 @@
                        return $inventory;
                }
 
+               public function edit_inventory()
+               {
+                       $location_id    = phpgw::get_var('location_id', 'int');
+                       $id                             = phpgw::get_var('id', 
'int');
+                       $inventory_id   = phpgw::get_var('inventory_id', 'int');
+
+                       $system_location = 
$GLOBALS['phpgw']->locations->get_name($location_id);
+
+                       $this->acl_add  = 
$this->acl->check($system_location['location'], PHPGW_ACL_ADD, 
$system_location['appname']);
+
+                       if(!$this->acl_add)
+                       {
+                               echo lang('No Access');
+                               $GLOBALS['phpgw']->common->phpgw_exit();
+                       }
+               
+               }
+
                public function add_inventory()
                {
                        $location_id    = phpgw::get_var('location_id', 'int');

Modified: trunk/property/js/yahoo/entity.edit.js
===================================================================
--- trunk/property/js/yahoo/entity.edit.js      2013-04-01 14:16:50 UTC (rev 
11019)
+++ trunk/property/js/yahoo/entity.edit.js      2013-04-02 10:32:06 UTC (rev 
11020)
@@ -16,8 +16,14 @@
                this.addFooterDatatable3(myPaginator_3,myDataTable_3);
        }
 
+       var FormatterEdit = function(elCell, oRecord, oColumn, oData)
+       {
+               var location_id = oRecord.getData('location_id');
+               var id = oRecord.getData('id');
+               var inventory_id = oRecord.getData('inventory_id');
+               elCell.innerHTML = "<a 
href=\"javascript:showlightbox_edit_inventory(" + location_id + ',' + id + ',' 
+ inventory_id + ')">' + 'Editer' + "</a>";
+       }       
 
-
        var FormatterCenter = function(elCell, oRecord, oColumn, oData)
        {
                var amount = YAHOO.util.Number.format(oData, {decimalPlaces:0, 
decimalSeparator:",", thousandsSeparator:" "});
@@ -91,7 +97,17 @@
                });
        }
 
+       this.showlightbox_edit_inventory = function(location_id, id, 
inventory_id)
+       {
+               var oArgs = {menuaction:'property.uientity.edit_inventory', 
location_id:location_id, id: id, inventory_id: inventory_id};
+               var sUrl = phpGWLink('index.php', oArgs);
 
+               TINY.box.show({iframe:sUrl, 
boxid:'frameless',width:750,height:550,fixed:false,maskid:'darkmask',maskopacity:40,
 mask:true, animate:true,
+               close: true,
+               closejs:function(){refresh_inventory(location_id, id)}
+               });
+       }
+
        this.refresh_inventory = function(location_id, id)
        {
                var oArgs = {menuaction:'property.uientity.get_inventory', 
location_id:location_id, id: id};




reply via email to

[Prev in Thread] Current Thread [Next in Thread]