fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15268] logistic: alter redirekt and buttons for new


From: sigurdne
Subject: [Fmsystem-commits] [15268] logistic: alter redirekt and buttons for new items
Date: Wed, 8 Jun 2016 12:15:06 +0000 (UTC)

Revision: 15268
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15268
Author:   sigurdne
Date:     2016-06-08 12:15:05 +0000 (Wed, 08 Jun 2016)
Log Message:
-----------
logistic: alter redirekt and buttons for new items

Modified Paths:
--------------
    trunk/logistic/inc/class.uiactivity.inc.php
    trunk/logistic/inc/class.uiproject.inc.php
    trunk/logistic/templates/base/activity/add_activity_item.xsl
    trunk/logistic/templates/base/project/project_type_item.xsl

Modified: trunk/logistic/inc/class.uiactivity.inc.php
===================================================================
--- trunk/logistic/inc/class.uiactivity.inc.php 2016-06-08 12:13:30 UTC (rev 
15267)
+++ trunk/logistic/inc/class.uiactivity.inc.php 2016-06-08 12:15:05 UTC (rev 
15268)
@@ -103,20 +103,15 @@
                                                                'name' => 
'user',
                                                                'text' => 
lang('Responsible user') . ':',
                                                                'list' => 
$user_array,
-                                                       ),
-                                                       array(
-                                                               'type' => 
'link',
-                                                               'value' => 
lang('Add activity'),
-                                                               'href' => 
self::link(array('menuaction' => 'logistic.uiactivity.add')),
-                                                               'class' => 
'new_item'
-                                                       ),
-                                               ),
-                                       ),
+                                                       )
+                                               )
+                                       )
                                ),
                                'datatable' => array(
                                        'source' => 
self::link(array('menuaction' => 'logistic.uiactivity.index', 'phpgw_return_as' 
=> 'json',
                                                'filter' => 
phpgw::get_var('filter', 'int'))),
                                        'allrows' => true,
+                                       'new_item' => 
self::link(array('menuaction' => 'logistic.uiactivity.add')),
                                        'field' => array(
                                                array(
                                                        'key' => 'id',

Modified: trunk/logistic/inc/class.uiproject.inc.php
===================================================================
--- trunk/logistic/inc/class.uiproject.inc.php  2016-06-08 12:13:30 UTC (rev 
15267)
+++ trunk/logistic/inc/class.uiproject.inc.php  2016-06-08 12:15:05 UTC (rev 
15268)
@@ -142,6 +142,8 @@
                                        $project = $result->serialize();
                                        $href = self::link(array('menuaction' 
=> 'logistic.uiactivity.edit', 'project_id' => $project['id']));
                                        $project['add_activity_link'] = "<a 
class=\"btn-sm delete\" href=\"{$href}\">Legg til aktivitet</a>";
+                                       $href_view = 
self::link(array('menuaction' => 'logistic.uiactivity.index', 'project_id' => 
$project['id']));
+                                       $project['view_activity_link'] = "<a 
class=\"btn-sm delete\" href=\"{$href_view}\">Vis aktiviteter</a>";
                                        $rows[] = $project;
                                }
                        }
@@ -192,20 +194,15 @@
                                                                'name' => 
'project_type',
                                                                'text' => 
lang('Project_type') . ':',
                                                                'list' => 
$project_type_array,
-                                                       ),
-                                                       array(
-                                                               'type' => 
'link',
-                                                               'value' => 
lang('t_new_project'),
-                                                               'href' => 
self::link(array('menuaction' => 'logistic.uiproject.add')),
-                                                               'class' => 
'new_item'
-                                                       ),
-                                               ),
-                                       ),
+                                                       )
+                                               )
+                                       )
                                ),
                                'datatable' => array(
                                        'source' => 
self::link(array('menuaction' => 'logistic.uiproject.index', 'phpgw_return_as' 
=> 'json')),
                                        'allrows' => true,
                                        'editor_action' => 
self::link(array('menuaction' => 'logistic.uiproject.edit_project_name')),
+                                       'new_item' => 
self::link(array('menuaction' => 'logistic.uiproject.add')),
                                        'field' => array(
                                                array(
                                                        'key' => 'id',
@@ -245,6 +242,11 @@
                                                        'sortable' => false
                                                ),
                                                array(
+                                                       'key' => 
'view_activity_link',
+                                                       'label' => lang('view 
activities'),
+                                                       'sortable' => false
+                                               ),
+                                               array(
                                                        'key' => 'link',
                                                        'hidden' => true
                                                )
@@ -302,29 +304,15 @@
                                        'form' => array(
                                                'toolbar' => array(
                                                        'item' => array(
-                                                               array('type' => 
'text',
-                                                                       'text' 
=> lang('search'),
-                                                                       'name' 
=> 'query'
-                                                               ),
-                                                               array(
-                                                                       'type' 
=> 'submit',
-                                                                       'name' 
=> 'search',
-                                                                       'value' 
=> lang('Search')
-                                                               ),
-                                                               array(
-                                                                       'type' 
=> 'link',
-                                                                       'value' 
=> lang('t_new_project_type'),
-                                                                       'href' 
=> self::link(array('menuaction' => 'logistic.uiproject.project_types',
-                                                                               
'new_type' => 'yes')),
-                                                                       'class' 
=> 'new_item'
-                                                               ),
-                                                       ),
-                                               ),
+                                                       )
+                                               )
                                        ),
                                        'datatable' => array(
                                                'source' => 
self::link(array('menuaction' => 'logistic.uiproject.project_types',
                                                        'phpgw_return_as' => 
'json', 'type' => 'project_type')),
                                                'editor_action' => 
self::link(array('menuaction' => 'logistic.uiproject.edit_project_type_name')),
+                                               'new_item' => 
self::link(array('menuaction' => 'logistic.uiproject.project_types',
+                                                                               
'new_type' => 'yes')),
                                                'field' => array(
                                                        array(
                                                                'key' => 'id',
@@ -346,6 +334,29 @@
                                        ),
                                );
 
+                               $parameters = array(
+                                       'parameter' => array(
+                                               array(
+                                                       'name' => 'id',
+                                                       'source' => 'id'
+                                               )
+                                       )
+                               );
+
+                               if ($this->acl_read)
+                               {
+                                       $data['datatable']['actions'][] = array
+                                               (
+                                               'my_name' => 'view',
+                                               'statustext' => lang('view'),
+                                               'text' => lang('view'),
+                                               'action' => 
$GLOBALS['phpgw']->link('/index.php', array(
+                                                       'menuaction' => 
'logistic.uiproject.edit_project_type'
+                                               )),
+                                               'parameters' => 
json_encode($parameters)
+                                       );
+                               }
+
                                
self::render_template_xsl(array('datatable_jquery'), $data);
                        }
                }
