[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [7764] property: notify project owner on altered tick
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [7764] property: notify project owner on altered ticket status |
Date: |
Fri, 30 Sep 2011 14:39:40 +0000 |
Revision: 7764
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7764
Author: sigurdne
Date: 2011-09-30 14:39:39 +0000 (Fri, 30 Sep 2011)
Log Message:
-----------
property: notify project owner on altered ticket status
Modified Paths:
--------------
trunk/property/inc/class.botts.inc.php
trunk/property/inc/class.sotts.inc.php
trunk/property/inc/class.uiwo_hour.inc.php
Added Paths:
-----------
trunk/property/inc/custom/default/varsle_prosjektoordinator_ved_avsluttet_relatert_melding_BBB.php
Modified: trunk/property/inc/class.botts.inc.php
===================================================================
--- trunk/property/inc/class.botts.inc.php 2011-09-30 12:41:10 UTC (rev
7763)
+++ trunk/property/inc/class.botts.inc.php 2011-09-30 14:39:39 UTC (rev
7764)
@@ -1014,7 +1014,32 @@
public function update_ticket($data, $id,$receipt = array())
{
$receipt = $this->so->update_ticket($data, $id,
$receipt);
- $this->fields_updated = $this->so->fields_updated;
+ $this->fields_updated = $this->so->fields_updated;
+
+ $criteria = array
+ (
+ 'appname' => 'property',
+ 'location' => $this->acl_location,
+ 'allrows' => true
+ );
+
+ $custom_functions =
$GLOBALS['phpgw']->custom_functions->find($criteria);
+
+ foreach ( $custom_functions as $entry )
+ {
+ // prevent path traversal
+ if ( preg_match('/\.\./', $entry['file_name']) )
+ {
+ continue;
+ }
+
+ $file = PHPGW_SERVER_ROOT .
"/property/inc/custom/{$GLOBALS['phpgw_info']['user']['domain']}/{$entry['file_name']}";
+ if ( $entry['active'] && is_file($file) )
+ {
+ require $file;
+ }
+ }
+
return $receipt;
}
Modified: trunk/property/inc/class.sotts.inc.php
===================================================================
--- trunk/property/inc/class.sotts.inc.php 2011-09-30 12:41:10 UTC (rev
7763)
+++ trunk/property/inc/class.sotts.inc.php 2011-09-30 14:39:39 UTC (rev
7764)
@@ -843,6 +843,7 @@
function update_ticket($ticket,$id = 0, $receipt = array())
{
+ $this->fields_updated = array();
$id = (int) $id;
// DB Content is fresher than http posted value.
$this->db->query("select * from fm_tts_tickets where
id='$id'",__LINE__,__FILE__);
@@ -943,7 +944,7 @@
{
if ($oldfinnish_date != $finnish_date)
{
- $this->fields_updated = true;
+ $this->fields_updated[] =
'finnish_date';
$this->historylog->add('F',$id,$finnish_date,$oldfinnish_date);
}
}
@@ -953,7 +954,7 @@
$check_old_custom = (int) trim($old_status,'C');
$this->db->query("SELECT * from fm_tts_status
WHERE id = {$check_old_custom}",__LINE__,__FILE__);
$this->db->next_record();
- $this->fields_updated = true;
+ $this->fields_updated[] = 'status';
if($old_status=='X' || $this->db->f('closed'))
{
$new_status = $ticket['status'];
@@ -971,7 +972,7 @@
if (($oldassigned != $ticket['assignedto']) &&
$ticket['assignedto'] != 'ignore')
{
- $this->fields_updated = true;
+ $this->fields_updated[] = 'assignedto';
$value_set=array('assignedto' =>
$ticket['assignedto']);
$value_set =
$this->db->validate_update($value_set);
@@ -982,7 +983,7 @@
if (($oldgroup_id != $ticket['group_id']) &&
$ticket['group_id'] != 'ignore')
{
- $this->fields_updated = true;
+ $this->fields_updated[] = 'group_id';
$value_set=array('group_id' =>
$ticket['group_id']);
$value_set =
$this->db->validate_update($value_set);
@@ -993,7 +994,7 @@
if ($oldpriority != $ticket['priority'])
{
- $this->fields_updated = true;
+ $this->fields_updated[] = 'priority';
$this->db->query("update fm_tts_tickets set
priority='" . $ticket['priority']
. "' where id='$id'",__LINE__,__FILE__);
$this->historylog->add('P',$id,$ticket['priority'],$oldpriority);
@@ -1002,13 +1003,13 @@
if ($old_contact_id != $ticket['contact_id'])
{
$contact_id = (int) $ticket['contact_id'];
- $this->fields_updated = true;
+ $this->fields_updated[] = 'contact_id';
$this->db->query("update fm_tts_tickets set
contact_id={$contact_id} WHERE id=$id",__LINE__,__FILE__);
}
if (($oldcat_id != $ticket['cat_id']) &&
$ticket['cat_id'] != 'ignore')
{
- $this->fields_updated = true;
+ $this->fields_updated[] = 'cat_id';
$this->db->query("update fm_tts_tickets set
cat_id='" . $ticket['cat_id']
. "' where id='$id'",__LINE__,__FILE__);
$this->historylog->add('T',$id,$ticket['cat_id'],$oldcat_id);
@@ -1016,7 +1017,7 @@
if ($old_budget != $ticket['budget'])
{
- $this->fields_updated = true;
+ $this->fields_updated[] = 'budget';
$this->db->query("UPDATE fm_tts_tickets set
budget='" . (int)$ticket['budget']
. "' where id='$id'",__LINE__,__FILE__);
$this->historylog->add('B',$id,$ticket['budget'],$old_budget);
@@ -1024,7 +1025,7 @@
/*
if ($old_billable_rate != $ticket['billable_rate'])
{
- $this->fields_updated = true;
+ $this->fields_updated[] = 'billable_rate';
$this->db->query("update fm_tts_tickets set
billable_rate='" . $ticket['billable_rate']
. "' where id='$id'",__LINE__,__FILE__);
$this->historylog->add('B',$id,$ticket['billable_rate'],$old_billable_rate);
@@ -1063,7 +1064,7 @@
$this->db->query("UPDATE fm_tts_tickets SET
order_cat_id='" . (int)$ticket['order_cat_id']
. "' WHERE id='$id'",__LINE__,__FILE__);
$receipt['message'][]= array('msg' =>
lang('order category has been updated'));
- $this->fields_updated = true;
+ $this->fields_updated[] = 'order_cat_id';
}
if ((int)$old_order_dim1 != (int)$ticket['order_dim1'])
@@ -1071,7 +1072,7 @@
$this->db->query("UPDATE fm_tts_tickets SET
order_dim1='" . (int)$ticket['order_dim1']
. "' WHERE id='$id'",__LINE__,__FILE__);
$receipt['message'][]= array('msg' =>
lang('order_dim1 has been updated'));
- $this->fields_updated = true;
+ $this->fields_updated[] = 'order_dim1';
}
if ($old_building_part != $ticket['building_part'])
@@ -1079,12 +1080,12 @@
$this->db->query("UPDATE fm_tts_tickets SET
building_part='" . $ticket['building_part']
. "' WHERE id='$id'",__LINE__,__FILE__);
$receipt['message'][]= array('msg' =>
lang('building part has been updated'));
- $this->fields_updated = true;
+ $this->fields_updated[] = 'building_part';
}
if (($old_note != $ticket['note']) && $ticket['note'])
{
- $this->fields_updated = true;
+ $this->fields_updated[] = 'note';
$this->historylog->add('C',$id,$ticket['note'],$old_note);
$_history_id =
$this->db->get_last_insert_id('fm_tts_history','history_id');
$this->db->query("UPDATE fm_tts_history SET
publish = 1 WHERE history_id = $_history_id",__LINE__,__FILE__);
Modified: trunk/property/inc/class.uiwo_hour.inc.php
===================================================================
--- trunk/property/inc/class.uiwo_hour.inc.php 2011-09-30 12:41:10 UTC (rev
7763)
+++ trunk/property/inc/class.uiwo_hour.inc.php 2011-09-30 14:39:39 UTC (rev
7764)
@@ -1404,8 +1404,6 @@
'lang_contact_phone'
=> lang('Contact phone'),
'contact_phone'
=> $project['contact_phone'],
- //
'lang_vendor' => lang('vendor'),
-
'lang_branch'
=> lang('branch'),
'branch_list'
=> $this->boproject->select_branch_p_list($project['project_id']),
'other_branch'
=> $project['other_branch'],
Added:
trunk/property/inc/custom/default/varsle_prosjektoordinator_ved_avsluttet_relatert_melding_BBB.php
===================================================================
---
trunk/property/inc/custom/default/varsle_prosjektoordinator_ved_avsluttet_relatert_melding_BBB.php
(rev 0)
+++
trunk/property/inc/custom/default/varsle_prosjektoordinator_ved_avsluttet_relatert_melding_BBB.php
2011-09-30 14:39:39 UTC (rev 7764)
@@ -0,0 +1,15 @@
+<?php
+ $db = & $GLOBALS['phpgw']->db;
+
+ if(in_array('status', $this->fields_updated))
+ {
+ $_status = (int) trim($data['status'],'C');
+ $db->query("SELECT * from fm_tts_status WHERE id =
{$_status}",__LINE__,__FILE__);
+ $this->db->next_record();
+ if($db->f('closed'))
+ {
+ _debug_array($this->fields_updated);
+ }
+ }
+
+
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [7764] property: notify project owner on altered ticket status,
Sigurd Nes <=