[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: property/inc class.boproject.inc.php,1.4,1.5 cla
From: |
Sigurd Nes <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: property/inc class.boproject.inc.php,1.4,1.5 class.borequest.inc.php,1.3,1.4 class.soproject.inc.php,1.12,1.13 class.sorequest.inc.php,1.7,1.8 class.uiproject.inc.php,1.21,1.22 class.uirequest.inc.php,1.15,1.16 |
Date: |
Mon, 26 May 2003 08:15:22 -0400 |
Update of /cvsroot/phpgroupware/property/inc
In directory subversions:/tmp/cvs-serv30042/inc
Modified Files:
class.boproject.inc.php class.borequest.inc.php
class.soproject.inc.php class.sorequest.inc.php
class.uiproject.inc.php class.uirequest.inc.php
Log Message:
no message
Index: class.boproject.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boproject.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.boproject.inc.php 23 May 2003 08:40:19 -0000 1.4
--- class.boproject.inc.php 26 May 2003 12:15:20 -0000 1.5
***************
*** 434,437 ****
--- 434,443 ----
}
+ function add_request($add_request,$id)
+ {
+
+ return $this->so->add_request($add_request,$id);
+ }
+
function read_single_equipment_type($equipment_type_id)
{
Index: class.borequest.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.borequest.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.borequest.inc.php 23 May 2003 08:40:19 -0000 1.3
--- class.borequest.inc.php 26 May 2003 12:15:20 -0000 1.4
***************
*** 371,378 ****
}
! function read()
{
$request = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
!
'filter' => $this->filter,'cat_id' => $this->cat_id,'status_id' =>
$this->status_id));
$this->total_records = $this->so->total_records;
--- 371,378 ----
}
! function read($project_id)
{
$request = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
!
'filter' => $this->filter,'cat_id' => $this->cat_id,'status_id' =>
$this->status_id,'project_id' => $project_id));
$this->total_records = $this->so->total_records;
Index: class.soproject.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soproject.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** class.soproject.inc.php 21 May 2003 20:09:51 -0000 1.12
--- class.soproject.inc.php 26 May 2003 12:15:20 -0000 1.13
***************
*** 20,23 ****
--- 20,24 ----
$this->bocommon =
CreateObject($this->currentapp.'.bocommon',True);
$this->historylog =
CreateObject($this->currentapp.'.historylog','project');
+ $this->historylog_r =
CreateObject($this->currentapp.'.historylog','request');
if
($GLOBALS['phpgw_info']['server']['db_type']=='pgsql')
***************
*** 224,238 ****
}
! $sql = "SELECT * FROM fm_project_origin WHERE
project_id='$project_id'";
$this->db->query($sql,__LINE__,__FILE__);
! if ($this->db->next_record())
{
! $project['origin_id'] =
$this->db->f('origin_id');
! $project['origin'] =
$this->db->f('origin');
}
//_debug_array($project);
return $project;
--- 225,247 ----
}
+ $sql = "SELECT * FROM fm_project_origin WHERE
project_id='$project_id' and origin ='request'";
! $this->db->query($sql,__LINE__,__FILE__);
!
! while ($this->db->next_record())
! {
! $project['request_id'][]['id'] =
$this->db->f('origin_id');
! }
!
! $sql = "SELECT * FROM fm_project_origin WHERE
project_id='$project_id' and origin ='ticket'";
$this->db->query($sql,__LINE__,__FILE__);
! while ($this->db->next_record())
{
! $project['ticket_id'][]['id'] =
$this->db->f('origin_id');
}
+
//_debug_array($project);
return $project;
***************
*** 450,455 ****
$old_status = $this->db->f('status');
! $old_categroy = $this->db->f('category');
! $old_coordinator = $this->db->f('coordinator');
if ($old_status != $project['status'])
{
--- 459,464 ----
$old_status = $this->db->f('status');
! $old_categroy = (int)$this->db->f('category');
! $old_coordinator = (int)$this->db->f('coordinator');
if ($old_status != $project['status'])
{
***************
*** 521,524 ****
--- 530,534 ----
}
+
$this->update_request_status($project['project_id'],$project['status'],$project['cat_id'],$project['coordinator']);
$receipt['message'][] = array('msg'=>lang('project %1
has been edited',$project['project_id']));
***************
*** 527,532 ****
--- 537,638 ----
}
+ function
update_request_status($project_id='',$status='',$category=0,$coordinator=0)
+ {
+ $sql = "SELECT origin_id FROM fm_project_origin WHERE
project_id='$project_id' and origin ='request'";
+ $this->db->query($sql,__LINE__,__FILE__);
+
+ while ($this->db->next_record())
+ {
+ $request_id[] = $this->db->f('origin_id');
+ }
+
+ for ($i=0;$i<count($request_id);$i++)
+ {
+ $this->db->query("SELECT
status,category,coordinator FROM fm_request where id='" .$request_id[$i]
."'",__LINE__,__FILE__);
+
+ $this->db->next_record();
+
+ $old_status = $this->db->f('status');
+ $old_category = (int)$this->db->f('category');
+ $old_coordinator =
(int)$this->db->f('coordinator');
+
+ if ($old_status != $status)
+ {
+
$this->historylog_r->add('S',$request_id[$i],$status);
+ }
+
+ if ((int)$old_category != (int)$category)
+ {
+
$this->historylog_r->add('T',$request_id[$i],$category);
+ }
+
+ if ((int)$old_coordinator != (int)$coordinator)
+ {
+
$this->historylog_r->add('C',$request_id[$i],$coordinator);
+ }
+
+ $this->db2->query("update fm_request set
status='$status',coordinator='$coordinator' where id='". $request_id[$i] .
"'",__LINE__,__FILE__);
+ }
+ }
+
+
+ function check_request($request_id)
+ {
+ $sql = "SELECT project_id FROM fm_project_origin WHERE
origin_id='$request_id' and origin ='request'";
+ $this->db->query($sql,__LINE__,__FILE__);
+
+ $this->db->next_record();
+
+ if ( $this->db->f(0))
+ {
+ return $this->db->f('project_id');
+ }
+ }
+
+ function add_request($add_request,$id)
+ {
+
+ for ($i=0;$i<count($add_request['request_id']);$i++)
+ {
+
$project_id=$this->check_request($add_request['request_id'][$i]);
+
+ if(!$project_id)
+ {
+ $this->db->query("INSERT INTO
fm_project_origin (origin,origin_id,project_id) "
+ . "VALUES ('request','"
+ .
$add_request['request_id'][$i]. "','"
+ . $id. "')",__LINE__,__FILE__);
+
+ $this->db2->query("update fm_request
set project_id='$id' where id='". $add_request['request_id'][$i] .
"'",__LINE__,__FILE__);
+
+ $receipt['message'][] =
array('msg'=>lang('request %1 has been added',$add_request['request_id'][$i]));
+ }
+ else
+ {
+ $receipt['error'][] =
array('msg'=>lang('request %1 has already been added to project
%2',$add_request['request_id'][$i],$project_id));
+ }
+
+ }
+
+ return $receipt;
+ }
+
function delete($project_id )
{
+
+ $sql = "SELECT origin_id FROM fm_project_origin WHERE
project_id='$project_id' and origin ='request'";
+ $this->db->query($sql,__LINE__,__FILE__);
+
+ while ($this->db->next_record())
+ {
+ $request_id[] = $this->db->f('origin_id');
+ }
+
+ for ($i=0;$i<count($request_id);$i++)
+ {
+
+ $this->db2->query("update fm_request set
project_id = NULL where id='". $request_id[$i] . "'",__LINE__,__FILE__);
+ }
+
$this->db->query("DELETE FROM fm_project WHERE id='" .
$project_id . "'",__LINE__,__FILE__);
$this->db->query("DELETE FROM fm_project_history WHERE
history_record_id='" . $project_id . "'",__LINE__,__FILE__);
Index: class.sorequest.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sorequest.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** class.sorequest.inc.php 21 May 2003 20:09:51 -0000 1.7
--- class.sorequest.inc.php 26 May 2003 12:15:20 -0000 1.8
***************
*** 78,82 ****
$this->update_score($values,'');
! $receipt = lang('priority keys has been updated');
return $receipt;
--- 78,82 ----
$this->update_score($values,'');
! $receipt['message'][] = array('msg'=> lang('priority
keys has been updated'));
return $receipt;
***************
*** 184,187 ****
--- 184,188 ----
$cat_id =
(isset($data['cat_id'])?$data['cat_id']:0);
$status_id =
(isset($data['status_id'])?$data['status_id']:0);
+ $project_id =
(isset($data['project_id'])?$data['project_id']:'');
}
***************
*** 195,227 ****
}
! $filtermethod = ' ( fm_request.owner=' . $this->account;
! if (is_array($this->grants))
! {
! $grants = $this->grants;
! while (list($user) = each($grants))
! {
! $public_user_list[] = $user;
! }
! reset($public_user_list);
! $filtermethod .= " OR
(fm_request.access='public' OR fm_request.owner IN(" .
implode(',',$public_user_list) . ")))";
! }
! else
! {
! $filtermethod .= ' )';
! }
!
if ($cat_id > 0)
{
! $filtermethod .= " AND
fm_request.category='$cat_id' ";
}
if ($status_id)
{
! $filtermethod .= " AND
fm_request.status='$status_id' ";
}
if ($filter)
{
! $filtermethod .= " AND
fm_request.coordinator='$filter' ";
}
--- 196,222 ----
}
! $where = 'WHERE';
if ($cat_id > 0)
{
! $filtermethod .= " $where
fm_request.category='$cat_id' ";
! $where = 'AND';
}
if ($status_id)
{
! $filtermethod .= " $where
fm_request.status='$status_id' ";
! $where = 'AND';
}
if ($filter)
{
! $filtermethod .= " $where
fm_request.coordinator='$filter' ";
! $where = 'AND';
! }
!
! if ($project_id)// lookup requests not already
allocated to projects
! {
! $filtermethod .= " $where project_id is NULL ";
! $where = 'AND';
}
***************
*** 231,238 ****
$query = ereg_replace('"','',$query);
! $querymethod = " AND fm_request.title LIKE
'%$query%' or fm_request.address LIKE '%$query%' or fm_request.location_code
LIKE '%$query%'";
}
! $sql = "SELECT * FROM fm_request WHERE $filtermethod
$querymethod";
$this->db2->query($sql,__LINE__,__FILE__);
--- 226,233 ----
$query = ereg_replace('"','',$query);
! $querymethod = " $where (fm_request.title LIKE
'%$query%' or fm_request.address LIKE '%$query%' or fm_request.location_code
LIKE '%$query%')";
}
! $sql = "SELECT * FROM fm_request $filtermethod
$querymethod";
$this->db2->query($sql,__LINE__,__FILE__);
Index: class.uiproject.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiproject.inc.php,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** class.uiproject.inc.php 23 May 2003 08:40:19 -0000 1.21
--- class.uiproject.inc.php 26 May 2003 12:15:20 -0000 1.22
***************
*** 246,249 ****
--- 246,251 ----
$id =
get_var('id',array('POST','GET'));
$values =
get_var('values',array('POST'));
+ $add_request =
get_var('add_request',array('POST'));
+ //_debug_array($add_request);
$GLOBALS['phpgw']->xslttpl->add_file(array('project'));
***************
*** 251,254 ****
--- 253,261 ----
$bypass =
get_var('bypass',array('POST','GET'));
+ if($add_request)
+ {
+ $receipt =
$this->bo->add_request($add_request,$id);
+ }
+
if($values && !$bypass)
{
***************
*** 367,371 ****
}
! if(!$receipt['error'] && !$bypass)
{
$values = $this->bo->read_single($id);
--- 374,378 ----
}
! if((!$receipt['error'] || $add_request) && !$bypass)
{
$values = $this->bo->read_single($id);
***************
*** 423,435 ****
- if($values['origin']== 'ticket')
- {
- $origin_data = array
- (
- 'menuaction' =>
$this->currentapp.'.uitts.view',
- 'id' =>
$values['origin_id']
- );
- }
-
$link_data = array
(
--- 430,433 ----
***************
*** 438,441 ****
--- 436,446 ----
);
+ $link_request_data = array
+ (
+ 'menuaction' =>
$this->currentapp.'.uirequest.index',
+ 'query' =>
$values['location_code'],
+ 'project_id' => $values['project_id']
+ );
+
$dateformat =
strtolower($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
$sep = '/';
***************
*** 464,472 ****
(
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
! 'lang_origin'
=> lang('origin'),
! 'lang_origin_statustext' =>
lang('Link to the origin for this project'),
! 'link_origin'
=> $GLOBALS['phpgw']->link('/index.php',$origin_data),
! 'value_origin'
=> $values['origin'],
! 'value_origin_id'
=> $values['origin_id'],
'add_workorder_action'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiworkorder.edit'),
--- 469,483 ----
(
'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'],
!
! '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'),
! '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'),
Index: class.uirequest.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uirequest.inc.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** class.uirequest.inc.php 23 May 2003 08:40:19 -0000 1.15
--- class.uirequest.inc.php 26 May 2003 12:15:20 -0000 1.16
***************
*** 77,83 ****
'search_field'));
$links = $this->bocommon->menu();
! $request_list = $this->bo->read();
//_debug_array($request_list);
--- 77,84 ----
'search_field'));
+ $project_id =
get_var('project_id',array('POST','GET')); // lookup for maintenance planning
$links = $this->bocommon->menu();
! $request_list = $this->bo->read($project_id);
//_debug_array($request_list);
***************
*** 125,129 ****
'district_id' =>
$this->district_id,
'filter'
=>$this->filter,
!
'lookup'
=>$lookup,
'query'
=>$this->query)
)),
--- 126,130 ----
'district_id' =>
$this->district_id,
'filter'
=>$this->filter,
!
'project_id'
=>$project_id,
'query'
=>$this->query)
)),
***************
*** 139,142 ****
--- 140,144 ----
'district_id' =>
$this->district_id,
'filter'
=>$this->filter,
+
'project_id'
=>$project_id,
'query'
=>$this->query)
)),
***************
*** 155,158 ****
--- 157,161 ----
'district_id' =>
$this->district_id,
'filter'
=>$this->filter,
+
'project_id'
=>$project_id,
'query'
=>$this->query)
)),
***************
*** 169,172 ****
--- 172,176 ----
'district_id' =>
$this->district_id,
'filter'
=>$this->filter,
+
'project_id'
=>$project_id,
'query'
=>$this->query)
)),
***************
*** 180,184 ****
$table_add[] = array
(
- 'lang_add' =>
lang('add'),
'lang_add_statustext' => lang('add a
request'),
'add_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uirequest.edit')
--- 184,187 ----
***************
*** 194,198 ****
'filter'
=>$this->filter,
'status_id'
=>$this->status_id,
! 'lookup'
=>$lookup,
'query'
=>$this->query
);
--- 197,201 ----
'filter'
=>$this->filter,
'status_id'
=>$this->status_id,
! 'project_id'
=>$project_id,
'query'
=>$this->query
);
***************
*** 200,213 ****
$data = array
(
! 'lang_priority_key'
=> lang('Priority key'),
! 'lang_priority_help' =>
lang('To alter the priority key'),
! 'link_priority_key'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uirequest.priority_key'),
! 'overlib_source'
=> './'.$this->currentapp.'/inc/overlib.js',
!
! 'link_history'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uirequest.index&lookup='
. $lookup),
! 'lang_history_statustext' =>
lang('searh for history at this location'),
! 'lang_select'
=> lang('select'),
! 'lookup_action'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiworkorder.edit'),
! 'lookup'
=> $lookup,
'links'
=> $links,
'allow_allrows'
=> false,
--- 203,220 ----
$data = array
(
! 'lang_priority_key'
=> lang('Priority key'),
! 'lang_priority_help'
=> lang('To alter the priority key'),
! 'link_priority_key'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uirequest.priority_key'),
! 'overlib_source'
=> './'.$this->currentapp.'/inc/overlib.js',
!
! 'link_history'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uirequest.index&project_id='
. $project_id),
! 'lang_history_statustext'
=> lang('searh for history at this location'),
! 'lang_select'
=> lang('select'),
!
! 'lang_add'
=> lang('add'),
! 'lang_add_to_project_statustext' =>
lang('add selected request to project'),
! 'add_to_project_action'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiproject.edit&id='
. $project_id),
! 'project_id'
=> $project_id,
!
'links'
=> $links,
'allow_allrows'
=> false,
***************
*** 231,235 ****
'status_name'
=> 'status_id',
'lang_no_status'
=> lang('No status'),
! 'status_list'
=> $this->bo->select_status_list('filter',$this->status_id),
'lang_user_statustext' =>
lang('Select the user the request belongs to. To do not use a category select
NO USER'),
--- 238,242 ----
'status_name'
=> 'status_id',
'lang_no_status'
=> lang('No status'),
! 'status_list'
=> $this->boproject->select_status_list('filter',$this->status_id),
'lang_user_statustext' =>
lang('Select the user the request belongs to. To do not use a category select
NO USER'),
***************
*** 299,304 ****
);
- //_debug_array($data);
-
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('priority_key' => $data));
}
--- 306,309 ----
***************
*** 655,659 ****
'user_list'
=> $this->bocommon->get_user_list('select',$values['coordinator']),
! 'status_list'
=> $this->bo->select_status_list('select',$values['status']),
'select_status_name' =>
'values[status]',
'lang_no_status'
=> lang('Select status'),
--- 660,664 ----
'user_list'
=> $this->bocommon->get_user_list('select',$values['coordinator']),
! 'status_list'
=> $this->boproject->select_status_list('select',$values['status']),
'select_status_name' =>
'values[status]',
'lang_no_status'
=> lang('Select status'),
***************
*** 883,887 ****
'user_list'
=> $this->bocommon->get_user_list('select',$values['coordinator']),
! 'status_list'
=> $this->bo->select_status_list('select',$values['status']),
'lang_status'
=> lang('Status'),
--- 888,892 ----
'user_list'
=> $this->bocommon->get_user_list('select',$values['coordinator']),
! 'status_list'
=> $this->boproject->select_status_list('select',$values['status']),
'lang_status'
=> lang('Status'),
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: property/inc class.boproject.inc.php,1.4,1.5 class.borequest.inc.php,1.3,1.4 class.soproject.inc.php,1.12,1.13 class.sorequest.inc.php,1.7,1.8 class.uiproject.inc.php,1.21,1.22 class.uirequest.inc.php,1.15,1.16,
Sigurd Nes <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: property/templates/default project.xsl,1.9,1.10 request.xsl,1.6,1.7
- Next by Date:
[Phpgroupware-cvs] CVS: property/setup tables_current.inc.php,1.82,1.83
- Previous by thread:
[Phpgroupware-cvs] CVS: property/templates/default project.xsl,1.9,1.10 request.xsl,1.6,1.7
- Next by thread:
[Phpgroupware-cvs] CVS: property/setup tables_current.inc.php,1.82,1.83
- Index(es):