[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [6562] Property: Responsibility roles
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [6562] Property: Responsibility roles |
Date: |
Tue, 09 Nov 2010 20:41:48 +0000 |
Revision: 6562
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6562
Author: sigurdne
Date: 2010-11-09 20:41:48 +0000 (Tue, 09 Nov 2010)
Log Message:
-----------
Property: Responsibility roles
Modified Paths:
--------------
trunk/property/inc/class.bolocation.inc.php
trunk/property/inc/class.boresponsible.inc.php
trunk/property/inc/class.menu.inc.php
trunk/property/inc/class.solocation.inc.php
trunk/property/inc/class.uilocation.inc.php
trunk/property/js/yahoo/location.responsiblility_role.js
trunk/property/js/yahoo/property.js
trunk/property/setup/phpgw_no.lang
Modified: trunk/property/inc/class.bolocation.inc.php
===================================================================
--- trunk/property/inc/class.bolocation.inc.php 2010-11-09 14:28:32 UTC (rev
6561)
+++ trunk/property/inc/class.bolocation.inc.php 2010-11-09 20:41:48 UTC (rev
6562)
@@ -109,10 +109,10 @@
$location_code =
phpgw::get_var('location_code');
$this->start = $start ? $start : 0;
- $this->query = isset($query) ?
$query : $this->query;
+ $this->query = isset($query) &&
$query ? $query : '';
$this->filter = isset($filter) &&
$filter ? $filter : '';
- $this->sort = isset($sort)
&& $sort ? $sort : '';
- $this->order = isset($order) &&
$order ? $order : '';
+ $this->sort = isset($sort)
&& $sort ? $sort : $this->sort;
+ $this->order = isset($order) &&
$order ? $order : $this->order;
$this->cat_id = isset($cat_id) &&
$cat_id ? $cat_id : '';
$this->part_of_town_id = isset($part_of_town_id) &&
$part_of_town_id ? $part_of_town_id : '';
$this->district_id = isset($district_id)
&& $district_id ? $district_id : '';
@@ -140,7 +140,7 @@
$self = parse_url(phpgw::get_var('QUERY_STRING',
'string', 'SERVER') );
parse_str($self['path'],$self_out);
- if(isset($referer_out['menuaction']) &&
isset($self_out['menuaction']) && $referer_out['menuaction'] ==
$self_out['menuaction'])
+// if(isset($referer_out['menuaction']) &&
isset($self_out['menuaction']) && $referer_out['menuaction'] ==
$self_out['menuaction'])
{
$data =
$GLOBALS['phpgw']->session->appsession('session_data','location');
}
Modified: trunk/property/inc/class.boresponsible.inc.php
===================================================================
--- trunk/property/inc/class.boresponsible.inc.php 2010-11-09 14:28:32 UTC
(rev 6561)
+++ trunk/property/inc/class.boresponsible.inc.php 2010-11-09 20:41:48 UTC
(rev 6562)
@@ -289,6 +289,7 @@
public function update_role_assignment($values)
{
+ $receipt =array();
if(!isset($values['assign']))
{
$values['assign'] = array();
@@ -335,6 +336,15 @@
if(!$values['contact_id'])
{
$receipt['error'][] = array('msg'=>
lang('missing contact'));
+ }
+
+ if(!$values['responsibility_id'])
+ {
+ $receipt['error'][] = array('msg'=>
lang('Role is not related to responsibility'));
+ }
+
+ if( isset($receipt['error']) )
+ {
return $receipt;
}
@@ -347,7 +357,6 @@
'remark' =>
'from role assignment'
);
-//_debug_array($data);
$this->so->add_contact($data);
}
Modified: trunk/property/inc/class.menu.inc.php
===================================================================
--- trunk/property/inc/class.menu.inc.php 2010-11-09 14:28:32 UTC (rev
6561)
+++ trunk/property/inc/class.menu.inc.php 2010-11-09 20:41:48 UTC (rev
6562)
@@ -555,11 +555,11 @@
'text' => lang('Summary'),
'image' => array('property',
'location_summary')
);
- $children['responsiblility_role'] = array
+ $children['responsibility_role'] = array
(
'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uilocation.responsiblility_role')),
- 'text' => lang('responsiblility
role'),
- 'image' => array('property',
'responsiblility_role')
+ 'text' => lang('responsibility
role'),
+ 'image' => array('property',
'responsibility_role')
);
/* if ( $acl->check('.location', 16, 'property') )
Modified: trunk/property/inc/class.solocation.inc.php
===================================================================
--- trunk/property/inc/class.solocation.inc.php 2010-11-09 14:28:32 UTC (rev
6561)
+++ trunk/property/inc/class.solocation.inc.php 2010-11-09 20:41:48 UTC (rev
6562)
@@ -265,15 +265,28 @@
$location_code =
isset($data['location_code']) ? $data['location_code'] : '';
}
+ if (!$type_id)
+ {
+ return;
+ }
+
if($order == 'undefined')
{
$order = '';
}
- if (!$type_id)
+
+ switch ($order)
{
- return;
+ case 'undefined':
+ $order = '';
+ break;
+ case 'loc1':
+ $order = 'fm_location1.loc1';
+ break;
+ default:
}
+
$sql = $this->socommon->fm_cache('sql_'. $type_id . '_'
. $lookup_tenant . '_' . $lookup);
$location_id =
$GLOBALS['phpgw']->locations->get_id('property', ".location.{$type_id}");
Modified: trunk/property/inc/class.uilocation.inc.php
===================================================================
--- trunk/property/inc/class.uilocation.inc.php 2010-11-09 14:28:32 UTC (rev
6561)
+++ trunk/property/inc/class.uilocation.inc.php 2010-11-09 20:41:48 UTC (rev
6562)
@@ -867,6 +867,7 @@
+
}
$datatable['pagination']['records_total'] =
$this->bo->total_records;
@@ -1023,7 +1024,7 @@
$type_id = 1;
}
- $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::responsiblility_role';
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::responsibility_role';
if (!$this->acl_read)
{
@@ -1037,14 +1038,16 @@
$_role = CreateObject('property.socategory');
$_role->get_location_info('responsibility_role','');
+ $this->save_sessiondata();
+
if($values && $this->acl_edit)
{
- $user_id = phpgw::get_var('user_id', 'int');
+ $user_id = phpgw::get_var('user_id', 'int',
'request', $this->account);
$account =
$GLOBALS['phpgw']->accounts->get($user_id);
$contact_id = $account->person_id;
if(!$role_id)
{
- $receipt['error'][] = array('msg'=>
lang('missing role'));
+ $receipt['error'][] = array('msg'=>
lang('missing role'));
}
else
{
@@ -1084,10 +1087,7 @@
'lookup_name' => $lookup_name,
'cat_id' =>
$this->cat_id,
'status' =>
$this->status,
- 'location_code' =>
$this->location_code,
- // 'sort'
=> $this->sort,
- // 'order'
=> $this->order
-
+ 'location_code' =>
$this->location_code
));
$datatable['config']['allow_allrows'] = true;
@@ -1103,13 +1103,11 @@
."cat_id:'{$this->cat_id}',"
."status:'{$this->status}',"
."location_code:'{$this->location_code}',"
- //
."sort:'{$this->sort}',"
- //
."order:'{$this->order}',"
-
."block_query:'{$block_query}'";
+
."block_query:'{$block_query}'";
- //$values_combo_box[0] =
execMethod('property.soadmin_location.read',array());
- $values_combo_box[0] =
array(array('id'=>'1','name'=> 'Eiendom'));
+ $values_combo_box[0] =
execMethod('property.soadmin_location.read',array());
+ //$values_combo_box[0] =
array(array('id'=>'1','name'=> 'Eiendom'));
$values_combo_box[1] =
$this->bocommon->select_category_list(array('format'=>'filter',
'selected' => $this->cat_id,
@@ -1130,7 +1128,7 @@
array_unshift
($values_combo_box[3],$default_value);
$values_combo_box[4] =
$this->bocommon->get_user_list_right2('filter',PHPGW_ACL_EDIT,$this->user_id,'.location');
- array_unshift
($values_combo_box[4],array('id'=>$GLOBALS['phpgw_info']['user']['account_id'],'name'=>lang('mine
roles')));
+// array_unshift
($values_combo_box[4],array('id'=>$GLOBALS['phpgw_info']['user']['account_id'],'name'=>lang('mine
roles')));
$default_value =
array('id'=>'','name'=>lang('no user'));
array_unshift
($values_combo_box[4],$default_value);
@@ -1256,6 +1254,12 @@
'size' => 28,
'onkeypress' => 'return pulsar(event)',
'tab_index' => 7
+
),
+
array
+
( //place holder for selected events
+
'type' => 'hidden',
+
'id' => 'event',
+
'value' => ''
)
),
'hidden_value' => array(
@@ -1350,180 +1354,6 @@
}
// NO pop-up
$datatable['rowactions']['action'] = array();
- if(!$lookup)
- {
- $parameters = array
- (
- 'parameter' => array
- (
- array
- (
- 'name' =>
'location_code',
- 'source' =>
'location_code'
- ),
- )
- );
-
- $parameters2 = array
- (
- 'parameter' => array
- (
- array
- (
- 'name' =>
'sibling',
- 'source' =>
'location_code'
- ),
- )
- );
-
- $parameters3 = array
- (
- 'parameter' => array
- (
- array
- (
- 'name' =>
'search_for',
- 'source' =>
'location_code'
- ),
- )
- );
-
- if($this->acl->check('run', PHPGW_ACL_READ,
'rental'))
- {
- $datatable['rowactions']['action'][] =
array(
- 'my_name'
=> 'view',
- 'text'
=> lang('contracts'),
- 'action'
=> $GLOBALS['phpgw']->link('/index.php',array
-
(
-
'menuaction' => 'rental.uicontract.index',
-
'search_type' => 'location_id',
-
'contract_status' => 'all',
-
'populate_form' => 'yes'
-
)),
- 'parameters' => $parameters3
- );
- }
-
- if($this->acl_read)
- {
- $datatable['rowactions']['action'][] =
array(
- 'my_name' =>
'view',
- 'text' =>
lang('view'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php',array
-
(
-
'menuaction' => 'property.uilocation.view',
-
'lookup_tenant' => $lookup_tenant
-
)),
- 'parameters' => $parameters
- );
- $datatable['rowactions']['action'][] =
array(
- 'my_name' =>
'view',
- 'text' =>
lang('open view in new window'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php',array
-
(
-
'menuaction' => 'property.uilocation.view',
-
'lookup_tenant' => $lookup_tenant,
-
'target' => '_blank'
-
)),
- 'parameters' => $parameters
- );
- }
- if($this->acl_add)
- {
- $datatable['rowactions']['action'][] =
array(
- 'my_name'
=> 'edit',
- 'text' =>
lang('add'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php',array
-
(
-
'menuaction' => 'property.uilocation.edit',
-
'lookup_tenant' => $lookup_tenant
-
)),
- 'parameters' => $parameters2
- );
- }
- if($this->acl_edit)
- {
- $datatable['rowactions']['action'][] =
array(
- 'my_name'
=> 'edit',
- 'text' =>
lang('edit'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php',array
-
(
-
'menuaction' => 'property.uilocation.edit',
-
'lookup_tenant' => $lookup_tenant
-
)),
- 'parameters' => $parameters
- );
- $datatable['rowactions']['action'][] =
array(
- 'my_name'
=> 'edit',
- 'text' =>
lang('open edit in new window'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php',array
-
(
-
'menuaction' => 'property.uilocation.edit',
-
'lookup_tenant' => $lookup_tenant,
-
'target' => '_blank'
-
)),
- 'parameters' => $parameters
- );
-
- }
- $jasper = execMethod('property.sojasper.read',
array('location_id' => $GLOBALS['phpgw']->locations->get_id('property',
$this->acl_location)));
-
- foreach ($jasper as $report)
- {
- $datatable['rowactions']['action'][] =
array(
- 'my_name'
=> 'edit',
- 'text'
=> lang('open JasperReport %1 in new window', $report['title']),
- 'action'
=> $GLOBALS['phpgw']->link('/index.php',array
-
(
-
'menuaction' =>
'property.uijasper.view',
-
'jasper_id'
=> $report['id'],
-
'target'
=> '_blank'
-
)),
- 'parameters'
=> $parameters
- );
- }
-
-
- if($integrationurl)
- {
- $datatable['rowactions']['action'][] =
array(
- 'my_name'
=> 'integration',
- 'text'
=> $integration_name,
- 'action'
=> $integrationurl.'&target=_blank',
- 'parameters' =>
$parameters_integration
- );
- }
-
- if($this->acl_delete)
- {
- $datatable['rowactions']['action'][] =
array(
- 'my_name' =>
'delete',
- 'text' =>
lang('delete'),
- 'confirm_msg' => lang('do you
really want to delete this entry'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php',array
-
(
-
'menuaction' => 'property.uilocation.delete',
-
'lookup_tenant' => $lookup_tenant
-
)),
- 'parameters' => $parameters
- );
- }
- if($this->acl_add)
- {
- $datatable['rowactions']['action'][] =
array(
- 'my_name'
=> 'add',
- 'text'
=> lang('add'),
- 'action'
=> $GLOBALS['phpgw']->link('/index.php',array
-
(
-
'menuaction' => 'property.uilocation.edit',
-
'type_id' => $type_id,
-
'parent' => $this->location_code
-
))
- );
- }
-
- unset($parameters);
- }
//$uicols_count indicates the number of columns to
display in actuall option-menu. this variable was set in $this->bo->read()
$uicols_count = count($uicols['descr']);
@@ -1543,7 +1373,7 @@
if($uicols['name'][$i]=='loc1'):
{
$datatable['headers']['header'][$i]['sortable'] = true;
-
$datatable['headers']['header'][$i]['sort_field'] = 'fm_location1.loc1';
+
$datatable['headers']['header'][$i]['sort_field'] = 'loc1';
}
elseif($uicols['name'][$i]=='street_name'):
{
@@ -1649,22 +1479,6 @@
$json['hidden']['dependent'][] = array ( 'id'
=> $this->part_of_town_id,
'value' =>
$this->bocommon->select2String($opt_cb_depend)
);
-
- $_role_criteria = array
- (
- 'type' => 'responsibility_role',
- 'filter' => array('location' =>
".location.{$type_id}"),
- 'order' => 'name'
- );
-
- $_roles =
execMethod('property.socategory.get_list',$_role_criteria);
- $default_value = array
('id'=>'','name'=>lang('no role'));
- array_unshift ($_roles,$default_value);
-
- $json['hidden']['dependent'][] = array ( 'id'
=> $type_id,
- 'value' =>
$this->bocommon->select2String($_roles)
-
);
-
// right in datatable
if(isset($datatable['rowactions']['action']) &&
is_array($datatable['rowactions']['action']))
{
@@ -1721,8 +1535,6 @@
// Prepare YUI Library
$GLOBALS['phpgw']->js->validate_file( 'yahoo',
'location.responsiblility_role', 'property' );
- //$this->save_sessiondata();
-
}
Modified: trunk/property/js/yahoo/location.responsiblility_role.js
===================================================================
--- trunk/property/js/yahoo/location.responsiblility_role.js 2010-11-09
14:28:32 UTC (rev 6561)
+++ trunk/property/js/yahoo/location.responsiblility_role.js 2010-11-09
20:41:48 UTC (rev 6562)
@@ -4,9 +4,9 @@
//define SelectButton
var oMenuButton_0, oMenuButton_1, oMenuButton_2, oMenuButton_3,
oMenuButton_4, oMenuButton_5;
var selectsButtons = [
- {order:0, var_URL:'type_id', name:'btn_type_id',
style:'typebutton', dependiente:[3,5]},
+ {order:0, var_URL:'type_id', name:'btn_type_id',
style:'typebutton', dependiente:[], reload:1},
{order:1, var_URL:'cat_id', name:'btn_cat_id',
style:'categorybutton', dependiente:[]},
- {order:2, var_URL:'district_id', name:'btn_district_id',
style:'districtbutton', dependiente:[3,5]},
+ {order:2, var_URL:'district_id', name:'btn_district_id',
style:'districtbutton', dependiente:[3]},
{order:3,
var_URL:'part_of_town_id',name:'btn_part_of_town_id',style:'partOFTownbutton',dependiente:[]},
{order:4, var_URL:'user_id', name:'btn_user_id',
style:'userIdbutton', dependiente:[]},
{order:5, var_URL:'role_id', name:'btn_role_id',
style:'roleIdbutton', dependiente:[]}
@@ -103,30 +103,23 @@
tableYUI =
YAHOO.util.Dom.getElementsByClassName("yui-dt-data","tbody")[0].parentNode;
tableYUI.setAttribute("id","tableYUI");
- //category
- index =
locate_in_array_options(0,"value",path_values.location_id);
+ //type
+ index =
locate_in_array_options(0,"value",path_values.type_id);
if(index)
{
oMenuButton_0.set("label", ("<em>" +
array_options[0][index][1] + "</em>"));
}
-
- //user
- index =
locate_in_array_options(1,"value",path_values.user_id);
+ //category
+ index =
locate_in_array_options(1,"value",path_values.cat_id);
if(index)
{
oMenuButton_1.set("label", ("<em>" +
array_options[1][index][1] + "</em>"));
}
-/*
+
//district
- index =
locate_in_array_options(1,"value",path_values.district_id);
+ index =
locate_in_array_options(2,"value",path_values.district_id);
if(index)
{
- oMenuButton_1.set("label", ("<em>" +
array_options[1][index][1] + "</em>"));
- }
- //status
- index =
locate_in_array_options(2,"value",path_values.status_id);
- if(index)
- {
oMenuButton_2.set("label", ("<em>" +
array_options[2][index][1] + "</em>"));
}
//user
@@ -135,35 +128,12 @@
{
oMenuButton_3.set("label", ("<em>" +
array_options[3][index][1] + "</em>"));
}
-*/
+
// oMenuButton_0.focus();
YAHOO.util.Dom.get(textImput[0].id).focus();
}
else if(flag_particular_setting=='update')
{
-/*
- myColumnDefs = [];
- for(var k=0 ; k<values_ds.headers.name.length; k++)
- {
- if (values_ds.headers.input_type[k] == 'hidden')
- {
- var obj_temp = {key: values_ds.headers.name[k],
label: values_ds.headers.descr[k], visible: false, resizeable:true,
sortable: false, source: ""};
- }
- else
- {
- if (values_ds.headers.name[k] == 'num')
- {
- var obj_temp = {key:
values_ds.headers.name[k], label: values_ds.headers.descr[k], visible: true,
resizeable:true, sortable: true, source: "num"};
- }
- else
- {
- var obj_temp = {key:
values_ds.headers.name[k], label: values_ds.headers.descr[k], visible: true,
resizeable:true, sortable: false, source: ""};
- }
- }
- myColumnDefs.push(obj_temp);
- }
- init_datatable();
-*/
}
}
Modified: trunk/property/js/yahoo/property.js
===================================================================
--- trunk/property/js/yahoo/property.js 2010-11-09 14:28:32 UTC (rev 6561)
+++ trunk/property/js/yahoo/property.js 2010-11-09 20:41:48 UTC (rev 6562)
@@ -405,7 +405,11 @@
control.set("label", ("<em>" + p_oItem[1] + "</em>"));
control.set("value", p_oItem[0]);
eval("path_values."+selectsButtons[p_oItem[2]].var_URL+"='"+p_oItem[0]+"'")
-
+ if(selectsButtons[p_oItem[2]].reload)
+ {
+ ds = phpGWLink('index.php',path_values);
+ window.open(ds,'_self');
+ }
// tiene dependiente asociado?
if(selectsButtons[p_oItem[2]].dependiente.length)
{
Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang 2010-11-09 14:28:32 UTC (rev 6561)
+++ trunk/property/setup/phpgw_no.lang 2010-11-09 20:41:48 UTC (rev 6562)
@@ -1059,6 +1059,7 @@
none consequences property no Ingen konsekvenser
no part of town property no Bydel ikke valgt
no revision property no Ingen revisjon
+no role property no Rolle ikke valgt
no status property no Status ikke valgt
no supervisor property no Attestant ikke valgt
note property no Notat
@@ -1278,6 +1279,7 @@
residential environment property no Bo-miljø
responsible property no Ansvarlig
responsible matrix property no Ansvarsmatrise
+responsibility role property no Rolle for Ansvarsmatrise
result property no Resultat
return back to the list property no Returner til oversikt
revision property no Revisjon
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [6562] Property: Responsibility roles,
Sigurd Nes <=