fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [7767] property: change priority by right klick at ti


From: Sigurd Nes
Subject: [Fmsystem-commits] [7767] property: change priority by right klick at tickets
Date: Fri, 30 Sep 2011 17:47:11 +0000

Revision: 7767
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7767
Author:   sigurdne
Date:     2011-09-30 17:47:11 +0000 (Fri, 30 Sep 2011)
Log Message:
-----------
property: change priority by right klick at tickets

Modified Paths:
--------------
    trunk/property/inc/class.botts.inc.php
    trunk/property/inc/class.sotts.inc.php
    trunk/property/inc/class.uitts.inc.php
    trunk/property/setup/phpgw_no.lang

Modified: trunk/property/inc/class.botts.inc.php
===================================================================
--- trunk/property/inc/class.botts.inc.php      2011-09-30 17:41:59 UTC (rev 
7766)
+++ trunk/property/inc/class.botts.inc.php      2011-09-30 17:47:11 UTC (rev 
7767)
@@ -1011,6 +1011,13 @@
                        return $receipt;
                }
 
+               public function update_priority($data, $id = 0)
+               {
+                       $receipt        = $this->so->update_priority($data, 
$id);
+                       $this->fields_updated = $this->so->fields_updated;
+                       return $receipt;
+               }
+
                public function update_ticket($data, $id,$receipt = array())
                {
                        $receipt = $this->so->update_ticket($data, $id, 
$receipt);

Modified: trunk/property/inc/class.sotts.inc.php
===================================================================
--- trunk/property/inc/class.sotts.inc.php      2011-09-30 17:41:59 UTC (rev 
7766)
+++ trunk/property/inc/class.sotts.inc.php      2011-09-30 17:47:11 UTC (rev 
7767)
@@ -779,6 +779,7 @@
                        }
                        return $status;
                }
+
                function update_status($ticket,$id = 0)
                {
                        $id = (int) $id;
@@ -841,6 +842,33 @@
 
                }
 
+               function update_priority($ticket,$id = 0)
+               {
+                       $id = (int) $id;
+                       $receipt = array();
+                       $this->db->query("SELECT priority FROM fm_tts_tickets 
WHERE id={$id}",__LINE__,__FILE__);
+                       $this->db->next_record();
+                       $oldpriority  = $this->db->f('priority');
+
+                       $this->db->transaction_begin();
+
+                       if ($oldpriority != $ticket['priority'])
+                       {
+                               $this->fields_updated = true;
+                               $this->db->query("UPDATE fm_tts_tickets set 
priority='" . $ticket['priority']
+                                       . "' WHERE id={$id}",__LINE__,__FILE__);
+                               
$this->historylog->add('P',$id,$ticket['priority'],$oldpriority);
+                       }
+
+                       $this->db->transaction_commit();
+
+                       if ($this->fields_updated)
+                       {
+                               $receipt['message'][]= array('msg' => 
lang('Ticket %1 has been updated',$id));
+                       }
+                       return $receipt;
+               }
+
                function update_ticket($ticket,$id = 0, $receipt = array())
                {
                        $this->fields_updated = array();

Modified: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php      2011-09-30 17:41:59 UTC (rev 
7766)
+++ trunk/property/inc/class.uitts.inc.php      2011-09-30 17:47:11 UTC (rev 
7767)
@@ -49,6 +49,7 @@
                        'download2'                     => true,
                        'view_file'                     => true,
                        'edit_status'           => true,
+                       'edit_priority'         => true,
                        'update_data'           => true,
                        '_print'                        => true,
                        'columns'                       => true
@@ -318,10 +319,30 @@
                        {
                                $receipt = $this->bo->mail_ticket($id, 
$this->bo->fields_updated, $receipt);
                        }
-                       //      
$GLOBALS['phpgw']->session->appsession('receipt','property',$receipt);
-                       return "id ".$id." ".lang('Status has been changed');
+                       return "id {$id} " . lang('Status has been changed');
                }
 
+               function edit_priority()
+               {
+                       if(!$this->acl_edit)
+                       {
+                               return lang('sorry - insufficient rights');
+                       }
+
+                       $new_priority = phpgw::get_var('new_priority', 
'string', 'GET');
+                       $id             = phpgw::get_var('id', 'int');
+
+                       $ticket = $this->bo->read_single($id);
+
+                       $receipt        = 
$this->bo->update_priority(array('priority'=>$new_priority),$id);
+                       if 
(isset($this->bo->config->config_data['mailnotification']) && 
$this->bo->config->config_data['mailnotification'])
+                       {
+                               $receipt = $this->bo->mail_ticket($id, 
$this->bo->fields_updated, $receipt);
+                       }
+                       return "id {$id} " . lang('priority has been changed');
+               }
+
+
                function delete()
                {
                        if(!$this->acl_delete)
@@ -1130,7 +1151,7 @@
                                                (
                                                        'my_name'               
=> 'status',
                                                        'statustext'    => 
$status_info['status'],
-                                                       'text'                  
=> lang('change to') . ':  ' .$status_info['status'],
+                                                       'text'                  
=> lang('change to') . ' status:  ' .$status_info['status'],
                                                        'confirm_msg'   => 
lang('do you really want to change the status to %1',$status_info['status']),
                                                        'action'                
=> $GLOBALS['phpgw']->link('/index.php',array
                                                        (
@@ -1151,8 +1172,38 @@
                                                        'parameters'    => 
$parameters
                                                );
                                }
+
+                               $_priorities = $this->bo->get_priority_list();
+                               foreach ($_priorities as $_priority => 
$_priority_info)
+                               {
+                                       $datatable['rowactions']['action'][] = 
array
+                                       (
+                                               'my_name'               => 
'priority',
+                                               'statustext'    => 
$_priority_info['name'],
+                                               'text'                  => 
lang('change to') . ' ' . lang('priority') .':  ' .$_priority_info['name'],
+                                               'confirm_msg'   => lang('do you 
really want to change the priority to %1',$_priority_info['name']),
+                                               'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
+                                               (
+                                                       'menuaction'            
=> 'property.uitts.edit_priority',
+                                                       'edit_status'           
=> true,
+                                                       'new_priority'          
=> $_priority,
+                                                       '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,
+                                                       'delete'                
        => 'dummy'// FIXME to trigger the json in property.js.
+                                               )),
+                                               'parameters'    => $parameters
+                                       );
+                               }
                        }
 
+
                        if($this->acl_add)
                        {
                                $datatable['rowactions']['action'][] = array

Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang  2011-09-30 17:41:59 UTC (rev 7766)
+++ trunk/property/setup/phpgw_no.lang  2011-09-30 17:47:11 UTC (rev 7767)
@@ -541,6 +541,7 @@
 download       common  no      Last ned
 download table to your browser common  no      Last ned tabell til din 
nettleser
 do you really want to change the status to %1  property        no      Vil du 
virkelig endre status til %1
+do you really want to change the priority to %1        property        no      
Vil du virkelig endre prioritet til %1
 do you really want to delete this entry        property        no      Vil du 
virkelig slette denne posten
 do you really want to update the categories    property        no      vil du 
virkelig oppdatere kategoriene
 do you really want to update the categories again      property        no      
vil du virkelig oppdatere kategoriene igjen




reply via email to

[Prev in Thread] Current Thread [Next in Thread]