[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] property/inc class.sotts2.inc.php, 1.5 class.uitts.in
From: |
sigurdne |
Subject: |
[Phpgroupware-cvs] property/inc class.sotts2.inc.php, 1.5 class.uitts.inc.php, 1.7 |
Date: |
Thu, 24 Feb 2005 15:06:55 -0000 |
Update of property/inc
Modified Files:
Branch: MAIN
class.sotts2.inc.php lines: +63 -1
class.uitts.inc.php lines: +51 -2
Log Message:
no message
====================================================
Index: property/inc/class.sotts2.inc.php
diff -u property/inc/class.sotts2.inc.php:1.4
property/inc/class.sotts2.inc.php:1.5
--- property/inc/class.sotts2.inc.php:1.4 Thu Jan 13 16:52:48 2005
+++ property/inc/class.sotts2.inc.php Mon Jan 24 10:30:56 2005
@@ -41,6 +41,68 @@
$this->like = $this->bocommon->like;
}
+ function update_status($ticket,$id='')
+ {
+ // DB Content is fresher than http posted value.
+ $this->db->query("select * from fm_tts_tickets where
id='$id'",__LINE__,__FILE__);
+ $this->db->next_record();
+ $old_status = $this->db->f('status');
+
+ $this->db->transaction_begin();
+
+ /*
+ ** phpgw_fm_tts_append.append_type - Defs
+ ** R - Reopen ticket
+ ** X - Ticket closed
+ ** O - Ticket opened
+ ** C - Comment appended
+ ** A - Ticket assignment
+ ** G - Ticket group assignment
+ ** P - Priority change
+ ** T - Category change
+ ** S - Subject change
+ ** B - Billing rate
+ ** H - Billing hours
+ ** F - finnish date
+ */
+
+ if ($old_status != $ticket['status'])
+ {
+ $fields_updated = True;
+ if($old_status=='X')
+ {
+
$this->historylog->add('R',$id,$ticket['status'],$old_status);
+
+ $this->db->query("update fm_tts_tickets
set status='O' where id='$id'",__LINE__,__FILE__);
+ }
+ else
+ {
+
$this->historylog->add($ticket['status'],$id,$ticket['status'],$old_status);
+
+ $this->db->query("update fm_tts_tickets
set status='"
+ . $ticket['status'] . "' where
id='$id'",__LINE__,__FILE__);
+ }
+ }
+
+ $this->db->transaction_commit();
+
+ if ($fields_updated)
+ {
+ $this->config->read_repository();
+
+ if
($this->config->config_data['mailnotification'])
+ {
+
$receipt=$this->bo->mail_ticket($id,$fields_updated,'',$location_code);
+
+ }
+
+ $receipt['message'][]= array('msg' =>
lang('Ticket %1 has been updated',$id));
+ }
+
+ return $receipt;
+
+ }
+
function update_ticket($ticket,$id='')
{
// DB Content is fresher than http posted value.
====================================================
Index: property/inc/class.uitts.inc.php
diff -u property/inc/class.uitts.inc.php:1.6
property/inc/class.uitts.inc.php:1.7
--- property/inc/class.uitts.inc.php:1.6 Thu Jan 13 16:52:48 2005
+++ property/inc/class.uitts.inc.php Mon Jan 24 10:30:56 2005
@@ -162,6 +162,20 @@
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uilocation.stop&perm=1&acl_location='
. $this->acl2_location);
}
+ if(get_var('edit_status',array('POST','GET')))
+ {
+ if(!$this->acl_edit)
+ {
+
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uilocation.stop&perm=4&acl_location='
. $this->acl2_location);
+ }
+
+ $new_status =
get_var('new_status',array('POST','GET'));
+ $id = get_var('id',array('POST','GET'));
+ $so2 =
CreateObject($this->currentapp.'.sotts2');
+ $receipt =
$so2->update_status(array('status'=>$new_status),$id);
+
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp,$receipt);
+ }
+
$GLOBALS['phpgw']->xslttpl->add_file(array('tts',
'menu',
'nextmatchs',
@@ -208,6 +222,37 @@
{
$first= $ticket['category'];
}
+
+ if ($ticket['status']=='O')
+ {
+ $text_edit_status = lang('Close');
+ $new_status = 'X';
+ }
+ else
+ {
+ $text_edit_status = lang('Open');
+ $new_status = 'O';
+ }
+
+
+ $link_status_data = array
+ (
+ 'menuaction' =>
$this->currentapp.'.uitts.index',
+ 'id'
=> $ticket['id'],
+ 'edit_status' => true,
+ 'new_status' =>
$new_status,
+ 'second_display'
=> true,
+ 'sort'
=>$this->sort,
+ 'order'
=>$this->order,
+ 'cat_id'
=>$this->cat_id,
+ 'filter'
=>$this->filter,
+ 'user_filter'
=>$this->user_filter,
+ 'query'
=>$this->query,
+ 'district_id' =>
$this->district_id,
+ 'allrows'
=>$this->allrows
+ );
+
+
$content[] = array
(
'id'
=> $ticket['id'],
@@ -226,6 +271,9 @@
'link_view'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uitts.view&id='
. $ticket['id']),
'lang_view_statustext' =>
lang('view the ticket'),
'text_view'
=> lang('view'),
+ 'link_edit_status'
=> $GLOBALS['phpgw']->link('/index.php',$link_status_data),
+ 'lang_edit_status_statustext'
=> lang('Edit status for the ticket'),
+ 'text_edit_status'
=> $text_edit_status
);
}
@@ -333,7 +381,8 @@
'lang_finnish_date' =>
lang('finnish date'),
'lang_delay' =>
lang('delay'),
'lang_finnish_statustext'=> lang('presumed
finnish date'),
- 'lang_opened_by' => lang('Opened
by')
+ 'lang_opened_by' => lang('Opened
by'),
+ 'lang_edit_status' => lang('Edit
status')
);
for ($i=0;$i<count($uicols);$i++)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] property/inc class.sotts2.inc.php, 1.5 class.uitts.inc.php, 1.7,
sigurdne <=