fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10408]


From: Torstein
Subject: [Fmsystem-commits] [10408]
Date: Thu, 01 Nov 2012 13:11:14 +0000

Revision: 10408
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10408
Author:   vator
Date:     2012-11-01 13:11:13 +0000 (Thu, 01 Nov 2012)
Log Message:
-----------


Modified Paths:
--------------
    trunk/logistic/inc/class.uiactivity.inc.php
    trunk/logistic/templates/base/activity/activity_tabs.xsl
    trunk/logistic/templates/base/activity/view_activity_item.xsl
    trunk/logistic/templates/base/css/base.css
    trunk/logistic/templates/base/requirement/requirement_overview.xsl

Modified: trunk/logistic/inc/class.uiactivity.inc.php
===================================================================
--- trunk/logistic/inc/class.uiactivity.inc.php 2012-11-01 11:30:44 UTC (rev 
10407)
+++ trunk/logistic/inc/class.uiactivity.inc.php 2012-11-01 13:11:13 UTC (rev 
10408)
@@ -32,6 +32,7 @@
        phpgw::import_class('logistic.sorequirement_resource_allocation');
        phpgw::import_class('phpgwapi.uicommon');
        phpgw::import_class('logistic.soactivity');
+       phpgw::import_class('phpgwapi.jquery');
 
        include_class('logistic', 'actvity');
 
@@ -49,7 +50,8 @@
                        'view'                  => true,
                        'index'                 => true,
                        'save'                  => true,
-                       'edit_favorite' => true
+                       'edit_favorite' => true,
+                       'view_resource_allocation'      => true
                );
 
                public function __construct()
@@ -494,7 +496,111 @@
                        }
                        $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'logistic.uiactivity.index'));     
                }
+               
+               public function view_resource_allocation()
+               {
+                       $activity_id = phpgw::get_var('activity_id');
 
+                       $activity = $this->so->get_single($activity_id);
+                       
+                       $data = array(
+                               'form' => array(
+                                       'toolbar' => array(
+                                               'item' => array(
+                                                       array('type' => 'text',
+                                                               'text' => 
lang('search'),
+                                                               'name' => 
'query'
+                                                       ),
+                                                       array(
+                                                               'type' => 
'submit',
+                                                               'name' => 
'search',
+                                                               'value' => 
lang('Search')
+                                                       ),
+                                               ),
+                                       ),
+                               ),
+                               'datatable' => array(
+                                       'source' => 
self::link(array('menuaction' => 'logistic.uirequirement.index', 'activity_id' 
=> $activity_id, 'phpgw_return_as' => 'json')),
+                                       'field' => array(
+                                               array(
+                                                       'key' => 'select',
+                                                       'label' => 
lang('select'),
+                                                       'sortable' => false,
+                                               ),
+                                               array(
+                                                       'key' => 'id',
+                                                       'label' => lang('ID'),
+                                                       'sortable' => true,
+                                               ),
+                                               array(
+                                                       'key' => 'start_date',
+                                                       'label' => lang('Start 
date'),
+                                                       'sortable' => false
+                                               ),
+                                               array(
+                                                       'key' => 'end_date',
+                                                       'label' => lang('End 
date'),
+                                                       'sortable' => false
+                                               ),
+                                               array(
+                                                       'key' => 'no_of_items',
+                                                       'label' => lang('Num 
required'),
+                                                       'sortable' => false
+                                               ),
+                                               array(
+                                                       'key' => 'allocated',
+                                                       'label' => lang('Num 
allocated'),
+                                                       'sortable' => false
+                                               ),
+                                               array(
+                                                       'key' => 'location_id',
+                                                       'label' => 
lang('Resource type'),
+                                                       'sortable' => false
+                                               ),
+                                               array(
+                                                       'key' => 'link',
+                                                       'hidden' => true
+                                               ),
+                                               array(
+                                                       'key' => 'id',
+                                                       'className' => 
'requirement_id',
+                                                       'hidden' => true
+                                               ),
+                                               array(
+                                                       'key' => 'delete_link',
+                                                       'label' => lang('Delete 
requirement'),
+                                                       'sortable' => false,
+                                               ),
+                                               array(
+                                                       'key' => 'alloc_link',
+                                                       'label' => 
lang('Allocate resources'),
+                                                       'sortable' => false,
+                                               ),
+                                               array(
+                                                       'key' => 'status',
+                                                       'label' => 
lang('Status'),
+                                                       'sortable' => false,
+                                               ),
+                                       )
+                               ),
+                       );
+                       
+                       phpgwapi_yui::load_widget('datatable');
+                       phpgwapi_yui::load_widget('paginator');
+                       phpgwapi_jquery::load_widget('core');
+
+                       $tabs = $this->make_tab_menu($activity_id);
+                       
+                       $data['tabs']                   = 
$GLOBALS['phpgw']->common->create_tabs($tabs, 1);
+                       $data['view']           = 'requirement_overview';
+                       $data['activity'] = $activity;
+                       
+                       self::add_javascript('logistic', 'logistic', 
'activity.js');
+                       self::add_javascript('logistic', 'logistic', 
'resource_allocation.js');
+                       self::add_javascript('logistic', 'logistic', 
'requirement.js');
+                       
self::render_template_xsl(array('activity/view_activity_item', 
'requirement/requirement_overview', 'activity/activity_tabs'), $data);
+               }
+
                private function get_user_array()
                {
                        $user_array = array();
@@ -526,7 +632,7 @@
                                                                                
                                                                                
                                                                                
                         'id' => $activity->get_id()))
                                                ), array(
                                                        'label' => "2: " . 
lang('Requirement allocation'),
-                                                       'link'  => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'logistic.uirequirement_resource_allocation.view',
+                                                       'link'  => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'logistic.uiactivity.view_resource_allocation',
                                                                                
                                                                                
                                                                                
                         'activity_id' => $activity->get_id()))
                                                ));
                        }else{

Modified: trunk/logistic/templates/base/activity/activity_tabs.xsl
===================================================================
--- trunk/logistic/templates/base/activity/activity_tabs.xsl    2012-11-01 
11:30:44 UTC (rev 10407)
+++ trunk/logistic/templates/base/activity/activity_tabs.xsl    2012-11-01 
13:11:13 UTC (rev 10408)
@@ -29,7 +29,7 @@
                        <xsl:value-of disable-output-escaping="yes" 
select="tabs" />
                        <xsl:call-template name="activity_details" />
                </xsl:when>
-               <xsl:when test="view = 'resource_allocation'">
+               <xsl:when test="view = 'requirement_overview'">
                        <xsl:choose>
                                <xsl:when test="activity/id != '' or 
activity/id != 0">
                                        <h1 style="float:left;"> 
@@ -49,7 +49,7 @@
                        </xsl:choose>
                
                        <xsl:value-of disable-output-escaping="yes" 
select="tabs" />
-                       <xsl:call-template name="requirement_values" />
+                       <xsl:call-template name="requirement_overview" />
                </xsl:when>
        </xsl:choose>
 </div>

Modified: trunk/logistic/templates/base/activity/view_activity_item.xsl
===================================================================
--- trunk/logistic/templates/base/activity/view_activity_item.xsl       
2012-11-01 11:30:44 UTC (rev 10407)
+++ trunk/logistic/templates/base/activity/view_activity_item.xsl       
2012-11-01 13:11:13 UTC (rev 10408)
@@ -4,20 +4,6 @@
 <xsl:template name="activity_details" xmlns:php="http://php.net/xsl";>
 <xsl:variable name="date_format"><xsl:value-of 
select="php:function('get_phpgw_info', 
'user|preferences|common|dateformat')"/></xsl:variable>
 