@@ -390,6 +401,10 @@
                                $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'logistic.uiproject.edit_project_type',
                                        'id' => $project_type_id));
                        }
+                       else if (isset($_POST['cancel_project_type']))
+                       {
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'logistic.uiproject.project_types'));
+                       }
                        else
                        {
                                if ($project_type_id && 
is_numeric($project_type_id))
@@ -402,8 +417,7 @@
                                                $project = $objects[$keys[0]];
                                        }
                                }
-                               $data = array
-                                       (
+                               $data = array(
                                        'project' => $project
                                );
 
@@ -446,13 +460,11 @@
                        }
                        else if (isset($_POST['cancel_project_type']))
                        {
-                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'logistic.uiproject.view_project_type',
-                                       'id' => $project_type_id));
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'logistic.uiproject.project_types'));
                        }
                        else
                        {
-                               $data = array
-                                       (
+                               $data = array(
                                        'project' => $project,
                                        'editable' => true
                                );

Modified: trunk/logistic/templates/base/activity/add_activity_item.xsl
===================================================================
--- trunk/logistic/templates/base/activity/add_activity_item.xsl        
2016-06-08 12:13:30 UTC (rev 15267)
+++ trunk/logistic/templates/base/activity/add_activity_item.xsl        
2016-06-08 12:15:05 UTC (rev 15268)
@@ -350,7 +350,7 @@
        <form name="cancel_form" id="cancel_form" action="{$cancel_url}" 
method="post">
        </form>
 
-       <xsl:call-template name="jquery_phpgw_i18n"/>
+       <!--xsl:call-template name="jquery_phpgw_i18n"/-->
 
 </xsl:template>
 

Modified: trunk/logistic/templates/base/project/project_type_item.xsl
===================================================================
--- trunk/logistic/templates/base/project/project_type_item.xsl 2016-06-08 
12:13:30 UTC (rev 15267)
+++ trunk/logistic/templates/base/project/project_type_item.xsl 2016-06-08 
12:15:05 UTC (rev 15268)
@@ -7,7 +7,7 @@
        <h1>Prosjekttype</h1>
                <div style="padding:20px;" class="content-wrp">
                        <form action="#" method="post">
-                               <input type="hidden" name="id" value = 
"{value_id}">
+                               <input type="hidden" name="id" value = 
"{project/id}">
                                </input>
                                <dl class="proplist-col">
                                        <dt>
@@ -26,16 +26,17 @@
                                </dl>
                                
                                <div class="form-buttons">
+                                       <xsl:variable 
name="lang_cancel"><xsl:value-of select="php:function('lang', 'cancel')" 
/></xsl:variable>
                                        <xsl:choose>
                                                <xsl:when test="editable">
                                                        <xsl:variable 
name="lang_save"><xsl:value-of select="php:function('lang', 'save')" 
/></xsl:variable>
-                                                       <xsl:variable 
name="lang_cancel"><xsl:value-of select="php:function('lang', 'cancel')" 
/></xsl:variable>
                                                        <input type="submit" 
name="save_project_type" value="{$lang_save}" title = "{$lang_save}" />
                                                        <input type="submit" 
name="cancel_project_type" value="{$lang_cancel}" title = "{$lang_cancel}" />
                                                </xsl:when>
                                                <xsl:otherwise>
                                                        <xsl:variable 
name="lang_edit"><xsl:value-of select="php:function('lang', 'edit')" 
/></xsl:variable>
                                                        <input type="submit" 
name="edit_project_type" value="{$lang_edit}" title = "{$lang_edit}" />
+                                                       <input type="submit" 
name="cancel_project_type" value="{$lang_cancel}" title = "{$lang_cancel}" />
                                                </xsl:otherwise>
                                        </xsl:choose>
                                </div>




reply via email to

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