fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10457]


From: Torstein
Subject: [Fmsystem-commits] [10457]
Date: Sun, 04 Nov 2012 20:00:57 +0000

Revision: 10457
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10457
Author:   vator
Date:     2012-11-04 20:00:56 +0000 (Sun, 04 Nov 2012)
Log Message:
-----------


Modified Paths:
--------------
    trunk/logistic/inc/class.uirequirement.inc.php
    trunk/logistic/inc/class.uirequirement_resource_allocation.inc.php
    trunk/logistic/setup/phpgw_no.lang
    trunk/logistic/setup/tables_update.inc.php
    trunk/logistic/templates/base/css/base.css
    trunk/logistic/templates/base/requirement/requirement_item.xsl
    trunk/logistic/templates/base/requirement/requirement_values.xsl

Modified: trunk/logistic/inc/class.uirequirement.inc.php
===================================================================
--- trunk/logistic/inc/class.uirequirement.inc.php      2012-11-04 16:56:48 UTC 
(rev 10456)
+++ trunk/logistic/inc/class.uirequirement.inc.php      2012-11-04 20:00:56 UTC 
(rev 10457)
@@ -161,20 +161,25 @@
                                $filters = array('requirement_id' => 
$entry['id']);
                                $num_allocated = 
$this->so_resource_allocation->get_count($search_for, $search_type, $filters);
                                
+                               $entry['allocated'] = $num_allocated;
+                               $entry['select'] = "<input 
class=\"select_line\" type =\"radio\" {$_checked} name=\"values[select_line]\" 
value=\"{$entry['id']}\">";
+                                       
                                if($num_allocated == $num_required)
                                {
-                                       $entry['status'] = "OK";        
+                                       $entry['status'] = "OK";
+                                       
+                                       $entry['alloc_link'] = "<span 
class='btn-sm cancel'>Tildel ressurser</span>";
                                }
                                else
                                {
-                                       $entry['status'] = "MANGLER";
+                                       $num_remaining = $num_required - 
$num_allocated;
+                                       $entry['status'] = "MANGLER (" . 
$num_remaining . ")";
+                                       
+                                       $href = self::link(array('menuaction' 
=> 'logistic.uirequirement_resource_allocation.edit', 'requirement_id' => 
$entry['id']));
+                                       $entry['alloc_link'] = "<a 
class=\"btn-sm alloc\" href=\"{$href}\">Tildel ressurser</a>";
                                }
                                
-                               $entry['allocated'] = $num_allocated;
                                
-                               $entry['select'] = "<input 
class=\"select_line\" type =\"radio\" {$_checked} name=\"values[select_line]\" 
value=\"{$entry['id']}\">";
-                               $href = self::link(array('menuaction' => 
'logistic.uirequirement_resource_allocation.edit', 'requirement_id' => 
$entry['id']));
-                               $entry['alloc_link'] = "<a class=\"btn-sm 
alloc\" href=\"{$href}\">Tildel ressurser</a>";
                        }
 
                        // ... add result data

