fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7229] property: more on custom menues


From: Sigurd Nes
Subject: [Fmsystem-commits] [7229] property: more on custom menues
Date: Fri, 15 Apr 2011 16:55:23 +0000

Revision: 7229
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7229
Author:   sigurdne
Date:     2011-04-15 16:55:22 +0000 (Fri, 15 Apr 2011)
Log Message:
-----------
property: more on custom menues

Modified Paths:
--------------
    trunk/phpgwapi/templates/portico/navbar.inc.php
    trunk/property/inc/class.menu.inc.php
    trunk/property/inc/class.sogeneric.inc.php
    trunk/property/inc/class.uigeneric.inc.php
    trunk/property/setup/setup.inc.php
    trunk/property/setup/tables_current.inc.php
    trunk/property/setup/tables_update.inc.php

Modified: trunk/phpgwapi/templates/portico/navbar.inc.php
===================================================================
--- trunk/phpgwapi/templates/portico/navbar.inc.php     2011-04-15 13:43:54 UTC 
(rev 7228)
+++ trunk/phpgwapi/templates/portico/navbar.inc.php     2011-04-15 16:55:22 UTC 
(rev 7229)
@@ -225,6 +225,11 @@
                {
                        $target = "target = '{$item['target']}'";
                }
+               if(isset($item['local_files']) && $item['local_files'])
+               {
+                       $item['url'] = 'file:///' . 
str_replace(':','|',$item['url']);
+               }
+
                return <<<HTML
 $out
                                        <a 
href="{$item['url']}"{$link_class}{$icon_style} id="{$id}" {$target}>

Modified: trunk/property/inc/class.menu.inc.php
===================================================================
--- trunk/property/inc/class.menu.inc.php       2011-04-15 13:43:54 UTC (rev 
7228)
+++ trunk/property/inc/class.menu.inc.php       2011-04-15 16:55:22 UTC (rev 
7229)
@@ -932,15 +932,12 @@
                                $custom_menu_items= 
$custom_menus->read(array('type' => 'custom_menu_items' , 'filter' => 
array('location' => '.document')));
                                foreach($custom_menu_items as $item)
                                {
-                                       if($item['local_files'])
-                                       {
-                                               $item['url'] = 'file:///' . 
str_replace(':','|',$item['url']);
-                                       }
                                        
$menus['navigation']['documentation']['children'][] = array
                                                (
-                                                       'url'   => $item['url'],
-                                                       'text'  => 
$item['name'],
-                                                       'target'=> '_blank'
+                                                       'url'                   
=> $item['url'],
+                                                       'text'                  
=> $item['text'],
+                                                       'target'                
=> $item['target'] ? $item['target']: '_blank',
+                                                       'local_files'   => 
$item['local_files']
                                                );
                                }
                        }
@@ -973,14 +970,14 @@
                                                        
$menus['navigation']["entity_{$entry['id']}"]['children'] = 
$entity->read_category_tree($entry['id'],'property.uientity.index', 
PHPGW_ACL_READ);
                                                }
 
