fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15838] admin custom fields


From: sigurdne
Subject: [Fmsystem-commits] [15838] admin custom fields
Date: Mon, 17 Oct 2016 08:23:30 +0000 (UTC)

Revision: 15838
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15838
Author:   sigurdne
Date:     2016-10-17 08:23:29 +0000 (Mon, 17 Oct 2016)
Log Message:
-----------
admin custom fields

Modified Paths:
--------------
    trunk/admin/inc/class.ui_custom.inc.php
    trunk/admin/templates/base/custom.xsl
    trunk/phpgwapi/templates/base/datatable_jquery.xsl
    trunk/property/templates/base/admin_entity.xsl

Added Paths:
-----------
    trunk/admin/js/base/ui_custom.list_attribute_group.js

Modified: trunk/admin/inc/class.ui_custom.inc.php
===================================================================
--- trunk/admin/inc/class.ui_custom.inc.php     2016-10-17 08:22:39 UTC (rev 
15837)
+++ trunk/admin/inc/class.ui_custom.inc.php     2016-10-17 08:23:29 UTC (rev 
15838)
@@ -920,6 +920,11 @@
                                                                'name'   => 
'location',
                                                                'text'   => 
lang('location'),
                                                                'list'   => 
$location_list,
+                                                       ),
+                                                       array('type'     => 
'hidden',
+                                                               'id'     => 
'appname',
+                                                               'name'   => 
'appname',
+                                                               'value'  => 
$this->appname,
                                                        )
                                                )
                                        )
@@ -931,10 +936,10 @@
                                                'phpgw_return_as'        => 
'json'
                                        )),
                                        'allrows'                => true,
