fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10043] added button for create new activity from pro


From: Erik Holm-Larsen
Subject: [Fmsystem-commits] [10043] added button for create new activity from project
Date: Thu, 27 Sep 2012 10:54:21 +0000

Revision: 10043
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10043
Author:   erikhl
Date:     2012-09-27 10:54:21 +0000 (Thu, 27 Sep 2012)
Log Message:
-----------
added button for create new activity from project

Modified Paths:
--------------
    trunk/logistic/inc/class.uiproject.inc.php
    trunk/logistic/setup/phpgw_no.lang
    trunk/logistic/templates/base/project_item.xsl

Modified: trunk/logistic/inc/class.uiproject.inc.php
===================================================================
--- trunk/logistic/inc/class.uiproject.inc.php  2012-09-27 10:27:42 UTC (rev 
10042)
+++ trunk/logistic/inc/class.uiproject.inc.php  2012-09-27 10:54:21 UTC (rev 
10043)
@@ -150,11 +150,37 @@
                                {
                                        array_walk(
                                                                        
$result_data['results'], array($this, '_add_links'), "logistic.uiproject.view");
+                                                                       
//$result_data['results'], array($this, 'add_actions'), array('project'));
                                }
                        }
                        return $this->yui_results($result_data);
                }
 
+               public function add_actions(&$value, $key, $params)
+               {
+                       $value['ajax'] = array();
+                       $value['actions'] = array();
+                       $value['labels'] = array();
+
+                       $type = $params[0];
+
+                       switch($type)
+                       {
+                               default:
+                                       $value['ajax'][] = false;
+                                       $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 'logistic.uiactivity.view', 
'id' => $value['id'])));
+                                       $value['labels'][] = lang('Show 
activity');
+
+                                       $value['ajax'][] = false;
+                                       $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 'logistic.uiactivity.edit', 
'id' => $value['id'])));
+                                       $value['labels'][] = lang('Edit 
activity');
+
+                                       $value['ajax'][] = false;
+                                       $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'logistic.uiactivity.add')));
+                                       $value['labels'][] = lang('New 
activity');
+                       }
+               }
+
                public function index()
                {
                        if (phpgw::get_var('phpgw_return_as') == 'json')
@@ -310,6 +336,10 @@
                        {
                                $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'logistic.uiproject.edit', 'id' => $project_id));
                        }
+                       else if (isset($_POST['new_activity']))
+                       {
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'logistic.uiactivity.add', 'project_id' => $project_id));
+                       }
                        else
                        {
                                if ($project_id && is_numeric($project_id))

Modified: trunk/logistic/setup/phpgw_no.lang
===================================================================
--- trunk/logistic/setup/phpgw_no.lang  2012-09-27 10:27:42 UTC (rev 10042)
+++ trunk/logistic/setup/phpgw_no.lang  2012-09-27 10:54:21 UTC (rev 10043)
@@ -10,7 +10,7 @@
 ID     logistic        no      ID
 t_new_project  logistic        no      Nytt prosjekt
 t_new_project_type     logistic        no      Ny prosjekttype
-t_new_activity logistic        no      Ny aktivitet
+t_new_activity logistic        no      Opprett ny aktivitet på dette prosjektet
 Project_type   logistic        no      Prosjekttype
 settings       logistic        no      innstillinger
 Project types  logistic        no      Prosjekttyper

Modified: trunk/logistic/templates/base/project_item.xsl
===================================================================
--- trunk/logistic/templates/base/project_item.xsl      2012-09-27 10:27:42 UTC 
(rev 10042)
+++ trunk/logistic/templates/base/project_item.xsl      2012-09-27 10:54:21 UTC 
(rev 10043)
@@ -6,7 +6,7 @@
 <xsl:call-template name="yui_phpgw_i18n"/>
 <div class="yui-navset yui-navset-top">
        <div class="identifier-header">
-               <h1><img src="{img_go_home}" /> 
+               <h1><img src="{img_go_home}" />
                                <xsl:value-of select="php:function('lang', 
'Project')" />
                </h1>
        </div>
@@ -43,7 +43,7 @@
                                                        <xsl:value-of 
select="project/project_type_label" />
                                                </xsl:otherwise>
                                        </xsl:choose>
-                                       </dd>   
+                                       </dd>
                                        <dt>
                                                <label 
for="description"><xsl:value-of select="php:function('lang', 'Description')" 
/></label>
                                        </dt>
@@ -58,7 +58,7 @@
                                        </xsl:choose>
                                        </dd>
                                </dl>
-                               
+
                                <div class="form-buttons">
                                        <xsl:choose>
                                                <xsl:when test="editable">
@@ -69,7 +69,9 @@
                                                </xsl:when>
                                                <xsl:otherwise>
                                                        <xsl:variable 
name="lang_edit"><xsl:value-of select="php:function('lang', 'edit')" 
/></xsl:variable>
+                                                       <xsl:variable 
name="lang_new_activity"><xsl:value-of select="php:function('lang', 
't_new_activity')" /></xsl:variable>
                                                        <input type="submit" 
name="edit_project" value="{$lang_edit}" title = "{$lang_edit}" />
+                                                       <input type="submit" 
name="new_activity" value="{$lang_new_activity}" title = "{$lang_new_activity}" 
/>
                                                </xsl:otherwise>
                                        </xsl:choose>
                                </div>




reply via email to

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