fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [9929] Merge 9920:9928 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [9929] Merge 9920:9928 from trunk
Date: Wed, 29 Aug 2012 12:48:14 +0000

Revision: 9929
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9929
Author:   sigurdne
Date:     2012-08-29 12:48:14 +0000 (Wed, 29 Aug 2012)
Log Message:
-----------
Merge 9920:9928 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
    
branches/Version-1_0-branch/activitycalendar/inc/class.uiorganization.inc.php
    
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_edit.php
    
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new.php
    
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new_step_1.php
    
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/organization_edit.php
    branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
    branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
    
branches/Version-1_0-branch/controller/inc/component/class.year_calendar_agg.inc.php
    branches/Version-1_0-branch/controller/inc/hook_home.inc.php
    branches/Version-1_0-branch/controller/inc/model/class.control.inc.php
    branches/Version-1_0-branch/controller/js/controller/ajax.js
    branches/Version-1_0-branch/controller/templates/base/css/base.css
    
branches/Version-1_0-branch/property/inc/cron/default/synkroniser_med_boei.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,8852-8858,8860-8867,8869-8870,8872,8874-8877,8879,8881,8883-8888,8890,8892-8901,8903-8911,8913-8917,8920-8923,8925-8933,8935-8938,8940-8943,8945,8947-8948,8950,8952-8953,8955-8962,8964,8966,8968-8970,8972-8975,8977-8983,8985-8993,8995-9001,9003,9005,9007,9009,9011-9019,9021-9023,9025,9027-9028,9030-9044,9046-9047,9049-9050,9052-9056,9058-9059,9061,9063-9064,9066-9068,9071-9092,9094-9112,9114-9117,9119,9121-9160,9162-9166,9169-9207,9209-9211,9213-9215,9217,9219,9221-9253,9255,9257,9259-9260,9262,9264-9269,9271-9273,9275,9277-9278,9280,9282-9283,9285-9289,9291-9299,9301-9310,9312-9313,9315-9320,9322-9324,9326-9338,9340-9342,9344,9346-9348,9350-9358,9360-9362,9364-9366,9368-9374,9376-9382,9384,9386,9388-9390,9392-9396,9398-9402,9404-9410,9412,9414,9416-9417,9419-9425,9427,9429-9430,9432,9434-9463,9465-9502,9504-9506,9508-9521,9523-9526,9528,9530-9537,9539,9541-9551,9553,9555-9556,9558-9578,9580-9581,9583,9585,9587,9589,9591-9624,9626-9655,9657-9700,9702-9726,9728-9729,9731-9749,9751,9753-9754,9756-9832,9834-9836,9838-9839,9841-9846,9848-9850,9852-9858,9860-9863,9865,9867,9869-9871,9873-9893,9895,9897-9912,9914-9919
   + 
/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,8860-8867,8869-8870,8872,8874-8877,8879,8881,8883-8888,8890,8892-8901,8903-8911,8913-8917,8920-8923,8925-8933,8935-8938,8940-8943,8945,8947-8948,8950,8952-8953,8955-8962,8964,8966,8968-8970,8972-8975,8977-8983,8985-8993,8995-9001,9003,9005,9007,9009,9011-9019,9021-9023,9025,9027-9028,9030-9044,9046-9047,9049-9050,9052-9056,9058-9059,9061,9063-9064,9066-9068,9071-9092,9094-9112,9114-9117,9119,9121-9160,9162-9166,9169-9207,9209-9211,9213-9215,9217,9219,9221-9253,9255,9257,9259-9260,9262,9264-9269,9271-9273,9275,9277-9278,9280,9282-9283,9285-9289,9291-9299,9301-9310,9312-9313,9315-9320,9322-9324,9326-9338,9340-9342,9344,9346-9348,9350-9358,9360-9362,9364-9366,9368-9374,9376-9382,9384,9386,9388-9390,9392-9396,9398-9402,9404-9410,9412,9414,9416-9417,9419-9425,9427,9429-9430,9432,9434-9463,9465-9502,9504-9506,9508-9521,9523-9526,9528,9530-9537,9539,9541-9551,9553,9555-9556,9558-9578,9580-9581,9583,9585,9587,9589,9591-9624,9626-9655,9657-9700,9702-9726,9728-9729,9731-9749,9751,9753-9754,9756-9832,9834-9836,9838-9839,9841-9846,9848-9850,9852-9858,9860-9863,9865,9867,9869-9871,9873-9893,9895,9897-9912,9914-9919,9921-9928

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php   
2012-08-29 12:46:40 UTC (rev 9928)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php   
2012-08-29 12:48:14 UTC (rev 9929)
@@ -638,7 +638,6 @@
             if($office_id != null)
             {
                $sql = "SELECT description FROM bb_office where id=$office_id";
-                var_dump($sql);
                $this->db->query($sql, __LINE__, __FILE__);
                while($this->db->next_record()){
                     $result = $this->db->f('description');

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/class.uiorganization.inc.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendar/inc/class.uiorganization.inc.php   
    2012-08-29 12:46:40 UTC (rev 9928)
+++ 
branches/Version-1_0-branch/activitycalendar/inc/class.uiorganization.inc.php   
    2012-08-29 12:48:14 UTC (rev 9929)
@@ -180,7 +180,7 @@
                                {
                                        $error = lang('messages_form_error');
                                }
-                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'activitycalendar.uiorganization.show', 'id' => 
$org->get_id(), 'saved_ok' => 'yes'));
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'activitycalendar.uidashboard.index'));
                        }
                        else if(isset($_POST['update_organization'])) // The 
user has pressed the store button
                        {
@@ -261,7 +261,7 @@
                                $org->set_transferred(true);
                                $so_org->update_local($org);
                                
-                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'activitycalendar.uiorganization.show', 'id' => 
$org->get_id(), 'saved_ok' => 'yes'));
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'activitycalendar.uidashboard.index'));
                        }
                        
                        $contact_persons = 
$so_contact->get_local_contact_persons($org->get_id());

Modified: 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_edit.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_edit.php
       2012-08-29 12:46:40 UTC (rev 9928)
+++ 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_edit.php
       2012-08-29 12:48:14 UTC (rev 9929)
@@ -181,9 +181,9 @@
                alert("Telefonnummer til kontaktperson må fylles ut!");
                return false;
        }
