[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] property/inc class.soproject.inc.php, 1.14 class.bopr
From: |
sigurdne |
Subject: |
[Phpgroupware-cvs] property/inc class.soproject.inc.php, 1.14 class.boproject.inc.php, 1.7 class.uitts.inc.php, 1.10 class.uiproject.inc.php, 1.12 class.uirequest.inc.php, 1.8 |
Date: |
Fri, 25 Feb 2005 14:19:00 +0100 |
Update of property/inc
Modified Files:
Branch: MAIN
class.soproject.inc.php lines: +45 -1
class.boproject.inc.php lines: +7 -1
class.uitts.inc.php lines: +7 -4
class.uiproject.inc.php lines: +96 -29
class.uirequest.inc.php lines: +2 -3
Log Message:
no message
====================================================
Index: property/inc/class.soproject.inc.php
diff -u property/inc/class.soproject.inc.php:1.13
property/inc/class.soproject.inc.php:1.14
--- property/inc/class.soproject.inc.php:1.13 Thu Feb 24 10:13:27 2005
+++ property/inc/class.soproject.inc.php Fri Feb 25 13:19:54 2005
@@ -356,6 +356,27 @@
}
}
+ $sql = "SELECT * FROM fm_project_origin WHERE
project_id='$project_id' ORDER by origin DESC ";
+
+ $this->db->query($sql,__LINE__,__FILE__);
+
+ $i=-1;
+ while ($this->db->next_record())
+ {
+ if($last_type != $this->db->f('origin'))
+ {
+ $i++;
+ }
+ $project['origin'][$i]['type'] =
$this->db->f('origin');
+ $project['origin'][$i]['link'] =
$this->get_origin_link($this->db->f('origin'));
+ $project['origin'][$i]['data'][]= array(
+ 'id'=> $this->db->f('origin_id'),
+ 'type'=> $this->db->f('origin')
+ );
+
+ $last_type=$this->db->f('origin');
+ }
+
$sql = "SELECT * FROM fm_project_origin WHERE
project_id='$project_id' and origin ='request'";
$this->db->query($sql,__LINE__,__FILE__);
@@ -383,6 +404,29 @@
}
+ function get_origin_link($type)
+ {
+ if($type=='tts'):
+ {
+ $link = '.uitts.view';
+ }
+ elseif($type=='request'):
+ {
+ $link = '.uirequest.view';
+ }
+ elseif(substr($type,0,6)=='entity'):
+ {
+
+ $type = explode("_",$type);
+ $entity_id = $type[1];
+ $cat_id = $type[2];
+ $link =
".uientity.view&entity_id=$entity_id&cat_id=$cat_id";
+ }
+ endif;
+
+ return $link;
+ }
+
function get_ticket($project_id = '')
{
$sql = "SELECT * FROM fm_project_origin WHERE
project_id='$project_id' and origin ='tts'";
====================================================
Index: property/inc/class.boproject.inc.php
diff -u property/inc/class.boproject.inc.php:1.6
property/inc/class.boproject.inc.php:1.7
--- property/inc/class.boproject.inc.php:1.6 Thu Jan 13 16:52:48 2005
+++ property/inc/class.boproject.inc.php Fri Feb 25 13:19:54 2005
@@ -572,5 +572,11 @@
{
$this->so->delete($project_id);
}
+
+ function get_origin_link($origin)
+ {
+ return $this->so->get_origin_link($origin);
+ }
+
}
?>
====================================================
Index: property/inc/class.uitts.inc.php
diff -u property/inc/class.uitts.inc.php:1.9
property/inc/class.uitts.inc.php:1.10
--- property/inc/class.uitts.inc.php:1.9 Wed Feb 9 14:17:25 2005
+++ property/inc/class.uitts.inc.php Fri Feb 25 13:19:54 2005
@@ -761,7 +761,8 @@
'p_entity_id' =>
$ticket['p_entity_id'],
'p_cat_id' =>
$ticket['p_cat_id'],
'tenant_id' =>
$ticket['tenant_id'],
- 'ticket_id' => $id
+ 'origin' => 'tts',
+ 'origin_id' => $id
);
$order_link_data = array
@@ -773,7 +774,8 @@
'p_entity_id' =>
$ticket['p_entity_id'],
'p_cat_id' =>
$ticket['p_cat_id'],
'tenant_id' =>
$ticket['tenant_id'],
- 'ticket_id' => $id
+ 'origin' => 'tts',
+ 'origin_id' => $id
);
$form_link = array
@@ -862,7 +864,8 @@
'p_entity_id' =>
$ticket['p_entity_id'],
'p_cat_id'
=> $ticket['p_cat_id'],
'tenant_id'
=> $ticket['tenant_id'],
- 'ticket_id'
=> $id
+ 'origin'
=> 'tts',
+ 'origin_id'
=> $id
));
$link_entity[$i]['name'] =
$entry['name'];
$i++;
====================================================
Index: property/inc/class.uiproject.inc.php
diff -u property/inc/class.uiproject.inc.php:1.11
property/inc/class.uiproject.inc.php:1.12
--- property/inc/class.uiproject.inc.php:1.11 Thu Jan 13 16:52:48 2005
+++ property/inc/class.uiproject.inc.php Fri Feb 25 13:19:54 2005
@@ -527,7 +527,6 @@
$id =
get_var('id',array('POST','GET'));
$values =
get_var('values',array('POST'));
$add_request =
get_var('add_request',array('POST'));
- $add_request =
get_var('add_request',array('POST'));
$config =
CreateObject('phpgwapi.config');
$bolocation =
CreateObject($this->currentapp.'.bolocation');
@@ -577,7 +576,6 @@
$location_code =
get_var('location_code',array('POST','GET'));
$tenant_id =
get_var('tenant_id',array('POST','GET'));
$values['descr'] =
get_var('descr',array('POST','GET'));
- $ticket_id =
get_var('ticket_id',array('POST','GET'));
$request_id =
get_var('request_id',array('POST','GET'));
$p_entity_id =
get_var('p_entity_id',array('POST','GET'));
$p_cat_id =
get_var('p_cat_id',array('POST','GET'));
@@ -585,25 +583,19 @@
$values['p'][$p_entity_id]['p_cat_id']
= $p_cat_id;
$values['p'][$p_entity_id]['p_num']
= get_var('p_num',array('POST','GET'));
+ $origin =
get_var('origin',array('POST','GET'));
+ $origin_id =
get_var('origin_id',array('POST','GET'));
+
if($p_entity_id && $p_cat_id)
{
- $boadmin_entity =
CreateObject($this->currentapp.'.boadmin_entity');
- $entity_category =
$boadmin_entity->read_single_category($p_entity_id,$p_cat_id);
-
$values['p'][$p_entity_id]['p_cat_name'] = $entity_category['name'];
- }
- if($ticket_id)
- {
- $values['ticket_id'][0]['id']=
$ticket_id;
- $values['origin']= 'tts';
- $values['origin_id']= $ticket_id;
- }
+ if(!is_object($boadmin_entity))
+ {
+ $boadmin_entity =
CreateObject($this->currentapp.'.boadmin_entity');
+ }
- if($request_id)
- {
- $values['request_id'][0]['id']=
$request_id;
- $values['origin']= 'request';
- $values['origin_id']= $request_id;
+ $entity_category =
$boadmin_entity->read_single_category($p_entity_id,$p_cat_id);
+
$values['p'][$p_entity_id]['p_cat_name'] = $entity_category['name'];
}
if($location_code)
@@ -613,10 +605,27 @@
}
+ if($values['origin'])
+ {
+ $origin = $values['origin'];
+ $origin_id = $values['origin_id'];
+ }
+
+ if($origin)
+ {
+ unset($values['origin']);
+ unset($values['origin_id']);
+ $values['origin'][0]['type']= $origin;
+
$values['origin'][0]['link']=$this->bo->get_origin_link($origin);
+ $values['origin'][0]['data'][]= array(
+ 'id'=> $origin_id,
+ 'type'=> $origin
+ );
+ }
+
$values['start_date'] =
get_var('start_date',array('POST'));
$values['end_date'] =
get_var('end_date',array('POST'));
-//_debug_array($values);
$config->read_repository();
if ($values['save'])
@@ -869,7 +878,7 @@
$link_request_data = array
(
'menuaction' =>
$this->currentapp.'.uirequest.index',
- 'query' =>
$values['location_code'],
+ 'query' =>
$values['location_data']['loc1'],
'project_id' => $values['project_id']
);
@@ -919,24 +928,48 @@
$cal_info = $this->bocommon->jscalendar();
$jsDateFormat=$cal_info['jsDateFormat'];
+
+ for ($i=0;$i<count($values['origin']);$i++)
+ {
+
$values['origin'][$i]['link']=$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp
. $values['origin'][$i]['link']);
+
if(substr($values['origin'][$i]['type'],0,6)=='entity')
+ {
+ $type =
explode("_",$values['origin'][$i]['type']);
+ $entity_id = $type[1];
+ $cat_id = $type[2];
+
+ if(!is_object($boadmin_entity))
+ {
+ $boadmin_entity =
CreateObject($this->currentapp.'.boadmin_entity');
+ }
+ $entity_category =
$boadmin_entity->read_single_category($entity_id,$cat_id);
+ $values['origin'][$i]['descr'] =
$entity_category['name'];
+ }
+ else
+ {
+ $values['origin'][$i]['descr']=
lang($values['origin'][$i]['type']);
+ if($values['origin'][$i]['type'] ==
'request')
+ {
+ $selected_request = True;
+ }
+ }
+ }
+
+
$data = array
(
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
- 'lang_ticket'
=> lang('ticket'),
- 'lang_ticket_statustext' =>
lang('Link to the ticket for this project'),
- 'link_ticket'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uitts.view'),
- 'value_ticket_id'
=> $values['ticket_id'],
'value_origin'
=> $values['origin'],
- 'value_origin_id'
=> $values['origin_id'],
+ 'value_origin_type'
=> $origin,
+ 'value_origin_id'
=> $origin_id,
+ 'selected_request'
=> $selected_request,
- 'lang_request'
=> lang('request'),
'lang_select_request' =>
lang('Select request'),
'lang_select_request_statustext' =>
lang('Add request for this project'),
'lang_request_statustext' =>
lang('Link to the request for this project'),
'lang_delete_request_statustext'=> lang('Check
to delete this request from this project'),
'link_select_request' =>
$GLOBALS['phpgw']->link('/index.php',$link_request_data),
- 'value_request_id'
=> $values['request_id'],
'link_request'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uirequest.view'),
'add_workorder_action'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiworkorder.edit'),
@@ -1189,11 +1222,45 @@
//_debug_array($values);
$msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+ for ($i=0;$i<count($values['origin']);$i++)
+ {
+
$values['origin'][$i]['link']=$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp
. $values['origin'][$i]['link']);
+
if(substr($values['origin'][$i]['type'],0,6)=='entity')
+ {
+ $type =
explode("_",$values['origin'][$i]['type']);
+ $entity_id = $type[1];
+ $cat_id = $type[2];
+
+ if(!is_object($boadmin_entity))
+ {
+ $boadmin_entity =
CreateObject($this->currentapp.'.boadmin_entity');
+ }
+ $entity_category =
$boadmin_entity->read_single_category($entity_id,$cat_id);
+ $values['origin'][$i]['descr'] =
$entity_category['name'];
+ }
+ else
+ {
+ $values['origin'][$i]['descr']=
lang($values['origin'][$i]['type']);
+ if($values['origin'][$i]['type'] ==
'request')
+ {
+ $selected_request = True;
+ }
+ }
+ }
+
$data = array
(
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
- 'lang_ticket'
=> lang('ticket'),
+
+ 'value_origin'
=> $values['origin'],
+ 'value_origin_type'
=> $origin,
+ 'value_origin_id'
=> $origin_id,
+ 'selected_request'
=> $selected_request,
+
+
+/* 'lang_ticket'
=> lang('ticket'),
'lang_ticket_statustext' =>
lang('Link to the ticket for this project'),
'link_ticket'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uitts.view'),
'value_ticket_id'
=> $values['ticket_id'],
@@ -1202,7 +1269,7 @@
'lang_request_statustext' =>
lang('Link to the request for this project'),
'value_request_id'
=> $values['request_id'],
'link_request'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uirequest.view'),
-
+*/
'table_header_workorder_budget' =>
$table_header_workorder_budget,
'lang_no_workorders' =>
lang('No workorder bugdet'),
'workorder_link'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiworkorder.view'),
====================================================
Index: property/inc/class.uirequest.inc.php
diff -u property/inc/class.uirequest.inc.php:1.7
property/inc/class.uirequest.inc.php:1.8
--- property/inc/class.uirequest.inc.php:1.7 Mon Jan 24 11:41:32 2005
+++ property/inc/class.uirequest.inc.php Fri Feb 25 13:19:54 2005
@@ -749,7 +749,7 @@
'consequence_list_residential_environment'
=> $this->bo->select_consequence_list($values['c_residential_environment']),
'lang_authorities_demands'
=> lang('Authorities Demands'),
- 'lang_authorities_demands_statustext'
=> lang('Is there a demand from the authorities to correct this
condition?'),
+ 'lang_authorities_demands_statustext'
=> lang('Is there a demand from the authorities to correct this condition?'),
'authorities_demands'
=> $values['authorities_demands']
);
@@ -780,7 +780,6 @@
'link_project'
=> $GLOBALS['phpgw']->link('/index.php',$project_lookup_data),
'value_project_id'
=> $values['project_id'],
-
'generate_project_action'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiproject.edit'),
'lang_generate_project'
=> lang('Generate project'),
'lang_generate_project_statustext' =>
lang('Generate a project from this request'),
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] property/inc class.soproject.inc.php, 1.14 class.boproject.inc.php, 1.7 class.uitts.inc.php, 1.10 class.uiproject.inc.php, 1.12 class.uirequest.inc.php, 1.8,
sigurdne <=