[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [13668] property: update on responsibility matrix
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [13668] property: update on responsibility matrix |
Date: |
Wed, 15 Jul 2015 13:29:45 +0000 |
Revision: 13668
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=13668
Author: sigurdne
Date: 2015-07-15 13:29:43 +0000 (Wed, 15 Jul 2015)
Log Message:
-----------
property: update on responsibility matrix
Modified Paths:
--------------
trunk/property/inc/class.boevent.inc.php
trunk/property/inc/class.boresponsible.inc.php
trunk/property/inc/class.solocation.inc.php
trunk/property/inc/class.soresponsible.inc.php
trunk/property/inc/class.uievent.inc.php
trunk/property/inc/class.uilocation.inc.php
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.boevent.inc.php
===================================================================
--- trunk/property/inc/class.boevent.inc.php 2015-07-14 23:15:14 UTC (rev
13667)
+++ trunk/property/inc/class.boevent.inc.php 2015-07-15 13:29:43 UTC (rev
13668)
@@ -377,7 +377,7 @@
//$times['min']= '*'; // for testing the - every minute
- $account_id =
execMethod('property.soresponsible.get_responsible_user_id',
$data['responsible']);
+ $account_id =
execMethod('property.soresponsible.get_contact_user_id', $data['contact_id']);
$timer_data = array
(
@@ -387,7 +387,7 @@
'enabled' => !!
$data['enabled'],
// 'action' =>
$action['action'],
'action' =>
$this->event_functions[$data['action']]['action'],
- 'action_data' =>
array('responsible_id' => $data['responsible_id'])
+ 'action_data' => array('contact_id'
=> $data['contact_id'])
);
if($data['end_date'])
@@ -529,7 +529,6 @@
$values = $responsible->read_type(array('start' => 0,
'query' =>'', 'sort' => '',
'order' => '', 'location' => $location,
'allrows'=>true,
'filter' => ''));
-
$list = array(0 => lang('none'));
foreach($values as $entry)
{
@@ -563,15 +562,15 @@
$interlink = CreateObject('property.interlink');
$relation_link =
$interlink->get_relation_link(".{$location_arr[1]}", $id, 'view', true);
- $responsible_id =
isset($data['action_data']['responsible_id']) ?
$data['action_data']['responsible_id'] : 0;
- if(!$responsible_id)
+ $contact_id = isset($data['action_data']['contact_id'])
? $data['action_data']['contact_id'] : 0;
+ if(!$contact_id)
{
return false;
}
- $comms =
execMethod('addressbook.boaddressbook.get_comm_contact_data',$responsible_id);
+ $comms =
execMethod('addressbook.boaddressbook.get_comm_contact_data',$contact_id);
- $number = $comms[$responsible_id]['mobile (cell)
phone'];
+ $number = $comms[$contact_id]['mobile (cell) phone'];
$subject = lang('reminder');
$message = "<a href =\"{$relation_link}\">" .
lang('record').' #' .$id .'</a>'."\n";
@@ -595,17 +594,17 @@
$interlink = CreateObject('property.interlink');
$relation_link =
$interlink->get_relation_link(".{$location_arr[1]}", $id, 'view', true);
- $responsible_id =
isset($data['action_data']['responsible_id']) ?
$data['action_data']['responsible_id'] : 0;
- if(!$responsible_id)
+ $contact_id = isset($data['action_data']['contact_id'])
? $data['action_data']['contact_id'] : 0;
+ if(!$contact_id)
{
return false;
}
- $account_id =
$GLOBALS['phpgw']->accounts->search_person($responsible_id);
+ $account_id =
$GLOBALS['phpgw']->accounts->search_person($contact_id);
$socommon = CreateObject('property.socommon');
$prefs =
$socommon->create_preferences('property',$account_id);
- $comms =
execMethod('addressbook.boaddressbook.get_comm_contact_data',$responsible_id);
- $_address = isset($comms[$responsible_id]['work
email']) && $comms[$responsible_id]['work email'] ?
$comms[$responsible_id]['work email'] :$prefs['email'];
+ $comms =
execMethod('addressbook.boaddressbook.get_comm_contact_data',$contact_id);
+ $_address = isset($comms[$contact_id]['work
email']) && $comms[$contact_id]['work email'] ? $comms[$contact_id]['work
email'] :$prefs['email'];
$subject = lang('reminder');
$message = "<a href =\"{$relation_link}\">" .
lang('record').' #' .$id .'</a>'."\n";
Modified: trunk/property/inc/class.boresponsible.inc.php
===================================================================
--- trunk/property/inc/class.boresponsible.inc.php 2015-07-14 23:15:14 UTC
(rev 13667)
+++ trunk/property/inc/class.boresponsible.inc.php 2015-07-15 13:29:43 UTC
(rev 13668)
@@ -347,12 +347,12 @@
{
$to_edit[] = array
(
- 'id'
=> $responsible_item,
- 'active_from'
=> time(),
- 'contact_id'
=> $values['contact_id'],
- 'location_code'
=> $location_code,
-
'responsibility_id' => $values['responsibility_id'],
- 'remark'
=> 'from role assignment'
+ 'id'
=> $responsible_item,
+ 'active_from'
=> time(),
+ 'contact_id'
=> $values['contact_id'],
+ 'location_code'
=> $location_code,
+
'responsibility_role_id' => $values['responsibility_role_id'],
+ 'remark'
=> 'from role assignment'
);
}
}
@@ -370,7 +370,7 @@
$receipt['error'][] = array('msg'=>
lang('missing contact'));
}
- if(!$values['responsibility_id'])
+ if(!$values['responsibility_role_id'])
{
$receipt['error'][] = array('msg'=>
lang('Role is not related to responsibility'));
}
@@ -384,7 +384,7 @@
(
'location'
=> explode('-', $location_code),
'active_from' =>
time(),
- 'responsibility_id' =>
$values['responsibility_id'],
+ 'responsibility_role_id'
=> $values['responsibility_role_id'],
'contact_id' =>
$values['contact_id'],
'remark'
=> 'from role assignment'
);
Modified: trunk/property/inc/class.solocation.inc.php
===================================================================
--- trunk/property/inc/class.solocation.inc.php 2015-07-14 23:15:14 UTC (rev
13667)
+++ trunk/property/inc/class.solocation.inc.php 2015-07-15 13:29:43 UTC (rev
13668)
@@ -554,10 +554,8 @@
{
$joinmethod .= " {$this->join}
fm_responsibility_contact ON ( fm_location{$type_id}.location_code =
fm_responsibility_contact.location_code))";
$paranthesis .='(';
- $joinmethod .= " {$this->join}
fm_responsibility ON ( fm_responsibility_contact.responsibility_id =
fm_responsibility.id))";
+ $joinmethod .= " {$this->join}
fm_responsibility_role ON ( fm_responsibility_contact.id =
fm_responsibility_role.responsibility_role_id))";
$paranthesis .='(';
- $joinmethod .= " {$this->join}
fm_responsibility_role ON ( fm_responsibility.id =
fm_responsibility_role.responsibility_id))";
- $paranthesis .='(';
$cols.= ',fm_responsibility_role.id as
role_id';
$cols_return[] = 'role_id';
Modified: trunk/property/inc/class.soresponsible.inc.php
===================================================================
--- trunk/property/inc/class.soresponsible.inc.php 2015-07-14 23:15:14 UTC
(rev 13667)
+++ trunk/property/inc/class.soresponsible.inc.php 2015-07-15 13:29:43 UTC
(rev 13668)
@@ -86,29 +86,16 @@
if ($order)
{
- $ordermethod = " order by
fm_responsibility.$order $sort";
+ $ordermethod = " ORDER BY
fm_responsibility.$order $sort";
}
else
{
- $ordermethod = ' order by fm_responsibility.id
DESC';
+ $ordermethod = ' ORDER BY fm_responsibility.id
DESC';
}
$where= 'WHERE';
$filtermethod = '';
-/*
- if(is_array($filter) && $location)
- {
- $filtermethod .= " $where cat_id IN (" .
implode(',', $filter) . ')';
- $where = 'AND';
- }
-
- if($location)
- {
- $filtermethod .= " $where
fm_responsibility_module.location_id =" .
$GLOBALS['phpgw']->locations->get_id($this->appname, $location);
- $where = 'AND';
- }
- */
$querymethod = '';
if($query)
{
@@ -116,11 +103,7 @@
}
$sql = "SELECT fm_responsibility.* FROM
fm_responsibility"
-// . " {$this->join} fm_responsibility_module ON
fm_responsibility.id = fm_responsibility_module.responsibility_id"
-// . " {$this->join} phpgw_locations ON
fm_responsibility_module.location_id = phpgw_locations.location_id"
-// . " {$this->join} phpgw_applications ON
phpgw_locations.app_id = phpgw_applications.app_id"
. " {$filtermethod} {$querymethod}";
-// . " WHERE app_name = '{$appname}' $filtermethod
$querymethod";
$this->db->query($sql, __LINE__, __FILE__);
$this->total_records = $this->db->num_rows();
@@ -143,18 +126,13 @@
'id' =>
$this->db->f('id'),
'name' =>
$this->db->f('name', true),
'descr' =>
$this->db->f('descr', true),
- 'active' =>
$this->db->f('active'),
- 'location' =>
$this->db->f('location'),
- 'cat_id' =>
$this->db->f('cat_id'),
- 'created_by' =>
$this->db->f('created_by'),
- 'created_on' =>
$this->db->f('created_on'),
);
}
$cats = CreateObject('phpgwapi.categories', -1);
foreach($values as &$entry)
{
- $sql = "SELECT location_id, cat_id FROM
fm_responsibility_module WHERE responsibility_id = {$entry['id']}";
+ $sql = "SELECT * FROM fm_responsibility_module
WHERE responsibility_id = {$entry['id']}";
$this->db->query($sql, __LINE__, __FILE__);
$locations = array();
while ($this->db->next_record())
@@ -162,6 +140,10 @@
$location_id =
$this->db->f('location_id');
$cat_id = $this->db->f('cat_id');
$locations["{$location_id}_{$cat_id}"]
= true;
+ $entry['active'] =
$this->db->f('active');
+ $entry['created_by'] =
$this->db->f('created_by');
+ $entry['created_on'] =
$this->db->f('created_on');
+
}
$__location_info = array();
foreach($locations as $location => $dummy)
@@ -347,7 +329,6 @@
'id' =>
$this->db->f('id'),
'name' =>
$this->db->f('name', true),
'descr' =>
$this->db->f('descr', true),
- 'active' =>
$this->db->f('active'),
'cat_id' =>
$this->db->f('cat_id'),
'created_by' =>
$this->db->f('created_by'),
'created_on' =>
$this->db->f('created_on'),
@@ -366,7 +347,8 @@
public function read_single_role($id)
{
- $sql = 'SELECT * FROM fm_responsibility_role WHERE id=
' . (int) $id;
+ $id = (int) $id;
+ $sql = "SELECT * FROM fm_responsibility_role WHERE id=
{$id}";
$this->db->query($sql, __LINE__, __FILE__);
@@ -429,10 +411,10 @@
{
$receipt = array();
- $value_set['name']
=$this->db->db_addslashes($data['name']);
+ $value_set['name']
= $this->db->db_addslashes($data['name']);
$value_set['remark'] =
$this->db->db_addslashes($data['remark']);
$value_set['responsibility_id'] =
$data['responsibility_id'];
- $value_set['location_level']
= implode(',', $data['location_level']);
+ $value_set['location_level'] = implode(',',
$data['location_level']);
$value_set['modified_date'] =
time();
@@ -479,8 +461,6 @@
'id' =>
$this->db->f('id'),
'name' =>
$this->db->f('name', true),
'descr' =>
$this->db->f('descr', true),
- 'active' =>
$this->db->f('active'),
- 'cat_id' =>
$this->db->f('cat_id'),
'created_by' =>
$this->db->f('created_by'),
'created_on' =>
$this->db->f('created_on'),
);
@@ -514,10 +494,23 @@
function delete_type($id)
{
+ $id = (int)$id;
$this->db->transaction_begin();
- $this->db->query('DELETE FROM fm_responsibility_module
WHERE responsibility_id=' . (int) $id, __LINE__, __FILE__);
- $this->db->query('DELETE FROM fm_responsibility_contact
WHERE responsibility_id=' . (int) $id, __LINE__, __FILE__);
- $this->db->query('DELETE FROM fm_responsibility WHERE
id=' . (int) $id, __LINE__, __FILE__);
+
+ $this->db->query("SELECT id FROM fm_responsibility_role
WHERE responsibility_id = {$id}", __LINE__, __FILE__);
+
+ $responsibility_role_ids = array();
+ while ($this->db->next_record())
+ {
+ $responsibility_role_ids[] = $this->db->f('id');
+ }
+ if($responsibility_role_ids)
+ {
+ $this->db->query('DELETE FROM
fm_responsibility_contact WHERE responsibility_role_id IN(' . implode(',',
$responsibility_role_ids) . ')', __LINE__, __FILE__);
+ }
+ $this->db->query("DELETE FROM fm_responsibility_role
WHERE responsibility_id = {$id}", __LINE__, __FILE__);
+ $this->db->query("DELETE FROM fm_responsibility_module
WHERE responsibility_id = {$id}", __LINE__, __FILE__);
+ $this->db->query("DELETE FROM fm_responsibility WHERE
id = {$id}", __LINE__, __FILE__);
$this->db->transaction_commit();
}
@@ -540,31 +533,39 @@
$order = isset($data['order']) ?
$this->db->db_addslashes($data['order']) : '';
$allrows = isset($data['allrows']) ?
!!$data['allrows'] : '';
$type_id =
isset($data['type_id']) && $data['type_id'] ? (int) $data['type_id'] : 0;
+ $role_id =
isset($data['role_id']) && $data['role_id'] ? (int) $data['role_id'] : 0;
}
if ($order)
{
- $ordermethod = " order by $order $sort";
+ $ordermethod = "ORDER BY $order $sort";
}
else
{
- $ordermethod = ' order by responsibility_id
DESC';
+ $ordermethod = 'ORDER BY responsibility_role_id
DESC';
}
- $filtermethod = ' WHERE expired_on IS NULL';
+ $filtermethod = 'WHERE expired_on IS NULL';
$where = 'AND';
if($type_id > 0)
{
- $filtermethod .= " $where responsibility_id =
$type_id";
+ $filtermethod .= " {$where} responsibility_id =
{$type_id}";
}
+ if($role_id > 0)
+ {
+ $filtermethod .= " {$where}
responsibility_role_id = {$type_id}";
+ }
+
$querymethod = '';
if($query)
{
$querymethod = "$where (remark $this->like
'%$query%')";
}
- $sql = "SELECT * FROM fm_responsibility_contact
$filtermethod $querymethod";
+ $sql = "SELECT fm_responsibility_contact.* ,
fm_responsibility_role.responsibility_id FROM fm_responsibility_contact"
+ . " $this->join fm_responsibility_role ON
fm_responsibility_contact.responsibility_role_id = fm_responsibility_role.id"
+ . " $filtermethod $querymethod";
$this->db->query($sql, __LINE__, __FILE__);
$this->total_records = $this->db->num_rows();
@@ -584,22 +585,23 @@
{
$values[] = array
(
- 'id'
=> $this->db->f('id'),
- 'responsibility_id' =>
$this->db->f('responsibility_id'),
- 'contact_id' =>
$this->db->f('contact_id'),
- 'location_code' =>
$this->db->f('location_code'),
- 'priority'
=> $this->db->f('priority'),
- 'active_from' =>
$this->db->f('active_from'),
- 'active_to'
=> $this->db->f('active_to'),
- 'created_on' =>
$this->db->f('created_on'),
- 'created_by' =>
$this->db->f('created_by'),
- 'expired_on' =>
$this->db->f('expired_on'), // historical records
- 'expired_by' =>
$this->db->f('expired_by'),
- 'p_num'
=> $this->db->f('p_num', true),
- 'p_entity_id' =>
$this->db->f('p_entity_id'),
- 'p_cat_id'
=> $this->db->f('p_cat_id'),
- 'ecodimb'
=> $this->db->f('ecodimb'),
- 'remark'
=> $this->db->f('remark', true),
+ 'id'
=> $this->db->f('id'),
+ 'responsibility_id'
=> $this->db->f('responsibility_id'),
+ 'responsibility_role_id'
=> $this->db->f('responsibility_role_id'),
+ 'contact_id'
=> $this->db->f('contact_id'),
+ 'location_code'
=> $this->db->f('location_code'),
+ 'priority'
=> $this->db->f('priority'),
+ 'active_from'
=> $this->db->f('active_from'),
+ 'active_to'
=> $this->db->f('active_to'),
+ 'created_on'
=> $this->db->f('created_on'),
+ 'created_by'
=> $this->db->f('created_by'),
+ 'expired_on'
=> $this->db->f('expired_on'), // historical records
+ 'expired_by'
=> $this->db->f('expired_by'),
+ 'p_num'
=> $this->db->f('p_num', true),
+ 'p_entity_id'
=> $this->db->f('p_entity_id'),
+ 'p_cat_id'
=> $this->db->f('p_cat_id'),
+ 'ecodimb'
=> $this->db->f('ecodimb'),
+ 'remark'
=> $this->db->f('remark', true),
);
}
@@ -622,7 +624,7 @@
$insert_values = array
(
- (int) $values['responsibility_id'],
+ (int) $values['responsibility_role_id'],
(int) $values['contact_id'],
@implode('-', $values['location']),
(int) $values['active_from'],
@@ -640,7 +642,7 @@
$this->db->transaction_begin();
- $this->db->query("INSERT INTO fm_responsibility_contact
(responsibility_id, contact_id,"
+ $this->db->query("INSERT INTO fm_responsibility_contact
(responsibility_role_id, contact_id,"
." location_code, active_from, active_to,
p_num, p_entity_id, p_cat_id, ecodimb, remark, created_by, created_on)"
." VALUES ($insert_values)", __LINE__,
__FILE__);
@@ -727,9 +729,10 @@
public function read_single_contact($id)
{
- $sql = "SELECT fm_responsibility_contact.*,
fm_responsibility.name as responsibility_name"
+ $sql = "SELECT fm_responsibility_contact.*,
fm_responsibility.id as responsibility_id, fm_responsibility.name AS
responsibility_name, fm_responsibility_role.name AS role_name"
. " FROM fm_responsibility_contact"
- . " {$this->join} fm_responsibility ON
fm_responsibility_contact.responsibility_id = fm_responsibility.id"
+ . " {$this->join} fm_responsibility_role ON
fm_responsibility_contact.responsibility_role_id = fm_responsibility_role.id"
+ . " {$this->join} fm_responsibility ON
fm_responsibility_role.responsibility_id = fm_responsibility.id"
. ' WHERE fm_responsibility_contact.id=' .
(int) $id;
$this->db->query($sql, __LINE__, __FILE__);
@@ -739,23 +742,25 @@
$this->db->next_record();
$values = array
(
- 'id' =>
$this->db->f('id'),
- 'responsibility_id' =>
$this->db->f('responsibility_id'),
- 'responsibility_name'=>
$this->db->f('responsibility_name'),
- 'contact_id' =>
$this->db->f('contact_id'),
- 'location_code' =>
$this->db->f('location_code'),
- 'p_num' =>
$this->db->f('p_num'),
- 'p_entity_id' =>
$this->db->f('p_entity_id'),
- 'p_cat_id' =>
$this->db->f('p_cat_id'),
- 'remark' =>
$this->db->f('remark', true),
- 'active_from' =>
$this->db->f('active_from'),
- 'active_to' =>
$this->db->f('active_to'),
- 'created_by' =>
$this->db->f('created_by'),
- 'created_on' =>
$this->db->f('created_on'),
- 'expired_by' =>
$this->db->f('expired_by'),
- 'expired_on' =>
$this->db->f('expired_on'),
- 'priority' =>
$this->db->f('priority'), // FIXME - evaluate the need for this one
- 'ecodimb' =>
$this->db->f('ecodimb')
+ 'id'
=> $this->db->f('id'),
+ 'responsibility_id'
=> $this->db->f('responsibility_id'),
+ 'responsibility_role_id' =>
$this->db->f('responsibility_role_id'),
+ 'responsibility_name' =>
$this->db->f('responsibility_name'),
+ 'role_name'
=> $this->db->f('role_name'),
+ 'contact_id'
=> $this->db->f('contact_id'),
+ 'location_code'
=> $this->db->f('location_code'),
+ 'p_num'
=> $this->db->f('p_num'),
+ 'p_entity_id'
=> $this->db->f('p_entity_id'),
+ 'p_cat_id'
=> $this->db->f('p_cat_id'),
+ 'remark'
=> $this->db->f('remark', true),
+ 'active_from'
=> $this->db->f('active_from'),
+ 'active_to'
=> $this->db->f('active_to'),
+ 'created_by'
=> $this->db->f('created_by'),
+ 'created_on'
=> $this->db->f('created_on'),
+ 'expired_by'
=> $this->db->f('expired_by'),
+ 'expired_on'
=> $this->db->f('expired_on'),
+ 'priority'
=> $this->db->f('priority'), // FIXME - evaluate the need for this one
+ 'ecodimb'
=> $this->db->f('ecodimb')
);
return $values;
@@ -808,8 +813,7 @@
$time = time() +1;
$sql = "SELECT fm_responsibility_contact.id, contact_id
FROM fm_responsibility_contact"
- . " {$this->join} fm_responsibility ON
fm_responsibility_contact.responsibility_id = fm_responsibility.id"
- . " {$this->join} fm_responsibility_role ON
fm_responsibility.id = fm_responsibility_role.responsibility_id"
+ . " {$this->join} fm_responsibility_role ON
fm_responsibility_contact.responsibility_role_id = fm_responsibility_role.id"
. " WHERE fm_responsibility_role.id ={$role_id}"
. " AND fm_responsibility_contact.location_code
='{$location_code}'"
. " AND active_from < {$time} AND (active_to >
{$time} OR active_to = 0) AND expired_on IS NULL";
@@ -892,7 +896,8 @@
}
$sql = "SELECT contact_id FROM
fm_responsibility_contact"
- . " {$this->join} fm_responsibility ON
fm_responsibility_contact.responsibility_id = fm_responsibility.id"
+ . " {$this->join} fm_responsibility_role ON
fm_responsibility_contact.responsibility_role_id = fm_responsibility_role.id"
+ . " {$this->join} fm_responsibility ON
fm_responsibility_role.responsibility_id = fm_responsibility.id"
. " {$this->join} fm_responsibility_module ON
fm_responsibility.id = fm_responsibility_module.responsibility_id"
. ' WHERE cat_id =' . (int) $data['cat_id']
. ' AND active = 1 AND active_from < ' . time()
. ' AND (active_to > ' . time() . ' OR active_to = 0) AND expired_on IS NULL'
@@ -938,13 +943,12 @@
public function get_responsible_user_id($data = array())
{
- $responsibility_id = (int)$data['responsibility_id'];
+ $responsibility_role_id =
(int)$data['responsibility_role_id'];
$location_code = $data['location_code'];
$now = time();
$sql = "SELECT contact_id FROM
fm_responsibility_contact"
- . " {$this->join} fm_responsibility ON
fm_responsibility_contact.responsibility_id = fm_responsibility.id"
- . " WHERE fm_responsibility.id =
{$responsibility_id}"
+ . " WHERE responsibility_role_id =
{$responsibility_role_id}"
. " AND active_from < {$now}"
. " AND expired_on IS NULL"
. " AND location_code = '{$location_code}'";
Modified: trunk/property/inc/class.uievent.inc.php
===================================================================
--- trunk/property/inc/class.uievent.inc.php 2015-07-14 23:15:14 UTC (rev
13667)
+++ trunk/property/inc/class.uievent.inc.php 2015-07-15 13:29:43 UTC (rev
13668)
@@ -656,7 +656,7 @@
$item_id =
phpgw::get_var('item_id');//might be bigint
$id
= phpgw::get_var('id', 'int');
$values =
phpgw::get_var('values');
- $values['responsible_id'] =
phpgw::get_var('contact', 'int', 'POST');
+ $values['contact_id'] = phpgw::get_var('contact',
'int', 'POST');
//
$GLOBALS['phpgw_info']['apps']['manual']['section'] = 'general.edit.' . $type;
@@ -677,7 +677,7 @@
{
$receipt['error'][]=array('msg'=>lang('Please enter a description'));
}
- if(!isset($values['responsible_id']) ||
!$values['responsible_id'])
+ if(!isset($values['contact_id']) ||
!$values['contact_id'])
{
$receipt['error'][]=array('msg'=>lang('Please select a responsible'));
}
@@ -797,7 +797,7 @@
$msgbox_data = $this->bocommon->msgbox_data($receipt);
$contact_data=$this->bocommon->initiate_ui_contact_lookup(array(
- 'contact_id' =>
$values['responsible_id'],
+ 'contact_id' =>
$values['contact_id'],
'field' => 'contact',
'type' => 'form'));
@@ -825,9 +825,6 @@
'value_repeat_interval'
=> isset($values['repeat_interval']) ? $values['repeat_interval'] : 0,
'lang_repeat_interval_statustext'=>
lang('interval'),
- 'lang_responsible'
=> lang('responsible'),
- 'responsible'
=> $this->bo->get_responsible(isset($values['responsible']) ?
$values['responsible'] : ''),
-
'lang_action'
=> lang('action'),
'action'
=> $this->bo->get_action(isset($values['action']) ?
$values['action'] : ''),
Modified: trunk/property/inc/class.uilocation.inc.php
===================================================================
--- trunk/property/inc/class.uilocation.inc.php 2015-07-14 23:15:14 UTC (rev
13667)
+++ trunk/property/inc/class.uilocation.inc.php 2015-07-15 13:29:43 UTC (rev
13668)
@@ -1116,8 +1116,8 @@
$values_assign = $_POST['values_assign'];
$role_id = phpgw::get_var('role_id', 'int');
$receipt = array();
- $_role = CreateObject('property.sogeneric');
- $_role->get_location_info('responsibility_role','');
+ // $_role = CreateObject('property.sogeneric');
+ // $_role->get_location_info('responsibility_role','');
$this->save_sessiondata();
@@ -1135,9 +1135,10 @@
}
else
{
- $role =
$_role->read_single($data=array('id' => $role_id));
+ // $role =
$_role->read_single($data=array('id' => $role_id));
$values['contact_id']
= $contact_id;
- $values['responsibility_id'] =
$role['responsibility_id'];
+ // $values['responsibility_id'] =
$role['responsibility_id'];
+ $values['responsibility_role_id']
= $role_id;
$values['assign']
= $values_assign['assign'];
$values['assign_orig']
= $values_assign['assign_orig'];
$boresponsible =
CreateObject('property.boresponsible');
Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php 2015-07-14 23:15:14 UTC (rev 13667)
+++ trunk/property/setup/setup.inc.php 2015-07-15 13:29:43 UTC (rev 13668)
@@ -12,7 +12,7 @@
*/
$setup_info['property']['name'] = 'property';
- $setup_info['property']['version'] = '0.9.17.691';
+ $setup_info['property']['version'] = '0.9.17.692';
$setup_info['property']['app_order'] = 8;
$setup_info['property']['enable'] = 1;
$setup_info['property']['app_group'] = 'office';
Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2015-07-14 23:15:14 UTC (rev
13667)
+++ trunk/property/setup/tables_current.inc.php 2015-07-15 13:29:43 UTC (rev
13668)
@@ -2525,7 +2525,7 @@
'fm_responsibility_contact' => array(
'fd' => array(
'id' => array('type' => 'auto','precision' =>
'4','nullable' => False),
- 'responsibility_id' => array('type' => 'int',
'precision' => 4,'nullable' => False),
+ 'responsibility_role_id' => array('type' =>
'int', 'precision' => 4,'nullable' => False),
'contact_id' => array('type' => 'int',
'precision' => 4,'nullable' => True),
'location_code' => array('type' => 'varchar',
'precision' => 20,'nullable' => True),
'p_num' => array('type' => 'varchar',
'precision' => 15,'nullable' => True),
@@ -2543,7 +2543,7 @@
),
'pk' => array('id'),
'fk' => array(
- 'fm_responsibility' =>
array('responsibility_id' => 'id'),
+ 'fm_responsibility_role' =>
array('responsibility_role_id' => 'id'),
'phpgw_contact' => array('contact_id' =>
'contact_id')
),
'ix' => array('location_code'),
Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php 2015-07-14 23:15:14 UTC (rev
13667)
+++ trunk/property/setup/tables_update.inc.php 2015-07-15 13:29:43 UTC (rev
13668)
@@ -8531,4 +8531,35 @@
$GLOBALS['setup_info']['property']['currentver'] =
'0.9.17.691';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
+
+ /**
+ * Update property version from 0.9.17.691 to 0.9.17.692
+ * Alter field name.
+ */
+ $test[] = '0.9.17.691';
+ function property_upgrade0_9_17_691()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+ $MetaForeignKeys =
$GLOBALS['phpgw_setup']->oProc->m_odb->MetaForeignKeys('fm_responsibility_contact');
+
+ if(isset($MetaForeignKeys['fm_responsibility']) &&
$MetaForeignKeys['fm_responsibility'])
+ {
+ $GLOBALS['phpgw_setup']->oProc->query("ALTER TABLE
fm_responsibility_contact DROP CONSTRAINT
fm_responsibility_contact_responsibility_id_fkey");
+ }
+
+
$GLOBALS['phpgw_setup']->oProc->RenameColumn('fm_responsibility_contact','responsibility_id','responsibility_role_id');
+
+ $GLOBALS['phpgw_setup']->oProc->query("ALTER TABLE
fm_responsibility_contact"
+ . " ADD CONSTRAINT
fm_responsibility_contact_responsibility_role_id_fkey"
+ . " FOREIGN KEY (responsibility_role_id)"
+ . " REFERENCES fm_responsibility_role (id) MATCH SIMPLE"
+ . " ON UPDATE NO ACTION ON DELETE NO ACTION"
+ );
+
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['property']['currentver'] =
'0.9.17.692';
+ return $GLOBALS['setup_info']['property']['currentver'];
+ }
}
\ No newline at end of file
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [13668] property: update on responsibility matrix,
Sigurd Nes <=