-        if(document.getElementById('contact_phone').value != null && 
(document.getElementById('contact_phone').vaule.length < 8 && 
document.getElementById('contact_phone').value.length > 8))
+        if(document.getElementById('contact_phone').value != null && 
document.getElementById('contact_phone').value.length < 8)
        {
-               alert("Telefonnummer må inneholde 8 siffer!");
+               alert("Telefonnummer må inneholde minst 8 siffer!");
                return false;
        }
        if(document.getElementById('contact_mail').value == null || 
document.getElementById('contact_mail').value == '')

Modified: 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new.php
        2012-08-29 12:46:40 UTC (rev 9928)
+++ 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new.php
        2012-08-29 12:48:14 UTC (rev 9929)
@@ -210,9 +210,9 @@
                alert("Telefonnummer til kontaktperson må fylles ut!");
                return false;
        }
-        if(document.getElementById('contact_phone').value != null && 
(document.getElementById('contact_phone').value.length < 8 || 
document.getElementById('contact_phone').value.length > 8))
+        if(document.getElementById('contact_phone').value != null && 
document.getElementById('contact_phone').value.length < 8)
        {
-               alert("Telefonnummer må inneholde 8 siffer!");
+               alert("Telefonnummer må inneholde minst 8 siffer!");
                return false;
        }
        if(document.getElementById('contact_mail').value == null || 
document.getElementById('contact_mail').value == '')

Modified: 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new_step_1.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new_step_1.php
 2012-08-29 12:46:40 UTC (rev 9928)
+++ 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new_step_1.php
 2012-08-29 12:48:14 UTC (rev 9929)
@@ -149,6 +149,11 @@
                alert("Telefonnummer til kontaktperson må fylles ut!");
                return false;
        }
+        if(document.getElementById('org_contact1_phone').value != null && 
document.getElementById('org_contact1_phone').value.length < 8)
+       {
+               alert("Telefonnummer må inneholde minst 8 siffer!");
+               return false;
+       }
        if(document.getElementById('org_contact1_mail').value == null || 
document.getElementById('org_contact1_mail').value == '')
        {
                alert("E-post for kontaktperson må fylles ut!");

Modified: 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/organization_edit.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/organization_edit.php
   2012-08-29 12:46:40 UTC (rev 9928)
+++ 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/organization_edit.php
   2012-08-29 12:48:14 UTC (rev 9929)
@@ -13,7 +13,7 @@
        //url = 
"/aktivby/registreringsskjema/ny/index.php?menuaction=activitycalendarfrontend.uiactivity.get_address_search&amp;phpgw_return_as=json&amp;search="
 + address;
        url = "<?php echo 
$ajaxURL?>index.php?menuaction=activitycalendarfrontend.uiactivity.get_address_search&amp;phpgw_return_as=json&amp;search="
 + address;
 
-var divcontent_start = "<select name=\"address_select\" id=\"address_select\" 
size\"5\" onChange='setAddressValue(this)'>";
+var divcontent_start = "<select name=\"address_select\" id=\"address_select\" 
size=\"5\" onChange='setAddressValue(this)'>";
 var divcontent_end = "</select>";
        
        var callback = {
@@ -54,6 +54,11 @@
                alert("Telefonnummer til kontaktperson må fylles ut!");
                return false;
        }
+        if(document.getElementById('org_contact1_phone').value != null && 
document.getElementById('org_contact1_phone').value.length < 8)
+       {
+               alert("Telefonnummer må inneholde minst 8 siffer!");
+               return false;
+       }
        if(document.getElementById('org_contact1_mail').value == null || 
document.getElementById('org_contact1_mail').value == '')
        {
                alert("E-post for kontaktperson må fylles ut!");

Modified: branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php       
2012-08-29 12:46:40 UTC (rev 9928)
+++ branches/Version-1_0-branch/controller/inc/class.socheck_list.inc.php       
2012-08-29 12:48:14 UTC (rev 9929)
@@ -246,6 +246,47 @@
                }
        }
        
+       function get_check_list_for_control_by_date($control_id, $deadline_ts, 
$status = null, $location_code, $location_id, $component_id, $type)
+       {
+         $sql  = "SELECT * "; 
+               $sql .= "FROM controller_check_list ";
+               $sql .= "WHERE control_id = {$control_id} ";
+               $sql .= "AND deadline = {$deadline_ts}";                
+
+               if($type == "location")
+               {
+                       $sql .= "AND location_code = '{$location_code}' ";      
+               }
+               else if($type == "component")
+               {
+                       $sql .= "AND location_id = '{$location_id}' AND 
component_id = '{$component_id}' ";
+               }
+               
+               if($status != null)
+               {
+                       $sql .= "AND status = {$status} ";
+               }
+
+               $this->db->query($sql);
+               
+               $check_list = null;
+               if( $this->db->next_record() )
+               {
+                       $check_list = new 
controller_check_list($this->unmarshal($this->db->f('id'), 'int'));
+                       
$check_list->set_status($this->unmarshal($this->db->f('status'), 'int'));
+                       
$check_list->set_comment($this->unmarshal($this->db->f('comment'), 'string'));
+                       
$check_list->set_deadline($this->unmarshal($this->db->f('deadline'), 'int'));
+                       
$check_list->set_planned_date($this->unmarshal($this->db->f('planned_date'), 
'int'));
+                       
$check_list->set_completed_date($this->unmarshal($this->db->f('completed_date'),
 'int'));       
+                       
$check_list->set_component_id($this->unmarshal($this->db->f('component_id'), 
'int'));
+                       
$check_list->set_location_code($this->unmarshal($this->db->f('location_code', 
true), 'string'));
+                       
$check_list->set_num_open_cases($this->unmarshal($this->db->f('num_open_cases'),
 'int'));       
+                       
$check_list->set_num_pending_cases($this->unmarshal($this->db->f('num_pending_cases'),
 'int'));
+               }
+                               
+               return $check_list;
+       }
+       
        /**
         * Get check list objects for a control on a location with set planned 
date
         *
@@ -283,15 +324,12 @@
                $check_list = null;
                while ($this->db->next_record())
                {
-               
                        if( $this->db->f('cl_id') != $check_list_id )
                        {
-                               
                                if($check_list_id)
                                {
                                        $check_list_array[] = $check_list;
                                }
-                               
                                $check_list = new 
controller_check_list($this->unmarshal($this->db->f('cl_id'), 'int'));
                                
$check_list->set_status($this->unmarshal($this->db->f('cl_status'), 'int'));
                                
$check_list->set_comment($this->unmarshal($this->db->f('cl_comment'), 
'string'));

Modified: branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php  
2012-08-29 12:46:40 UTC (rev 9928)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php  
2012-08-29 12:48:14 UTC (rev 9929)
@@ -200,39 +200,34 @@
                 * @param $role_id responsible role for carrying out the 
control  
                 * @return array with controls as objects or arrays
                 */
