fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8859] Merge 8851:8858 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [8859] Merge 8851:8858 from trunk
Date: Tue, 14 Feb 2012 12:23:31 +0000

Revision: 8859
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8859
Author:   sigurdne
Date:     2012-02-14 12:23:27 +0000 (Tue, 14 Feb 2012)
Log Message:
-----------
Merge 8851:8858 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
    branches/Version-1_0-branch/controller/inc/class.socontrol_group.inc.php
    branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicase.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
    
branches/Version-1_0-branch/controller/inc/class.uicontrol_group_component.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicontrol_location.inc.php
    branches/Version-1_0-branch/controller/inc/class.uidocument.inc.php
    branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php
    
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
    branches/Version-1_0-branch/controller/js/controller/ajax.js
    branches/Version-1_0-branch/controller/setup/phpgw_no.lang
    
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
    branches/Version-1_0-branch/controller/templates/base/control/control.xsl
    
branches/Version-1_0-branch/controller/templates/base/control_location/register_control_to_location.xsl
    branches/Version-1_0-branch/controller/templates/base/css/base.css
    
branches/Version-1_0-branch/controller/templates/base/procedure/print_procedure.xsl
    
branches/Version-1_0-branch/controller/templates/base/view_component_for_control_group.xsl
    branches/Version-1_0-branch/property/inc/class.sos_agreement.inc.php

Property Changed:
----------------
    branches/Version-1_0-branch/


Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066,8068-8087,8089,8091-8108,8110-8124,8126-8129,8131,8133-8150,8152-8154,8156-8162,8164-8167,8169-8170,8172-8179,8181,8183-8196,8198-8207,8209-8211,8213-8214,8216-8217,8219-8220,8222,8224-8225,8227-8247,8249,8251,8253-8282,8284-8352,8354-8368,8370-8396,8398-8430,8432,8434-8440,8442-8445,8447-8453,8455-8456,8458,8460,8462-8464,8466-8473,8475-8479,8481,8483-8501,8503-8523,8525,8527-8531,8533,8535-8536,8538-8550,8552-8554,8556-8557,8559-8579,8581-8587,8589,8591-8592,8594-8595,8597-8601,8603-8610,8612-8613,8615,8617,8619-8645,8647-8650,8652-8661,8663-8666,8668-8669,8671-8683,8685-8691,8693-8730,8732-8737,8739,8741-8767,8769,8771-8772,8774,8776-8797,8799-8812,8814-8819,8821,8823-8833,8835-8837,8839,8841,8843-8849
   + 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066,8068-8087,8089,8091-8108,8110-8124,8126-8129,8131,8133-8150,8152-8154,8156-8162,8164-8167,8169-8170,8172-8179,8181,8183-8196,8198-8207,8209-8211,8213-8214,8216-8217,8219-8220,8222,8224-8225,8227-8247,8249,8251,8253-8282,8284-8352,8354-8368,8370-8396,8398-8430,8432,8434-8440,8442-8445,8447-8453,8455-8456,8458,8460,8462-8464,8466-8473,8475-8479,8481,8483-8501,8503-8523,8525,8527-8531,8533,8535-8536,8538-8550,8552-8554,8556-8557,8559-8579,8581-8587,8589,8591-8592,8594-8595,8597-8601,8603-8610,8612-8613,8615,8617,8619-8645,8647-8650,8652-8661,8663-8666,8668-8669,8671-8683,8685-8691,8693-8730,8732-8737,8739,8741-8767,8769,8771-8772,8774,8776-8797,8799-8812,8814-8819,8821,8823-8833,8835-8837,8839,8841,8843-8849,8852-8858

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php   
2012-02-14 12:20:44 UTC (rev 8858)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php   
2012-02-14 12:23:27 UTC (rev 8859)
@@ -43,6 +43,11 @@
                (
                        'name'       => 'get_groups',
                        'decription' => 'Get list of groups'
+               ),
+               array
+               (
+                       'name'       => 'debug_xmlrpc',
+                       'decription' => 'Return incoming params'
                )
        );
 
@@ -792,6 +797,16 @@
 //     _debug_array($groups);
                return $groups;
        }
