fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [9335]


From: Torstein
Subject: [Fmsystem-commits] [9335]
Date: Wed, 09 May 2012 11:50:05 +0000

Revision: 9335
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9335
Author:   vator
Date:     2012-05-09 11:50:05 +0000 (Wed, 09 May 2012)
Log Message:
-----------


Modified Paths:
--------------
    trunk/controller/inc/class.uicalendar.inc.php
    trunk/controller/inc/component/class.month_calendar.inc.php
    trunk/controller/templates/base/calendar/view_calendar_month.xsl
    trunk/controller/templates/base/calendar/view_calendar_year.xsl
    trunk/controller/templates/base/case/view_case_message.xsl
    trunk/controller/templates/base/css/base.css

Modified: trunk/controller/inc/class.uicalendar.inc.php
===================================================================
--- trunk/controller/inc/class.uicalendar.inc.php       2012-05-09 11:26:12 UTC 
(rev 9334)
+++ trunk/controller/inc/class.uicalendar.inc.php       2012-05-09 11:50:05 UTC 
(rev 9335)
@@ -53,7 +53,6 @@
                                
                public $public_functions = array
                (
-                       'index' =>      true,
                        'view_calendar_for_month'                       =>      
true,
                        'view_calendar_for_year'                        =>      
true,
                        'view_calendar_year_for_locations'      =>  true,
@@ -64,12 +63,12 @@
                {
                        parent::__construct();
                        
-                       $read        = 
$GLOBALS['phpgw']->acl->check('.control', PHPGW_ACL_READ, 'controller');//1 
-                       $add         = 
$GLOBALS['phpgw']->acl->check('.control', PHPGW_ACL_ADD, 'controller');//2 
-                       $edit         = 
$GLOBALS['phpgw']->acl->check('.control', PHPGW_ACL_EDIT, 'controller');//4 
-                       $delete     = $GLOBALS['phpgw']->acl->check('.control', 
PHPGW_ACL_DELETE, 'controller');//8 
+                       $read    = $GLOBALS['phpgw']->acl->check('.control', 
PHPGW_ACL_READ, 'controller');//1 
+                       $add     = $GLOBALS['phpgw']->acl->check('.control', 
PHPGW_ACL_ADD, 'controller');//2 
+                       $edit    = $GLOBALS['phpgw']->acl->check('.control', 
PHPGW_ACL_EDIT, 'controller');//4 
+                       $delete  = $GLOBALS['phpgw']->acl->check('.control', 
PHPGW_ACL_DELETE, 'controller');//8 
                        
-                       $manage     = $GLOBALS['phpgw']->acl->check('.control', 
16, 'controller');//16
+                       $manage  = $GLOBALS['phpgw']->acl->check('.control', 
16, 'controller');//16
                        
                        $this->so = CreateObject('controller.socheck_list');
                        $this->so_control = 
CreateObject('controller.socontrol');
@@ -103,8 +102,6 @@
                        
                        $to_date_ts = strtotime("$to_month/01/$to_year");
                                                                                
                
-                       $this->calendar_builder = new 
calendar_builder($from_date_ts, $to_date_ts);
-                       
                        $criteria = array
                        (
                                'user_id' => 
$GLOBALS['phpgw_info']['user']['account_id'],
@@ -120,39 +117,37 @@
                                $location_code = 
$my_locations[0]["location_code"];
                        }
                        
-                       $num_days_in_month = cal_days_in_month(CAL_GREGORIAN, 
$month, $year);
-                       
                        // Fetches controls for location within specified time 
period
                        $controls_for_location_array = 
$this->so_control->get_controls_by_location($location_code, $from_date_ts, 
$to_date_ts);
 
-                       // Fetches control ids with check lists for specified 
time period
+                       // Fetches all control ids with check lists for 
specified time period
                        $control_id_with_check_list_array = 
$this->so->get_check_lists_for_location_2($location_code, $from_date_ts, 
$to_date_ts);
                        
                        // Loops through all controls for location and 
populates controls with check lists
-                       $control_with_check_list_array = 
$this->populate_controls_with_check_lists($controls_for_location_array, 
$control_id_with_check_list_array);
+                       $controls_with_check_list_array = 
$this->populate_controls_with_check_lists($controls_for_location_array, 
$control_id_with_check_list_array);
                        
-                       $controls_calendar_array = 
$this->calendar_builder->build_calendar_array( $control_with_check_list_array, 
$num_days_in_month, "view_days" );
+                       $controls_calendar_array = array();
+                       foreach($controls_with_check_list_array as $control){
+                               $month_calendar = new month_calendar($control, 
$year, $month);
+                               $calendar_array = 
$month_calendar->build_calendar( $control->get_check_lists_array() );
+
+                               $controls_calendar_array[] = array("control" => 
$control->toArray(), "calendar_array" => $calendar_array);
+                       }
                        
                        $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
                
                        $property_array = 
execMethod('property.solocation.read', array('type_id' => 1, 'allrows' => 
true));
-                       
-                       $month_array = array("Januar", "Februar", "Mars", 
"April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", 
"Desember");
-                       
-                       for($i=1;$i<=$num_days_in_month;$i++){
-                               $heading_array[$i] = "$i";      
-                       }
-                       
+                                               
                        $data = array
                        (               
                                'my_locations'                    => 
$my_locations,
                                'view_location_code'      => $location_code,
                                'property_array'                  => 
$property_array,
                                'location_array'                  => 
$location_array,
-                               'heading_array'                   => 
$heading_array,
+                               'heading_array'                   => 
month_calendar::get_heading_array($year, $month),
                                'controls_calendar_array' => 
$controls_calendar_array,
                                'date_format'                     => 
$date_format,
-                               'period'                                  => 
$month_array[ $month - 1],
+                               'period'                                  => 
month_calendar::get_month_name($month-1),
                                'month_nr'                                => 
$month,
                                'year'                                    => 
$year,
                        );
@@ -396,15 +391,6 @@
                
                        $location_finder = new location_finder();
                        $my_locations = $location_finder->get_responsibilities( 
$criteria );
-
-                       
-                       $month_array = array("Januar", "Februar", "Mars", 
"April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", 
"Desember");
-                       
-                       $num_days_in_month = cal_days_in_month(CAL_GREGORIAN, 
$month, $year);
-                       
-                       for($i=1;$i<=$num_days_in_month;$i++){
-                               $heading_array[$i] = "$i";      
-                       }
                        
                        $data = array
                        (               
@@ -412,12 +398,12 @@
                                'view_location_code'                    => 
$location_code,
                                'property_array'                                
=> $property_array,
                                'location_array'                                
=> $location_array,
-                               'heading_array'                                 
=> $heading_array,
                                'locations_with_calendar_array' => 
$locations_with_calendar_array,
                                'date_format'                                   
=> $date_format,
-                               'period'                                        
        => $month_array[ $month - 1],
                                'month_nr'                                      
        => $month,
                                'year'                                          
        => $year,
+                               'heading_array'                                 
=> month_calendar::get_heading_array($year, $month),
+                               'period'                                        
        => month_calendar::get_month_name($month-1),
                        );
                        
                        self::render_template_xsl( 
array('calendar/view_calendar_month_for_locations', 
'calendar/check_list_status_checker', 'calendar/icon_color_map'), $data);

Modified: trunk/controller/inc/component/class.month_calendar.inc.php
===================================================================
--- trunk/controller/inc/component/class.month_calendar.inc.php 2012-05-09 
11:26:12 UTC (rev 9334)
+++ trunk/controller/inc/component/class.month_calendar.inc.php 2012-05-09 
11:50:05 UTC (rev 9335)
@@ -44,9 +44,9 @@
        
        function init_calendar(){
 
-               $this->calendar_array = array();
+               $num_days_in_month = cal_days_in_month(CAL_GREGORIAN, 
$this->month, $this->year);
                
-               for($i=1;$i<=$num;$i++){
+               for($i=1;$i<=$num_days_in_month;$i++){
                        $this->calendar_array[$i] = null;
                }
                
@@ -69,6 +69,24 @@
                }
        }
        
+       public static function get_heading_array($year, $month){
+               $num_days_in_month = cal_days_in_month(CAL_GREGORIAN, $month, 
$year);           
+               $heading_array = array();
+               
+               for($i=1;$i<=$num_days_in_month;$i++){
+                       $heading_array[$i] = "$i";      
+               }
+               
+               return $heading_array;
+       }
+       
+       public static function get_month_name($month){
+       
+               $month_array = array("Januar", "Februar", "Mars", "April", 
"Mai", "Juni", "Juli", "August", "September", "Oktober", "November", 
"Desember");
+               
+               return $month_array[$month]; 
+       }
+               
        // Function that puts checklists into a twelve months array for 
displaying a year or a days array for displaying a month
        public function build_calendar( $check_lists_array ){
                

Modified: trunk/controller/templates/base/calendar/view_calendar_month.xsl
===================================================================
--- trunk/controller/templates/base/calendar/view_calendar_month.xsl    
2012-05-09 11:26:12 UTC (rev 9334)
+++ trunk/controller/templates/base/calendar/view_calendar_month.xsl    
2012-05-09 11:50:05 UTC (rev 9335)
@@ -78,13 +78,13 @@
                        <ul class="calendar month">
                                <li class="heading">
                                        <div class="control_details_wrp">
-                                               <div class="title">Tittel</div>
-                                               <div 
class="assigned">Tildelt</div>
-                                               <div 
class="frequency">Frekvens</div>
+                                               <div 
class="title"><span>Tittel</span></div>
+                                               <div 
class="assigned"><span>Tildelt</span></div>
+                                               <div 
class="frequency"><span>Frekvens</span></div>
                                        </div>
                                        <div class="days_wrp">
                                                <xsl:for-each 
select="heading_array">
-                                                       <div><xsl:value-of 
select="."/></div>
+                                                       
<div><span><xsl:value-of select="."/></span></div>
                                                </xsl:for-each>
                                        </div>
                                </li>
@@ -104,14 +104,16 @@
                                        
                                        <div class="control_details_wrp">
                                                <div class="title">
-                                               <xsl:value-of 
select="control/title"/>
+                                               <span><xsl:value-of 
select="control/title"/></span>
                                                </div>
                                                <div class="assigned">
-                                               <xsl:value-of 
select="control/responsibility_name"/>
+                                               <span><xsl:value-of 
select="control/responsibility_name"/></span>
                                                </div>
                                                <div class="frequency">
-                                               <xsl:value-of 
select="control/repeat_type_label"/>
-                                               <xsl:value-of 
select="control/repeat_interval"/>
+                                               <span>
+                                                       <xsl:value-of 
select="control/repeat_type_label"/>
+                                                       <xsl:value-of 
select="control/repeat_interval"/>
+                                               </span>
                                                </div>
                                
                        </div>

Modified: trunk/controller/templates/base/calendar/view_calendar_year.xsl
===================================================================
--- trunk/controller/templates/base/calendar/view_calendar_year.xsl     
2012-05-09 11:26:12 UTC (rev 9334)
+++ trunk/controller/templates/base/calendar/view_calendar_year.xsl     
2012-05-09 11:50:05 UTC (rev 9335)
@@ -48,12 +48,9 @@
                <ul class="calendar">
                                <li class="heading">
                                <div class="control_details_wrp">
-                                       <xsl:if test="show_location">
-                                               <div 
class="location">Lokasjon</div>
-                                       </xsl:if>
-                                       <div class="title">Tittel</div>
-                                       <div class="assigned">Tildelt</div>
-                                       <div class="frequency">Frekvens</div>
+                                       <div 
class="title"><span>Tittel</span></div>
+                                       <div 
class="assigned"><span>Tildelt</span></div>
+                                       <div 
class="frequency"><span>Frekvens</span></div>
                                        </div>
                                        <div class="months_wrp">
                                        <xsl:for-each select="heading_array">
@@ -98,13 +95,13 @@
                                                                </div>
                                                        </xsl:if>
                                                        <div class="title">
-                                                       <xsl:value-of 
select="control/title"/>
+                                                       <span><xsl:value-of 
select="control/title"/></span>
                                                        </div>
                                                        <div class="assigned">
-                                                       <xsl:value-of 
select="control/responsibility_name"/>
+                                                       <span><xsl:value-of 
select="control/responsibility_name"/></span>
                                                        </div>
                                                        <div class="frequency">
-                                                       <xsl:value-of 
select="control/repeat_type_label"/>
+                                                       <span><xsl:value-of 
select="control/repeat_type_label"/></span>
                                                        </div>
                                                </div>          
                                                <div class="months_wrp">

Modified: trunk/controller/templates/base/case/view_case_message.xsl
===================================================================
--- trunk/controller/templates/base/case/view_case_message.xsl  2012-05-09 
11:26:12 UTC (rev 9334)
+++ trunk/controller/templates/base/case/view_case_message.xsl  2012-05-09 
11:50:05 UTC (rev 9335)
@@ -13,7 +13,7 @@
        <h3 class="box_header ext">Melding registrert</h3>
        <div id="caseMessage" class="box ext">
                
-                       <a id="showMessage">
+                       <a id="showMessage" target="_blank">
                                <xsl:attribute name="href">
                                        
<xsl:text>index.php?menuaction=property.uitts.view</xsl:text>
                                        <xsl:text>&amp;id=</xsl:text>

Modified: trunk/controller/templates/base/css/base.css
===================================================================
--- trunk/controller/templates/base/css/base.css        2012-05-09 11:26:12 UTC 
(rev 9334)
+++ trunk/controller/templates/base/css/base.css        2012-05-09 11:50:05 UTC 
(rev 9335)
@@ -962,10 +962,6 @@
     font-weight: bold;
     font-size:15px;
 }
-.control_details_wrp div{
-       width: 100px;
-       float:left;
-}
 .days_wrp div {
     float: left;
     font-size: 13px;
@@ -979,6 +975,10 @@
     text-align: center;
     width: 40px;
 }
+.months_wrp div a, .days_wrp div a, .control_details_wrp span, .days_wrp div 
span {
+    display: block;
+    padding: 8px 0;
+}
 ul.calendar li {
     height: 30px;
     padding: 7px 0;
@@ -994,13 +994,11 @@
     clear: both;
     padding: 1em;
 }
-.control_details_wrp div{
-   float:left;
-}
 .control_details_wrp div {
     float: left;
     height: 30px;
     padding: 0 10px;
+    width: 100px;
 }
 .control_details_wrp div.title {
     width: 200px;
@@ -1039,10 +1037,7 @@
     display: block;
     font-size: 10px;
     font-weight: bold;
-    left: 18px;
-    position: absolute;
     text-decoration: none;
-    top: 8px;
 }
 .days_wrp a.view_info_box {
     left: 8px;




reply via email to

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