-
+               
                public function 
get_controls_for_components_by_location($location_code, $from_date, $to_date, 
$repeat_type, $return_type = "return_object", $role_id = 0)
-               {
-                       $role_id = (int) $role_id;
-                       
-                       if($repeat_type != null)
-                       {
-                         $repeat_type = (int) $repeat_type;
-                       }
-
+               {                       
                        $controls_array = array();
                        
                        $sql  = "SELECT distinct c.*, 
fm_responsibility_role.name AS responsibility_name, ccl.location_id, 
ccl.component_id ";
                        $sql .= "FROM controller_control_component_list ccl "; 
-                       $sql .= "LEFT JOIN controller_control c on 
ccl.control_id=c.id ";
+                       $sql .= "LEFT JOIN controller_control c on 
ccl.control_id = c.id ";
                        $sql .= "LEFT JOIN fm_responsibility_role ON 
fm_responsibility_role.id = c.responsibility_id ";
                        $sql .= "LEFT JOIN fm_bim_item ON fm_bim_item.id = 
ccl.component_id ";
-                       $sql .= "WHERE fm_bim_item.loc1 = '$location_code' ";
-                       
+                       $sql .= "WHERE fm_bim_item.location_code LIKE 
'$location_code%' ";
+
                        if( $repeat_type != null)
                        {
+                               $repeat_type = (int) $repeat_type;
                                $sql .= "AND c.repeat_type = $repeat_type ";
                        }
                        if( $role_id)
                        {
+                                       $role_id = (int) $role_id;
                            $sql .= "AND c.responsibility_id = $role_id ";
                        }
                        
-                       $sql .= "AND (c.start_date <= $from_date AND c.end_date 
IS NULL ";
-                       $sql .= "OR c.end_date > $from_date AND c.start_date < 
$to_date)";
+                       $sql .= "AND ((c.start_date <= $to_date AND c.end_date 
IS NULL) ";
+                       $sql .= "OR (c.start_date <= $to_date AND c.end_date > 
$from_date ))";
 
                        $this->db->query($sql);
-                       
+
                        while($this->db->next_record())
                        {
                                $control = new 
controller_control($this->unmarshal($this->db->f('id'), 'int'));
@@ -249,11 +244,8 @@
                                
$control->set_repeat_type($this->unmarshal($this->db->f('repeat_type'), 'int'));
                                
$control->set_repeat_type_label($this->unmarshal($this->db->f('repeat_type'), 
'int'));
                                
$control->set_repeat_interval($this->unmarshal($this->db->f('repeat_interval'), 
'int'));
-//Sigurd 3.august 2010:
-                               
$control->set_location_id($this->unmarshal($this->db->f('location_id'), 'int'));
-                               
$control->set_component_id($this->unmarshal($this->db->f('component_id'), 
'int'));
-//
-                               if($return_type == "return_object")
+
+        if($return_type == "return_object")
                                {
                                        $controls_array[] = $control;
                                }
@@ -263,14 +255,7 @@
                                }
                        }
 
-                       if( count( $controls_array ) > 0 )
-                       {
-                               return $controls_array; 
-                       }
-                       else
-                       {
-                               return null;
-                       }
+                       return $controls_array; 
                }
                
                /**
@@ -284,11 +269,8 @@
                 * @param $role_id responsible role for carrying out the 
control  
                 * @return array of components as objects or arrays
                 */