+
+
+       /*
+       * Return incoming
+       */
+       function debug_xmlrpc($data = array())
+       {
+               return $data;
+       }
+
        
        function get_group_info($group_id)
        {

Modified: 
branches/Version-1_0-branch/controller/inc/class.socontrol_group.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socontrol_group.inc.php    
2012-02-14 12:20:44 UTC (rev 8858)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol_group.inc.php    
2012-02-14 12:23:27 UTC (rev 8859)
@@ -418,4 +418,34 @@
                        $sql =  "INSERT INTO 
controller_control_group_component_list (control_group_id, component_id) 
values($control_group_id, $component_id)";
                        $this->db->query($sql);
                }
+               
+               function get_control_group_ids_for_control($control_id)
+               {
+                       $results = array();
+
+                       $sql = "select distinct(cg.id) from 
controller_control_group cg, controller_control_item ci, 
controller_control_item_list cil where cil.control_id = {$control_id} and ci.id 
= cil.control_item_id and cg.id = ci.control_group_id";
+                       $this->db->query($sql, __LINE__, __FILE__);
+
+                       while ($this->db->next_record())
+                       {
+                               $results[] = $this->db->f('id');
+                       }
+
+                       return $results;
+               }
+               
+               function get_components_for_control_group($control_group_id)
+               {
+                       $results = array();
+                       
+                       $sql = "select * from 
controller_control_group_component_list where 
control_group_id={$control_group_id}";
+                       $this->db->query($sql, __LINE__, __FILE__);
+
+                       while ($this->db->next_record())
+                       {
+                               $results[] = $this->db->f('component_id');
+                       }
+
+                       return $results;
+               }
        }

Modified: 
branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php     
2012-02-14 12:20:44 UTC (rev 8858)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php     
2012-02-14 12:23:27 UTC (rev 8859)
@@ -300,5 +300,49 @@
 
                        return $control_item;
                }
+               
+               function get_control_items_for_component($control_group_id, 
$location_code)
+               {
+                       $results = array();
+                       $sql1 = "select distinct(cg.id) from 
controller_control_group cg, controller_control_item ci, 
controller_control_item_list cil where cil.control_id = {$control_id} and ci.id 
= cil.control_item_id and cg.id = ci.control_group_id";
+                       //var_dump($sql1);
+                       $this->db->query($sql1, __LINE__, __FILE__);
 
+                       while ($this->db->next_record()) {
+                               $results[] = array('control_group' => 
$this->db->f('id'));
+                       }
+
+                       return $results;
+                       
+               }
+               
+               function location_has_component($comp, $location_code)
+               {
+                       return true;
+               }
+               
+               function get_items_for_control_group($control_id, 
$control_group_id)
+               {
+                       $results = array();
+                       
+                       $sql = "select ci.* from controller_control_item ci, 
controller_control_item_list cil where ci.control_group_id = 
{$control_group_id} and cil.control_id = {$control_id} and ci.id = 
cil.control_item_id";
+                       //var_dump($sql);
+                       $this->db->query($sql, __LINE__, __FILE__);
+                       
+                       while($this->db->next_record())
+                       {
+                               //create check_item and add to return array
+                               $control_item = new 
controller_control_item($this->unmarshal($this->db->f('id', true), 'int'));
+                               
$control_item->set_title($this->unmarshal($this->db->f('title', true), 
'string'));
+                               
$control_item->set_required($this->unmarshal($this->db->f('required', true), 
'boolean'));
+                               
$control_item->set_type($this->unmarshal($this->db->f('type', true), 'string'));
+                               
$control_item->set_what_to_do($this->unmarshal($this->db->f('what_to_do', 
true), 'string'));
+                               
$control_item->set_how_to_do($this->unmarshal($this->db->f('how_to_do', true), 
'string'));
+                               
$control_item->set_control_group_id($this->unmarshal($this->db->f('control_group_id',
 true), 'int'));
+
+                               $results[] = $control_item;
+                       }
+                       return $results;
+               }
+
        }

Modified: branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php 
2012-02-14 12:20:44 UTC (rev 8858)
+++ branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php 
2012-02-14 12:23:27 UTC (rev 8859)
@@ -110,10 +110,13 @@
                        
                        $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
                        $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
                        $controls_with_check_list = 
$this->populate_controls_with_check_lists($controls_for_location_array, 
$control_id_with_check_list_array);
                        
                        $controls_calendar_array = array();