-/*
+
                                                $custom_menu_items= 
$custom_menus->read_tree(array('type' => 'custom_menu_items' , 'filter' => 
array('location' => ".entity.{$entry['id']}")));
 
                                                if($custom_menu_items)
                                                {
-                                                       
$menus['navigation']["entity_{$entry['id']}"]['children'][] = 
$custom_menu_items;
+                                                       
$menus['navigation']["entity_{$entry['id']}"]['children'] =  
array_merge($menus['navigation']["entity_{$entry['id']}"]['children'], 
$custom_menu_items);
                                                }
-*/
+
 /*
                                                foreach($custom_menu_items as 
$item)
                                                {

Modified: trunk/property/inc/class.sogeneric.inc.php
===================================================================
--- trunk/property/inc/class.sogeneric.inc.php  2011-04-15 13:43:54 UTC (rev 
7228)
+++ trunk/property/inc/class.sogeneric.inc.php  2011-04-15 16:55:22 UTC (rev 
7229)
@@ -1891,7 +1891,7 @@
                                                        ),
                                                        array
                                                        (
-                                                               'name' => 
'name',
+                                                               'name' => 
'text',
                                                                'descr' => 
lang('name'),
                                                                'type' => 
'varchar'
                                                        ),
@@ -1903,6 +1903,17 @@
                                                        ),
                                                        array
                                                        (
+                                                               'name'          
        => 'target',
+                                                               'descr'         
        => lang('target'),
+                                                               'type'          
        => 'select',
+                                                               'filter'        
        => false,
+                                                               'values_def'    
=> array
+                                                               (
+                                                                       
'valueset'              => array( array('id' => '_blank', 'name' => 
'_blank'),array('id' => '_parent', 'name' => '_parent') ),
+                                                               )
+                                                       ),
+                                                       array
+                                                       (
                                                                'name'          
        => 'location',
                                                                'descr'         
        => lang('location'),
                                                                'type'          
        => 'select',
@@ -2535,7 +2546,7 @@
                        {
                                return $this->tree;
                        }
-                       $sql = "SELECT * FROM {$table} WHERE parent_id = 
{$parent} ORDER BY name ASC";
+                       $sql = "SELECT * FROM {$table} WHERE parent_id = 
{$parent}";
                        $db->query($sql,__LINE__,__FILE__);
 
                        while ($db->next_record())
@@ -2576,7 +2587,7 @@
 
                        $filtermthod = 'WHERE parent_id = ' . (int)$parent;
 
-                       $sql = "SELECT * FROM {$table} {$filtermthod} ORDER BY 
name ASC";
+                       $sql = "SELECT * FROM {$table} {$filtermthod}";
                        $this->_db2->query($sql,__LINE__,__FILE__);
 
                        $fields = array(0 => 'id');

Modified: trunk/property/inc/class.uigeneric.inc.php
===================================================================
--- trunk/property/inc/class.uigeneric.inc.php  2011-04-15 13:43:54 UTC (rev 
7228)
+++ trunk/property/inc/class.uigeneric.inc.php  2011-04-15 16:55:22 UTC (rev 
7229)
@@ -772,10 +772,13 @@
                                $field['value'] =       
isset($values[$field['name']]) ? $values[$field['name']] : '';
                                if(isset($field['values_def']))
                                {
-                                       if($field['values_def']['valueset'])
+                                       if($field['values_def']['valueset'] && 
is_array($field['values_def']['valueset']))
                                        {
                                                $field['valueset'] = 
$field['values_def']['valueset'];
-                                               // TODO find selected value
+                                               foreach($field['valueset'] as 
&$_entry)
+                                               {
+                                                       $_entry['selected'] = 
$_entry['id'] == $field['value'] ? 1 : 0;
+                                               }
                                        }
                                        else 
if(isset($field['values_def']['method']))
                                        {

Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php  2011-04-15 13:43:54 UTC (rev 7228)
+++ trunk/property/setup/setup.inc.php  2011-04-15 16:55:22 UTC (rev 7229)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['property']['name']                 = 'property';
-       $setup_info['property']['version']              = '0.9.17.616';
+       $setup_info['property']['version']              = '0.9.17.617';
        $setup_info['property']['app_order']    = 8;
        $setup_info['property']['enable']               = 1;
        $setup_info['property']['app_group']    = 'office';

Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2011-04-15 13:43:54 UTC (rev 
7228)
+++ trunk/property/setup/tables_current.inc.php 2011-04-15 16:55:22 UTC (rev 
7229)
@@ -2221,8 +2221,9 @@
                        'fd' => array(
                                'id' => array('type' => 'auto', 'precision' => 
4,'nullable' => False),
                                'parent_id' => array('type' => 
'int','precision' => '4','nullable' => True),
-                               'name' => array('type' => 'varchar', 
'precision' => 200,'nullable' => False),
+                               'text' => array('type' => 'varchar', 
'precision' => 200,'nullable' => False),
                                'url' => array('type' => 'text','nullable' => 
True),
+                               'target' =>  array('type' => 
'varchar','precision' => '15','nullable' => True),
                                'location' => array('type' => 'varchar', 
'precision' => 200,'nullable' => False),
                                'local_files' => array('type' => 'int', 
'precision' => 2,'nullable' => true),
                                'user_id' => array('type' => 'int', 'precision' 
=> 4,'nullable' => True),

Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php  2011-04-15 13:43:54 UTC (rev 
7228)
+++ trunk/property/setup/tables_update.inc.php  2011-04-15 16:55:22 UTC (rev 
7229)
@@ -5221,7 +5221,28 @@
                }
        }
 
+       /**
+       * Update property version from 0.9.17.616 to 0.9.17.617
+       * rename field, add customized url-target
+       * 
+       */
 
+       $test[] = '0.9.17.616';
+       function property_upgrade0_9_17_616()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               
$GLOBALS['phpgw_setup']->oProc->RenameColumn('fm_custom_menu_items','name','text');
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_custom_menu_items','target', 
array('type' => 'varchar','precision' => '15','nullable' => True));
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.617';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }
+
+
        /**
        * Update property version from 0.9.17.607 to 0.9.17.608
        * Add more room for address at tickets




reply via email to

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