diff --git a/resources/inc/class.resources_bo.inc.php b/resources/inc/class.resources_bo.inc.php index ac263c921c..2fbfc3561a 100755 --- a/resources/inc/class.resources_bo.inc.php +++ b/resources/inc/class.resources_bo.inc.php @@ -295,10 +295,14 @@ class resources_bo // we need an id to save pictures and make links... if(!$resource['res_id']) { + $resource['res_owner'] = $GLOBALS['egw_info']['user']['account_id']; + $resource['res_created'] = egw_time::server2user(time(),'ts'); $resource['res_id'] = $this->so->save($resource); } else { + $resource['res_modifier'] = $GLOBALS['egw_info']['user']['account_id']; + $resource['res_modified'] = egw_time::server2user(time(),'ts'); $old = $this->read($resource['res_id']); } @@ -389,7 +393,7 @@ class resources_bo $this->so->save(); } } - + $res_id = $this->so->save($resource); // History & notifications diff --git a/resources/setup/setup.inc.php b/resources/setup/setup.inc.php index de8ca9a958..1d56ca03e2 100755 --- a/resources/setup/setup.inc.php +++ b/resources/setup/setup.inc.php @@ -13,7 +13,7 @@ $setup_info['resources']['name'] = 'resources'; $setup_info['resources']['title'] = 'Resources'; -$setup_info['resources']['version'] = '1.9.003'; +$setup_info['resources']['version'] = '1.9.004'; $setup_info['resources']['app_order'] = 5; $setup_info['resources']['tables'] = array('egw_resources','egw_resources_extra'); $setup_info['resources']['enable'] = 1; @@ -47,3 +47,4 @@ $setup_info['resources']['depends'][] = array( // cause eTemplates is not in the 'versions' => Array('1.7','1.8','1.9') ); + diff --git a/resources/setup/tables_current.inc.php b/resources/setup/tables_current.inc.php index bcfbdc9438..286fa2f111 100755 --- a/resources/setup/tables_current.inc.php +++ b/resources/setup/tables_current.inc.php @@ -29,7 +29,11 @@ $phpgw_baseline = array( 'accessory_of' => array('type' => 'int','precision' => '11','default' => '-1'), 'storage_info' => array('type' => 'varchar','precision' => '200'), 'inventory_number' => array('type' => 'varchar','precision' => '20'), - 'deleted' => array('type' => 'int','meta' => 'timestamp','precision' => '8') + 'deleted' => array('type' => 'int','meta' => 'timestamp','precision' => '8'), + 'res_creator' => array('type' => 'int','meta' => 'user','precision' => '11'), + 'res_created' => array('type' => 'int','meta' => 'timestamp','precision' => '8'), + 'res_modifier' => array('type' => 'int','meta' => 'user','precision' => '11'), + 'res_modified' => array('type' => 'int','meta' => 'timestamp','precision' => '8') ), 'pk' => array('res_id'), 'fk' => array(), diff --git a/resources/setup/tables_update.inc.php b/resources/setup/tables_update.inc.php index c0d1fbd744..76c72f8dd8 100755 --- a/resources/setup/tables_update.inc.php +++ b/resources/setup/tables_update.inc.php @@ -349,4 +349,30 @@ function resources_upgrade1_9_001() function resources_upgrade1_9_002() { return $GLOBALS['setup_info']['resources']['currentver'] = '1.9.003'; -} \ No newline at end of file +} +function resources_upgrade1_9_003() +{ + $GLOBALS['egw_setup']->oProc->AddColumn('egw_resources','res_creator',array( + 'type' => 'int', + 'meta' => 'user', + 'precision' => '11' + )); + $GLOBALS['egw_setup']->oProc->AddColumn('egw_resources','res_created',array( + 'type' => 'int', + 'meta' => 'timestamp', + 'precision' => '8' + )); + $GLOBALS['egw_setup']->oProc->AddColumn('egw_resources','res_modifier',array( + 'type' => 'int', + 'meta' => 'user', + 'precision' => '11' + )); + $GLOBALS['egw_setup']->oProc->AddColumn('egw_resources','res_modified',array( + 'type' => 'int', + 'meta' => 'timestamp', + 'precision' => '8' + )); + + return $GLOBALS['setup_info']['resources']['currentver'] = '1.9.004'; +} + diff --git a/resources/templates/default/edit.xet b/resources/templates/default/edit.xet index 98a67896a4..87db61ecf2 100644 --- a/resources/templates/default/edit.xet +++ b/resources/templates/default/edit.xet @@ -185,17 +185,17 @@ - + - + - + - +