[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [10986] property: more on inventory
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [10986] property: more on inventory |
Date: |
Wed, 13 Mar 2013 20:45:24 +0000 |
Revision: 10986
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10986
Author: sigurdne
Date: 2013-03-13 20:45:24 +0000 (Wed, 13 Mar 2013)
Log Message:
-----------
property: more on inventory
Modified Paths:
--------------
trunk/property/inc/class.sobudget.inc.php
trunk/property/inc/class.soentity.inc.php
trunk/property/inc/class.uientity.inc.php
trunk/property/js/yahoo/entity.edit.js
trunk/property/templates/base/entity.xsl
Modified: trunk/property/inc/class.sobudget.inc.php
===================================================================
--- trunk/property/inc/class.sobudget.inc.php 2013-03-13 20:44:40 UTC (rev
10985)
+++ trunk/property/inc/class.sobudget.inc.php 2013-03-13 20:45:24 UTC (rev
10986)
@@ -565,7 +565,6 @@
$filtermethod = '';
$filtermethod_order = " WHERE (fm_workorder_budget.year
= $year OR fm_workorder_status.closed IS NULL)";
- $filtermethod_paid = " WHERE
(fm_orders_paid_or_pending_view.periode > {$year}00 and
fm_orders_paid_or_pending_view.periode < {$year}13)";
$where = 'AND';
Modified: trunk/property/inc/class.soentity.inc.php
===================================================================
--- trunk/property/inc/class.soentity.inc.php 2013-03-13 20:44:40 UTC (rev
10985)
+++ trunk/property/inc/class.soentity.inc.php 2013-03-13 20:45:24 UTC (rev
10986)
@@ -151,10 +151,10 @@
switch($order)
{
case 'user_id':
- // $ordermethod = " ORDER BY
phpgw_accounts.account_lastname {$sort}"; // Don't work with LDAP.
+ // $ordermethod = " ORDER BY
phpgw_accounts.account_lastname {$sort}"; // Don't work with LDAP.
break;
case 'loc1_name':
- $ordermethod = " ORDER BY
fm_location1.loc1_name {$sort}"; // Don't work with LDAP.
+ $ordermethod = " ORDER BY
fm_location1.loc1_name {$sort}"; // Don't work with LDAP.
break;
default:
$ordermethod = " ORDER BY
$entity_table.$order $sort";
@@ -220,7 +220,7 @@
/**
* Method for retreiving sublevels of a hierarchy.
- *
+ *
* @param $data array array holding input parametres
* @return array of entities
*/
@@ -768,7 +768,7 @@
switch($order)
{
case 'user_id':
- // $ordermethod = " ORDER BY
phpgw_accounts.account_lastname {$sort}"; // Don't work with LDAP.
+ // $ordermethod = " ORDER BY
phpgw_accounts.account_lastname {$sort}"; // Don't work with LDAP.
break;
case 'loc1_name':
$ordermethod = " ORDER BY
fm_location1.loc1_name {$sort}";
@@ -1176,10 +1176,10 @@
switch($order)
{
case 'user_id':
- // $ordermethod = " ORDER BY
phpgw_accounts.account_lastname {$sort}"; // Don't work with LDAP.
+ // $ordermethod = " ORDER BY
phpgw_accounts.account_lastname {$sort}"; // Don't work with LDAP.
break;
case 'loc1_name':
- $ordermethod = " ORDER BY
fm_location1.loc1_name {$sort}"; // Don't work with LDAP.
+ $ordermethod = " ORDER BY
fm_location1.loc1_name {$sort}"; // Don't work with LDAP.
break;
default:
$metadata =
$this->db->metadata($entity_table);
@@ -2352,7 +2352,7 @@
/**
* Method for retreiving inventory of bulk items.
- *
+ *
* @param $data array array holding input parametres
* @return array of entities
*/
@@ -2368,18 +2368,24 @@
return array();
}
- $sql = "SELECT * FROM fm_bim_item_inventory WHERE
location_id = {$location_id} AND id = {$id}";
+ $sql = "SELECT fm_bim_item_inventory.*,
fm_standard_unit.name AS unit FROM fm_bim_item_inventory"
+ . " {$this->join} fm_standard_unit ON
fm_bim_item_inventory.unit_id = fm_standard_unit.id"
+ . " WHERE location_id = {$location_id} AND
fm_bim_item_inventory.item_id = {$id} AND expired_on IS NULL";
$this->db->query($sql,__LINE__,__FILE__);
$inventory = array();
while ($this->db->next_record())
{
$inventory[] = array
(
- 'inventory' =>
$this->db->f('inventory'),
- 'unit_id' =>
$this->db->f('unit_id'),
+ 'inventory' =>
$this->db->f('inventory'),
+ 'unit' =>
$this->db->f('unit', true),
'remark' =>
$this->db->f('remark', true),
- 'descr' =>
$this->db->f('descr', true),
- 'is_eav' =>
$this->db->f('is_eav')
+ 'p_location_id' =>
$this->db->f('p_location_id'),
+ 'p_id' =>
$this->db->f('p_id'),
+ 'bookable' =>
$this->db->f('bookable'),
+ 'active_from' =>
$this->db->f('active_from'),
+ 'active_to' =>
$this->db->f('active_to'),
+ 'bookable' =>
$this->db->f('bookable'),
);
}
@@ -2401,7 +2407,7 @@
expired_on bigint,
expired_by bigint,
remark text,
-
+
*/
Modified: trunk/property/inc/class.uientity.inc.php
===================================================================
--- trunk/property/inc/class.uientity.inc.php 2013-03-13 20:44:40 UTC (rev
10985)
+++ trunk/property/inc/class.uientity.inc.php 2013-03-13 20:45:24 UTC (rev
10986)
@@ -57,9 +57,10 @@
'attrib_history'=> true,
'attrib_help' => true,
'print_pdf' => true,
- 'index' => true,
+ 'index' => true,
'addfiles' => true,
- 'get_files' => true
+ 'get_files' => true,
+ 'add_inventory' => true
);
function property_uientity()
@@ -2166,6 +2167,7 @@
'datatable'
=> $datavalues,
'myColumnDefs'
=> $myColumnDefs,
'enable_bulk'
=> $category['enable_bulk'],
+ 'value_location_id'
=> $GLOBALS['phpgw']->locations->get_id($this->type_app[$this->type],
$this->acl_location),
'link_pdf'
=> $GLOBALS['phpgw']->link('/index.php',$pdf_data),
'start_project'
=> $category['start_project'],
'lang_start_project'
=> lang('start project'),
@@ -2266,6 +2268,8 @@
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/container/assets/skins/sam/container.css');
$GLOBALS['phpgw']->js->validate_file( 'yahoo',
'entity.edit', 'property' );
+ $GLOBALS['phpgw']->js->validate_file( 'tinybox2',
'packed', 'phpgwapi' );
+
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/tinybox2/style.css');
$criteria = array
@@ -2850,4 +2854,27 @@
{
return $this->bo->get_inventory($id);
}
+
+ public function add_inventory()
+ {
+ $location_id = phpgw::get_var('location_id', 'int');
+ $id = phpgw::get_var('id',
'int');
+ $system_location =
$GLOBALS['phpgw']->locations->get_name($location_id);
+_debug_array($location_id);
+_debug_array($id);
+_debug_array($system_location);
+
+ $this->acl_add =
$this->acl->check($system_location['location'], PHPGW_ACL_ADD,
$system_location['appname']);
+
+ if(!$this->acl_add)
+ {
+ $GLOBALS['phpgw_info']['flags']['xslt_app'] =
true;
+ echo lang('No Access');
+ $GLOBALS['phpgw']->common->phpgw_exit();
+ }
+
+
+
+die();
+ }
}
Modified: trunk/property/js/yahoo/entity.edit.js
===================================================================
--- trunk/property/js/yahoo/entity.edit.js 2013-03-13 20:44:40 UTC (rev
10985)
+++ trunk/property/js/yahoo/entity.edit.js 2013-03-13 20:45:24 UTC (rev
10986)
@@ -35,7 +35,19 @@
execute_async(myDataTable_0);
}
+ this.showlightbox_add_inventory = function(location_id, id)
+ {
+ var oArgs = {menuaction:'property.uientity.add_inventory',
location_id:location_id, id: id};
+ var sUrl = phpGWLink('index.php', oArgs);
+ TINY.box.show({iframe:sUrl,
boxid:'frameless',width:750,height:450,fixed:false,maskid:'darkmask',maskopacity:40,
mask:true, animate:true,
+ close: true
+ // closejs:function(){closeJS_local()}
+ });
+ }
+
+
+
YAHOO.util.Event.addListener(window, "load", function()
{
var loader = new YAHOO.util.YUILoader();
Modified: trunk/property/templates/base/entity.xsl
===================================================================
--- trunk/property/templates/base/entity.xsl 2013-03-13 20:44:40 UTC (rev
10985)
+++ trunk/property/templates/base/entity.xsl 2013-03-13 20:45:24 UTC (rev
10986)
@@ -325,7 +325,12 @@
</tr>
<xsl:choose>
<xsl:when test="value_id!='' and mode = 'edit'">
-
+
<xsl:variable name="lang_add_inventory">
+
<xsl:value-of select="php:function('lang', 'add inventory')"/>
+
</xsl:variable>
+
<a
href="javascript:showlightbox_add_inventory({value_location_id},{value_id})"
title="{$lang_add_inventory}">
+
<xsl:value-of select="$lang_add_inventory"/>
+
</a>
</xsl:when>
</xsl:choose>
</table>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [10986] property: more on inventory,
Sigurd Nes <=