-                                       'new_item' => self::link(array(
+                                       'new_item' => array('onclick' => 
'onNew_group()'),/*self::link(array(
                                                                        
'menuaction' => 'admin.ui_custom.edit_attrib_group',
                                                                        
'appname'        => $this->appname,
-                                                                       
'menu_selection'         => $this->menu_selection)),
+                                                                       
'menu_selection'         => $this->menu_selection)),*/
                                        'editor_action'  => '',
                                        'field'                  => array(
                                                array(
@@ -953,7 +958,7 @@
                                                        'sortable'       => true
                                                ),
                                                array(
-                                                       'key'            => 
'text',
+                                                       'key'            => 
'descr',
                                                        'label'          => 
lang('Descr'),
                                                        'sortable'       => 
false
                                                ),
@@ -1097,6 +1102,8 @@
 
                        unset($parameters);
                        unset($parameters2);
+                       self::add_javascript('admin', 'base', 
'ui_custom.list_attribute_group.js');
+
                        self::render_template_xsl('datatable_jquery', $data);
                }
 

Added: trunk/admin/js/base/ui_custom.list_attribute_group.js
===================================================================
--- trunk/admin/js/base/ui_custom.list_attribute_group.js                       
        (rev 0)
+++ trunk/admin/js/base/ui_custom.list_attribute_group.js       2016-10-17 
08:23:29 UTC (rev 15838)
@@ -0,0 +1,11 @@
+function onNew_group()
+{
+       var oArgs = {
+               menuaction: 'admin.ui_custom.edit_attrib_group',
+               appname: document.getElementById('appname').value,
+               location: document.getElementById('location').value
+       };
+       var sUrl = phpGWLink('index.php', oArgs);
+       window.location = sUrl;
+}
+

Modified: trunk/admin/templates/base/custom.xsl
===================================================================
--- trunk/admin/templates/base/custom.xsl       2016-10-17 08:22:39 UTC (rev 
15837)
+++ trunk/admin/templates/base/custom.xsl       2016-10-17 08:23:29 UTC (rev 
15838)
@@ -570,12 +570,12 @@
                                                                <xsl:value-of 
select="php:function('lang', 'get single function input')"/>
                                                        </td>
                                                        <td>
-                                                       <textarea cols="60" 
rows="10" name="values[get_single_function_input]">
-                                                               <xsl:attribute 
name="title">
-                                                                       
<xsl:text>parameter1 = value1, parameter2 = value2...</xsl:text>
-                                                               </xsl:attribute>
-                                                               <xsl:value-of 
select="value_get_single_function_input"/>
-                                                       </textarea>
+                                                               <textarea 
cols="60" rows="10" name="values[get_single_function_input]">
+                                                                       
<xsl:attribute name="title">
+                                                                               
<xsl:text>parameter1 = value1, parameter2 = value2...</xsl:text>
+                                                                       
</xsl:attribute>
+                                                                       
<xsl:value-of select="value_get_single_function_input"/>
+                                                               </textarea>
                                                        </td>
                                                </tr>
                                        </xsl:when>
@@ -1173,74 +1173,70 @@
 
 <xsl:template name="choice" xmlns:php="http://php.net/xsl";>
        <table class="pure-table pure-table-bordered" border="0" 
cellspacing="2" cellpadding="2">
-               <xsl:choose>
-                       <xsl:when test="value_choice!=''">
-                               <thead>
-                               <tr>
-                                       <th width="5%" align="left">
-                                               <xsl:value-of 
select="php:function('lang', 'id')" />
-                                       </th>
-                                       <th width="40%" align="left">
-                                               <xsl:value-of 
select="php:function('lang', 'value')" />
-                                       </th>
-                                       <th  width="40%" align="left">
-                                               <xsl:value-of 
select="php:function('lang', 'title')" />
-                                       </th>
-                                       <th width="5%" align="left">
-                                               <xsl:value-of 
select="php:function('lang', 'order')" />
-                                       </th>
-                                       <th width="10%" align="center">
-                                               <xsl:value-of 
select="lang_delete_value"/>
-                                       </th>
-                               </tr>
-                               </thead>
-                               <xsl:for-each select="value_choice" >
-                                       <tr>
-                                               <xsl:attribute name="class">
-                                                       <xsl:choose>
-                                                               <xsl:when 
test="@class">
-                                                                       
<xsl:value-of select="@class"/>
-                                                               </xsl:when>
-                                                               <xsl:when 
test="position() mod 2 != 0">
-                                                                       
<xsl:text>pure-table-odd</xsl:text>
-                                                               </xsl:when>
-                                                       </xsl:choose>
+               <thead>
+                       <tr>
+                               <th width="5%" align="left">
+                                       <xsl:value-of 
select="php:function('lang', 'id')" />
+                               </th>
+                               <th width="40%" align="left">
+                                       <xsl:value-of 
select="php:function('lang', 'value')" />
+                               </th>
+                               <th  width="40%" align="left">
+                                       <xsl:value-of 
select="php:function('lang', 'title')" />
+                               </th>
+                               <th width="5%" align="left">
+                                       <xsl:value-of 
select="php:function('lang', 'order')" />
+                               </th>
+                               <th width="10%" align="center">
+                                       <xsl:value-of 
select="lang_delete_value"/>
+                               </th>
+                       </tr>
+               </thead>
+               <xsl:for-each select="value_choice" >
+                       <tr>
+                               <xsl:attribute name="class">
+                                       <xsl:choose>
+                                               <xsl:when test="@class">
+                                                       <xsl:value-of 
select="@class"/>
+                                               </xsl:when>
+                                               <xsl:when test="position() mod 
2 != 0">
+                                                       
<xsl:text>pure-table-odd</xsl:text>
+                                               </xsl:when>
+                                       </xsl:choose>
+                               </xsl:attribute>
+                               <td align="left">
+                                       <xsl:value-of select="id"/>
+                               </td>
+                               <td align="left">
+                                       <input type="textbox" 
name="values[edit_choice][{id}]" value="{value}" size='15'>
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="php:function('lang', 'value')" />
                                                </xsl:attribute>
-                                               <td align="left">
-                                                       <xsl:value-of 
select="id"/>
-                                               </td>
-                                               <td align="left">
-                                                       <input type="textbox" 
name="values[edit_choice][{id}]" value="{value}" size='15'>
-                                                               <xsl:attribute 
name="title">
-                                                                       
<xsl:value-of select="php:function('lang', 'value')" />
-                                                               </xsl:attribute>
-                                                       </input>
-                                               </td>
-                                               <td align="left">
-                                                       <input type="textbox" 
name="values[title_choice][{id}]" value="{title}" size='15'>
-                                                               <xsl:attribute 
name="title">
-                                                                       
<xsl:value-of select="php:function('lang', 'value')" />
-                                                               </xsl:attribute>
-                                                       </input>
-                                               </td>
-                                               <td align="center">
-                                                       <input type="textbox" 
name="values[order_choice][{id}]" value="{order}" size='4'>
-                                                               <xsl:attribute 
name="title">
-                                                                       
<xsl:value-of select="php:function('lang', 'order')" />
-                                                               </xsl:attribute>
-                                                       </input>
-                                               </td>
-                                               <td align="center">
-                                                       <input type="checkbox" 
name="values[delete_choice][]" value="{id}">
-                                                               <xsl:attribute 
name="title">
-                                                                       
<xsl:value-of select="//lang_delete_choice_statustext"/>
-                                                               </xsl:attribute>
-                                                       </input>
-                                               </td>
-                                       </tr>
-                               </xsl:for-each>
-                       </xsl:when>
-               </xsl:choose>
+                                       </input>
+                               </td>
+                               <td align="left">
+                                       <input type="textbox" 
name="values[title_choice][{id}]" value="{title}" size='15'>
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="php:function('lang', 'value')" />
+                                               </xsl:attribute>
+                                       </input>
+                               </td>
+                               <td align="center">
+                                       <input type="textbox" 
name="values[order_choice][{id}]" value="{order}" size='4'>
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="php:function('lang', 'order')" />
+                                               </xsl:attribute>
+                                       </input>
+                               </td>
+                               <td align="center">
+                                       <input type="checkbox" 
name="values[delete_choice][]" value="{id}">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="//lang_delete_choice_statustext"/>
+                                               </xsl:attribute>
+                                       </input>
+                               </td>
+                       </tr>
+               </xsl:for-each>
                <tr>
                        <td valign="top">
                                <input type="text" name="values[new_choice_id]" 
size = '3'>
@@ -1263,6 +1259,10 @@
                                        </xsl:attribute>
                                </input>
                        </td>
+                       <td>
+                       </td>
+                       <td>
+                       </td>
                </tr>
        </table>
 </xsl:template>

Modified: trunk/phpgwapi/templates/base/datatable_jquery.xsl
===================================================================
--- trunk/phpgwapi/templates/base/datatable_jquery.xsl  2016-10-17 08:22:39 UTC 
(rev 15837)
+++ trunk/phpgwapi/templates/base/datatable_jquery.xsl  2016-10-17 08:23:29 UTC 
(rev 15838)
@@ -619,15 +619,27 @@
                                //},
                                <xsl:choose>
                                        <xsl:when test="new_item">
-                                               {
-                                               text: "<xsl:value-of 
select="php:function('lang', 'new')"/>",
-                                               sUrl: '<xsl:value-of 
select="new_item"/>',
+                                               <xsl:choose>
+                                                       <xsl:when 
test="new_item/onclick">
+                                                       {
+                                                               text: 
"<xsl:value-of select="php:function('lang', 'new')"/>",
+                                                               action: 
function (e, dt, node, config) {
+                                                                       
<xsl:value-of select="new_item/onclick"/>;
+                                                               }
+                                                       },
+                                                       </xsl:when>
+                                                       <xsl:otherwise>
+                                                       {
+                                                               text: 
"<xsl:value-of select="php:function('lang', 'new')"/>",
+                                                               sUrl: 
'<xsl:value-of select="new_item"/>',
 
-                                               action: function (e, dt, node, 
config) {
-                                               var sUrl = config.sUrl;
-                                               window.open(sUrl, '_self');
-                                               }
-                                               },
+                                                               action: 
function (e, dt, node, config) {
+                                                                       var 
sUrl = config.sUrl;
+                                                                       
window.open(sUrl, '_self');
+                                                               }
+                                                       },
+                                                       </xsl:otherwise>
+                                               </xsl:choose>
                                        </xsl:when>
                                </xsl:choose>
                                <xsl:choose>

Modified: trunk/property/templates/base/admin_entity.xsl
===================================================================
--- trunk/property/templates/base/admin_entity.xsl      2016-10-17 08:22:39 UTC 
(rev 15837)
+++ trunk/property/templates/base/admin_entity.xsl      2016-10-17 08:23:29 UTC 
(rev 15838)
@@ -2135,6 +2135,9 @@
        <xsl:variable name="lang_value">
                <xsl:value-of select="php:function('lang', 'value')"/>
        </xsl:variable>
+       <xsl:variable name="lang_title">
+               <xsl:value-of select="php:function('lang', 'title')"/>
+       </xsl:variable>
        <xsl:variable name="lang_sorting">
                <xsl:value-of select="php:function('lang', 'sorting')"/>
        </xsl:variable>
@@ -2145,69 +2148,71 @@
                <xsl:value-of select="php:function('lang', 'delete this value 
from the list of multiple choice')"/>
        </xsl:variable>
        <table class="pure-table pure-table-bordered">
-               <xsl:choose>
-                       <xsl:when test="value_choice!=''">
-                               <tr class="th">
-                                       <td class="th_text" width="5%" 
align="left">
-                                               <xsl:value-of 
select="$lang_id"/>
-                                       </td>
-                                       <td class="th_text" width="85%" 
align="left">
-                                               <xsl:value-of 
select="$lang_value"/>
-                                       </td>
-                                       <td class="th_text" width="85%" 
align="left">
-                                               <xsl:value-of 
select="$lang_sorting"/>
-                                       </td>
-                                       <td class="th_text" width="15%" 
align="center">
-                                               <xsl:value-of 
select="$lang_delete_value"/>
-                                       </td>
-                               </tr>
-                               <xsl:for-each select="value_choice">
-                                       <tr>
-                                               <xsl:attribute name="class">
-                                                       <xsl:choose>
-                                                               <xsl:when 
test="@class">
-                                                                       
<xsl:value-of select="@class"/>
-                                                               </xsl:when>
-                                                               <xsl:when 
test="position() mod 2 = 0">
-                                                                       
<xsl:text>row_off</xsl:text>
-                                                               </xsl:when>
-                                                               <xsl:otherwise>
-                                                                       
<xsl:text>row_on</xsl:text>
-                                                               </xsl:otherwise>
-                                                       </xsl:choose>
+               <thead>
+                       <tr>
+                               <th width="5%" align="left">
+                                       <xsl:value-of select="$lang_id"/>
+                               </th>
+                               <th width="40%" align="left">
+                                       <xsl:value-of select="$lang_value"/>
+                               </th>
+                               <th  width="40%" align="left">
+                                       <xsl:value-of select="$lang_title"/>
+                               </th>
+                               <th width="5%" align="left">
+                                       <xsl:value-of select="$lang_sorting"/>
+                               </th>
+                               <th width="10%" align="center">
+                                       <xsl:value-of 
select="$lang_delete_value"/>
+                               </th>
+                       </tr>
+               </thead>
+               <xsl:for-each select="value_choice">
+                       <tr>
+                               <xsl:attribute name="class">
+                                       <xsl:choose>
+                                               <xsl:when test="@class">
+                                                       <xsl:value-of 
select="@class"/>
+                                               </xsl:when>
+                                               <xsl:when test="position() mod 
2 != 0">
+                                                       
<xsl:text>pure-table-odd</xsl:text>
+                                               </xsl:when>
+                                       </xsl:choose>
+                               </xsl:attribute>
+                               <td align="left">
+                                       <xsl:value-of select="id"/>
+                               </td>
+                               <td align="left">
+                                       <input type="textbox" 
name="values[edit_choice][{id}]" value="{value}" size="15">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="$lang_value"/>
                                                </xsl:attribute>
-                                               <td align="left">
-                                                       <xsl:value-of 
select="id"/>
-                                               </td>
-                                               <td align="left">
-                                                       <input type="textbox" 
name="values[edit_choice][{id}]" value="{value}" size="15">
-                                                               <xsl:attribute 
name="title">
-                                                                       
<xsl:value-of select="$lang_value"/>
-                                                               </xsl:attribute>
-                                                       </input>
-                                               </td>
-                                               <td align="center">
-                                                       <input type="textbox" 
name="values[order_choice][{id}]" value="{order}" size="4">
-                                                               <xsl:attribute 
name="title">
-                                                                       
<xsl:value-of select="$lang_sorting"/>
-                                                               </xsl:attribute>
-                                                       </input>
-                                               </td>
-                                               <td align="center">
-                                                       <input type="checkbox" 
name="values[delete_choice][]" value="{id}">
-                                                               <xsl:attribute 
name="title">
-                                                                       
<xsl:value-of select="$lang_delete_title"/>
-                                                               </xsl:attribute>
-                                                       </input>
-                                               </td>
-                                       </tr>
-                               </xsl:for-each>
-                       </xsl:when>
-               </xsl:choose>
+                                       </input>
+                               </td>
+                               <td align="left">
+                                       <input type="textbox" 
name="values[title_choice][{id}]" value="{title}" size='15'>
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="php:function('lang', 'value')" />
+                                               </xsl:attribute>
+                                       </input>
+                               </td>
+                               <td align="center">
+                                       <input type="textbox" 
name="values[order_choice][{id}]" value="{order}" size="4">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="$lang_sorting"/>
+                                               </xsl:attribute>
+                                       </input>
+                               </td>
+                               <td align="center">
+                                       <input type="checkbox" 
name="values[delete_choice][]" value="{id}">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="$lang_delete_title"/>
+                                               </xsl:attribute>
+                                       </input>
+                               </td>
+                       </tr>
+               </xsl:for-each>
                <tr>
-                       <td valign="top" colspan="2">
-                               <xsl:value-of select="php:function('lang', 'new 
value')"/>
-                       </td>
                        <td valign="top">
                                <input type="text" name="values[new_choice_id]" 
size = '3'>
                                        <xsl:attribute name="title">
@@ -2222,6 +2227,17 @@
                                        </xsl:attribute>
                                </input>
                        </td>
+                       <td valign="top">
+                               <input type="text" 
name="values[new_title_choice]">
+                                       <xsl:attribute name="title">
+                                               <xsl:value-of 
select="php:function('lang', 'title')" />
+                                       </xsl:attribute>
+                               </input>
+                       </td>
+                       <td>
+                       </td>
+                       <td>
+                       </td>
                </tr>
        </table>
 </xsl:template>




reply via email to

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