fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11439] property: custom priorities


From: Sigurd Nes
Subject: [Fmsystem-commits] [11439] property: custom priorities
Date: Thu, 07 Nov 2013 19:35:14 +0000

Revision: 11439
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11439
Author:   sigurdne
Date:     2013-11-07 19:35:12 +0000 (Thu, 07 Nov 2013)
Log Message:
-----------
property: custom priorities

Modified Paths:
--------------
    trunk/property/inc/class.botts.inc.php
    trunk/property/inc/class.menu.inc.php
    trunk/property/inc/class.sogeneric.inc.php
    trunk/property/setup/default_records.inc.php
    trunk/property/setup/setup.inc.php
    trunk/property/setup/tables_current.inc.php
    trunk/property/setup/tables_update.inc.php
    trunk/property/templates/base/config.tpl

Property Changed:
----------------
    trunk/property/test_menu.php

Modified: trunk/property/inc/class.botts.inc.php
===================================================================
--- trunk/property/inc/class.botts.inc.php      2013-11-07 12:52:19 UTC (rev 
11438)
+++ trunk/property/inc/class.botts.inc.php      2013-11-07 19:35:12 UTC (rev 
11439)
@@ -451,29 +451,13 @@
                        return $status_text;
                }
 
-
-               function get_priority_list($selected='')
+               function get_priority_list($selected = 0)
                {
-
-                       $prioritylevels = 
isset($this->config->config_data['prioritylevels']) && 
$this->config->config_data['prioritylevels'] ? 
$this->config->config_data['prioritylevels'] : 3;
-
                        if(!$selected)
                        {
                                $selected = 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['prioritydefault'])
 ? $GLOBALS['phpgw_info']['user']['preferences']['property']['prioritydefault'] 
: $prioritylevels;
                        }
-
-                       $priority_comment[$prioritylevels]=' - '.lang('Lowest');
-                       //                      $priority_comment[2]=' - 
'.lang('Medium');
-                       $priority_comment[1]=' - '.lang('Highest');
-
-                       $priorities = array();
-                       for ($i=1; $i<= $prioritylevels; $i++)
-                       {
-                               $priorities[$i]['id'] =$i;
-                               $priorities[$i]['name'] =$i . 
(isset($priority_comment[$i])?$priority_comment[$i]:'');
-                       }
-
-                       return 
$this->bocommon->select_list($selected,$priorities);
+                       return execMethod('property.bogeneric.get_list', 
array('type' => 'ticket_priority', 'selected' => $selected) );
                }
 
                function get_category_name($cat_id)
@@ -901,8 +885,10 @@
                                $default_group = 0;
                        }
 
-                       $default_priority = 
isset($this->config->config_data['prioritylevels']) && 
$this->config->config_data['prioritylevels'] ? 
$this->config->config_data['prioritylevels'] : 3;
+                       $priority_list = $this->get_priority_list();
 
+                       $default_priority = 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['prioritydefault'])
 ? $GLOBALS['phpgw_info']['user']['preferences']['property']['prioritydefault'] 
: count($priority_list);
+
                        $ticket = array
                        (
                                'origin_id'                     => 
isset($data['origin_id']) ? $data['origin_id'] : null,

Modified: trunk/property/inc/class.menu.inc.php
===================================================================
--- trunk/property/inc/class.menu.inc.php       2013-11-07 12:52:19 UTC (rev 
11438)
+++ trunk/property/inc/class.menu.inc.php       2013-11-07 19:35:12 UTC (rev 
11439)
@@ -162,6 +162,11 @@
                                                        'text'  => lang('Ticket 
status'),
                                                        'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uigeneric.index', 'type' => 'ticket_status') )
                                                ),
