fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16975] controller: FDV-30


From: sigurdne
Subject: [Fmsystem-commits] [16975] controller: FDV-30
Date: Mon, 14 Aug 2017 05:48:12 -0400 (EDT)

Revision: 16975
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16975
Author:   sigurdne
Date:     2017-08-14 05:48:12 -0400 (Mon, 14 Aug 2017)
Log Message:
-----------
controller: FDV-30

Modified Paths:
--------------
    trunk/controller/inc/class.uicalendar.inc.php
    trunk/controller/js/controller/ajax.js
    trunk/controller/setup/phpgw_no.lang
    
trunk/controller/templates/base/calendar/view_calendar_month_for_locations.xsl
    
trunk/controller/templates/base/calendar/view_calendar_year_for_locations.xsl

Modified: trunk/controller/inc/class.uicalendar.inc.php
===================================================================
--- trunk/controller/inc/class.uicalendar.inc.php       2017-08-13 15:04:15 UTC 
(rev 16974)
+++ trunk/controller/inc/class.uicalendar.inc.php       2017-08-14 09:48:12 UTC 
(rev 16975)
@@ -480,7 +480,9 @@
                                $bookmark_locations = array_keys($bookmarks);
                        }
 
-                       if ($location_code = phpgw::get_var('location_code'))
+                       $location_code = phpgw::get_var('location_code', 
'string');
+
+                       if ($location_code && $location_code != 'all')
                        {
                                $bookmark_locations[] = $location_code;
                        }
@@ -496,7 +498,7 @@
                                        $locations_list[] = array
                                                (
                                                'id' => 
$location['location_code'],
-                                               'name' => $location['loc_name'],
+                                               'name' => 
"{$location['location_code']} - {$location['loc_name']}",
                                                'selected' => $location_code == 
$location['location_code'] ? 1 : 0
                                        );
                                }
@@ -515,6 +517,12 @@
                                        $locations_location_code[$key] = 
$row['location_code'];
                                }
                                array_multisort($locations_location_code, 
SORT_ASC, $locations_list);
+
+                               array_unshift($locations_list, array(
+                                               'id' => 'all',
+                                               'name' => lang('all'),
+                                               'selected' => $location_code == 
'all' ? 1 : 0
+                               ));
                        }
 
 
@@ -538,9 +546,12 @@
                                {
                                        $curr_location_code = 
$location['location_code'];
 
-                                       if (!$bookmark_locations || 
!in_array($curr_location_code, $bookmark_locations))
+                                       if($location_code != 'all')
                                        {
-                                               continue;
+                                               if (!$bookmark_locations || 
!in_array($curr_location_code, $bookmark_locations))
+                                               {
+                                                       continue;
+                                               }
                                        }
 
                                        $cl_criteria = new 
controller_check_list();
@@ -603,7 +614,7 @@
                                        // Loops through controls in 
controls_for_location_array and populates aggregate open cases pr month array.
                                        $agg_open_cases_pr_month_array = 
$this->build_agg_open_cases_pr_month_array($cl_criteria, $year, $from_month, 
$to_month);
 
-                                       $year_calendar_agg = new 
year_calendar_agg($control, $year, $location_code, 
"VIEW_LOCATIONS_FOR_CONTROL");
+                                       $year_calendar_agg = new 
year_calendar_agg($control, $year, $curr_location_code, 
"VIEW_LOCATIONS_FOR_CONTROL");
                                        $calendar_array = 
$year_calendar_agg->build_calendar($agg_open_cases_pr_month_array);
                                        $components_with_calendar_array[] = 
array("component" => $component->toArray(),
                                                "calendar_array" => 
$calendar_array);
@@ -616,9 +627,12 @@
                                {
                                        $curr_location_code = 
$location['location_code'];
 
-                                       if (!$bookmark_locations || 
!in_array($curr_location_code, $bookmark_locations))
+                                       if($location_code != 'all')
                                        {
-                                               continue;
+                                               if (!$bookmark_locations || 
!in_array($curr_location_code, $bookmark_locations))
+                                               {
+                                                       continue;
+                                               }
                                        }
 
                                        $repeat_type = 
$control->get_repeat_type();
@@ -756,7 +770,9 @@
                                $bookmark_locations = array_keys($bookmarks);
                        }
 
-                       if ($location_code = phpgw::get_var('location_code'))
+                       $location_code = phpgw::get_var('location_code', 
'string');
+
+                       if ($location_code && $location_code != 'all')
                        {
                                $bookmark_locations[] = $location_code;
                        }
@@ -771,7 +787,7 @@
                                        $locations_list[] = array
                                                (
                                                'id' => 
$location['location_code'],
-                                               'name' => $location['loc_name'],
+                                               'name' => 
"{$location['location_code']} - {$location['loc_name']}",
                                                'selected' => $location_code == 
$location['location_code'] ? 1 : 0
                                        );
                                }