Modified: trunk/logistic/inc/class.uirequirement_resource_allocation.inc.php
===================================================================
--- trunk/logistic/inc/class.uirequirement_resource_allocation.inc.php  
2012-11-04 16:56:48 UTC (rev 10456)
+++ trunk/logistic/inc/class.uirequirement_resource_allocation.inc.php  
2012-11-04 20:00:56 UTC (rev 10457)
@@ -373,7 +373,7 @@
                public function save()
                {
                        $requirement_id = phpgw::get_var('requirement_id');
-                       
+               
                        if($requirement_id && is_numeric($requirement_id))
                        {
                                $requirement = 
$this->so_requirement->get_single($requirement_id);
@@ -383,13 +383,12 @@
                        $chosen_resources = phpgw::get_var('chosen_resources');
                        
                        $filters = array('requirement_id' => 
$requirement->get_id());
-                       $num_allocated = 
$this->so_resource_allocation->get_count($search_for, $search_type, $filters); 
-                                                        
+                       $num_allocated = $this->so->get_count($search_for, 
$search_type, $filters);     
+                                                               
                        $num_required = $requirement->get_no_of_items();
                                                        
-                       $num_allowed_bookings = $num_required - $num_required;
-                       
-                       
+                       $num_allowed_bookings = $num_required - $num_allocated;
+                                       
                        if( count($chosen_resources) <=  $num_allowed_bookings)
                        {
                                foreach($chosen_resources as $resource_id)
@@ -403,8 +402,8 @@
                                        $resource_alloc_id = $this->so->store( 
$resource_alloc );
                                }
                                
-                               $activity_id = 
$this->so_activity->get_single($requirement->get_activity_id()); 
-       
+                               $activity = 
$this->so_activity->get_single($requirement->get_activity_id()); 
+
                                $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'logistic.uiactivity.view_resource_allocation', 
'activity_id' => $activity_id));
                        }
                        else
@@ -478,7 +477,6 @@
                                                'activity' => $activity,
                                                'allocation' => $allocation,
                                                'requirement' => $requirement,
-                                               'img_go_home' => 
'rental/templates/base/images/32x32/actions/go-home.png',
                                                'dateformat' => 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']
                                );
 

Modified: trunk/logistic/setup/phpgw_no.lang
===================================================================
--- trunk/logistic/setup/phpgw_no.lang  2012-11-04 16:56:48 UTC (rev 10456)
+++ trunk/logistic/setup/phpgw_no.lang  2012-11-04 20:00:56 UTC (rev 10457)
@@ -90,4 +90,5 @@
 Overview of resources for activity     logistic        no      Oversikt over 
ressurser for aktivteten
 Allocated resouces     logistic        no      Tildelte ressurser
 Click on table above to get allocations        logistic        no      Klikk 
på en rad i tabellen over for å få frem visning
-Add activity to project        logistic        no      Legg aktivitet til 
prosjektet
\ No newline at end of file
+Add activity to project        logistic        no      Legg aktivitet til 
prosjektet
+View resources overview        logistic        no      Vis ressursoversikt
\ No newline at end of file

Modified: trunk/logistic/setup/tables_update.inc.php
===================================================================
--- trunk/logistic/setup/tables_update.inc.php  2012-11-04 16:56:48 UTC (rev 
10456)
+++ trunk/logistic/setup/tables_update.inc.php  2012-11-04 20:00:56 UTC (rev 
10457)
@@ -58,4 +58,4 @@
                        return $GLOBALS['setup_info']['logistic']['currentver'];
                }
        }
-       
\ No newline at end of file
+       

Modified: trunk/logistic/templates/base/css/base.css
===================================================================
--- trunk/logistic/templates/base/css/base.css  2012-11-04 16:56:48 UTC (rev 
10456)
+++ trunk/logistic/templates/base/css/base.css  2012-11-04 20:00:56 UTC (rev 
10457)
@@ -860,7 +860,7 @@
     text-align: center;
 }
 
-.btn.cancel, .btn_m.cancel {
+.btn.cancel, .btn_m.cancel, .btn-sm.cancel {
   background: none repeat scroll 0 0 #EEEEEE;
   border: 1px solid #CCCCCC;
   color: #333333;
@@ -2432,4 +2432,8 @@
 
 #breadcrumb img{
        height: 14px;
+}
+
+#requirement-container .btn-sm.cancel {
+  border: 1px solid #CCCCCC;
 }
\ No newline at end of file

Modified: trunk/logistic/templates/base/requirement/requirement_item.xsl
===================================================================
--- trunk/logistic/templates/base/requirement/requirement_item.xsl      
2012-11-04 16:56:48 UTC (rev 10456)
+++ trunk/logistic/templates/base/requirement/requirement_item.xsl      
2012-11-04 20:00:56 UTC (rev 10457)
@@ -117,16 +117,34 @@
                        </dl>
                        
                        <div class="form-buttons">