@@ -188,7 +191,7 @@
                        $my_locations = $location_finder->get_responsibilities( 
$criteria );
                        
                        if(empty($location_code)){
-                               $location_code = 
$my_locations[0]["location_code"];     
+                               $location_code = 
$my_locations[0]["location_code"];
                        }
                        
                        $repeat_type = null;
@@ -202,7 +205,7 @@
                        // Puts aggregate values for daily controls in a twelve 
month array 
                        foreach($controls_for_location_array as $control){
                                if($control->get_repeat_type() == 0 | 
$control->get_repeat_type() == 1){
-                                       $controls_calendar_array = 
$this->calendar_builder->build_agg_calendar_array($controls_calendar_array, 
$control, $location_code, $year);
+                                       $controls_calendar_array = 
$this->calendar_builder->build_agg_calendar($controls_calendar_array, $control, 
$location_code, $year);
                                }
                        }
                        
@@ -211,6 +214,11 @@
                        
                        $controls_calendar_array = 
$this->calendar_builder->build_calendar_array( $controls_calendar_array, 
$control_check_list_array, 12, "view_months" );
                        
+                       $repeat_type = 3;
+                       $control_check_list_array = 
$this->so->get_check_lists_for_location( $location_code, $from_date_ts, 
$to_date_ts, $repeat_type );
+                       
+                       $controls_calendar_array = 
$this->calendar_builder->build_calendar_array( $controls_calendar_array, 
$control_check_list_array, 12, "view_months" );
+                       
                        $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
                        
                        $heading_array = array("Jan", "Feb", "Mar", "Apr", 
"Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des");
@@ -232,7 +240,7 @@
                        self::add_javascript('controller', 'controller', 
'jquery.js');
                        self::add_javascript('controller', 'controller', 
'ajax.js');
                }
-               
+               /*
                public function view_calendar_for_locations()
                {
                        $control_id = phpgw::get_var('control_id');
@@ -300,6 +308,6 @@
                        self::add_javascript('controller', 'controller', 
'jquery.js');
                        self::add_javascript('controller', 'controller', 
'ajax.js');
                }
-               
+               */
                public function query(){}
        }
\ No newline at end of file

Modified: branches/Version-1_0-branch/controller/inc/class.uicase.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicase.inc.php     
2012-02-14 12:20:44 UTC (rev 8858)
+++ branches/Version-1_0-branch/controller/inc/class.uicase.inc.php     
2012-02-14 12:23:27 UTC (rev 8859)
@@ -43,6 +43,8 @@
                private $so;
                private $so_check_list;
                private $so_control;
+               private $so_control_item;
+               private $so_check_item;
                
                var $public_functions = array(
                                                                        
'register_case'                         => true,
@@ -64,6 +66,7 @@
                        $this->so_check_list = 
CreateObject('controller.socheck_list');
                        $this->so_control = 
CreateObject('controller.socontrol');
                        $this->so_check_item = 
CreateObject('controller.socheck_item');
+                       $this->so_control_item = 
CreateObject('controller.socontrol_item');
                }       
                
                function register_case(){
@@ -154,7 +157,12 @@
                                $status_checker = new status_checker();
                                $status_checker->update_check_list_status( 
$check_list_id );
                                                
-                               return json_encode( array( "status" => "saved", 
"case" => $case->toArray() ) );
+                               $check_item = 
$this->so_check_item->get_single($case->get_check_item_id());
+                               $control_item = 
$this->so_control_item->get_single($check_item->get_control_item_id());
+                               
+                               $type = $control_item->get_type();
+                               
+                               return json_encode( array( "status" => "saved", 
"type" => $type, "caseObj" => $case->toArray() ) );
                        }
                        else
                                return json_encode( array( "status" => 
"not_saved" ) );

Modified: branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php       
2012-02-14 12:20:44 UTC (rev 8858)
+++ branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php       
2012-02-14 12:23:27 UTC (rev 8859)
@@ -48,6 +48,7 @@
                private $so_check_item;
                private $so_procedure;
                private $so_control_group_list;