-               public function get_controls_by_component($location_code, 
$from_date, $to_date, $repeat_type = '', $return_type = "return_object", 
$role_id = 0, $filter = null)
+               public function get_controls_by_component($from_date, $to_date, 
$repeat_type, $return_type = "return_object", $role_id = 0, $filter = null)
                {
-                       $role_id = (int) $role_id;
-                       $repeat_type = (int) $repeat_type;
-
                        $controls_array = array();
                        
                        $sql   = "SELECT c.id as control_id, c.*, ";
@@ -300,15 +282,16 @@
                        $sql  .= "JOIN controller_control c on cl.control_id = 
c.id ";
                        $sql  .= "JOIN fm_responsibility_role ON 
fm_responsibility_role.id = c.responsibility_id ";
                        $sql  .= "AND bim_item.type = bim_type.id ";
-                       $sql  .= "AND bim_item.type = bim_type.id ";
                        
-                       if( $repeat_type)
+                       if( $repeat_type != null)
                        {
+                               $repeat_type = (int) $repeat_type;
                                $sql .= "AND c.repeat_type = $repeat_type ";
                        }
-                       if( $role_id)
+                       if( $role_id )
                        {
-                           $sql .= "AND c.responsibility_id = $role_id ";
+                               $role_id = (int) $role_id;
+                         $sql .= "AND c.responsibility_id = $role_id ";
                        }
                            
                        $sql .= "AND (c.start_date <= $from_date AND c.end_date 
IS NULL ";
@@ -316,10 +299,10 @@
                        
                        if($filter != null)
                        {
-                               $sql  .= "AND " . $filter;      
+                               $sql .= "AND " . $filter;       
                        }
                        
-                       $sql  .= "ORDER BY bim_item.id ";
+                       $sql .= "ORDER BY bim_item.id ";
                         
                        $this->db->query($sql);
                        

Modified: branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php 
2012-08-29 12:46:40 UTC (rev 9928)
+++ branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php 
2012-08-29 12:48:14 UTC (rev 9929)
@@ -123,12 +123,12 @@
                        if($level == 1){
                                // Fetches all controls for the components for 
a location within time period
                                $filter = "bim_item.location_code = 
'$location_code' ";
-                               $components_with_controls_array = 
$this->so_control->get_controls_by_component($location_code, $from_date_ts, 
$to_date_ts, $repeat_type, "return_object", $role, $filter);      
+                               $components_with_controls_array = 
$this->so_control->get_controls_by_component($from_date_ts, $to_date_ts, 
$repeat_type, "return_object", $role, $filter);      
                        }else
                        {
                                // Fetches all controls for the components for 
a location within time period
                                $filter = "bim_item.location_code LIKE 
'$location_code%' ";
-                               $components_with_controls_array = 
$this->so_control->get_controls_by_component($location_code, $from_date_ts, 
$to_date_ts, $repeat_type, "return_object", $role, $filter);      
+                               $components_with_controls_array = 
$this->so_control->get_controls_by_component($from_date_ts, $to_date_ts, 
$repeat_type, "return_object", $role, $filter);      
                        }
                        
                        // Fetches all control ids with check lists for 
specified time period
@@ -264,12 +264,12 @@
                        if($level == 1){
                                // Fetches all controls for the components for 
a location within time period
                                $filter = "bim_item.location_code = 
'$location_code' ";
-                               $components_with_controls_array = 
$this->so_control->get_controls_by_component($location_code, $from_date_ts, 
$to_date_ts, $repeat_type, "return_object", $role, $filter);      
+                               $components_with_controls_array = 
$this->so_control->get_controls_by_component($from_date_ts, $to_date_ts, 
$repeat_type, "return_object", $role, $filter);      
                        }else
                        {
                                // Fetches all controls for the components for 
a location within time period
                                $filter = "bim_item.location_code LIKE 
'$location_code%' ";
-                               $components_with_controls_array = 
$this->so_control->get_controls_by_component($location_code, $from_date_ts, 
$to_date_ts, $repeat_type, "return_object", $role, $filter);      
+                               $components_with_controls_array = 
$this->so_control->get_controls_by_component($from_date_ts, $to_date_ts, 
$repeat_type, "return_object", $role, $filter);      
                        }
                        
                        // Loops through controls with repeat type day or week

Modified: 
branches/Version-1_0-branch/controller/inc/component/class.year_calendar_agg.inc.php
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/component/class.year_calendar_agg.inc.php
        2012-08-29 12:46:40 UTC (rev 9928)
+++ 
branches/Version-1_0-branch/controller/inc/component/class.year_calendar_agg.inc.php
        2012-08-29 12:48:14 UTC (rev 9929)
@@ -38,7 +38,7 @@
        else if( ($month_nr < date("m"))  && (date("Y", 
$this->control->get_start_date()) == $this->year) )
        {
                $this->calendar_array[ $month_nr ]["status"] = 
"CONTROLS_NOT_DONE";
-               $this->calendar_array[ $month_nr ]["info"] = array("view" => 
$this->view, "control_id" => $this->control->get_id(), "year" => $this->year, 
"month" => $month_nr);
+               $this->calendar_array[ $month_nr ]["info"] = array("view" => 
$this->view, "control_id" => $this->control->get_id(), "location_code" =>  
$this->location_code, "year" => $this->year, "month" => $month_nr);
        }
        else
        {

Modified: branches/Version-1_0-branch/controller/inc/hook_home.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/hook_home.inc.php        
2012-08-29 12:46:40 UTC (rev 9928)
+++ branches/Version-1_0-branch/controller/inc/hook_home.inc.php        
2012-08-29 12:48:14 UTC (rev 9929)
@@ -54,50 +54,150 @@
        $from_date_ts = strtotime("now");
        $to_year = $year + 1;
        $to_date_ts = strtotime("01/01/$to_year");      
-                               
+       
+       // Fetches my properties        
        $criteria = array
        (
                'user_id' => $GLOBALS['phpgw_info']['user']['account_id'],
-               'type_id' => 1,
+               'type_id' => 1, // Nivå i bygningsregisteret 1:eiendom
                'role_id' => 0, // For å begrense til en bestemt rolle - ellers 
listes alle roller for brukeren
                'allrows' => false
        );
 
        $location_finder = new location_finder();
-       $my_locations = $location_finder->get_responsibilities( $criteria );
+       $my_properties = $location_finder->get_responsibilities( $criteria );
 
+       // Fetches my buildings
+       $criteria = array
+       (
+               'user_id' => $GLOBALS['phpgw_info']['user']['account_id'],
+               'type_id' => 2, // Nivå i bygningsregisteret 1:eiendom
+               'role_id' => 0, // For å begrense til en bestemt rolle - ellers 
listes alle roller for brukeren
+               'allrows' => false
+       );
+
+       $location_finder = new location_finder();
+       $my_buildings = $location_finder->get_responsibilities( $criteria );
+       
+       $my_locations = array_merge($my_properties, $my_buildings);
+
+
+       /* =======================================  CONTROLS NOT DONE  
================================= */
+       
+       $my_controls = array();
+       
+       $to_date_ts = strtotime("now");
+       $to_year = date("Y") - 1;
+       $from_date_ts = strtotime("01/01/$to_year");
        $repeat_type = null;
-       $controls_for_location_array = array();
+       
+       $my_controls = array();
        foreach($my_locations as $location)
        {
-           $controls = array();
-           $controls_loc = 
$so_control->get_controls_by_location($location["location_code"], 
$from_date_ts, $to_date_ts, $repeat_type, '', $location["role_id"] );
-           $controls_comp = 
$so_control->get_controls_for_components_by_location($location["location_code"],
 $from_date_ts, $to_date_ts, $repeat_type, '', $location["role_id"] );
-           foreach($controls_loc as $cl)
+                       $controls = array();
+                       $components_with_controls_array = array();
+                       $location_code = $location["location_code"];
+                                               
+           $controls_loc = $so_control->get_controls_by_location( 
$location_code, $from_date_ts, $to_date_ts, $repeat_type, "return_array", 
$location["role_id"] );
+                                   
+                       $level = count(explode('-', $location_code));
+
+                       if($level == 1){
+                               // Fetches all controls for the components for 
a location within time period
+                               $filter = "bim_item.location_code = 
'$location_code' ";
+                               $components_with_controls_array = 
$so_control->get_controls_by_component($from_date_ts, $to_date_ts, 
$repeat_type, "return_array", $location["role_id"], $filter);      
+                       }else
+                       {
+                               // Fetches all controls for the components for 
a location within time period
+                               $filter = "bim_item.location_code LIKE 
'$location_code%' ";
+                               $components_with_controls_array = 
$so_control->get_controls_by_component($from_date_ts, $to_date_ts, 
$repeat_type, "return_array", $location["role_id"], $filter);      
+                       }
+
+                       if( count($controls_loc) > 0 )
            {
-               $controls[] = $cl;
+               $my_controls[] = array( $location_code, 'location', 
$controls_loc );
            }
-           foreach($controls_comp as $cc)
+
+           if( count($components_with_controls_array) > 0 )
            {
-               $controls[] = $cc;
+               foreach($components_with_controls_array as $component)
+               {
+                       $my_controls[] = array( $location_code, 'component', 
$component['controls_array'], $component );        
+               }
            }
-           
-        $controls_for_location_array[] = array($location["location_code"], 
$controls);
        }
        
-
-       $controls_array = array();
-       $control_dates = array();
-       foreach($controls_for_location_array as $control_arr){
-               $current_location = $control_arr[0];
-               $controls_for_loc_array = $control_arr[1];
-               foreach($controls_for_loc_array as $control)
+       $my_undone_controls = array();
+       $so_check_list = CreateObject('controller.socheck_list');
+                       
+       foreach($my_controls as $container_arr)
+       {       
+               $location_code = $container_arr[0];
+               $control_type = $container_arr[1];
+               $controls = $container_arr[2];
+               
+               foreach($controls as $my_control)
                {
-                       $date_generator = new 
date_generator($control["start_date"], $control["end_date"], $from_date_ts, 
$to_date_ts, $control["repeat_type"], $control["repeat_interval"]);
-                       $controls_array[] = array($current_location, $control, 
$date_generator->get_dates());
+                       if($my_control["repeat_type"] == 0)
+                       {
+                               // Daily control: Fetch undone controls one 
week back in time
+                               $from_date_ts =  mktime(0, 0, 0, date("n"), 
date("j")-7, date("Y") );
+                       }
+                       else if($my_control["repeat_type"] == 1)
+                       {
+                               // Weekly control: Fetch undone controls one 
month back in time
+                               $from_date_ts =  mktime(0, 0, 0, date("n")-1, 
date("j"), date("Y") ); 
+                       }
+                       else if($my_control["repeat_type"] == 2)
+                       {
+                               // Monthly control: Fetch undone controls three 
months back in time
+                               $from_date_ts =  mktime(0, 0, 0, date("n")-3, 
date("j"), date("Y") ); 
+                       }
+                       else if($my_control["repeat_type"] == 3)
+                       {
+                               // Yearly control: Fetch undone controls one 
year back in time
+                               $from_date_ts =  mktime(0, 0, 0, date("n"), 
date("j"), date("Y")-1 );
+                       }
+                                               
+                       $date_generator = new 
date_generator($my_control["start_date"], $my_control["end_date"], 
$from_date_ts, $to_date_ts, $my_control["repeat_type"], 
$my_control["repeat_interval"]);
+                       $deadline_dates_for_control = 
$date_generator->get_dates();
+                       
+                       $check_list_array = array();
+                       foreach($deadline_dates_for_control as $deadline_ts)
+                       {
+                               $check_list = null;
+                               
+                               if($control_type == "location")
+                               {
+                                 $check_list = 
$so_check_list->get_check_list_for_control_by_date($my_control['id'], 
$deadline_ts, null, $location_code, null, null, "location"        );
+                               }
+                               else if($control_type == "component")
+                               {
+                                       $component = $container_arr[3];
+                                       
+                                       $check_list = 
$so_check_list->get_check_list_for_control_by_date($my_control['id'], 
$deadline_ts, null, null, $component['location_id'], $component['id'], 
"component"  );
+                               }
+                               
+                               if($check_list == null)
+                               {      
+                     if($control_type == "location")
+                     {
+                                       $my_undone_controls[] = array("add", 
$deadline_ts, $my_control, "location", $location_code );
+                     }
+                                       else if($control_type == "component")
+                     {
+                       $component = $container_arr[3];
+                                       $my_undone_controls[] = array("add", 
$deadline_ts, $my_control, "component", $component['location_id'], 
$component['id'] );
+                     }
+                               }
+                               else if($check_list->get_status() == 
controller_check_list::STATUS_NOT_DONE)
+                               {
+                                       $my_undone_controls[] = array("edit", 
$deadline_ts, $my_control, $check_list->get_id(), $location_code );
+                               }
+                       }
                }
        }
-       
+               
        $portalbox0 = CreateObject('phpgwapi.listbox', array
        (
                'title'         => "Mine glemte kontroller",
@@ -108,88 +208,140 @@
                'outerborderwidth'      => '0',
                'header_background_image'       => 
$GLOBALS['phpgw']->common->image('phpgwapi','bg_filler', '.png', False)
        ));
-
+       
        $app_id = $GLOBALS['phpgw']->applications->name2id('controller');
        if( !isset($GLOBALS['portal_order']) ||!in_array($app_id, 
$GLOBALS['portal_order']) )
        {
                $GLOBALS['portal_order'][] = $app_id;
        }
-       $var = array
-       (
-               'up'    => array('url'  => '/set_box.php', 'app'        => 
$app_id),
-               'down'  => array('url'  => '/set_box.php', 'app'        => 
$app_id),
-               'close' => array('url'  => '/set_box.php', 'app'        => 
$app_id),
-               'question'      => array('url'  => '/set_box.php', 'app'        
=> $app_id),
-               'edit'  => array('url'  => '/set_box.php', 'app'        => 
$app_id)
-       );
-
-       $category_name = array(); // caching
        
-       $cats   = CreateObject('phpgwapi.categories', -1, 'controller', 
'.control');
-       $cats->supress_info     = true;
-       $control_areas = 
$cats->formatted_xslt_list(array('format'=>'filter','selected' => '','globals' 
=> true,'use_acl' => $this->_category_acl));
 
-       $portalbox0->data = array();
-       $portalbox0_data = array();
-       foreach ($controls_array as $control_instance)
+       function cmp($a, $b)
        {
-               $curr_location = $control_instance[0];
-               $current_control = $control_instance[1];
-               $check_lists = 
$so->get_open_check_lists_for_control($current_control["id"], $curr_location, 
$from_date_ts);
-               $location_array = execMethod('property.bolocation.read_single', 
array('location_code' => $curr_location));
-               $location_name = $location_array["loc1_name"];
-               if(isset($current_control['component_id']) && 
$current_control['component_id'])
+    if ($a[1] == $b[1]) {
+        return 0;
+    }
+    
+    return ($a[1] < $b[1]) ? -1 : 1;
+       }
+       
+       usort($my_undone_controls, "cmp");
+       
+       foreach($my_undone_controls as $my_undone_control)
+       {
+       
+               $check_list_status = $my_undone_control[0];
+               $deadline_ts = $my_undone_control[1];
+               $my_control = $my_undone_control[2];
+               
+               $cats   = CreateObject('phpgwapi.categories', -1, 'controller', 
'.control');
+         $cats->supress_info   = true;
+         $control_areas = 
$cats->formatted_xslt_list(array('format'=>'filter','selected' => '','globals' 
=> true,'use_acl' => $this->_category_acl));
+               
+               foreach($control_areas['cat_list'] as $area)
                {
-                       if($short_desc = 
execMethod('property.soentity.get_short_description', array('location_id' => 
$current_control['location_id'], 'id' => $current_control['component_id'])))
+                       if($area['cat_id'] == $my_control["control_area_id"])
                        {
-                               $location_name .= "::{$short_desc}";
+                               $control_area_name = $area['name'];
                        }
                }
-
-               foreach($control_areas['cat_list'] as $area)
+               
+               $date_str = date($dateformat, $deadline_ts);
+               
+               if($check_list_status == "add")
                {
-                       if($area['cat_id'] == 
$current_control["control_area_id"])
+                       $check_list_type = $my_undone_control[3];
+                       
+                       if($check_list_type == "location")
                        {
-                               $control_area_name = $area['name'];
+                               $location_code = $my_undone_control[4];
+                               $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
+                               $location_name = $location_array["loc1_name"];
+                               
+                               $portalbox0->data[] = array(                    
+                               'text' => "<span 
class='title'>{$location_name}</span><span 
class='control-area'>{$control_area_name}</span> <span 
class='control'>{$my_control['title']}</span> <span class='date'>Fristdato 
{$date_str}</span>",
+                               'link' => $GLOBALS['phpgw']->link('/index.php', 
array('menuaction' => 'controller.uicheck_list.add_check_list', 'type' => 
"location", 'control_id' => $my_control['id'], 'location_code' => 
$location_code, 'deadline_ts' => $deadline_ts))
+                   );
                        }
+                       else if($check_list_type == "component")
+                       {
+                               $location_id = $my_undone_control[4];
+                               $component_id = $my_undone_control[5];
+                               
+               $short_desc_arr = 
execMethod('property.soentity.get_short_description', array('location_id' => 
$location_id, 'id' => $component_id));
+               
+                               $portalbox0->data[] = array(                    
+                               'text' => "<span 
class='title'>{$short_desc_arr}</span><span 
class='control-area'>{$control_area_name}</span> <span 
class='control'>{$my_control['title']}</span> <span class='date'>Fristdato 
{$date_str}</span>",
+                               'link' => $GLOBALS['phpgw']->link('/index.php', 
array('menuaction' => 'controller.uicheck_list.add_check_list', 'type' => 
"component", 'control_id' => $my_control['id'], 'location_id' => $location_id, 
'component_id' => $component_id, 'deadline_ts' => $deadline_ts))
+                   );
+                       }       
                }
-               foreach($check_lists as $check_list)
+               else if($check_list_status == "edit")
                {
-                       $next_date = "Frist: " . date($dateformat, 
$check_list->get_deadline());
-                       $portalbox0_data[] = array
-                       ($check_list->get_deadline(), array
-                       (
-                               'text' => "<span 
class='title'>{$location_name}</span><span 
class='control-area'>{$control_area_name}</span> <span 
class='control'>{$current_control["title"]}</span> <span 
class='date'>{$next_date}</span>",
-                               'link' => $GLOBALS['phpgw']->link('/index.php', 
array('menuaction' => 'controller.uicheck_list.edit_check_list', 
'check_list_id' => $check_list->get_id()))
-                       ));
+                               $check_list_id = $my_undone_control[3];
+                               $location_code = $my_undone_control[4];
+                               
+                               $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
+                               $location_name = $location_array["loc1_name"];
+                               
+                               $portalbox0->data[] = array(                    
+                         'text' => "<span 
class='title'>{$location_name}</span><span 
class='control-area'>{$control_area_name}</span> <span 
class='control'>{$my_control['title']}</span> <span class='date'>Fristdato 
{$date_str}</span>",
+                         'link' => $GLOBALS['phpgw']->link('/index.php', 
array('menuaction' => 'controller.uicheck_list.edit_check_list', 
'check_list_id' => $check_list_id))
+                 );
                }
        }
-       //sort data by planned date for check list
-       sort($portalbox0_data);
-       //$limit = 5;
-       $tmp = 0;
-       foreach($portalbox0_data as $check_list_dates)
-       {
-               if($tmp < $limit_no_of_planned)
-               {
-                       $portalbox0->data[] = $check_list_dates[1];
-               }
-               $tmp++;
-       }
-
+       
        $styling  = "\n".'<!-- BEGIN checklist info -->'."\n ";
        $styling .= "<style> .home_portal_content 
a{color:#0066CC;text-decoration: none;text-transform: uppercase;} 
.home_portal{margin: 20px 10px 0;} "; 
        $styling .= " .home-box {background: none repeat scroll 0 0 #EDF5FF; 
border-color: #DBE5EF; border-radius: 4px; margin: 20px;}";
        $styling .= " .home-box .home_portal{margin: 0;border: 1px solid 
#DEEAF8;} .home_portal_content{padding:10px;} ";
-       $styling .= " .home_portal_title h2{ background: #DEEAF8; margin: 0; 
padding: 5px 10px;} .home_portal_content ul li{padding: 3px;}";
-       $styling .= " .home_portal_content 
.title{display:inline-block;width:300px;} .home_portal_content 
.control-area{display:inline-block;width:200px;}";
+       $styling .= " .home_portal_title h2{ background: #DEEAF8; margin: 0; 
padding: 5px 10px;} .home_portal_content ul li{padding: 7px 0;}";
+       $styling .= " .home_portal_content 
.title{display:inline-block;width:300px;margin:0 20px 0 0;} 
.home_portal_content .control-area{display:inline-block;width:200px;}";
        $styling .= " .home_portal_content 
.control{display:inline-block;width:300px;} .home_portal_content 
.date{display:inline-block;width:300px;}";
+       $styling .= " .home_portal_content a span{cursor: 
pointer;vertical-align: middle;}";
        $styling .= "</style>"; 
        $styling .= "\n".'<!-- END checklist info -->'."\n";
        
        echo $styling;
        echo "\n".'<!-- BEGIN checklist info -->'."\n <div 
class='home-box'>".$portalbox0->draw()."</div>\n".'<!-- END checklist info 
-->'."\n";
        
+       /* =======================================  MY PLANNED CONTROLS  
================================= */
+
+       $repeat_type = null;
+       $controls_for_location_array = array();
+       foreach($my_locations as $location)
+       {
+           $controls = array();
+           $controls_loc = 
$so_control->get_controls_by_location($location["location_code"], 
$from_date_ts, $to_date_ts, $repeat_type, "return_array", $location["role_id"] 
);
+           $controls_comp = 
$so_control->get_controls_for_components_by_location($location["location_code"],
 $from_date_ts, $to_date_ts, $repeat_type, "return_array", $location["role_id"] 
);
+           
+           foreach($controls_loc as $cl)
+           {
+               $controls[] = $cl;
+           }
+           
+           foreach($controls_comp as $cc)
+           {
+               $controls[] = $cc;
+           }
+           
+      $controls_for_location_array[] = array($location["location_code"], 
$controls);
+       }
+       
+       $controls_array = array();
+       $control_dates = array();
+       foreach($controls_for_location_array as $control_arr){
+               $current_location = $control_arr[0];
+               $controls_for_loc_array = $control_arr[1];
+               foreach($controls_for_loc_array as $control)
+               {
+                       $date_generator = new 
date_generator($control["start_date"], $control["end_date"], $from_date_ts, 
$to_date_ts, $control["repeat_type"], $control["repeat_interval"]);
+                       $controls_array[] = array($current_location, $control, 
$date_generator->get_dates());
+               }
+       }
+       
+       
+       
        $portalbox1 = CreateObject('phpgwapi.listbox', array
        (
                'title'         => "Mine planlagte kontroller",
@@ -215,6 +367,8 @@
                'edit'  => array('url'  => '/set_box.php', 'app'        => 
$app_id)
        );
 
+       /* =======================================  MY CONTROLS  
================================= */
+       
        $category_name = array(); // caching
        
        $cats   = CreateObject('phpgwapi.categories', -1, 'controller', 
'.control');
@@ -295,11 +449,6 @@
                'edit'  => array('url'  => '/set_box.php', 'app'        => 
$app_id)
        );
 
-       foreach ( $var as $key => $value )
-       {
-//                                     $portalbox2->set_controls($key,$value);
-       }
-
        $category_name = array(); // caching
 
        $portalbox2->data = array();
@@ -350,7 +499,7 @@
                                                                'deadline_ts'   
=> $current_date,
                                                                'control_id'    
=> $current_control["id"],
                                                                'location_code' 
=> $curr_location,
-                                                               'type'          
        => $current_control['component_id'] ? 'component' : '',
+                                                               'type'          
        => $current_control['component_id'] ? 'component' : 'location',
                                                                'location_id'   
=> $current_control['location_id'],
                                                                'component_id'  
=> $current_control['component_id']
                                                        ))