+                                               'ticket_priority'       => array
+                                               (
+                                                       'text'  => lang('Ticket 
priority'),
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uigeneric.index', 'type' => 'ticket_priority') )
+                                               ),
                                                'ticket_config' => array
                                                (
                                                        'text'  => lang('ticket 
config'),

Modified: trunk/property/inc/class.sogeneric.inc.php
===================================================================
--- trunk/property/inc/class.sogeneric.inc.php  2013-11-07 12:52:19 UTC (rev 
11438)
+++ trunk/property/inc/class.sogeneric.inc.php  2013-11-07 19:35:12 UTC (rev 
11439)
@@ -1223,6 +1223,30 @@
                                        );
                                break;
 
+                       case 'ticket_priority':
+                               $_lang_priority = lang('priority');
+                               $info = array
+                                       (
+                                               'table'                         
=> 'fm_tts_priority',
+                                               'id'                            
=> array('name' => 'id', 'type' => 'int'),
+                                               'fields'                        
=> array
+                                               (
+                                                       array
+                                                       (
+                                                               'name' => 
'name',
+                                                               'descr' => 
lang('name'),
+                                                               'type' => 
'varchar'
+                                                       ),
+                                               ),
+                                               'edit_msg'                      
=> lang('edit') . ' ' . $_lang_priority,
+                                               'add_msg'                       
=> lang('add') . ' ' . $_lang_priority,
+                                               'name'                          
=> $_lang_priority,
+                                               'acl_app'                       
=> 'property',
+                                               'acl_location'          => 
'.admin',
+                                               'menu_selection'        => 
'admin::property::ticket::ticket_priority'
+                                       );
+                               break;
+
                                //-------- ID type varchar
                        case 'project_status':
                                $info = array
@@ -1965,7 +1989,7 @@
                                                ),
                                                'edit_msg'                      
=> lang('edit'),
                                                'add_msg'                       
=> lang('add'),
-                                               'name'                          
=> lang('event action'),
+                                               'name'                          
=> lang('ticket status'),
                                                'acl_app'                       
=> 'property',
                                                'acl_location'          => 
'.admin',
                                                'menu_selection'        => 
'admin::property::ticket::ticket_status'

Modified: trunk/property/setup/default_records.inc.php
===================================================================
--- trunk/property/setup/default_records.inc.php        2013-11-07 12:52:19 UTC 
(rev 11438)
+++ trunk/property/setup/default_records.inc.php        2013-11-07 19:35:12 UTC 
(rev 11439)
@@ -946,3 +946,7 @@
                $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
fm_ecodimb_role (id, name) VALUES (2, 'Attestant')",__LINE__,__FILE__);
                $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
fm_ecodimb_role (id, name) VALUES (3, 'Anviser')",__LINE__,__FILE__);
 
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
fm_tts_priority (id, name) VALUES (1, '1 - Highest')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
fm_tts_priority (id, name) VALUES (2, '2')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
fm_tts_priority (id, name) VALUES (3, '3 - Lowest')");
+

Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php  2013-11-07 12:52:19 UTC (rev 11438)
+++ trunk/property/setup/setup.inc.php  2013-11-07 19:35:12 UTC (rev 11439)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['property']['name']                 = 'property';
-       $setup_info['property']['version']              = '0.9.17.672';
+       $setup_info['property']['version']              = '0.9.17.673';
        $setup_info['property']['app_order']    = 8;
        $setup_info['property']['enable']               = 1;
        $setup_info['property']['app_group']    = 'office';
@@ -135,6 +135,7 @@
                'fm_project_history',
                'fm_project_budget',
                'fm_tts_status',
+               'fm_tts_priority',
                'fm_tts_tickets',
                'fm_tts_history',
                'fm_tts_views',

Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2013-11-07 12:52:19 UTC (rev 
11438)
+++ trunk/property/setup/tables_current.inc.php 2013-11-07 19:35:12 UTC (rev 
11439)
@@ -1009,6 +1009,16 @@
                        'ix' => array(),
                        'uc' => array()
                ),
+               'fm_tts_priority' => array(
+                       'fd' => array(
+                               'id' => array('type' => 'int','nullable' => 
False),
+                               'name' => array('type' => 'varchar','precision' 
=> '100','nullable' => true),
+                       ),
+                       'pk' => array('id'),
+                       'ix' => array(),
+                       'ix' => array(),
+                       'uc' => array()
+               ),
                'fm_tts_tickets' => array(
                        'fd' => array(
                                'id' => array('type' => 'auto','nullable' => 
False),

Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php  2013-11-07 12:52:19 UTC (rev 
11438)
+++ trunk/property/setup/tables_update.inc.php  2013-11-07 19:35:12 UTC (rev 
11439)
@@ -7738,3 +7738,49 @@
                }
        }
 
+       /**
+       * Update property version from 0.9.17.672 to 0.9.17.673
+       * Add configurable prioriy keys for tickets
+       */
+
+       $test[] = '0.9.17.672';
+       function property_upgrade0_9_17_672()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               $GLOBALS['phpgw_setup']->oProc->CreateTable(
+                       'fm_tts_priority', array(
+                               'fd' => array(
+                                       'id' => array('type' => 
'int','precision' => 4,'nullable' => False),
+                                       'name' => array('type' => 
'varchar','precision' => 100,'nullable' => true),
+                               ),
+                               'pk' => array('id'),
+                               'fk' => array(),
+                               'ix' => array(),
+                               'uc' => array()
+                       )
+               );
+
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT config_value FROM 
phpgw_config WHERE config_app = 'property' AND config_name = 'prioritylevels'");
+               $GLOBALS['phpgw_setup']->oProc->next_record();
+               $prioritylevels = 
$GLOBALS['phpgw_setup']->oProc->f('config_value');
+
+               $prioritylevels = $prioritylevels ? $prioritylevels : 3;
+
+               $priority_comment = array();
+               $priority_comment[$prioritylevels]      = " - Lowest";
+               $priority_comment[1]                            = " - Highest";
+
+               for ($i=1; $i<= $prioritylevels; $i++)
+               {
+                       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
fm_tts_priority (id, name) VALUES ({$i}, '{$i}{$priority_comment[$i]}')");
+               }
+
+               $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM phpgw_config 
WHERE config_app = 'property' AND config_name = 'prioritylevels'");
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.673';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }

Modified: trunk/property/templates/base/config.tpl
===================================================================
--- trunk/property/templates/base/config.tpl    2013-11-07 12:52:19 UTC (rev 
11438)
+++ trunk/property/templates/base/config.tpl    2013-11-07 19:35:12 UTC (rev 
11439)
@@ -339,16 +339,6 @@
                                </select>
                        </td>
                </tr>
-               <tr class="row_on">
-                       <td>{lang_priority_levels_TTS}.</td>
-                       <td>
-                               <select name="newsettings[prioritylevels]">
-                                       <option value="" 
{selected_prioritylevels_}>3</option>
-                                       <option value="4" 
{selected_prioritylevels_4}>4</option>
-                                       <option value="5" 
{selected_prioritylevels_5}>5</option>
-                               </select>
-                       </td>
-               </tr>
                <tr class="row_off">
                        <td>{lang_mandatory_title_TTS}.</td>
                        <td>


Property changes on: trunk/property/test_menu.php
___________________________________________________________________
Added: svn:keywords
   + Revision Author Id




reply via email to

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