+               private $so_control_group;
                private $so_control_item_list;
        
                var $public_functions = array(
@@ -84,6 +85,7 @@
                        $this->so_check_item            = 
CreateObject('controller.socheck_item');
                        $this->so_procedure                     = 
CreateObject('controller.soprocedure');
                        $this->so_control_group_list = 
CreateObject('controller.socontrol_group_list');
+                       $this->so_control_group         = 
CreateObject('controller.socontrol_group');
                        $this->so_control_item_list = 
CreateObject('controller.socontrol_item_list');
 
                        
self::set_active_menu('controller::control::check_list');
@@ -527,6 +529,40 @@
                                }
                        }
                        
+                       //get control items based on control group/component 
connection
+                       $control_groups_for_control = 
$this->so_control_group->get_control_group_ids_for_control($control->get_id());
+                       //_debug_array($control_groups_for_control);
+                       foreach($control_groups_for_control as $cg)
+                       {
+                               $components_for_control_group[] = array($cg => 
$this->so_control_group->get_components_for_control_group($cg));
+                       }
+                       //_debug_array($components_for_control_group);
+                       $control_group_check_items = array();
+                       foreach($components_for_control_group as $cg_components)
+                       {
+                               foreach($control_groups_for_control as 
$cg_control)
+                               {
+                                       $components = 
$cg_components[$cg_control];
+                                       //_debug_array($components);
+                                       $location_has_component = false;
+                                       foreach($components as $comp)
+                                       {
+                                               if(!$location_has_component)
+                                               {
+                                                       //check if current 
location has component
+                                                       $location_has_component 
= $this->so_control_item->location_has_component($comp, 
$check_list->get_location_code);
+                                               }
+                                       }
+                                       if($location_has_component)
+                                       {
+                                               //the check items for the 
control group shall be added
+                                               $check_items = 
$this->so_control_item->get_items_for_control_group($control->get_id(), 
$cg_control);
+                                               $control_group_check_items[] = 
$check_items;
+                                       }
+                               }
+                       }
+                       //_debug_array($control_group_check_items);
+                       
                        // Makes control items list stripped for closed check 