-<div class="content-wrp">
-       <xsl:choose>
-               <xsl:when test="parent_activity/id &gt; 0">
-                       <h1> 
-                               <xsl:value-of select="parent_activity/name" 
disable-output-escaping="yes"/>::<xsl:value-of select="php:function('lang', 
'Add sub activity')" />
-                       </h1>
-               </xsl:when>
-               <xsl:otherwise>
-                       <h1> 
-                               <xsl:value-of select="php:function('lang', 'Add 
activity')" />
-                       </h1>
-               </xsl:otherwise>
-       </xsl:choose>
-       
        <div class="content-wrp">
                <div id="details">
                        <xsl:variable name="action_url">
@@ -198,7 +184,6 @@
                        </form>
                </div>
        </div>
-</div>
 </xsl:template>
 
 <xsl:template name="datasource-definition">

Modified: trunk/logistic/templates/base/css/base.css
===================================================================
--- trunk/logistic/templates/base/css/base.css  2012-11-01 11:30:44 UTC (rev 
10407)
+++ trunk/logistic/templates/base/css/base.css  2012-11-01 13:11:13 UTC (rev 
10408)
@@ -2326,7 +2326,6 @@
 }
 
 #resource_alloc_wrp {
-       margin: 20px;
        padding: 20px;  
 }
 

Modified: trunk/logistic/templates/base/requirement/requirement_overview.xsl
===================================================================
--- trunk/logistic/templates/base/requirement/requirement_overview.xsl  
2012-11-01 11:30:44 UTC (rev 10407)
+++ trunk/logistic/templates/base/requirement/requirement_overview.xsl  
2012-11-01 13:11:13 UTC (rev 10408)
@@ -15,9 +15,7 @@
        </func:result>
 </func:function>
 
-<xsl:template match="data" xmlns:php="http://php.net/xsl";>
-       <xsl:call-template name="yui_phpgw_i18n"/>
-       
+<xsl:template name="requirement_overview" xmlns:php="http://php.net/xsl";>
        <div id="resource_alloc_wrp" class="content-wrp">
 
                        <div id="paging"></div>
@@ -43,10 +41,10 @@
                        <h2 style="clear:both;">Allokerte ressurser</h2>
                        <div id="allocation-container"></div>
        </div>
-       <xsl:call-template name="datasource-definition" />
+       <xsl:call-template name="datasource-def" />
 </xsl:template>
 
-<xsl:template name="datasource-definition">
+<xsl:template name="datasource-def">
 
        <script>
        YAHOO.util.Event.onDOMReady(function(){




reply via email to

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