@@ -789,6 +805,12 @@
                                        $locations_location_code[$key] = 
$row['location_code'];
                                }
                                array_multisort($locations_location_code, 
SORT_ASC, $locations_list);
+
+                               array_unshift($locations_list, array(
+                                               'id' => 'all',
+                                               'name' => lang('all'),
+                                               'selected' => $location_code == 
'all' ? 1 : 0
+                               ));
                        }
 
                        // Validates year. If year is not set, current year is 
chosen
@@ -809,9 +831,12 @@
                        {
                                $curr_location_code = 
$location['location_code'];
 
-                               if (!$bookmark_locations || 
!in_array($curr_location_code, $bookmark_locations))
+                               if($location_code != 'all')
                                {
-                                       continue;
+                                       if (!$bookmark_locations || 
!in_array($curr_location_code, $bookmark_locations))
+                                       {
+                                               continue;
+                                       }
                                }
 
                                $repeat_type = $control->get_repeat_type();
@@ -1043,7 +1068,7 @@
 
                        foreach ($my_locations as $location)
                        {
-                               if ($location['location_code'] != 
$current_location_code)
+                               if ($location['location_code'] != 
$current_location_code && $current_location_code != 'all')
                                {
                                        $my_washed_locations[] = $location;
                                }

Modified: trunk/controller/js/controller/ajax.js
===================================================================
--- trunk/controller/js/controller/ajax.js      2017-08-13 15:04:15 UTC (rev 
16974)
+++ trunk/controller/js/controller/ajax.js      2017-08-14 09:48:12 UTC (rev 
16975)
@@ -691,7 +691,7 @@
                        var control_id = 
$(thisForm).find("input[name='control_id']").val();
                        var oArgs = {menuaction: 
'controller.uicalendar.view_calendar_month_for_locations'};
                        var baseUrl = phpGWLink('index.php', oArgs, false);
-                       var requestUrl = baseUrl + "&location_code=" + 
location_code + "&year=" + year + "&control_id=" + control_id;
+                       var requestUrl = baseUrl + "&location_code=" + 
location_code + "&year=" + year + "&month=" + month + "&control_id=" + 
control_id;
                        window.location.href = requestUrl;
                }
 

Modified: trunk/controller/setup/phpgw_no.lang
===================================================================
--- trunk/controller/setup/phpgw_no.lang        2017-08-13 15:04:15 UTC (rev 
16974)
+++ trunk/controller/setup/phpgw_no.lang        2017-08-14 09:48:12 UTC (rev 
16975)
@@ -394,4 +394,5 @@
 Control types  controller      no      Kontrolltyper
 location       controller      no      Lokasjon
 document types controller      no      Dokumenttyper
-Do not edit archived version   controller      no      Du kan ikke endre 
arkiverte versjoner
\ No newline at end of file
+Do not edit archived version   controller      no      Du kan ikke endre 
arkiverte versjoner
+choose a location      controller      no      Velg en lokasjon
\ No newline at end of file

Modified: 
trunk/controller/templates/base/calendar/view_calendar_month_for_locations.xsl
===================================================================
--- 
trunk/controller/templates/base/calendar/view_calendar_month_for_locations.xsl  
    2017-08-13 15:04:15 UTC (rev 16974)
+++ 
trunk/controller/templates/base/calendar/view_calendar_month_for_locations.xsl  
    2017-08-14 09:48:12 UTC (rev 16975)
@@ -12,7 +12,9 @@
                        <h1>Kontrollplan for <xsl:value-of 
select="control/title"/></h1>
                        <h3>Oversikt for <span class="month"><xsl:value-of 
select="php:function('lang', $month_str)" /></span><span 
class="year"><xsl:value-of select="current_year"/></span></h3>
                                <div id="choose-my-location" class="select-box">
-                                       <label>Velg en lokasjon</label>
+                                       <label>
+                                               <xsl:value-of 
select="php:function('lang', 'choose a location')" />
+                                       </label>
                                          <form action="#">
                                                <input type="hidden" 
name="period_type" value="view_month_for_locations" />
                                                <input type="hidden" 
name="year">
@@ -20,6 +22,7 @@
                                                        <xsl:value-of 
select="current_year"/>
                                                  </xsl:attribute>
                                                </input>
+                                               <input type="hidden" 
name="month" value="{current_month_nr}"/>
                                                <input type="hidden" 
name="control_id">
                                                  <xsl:attribute name="value">
                                                        <xsl:value-of 
select="//control/id"/>
@@ -28,15 +31,10 @@
                                                <select id="choose-my-location" 
class="select-location">
                                                  <option>Velg bygg</option>
                                                  <xsl:for-each 
select="locations_list">
-                                                       <option>
+                                                       <option value="{id}">
                                                          <xsl:if 
test="selected = 1">
                                                                <xsl:attribute 
name="selected">selected</xsl:attribute>
                                                          </xsl:if>
-                                                         <xsl:attribute 
name="value">
-                                                               <xsl:value-of 
select="id"/>
-                                                         </xsl:attribute>
-                                                               <xsl:value-of 
select="id"/>
-                                                               <xsl:text> - 
</xsl:text>
                                                                <xsl:value-of 
disable-output-escaping="yes" select="name"/>
                                                        </option>
                                                  </xsl:for-each>

Modified: 
trunk/controller/templates/base/calendar/view_calendar_year_for_locations.xsl
===================================================================
--- 
trunk/controller/templates/base/calendar/view_calendar_year_for_locations.xsl   
    2017-08-13 15:04:15 UTC (rev 16974)
+++ 
trunk/controller/templates/base/calendar/view_calendar_year_for_locations.xsl   
    2017-08-14 09:48:12 UTC (rev 16975)
@@ -14,7 +14,9 @@
                        <h3>Periode: <xsl:value-of select="current_year"/></h3>
                        
                                <div id="choose-my-location" class="select-box">
-                                       <label>Velg en lokasjon</label>
+                                       <label>
+                                               <xsl:value-of 
select="php:function('lang', 'choose a location')" />
+                                       </label>
                                          <form action="#">
                                                <input type="hidden" 
name="period_type" value="view_year_for_locations" />
                                                <input type="hidden" 
name="year">
@@ -32,19 +34,13 @@
                                                                <xsl:value-of 
select="$serie_id"/>
                                                        </xsl:attribute>
                                                </input>
-
                                                <select id="choose-my-location" 
class="select-location">
                                                  <option>Velg bygg</option>
                                                  <xsl:for-each 
select="locations_list">
-                                                       <option>
+                                                       <option value="{id}">
                                                          <xsl:if 
test="selected = 1">
                                                                <xsl:attribute 
name="selected">selected</xsl:attribute>
                                                          </xsl:if>
-                                                         <xsl:attribute 
name="value">
-                                                               <xsl:value-of 
select="id"/>
-                                                         </xsl:attribute>
-                                                               <xsl:value-of 
select="id"/>
-                                                               <xsl:text> - 
</xsl:text>
                                                                <xsl:value-of 
disable-output-escaping="yes" select="name"/>
                                                        </option>
                                                  </xsl:for-each>




reply via email to

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