items of type measurement                 
                        foreach($control_items as $control_item){
                                if( !in_array($control_item->get_id(), 
$remove_control_item_ids_array) ){

Modified: 
branches/Version-1_0-branch/controller/inc/class.uicontrol_group_component.inc.php
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/class.uicontrol_group_component.inc.php
  2012-02-14 12:20:44 UTC (rev 8858)
+++ 
branches/Version-1_0-branch/controller/inc/class.uicontrol_group_component.inc.php
  2012-02-14 12:23:27 UTC (rev 8859)
@@ -331,6 +331,9 @@
                        $allrows                                = 
phpgw::get_var('allrows', 'bool');
                        $location_code                  = 
phpgw::get_var('location_code');*/
 
+                       $control_group_id = phpgw::get_var('control_group_id');
+                       //var_dump($control_group_id);
+                       
                        $type_id = phpgw::get_var('bim_type_id');
 
                        $start = phpgw::get_var('startIndex');

Modified: 
branches/Version-1_0-branch/controller/inc/class.uicontrol_location.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol_location.inc.php 
2012-02-14 12:20:44 UTC (rev 8858)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol_location.inc.php 
2012-02-14 12:23:27 UTC (rev 8859)
@@ -141,7 +141,7 @@
                                                ),
                                                array(
                                                        'key'   =>      'title',
-                                                       'label' =>      
lang('Property name'),
+                                                       'label' =>      
lang('Control title'),
                                                        'sortable'      =>      
false
                                                ),
                                                array(
@@ -151,7 +151,7 @@
                                                ),
                                                array(
                                                        'key' => 'loc1_name',
-                                                       'label' => 
lang('Location_name'),
+                                                       'label' => 
lang('Property name'),
                                                        'sortable'      => false
                                                ),
                                                array(

Modified: branches/Version-1_0-branch/controller/inc/class.uidocument.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uidocument.inc.php 
2012-02-14 12:20:44 UTC (rev 8858)
+++ branches/Version-1_0-branch/controller/inc/class.uidocument.inc.php 
2012-02-14 12:23:27 UTC (rev 8859)
@@ -220,7 +220,7 @@
                                
$document->set_name($_FILES["file_path"]["name"]);
                                
$document->set_type_id(phpgw::get_var('document_type'));
                                $desc = 
phpgw::get_var('document_description','html');
-                               var_dump($desc);
+                               //var_dump($desc);
                                $document->set_description($desc);
                                $document->set_procedure_id($procedure_id);
                                //var_dump($document);

Modified: branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php        
2012-02-14 12:20:44 UTC (rev 8858)
+++ branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php        
2012-02-14 12:23:27 UTC (rev 8859)
@@ -553,7 +553,8 @@
                        (
                                'location'      => $location_array,
                                'control'       => $control->toArray(),
-                               'procedure'     => $procedure->toArray()
+                               'procedure'     => $procedure->toArray(),
+                               'dateformat'                    => 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']
                        );
                        
                        if( !empty($control_group_id) ){

Modified: 
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
 2012-02-14 12:20:44 UTC (rev 8858)
+++ 
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
 2012-02-14 12:23:27 UTC (rev 8859)
@@ -76,7 +76,7 @@
                return $controls_calendar_array;
        }
        
-       public function build_agg_calendar_array($controls_calendar_array, 
$control, $location_code, $year){
+       public function build_agg_calendar($controls_calendar_array, $control, 
$location_code, $year){
                                
                if( date("Y", $control->get_start_date()) == $year ){
                        $from_month = date("n", $control->get_start_date());    

Modified: branches/Version-1_0-branch/controller/js/controller/ajax.js
===================================================================
--- branches/Version-1_0-branch/controller/js/controller/ajax.js        
2012-02-14 12:20:44 UTC (rev 8858)
+++ branches/Version-1_0-branch/controller/js/controller/ajax.js        
2012-02-14 12:23:27 UTC (rev 8859)
@@ -523,8 +523,8 @@
                                  var jsonObj = jQuery.parseJSON(data);
                 
                                  if(jsonObj.status == "saved"){
-                                       //  var case_id = "#case_" + 
jsonObj.case.id; 
-                                       //  var case_descr = jsonObj.case.descr;
+                                         var case_id = "#case_" + 
jsonObj.caseObj.id; 
+                                         var case_descr = 
jsonObj.caseObj.descr;
                                          
                                          $(case_id).show();
                                          
$(case_id).find(".case_descr").text(case_descr);
@@ -532,8 +532,7 @@
                                          }
                                  }
                          }
-               });
-               
+               });     
        });
        
        $("a.quick_edit").live("click", function(e){

Modified: branches/Version-1_0-branch/controller/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/controller/setup/phpgw_no.lang  2012-02-14 
12:20:44 UTC (rev 8858)
+++ branches/Version-1_0-branch/controller/setup/phpgw_no.lang  2012-02-14 
12:23:27 UTC (rev 8859)
@@ -255,6 +255,7 @@
 Procedure attachment   controller      no      Vedlegg
 Procedure start date   controller      no      Start dato
 Procedure end date     controller      no      Slutt dato
+Procedure valid from date      controller      no      Gyldig fra
 New control item       controller      no      Nytt kontrollpunkt
 Control item title     controller      no      Tittel
 Control_group  controller      no      Kontrollgruppe

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
 2012-02-14 12:20:44 UTC (rev 8858)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/add_check_list.xsl
 2012-02-14 12:23:27 UTC (rev 8859)
@@ -8,12 +8,16 @@
                $( "#planned_date" ).datepicker({ 
                        monthNames: 
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
                        dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 'Fr', 'Lø'],
-                       dateFormat: 'dd/mm-yy' 
+                       dateFormat: 'dd/mm-yy',
+                       changeMonth: true,
+                       changeYear: true
                });
                $( "#completed_date" ).datepicker({ 
                        monthNames: 
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
                        dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 'Fr', 'Lø'],
-                       dateFormat: 'dd/mm-yy' 
+                       dateFormat: 'dd/mm-yy',
+                       changeMonth: true,
+                       changeYear: true 
                });
        });
 </script>

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
        2012-02-14 12:20:44 UTC (rev 8858)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
        2012-02-14 12:23:27 UTC (rev 8859)