@@ -385,7 +534,7 @@
                                                'deadline_ts'   => 
$current_date, 
                                                'control_id'    => 
$current_control["id"], 
                                                'location_code' => 
$curr_location,
-                                               'type'                  => 
$current_control['component_id'] ? 'component' : '',
+                                               'type'                  => 
$current_control['component_id'] ? 'component' : 'location',
                                                'location_id'   => 
$current_control['location_id'],
                                                'component_id'  => 
$current_control['component_id']
                                        ))
@@ -407,3 +556,4 @@
                $tmp++;
        }
        echo "\n".'<!-- BEGIN assigned checklist info -->'."\n<div 
class='home-box'>".$portalbox2->draw()."</div>\n".'<!-- END assigned checklist 
info -->'."\n";
+       
\ No newline at end of file

Modified: branches/Version-1_0-branch/controller/inc/model/class.control.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/model/class.control.inc.php      
2012-08-29 12:46:40 UTC (rev 9928)
+++ branches/Version-1_0-branch/controller/inc/model/class.control.inc.php      
2012-08-29 12:48:14 UTC (rev 9929)
@@ -57,8 +57,6 @@
                protected $responsibility_name;
                protected $control_area_id;
                protected $control_area_name;
-               protected $location_id;
-               protected $component_id;
 
                // Objects
                protected $check_lists_array = array();
