forked from extern/egroupware
* Resources: Add new "res_creator,res_created,res_modifier and res_modified" columns to the database, and also, set their values in resources_bo
This commit is contained in:
parent
e60bc19f6f
commit
5e6e016375
@ -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
|
||||
|
@ -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')
|
||||
);
|
||||
|
||||
|
||||
|
@ -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(),
|
||||
|
@ -349,4 +349,30 @@ function resources_upgrade1_9_001()
|
||||
function resources_upgrade1_9_002()
|
||||
{
|
||||
return $GLOBALS['setup_info']['resources']['currentver'] = '1.9.003';
|
||||
}
|
||||
}
|
||||
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';
|
||||
}
|
||||
|
||||
|
@ -185,17 +185,17 @@
|
||||
<description value="Created by"/>
|
||||
<hbox>
|
||||
<menulist>
|
||||
<menupopup type="select-account" id="" readonly="true"/>
|
||||
<menupopup type="select-account" id="res_owner" readonly="true"/>
|
||||
</menulist>
|
||||
<date-time id="info_created" readonly="true" align="right"/>
|
||||
<date-time id="res_created" readonly="true" align="right"/>
|
||||
</hbox>
|
||||
<description/>
|
||||
<description value="Last modified"/>
|
||||
<hbox>
|
||||
<menulist>
|
||||
<menupopup type="select-account" id="" readonly="true"/>
|
||||
<menupopup type="select-account" id="res_modifier" readonly="true"/>
|
||||
</menulist>
|
||||
<date-time readonly="true" align="right"/>
|
||||
<date-time id="res_modified" readonly="true" align="right"/>
|
||||
</hbox>
|
||||
</row>
|
||||
<row class="dialogFooterToolbar">
|
||||
|
Loading…
Reference in New Issue
Block a user