[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [11211] property: periodization transition
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [11211] property: periodization transition |
Date: |
Thu, 27 Jun 2013 13:24:15 +0000 |
Revision: 11211
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11211
Author: sigurdne
Date: 2013-06-27 13:24:14 +0000 (Thu, 27 Jun 2013)
Log Message:
-----------
property: periodization transition
Modified Paths:
--------------
trunk/property/inc/class.boinvoice.inc.php
trunk/property/inc/class.menu.inc.php
trunk/property/inc/class.sogeneric.inc.php
trunk/property/setup/phpgw_no.lang
trunk/property/setup/setup.inc.php
trunk/property/setup/tables_current.inc.php
trunk/property/setup/tables_update.inc.php
Modified: trunk/property/inc/class.boinvoice.inc.php
===================================================================
--- trunk/property/inc/class.boinvoice.inc.php 2013-06-27 10:57:38 UTC (rev
11210)
+++ trunk/property/inc/class.boinvoice.inc.php 2013-06-27 13:24:14 UTC (rev
11211)
@@ -248,6 +248,26 @@
function period_list($selected='')
{
+
+ $sogeneric =
CreateObject('property.sogeneric','period_transition');
+ $config =
$sogeneric->read(array('allrows' => true));
+
+ $period_transition = array();
+ foreach($config as $entry)
+ {
+ $period_transition[$entry['month']] = $entry;
+ }
+
+ $current_month = date('n');
+
+ if(isset($period_transition[$current_month]))
+ {
+ $_lag_day =
(int)$period_transition[$current_month]['day'];
+ $_lag_hour =
(int)$period_transition[$current_month]['hour'];
+ $_lag_seconds = ($_lag_day * 24 * 3600) +
($_lag_hour * 3600);
+ }
+
+//_debug_array($period_transition);
$time = time();
$_lag = date('n') == 1 ? 17 : 7;//6 days into next
month, 16 days into next year
Modified: trunk/property/inc/class.menu.inc.php
===================================================================
--- trunk/property/inc/class.menu.inc.php 2013-06-27 10:57:38 UTC (rev
11210)
+++ trunk/property/inc/class.menu.inc.php 2013-06-27 13:24:14 UTC (rev
11211)
@@ -251,6 +251,11 @@
'text' =>
lang('periodization outline'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uigeneric.index', 'type' => 'periodization_outline') )
),
+ 'period_transition' => array
+ (
+ 'text' => lang('period
transition'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uigeneric.index', 'type' => 'period_transition') )
+ ),
'accounting_config' => array
(
'text' =>
lang('Configuration'),
Modified: trunk/property/inc/class.sogeneric.inc.php
===================================================================
--- trunk/property/inc/class.sogeneric.inc.php 2013-06-27 10:57:38 UTC (rev
11210)
+++ trunk/property/inc/class.sogeneric.inc.php 2013-06-27 13:24:14 UTC (rev
11211)
@@ -1223,7 +1223,6 @@
);
break;
-
//-------- ID type varchar
case 'project_status':
$info = array
@@ -2492,6 +2491,110 @@
break;
+ case 'period_transition':
+ $valueset_month = array();
+ $valueset_day = array();
+ $valueset_hour = array();
+
+ $lang_default = lang('default');
+ for ($i=1;$i<14;$i++)
+ {
+ $valueset_month[] = array
+ (
+ 'id' => $i,
+ 'name' => $i == 13 ? "{$i}
({$lang_default})" : $i
+ );
+ }
+
+ for ($i=1;$i<32;$i++)
+ {
+ $valueset_day[] = array
+ (
+ 'id' => $i,
+ 'name' => $i
+ );
+ }
+
+ for ($i=1;$i<25;$i++)
+ {
+ $valueset_hour[] = array
+ (
+ 'id' => $i,
+ 'name' => $i
+ );
+ }
+
+ $info = array
+ (
+ 'table'
=> 'fm_eco_period_transition',
+ 'id'
=> array('name' => 'id', 'type' => 'auto'),
+ 'fields'
=> array
+ (
+ array
+ (
+ 'name'
=> 'month',
+ 'descr'
=> lang('month'),
+ 'type'
=> 'select',
+ 'nullable'
=> false,
+ 'filter'
=> true,
+ 'sortable'
=> true,
+ 'values_def'
=> array
+ (
+
'valueset' => $valueset_month,
+ )
+ ),
+ array
+ (
+ 'name'
=> 'day',
+ 'descr'
=> lang('day'),
+ 'type'
=> 'select',
+ 'nullable'
=> false,
+ 'size'
=> 4,
+ 'sortable'
=> true,
+ 'values_def'
=> array
+ (
+
'valueset' => $valueset_day,
+ )
+ ),
+ array
+ (
+ 'name'
=> 'hour',
+ 'descr'
=> lang('hour'),
+ 'type'
=> 'select',
+ 'nullable'
=> true,
+ 'size'
=> 4,
+ 'sortable'
=> true,
+ 'values_def'
=> array
+ (
+
'valueset' => $valueset_hour,
+ )
+ ),
+ array
+ (
+ 'name'
=> 'remark',
+ 'descr'
=> lang('remark'),
+ 'type'
=> 'varchar',
+ 'nullable'
=> true,
+ 'size'
=> 60,
+ 'sortable'
=> true
+ )
+ ),
+ 'edit_msg'
=> lang('edit'),
+ 'add_msg'
=> lang('add'),
+ 'name'
=> lang('period transition'),
+ 'acl_app'
=> 'property',
+ 'acl_location' => '.admin',
+ 'menu_selection' =>
'admin::property::accounting::period_transition',
+ 'default'
=> array
+ (
+ 'user_id'
=> array('add' => '$this->account'),
+ 'entry_date' =>
array('add' => 'time()'),
+ 'modified_date' =>
array('edit' => 'time()'),
+ )
+ );
+
+ break;
+
// START BOOKING TABLES
case 'bb_office':
$info = array
Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang 2013-06-27 10:57:38 UTC (rev 11210)
+++ trunk/property/setup/phpgw_no.lang 2013-06-27 13:24:14 UTC (rev 11211)
@@ -1218,6 +1218,7 @@
performed property no Utført
period property no Periode
periods property no Perioder
+period transition property no Periode overgang
permission property no rettighet
permissions property no Rettigheter
permissions are updated! property no rettigheter er oppdatert
@@ -2004,4 +2005,4 @@
request condition description property no Tilstandsbeskrivelse
cost operation property no Andel driftskonstnad i kr.
cost investment property no Andel investering i kr.
-grant category property no Tilskuddskategori
\ No newline at end of file
+grant category property no Tilskuddskategori
Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php 2013-06-27 10:57:38 UTC (rev 11210)
+++ trunk/property/setup/setup.inc.php 2013-06-27 13:24:14 UTC (rev 11211)
@@ -12,7 +12,7 @@
*/
$setup_info['property']['name'] = 'property';
- $setup_info['property']['version'] = '0.9.17.668';
+ $setup_info['property']['version'] = '0.9.17.669';
$setup_info['property']['app_order'] = 8;
$setup_info['property']['enable'] = 1;
$setup_info['property']['app_group'] = 'office';
@@ -156,6 +156,7 @@
'fm_ecouser',
'fm_eco_periodization',
'fm_eco_periodization_outline',
+ 'fm_eco_period_transition',
'fm_event',
'fm_event_action',
'fm_event_exception',
Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2013-06-27 10:57:38 UTC (rev
11210)
+++ trunk/property/setup/tables_current.inc.php 2013-06-27 13:24:14 UTC (rev
11211)
@@ -1354,6 +1354,22 @@
'fk' => array('fm_eco_periodization' =>
array('periodization_id' => 'id') ),
'uc' => array('periodization_id', 'month')
),
+ 'fm_eco_period_transition' => array(
+ 'fd' => array(
+ 'id' => array('type' => 'auto','precision' =>
4,'nullable' => False),
+ 'month' => array('type' => 'int','precision' =>
'4','nullable' => False),
+ 'day' => array('type' => 'int','precision' =>
'4','nullable' => true),
+ 'hour' => array('type' => 'int','precision' =>
'4','nullable' => true),
+ 'remark' => array('type' =>
'varchar','precision' => '60','nullable' => true),
+ 'user_id' => array('type' => 'int','precision'
=> 4,'nullable' => false),
+ 'entry_date' => array('type' =>
'int','precision' => 4,'nullable' => false),
+ 'modified_date' => array('type' =>
'int','precision' => 4,'nullable' => True)
+ ),
+ 'pk' => array('id'),
+ 'ix' => array(),
+ 'fk' => array(),
+ 'uc' => array('month')
+ ),
'fm_order_dim1' => array(
'fd' => array(
'id' => array('type' => 'int','precision' =>
'4','nullable' => False),
Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php 2013-06-27 10:57:38 UTC (rev
11210)
+++ trunk/property/setup/tables_update.inc.php 2013-06-27 13:24:14 UTC (rev
11211)
@@ -7544,3 +7544,42 @@
return $GLOBALS['setup_info']['property']['currentver'];
}
}
+
+
+
+ /**
+ * Update property version from 0.9.17.668 to 0.9.17.669
+ * Add check for missing budgets
+ */
+ $test[] = '0.9.17.668';
+ function property_upgrade0_9_17_668()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+ $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM fm_cache");
+
+ $GLOBALS['phpgw_setup']->oProc->CreateTable(
+ 'fm_eco_period_transition', array(
+ 'fd' => array(
+ 'id' => array('type' =>
'auto','precision' => 4,'nullable' => False),
+ 'month' => array('type' =>
'int','precision' => '4','nullable' => False),
+ 'day' => array('type' =>
'int','precision' => '4','nullable' => true),
+ 'hour' => array('type' =>
'int','precision' => '4','nullable' => true),
+ 'remark' => array('type' =>
'varchar','precision' => '60','nullable' => true),
+ 'user_id' => array('type' =>
'int','precision' => 4,'nullable' => false),
+ 'entry_date' => array('type' =>
'int','precision' => 4,'nullable' => false),
+ 'modified_date' => array('type' =>
'int','precision' => 4,'nullable' => True)
+ ),
+ 'pk' => array('id'),
+ 'ix' => array(),
+ 'fk' => array(),
+ 'uc' => array('month')
+ )
+ );
+
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['property']['currentver'] =
'0.9.17.669';
+ return $GLOBALS['setup_info']['property']['currentver'];
+ }
+ }
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [11211] property: periodization transition,
Sigurd Nes <=