@@ -235,32 +233,6 @@
                        $this->error_msg_array = $error_msg_array;
                }
                
-
-
-//Sigurd 3.august 2010: needed for 
socontrol::get_controls_for_components_by_location() 
-
-               public function set_location_id($location_id)
-               {
-                       $this->location_id = $location_id;
-               }
-
-               public function get_location_id()
-               {
-                       return $this->location_id;
-               }
-
-               public function set_component_id($component_id)
-               {
-                       $this->component_id = $component_id;
-               }
-
-               public function get_component_id()
-               {
-                       return $this->component_id;
-               }
-
-//
-
                /**
                 * Get a static reference to the storage object associated with 
this model object
                 * 

Modified: branches/Version-1_0-branch/controller/js/controller/ajax.js
===================================================================
--- branches/Version-1_0-branch/controller/js/controller/ajax.js        
2012-08-29 12:46:40 UTC (rev 9928)
+++ branches/Version-1_0-branch/controller/js/controller/ajax.js        
2012-08-29 12:48:14 UTC (rev 9929)
@@ -543,58 +543,34 @@
                
                var check_list_id = $("#check_list_id").val();
                        
-                       var statusFieldVal = $("#status").val();
-                       var statusRow = $("#status").closest(".row");
-                       var plannedDateVal = $("#planned_date").val();
-                       var plannedDateRow = $("#planned_date").closest(".row");
-                       var completedDateVal = $("#completed_date").val();
-                       var completedDateRow = 
$("#completed_date").closest(".row");
-                       
-                       // Checks that COMPLETE DATE is set if status is set to 
DONE 
-                       if(statusFieldVal == 1 & completedDateVal == ''){
-                               e.preventDefault();
-                               // Displays error message above completed date
-                               $(completedDateRow).before("<div 
class='input_error_msg'>Vennligst angi når kontrollen ble utført</div>");
-               }
-                       else if(statusFieldVal == 0 && completedDateVal != ''){
-                               e.preventDefault();
-                               // Displays error message above completed date
-                               $(statusRow).before("<div 
class='input_error_msg'>Vennligst endre status til utført</div>");
+               var statusFieldVal = $("#status").val();
+               var statusRow = $("#status").closest(".row");
+               var plannedDateVal = $("#planned_date").val();
+               var plannedDateRow = $("#planned_date").closest(".row");
+               var completedDateVal = $("#completed_date").val();
+               var completedDateRow = $("#completed_date").closest(".row");
+               
+               $(thisForm).find('.input_error_msg').remove();
+               
+               // Checks that COMPLETE DATE is set if status is set to DONE 
+               if(statusFieldVal == 1 & completedDateVal == ''){
+                       e.preventDefault();
+                       // Displays error message above completed date
+                       $(completedDateRow).before("<div 
class='input_error_msg'>Vennligst angi når kontrollen ble utført</div>");
+       }
+               else if(statusFieldVal == 0 && completedDateVal != ''){
+                       e.preventDefault();
+                       // Displays error message above completed date
+                       $(statusRow).before("<div 
class='input_error_msg'>Vennligst endre status til utført eller slett 
utførtdato</div>");
+               }
+               else if(statusFieldVal == 0 & plannedDateVal == ''){
+                       e.preventDefault();
+                       // Displays error message above planned date
+                       if( 
!$(plannedDateRow).prev().hasClass("input_error_msg") )
+                       {
+                         $(plannedDateRow).before("<div 
class='input_error_msg'>Vennligst endre status for kontroll eller angi 
planlagtdato</div>");   
                        }
-                       else if(statusFieldVal == 0 & plannedDateVal == ''){
-                               e.preventDefault();
-                               // Displays error message above planned date
-                               if( 
!$(plannedDateRow).prev().hasClass("input_error_msg") )
-                               {
-                                 $(plannedDateRow).before("<div 
class='input_error_msg'>Vennligst endre status for kontroll eller angi 
planlagtdato</div>");   
-                               }
-                       }       
-                       /*
-                       else{
-                       $(".input_error_msg").hide();
-                       
-                               $.ajax({
-                                         type: 'POST',
-                                         url: requestUrl + 
"&phpgw_return_as=json&" + $(thisForm).serialize(),
-                                         success: function(data) {
-                                                 if(data){
-                                                 var obj = 
jQuery.parseJSON(data);
-                                               
-                                                 if(obj.status == "updated"){
-                                                         var submitBnt = 
$(thisForm).find("input[type='submit']");
-                                                         
$(submitBnt).val("Lagret");   
-                                                                 
-                                                         // Changes text on 
save button back to original
-                                                         
window.setTimeout(function() {
-                                                                       
$(submitBnt).val('Lagre detaljer');
-                                                                       
$(submitBnt).addClass("not_active");
-                                                         }, 1000);
-                                                         }
-                                                 }
-                                               }
-                               });
-               }
-               */
+               }       
        });
        
        // Display submit button on click