+                       
+                               <xsl:variable name="view_resources_params">
+                                       
<xsl:text>menuaction:logistic.uiactivity.view_resource_allocation, 
activity_id:</xsl:text>
+                                               <xsl:value-of 
select="activity/id" />
+                                       </xsl:variable>
+                                       <xsl:variable name="view_resources_url">
+                                               <xsl:value-of 
select="php:function('get_phpgw_link', '/index.php', $view_resources_params )" 
/>
+                               </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_requirement" value="{$lang_save}" title = "{$lang_save}" />
-                                               <input type="submit" 
name="cancel_requirement" value="{$lang_cancel}" title = "{$lang_cancel}" />
+                                               <input type="submit" 
name="cancel_requirement" value="{$lang_cancel}" title = "{$lang_cancel}" />    
                           
+                                                               
+                                               <a style="margin-left: 20px;" 
id="view-resources-btn" class="btn non-focus" href="{$view_resources_url}">
+                                                 <xsl:value-of 
select="php:function('lang', 'View resources overview')" />
+                                               </a>
+                                               
                                        </xsl:when>
                                        <xsl:otherwise>
                                                <xsl:variable 
name="lang_edit"><xsl:value-of select="php:function('lang', 'edit')" 
/></xsl:variable>
                                                <input type="submit" 
name="edit_requirement" value="{$lang_edit}" title = "{$lang_edit}" />
+
+                                               <a style="margin-left: 20px;" 
id="view-resources-btn" class="btn non-focus" href="{$view_resources_url}">
+                                                 <xsl:value-of 
select="php:function('lang', 'View resources overview')" />
+                                               </a>
                                        </xsl:otherwise>
                                </xsl:choose>
                        </div>

Modified: trunk/logistic/templates/base/requirement/requirement_values.xsl
===================================================================
--- trunk/logistic/templates/base/requirement/requirement_values.xsl    
2012-11-04 16:56:48 UTC (rev 10456)
+++ trunk/logistic/templates/base/requirement/requirement_values.xsl    
2012-11-04 20:00:56 UTC (rev 10457)
@@ -176,12 +176,24 @@
                        </dl>
                        
                        <div class="form-buttons">
+                       
+                               <xsl:variable name="view_resources_params">
+                                       
<xsl:text>menuaction:logistic.uiactivity.view_resource_allocation, 
activity_id:</xsl:text>
+                                 <xsl:value-of select="activity/id" />
+                               </xsl:variable>
+                               <xsl:variable name="view_resources_url">
+                                 <xsl:value-of 
select="php:function('get_phpgw_link', '/index.php', $view_resources_params )" 
/>
+                               </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_requirement_values" value="{$lang_save}" title = "{$lang_save}" />
                                                <input type="submit" 
name="cancel_requirement_values" value="{$lang_cancel}" title = 
"{$lang_cancel}" />
+                                               
+                                               <a style="margin-left: 20px;" 
id="view-resources-btn" class="btn non-focus" href="{$view_resources_url}">
+                                                 <xsl:value-of 
select="php:function('lang', 'View resources overview')" />
+                                               </a>
                                        </xsl:when>
                                        <xsl:otherwise>
                                                <xsl:variable name="params">
@@ -192,6 +204,10 @@
                                                                <xsl:value-of 
select="php:function('get_phpgw_link', '/index.php', $params )" />
                                                        </xsl:variable>
                                                        <a class="btn" 
href="{$edit_url}"><xsl:value-of select="php:function('lang', 'edit')" /></a>
+                                                       
+                                               <a style="margin-left: 20px;" 
id="view-resources-btn" class="btn non-focus" href="{$view_resources_url}">
+                                                 <xsl:value-of 
select="php:function('lang', 'View resources overview')" />
+                                               </a>
                                        </xsl:otherwise>
                                </xsl:choose>
                        </div>




reply via email to

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