@@ -9,17 +9,23 @@
                        $( "#planned_date" ).datepicker({ 
                                monthNames: 
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
                                dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 
'Fr', 'Lø'],
-                               dateFormat: 'dd/mm-yy' 
+                               dateFormat: 'dd/mm-yy',
+                               changeMonth: true,
+                               changeYear: true
                        });
                        $( "#completed_date" ).datepicker({ 
                                monthNames: 
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
                                dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 
'Fr', 'Lø'],
-                               dateFormat: 'dd/mm-yy' 
+                               dateFormat: 'dd/mm-yy',
+                               changeMonth: true,
+                               changeYear: true 
                        });
                        $( "#deadline_date" ).datepicker({ 
                                monthNames: 
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
                                dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 
'Fr', 'Lø'],
-                               dateFormat: 'dd/mm-yy' 
+                               dateFormat: 'dd/mm-yy',
+                               changeMonth: true,
+                               changeYear: true 
                        });
                        
                });

Modified: 
branches/Version-1_0-branch/controller/templates/base/control/control.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/control/control.xsl   
2012-02-14 12:20:44 UTC (rev 8858)
+++ branches/Version-1_0-branch/controller/templates/base/control/control.xsl   
2012-02-14 12:23:27 UTC (rev 8859)
@@ -13,12 +13,16 @@
                        $( "#start_date" ).datepicker({ 
                                monthNames: 
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
                                dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 
'Fr', 'Lø'],
-                               dateFormat: 'd/m-yy' 
+                               dateFormat: 'd/m-yy',
+                               changeMonth: true,
+                               changeYear: true 
                        });
                        $( "#end_date" ).datepicker({ 
                                monthNames: 
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
                                dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 
'Fr', 'Lø'],
-                               dateFormat: 'd/m-yy' 
+                               dateFormat: 'd/m-yy',
+                               changeMonth: true,
+                               changeYear: true
                        });     
                });
        </script>

Modified: 
branches/Version-1_0-branch/controller/templates/base/control_location/register_control_to_location.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/control_location/register_control_to_location.xsl
     2012-02-14 12:20:44 UTC (rev 8858)
+++ 
branches/Version-1_0-branch/controller/templates/base/control_location/register_control_to_location.xsl
     2012-02-14 12:23:27 UTC (rev 8859)
@@ -33,10 +33,14 @@
 </xsl:template>
 
 <xsl:template match="control_filters" name="control_filters" 
xmlns:php="http://php.net/xsl";>
-       <div style="margin: 10px;padding: 10px; width: 25%;">
-               
-               <!-- When control area is chosen, an ajax request is executed. 
The operation fetches controls from db and populates the control list.
-                        The ajax opearation is handled in ajax.js --> 
+       
+       <div id="choose_control">
+               <!-- 
+                       When control area is chosen, an ajax request is 
executed. 
+                       The operation fetches controls from db and populates 
the control list.
+                       The ajax opearation is handled in ajax.js 
+               -->
+                <div class="error_msg">Du må velge kontroll før du kan legge 
til bygg</div> 
                 <select style="float:left;" id="control_area_list" 
name="control_area_list">
                        <option value="">Velg kontrollområde</option>
                        <xsl:for-each select="control_areas_array2">
@@ -69,6 +73,7 @@
 </xsl:template>
 
 <xsl:template match="filter_form" xmlns:php="http://php.net/xsl";>
+
        <form id="queryForm">
                <xsl:attribute name="method">
                        <xsl:value-of select="phpgw:conditional(not(method), 
'GET', method)"/>
@@ -80,13 +85,11 @@
                <xsl:call-template name="filter_list"/>
        </form>
        
-       <form id="update_table_dummy" method='POST' action='' >
-       </form>
+       <form id="update_table_dummy" method='POST' action='' ></form>
 
 </xsl:template>
 
 <xsl:template name="filter_list" xmlns:php="http://php.net/xsl";>
-       <div>
          <ul id="filters">
                <li>
                  <select id="type_id" name="type_id">
@@ -138,8 +141,6 @@
                        <input type="submit" name="search" 
value="{$lang_search}" title = "{$lang_search}" />
                  </li>                 
          </ul>
-       
-       </div>
 </xsl:template>
 
 <xsl:template match="datatable" xmlns:php="http://php.net/xsl";>