Modified: branches/Version-1_0-branch/controller/templates/base/css/base.css
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/css/base.css  
2012-08-29 12:46:40 UTC (rev 9928)
+++ branches/Version-1_0-branch/controller/templates/base/css/base.css  
2012-08-29 12:48:14 UTC (rev 9929)
@@ -1015,7 +1015,7 @@
 }
 
 #check_list_details .col_1 {
-    width: 46%;
+    width: 50%;
 }
 
 /* =======================================  TAB CHECK LIST DETAILS 
========================================= */
@@ -2174,8 +2174,8 @@
   margin-bottom: 5px;
   margin-top: 5px;
   padding: 5px;
-  width: 100%;
   text-align: center;
+  width: 90%;
 }
 
 .error_msg {

Modified: 
branches/Version-1_0-branch/property/inc/cron/default/synkroniser_med_boei.php
===================================================================
--- 
branches/Version-1_0-branch/property/inc/cron/default/synkroniser_med_boei.php  
    2012-08-29 12:46:40 UTC (rev 9928)
+++ 
branches/Version-1_0-branch/property/inc/cron/default/synkroniser_med_boei.php  
    2012-08-29 12:48:14 UTC (rev 9929)
@@ -380,7 +380,7 @@
 
                                $this->db->query($sql2_utf,__LINE__,__FILE__);
                                
$this->db_boei->query($sql2_latin,__LINE__,__FILE__);
-                               $this->db->query("INSERT INTO fm_locations 
(level, location_code) VALUES (1, 
'{$objekt_utf[$i]['location_code']}')",__LINE__,__FILE__);
+                               $this->db->query("INSERT INTO fm_locations 
(level, location_code, loc1) VALUES (1, '{$objekt_utf[$i]['location_code']}', 
'{$objekt_utf[$i]['loc1']}')",__LINE__,__FILE__);
 
                                $obj_msg[]=$objekt_utf[$i]['loc1'];
                        }
@@ -436,7 +436,7 @@
 
                                $this->db->query($sql2_utf,__LINE__,__FILE__);
                                
$this->db_boei->query($sql2_latin,__LINE__,__FILE__);
-                               $this->db->query("INSERT INTO fm_locations 
(level, location_code) VALUES (2, 
'{$bygg_utf[$i]['location_code']}')",__LINE__,__FILE__);
+                               $this->db->query("INSERT INTO fm_locations 
(level, location_code, loc1) VALUES (2, '{$bygg_utf[$i]['location_code']}', 
'{$objekt_utf[$i]['loc1']}')",__LINE__,__FILE__);
 
                                $bygg_msg[]=$bygg_utf[$i]['location_code'];
                        }
@@ -500,7 +500,7 @@
 
                                $this->db->query($sql2_utf,__LINE__,__FILE__);
                                
$this->db_boei->query($sql2_latin,__LINE__,__FILE__);
-                               $this->db->query("INSERT INTO fm_locations 
(level, location_code) VALUES (3, 
'{$seksjon_utf[$i]['location_code']}')",__LINE__,__FILE__);
+                               $this->db->query("INSERT INTO fm_locations 
(level, location_code, loc1) VALUES (3, '{$seksjon_utf[$i]['location_code']}', 
'{$objekt_utf[$i]['loc1']}')",__LINE__,__FILE__);
 
                                
$seksjon_msg[]=$seksjon_utf[$i]['location_code'];
                        }
@@ -591,7 +591,7 @@
 
                                $this->db->query($sql2_utf,__LINE__,__FILE__);
                                
$this->db_boei->query($sql2_latin,__LINE__,__FILE__);
-                               $this->db->query("INSERT INTO fm_locations 
(level, location_code) VALUES (4, 
'{$leieobjekt_utf[$i]['location_code']}')",__LINE__,__FILE__);
+                               $this->db->query("INSERT INTO fm_locations 
(level, location_code, loc1) VALUES (4, 
'{$leieobjekt_utf[$i]['location_code']}', 
'{$objekt_utf[$i]['loc1']}')",__LINE__,__FILE__);
 
                                
$leieobjekt_msg[]=$leieobjekt_utf[$i]['location_code'];
                        }




reply via email to

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