@@ -173,15 +174,29 @@
        
        function saveLocationToControl()
        {
+               var control_id_value = 
document.getElementById('control_id').value;
+               
+               if( !(control_id_value > 0) ){
+                       var choose_control_elem = 
document.getElementById('choose_control');
+                       var error_elem = 
YAHOO.util.Dom.getElementsByClassName('error_msg')[0];
+                                               
+                       error_elem.style.display = 'block';
+                       
+                       return false;
+               }else{
+                       var error_elem = 
YAHOO.util.Dom.getElementsByClassName('error_msg')[0];
+                       error_elem.style.display = 'none';
+               }
+                               
                var divs = 
YAHOO.util.Dom.getElementsByClassName('location_submit');
                var mydiv = divs[divs.length-1];
 
                // styles for dont show
-               mydiv.style.display = "none";
+               
 
                valuesForPHP = 
YAHOO.util.Dom.getElementsByClassName('mychecks');
                var values_return = ""; //new Array(); 
-               
+                       
                for(i=0;i<valuesForPHP.length;i++)
                {
                        if(valuesForPHP[i].children[0].children[0].checked)
@@ -193,8 +208,20 @@
                        }
                }
                
-               var control_id_value = 
document.getElementById('control_id').value;
+               if( !(values_return.length > 0) ){
+                       var datatable_container_elem = 
document.getElementById('datatable-container');
+                       var error_elem = 
YAHOO.util.Dom.getElementsByClassName('error_msg')[1];
+                                               
+                       error_elem.style.display = 'block';
+                       
+                       return false;
+               }else{
+                       var error_elem = 
YAHOO.util.Dom.getElementsByClassName('error_msg')[1];
+                       error_elem.style.display = 'none';
+               }
 
+               mydiv.style.display = "none";
+
                var returnfield = document.createElement('input');
                returnfield.setAttribute('name', 'values_assign');
                returnfield.setAttribute('type', 'text');
@@ -210,7 +237,9 @@
        ]]>
        </script>
        <div id="data_paginator"/>
+       <div class="error_msg" style="margin-left:20px;">Du må velge bygg før 
du kan legge til en kontroll</div>
        <div id="datatable-container"/>
+       
        <xsl:call-template name="datasource-definition" />
        <xsl:variable name="label_submit"><xsl:value-of 
select="php:function('lang', 'save')" /></xsl:variable>
        <xsl:variable name="label_checkAll"><xsl:value-of 
select="php:function('lang', 'invert_checkboxes')" /></xsl:variable>

Modified: branches/Version-1_0-branch/controller/templates/base/css/base.css
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/css/base.css  
2012-02-14 12:20:44 UTC (rev 8858)
+++ branches/Version-1_0-branch/controller/templates/base/css/base.css  
2012-02-14 12:23:27 UTC (rev 8859)
@@ -1332,3 +1332,24 @@
        padding: 20px;
        border: 1px solid #ABABAB;
 }
+
+/* ======================== REGISTER CONTROL FOR LOCATION 
============================== */
+#choose_control{
+       margin: 10px;
+       padding: 10px; 
+       width: 25%;
+}
+.error_msg {
+       color: red;
+    display: none;
+    font-size: 14px;
+    padding: 7px 0;
+}
+
+#control_details #select_all{
+       margin-left: 660px;     
+}
+#control_details #location_form{
+       margin-left: 20px;
+       margin-bottom: 20px;    
+}
\ No newline at end of file

Modified: 
branches/Version-1_0-branch/controller/templates/base/procedure/print_procedure.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/procedure/print_procedure.xsl
 2012-02-14 12:20:44 UTC (rev 8858)
+++ 
branches/Version-1_0-branch/controller/templates/base/procedure/print_procedure.xsl
 2012-02-14 12:23:27 UTC (rev 8859)
@@ -16,7 +16,7 @@
                        <span style="display: inline-block;width: 
600px;"><xsl:value-of select="procedure/control_area_name" /></span>
                </div>
                <div>
-                       <label for="start_date"><xsl:value-of 
select="php:function('lang','Procedure start date')" /></label>
+                       <label for="start_date"><xsl:value-of 
select="php:function('lang','Procedure valid from date')" /></label>
                        <xsl:variable name="startdate"><xsl:value-of 
select="procedure/start_date" /></xsl:variable>
                        <xsl:value-of select="php:function('date', $dateformat, 
$startdate)" />
                </div>
@@ -49,12 +49,8 @@
                </div>
                <div>
                        <label for="reference"><xsl:value-of 
select="php:function('lang','Procedure Reference')" /></label>
-                       <xsl:value-of select="procedure/reference" />
+                       <xsl:value-of select="procedure/reference" 
disable-output-escaping="yes"/>
                </div>
-               <div>
-                       <label for="attachment"><xsl:value-of 
select="php:function('lang','Procedure Attachment')" /></label>
-                       <xsl:value-of select="procedure/attachment" />
-               </div>
                <a href="#print" class="btn" onClick="window.print()">Skriv 
ut</a>              
 </div>
 <style>

Modified: 
branches/Version-1_0-branch/controller/templates/base/view_component_for_control_group.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/view_component_for_control_group.xsl
  2012-02-14 12:20:44 UTC (rev 8858)
+++ 
branches/Version-1_0-branch/controller/templates/base/view_component_for_control_group.xsl
  2012-02-14 12:23:27 UTC (rev 8859)
@@ -38,25 +38,25 @@
                                 </select>
                                 
                                 <form id="loc_form" action="" method="GET">
-                       
-                                       <select id="control_group_id" 
name="control_group_id" style="width: 250px;">
-                                       <xsl:choose>
-                                               <xsl:when 
test="control_group_array/child::node()">
-                                                       <xsl:for-each 
select="control_group_array">
-                                                               <xsl:variable 
name="control_group_id"><xsl:value-of select="id"/></xsl:variable>
-                                                               <option 
value="{$control_group_id}">
-                                                                       
<xsl:value-of select="group_name"/>
-                                                               </option>       
                        
-                                                       </xsl:for-each>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <option>
-                                                               Ingen 
kontrollgrupper
-                                                       </option>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                               
-                                       </select>
+                                       <div id="control_group_id_div">
+                                               <select id="control_group_id" 
name="control_group_id" style="width: 250px;">
+                                               <xsl:choose>
+                                                       <xsl:when 
test="control_group_array/child::node()">
+                                                               <xsl:for-each 
select="control_group_array">
+                                                                       
<xsl:variable name="c_g_id"><xsl:value-of select="id"/></xsl:variable>
+                                                                       <option 
value="{c_g_id}">
+                                                                               
<xsl:value-of select="group_name"/>
+                                                                       
</option>                               
+                                                               </xsl:for-each>
+                                                       </xsl:when>
+                                                       <xsl:otherwise>
+                                                               <option>
+                                                                       Ingen 
kontrollgrupper
+                                                               </option>
+                                                       </xsl:otherwise>
+                                               </xsl:choose>
+                                               </select>
+                                       </div>
                                </form>
                        </div>
                        

Modified: branches/Version-1_0-branch/property/inc/class.sos_agreement.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sos_agreement.inc.php        
2012-02-14 12:20:44 UTC (rev 8858)
+++ branches/Version-1_0-branch/property/inc/class.sos_agreement.inc.php        
2012-02-14 12:23:27 UTC (rev 8859)
@@ -284,18 +284,30 @@
 
                        if ($order)
                        {
-                               switch ($order)
+                               if(!$detail)
                                {
-                                       case 'id':
-                                       case 'status':
-                                               $ordermethod = " ORDER BY 
{$entity_table}.{$order} {$sort}";
-                                               break;
-                                       case 'category':
-                                               $ordermethod = " ORDER BY 
{$category_table}.descr {$sort}";                                     
-                                               break;
-                                       default:
-                                               $ordermethod = " ORDER BY 
{$order} {$sort}";
+                                       switch ($order)
+                                       {
+                                               case 'id':
+                                               case 'status':
+                                                       $ordermethod = " ORDER 
BY {$entity_table}.{$order} {$sort}";
+                                                       break;
+                                               case 'category':
+                                                       $ordermethod = " ORDER 
BY {$category_table}.descr {$sort}";                                     
+                                                       break;
+                                               default:
+                                                       $ordermethod = " ORDER 
BY {$order} {$sort}";
+                                       }
                                }
+                               else
+                               {
+                                       switch ($order)
+                                       {
+                                               case 'id':
+                                                       $ordermethod = " ORDER 
BY {$entity_table}.{$order} {$sort}";
+                                                       break;
+                                       }
+                               }
                        }
                        else
                        {




reply via email to

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