fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8551] Merge 8537:8550 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [8551] Merge 8537:8550 from trunk
Date: Tue, 10 Jan 2012 09:51:11 +0000

Revision: 8551
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8551
Author:   sigurdne
Date:     2012-01-10 09:51:11 +0000 (Tue, 10 Jan 2012)
Log Message:
-----------
Merge 8537:8550 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
    branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
    branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
    branches/Version-1_0-branch/activitycalendar/templates/base/activity.php
    
branches/Version-1_0-branch/activitycalendar/templates/base/activity_list_partial.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/controller/inc/class.socheck_item.inc.php
    branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php
    branches/Version-1_0-branch/controller/inc/class.soprocedure.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.uicheck_list_for_location.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
    branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php
    branches/Version-1_0-branch/controller/inc/model/class.check_item.inc.php
    branches/Version-1_0-branch/controller/inc/model/class.procedure.inc.php
    branches/Version-1_0-branch/controller/js/controller/ajax.js
    branches/Version-1_0-branch/controller/setup/setup.inc.php
    branches/Version-1_0-branch/controller/setup/tables_current.inc.php
    branches/Version-1_0-branch/controller/setup/tables_update.inc.php
    
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_details.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_info.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_items.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/view_errors_for_check_list.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/view_measurements.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/procedure/view_procedures_for_control.xsl
    branches/Version-1_0-branch/property/inc/class.botts.inc.php
    branches/Version-1_0-branch/property/inc/class.notify.inc.php
    branches/Version-1_0-branch/property/inc/class.uiproject.inc.php
    branches/Version-1_0-branch/property/inc/class.uitts.inc.php
    branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php
    branches/Version-1_0-branch/property/js/yahoo/notify.js
    branches/Version-1_0-branch/property/js/yahoo/property2.js
    branches/Version-1_0-branch/property/templates/base/project.xsl
    branches/Version-1_0-branch/property/templates/base/tts.xsl
    branches/Version-1_0-branch/property/templates/base/workorder.xsl

Added Paths:
-----------
    branches/Version-1_0-branch/controller/inc/class.socase.inc.php
    
branches/Version-1_0-branch/controller/inc/model/class.check_item_case.inc.php
    branches/Version-1_0-branch/controller/templates/base/case/
    
branches/Version-1_0-branch/controller/templates/base/check_list/register_case.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/view_closed_cases.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_cases.xsl

Removed Paths:
-------------
    
branches/Version-1_0-branch/controller/templates/base/check_list/register_errors.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/view_closed_errors.xsl
    
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_errors.xsl
    
branches/Version-1_0-branch/controller/templates/base/create_error_report_message.xsl
    
branches/Version-1_0-branch/controller/templates/base/view_error_report_message.xsl

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
   + 
/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

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php   
2012-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php   
2012-01-10 09:51:11 UTC (rev 8551)
@@ -175,6 +175,11 @@
                                $filter_clauses[] = "activity.office = 
'{$activity_district}'";
                        }
                }
+               if(isset($filters['updated_date_hidden']) && 
$filters['updated_date_hidden'] != "")
+               {
+                       $ts_query = strtotime($filters['updated_date_hidden']); 
// target timestamp specified by user
+                       $filter_clauses[] = "activity.last_change_date < 
{$ts_query}";
+               }
                
                if(count($filter_clauses))
                {

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php 
2012-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php 
2012-01-10 09:51:11 UTC (rev 8551)
@@ -331,7 +331,7 @@
                                break;
                        case 'all_activities':
                        default:
-                               $filters = array('activity_state' => 
phpgw::get_var('activity_state'), 'activity_category' => 
phpgw::get_var('activity_category'), 'activity_district' => 
phpgw::get_var('activity_district'), 'user_id' => $uid);
+                               $filters = array('activity_state' => 
phpgw::get_var('activity_state'), 'activity_category' => 
phpgw::get_var('activity_category'), 'activity_district' => 
phpgw::get_var('activity_district'), 'user_id' => $uid, 'updated_date_hidden' 
=> phpgw::get_var('date_change_hidden'));
                                $result_objects = 
activitycalendar_soactivity::get_instance()->get($start_index, $num_of_objects, 
$sort_field, $sort_ascending, $search_for, $search_type, $filters);
                                $object_count = 
activitycalendar_soactivity::get_instance()->get_count($search_for, 
$search_type, $filters);
                                break;

Modified: branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang    
2012-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang    
2012-01-10 09:51:11 UTC (rev 8551)
@@ -46,7 +46,10 @@
 building schedule      activitycalendar        no      Kalender
 buildings      activitycalendar        no      Bygg/anlegg
 bygning        activitycalendar        no      Bygg/anlegg
+calendar_months        activitycalendar        no      
["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"]
+calendar_weekdays      activitycalendar        no      
["Sø","Ma","Ti","On","To","Fr","Lø"]
 cancel activitycalendar        no      Avbryt
+clear  activitycalendar        no      Nullstill
 cancelled      activitycalendar        no      Avbestilt
 case officer   activitycalendar        no      Saksbehandler
 category       activitycalendar        no      Kategori
@@ -183,6 +186,7 @@
 season name    activitycalendar        no      Sesong
 seasons        activitycalendar        no      Sesonger
 secondary admin        activitycalendar        no      Kontaktperson 2
+select_date    activitycalendar        no      Velg dato
 select a building first        activitycalendar        no      Velg 
bygg/anlegg først
 select a grooup        activitycalendar        no      Velg en Gruppe
 select category...     activitycalendar        no      Velg en kategori...

Modified: 
branches/Version-1_0-branch/activitycalendar/templates/base/activity.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/templates/base/activity.php    
2012-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/activitycalendar/templates/base/activity.php    
2012-01-10 09:51:11 UTC (rev 8551)
@@ -334,12 +334,12 @@
                                        if ($editable)
                                        {
                                                ?>
-                                               <select name="arena_id" 
id="arena_id" onchange="javascript: check_external();">
+                                               <select name="arena_id" 
id="arena_id" style="width: 300px;" onchange="javascript: check_external();">
                                                        <option value="0">Ingen 
arena valgt</option>
                                                        <?php
                                                        foreach($arenas as 
$arena)
                                                        {
-                                                               echo "<option 
".($current_arena_id == $arena->get_id() ? 'selected="selected"' : "")." 
value=\"{$arena->get_id()}\">".$arena->get_arena_name()."</option>";
+                                                               echo "<option 
".($current_arena_id == $arena->get_id() ? 'selected="selected"' : "")." 
value=\"{$arena->get_id()}\" 
title=\"{$arena->get_arena_name()}\">".$arena->get_arena_name()."</option>";
                                                        }
                                                        ?>
                                                </select>

Modified: 
branches/Version-1_0-branch/activitycalendar/templates/base/activity_list_partial.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendar/templates/base/activity_list_partial.php
       2012-01-10 09:47:57 UTC (rev 8550)
+++ 
branches/Version-1_0-branch/activitycalendar/templates/base/activity_list_partial.php
       2012-01-10 09:51:11 UTC (rev 8551)
@@ -114,7 +114,7 @@
                
'index.php?menuaction=activitycalendar.uiactivities.query&amp;phpgw_return_as=json<?php
 echo $url_add_on; ?>&amp;editable=<?php echo $editable ? "true" : "false"; ?>',
                columnDefs,
                '<?php echo $list_id ?>_form',
-               ['<?php echo $list_id ?>_ctrl_toggle_activity_state', '<?php 
echo $list_id ?>_ctrl_toggle_activity_district', '<?php echo $list_id 
?>_ctrl_toggle_activity_category', '<?php echo $list_id ?>_ctrl_search_query'],
+               ['<?php echo $list_id ?>_ctrl_toggle_activity_state', '<?php 
echo $list_id ?>_ctrl_toggle_activity_district', '<?php echo $list_id 
?>_ctrl_toggle_activity_category', '<?php echo $list_id ?>_ctrl_search_query', 
'date_updated'],
                '<?php echo $list_id ?>_container',
                '<?php echo $list_id ?>_paginator',
                '<?php echo $list_id ?>',
@@ -133,6 +133,7 @@
         var office = document.getElementById('<?php echo $list_id 
?>_ctrl_toggle_activity_district').value;
         var state = document.getElementById('<?php echo $list_id 
?>_ctrl_toggle_activity_state').value;
         var category = document.getElementById('<?php echo $list_id 
?>_ctrl_toggle_activity_category').value;
+        var updatedDate = document.getElementById('date_change').value;
         <?php
         /* FIXME Search queries will affect ALL data tables listed on one page 
(of that type) when exporting
          * even though the search only affects one of the data tables.
@@ -146,18 +147,20 @@
             '&amp;activity_district='+office+
             '&amp;activity_state='+state+
             '&amp;activity_category='+category+
+            '&amp;activity_updated='+updatedDate+
                '&amp;export=true';
     }
 
     function activity_email(ptype) {
 
-       var confirm_res = confirm("Du er i ferd med å sende e-post til flere 
mottakere.\n\nVil du gjøre dette?");
+       var confirm_res = confirm("Du er i ferd med å sende e-post til utvalget 
under.\n\nVil du gjøre dette?");
         if(confirm_res==true)
         {      
                var query = document.getElementById('<?php echo $list_id 
?>_ctrl_search_query').value;
                var office = document.getElementById('<?php echo $list_id 
?>_ctrl_toggle_activity_district').value;
                var state = document.getElementById('<?php echo $list_id 
?>_ctrl_toggle_activity_state').value;
                var category = document.getElementById('<?php echo $list_id 
?>_ctrl_toggle_activity_category').value;
+               var updatedDate = document.getElementById('date_change').value;
                <?php
                /* FIXME Search queries will affect ALL data tables listed on 
one page (of that type) when exporting
                 * even though the search only affects one of the data tables.
@@ -171,6 +174,7 @@
                    '&amp;activity_district='+office+
                    '&amp;activity_state='+state+
                    '&amp;activity_category='+category+
+                   '&amp;activity_updated='+updatedDate+
                        '&amp;email=true';
         }
     }
@@ -228,6 +232,8 @@
                        }
                        ?>
                </select>
+               <label class="toolbar_element_label" for="date_change" 
id="label_date_change"><?php echo lang('date') ?></label>
+               <?php echo 
$GLOBALS['phpgw']->yuical->add_listener('date_change'); ?>
        </fieldset>
        
        

Modified: 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_edit.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_edit.php
       2012-01-10 09:47:57 UTC (rev 8550)
+++ 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_edit.php
       2012-01-10 09:51:11 UTC (rev 8551)
@@ -262,12 +262,12 @@
                                        <?php
                                        $current_arena_id = 
$activity->get_arena();
                                        ?>
-                                       <select name="arena_id" id="arena_id" 
onchange="javascript: check_external();">
+                                       <select name="arena_id" id="arena_id" 
style="width: 400px;" onchange="javascript: check_external();">
                                                <option value="0">Ingen arena 
valgt</option>
                                                <?php
                                                foreach($arenas as $arena)
                                                {
-                                                       echo "<option 
".($current_arena_id == $arena->get_id() ? 'selected="selected"' : "")." 
value=\"{$arena->get_id()}\">".$arena->get_arena_name()."</option>";
+                                                       echo "<option 
".($current_arena_id == $arena->get_id() ? 'selected="selected"' : "")." 
value=\"{$arena->get_id()}\" 
title=\"{$arena->get_arena_name()}\">".$arena->get_arena_name()."</option>";
                                                }
                                                ?>
                                        </select>

Modified: 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new.php
        2012-01-10 09:47:57 UTC (rev 8550)
+++ 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new.php
        2012-01-10 09:51:11 UTC (rev 8551)
@@ -279,13 +279,13 @@
                                        <?php
                                        $current_arena_id = 
$activity->get_arena();
                                        ?>
-                                       <select name="arena_id" id="arena_id" 
onchange="javascript: run_checks();">
+                                       <select name="arena_id" id="arena_id" 
style="width: 400px;" onchange="javascript: run_checks();">
                                                <option value="0">Ingen arena 
valgt</option>
                                                <option value="new_arena">Ny 
arena</option>
                                                <?php
                                                foreach($arenas as $arena)
                                                {
-                                                       echo "<option 
".($current_arena_id == $arena->get_id() ? 'selected="selected"' : "")." 
value=\"{$arena->get_id()}\">".$arena->get_arena_name()."</option>";
+                                                       echo "<option 
".($current_arena_id == $arena->get_id() ? 'selected="selected"' : "")." 
value=\"{$arena->get_id()}\" 
title=\"{$arena->get_arena_name()}\">".$arena->get_arena_name()."</option>";
                                                }
                                                ?>
                                        </select>
@@ -338,7 +338,7 @@
                                        <?php if($new_organization){?>
                                        <input type="hidden" 
name="organization_id" id="organization_id" value="new_org" />
                                                <dt><label 
for="orgname">Organisasjonsnavn</label></dt>
-                                               <dd><input type="text" 
name="orgname"/></dd>
+                                               <dd><input type="text" 
name="orgname" size="100"/></dd>
                                                <dt><label 
for="orgno">Organisasjonsnummer</label></dt>
                                                <dd><input type="text" 
name="orgno"/></dd>
                                                <dt><label 
for="district">Bydel</label></dt>
@@ -353,7 +353,7 @@
                                                }?>
                                                </select></dd>
                                                <dt><label 
for="homepage">Hjemmeside</label></dt>
-                                               <dd><input type="text" 
name="homepage"/></dd>
+                                               <dd><input type="text" 
name="homepage" size="100"/></dd>
                                                <dt><label 
for="email">E-post</label></dt>
                                                <dd><input type="text" 
name="email"/></dd>
                                                <dt><label 
for="phone">Telefon</label></dt>
@@ -364,20 +364,20 @@
                                                <label 
for="number">Nummer</label>
                                                <input type="text" 
name="number"/><br/>
                                                <label 
for="postaddress">Postnummer og Sted</label>
-                                               <input type="text" 
name="postaddress"/></dd>
+                                               <input type="text" 
name="postaddress" size="100"/></dd>
                                                <dt><label 
for="org_description">Beskrivelse</label></dt>
                                                <dd><textarea rows="10" 
cols="100" name="org_description"></textarea></dd>
                                        <hr/>
                                        <b>Kontaktperson 1</b><br/>
                                        <dt><label 
for="contact1_name">Navn</label>
-                                       <input type="text" 
name="org_contact1_name"/><br/>
+                                       <input type="text" 
name="org_contact1_name" size="100"/><br/>
                                        <dt><label 
for="contact1_phone">Telefon</label>
                                        <input type="text" 
name="org_contact1_phone"/><br/>
                                        <dt><label 
for="contact1_mail">E-post</label>
                                        <input type="text" 
name="org_contact1_mail"/><br/>
                                        <b>Kontaktperson 2</b><br/>
                                        <dt><label 
for="contact2_name">Navn</label>
-                                       <input type="text" 
name="org_contact2_name"/><br/>
+                                       <input type="text" 
name="org_contact2_name" size="100"/><br/>
                                        <dt><label 
for="contact2_phone">Telefon</label>
                                        <input type="text" 
name="org_contact2_phone"/><br/>
                                        <dt><label 
for="contact2_mail">E-post</label>
@@ -388,7 +388,7 @@
                                        <label 
for="contact2_number">Nummer</label>
                                        <input type="text" 
name="org_contact2_number"/><br/>
                                        <dt><label 
for="contact2_postaddress">Postnummer og Sted</label>
-                                       <input type="text" 
name="org_contact2_postaddress"/>
+                                       <input type="text" 
name="org_contact2_postaddress" size="100"/>
                                        <hr/>
                                        <?php }else{?>
                                                <input type="hidden" 
name="organization_id" id="organization_id" value="<?php echo 
$organization->get_id()?>" />
@@ -439,7 +439,7 @@
                                </dd>
                                <span id="new_group_fields" style="display: 
none;">
                                        <dt><label 
for="groupname">Navn</label></dt>
-                                       <dd><input type="text" 
name="groupname"/><br/></dd>
+                                       <dd><input type="text" name="groupname" 
size="100"/><br/></dd>
                                        <dt><label 
for="group_description">Beskrivelse av aktiviteten</label></dt>
                                        <dd><textarea rows="10" cols="100" 
name="group_description"></textarea></dd>
                                        <hr/>

Copied: branches/Version-1_0-branch/controller/inc/class.socase.inc.php (from 
rev 8550, trunk/controller/inc/class.socase.inc.php)
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socase.inc.php             
                (rev 0)
+++ branches/Version-1_0-branch/controller/inc/class.socase.inc.php     
2012-01-10 09:51:11 UTC (rev 8551)
@@ -0,0 +1,115 @@
+<?php
+       /**
+       * phpGroupWare - controller: a part of a Facilities Management System.
+       *
+       * @author Erink Holm-Larsen <address@hidden>
+       * @author Torstein Vadla <address@hidden>
+       * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * This file is part of phpGroupWare.
+       *
+       * phpGroupWare is free software; you can redistribute it and/or modify
+       * it under the terms of the GNU General Public License as published by
+       * the Free Software Foundation; either version 2 of the License, or
+       * (at your option) any later version.
+       *
+       * phpGroupWare is distributed in the hope that it will be useful,
+       * but WITHOUT ANY WARRANTY; without even the implied warranty of
+       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+       * GNU General Public License for more details.
+       *
+       * You should have received a copy of the GNU General Public License
+       * along with phpGroupWare; if not, write to the Free Software
+       * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 
 USA
+       *
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/
+       * @package property
+       * @subpackage controller
+       * @version $Id: class.socheck_item.inc.php 8535 2012-01-09 10:14:45Z 
vator $
+       */
+
+       phpgw::import_class('controller.socommon');
+
+       include_class('controller', 'check_item_case', 'inc/model/');
+
+       class controller_socase extends controller_socommon
+       {
+               protected static $so;
+
+               /**
+                * Get a static reference to the storage object associated with 
this model object
+                *
+                * @return controller_socontrol_group the storage object
+                */
+               public static function get_instance()
+               {
+                       if (self::$so == null) {
+                               self::$so = CreateObject('controller.socase');
+                       }
+                       return self::$so;
+               }
+
+               function get_query(string $sort_field, boolean $ascending, 
string $search_for, string $search_type, array $filters, boolean 
$return_count){}
+
+               function populate(int $object_id, &$object){}
+
+               function add(&$case)
+               {
+                       $cols = array(
+                                       'check_item_id',
+                                       'status',
+                                       'location_id',
+                                       'location_item_id',
+                                       'descr',
+                                       'user_id',
+                                       'entry_date',
+                                       'modified_date',
+                                       'modified_by',
+                       );
+
+                       $values = array(
+                               $this->marshal($case->get_check_item_id(), 
'int'),
+                               $case->get_status(),
+                               $this->marshal($case->get_location_id(), 'int'),
+                               $this->marshal($case->get_location_item_id(), 
'int'),
+                               $this->marshal($case->get_descr(), 'int'),
+                               $this->marshal($case->get_user_id(), 'int'),
+                               $this->marshal($case->get_entry_date(), 'int'),
+                               $this->marshal($case->get_modified_date(), 
'int'),
+                               $this->marshal($case->get_modified_by(), 'int')
+                       );
+
+                       $result = $this->db->query('INSERT INTO 
controller_check_item_case (' . join(',', $cols) . ') VALUES (' . join(',', 
$values) . ')', __LINE__,__FILE__);
+
+                       return isset($result) ? 
$this->db->get_last_insert_id('controller_check_item_case', 'id') : 0;
+               }
+
+               function update($case)
+               {
+                       $id = $case->get_id();
+
+                       $values = array(
+                               'check_item_id = ' . 
$this->marshal($case->get_check_item_id(), 'int'),
+                               'location_id = ' . 
$this->marshal($case->get_location_id(), 'int'),
+                               'location_item_id = ' . 
$this->marshal($case->get_location_item_id(), 'int'),
+                               'descr = ' . $this->marshal($case->get_descr(), 
'string'),
+                               'user_id = ' . 
$this->marshal($case->get_user_id(), 'int'),
+                               'entry_date = ' . 
$this->marshal($case->get_entry_date(), 'int'),
+                               'modified_date = ' . 
$this->marshal($case->get_modified_date(), 'int'),
+                               'modified_by = ' . 
$this->marshal($case->get_modified_by(), 'int'),
+                       );
+
+                       $result = $this->db->query('UPDATE 
controller_check_item_case SET ' . join(',', $values) . " WHERE id=$id", 
__LINE__,__FILE__);
+
+                       if( isset($result) )
+                       {
+                               return $id;
+                       }
+                       else
+                       {
+                               return 0;
+                       }
+               }
+               
+               function get_id_field_name(){}
+       }

Modified: branches/Version-1_0-branch/controller/inc/class.socheck_item.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socheck_item.inc.php       
2012-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/controller/inc/class.socheck_item.inc.php       
2012-01-10 09:51:11 UTC (rev 8551)
@@ -136,6 +136,41 @@
                        }
                }
                
+               
+               public function 
get_check_item_by_check_list_and_control_item($check_list_id, $control_item_id)
+               {
+                       $sql = "SELECT ci.*, ci.id as c_id, coi.id as coi_id, 
coi.* ";
+                       $sql .= "FROM controller_check_item ci, 
controller_control_item coi "; 
+                       $sql .= "WHERE ci.check_list_id = $check_list_id ";
+                       $sql .= "AND ci.control_item_id = coi.id ";
+                       $sql .= "AND ci.control_item_id = $control_item_id";
+                       
+                       $this->db->limit_query($sql, 0, __LINE__, __FILE__, 1);
+
+                       if($this->db->next_record()) {
+                               $check_item = new 
controller_check_item($this->unmarshal($this->db->f('c_id', true), 'int'));
+                               
$check_item->set_status($this->unmarshal($this->db->f('status', true), 'bool'));
+                               
$check_item->set_comment($this->unmarshal($this->db->f('comment', true), 
'string'));
+                               
$check_item->set_check_list_id($this->unmarshal($this->db->f('check_list_id', 
true), 'int'));
+                               
$check_item->set_control_item_id($this->unmarshal($this->db->f('control_item_id',
 true), 'int'));
+
+                               $control_item = new 
controller_control_item($this->unmarshal($this->db->f('coi_id', true), 'int'));
+                               $control_item->set_title($this->db->f('title', 
true), 'string');
+                               
$control_item->set_required($this->db->f('required', true), 'string');
+                               
$control_item->set_what_to_do($this->db->f('what_to_do', true), 'string');
+                               
$control_item->set_how_to_do($this->db->f('how_to_do', true), 'string');
+                               
$control_item->set_control_group_id($this->db->f('control_group_id', true), 
'string');
+
+                               
$check_item->set_control_item($control_item->toArray());
+
+                               return $check_item;
+                       }
+                       else
+                       {
+                               return null;
+                       }
+               }
+               
                public function get_check_items($check_list_id, $status, $type){
                        $sql  = "SELECT ci.id as ci_id, ci.status, 
control_item_id, ci.comment, ci.measurement, check_list_id, "; 
                        $sql .= "coi.id as coi_id, coi.title, coi.required, 
coi.what_to_do, coi.how_to_do, coi.control_group_id, coi.type "; 
@@ -177,12 +212,78 @@
                        return $check_items_array;
                }
                
+               public function get_check_items_and_cases($check_list_id, 
$returnType = "object"){
+                       $sql  = "SELECT ci.id as ci_id, ci.status, 
control_item_id, ci.comment, ci.measurement, check_list_id, cic.id as cic_id, 
cic.* "; 
+                       $sql .= "FROM controller_check_item ci "; 
+                       $sql .= "LEFT JOIN controller_check_item_case as cic ON 
ci.id = cic.check_item_id ";
+                       $sql .= "WHERE ci.check_list_id = $check_list_id ";
+                                                                               
        
+                       $this->db->query($sql);
+                       
+                       $check_item_id = 0;
+                       $check_item = null;
+                       while ($this->db->next_record()) {
+                               
+                               if( $this->db->f('ci_id', true) != 
$check_item_id ){
+                                       
+                                       if($check_item_id != 0){
+                                               
$check_item->set_cases_array($cases_array);
+                                               
+                                               if($returnType == "array")
+                                                       $check_items_array[] = 
$check_item->toArray();
+                                               else
+                                                       $check_items_array[] = 
$check_item;
+                                       }
+                               
+                                       $check_item = new 
controller_check_item($this->unmarshal($this->db->f('ci_id', true), 'int'));
+                                       
$check_item->set_control_item_id($this->unmarshal($this->db->f('control_item_id',
 true), 'int'));
+                                       
$check_item->set_status($this->unmarshal($this->db->f('status', true), 'bool'));
+                                       
$check_item->set_comment($this->unmarshal($this->db->f('comment', true), 
'string'));
+                                       
$check_item->set_check_list_id($this->unmarshal($this->db->f('check_list_id', 
true), 'int'));
+                                       
$check_item->set_measurement($this->unmarshal($this->db->f('measurement', 
true), 'int'));
+                                                                       
+                                       $cases_array = array();
+                               }
+                               
+                               $case = new 
controller_check_item_case($this->unmarshal($this->db->f('cic_id', true), 
'int'));
+                               
$case->set_check_item_id($this->unmarshal($this->db->f('check_item_id', true), 
'int'));
+                               
$case->set_location_id($this->unmarshal($this->db->f('location_id', true), 
'int'));
+                               
$case->set_location_item_id($this->unmarshal($this->db->f('location_item_id', 
true), 'int'));
+                               
$case->set_descr($this->unmarshal($this->db->f('descr', true), 'string'));
+                               
$case->set_user_id($this->unmarshal($this->db->f('user_id', true), 'int'));     
+                               
$case->set_entry_date($this->unmarshal($this->db->f('entry_date', true), 
'int'));
+                               
$case->set_modified_date($this->unmarshal($this->db->f('modified_date', true), 
'int'));
+                               
$case->set_modified_by($this->unmarshal($this->db->f('modified_by', true), 
'int'));
+                       
+                               if($returnType == "array")
+                                       $cases_array[] = $case->toArray();
+                               else
+                                       $cases_array[] = $case;
+       
+                               $check_item_id =  $check_item->get_id();
+                       }
+                       
+                       if($check_item != null){
+                               $check_item->set_cases_array($cases_array);
+                               
+                               if($returnType == "array")
+                                       $check_items_array[] = 
$check_item->toArray();
+                               else
+                                       $check_items_array[] = $check_item;
+                               
+                               return $check_items_array;
+                       }else {
+                               return null;
+                       }
+               }
+               
                public function get_check_items_by_message($message_ticket_id){
-                       $sql  = "SELECT ci.id as ci_id, ci.status, 
control_item_id, ci.comment, ci.message_ticket_id, ci.measurement, 
check_list_id, "; 
+                       $sql  = "SELECT ci.id as ci_id, ci.status, 
control_item_id, ci.comment, ci.measurement, check_list_id, "; 
                        $sql .= "coi.id as coi_id, coi.title, coi.required, 
coi.what_to_do, coi.how_to_do, coi.control_group_id, coi.type "; 
                        $sql .= "FROM controller_check_item ci "; 
                        $sql .= "LEFT JOIN controller_control_item as coi ON 
ci.control_item_id = coi.id ";
-                       $sql .= "WHERE ci.message_ticket_id = 
$message_ticket_id ";
+                       $sql .= "LEFT JOIN controller_check_item_case as cic ON 
ci.id = cic.check_item_id ";
+                       $sql .= "WHERE cic.location_item_id = 
$message_ticket_id ";
                                                                
                        $this->db->query($sql);
                        
@@ -192,7 +293,6 @@
                                
$check_item->set_status($this->unmarshal($this->db->f('status', true), 'bool'));
                                
$check_item->set_comment($this->unmarshal($this->db->f('comment', true), 
'string'));
                                
$check_item->set_check_list_id($this->unmarshal($this->db->f('check_list_id', 
true), 'int'));
-                               
$check_item->set_message_ticket_id($this->unmarshal($this->db->f('message_ticket_id',
 true), 'int'));
                                
$check_item->set_measurement($this->unmarshal($this->db->f('measurement', 
true), 'int'));
                                
                                $control_item = new 
controller_control_item($this->unmarshal($this->db->f('coi_id', true), 'int'));

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-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php     
2012-01-10 09:51:11 UTC (rev 8551)
@@ -308,7 +308,7 @@
                        return $results;
                }
 
-               function get_control_items_by_control_id($control_id, 
$returnType = "object")
+               function get_control_items_by_control($control_id, $returnType 
= "object")
                {
                        $results = array();
 
@@ -327,12 +327,14 @@
 
                                if($returnType == "array")
                                        $results[] = $control_item->toArray();
+                               else
+                                       $results[] = $control_item;
                        }
                        
                        return $results;
                }
 
-               function get_control_items_by_control_id_and_group($control_id, 
$control_group_id)
+               function get_control_items_by_control_and_group($control_id, 
$control_group_id)
                {
                        $results = array();
 

Modified: branches/Version-1_0-branch/controller/inc/class.soprocedure.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.soprocedure.inc.php        
2012-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/controller/inc/class.soprocedure.inc.php        
2012-01-10 09:51:11 UTC (rev 8551)
@@ -31,6 +31,7 @@
        phpgw::import_class('controller.socommon');
 
        include_class('controller', 'procedure', 'inc/model/');
+       include_class('controller', 'document', 'inc/model/');
 
        class controller_soprocedure extends controller_socommon
        {
@@ -140,27 +141,46 @@
                function get_single($id)
                {
                        $id = (int)$id;
+                       
+                       $counter = 0;
+                       $documents = null;
+                       
 
                        $joins = " {$this->left_join} controller_control_area 
ON (p.control_area_id = controller_control_area.id)";
-                       $sql = "SELECT p.*, controller_control_area.title AS 
control_area_name FROM controller_procedure p {$joins} WHERE p.id = " . $id;
-                       $this->db->limit_query($sql, 0, __LINE__, __FILE__, 1);
-                       $this->db->next_record();
-
-                       $procedure = new 
controller_procedure($this->unmarshal($this->db->f('id', true), 'int'));
-                       
$procedure->set_title($this->unmarshal($this->db->f('title', true), 'string'));
-                       
$procedure->set_purpose($this->unmarshal($this->db->f('purpose', true), 
'string'));
-                       
$procedure->set_responsibility($this->unmarshal($this->db->f('responsibility', 
true), 'string'));
-                       
$procedure->set_description($this->unmarshal($this->db->f('description', true), 
'string'));
-                       
$procedure->set_reference($this->unmarshal($this->db->f('reference', true), 
'string'));
-                       
$procedure->set_attachment($this->unmarshal($this->db->f('attachment', true), 
'string'));
-                       
$procedure->set_start_date($this->unmarshal($this->db->f('start_date'), 'int'));
-                       
$procedure->set_end_date($this->unmarshal($this->db->f('end_date'), 'int'));
-                       
$procedure->set_procedure_id($this->unmarshal($this->db->f('procedure_id'), 
'int'));
-                       
$procedure->set_revision_no($this->unmarshal($this->db->f('revision_no'), 
'int'));
-                       
$procedure->set_revision_date($this->unmarshal($this->db->f('revision_date'), 
'int'));
-                       
$procedure->set_control_area_id($this->unmarshal($this->db->f('control_aera_id',
 'int')));
-                       
$procedure->set_control_area_name($this->unmarshal($this->db->f('control_area_name',
 'string')));
-
+                       $joins .= " {$this->left_join} controller_document ON 
(p.id = controller_document.procedure_id)";
+                       $sql = "SELECT p.*, controller_control_area.title AS 
control_area_name, controller_document.id AS document_id, 
controller_document.title AS document_title, controller_document.description as 
document_description FROM controller_procedure p {$joins} WHERE p.id = " . $id;
+                       //var_dump($sql);
+                       $this->db->query($sql, __LINE__, __FILE__);
+                       while ($this->db->next_record()) {
+                               if($counter == 0){
+                                       $procedure = new 
controller_procedure($this->unmarshal($this->db->f('id', true), 'int'));
+                                       
$procedure->set_title($this->unmarshal($this->db->f('title', true), 'string'));
+                                       
$procedure->set_purpose($this->unmarshal($this->db->f('purpose', true), 
'string'));
+                                       
$procedure->set_responsibility($this->unmarshal($this->db->f('responsibility', 
true), 'string'));
+                                       
$procedure->set_description($this->unmarshal($this->db->f('description', true), 
'string'));
+                                       
$procedure->set_reference($this->unmarshal($this->db->f('reference', true), 
'string'));
+                                       
$procedure->set_attachment($this->unmarshal($this->db->f('attachment', true), 
'string'));
+                                       
$procedure->set_start_date($this->unmarshal($this->db->f('start_date'), 'int'));
+                                       
$procedure->set_end_date($this->unmarshal($this->db->f('end_date'), 'int'));
+                                       
$procedure->set_procedure_id($this->unmarshal($this->db->f('procedure_id'), 
'int'));
+                                       
$procedure->set_revision_no($this->unmarshal($this->db->f('revision_no'), 
'int'));
+                                       
$procedure->set_revision_date($this->unmarshal($this->db->f('revision_date'), 
'int'));
+                                       
$procedure->set_control_area_id($this->unmarshal($this->db->f('control_aera_id',
 'int')));
+                                       
$procedure->set_control_area_name($this->unmarshal($this->db->f('control_area_name',
 'string')));
+                               }
+                               
+                               if($this->db->f('document_id', true) != ''){
+                                       $document = new 
controller_document($this->unmarshal($this->db->f('document_id', true), 'int'));
+                                       
$document->set_procedure_id($procedure->get_id());
+                                       
$document->set_title($this->unmarshal($this->db->f('document_title', true), 
'string'));
+                                       
$document->set_description($this->unmarshal($this->db->f('document_description',
 true), 'string'));
+                                       
+                                       $procedure->add_document($document);
+                               }
+                               
+                               $counter++;
+                       }
+//var_dump($procedure);
                        return $procedure;
                }
 

Modified: branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php 
2012-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php 
2012-01-10 09:51:11 UTC (rev 8551)
@@ -107,8 +107,6 @@
                                $heading_array[$i] = "$i";      
                        }
                                                        
-                       //print_r( $controls_calendar_array );
-                       
                        $data = array
                        (               
                                'location_array'                  => 
$location_array,
@@ -234,7 +232,7 @@
                        foreach ($control_groups_array as $control_group)
                        {       
                                $control_group_id = $control_group->get_id();
-                               $saved_control_items = 
$this->so_control_item->get_control_items_by_control_id_and_group($control_id, 
$control_group_id);
+                               $saved_control_items = 
$this->so_control_item->get_control_items_by_control_and_group($control_id, 
$control_group_id);
                                
                                $saved_groups_with_items_array[] = 
array("control_group" => $control_group->toArray(), "control_items" => 
$saved_control_items);
                        }       
@@ -289,7 +287,7 @@
                        
                        $check_list_id = $this->so_check_list->store( 
$new_check_list );
                        
-                       $control_items_list = 
$this->so_control_item->get_control_items_by_control_id($control_id);
+                       $control_items_list = 
$this->so_control_item->get_control_items_by_control($control_id);
                        
                        foreach($control_items_list as $control_item){
                                
@@ -332,7 +330,7 @@
                        
                        $check_list_id = $this->so_check_list->store( 
$new_check_list );
                        
-                       $control_items_list = 
$this->so_control_item->get_control_items_by_control_id($control_id);
+                       $control_items_list = 
$this->so_control_item->get_control_items_by_control($control_id);
                        
                        foreach($control_items_list as $control_item){
                                

Modified: branches/Version-1_0-branch/controller/inc/class.uicase.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicase.inc.php     
2012-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/controller/inc/class.uicase.inc.php     
2012-01-10 09:51:11 UTC (rev 8551)
@@ -30,51 +30,79 @@
        
        phpgw::import_class('phpgwapi.yui');
        phpgw::import_class('controller.uicommon');
-       phpgw::import_class('controller.socontrol_area');
+       phpgw::import_class('controller.socase');
+       phpgw::import_class('controller.socheck_list');
+       phpgw::import_class('controller.socheck_item');
+       phpgw::import_class('controller.socontrol');
        
-       include_class('controller', 'check_list', 'inc/model/');
-       include_class('controller', 'date_generator', 'inc/component/');
-               
-       class controller_uierror_report_message extends controller_uicommon
+       include_class('controller', 'check_item_case', 'inc/model/');
+                       
+       class controller_uicase extends controller_uicommon
        {
-               private $so_control_area;
+               private $so;
+               private $so_check_list;
                private $so_control;
-               private $so_check_list;
-               private $so_control_item;
-               private $so_check_item;
-       
+               
                var $public_functions = array(
-                                                                               
'create_case' => true,
-                                                                               
'save_case' => true
-                                                                       );
+                                                                       
'register_case' => true,
+                                                                       
'create_case_message' => true,
+                                                                       
'view_case_message' => true,
+                                                                       
'save_case_message' => true
+                                                               );
 
                function __construct()
                {
                        parent::__construct();
-
-                       $this->bo                                       = 
CreateObject('property.bolocation',true);
-                       $this->bocommon                         = & 
$this->bo->bocommon;
-                       $this->so_control_area          = 
CreateObject('controller.socontrol_area');
-                       $this->so_control                       = 
CreateObject('controller.socontrol');
-                       $this->so_check_list            = 
CreateObject('controller.socheck_list');
-                       $this->so_control_item          = 
CreateObject('controller.socontrol_item');
-                       $this->so_check_item            = 
CreateObject('controller.socheck_item');
                        
-                       $this->type_id                          = 
$this->bo->type_id;
-                       
-                       
self::set_active_menu('controller::control::location_for_check_list');
+                       $this->so = CreateObject('controller.socase');
+                       $this->so_check_list = 
CreateObject('controller.socheck_list');
+                       $this->so_control = 
CreateObject('controller.socontrol');
+                       $this->so_check_item = 
CreateObject('controller.socheck_item');
                }       
                
-               function create_case(){
+               function register_case(){
                        $check_list_id = phpgw::get_var('check_list_id');
+                       $control_item_id = phpgw::get_var('control_item_id');
                                                
-                       $check_list_with_check_items = 
$this->so_check_list->get_single_with_check_items($check_list_id, null, 
'control_item_type_1');
+                       $check_list = 
$this->so_check_list->get_single($check_list_id);
                                                
+                       $control_id = $check_list->get_control_id();
+                       $control = $this->so_control->get_single( $control_id );
+                       
+                       $check_item = 
$this->so_check_item->get_check_item_by_check_list_and_control_item($check_list_id,
 $control_item_id);
+                       
+                       $todays_date = mktime(0,0,0,date("m"), date("d"), 
date("Y"));
+
+                       $user_id = $GLOBALS['phpgw_info']['user']['id'];
+                       $status = 0;
+                       
+                       $case = new controller_check_item_case();
+                       $case->set_check_item_id( $check_item->get_id() );
+                       $case->set_status($status);
+                       $case->set_location_id($location_id);
+                       $case->set_user_id($user_id);
+                       $case->set_entry_date($todays_date);
+                       $case->set_modified_date($todays_date);
+                       $case->set_modified_by($user_id);
+                               
+                       return $this->so->store($case);
+               }
+               
+               function create_case_message(){
+                       $check_list_id = phpgw::get_var('check_list_id');
+                                               
+                       $check_items_and_cases = 
$this->so_check_item->get_check_items_and_cases($check_list_id, "array");
+
                        $control_id = 
$check_list_with_check_items["control_id"];
                        $control = $this->so_control->get_single( $control_id );
                        
-                       $location_code = 
$check_list_with_check_items["location_code"];  
-                                
+                       $location_code = 
$check_list_with_check_items["location_code"];
+
+                       $level = count(explode('-',location_code));
+                       
+                       if($level == 1)
+                               $buildings_array = 
execMethod('property.solocation.get_children',$location_code);
+                       
                        $date_format = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
        
                        $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
@@ -87,12 +115,18 @@
                        $data = array
                        (
                                'categories'                    => $categories,
-                               'location_array'                => 
$location_array,
                                'control_array'                 => 
$control->toArray(),
-                               'check_list'                    => 
$check_list_with_check_items,
+                               'check_items_and_cases' => 
$check_items_and_cases,
+                               'buildings_array'               => 
$buildings_array,
                                'date_format'                   => $date_format
                        );
                        
+                       if(count( $buildings_array ) > 0){
+                               $data['buildings_array']  = $buildings_array;
+                       }else{
+                               $data['building_array'] = $building_array;
+                       }
+                                               
                        self::add_javascript('controller', 'controller', 
'jquery.js');
                        self::add_javascript('controller', 'controller', 
'jquery-ui.custom.min.js');
                        self::add_javascript('controller', 'controller', 
'custom_ui.js');
@@ -100,15 +134,15 @@
                        
                        
$GLOBALS['phpgw']->css->add_external_file('controller/templates/base/css/jquery-ui.custom.css');
                        
-                       self::render_template_xsl('create_case', $data);
+                       self::render_template_xsl('case/create_case', $data);
                }
                
-               function save_case(){
+               function save_case_message(){
                        $check_list_id = phpgw::get_var('check_list_id');
-                       $check_item_ids = phpgw::get_var('check_item_ids');
                        $location_code = phpgw::get_var('location_code');
                        $message_title = phpgw::get_var('message_title');
                        $message_cat_id = phpgw::get_var('message_cat_id');
+                       $check_item_ids = phpgw::get_var('check_item_ids');
                        
                        $check_list = 
$this->so_check_list->get_single($check_list_id);
                                                
@@ -121,6 +155,8 @@
        
                        $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
 
+                       $message_details = "Kontroll: " .  
$control->get_title() . "\n\n";
+                       
                        // Generates message details from comment field in 
check item 
                        foreach($check_item_ids as $check_item_id){
                                $check_item = 
$this->so_check_item->get_single($check_item_id);
@@ -145,15 +181,49 @@
                        $botts = CreateObject('property.botts',true);
                        $message_ticket_id = $botts->add_ticket($ticket);
 
+                       $todays_date = mktime(0,0,0,date("m"), date("d"), 
date("Y"));
+
+                       $user_id = $GLOBALS['phpgw_info']['user']['id'];
+                       $status = 0;
+                       
                        // Registers message and updates check items with 
message ticket id
                        foreach($check_item_ids as $check_item_id){
                                $check_item = 
$this->so_check_item->get_single($check_item_id);
-                               $check_item->set_message_ticket_id( 
$message_ticket_id );
-                               $this->so_check_item->update($check_item);
+                               
+                               $case = new controller_check_item_case();
+                               $case->set_check_item_id($check_item_id);
+                               $case->set_status($status);
+                               $case->set_location_id($location_id);
+                               $case->set_location_item_id($message_ticket_id);
+                               $case->set_user_id($user_id);
+                               $case->set_entry_date($todays_date);
+                               $case->set_modified_date($todays_date);
+                               $case->set_modified_by($user_id);
+                               
+                               $this->so->store($case);
                        }                       
                        
-                       $registered_message_check_items = 
$this->so_check_item->get_check_items_by_message($message_ticket_id); 
+                       $this->redirect(array('menuaction' => 
'controller.uicase.view_case', 'check_list_id'=>$check_list_id, 
'message_ticket_id'=>$message_ticket_id));
+               }
+               
+               function view_case_message(){
+                       $check_list_id = phpgw::get_var('check_list_id');
+                       $message_ticket_id = 
phpgw::get_var('message_ticket_id');
+                               
+                       $check_list = 
$this->so_check_list->get_single($check_list_id);
+                                               
+                       $control_id = $check_list->get_control_id();
+                       $control = $this->so_control->get_single( $control_id );
                        
+                       $location_code = $check_list->get_location_code();
+                                
+                       $date_format = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+       
+                       $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
+
+                       $registered_message_check_items = 
$this->so_check_item->get_check_items_by_message($message_ticket_id);
+                       
+                       $botts = CreateObject('property.botts',true);
                        $message_ticket = 
$botts->read_single($message_ticket_id);
                        
                        $catsObj = CreateObject('phpgwapi.categories', -1, 
'property', '.ticket');
@@ -179,7 +249,7 @@
                        
                        
$GLOBALS['phpgw']->css->add_external_file('controller/templates/base/css/jquery-ui.custom.css');
                        
-                       self::render_template_xsl('view_case', $data);
+                       self::render_template_xsl('case/view_case', $data);
                }
                
                public function query(){}

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-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php       
2012-01-10 09:51:11 UTC (rev 8551)
@@ -61,9 +61,9 @@
                        'view_control_items'                            =>      
true,
                        'view_control_details'                          =>      
true,
                        'print_check_list'                                      
=>      true,
-                       'register_errors'                                       
=>      true,
-                       'view_open_errors'                                      
=>      true,
-                       'view_closed_errors'                            =>      
true,
+                       'register_case'                                         
=>      true,
+                       'view_open_cases'                                       
=>      true,
+                       'view_closed_cases'                                     
=>      true,
                        'view_measurements'                                     
=>      true
                
                );
@@ -283,7 +283,7 @@
                        //Populating array with saved control items for each 
group
                        foreach ($control_groups as $control_group)
                        {       
-                               $saved_control_items = 
$this->so_control_item->get_control_items_by_control_id_and_group($control->get_id(),
 $control_group->get_id());
+                               $saved_control_items = 
$this->so_control_item->get_control_items_by_control_and_group($control->get_id(),
 $control_group->get_id());
                                
                                $control_item = 
$this->so_control_item->get_single($control_item_id);
                                
@@ -346,7 +346,7 @@
                        //Populating array with saved control items for each 
group
                        foreach ($control_groups as $control_group)
                        {       
-                               $saved_control_items = 
$this->so_control_item->get_control_items_by_control_id_and_group($control->get_id(),
 $control_group->get_id());
+                               $saved_control_items = 
$this->so_control_item->get_control_items_by_control_and_group($control->get_id(),
 $control_group->get_id());
                                
                                $control_item = 
$this->so_control_item->get_single($control_item_id);
                                
@@ -362,59 +362,26 @@
                        
self::render_template_xsl('check_list/print_check_list', $data);
                }
                
-               function register_errors(){
+               function register_case(){
                        $check_list_id = phpgw::get_var('check_list_id');
                        
                        $check_list = 
$this->so_check_list->get_single($check_list_id);
-                       
-                       // Fetches with check items
-                       $open_check_items = 
$this->so_check_item->get_check_items($check_list_id, 'open', 
'control_item_type_1');
-
-                       // Fetches check list with check items
-                       $handled_check_items = 
$this->so_check_item->get_check_items($check_list_id, 'handled', 
'control_item_type_1');
-                                               
+                                                       
                        $location_code = $check_list->get_location_code();
                                
                        // Fetches all control items for check list
-                       $control_items_for_check_list = 
$this->so_control_item->get_control_items_by_control_id($check_list->get_control_id());
-                       
-                       // Fetches check items that registeres measurement
-                       $measurement_check_items = 
$this->so_check_item->get_check_items($check_list_id, null, 
'control_item_type_2');
-                                               
-                       // Puts ids for control items that is registered as 
open check item in an array   
-                       $control_item_ids = array();
-                       foreach($open_check_items as $check_item){
-                               $control_item_ids[] = 
$check_item["control_item_id"];
-                       }
-                       
-                       // Puts ids for control items that is registered as 
handled check item in an array   
-                       foreach($handled_check_items as $check_item){
-                               $control_item_ids[] = 
$check_item["control_item_id"];
-                       }
-                       
-                       // Puts ids for control items that is registered check 
item measurements in an array   
-                       foreach($measurement_check_items as $check_item){
-                               $control_item_ids[] = 
$check_item["control_item_id"];
-                       }
-                       
-                       // Puts control items not registered as check item in 
an array
-                       $control_items_not_registered = array();
-                       foreach($control_items_for_check_list as $control_item){
-                               if( !in_array($control_item->get_id(), 
$control_item_ids) ){
-                                       $control_items_not_registered[] = 
$control_item->toArray();
-                               }
-                       }
+                       $control_items_for_check_list = 
$this->so_control_item->get_control_items_by_control($check_list->get_control_id(),
 "array");
 
                        $data = array
                        (
-                               'control_items_not_registered'  => 
$control_items_not_registered,
+                               'control_items_for_check_list'  => 
$control_items_for_check_list,
                                'check_list'    => $check_list->toArray()
                        );
                        
-                       self::render_template_xsl('check_list/register_errors', 
$data);
+                       self::render_template_xsl('check_list/register_case', 
$data);
                }
                
-               function view_open_errors(){
+               function view_open_cases(){
                        $check_list_id = phpgw::get_var('check_list_id');
                        
                        $check_list = 
$this->so_check_list->get_single($check_list_id);
@@ -428,10 +395,10 @@
                                'check_list'            => 
$check_list->toArray()
                        );
                        
-                       
self::render_template_xsl('check_list/view_open_errors', $data);
+                       self::render_template_xsl('check_list/view_open_cases', 
$data);
                }
                
-               function view_closed_errors(){
+               function view_closed_cases(){
                        $check_list_id = phpgw::get_var('check_list_id');
                        
                        $check_list = 
$this->so_check_list->get_single($check_list_id);
@@ -445,7 +412,7 @@
                                'check_list'    => $check_list->toArray()
                        );
                        
-                       
self::render_template_xsl('check_list/view_closed_errors', $data);
+                       
self::render_template_xsl('check_list/view_closed_cases', $data);
                }
                
                function view_measurements(){
@@ -496,7 +463,7 @@
                        foreach ($control_groups_array as $control_group)
                        {
                                $control_group_id = $control_group->get_id();
-                               $saved_control_items = 
$this->so_control_item->get_control_items_by_control_id_and_group($control_id, 
$control_group_id);
+                               $saved_control_items = 
$this->so_control_item->get_control_items_by_control_and_group($control_id, 
$control_group_id);
 
                                $saved_groups_with_items_array[] = 
array("control_group" => $control_group->toArray(), "control_items" => 
$saved_control_items);
                        }
@@ -599,7 +566,7 @@
 
                        $check_list_id = $this->so_check_list->store( 
$new_check_list );
 
-                       $control_items_list = 
$this->so_control_item->get_control_items_by_control_id($control_id);
+                       $control_items_list = 
$this->so_control_item->get_control_items_by_control($control_id);
 
                        foreach($control_items_list as $control_item){
 
@@ -642,7 +609,7 @@
 
                        $check_list_id = $this->so_check_list->store( 
$new_check_list );
 
-                       $control_items_list = 
$this->so_control_item->get_control_items_by_control_id($control_id);
+                       $control_items_list = 
$this->so_control_item->get_control_items_by_control($control_id);
 
                        foreach($control_items_list as $control_item){
 

Modified: 
branches/Version-1_0-branch/controller/inc/class.uicheck_list_for_location.inc.php
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/class.uicheck_list_for_location.inc.php
  2012-01-10 09:47:57 UTC (rev 8550)
+++ 
branches/Version-1_0-branch/controller/inc/class.uicheck_list_for_location.inc.php
  2012-01-10 09:51:11 UTC (rev 8551)
@@ -61,7 +61,7 @@
                                                                                
'add_check_list_for_location'   => true,
                                                                                
'save_check_list_for_location'  => true,
                                                                                
'edit_check_list_for_location'  => true,
-                                                                               
'create_error_report_message'   => true,
+                                                                               
'create_case_message'                   => true,
                                                                                
'view_control_info'                     => true,
                                                                                
'view_errors_for_check_list'    => true
                                                                        );
@@ -444,7 +444,7 @@
                        $this->redirect(array('menuaction' => 
'controller.uicheck_list_for_location.edit_check_list_for_location', 
'check_list_id'=>$check_list_id));
                }
                
-               function create_error_report_message(){
+               function create_case_message(){
                        $check_list_id = phpgw::get_var('check_list_id');
                                                
                        $check_list_with_check_items = 
$this->so_check_list->get_single_with_check_items($check_list_id);
@@ -473,7 +473,7 @@
                        
                        
$GLOBALS['phpgw']->css->add_external_file('controller/templates/base/css/jquery-ui.custom.css');
                        
-                       
self::render_template_xsl('create_error_report_message', $data);
+                       self::render_template_xsl('create_case_messsage', 
$data);
                }
                
                public function view_control_info(){

Modified: branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php  
2012-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php  
2012-01-10 09:51:11 UTC (rev 8551)
@@ -420,7 +420,7 @@
                        $control_group_ids = 
phpgw::get_var('control_group_ids');
                
                        // Fetches saved control items from db
-                       $saved_control_items = 
$this->so_control_item->get_control_items_by_control_id($control_id);
+                       $saved_control_items = 
$this->so_control_item->get_control_items_by_control($control_id);
                        $saved_control_item_ids = array();
                        
                        foreach($saved_control_items as $control_item){
@@ -558,7 +558,7 @@
                        //Populating array with saved control items for each 
group
                        foreach ($control_group_ids as $control_group_id)
                        {       
-                               $saved_control_items = 
$this->so_control_item->get_control_items_by_control_id_and_group($control_id, 
$control_group_id);
+                               $saved_control_items = 
$this->so_control_item->get_control_items_by_control_and_group($control_id, 
$control_group_id);
                                
                                $control_group = 
$this->so_control_group->get_single($control_group_id);
                                
@@ -628,7 +628,7 @@
                        
                        $check_list_id = $this->so_check_list->store( 
$new_check_list );
                        
-                       $control_items_list = 
$this->so_control_item->get_control_items_by_control_id($control_id);
+                       $control_items_list = 
$this->so_control_item->get_control_items_by_control($control_id);
                        
                        foreach($control_items_list as $control_item){
                                

Modified: branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php        
2012-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php        
2012-01-10 09:51:11 UTC (rev 8551)
@@ -505,7 +505,7 @@
                                'group_procedures_array'        => 
$group_procedures_array
                        );
                        
-                       
self::render_template_xsl('procedure/view_procedures_for_control', 
array('view_procedures_for_control' => $data));
+                       
self::render_template_xsl('procedure/view_procedures_for_control', $data);
                }
                
                public function print_procedure(){
@@ -518,7 +518,7 @@
                                'procedure'                     => 
$procedure->toArray()
                        );
                        
-                       self::render_template_xsl('procedure/print_procedure', 
array('print_procedure' => $data));
+                       self::render_template_xsl('procedure/print_procedure', 
$data);
                }
                
                public function query()

Modified: 
branches/Version-1_0-branch/controller/inc/model/class.check_item.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/model/class.check_item.inc.php   
2012-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/controller/inc/model/class.check_item.inc.php   
2012-01-10 09:51:11 UTC (rev 8551)
@@ -44,6 +44,7 @@
                                
                // Objects
                protected $control_item;
+               protected $cases_array = array();
                
                /**
                 * Constructor.  Takes an optional ID.  If a contract is 
created from outside
@@ -114,6 +115,13 @@
                }
                
                public function get_control_item() { return 
$this->control_item; }
+               
+               public function set_cases_array($cases_array)
+               {
+                       $this->cases_array = $cases_array;
+               }
+               
+               public function get_cases_array() { return $this->cases_array; }
                        
                        
                /**

Copied: 
branches/Version-1_0-branch/controller/inc/model/class.check_item_case.inc.php 
(from rev 8550, trunk/controller/inc/model/class.check_item_case.inc.php)
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/model/class.check_item_case.inc.php  
                            (rev 0)
+++ 
branches/Version-1_0-branch/controller/inc/model/class.check_item_case.inc.php  
    2012-01-10 09:51:11 UTC (rev 8551)
@@ -0,0 +1,128 @@
+<?php
+       /**
+       * phpGroupWare - controller: a part of a Facilities Management System.
+       *
+       * @author Erink Holm-Larsen <address@hidden>
+       * @author Torstein Vadla <address@hidden>
+       * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * This file is part of phpGroupWare.
+       *
+       * phpGroupWare is free software; you can redistribute it and/or modify
+       * it under the terms of the GNU General Public License as published by
+       * the Free Software Foundation; either version 2 of the License, or
+       * (at your option) any later version.
+       *
+       * phpGroupWare is distributed in the hope that it will be useful,
+       * but WITHOUT ANY WARRANTY; without even the implied warranty of
+       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+       * GNU General Public License for more details.
+       *
+       * You should have received a copy of the GNU General Public License
+       * along with phpGroupWare; if not, write to the Free Software
+       * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 
 USA
+       *
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/
+       * @package property
+       * @subpackage controller
+       * @version $Id: class.check_item.inc.php 8478 2012-01-03 12:36:37Z 
vator $
+       */
+
+       include_class('controller', 'model', 'inc/model/');
+       
+       class controller_check_item_case extends controller_model
+       {
+               public static $so;
+
+               protected $id;
+               protected $check_item_id;
+               protected $status;
+               protected $location_id;                 // FOREKOMST I 
MELDINGSREGISTERET
+               protected $location_item_id;    // MELDINGS ID
+               protected $descr;
+               protected $user_id;
+               protected $entry_date;
+               protected $modified_date;
+               protected $modified_by;
+               
+               /**
+                * Constructor.  Takes an optional ID.  If a contract is 
created from outside
+                * the database the ID should be empty so the database can add 
one according to its logic.
+                * 
+                * @param int $id the id of this composite
+                */
+               public function __construct(int $id = null)
+               {
+                       $this->id = (int)$id;
+               }
+               
+               public function set_id($id)
+               {
+                       $this->id = $id;
+               }
+               
+               public function get_id() { return $this->id; }
+
+               public function set_check_item_id($check_item_id)
+               {
+                       $this->check_item_id = $check_item_id;
+               }
+               
+               public function get_check_item_id() { return 
$this->check_item_id; }
+                               
+               public function set_status($status)
+               {
+                       $this->status = (int)$status;
+               }
+               
+               public function get_status() { return (int)$this->status; }
+               
+               public function get_location_id() { return 
(int)$this->location_id; }
+               
+               public function set_location_id($location_id)
+               {
+                       $this->location_id = $location_id;
+               }
+               
+               public function get_location_item_id() { return 
(int)$this->location_item_id; }
+               
+               public function set_location_item_id($location_item_id)
+               {
+                       $this->location_item_id = $location_item_id;
+               }
+
+               public function get_descr() { return (int)$this->descr; }
+               
+               public function set_descr($descr)
+               {
+                       $this->descr = $descr;
+               }
+               
+               public function get_user_id() { return (int)$this->user_id; }
+               
+               public function set_user_id($user_id)
+               {
+                       $this->user_id = $user_id;
+               }
+               
+               public function get_entry_date() { return 
(int)$this->entry_date; }
+               
+               public function set_entry_date($entry_date)
+               {
+                       $this->entry_date = $entry_date;
+               }
+               
+               public function get_modified_date() { return 
(int)$this->modified_date; }
+               
+               public function set_modified_date($modified_date)
+               {
+                       $this->modified_date = $modified_date;
+               }
+               
+               public function get_modified_by() { return 
(int)$this->modified_by; }
+               
+               public function set_modified_by($modified_by)
+               {
+                       $this->modified_by = $modified_by;
+               }
+       }

Modified: 
branches/Version-1_0-branch/controller/inc/model/class.procedure.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/model/class.procedure.inc.php    
2012-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/controller/inc/model/class.procedure.inc.php    
2012-01-10 09:51:11 UTC (rev 8551)
@@ -2,7 +2,7 @@
        /**
        * phpGroupWare - controller: a part of a Facilities Management System.
        *
-       * @author Erink Holm-Larsen <address@hidden>
+       * @author Erik Holm-Larsen <address@hidden>
        * @author Torstein Vadla <address@hidden>
        * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc. 
http://www.fsf.org/
        * This file is part of phpGroupWare.
@@ -29,6 +29,7 @@
        */
 
        include_class('controller', 'model', 'inc/model/');
+       include_class('controller', 'document', 'inc/model/');
        
        class controller_procedure extends controller_model
        {
@@ -48,6 +49,7 @@
                protected $revision_date;
                protected $control_area_id;
                protected $control_area_name;
+               protected $documents;
                
                /**
                 * Constructor.  Takes an optional ID.  If a procedure is 
created from outside
@@ -58,6 +60,7 @@
                public function __construct(int $id = null)
                {
                        $this->id = (int)$id;
+                       $this->documents = array();
                }
                
                public function set_id($id)
@@ -191,4 +194,29 @@
                                        'control_area'  => 
$this->get_control_area_name()
                        );
                }
+               
+               /**
+                * Get a list of the documents associated with this procedure.
+                * 
+                * @return array with controller_document objects, empty array 
if none, never null.
+                */
+               public function get_documents()
+               {
+                       return $this->documents;
+               }
+               
+               /**
+                * Add a document to this procedure. This method does not check 
if
+                * object is already added and does not do any db handling.
+                * 
+                * @param $new_document
+                */
+               public function add_document(controller_document $new_document)
+               {
+                       $new_document_id = $new_document->get_id();
+                       if(!in_array($new_document_id,$this->documents))
+                       {
+                               $this->documents[$new_document_id] = 
$new_document;
+                       }
+               }
        }

Modified: branches/Version-1_0-branch/controller/js/controller/ajax.js
===================================================================
--- branches/Version-1_0-branch/controller/js/controller/ajax.js        
2012-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/controller/js/controller/ajax.js        
2012-01-10 09:51:11 UTC (rev 8551)
@@ -284,6 +284,35 @@
                });
        });
        
+       $("#frm_register_case").live("submit", function(e){
+               e.preventDefault();
+
+               var thisForm = $(this);
+               var submitBnt = $(thisForm).find("input[type='submit']");
+               var requestUrl = $(thisForm).attr("action");
+               
+               $.ajax({
+                         type: 'POST',
+                         url: requestUrl + "&" + $(thisForm).serialize(),
+                         success: function(data) {
+                                 if(data){
+                                 var obj = jQuery.parseJSON(data);
+                               
+                                 if(obj.saveStatus == "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 
sjekkpunkt');
+                                                       
$(submitBnt).addClass("not_active");
+                                         }, 1000);
+                                         }
+                                 }
+                               }
+               });
+       });
+       
        $("#frm_update_check_list").live("click", function(e){
                var thisForm = $(this);
                var submitBnt = $(thisForm).find("input[type='submit']");
@@ -301,4 +330,10 @@
                var submitBnt = $(thisForm).find("input[type='submit']");
                $(submitBnt).removeClass("not_active");
        });
+       
+       $("#frm_register_case").live("click", function(e){
+               var thisForm = $(this);
+               var submitBnt = $(thisForm).find("input[type='submit']");
+               $(submitBnt).removeClass("not_active");
+       });
 });
\ No newline at end of file

Modified: branches/Version-1_0-branch/controller/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/setup/setup.inc.php  2012-01-10 
09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/controller/setup/setup.inc.php  2012-01-10 
09:51:11 UTC (rev 8551)
@@ -1,6 +1,6 @@
 <?php
        $setup_info['controller']['name'] = 'controller';
-       $setup_info['controller']['version'] = '0.1.18';
+       $setup_info['controller']['version'] = '0.1.19';
        $setup_info['controller']['app_order'] = 100;
        $setup_info['controller']['enable'] = 1;
        $setup_info['controller']['app_group']  = 'office';

Modified: branches/Version-1_0-branch/controller/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/setup/tables_current.inc.php 
2012-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/controller/setup/tables_current.inc.php 
2012-01-10 09:51:11 UTC (rev 8551)
@@ -194,12 +194,12 @@
                                'check_item_id'         => array('type' => 
'int', 'precision' => '4', 'nullable' => false),
                                'status' => array('type' => 'int', 'precision' 
=> '4', 'nullable' => false),
                                'location_id' => array('type' => 'int', 
'precision' => '4', 'nullable' => true), // representer meldingsfregisteret
-                    'location_item_id' => array('type' => 'int', 'precision' 
=> '8', 'nullable' => true), //meldings id
-                    'descr' => array('type' => 'text','nullable' => true),
-                    'user_id' => array('type' => 'int','precision' => 
'4','nullable' => true),
-                    'entry_date' => array('type' => 'int', 'precision' => 
4,'nullable' => false),
-                    'modified_date' => array('type' => 'int', 'precision' => 
4,'nullable' => True),
-                    'modified_by' => array('type' => 'int', 'precision' => 
4,'nullable' => True),
+                'location_item_id' => array('type' => 'int', 'precision' => 
'8', 'nullable' => true), //meldings id
+                'descr' => array('type' => 'text','nullable' => true),
+                'user_id' => array('type' => 'int','precision' => 
'4','nullable' => true),
+                'entry_date' => array('type' => 'int', 'precision' => 
8,'nullable' => false),
+                'modified_date' => array('type' => 'int', 'precision' => 
8,'nullable' => True),
+                'modified_by' => array('type' => 'int', 'precision' => 
4,'nullable' => True),
               ),
                 'pk' => array('id'),
                 'fk' => array('controller_check_item' => array('check_item_id' 
=> 'id')),

Modified: branches/Version-1_0-branch/controller/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/setup/tables_update.inc.php  
2012-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/controller/setup/tables_update.inc.php  
2012-01-10 09:51:11 UTC (rev 8551)
@@ -389,12 +389,30 @@
                );
                
                
$GLOBALS['phpgw_setup']->oProc->AddColumn('controller_check_item', 
'measurement',array(
-                       'type' => 'int',
-                       'precision' => 8,
-                       'nullable' => true,
-                       'default' => 0
+                       'type' => 'varchar',
+                       'precision' => 50,
+                       'nullable' => true
                ));
 
                $GLOBALS['setup_info']['controller']['currentver'] = '0.1.18';
                return $GLOBALS['setup_info']['controller']['currentver'];
+       }
+       
+       $test[] = '0.1.18';
+       function controller_upgrade0_1_18()
+       {
+               
$GLOBALS['phpgw_setup']->oProc->AlterColumn('controller_check_item_case','entry_date',array(
+                       'type' => 'int', 
+                       'precision' => 8,
+                       'nullable' => false
+               ));
+               
+               
$GLOBALS['phpgw_setup']->oProc->AlterColumn('controller_check_item_case','modified_date',array(
+                       'type' => 'int', 
+                       'precision' => 8,
+                       'nullable' => true
+               ));
+               
+               $GLOBALS['setup_info']['controller']['currentver'] = '0.1.19';
+               return $GLOBALS['setup_info']['controller']['currentver'];
        }
\ No newline at end of file

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-01-10 09:47:57 UTC (rev 8550)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/edit_check_list.xsl
        2012-01-10 09:51:11 UTC (rev 8551)
@@ -53,7 +53,7 @@
                                Vis info om kontroll
                        </a>
                        
-                       <a style="background:#DD624B;border-bottom: 1px solid 
#CB563F;border-top: 1px solid #EE836F;box-shadow: 0 1px 0 #A9422E, 0 -1px 0 
#A9422E;color: #FFFFFF;height: 18px;margin-left: 40px;margin-top: 1px;">
+                       <a style="background:#DD624B;border-bottom: 1px solid 
#CB563F;border-top: 1px solid #EE836F;box-shadow: 0 1px 0 #A9422E, 0 -1px 0 
#A9422E;color: #FFFFFF;height: 18px;margin-left: 75px;margin-top: 1px;">
                                <xsl:attribute name="href">
                                        
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.register_error</xsl:text>
                                        <xsl:text>&amp;check_list_id=</xsl:text>
@@ -63,8 +63,7 @@
                        </a>
                </div>
                
-               <div class="tab_menu"><a 
class="active">Sjekklistedetaljer</a></div>
-               
+               <h3 class="box_header">Sjekklistedetaljer</h3>
                <fieldset class="check_list_details">
                        <form id="frm_update_check_list" 
action="index.php?menuaction=controller.uicheck_list.update_check_list" 
method="post">
                                

Copied: 
branches/Version-1_0-branch/controller/templates/base/check_list/register_case.xsl
 (from rev 8550, trunk/controller/templates/base/check_list/register_case.xsl)
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/register_case.xsl
                          (rev 0)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/register_case.xsl
  2012-01-10 09:51:11 UTC (rev 8551)
@@ -0,0 +1,102 @@
+<!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
+
+<xsl:template match="data" xmlns:php="http://php.net/xsl";>
+
+<div id="error_message_menu">
+       <a class="btn" id="view_open_errors">                                   
+               <xsl:attribute name="href">
+                       
<xsl:text>index.php?menuaction=controller.uicheck_list.view_open_errors</xsl:text>
+                       <xsl:text>&amp;check_list_id=</xsl:text>
+                       <xsl:value-of select="check_list/id"/>
+                       <xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
+               </xsl:attribute>
+               Vis avvik/måling
+       </a>
+       <a class="btn">
+               <xsl:attribute name="href">
+                       
<xsl:text>index.php?menuaction=controller.uicase.create_case_message</xsl:text>
+                       <xsl:text>&amp;check_list_id=</xsl:text>
+                       <xsl:value-of select="check_list/id"/>
+               </xsl:attribute>
+               Registrer avviksmelding
+       </a>
+</div>
+
+<div id="register_errors_content">
+                       <div class="tab_menu"><a class="active">Registrer 
sak/måling</a></div>
+                                       
+                       <div class="tab_item active">
+                       
+                       <xsl:choose>
+                               <xsl:when 
test="control_items_for_check_list/child::node()">
+                               
+                                       <ul id="control_items_list" 
class="check_items expand_list">
+                                               <xsl:for-each 
select="control_items_for_check_list">
+                                                       <li>
+                                                       <h4><img 
src="controller/images/arrow_right.png" width="14"/><span><xsl:value-of 
select="title"/></span></h4>                                           
+                                                               <form 
id="frm_register_case" 
action="index.php?menuaction=controller.uicase.register_case&amp;phpgw_return_as=json"
 method="post">
+                                                                       
<xsl:variable name="control_item_id"><xsl:value-of select="id"/></xsl:variable>
+                                                                       <input 
type="hidden" name="control_item_id" value="{$control_item_id}" /> 
+                                                                       <input 
name="check_list_id" type="hidden">
+                                                                     
<xsl:attribute name="value">
+                                                                       
<xsl:value-of select="//check_list/id"/>
+                                                                     
</xsl:attribute>
+                                                                   </input>
+                                                                   <input 
name="status" type="hidden" value="0" />
+                                                                     
+                                                               <xsl:choose>
+                                                                       
<xsl:when test="type = 'control_item_type_1'">
+                                                                               
<input name="type" type="hidden" value="control_item_type_1" />
+                                                                           
+                                                                               
<div class="check_item">
+                                                                              
<div>
+                                                                               
         <label class="comment">Kommentar</label>
+                                                                               
         <textarea name="comment">
+                                                                               
                        <xsl:value-of select="comment"/>
+                                                                               
                 </textarea>
+                                                                               
   </div>
+                                                                              
<div class="form-buttons">
+                                                                               
                <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'register_error')" /></xsl:variable>
+                                                                               
                <input type="submit" name="save_control" value="{$lang_save}" 
class="not_active" title="{$lang_save}" />
+                                                                               
        </div>
+                                                                               
</div>
+                                                                       
</xsl:when>
+                                                                       
<xsl:when test="type = 'control_item_type_2'">
+                                                                               
<input name="type" type="hidden" value="control_item_type_2" />
+                                                                               
<div class="check_item">
+                                                                               
 <div>
+                                                                               
 <label class="comment">Registrer målingsverdi</label>
+                                                                               
   <input>
+                                                                               
              <xsl:attribute name="name">measurement</xsl:attribute>
+                                                                               
              <xsl:attribute name="type">text</xsl:attribute>
+                                                                               
              <xsl:attribute name="value">
+                                                                               
                <xsl:value-of select="measurement"/>
+                                                                               
              </xsl:attribute>
+                                                                               
            </input>
+                                                                              
</div>
+                                                                              
<div>
+                                                                               
         <label class="comment">Kommentar</label>
+                                                                               
         <textarea name="comment">
+                                                                               
                        <xsl:value-of select="comment"/>
+                                                                               
                 </textarea>
+                                                                               
   </div>
+                                                                              
<div class="form-buttons">
+                                                                               
                <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'register_error')" /></xsl:variable>
+                                                                               
                <input type="submit" name="save_control" value="Registrer 
avvik" class="not_active" title="{$lang_save}" />
+                                                                               
        </div>
+                                                                               
</div>
+                                                                       
</xsl:when>
+                                                               </xsl:choose>   
                                                                                
                        
+                                                                       
+                                                               </form>
+                                                   </li>
+                                               </xsl:for-each>
+                                       </ul>                   
+                                       </xsl:when>
+                                       <xsl:otherwise>
+                                               Alle sjekkpunkter for kontroll 
er registert som åpent/håndtert avvik eller måling 
+                                       </xsl:otherwise>
+                       </xsl:choose>
+               </div>
+               </div>
+</xsl:template>

Deleted: 
branches/Version-1_0-branch/controller/templates/base/check_list/register_errors.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/register_errors.xsl
        2012-01-10 09:47:57 UTC (rev 8550)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/register_errors.xsl
        2012-01-10 09:51:11 UTC (rev 8551)
@@ -1,101 +0,0 @@
-<!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
-
-<xsl:template match="register_errors" xmlns:php="http://php.net/xsl";>
-
-<div id="error_message_menu">
-       <a class="btn" id="view_open_errors">                                   
-               <xsl:attribute name="href">
-                       
<xsl:text>index.php?menuaction=controller.uicheck_list.view_open_errors</xsl:text>
-                       <xsl:text>&amp;check_list_id=</xsl:text>
-                       <xsl:value-of select="check_list/id"/>
-               </xsl:attribute>
-               Vis avvik/måling
-       </a>
-       <a class="btn">
-               <xsl:attribute name="href">
-                       
<xsl:text>index.php?menuaction=controller.uierror_report_message.create_error_report_message</xsl:text>
-                       <xsl:text>&amp;check_list_id=</xsl:text>
-                       <xsl:value-of select="check_list/id"/>
-               </xsl:attribute>
-               Registrer avviksmelding
-       </a>
-</div>
-
-<div id="register_errors_content">
-                       <div class="tab_menu"><a class="active">Registrer 
sak/måling</a></div>
-                                       
-                       <div class="tab_item active">
-                       
-                       <xsl:choose>
-                               <xsl:when 
test="control_items_not_registered/child::node()">
-                               
-                                       <ul id="control_items_list" 
class="check_items expand_list">
-                                               <xsl:for-each 
select="control_items_not_registered">
-                                                       <li>
-                                                       <h4><img 
src="controller/images/arrow_right.png" width="14"/><span><xsl:value-of 
select="title"/></span></h4>                                           
-                                                               <form 
class="frm_save_control_item" 
action="index.php?menuaction=controller.uicheck_list.add_check_item_to_list" 
method="post">
-                                                                       
<xsl:variable name="control_item_id"><xsl:value-of select="id"/></xsl:variable>
-                                                                       <input 
type="hidden" name="control_item_id" value="{$control_item_id}" /> 
-                                                                       <input 
name="check_list_id" type="hidden">
-                                                                     
<xsl:attribute name="value">
-                                                                       
<xsl:value-of select="//check_list/id"/>
-                                                                     
</xsl:attribute>
-                                                                   </input>
-                                                                   <input 
name="status" type="hidden" value="0" />
-                                                                     
-                                                               <xsl:choose>
-                                                                       
<xsl:when test="type = 'control_item_type_1'">
-                                                                               
<input name="type" type="hidden" value="control_item_type_1" />
-                                                                           
-                                                                               
<div class="check_item">
-                                                                              
<div>
-                                                                               
         <label class="comment">Kommentar</label>
-                                                                               
         <textarea name="comment">
-                                                                               
                        <xsl:value-of select="comment"/>
-                                                                               
                 </textarea>
-                                                                               
   </div>
-                                                                              
<div class="form-buttons">
-                                                                               
                <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'register_error')" /></xsl:variable>
-                                                                               
                <input type="submit" name="save_control" value="{$lang_save}" 
class="not_active" title="{$lang_save}" />
-                                                                               
        </div>
-                                                                               
</div>
-                                                                       
</xsl:when>
-                                                                       
<xsl:when test="type = 'control_item_type_2'">
-                                                                               
<input name="type" type="hidden" value="control_item_type_2" />
-                                                                               
<div class="check_item">
-                                                                               
 <div>
-                                                                               
 <label class="comment">Registrer målingsverdi</label>
-                                                                               
   <input>
-                                                                               
              <xsl:attribute name="name">measurement</xsl:attribute>
-                                                                               
              <xsl:attribute name="type">text</xsl:attribute>
-                                                                               
              <xsl:attribute name="value">
-                                                                               
                <xsl:value-of select="measurement"/>
-                                                                               
              </xsl:attribute>
-                                                                               
            </input>
-                                                                              
</div>
-                                                                              
<div>
-                                                                               
         <label class="comment">Kommentar</label>
-                                                                               
         <textarea name="comment">
-                                                                               
                        <xsl:value-of select="comment"/>
-                                                                               
                 </textarea>
-                                                                               
   </div>
-                                                                              
<div class="form-buttons">
-                                                                               
                <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'register_error')" /></xsl:variable>
-                                                                               
                <input type="submit" name="save_control" value="Registrer 
avvik" class="not_active" title="{$lang_save}" />
-                                                                               
        </div>
-                                                                               
</div>
-                                                                       
</xsl:when>
-                                                               </xsl:choose>   
                                                                                
                        
-                                                                       
-                                                               </form>
-                                                   </li>
-                                               </xsl:for-each>
-                                       </ul>                   
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               Alle sjekkpunkter for kontroll 
er registert som åpent/håndtert avvik eller måling 
-                                       </xsl:otherwise>
-                       </xsl:choose>
-               </div>
-               </div>
-</xsl:template>

Copied: 
branches/Version-1_0-branch/controller/templates/base/check_list/view_closed_cases.xsl
 (from rev 8550, 
trunk/controller/templates/base/check_list/view_closed_cases.xsl)
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/view_closed_cases.xsl
                              (rev 0)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_closed_cases.xsl
      2012-01-10 09:51:11 UTC (rev 8551)
@@ -0,0 +1,110 @@
+<!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
+
+<xsl:template match="data">
+
+<div id="error_message_menu">
+       <a class="btn" id="register_errors">                                    
+               <xsl:attribute name="href">
+                       
<xsl:text>index.php?menuaction=controller.uicheck_list.register_case</xsl:text>
+                       <xsl:text>&amp;check_list_id=</xsl:text>
+                       <xsl:value-of select="check_list/id"/>
+                       <xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
+               </xsl:attribute>
+               Registrer sak/måling
+       </a>
+       <a class="btn">
+               <xsl:attribute name="href">
+                       
<xsl:text>index.php?menuaction=controller.uicase.create_case_message</xsl:text>
+                       <xsl:text>&amp;check_list_id=</xsl:text>
+                       <xsl:value-of select="check_list/id"/>
+               </xsl:attribute>
+               Registrer avviksmelding
+       </a>
+</div>
+       
+<div id="view_errors">
+       
+       <div class="tab_menu">
+               <a id="view_open_errors">                                       
+                       <xsl:attribute name="href">
+                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_open_cases</xsl:text>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                               
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
+                       </xsl:attribute>
+                       Vis åpne saker
+               </a>
+               <a class="active" id="view_closed_errors">                      
                
+                       <xsl:attribute name="href">
+                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_closed_cases</xsl:text>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                               
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
+                       </xsl:attribute>
+                       Vis lukkede saker
+               </a>
+               <a id="view_measurements">                                      
+                       <xsl:attribute name="href">
+                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_measurements</xsl:text>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                               
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
+                       </xsl:attribute>
+                       Vis målinger
+               </a>
+       </div>  
+       
+       <div class="tab_item"> 
+               <xsl:choose>
+                       <xsl:when test="handled_check_items/child::node()">
+                               
+                       <div class="expand_menu"><div class="expand_all">Vis 
alle</div><div class="collapse_all focus">Skjul alle</div></div>
+                               
+                               <ul id="check_list_fixed_list" 
class="check_items expand_list">
+                                       <xsl:for-each 
select="handled_check_items">
+                                                       <xsl:if test="status = 
1">
+                                                       <li>
+                                                       <h4><img 
src="controller/images/arrow_right.png" width="14"/><span><xsl:value-of 
select="control_item/title"/></span></h4>                                       
       
+                                                               <form 
id="frm_save_check_item" 
action="index.php?menuaction=controller.uicheck_list.save_check_item" 
method="post">
+                                                                       
<xsl:variable name="check_item_id"><xsl:value-of select="id"/></xsl:variable>
+                                                                       <input 
type="hidden" name="check_item_id" value="{$check_item_id}" /> 
+                                                                       <div 
class="check_item">
+                                                                         <div>
+                                                                              
<label>Status</label>
+                                                                              
<select name="status">
+                                                                               
        <xsl:choose>
+                                                                               
                <xsl:when test="status = 0">
+                                                                               
                        <option value="0" SELECTED="SELECTED">Avvik er 
åpent</option>
+                                                                               
                        <option value="1">Avvik er håndtert</option>
+                                                                               
                </xsl:when>
+                                                                               
                <xsl:when test="status = 1">
+                                                                               
                        <option value="0">Avvik er åpent</option>
+                                                                               
                        <option value="1" SELECTED="SELECTED">Avvik er 
lukket</option>
+                                                                               
                </xsl:when>
+                                                                               
        </xsl:choose>
+                                                                               
   </select>
+                                                                      </div>
+                                                                      <div>
+                                                                        <label 
class="comment">Kommentar</label>
+                                                                        
<textarea name="comment">
+                                                                               
        <xsl:value-of select="comment"/>
+                                                                               
 </textarea>
+                                                                      </div>
+                                                                      <div 
class="form-buttons">
+                                                                               
        <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_item')" /></xsl:variable>
+                                                                               
        <input type="submit" name="save_control" value="Oppdater håndtert 
avvik" class="not_active" title="{$lang_save}" />
+                                                                               
</div>
+                                                                       </div>
+                                                               </form>
+                                                   </li>
+                                               </xsl:if>
+                                       </xsl:for-each>
+                               </ul>                   
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       Ingen registrerte håndterte avvik
+                               </xsl:otherwise>
+               </xsl:choose>
+       </div>
+</div>
+</xsl:template>
\ No newline at end of file

Deleted: 
branches/Version-1_0-branch/controller/templates/base/check_list/view_closed_errors.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/view_closed_errors.xsl
     2012-01-10 09:47:57 UTC (rev 8550)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_closed_errors.xsl
     2012-01-10 09:51:11 UTC (rev 8551)
@@ -1,110 +0,0 @@
-<!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
-
-<xsl:template match="view_closed_errors">
-
-<div id="error_message_menu">
-       <a class="btn" id="register_errors">                                    
-               <xsl:attribute name="href">
-                       
<xsl:text>index.php?menuaction=controller.uicheck_list.register_errors</xsl:text>
-                       <xsl:text>&amp;check_list_id=</xsl:text>
-                       <xsl:value-of select="check_list/id"/>
-                       <xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
-               </xsl:attribute>
-               Registrer sak/måling
-       </a>
-       <a class="btn">
-               <xsl:attribute name="href">
-                       
<xsl:text>index.php?menuaction=controller.uierror_report_message.create_error_report_message</xsl:text>
-                       <xsl:text>&amp;check_list_id=</xsl:text>
-                       <xsl:value-of select="check_list/id"/>
-               </xsl:attribute>
-               Registrer avviksmelding
-       </a>
-</div>
-       
-<div id="view_errors">
-       
-       <div class="tab_menu">
-               <a id="view_open_errors">                                       
-                       <xsl:attribute name="href">
-                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_open_errors</xsl:text>
-                               <xsl:text>&amp;check_list_id=</xsl:text>
-                               <xsl:value-of select="check_list/id"/>
-                               
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
-                       </xsl:attribute>
-                       Vis åpne saker
-               </a>
-               <a class="active" id="view_closed_errors">                      
                
-                       <xsl:attribute name="href">
-                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_closed_errors</xsl:text>
-                               <xsl:text>&amp;check_list_id=</xsl:text>
-                               <xsl:value-of select="check_list/id"/>
-                               
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
-                       </xsl:attribute>
-                       Vis lukkede saker
-               </a>
-               <a id="view_measurements">                                      
-                       <xsl:attribute name="href">
-                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_measurements</xsl:text>
-                               <xsl:text>&amp;check_list_id=</xsl:text>
-                               <xsl:value-of select="check_list/id"/>
-                               
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
-                       </xsl:attribute>
-                       Vis målinger
-               </a>
-       </div>  
-       
-       <div class="tab_item"> 
-               <xsl:choose>
-                       <xsl:when test="handled_check_items/child::node()">
-                               
-                       <div class="expand_menu"><div class="expand_all">Vis 
alle</div><div class="collapse_all focus">Skjul alle</div></div>
-                               
-                               <ul id="check_list_fixed_list" 
class="check_items expand_list">
-                                       <xsl:for-each 
select="handled_check_items">
-                                                       <xsl:if test="status = 
1">
-                                                       <li>
-                                                       <h4><img 
src="controller/images/arrow_right.png" width="14"/><span><xsl:value-of 
select="control_item/title"/></span></h4>                                       
       
-                                                               <form 
id="frm_save_check_item" 
action="index.php?menuaction=controller.uicheck_list.save_check_item" 
method="post">
-                                                                       
<xsl:variable name="check_item_id"><xsl:value-of select="id"/></xsl:variable>
-                                                                       <input 
type="hidden" name="check_item_id" value="{$check_item_id}" /> 
-                                                                       <div 
class="check_item">
-                                                                         <div>
-                                                                              
<label>Status</label>
-                                                                              
<select name="status">
-                                                                               
        <xsl:choose>
-                                                                               
                <xsl:when test="status = 0">
-                                                                               
                        <option value="0" SELECTED="SELECTED">Avvik er 
åpent</option>
-                                                                               
                        <option value="1">Avvik er håndtert</option>
-                                                                               
                </xsl:when>
-                                                                               
                <xsl:when test="status = 1">
-                                                                               
                        <option value="0">Avvik er åpent</option>
-                                                                               
                        <option value="1" SELECTED="SELECTED">Avvik er 
lukket</option>
-                                                                               
                </xsl:when>
-                                                                               
        </xsl:choose>
-                                                                               
   </select>
-                                                                      </div>
-                                                                      <div>
-                                                                        <label 
class="comment">Kommentar</label>
-                                                                        
<textarea name="comment">
-                                                                               
        <xsl:value-of select="comment"/>
-                                                                               
 </textarea>
-                                                                      </div>
-                                                                      <div 
class="form-buttons">
-                                                                               
        <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_item')" /></xsl:variable>
-                                                                               
        <input type="submit" name="save_control" value="Oppdater håndtert 
avvik" class="not_active" title="{$lang_save}" />
-                                                                               
</div>
-                                                                       </div>
-                                                               </form>
-                                                   </li>
-                                               </xsl:if>
-                                       </xsl:for-each>
-                               </ul>                   
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       Ingen registrerte håndterte avvik
-                               </xsl:otherwise>
-               </xsl:choose>
-       </div>
-</div>
-</xsl:template>
\ No newline at end of file

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_details.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_details.xsl
   2012-01-10 09:47:57 UTC (rev 8550)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_details.xsl
   2012-01-10 09:51:11 UTC (rev 8551)
@@ -1,7 +1,7 @@
 <!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
 <xsl:variable name="date_format">d/m-Y</xsl:variable>
 
-<xsl:template match="view_control_details" xmlns:php="http://php.net/xsl";>
+<xsl:template match="data" xmlns:php="http://php.net/xsl";>
        
 
        <fieldset>

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_info.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_info.xsl
      2012-01-10 09:47:57 UTC (rev 8550)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_info.xsl
      2012-01-10 09:51:11 UTC (rev 8551)
@@ -94,7 +94,7 @@
                                Vis info om kontroll
                        </a>
                        
-                       <a style="background:#DD624B;border-bottom: 1px solid 
#CB563F;border-top: 1px solid #EE836F;box-shadow: 0 1px 0 #A9422E, 0 -1px 0 
#A9422E;color: #FFFFFF;height: 18px;margin-left: 40px;margin-top: 1px;">
+                       <a style="background:#DD624B;border-bottom: 1px solid 
#CB563F;border-top: 1px solid #EE836F;box-shadow: 0 1px 0 #A9422E, 0 -1px 0 
#A9422E;color: #FFFFFF;height: 18px;margin-left: 75px;margin-top: 1px;">
                                <xsl:attribute name="href">
                                        
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.register_error</xsl:text>
                                        <xsl:text>&amp;check_list_id=</xsl:text>

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_items.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_items.xsl
     2012-01-10 09:47:57 UTC (rev 8550)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_control_items.xsl
     2012-01-10 09:51:11 UTC (rev 8551)
@@ -1,6 +1,6 @@
 <!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
 
-<xsl:template match="view_control_items">
+<xsl:template match="data">
 
 <ul class="groups">
        <xsl:for-each select="saved_groups_with_items_array">

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/view_errors_for_check_list.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/view_errors_for_check_list.xsl
     2012-01-10 09:47:57 UTC (rev 8550)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_errors_for_check_list.xsl
     2012-01-10 09:51:11 UTC (rev 8551)
@@ -6,28 +6,30 @@
                
        <script>
        
+               // ======================  LASTER FANEN view_open_errors NÅR 
SIDEN LASTES FØRSTE GANG  ===================
                $(document).ready(function() {
-                               var requestUrl = 
$("#view_open_errors").attr("href");
-                               load_tab(requestUrl);
-                       });
+                       var requestUrl = $("#view_open_cases").attr("href");
+                       load_tab(requestUrl);
+               });
                        
+               // ======================  FUNKSJONALITET FOR LASTING AV TABS 
===================
                $(function() {
                                        
-                       $("#register_errors").live("click", function(){
+                       $("#register_case").live("click", function(){
                                var requestUrl = $(this).attr("href");
                                load_tab(requestUrl);
                        
                                return false;
                        });
                                                
-                       $("#view_open_errors").live("click", function(){
+                       $("#view_open_cases").live("click", function(){
                                var requestUrl = $(this).attr("href");
                                load_tab(requestUrl);
                        
                                return false;
                        });
                        
-                       $("#view_closed_errors").live("click", function(){
+                       $("#view_closed_cases").live("click", function(){
                                var requestUrl = $(this).attr("href");
                                load_tab(requestUrl);
                        
@@ -81,7 +83,7 @@
                                Vis info om kontroll
                        </a>
                        
-                       <a style="background:#DD624B;border-bottom: 1px solid 
#CB563F;border-top: 1px solid #EE836F;box-shadow: 0 1px 0 #A9422E, 0 -1px 0 
#A9422E;color: #FFFFFF;height: 18px;margin-left: 40px;margin-top: 1px;">
+                       <a style="background:#DD624B;border-bottom: 1px solid 
#CB563F;border-top: 1px solid #EE836F;box-shadow: 0 1px 0 #A9422E, 0 -1px 0 
#A9422E;color: #FFFFFF;height: 18px;margin-left: 75px;margin-top: 1px;">
                                <xsl:attribute name="href">
                                        
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.register_error</xsl:text>
                                        <xsl:text>&amp;check_list_id=</xsl:text>
@@ -92,9 +94,9 @@
                </div>
                
                
-               <a style="display:none;" id="view_open_errors">
+               <a style="display:none;" id="view_open_cases">
                        <xsl:attribute name="href">
-                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_open_errors</xsl:text>
+                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_open_cases</xsl:text>
                                <xsl:text>&amp;check_list_id=</xsl:text>
                                <xsl:value-of select="check_list/id"/>
                                
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>

Modified: 
branches/Version-1_0-branch/controller/templates/base/check_list/view_measurements.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/view_measurements.xsl
      2012-01-10 09:47:57 UTC (rev 8550)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_measurements.xsl
      2012-01-10 09:51:11 UTC (rev 8551)
@@ -1,19 +1,20 @@
 <!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
 
-<xsl:template match="view_measurements">
+<xsl:template match="data">
 
 <div id="error_message_menu">
        <a class="btn" id="register_errors">                                    
                <xsl:attribute name="href">
-                       
<xsl:text>index.php?menuaction=controller.uicheck_list.register_errors</xsl:text>
+                       
<xsl:text>index.php?menuaction=controller.uicheck_list.register_case</xsl:text>
                        <xsl:text>&amp;check_list_id=</xsl:text>
                        <xsl:value-of select="check_list/id"/>
+                       <xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
                </xsl:attribute>
                Registrer sak/måling
        </a>
        <a class="btn">
                <xsl:attribute name="href">
-                       
<xsl:text>index.php?menuaction=controller.uierror_report_message.create_error_report_message</xsl:text>
+                       
<xsl:text>index.php?menuaction=controller.uicase.create_case_message</xsl:text>
                        <xsl:text>&amp;check_list_id=</xsl:text>
                        <xsl:value-of select="check_list/id"/>
                </xsl:attribute>
@@ -26,7 +27,7 @@
        <div class="tab_menu">
                <a id="view_open_errors">                                       
                        <xsl:attribute name="href">
-                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_open_errors</xsl:text>
+                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_open_cases</xsl:text>
                                <xsl:text>&amp;check_list_id=</xsl:text>
                                <xsl:value-of select="check_list/id"/>
                                
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
@@ -35,9 +36,10 @@
                </a>
                <a id="view_closed_errors">                                     
                        <xsl:attribute name="href">
-                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_closed_errors</xsl:text>
+                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_closed_cases</xsl:text>
                                <xsl:text>&amp;check_list_id=</xsl:text>
                                <xsl:value-of select="check_list/id"/>
+                               
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
                        </xsl:attribute>
                        Vis lukkede saker
                </a>

Copied: 
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_cases.xsl
 (from rev 8550, trunk/controller/templates/base/check_list/view_open_cases.xsl)
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_cases.xsl
                                (rev 0)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_cases.xsl
        2012-01-10 09:51:11 UTC (rev 8551)
@@ -0,0 +1,110 @@
+<!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
+
+<xsl:template match="data" xmlns:php="http://php.net/xsl";>
+
+<div id="error_message_menu">
+       <a class="btn" id="register_case">                                      
+               <xsl:attribute name="href">
+                       
<xsl:text>index.php?menuaction=controller.uicheck_list.register_case</xsl:text>
+                       <xsl:text>&amp;check_list_id=</xsl:text>
+                       <xsl:value-of select="check_list/id"/>
+                       <xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
+               </xsl:attribute>
+               Registrer sak/måling
+       </a>
+       <a class="btn">
+               <xsl:attribute name="href">
+                       
<xsl:text>index.php?menuaction=controller.uicase.create_case_message</xsl:text>
+                       <xsl:text>&amp;check_list_id=</xsl:text>
+                       <xsl:value-of select="check_list/id"/>
+               </xsl:attribute>
+               Registrer avviksmelding
+       </a>
+</div>
+       
+<div id="view_errors">
+       
+       <div class="tab_menu">
+               <a class="active" id="view_open_cases">                         
        
+                       <xsl:attribute name="href">
+                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_open_cases</xsl:text>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                               
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
+                       </xsl:attribute>
+                       Vis åpne saker
+               </a>
+               <a id="view_closed_cases">                                      
+                       <xsl:attribute name="href">
+                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_closed_cases</xsl:text>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                               
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
+                       </xsl:attribute>
+                       Vis lukkede saker
+               </a>
+               <a id="view_measurements">                                      
+                       <xsl:attribute name="href">
+                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_measurements</xsl:text>
+                               <xsl:text>&amp;check_list_id=</xsl:text>
+                               <xsl:value-of select="check_list/id"/>
+                               
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
+                       </xsl:attribute>
+                       Vis målinger
+               </a>
+       </div>  
+       
+       <div class="tab_item active">
+               <xsl:choose>
+                       <xsl:when test="open_check_items/child::node()">
+                               
+                       <div class="expand_menu"><div class="expand_all">Vis 
alle</div><div class="collapse_all focus">Skjul alle</div></div>
+               
+                               <ul id="check_list_not_fixed_list" 
class="check_items expand_list">
+                                       <xsl:for-each select="open_check_items">
+                                                       <li>
+                                                       <xsl:if test="status = 
0">
+                                                               <h4><img 
src="controller/images/arrow_right.png" width="14"/><span><xsl:value-of 
select="control_item/title"/></span></h4>                                       
       
+                                                               <form 
id="frm_save_check_item" 
action="index.php?menuaction=controller.uicheck_list.save_check_item" 
method="post">
+                                                                       
<xsl:variable name="check_item_id"><xsl:value-of select="id"/></xsl:variable>
+                                                                       <input 
type="hidden" name="check_item_id" value="{$check_item_id}" /> 
+                                                                       <div 
class="check_item">
+                                                                         <div>
+                                                                              
<label>Status</label>
+                                                                              
<select name="status">
+                                                                               
        <xsl:choose>
+                                                                               
                <xsl:when test="status = 0">
+                                                                               
                        <option value="0" SELECTED="SELECTED">Avvik er 
åpent</option>
+                                                                               
                        <option value="1">Avvik er håndtert</option>
+                                                                               
                </xsl:when>
+                                                                               
                <xsl:when test="status = 1">
+                                                                               
                        <option value="0">Avvik er åpent</option>
+                                                                               
                        <option value="1" SELECTED="SELECTED">Avvik er 
håndtert</option>
+                                                                               
                </xsl:when>
+                                                                               
        </xsl:choose>
+                                                                               
   </select>
+                                                                      </div>
+                                                                      <div>
+                                                                        <label 
class="comment">Kommentar</label>
+                                                                        
<textarea name="comment">
+                                                                               
        <xsl:value-of select="comment"/>
+                                                                               
 </textarea>
+                                                                      </div>
+                                                                      <div 
class="form-buttons">
+                                                                               
        <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_item')" /></xsl:variable>
+                                                                               
        <input style="width: 200px;" type="submit" name="save_control" 
value="Oppdater registrert avvik" class="not_active" title="{$lang_save}" />
+                                                                               
</div>
+                                                                       </div>
+                                                               </form>
+                                                       </xsl:if>
+                                           </li>
+                                       </xsl:for-each>
+                               </ul>                   
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       Ingen registrerte åpne avvik
+                               </xsl:otherwise>
+               </xsl:choose>
+       </div>
+</div>
+</xsl:template>

Deleted: 
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_errors.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_errors.xsl
       2012-01-10 09:47:57 UTC (rev 8550)
+++ 
branches/Version-1_0-branch/controller/templates/base/check_list/view_open_errors.xsl
       2012-01-10 09:51:11 UTC (rev 8551)
@@ -1,108 +0,0 @@
-<!-- $Id: choose_control_items.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
-
-<xsl:template match="view_open_errors" xmlns:php="http://php.net/xsl";>
-
-<div id="error_message_menu">
-       <a class="btn" id="register_errors">                                    
-               <xsl:attribute name="href">
-                       
<xsl:text>index.php?menuaction=controller.uicheck_list.register_errors</xsl:text>
-                       <xsl:text>&amp;check_list_id=</xsl:text>
-                       <xsl:value-of select="check_list/id"/>
-               </xsl:attribute>
-               Registrer sak/måling
-       </a>
-       <a class="btn">
-               <xsl:attribute name="href">
-                       
<xsl:text>index.php?menuaction=controller.uierror_report_message.create_error_report_message</xsl:text>
-                       <xsl:text>&amp;check_list_id=</xsl:text>
-                       <xsl:value-of select="check_list/id"/>
-               </xsl:attribute>
-               Registrer avviksmelding
-       </a>
-</div>
-       
-<div id="view_errors">
-       
-       <div class="tab_menu">
-               <a class="active" id="view_open_errors">                        
                
-                       <xsl:attribute name="href">
-                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_open_errors</xsl:text>
-                               <xsl:text>&amp;check_list_id=</xsl:text>
-                               <xsl:value-of select="check_list/id"/>
-                               
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
-                       </xsl:attribute>
-                       Vis åpne saker
-               </a>
-               <a id="view_closed_errors">                                     
-                       <xsl:attribute name="href">
-                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_closed_errors</xsl:text>
-                               <xsl:text>&amp;check_list_id=</xsl:text>
-                               <xsl:value-of select="check_list/id"/>
-                       </xsl:attribute>
-                       Vis lukkede saker
-               </a>
-               <a id="view_measurements">                                      
-                       <xsl:attribute name="href">
-                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_measurements</xsl:text>
-                               <xsl:text>&amp;check_list_id=</xsl:text>
-                               <xsl:value-of select="check_list/id"/>
-                               
<xsl:text>&amp;phpgw_return_as=stripped_html</xsl:text>
-                       </xsl:attribute>
-                       Vis målinger
-               </a>
-       </div>  
-       
-       <div class="tab_item active">
-               <xsl:choose>
-                       <xsl:when test="open_check_items/child::node()">
-                               
-                       <div class="expand_menu"><div class="expand_all">Vis 
alle</div><div class="collapse_all focus">Skjul alle</div></div>
-               
-                               <ul id="check_list_not_fixed_list" 
class="check_items expand_list">
-                                       <xsl:for-each select="open_check_items">
-                                                       <li>
-                                                       <xsl:if test="status = 
0">
-                                                               <h4><img 
src="controller/images/arrow_right.png" width="14"/><span><xsl:value-of 
select="control_item/title"/></span></h4>                                       
       
-                                                               <form 
id="frm_save_check_item" 
action="index.php?menuaction=controller.uicheck_list.save_check_item" 
method="post">
-                                                                       
<xsl:variable name="check_item_id"><xsl:value-of select="id"/></xsl:variable>
-                                                                       <input 
type="hidden" name="check_item_id" value="{$check_item_id}" /> 
-                                                                       <div 
class="check_item">
-                                                                         <div>
-                                                                              
<label>Status</label>
-                                                                              
<select name="status">
-                                                                               
        <xsl:choose>
-                                                                               
                <xsl:when test="status = 0">
-                                                                               
                        <option value="0" SELECTED="SELECTED">Avvik er 
åpent</option>
-                                                                               
                        <option value="1">Avvik er håndtert</option>
-                                                                               
                </xsl:when>
-                                                                               
                <xsl:when test="status = 1">
-                                                                               
                        <option value="0">Avvik er åpent</option>
-                                                                               
                        <option value="1" SELECTED="SELECTED">Avvik er 
håndtert</option>
-                                                                               
                </xsl:when>
-                                                                               
        </xsl:choose>
-                                                                               
   </select>
-                                                                      </div>
-                                                                      <div>
-                                                                        <label 
class="comment">Kommentar</label>
-                                                                        
<textarea name="comment">
-                                                                               
        <xsl:value-of select="comment"/>
-                                                                               
 </textarea>
-                                                                      </div>
-                                                                      <div 
class="form-buttons">
-                                                                               
        <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_item')" /></xsl:variable>
-                                                                               
        <input style="width: 200px;" type="submit" name="save_control" 
value="Oppdater registrert avvik" class="not_active" title="{$lang_save}" />
-                                                                               
</div>
-                                                                       </div>
-                                                               </form>
-                                                       </xsl:if>
-                                           </li>
-                                       </xsl:for-each>
-                               </ul>                   
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       Ingen registrerte åpne avvik
-                               </xsl:otherwise>
-               </xsl:choose>
-       </div>
-</div>
-</xsl:template>

Deleted: 
branches/Version-1_0-branch/controller/templates/base/create_error_report_message.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/create_error_report_message.xsl
       2012-01-10 09:47:57 UTC (rev 8550)
+++ 
branches/Version-1_0-branch/controller/templates/base/create_error_report_message.xsl
       2012-01-10 09:51:11 UTC (rev 8551)
@@ -1,98 +0,0 @@
-<!-- $Id: edit_check_list.xsl 8374 2011-12-20 07:45:04Z vator $ -->
-<xsl:template match="data" name="view_check_list" 
xmlns:php="http://php.net/xsl";>
-<xsl:variable name="date_format">d/m-Y</xsl:variable>
-
-<div id="main_content">
-       
-               <h1>Registrer avviksmelding</h1>
-               
-               <div class="tab_menu">
-                       <a class="active" href="#">Meldingen gjelder</a>
-               </div>  
-               <div id="error_report_message_details">
-                       <h3 class="first">Tittel på kontroll: <xsl:value-of 
select="control_array/title"/></h3>
-                       <xsl:choose>
-                               <xsl:when test="check_list/completed_date != 0">
-                                       <h3>Kontroll ble utført 
dato:<xsl:value-of select="php:function('date', $date_format, 
number(check_list/completed_date))"/></h3>
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       <h3>Kontroll ble utført dato: Ikke 
registrert utført</h3>
-                               </xsl:otherwise>
-                       </xsl:choose>
-                       <h3 class="last">Bygg: <xsl:value-of 
select="location_array/loc1_name"/></h3>
-               </div>
-               
-               <div class="tab_menu">
-                       <a class="active" href="#">Detaljer for meldingen</a>
-               </div>
-               <fieldset id="error_report_message_details">
-                       <xsl:choose>
-                               <xsl:when 
test="check_list/check_item_array/child::node()">
-                                       
-                               <form class="frm_save_error_report_message" 
action="index.php?menuaction=controller.uierror_report_message.save_error_report_message"
 method="post">
-                                       <input>
-                                     <xsl:attribute 
name="name">check_list_id</xsl:attribute>
-                                     <xsl:attribute 
name="type">hidden</xsl:attribute>
-                                     <xsl:attribute name="value">
-                                       <xsl:value-of select="check_list/id"/>
-                                     </xsl:attribute>
-                                   </input>
-                                   <input>
-                                     <xsl:attribute 
name="name">location_code</xsl:attribute>
-                                     <xsl:attribute 
name="type">hidden</xsl:attribute>
-                                     <xsl:attribute name="value">
-                                       <xsl:value-of 
select="location_array/location_code"/>
-                                     </xsl:attribute>
-                                   </input>
-                                   
-                                   <div>
-                                               <label>Tittel på melding</label>
-                                               <input name="message_title" 
type="text" />
-                                       </div>
-                                       
-                                       <div>
-                                               <label>Kategori</label>
-                                                <select name="message_cat_id">
-                                                       <option value="0">Velg 
kategori</option>
-                                                       <xsl:for-each 
select="categories/cat_list">
-                                                               <xsl:variable 
name="cat_id"><xsl:value-of select="./cat_id"/></xsl:variable>
-                                                               <option 
value="{$cat_id}">
-                                                                       
<xsl:value-of select="./name"/>
-                                                               </option>       
                
-                                                       </xsl:for-each>
-                                               </select>
-                                       </div>
-                       
-                                       <h3 class="check_item_details">Velg 
sjekkpunkter som skal være med i avviksmelding</h3>                             
    
-                                       <ul class="check_items">
-                                               <xsl:for-each 
select="check_list/check_item_array">
-                                                       <li>
-                                                               <xsl:variable 
name="check_item_id"><xsl:value-of select="id" /></xsl:variable>
-                                                               <h5><input 
type="checkbox" name="check_item_ids[]" value="{$check_item_id}" 
/><span><xsl:value-of select="control_item/title"/></span></h5>                 
                            
-                                                       </li>
-                                               </xsl:for-each>
-                                       </ul>
-                                       
-                                         <div class="form-buttons">
-                                               <xsl:variable 
name="lang_save"><xsl:value-of select="php:function('lang', 'save')" 
/></xsl:variable>
-                                               <input class="btn" 
type="submit" name="save_control" value="Registrer avviksmelding" 
title="{$lang_save}" />
-                                         </div>
-                               </form>                 
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       Ingen registrerte avvik
-                               </xsl:otherwise>
-                       </xsl:choose>
-               </fieldset>
-               
-               <a class="btn">
-               <xsl:attribute name="href">
-                               
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list_for_location</xsl:text>
-                               <xsl:text>&amp;check_list_id=</xsl:text>
-                               <xsl:value-of select="check_list/id"/>
-                       </xsl:attribute>
-             Vis sjekkliste
-           </a>
-                       
-</div>
-</xsl:template>

Modified: branches/Version-1_0-branch/controller/templates/base/css/base.css
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/css/base.css  
2012-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/controller/templates/base/css/base.css  
2012-01-10 09:51:11 UTC (rev 8551)
@@ -1111,28 +1111,28 @@
        position:absolute;
     z-index: 1;
 }
-#main_content #error_report_message_details {
+#main_content #case_details {
     background: none repeat scroll 0 0 #EDF5FF;
     border: 1px solid #DDDDDD;
     margin-bottom: 20px;
     padding: 15px;
     width: 800px;
 }
-#error_report_message_details label{
+#case_details label{
        display: inline-block;
        width: 130px;
        font-weight: normal;
        font-size: 15px;        
 }
-#error_report_message_details h3 {
+#case_details h3 {
     font-size: 15px;
     font-weight: normal;
     margin: 10px 0;
 }
-#error_report_message_details h3.first {
+#case_details h3.first {
     margin-top:0;
 }
-#error_report_message_details h3.last {
+#case_details h3.last {
     margin-bottom:0;
 }
 .btn{
@@ -1145,6 +1145,19 @@
     border: 1px solid #173073;
     cursor: pointer;
 }
+
+.btn.focus{
+       background: none repeat scroll 0 0 #DD624B;
+    border-bottom: 1px solid #CB563F;
+    border-top: 1px solid #EE836F;
+    border-left:0;
+    border-right:0;
+    box-shadow: 0 1px 0 #A9422E, 0 -1px 0 #A9422E;
+    color: #FFFFFF;
+    margin-top: 1px;   
+}
+
+
 #frm_update_check_list input[type="submit"]{
        width: 140px;   
 }
@@ -1184,4 +1197,18 @@
     margin-bottom: 20px;
     padding: 15px;
     width: 800px;
+}
+
+.box_header {
+    background: none repeat scroll 0 0 #2647A0;
+    border-left: 1px solid #173073;
+    border-right: 1px solid #173073;
+    border-top: 1px solid #173073;
+    color: #FFFFFF;
+    font-size: 13px;
+    font-weight: normal;
+    margin: 0;
+    padding: 3px 0 3px 15px;
+    text-align: left;
+    width: 815px;
 }
\ 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-01-10 09:47:57 UTC (rev 8550)
+++ 
branches/Version-1_0-branch/controller/templates/base/procedure/print_procedure.xsl
 2012-01-10 09:51:11 UTC (rev 8551)
@@ -1,7 +1,7 @@
 <!-- $Id: procedure_item.xsl 8503 2012-01-06 08:13:27Z erikhl $ -->
 <!-- item  -->
 
-<xsl:template match="print_procedure" xmlns:php="http://php.net/xsl";>
+<xsl:template match="data" xmlns:php="http://php.net/xsl";>
 <xsl:variable name="dateformat"><xsl:value-of select="dateformat" 
/></xsl:variable>
 
 <div style="margin:40px 0 0 40px;">

Modified: 
branches/Version-1_0-branch/controller/templates/base/procedure/view_procedures_for_control.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/procedure/view_procedures_for_control.xsl
     2012-01-10 09:47:57 UTC (rev 8550)
+++ 
branches/Version-1_0-branch/controller/templates/base/procedure/view_procedures_for_control.xsl
     2012-01-10 09:51:11 UTC (rev 8551)
@@ -1,6 +1,6 @@
 <!-- $Id: procedure_item.xsl 8485 2012-01-05 08:21:03Z erikhl $ -->
 
-<xsl:template match="view_procedures_for_control">
+<xsl:template match="data">
        <h3 style="margin:5px 0;">Prosedyre for kontroll</h3>
        
        <span>Tittel: </span><xsl:value-of select="control_procedure/title"/>

Deleted: 
branches/Version-1_0-branch/controller/templates/base/view_error_report_message.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/view_error_report_message.xsl
 2012-01-10 09:47:57 UTC (rev 8550)
+++ 
branches/Version-1_0-branch/controller/templates/base/view_error_report_message.xsl
 2012-01-10 09:51:11 UTC (rev 8551)
@@ -1,68 +0,0 @@
-<!-- $Id: edit_check_list.xsl 8374 2011-12-20 07:45:04Z vator $ -->
-<xsl:template match="data" name="view_check_list" 
xmlns:php="http://php.net/xsl";>
-<xsl:variable name="date_format">d/m-Y</xsl:variable>
-
-<div id="main_content">
-       
-               <h1>Avviksmelding registrert</h1>
-               
-               <div class="tab_menu">
-                       <a class="active" href="#">Meldingen gjaldt</a>
-               </div>  
-               <div id="error_report_message_details">
-                       <h3>Bygg: <xsl:value-of 
select="location_array/loc1_name"/></h3>
-                       <h3>Tittel på kontroll: <xsl:value-of 
select="control_array/title"/></h3>
-                       <xsl:choose>
-                               <xsl:when test="check_list/completed_date != 0">
-                                       <h3>Kontroll ble utført dato: 
<xsl:value-of select="php:function('date', $date_format, 
number(check_list/completed_date))"/></h3>
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       <h3>Kontroll ble utført dato:  Ikke 
registrert utført</h3>
-                               </xsl:otherwise>
-                       </xsl:choose>
-               </div>
-               
-               <div class="tab_menu">
-                       <a class="active" href="#">Detaljer for melding</a>
-               </div>
-               <div id="error_report_message_details">
-                       <div>       
-                               <label>Tittel på melding</label>
-                               <xsl:value-of select="message_ticket/subject"/>
-                       </div>
-                       
-                       <div>
-                               <label>Kategori</label>
-                               <span><xsl:value-of select="category"/></span> 
-                       </div>
-       
-       
-                       <h3 class="check_item_details">Avviksmeldingen omfattet 
følgende punkter</h3>                                   
-                       <ul class="check_items">
-                               <xsl:for-each 
select="registered_message_check_items">
-                                       <li>
-                                               <xsl:variable 
name="check_item_id"><xsl:value-of select="id" /></xsl:variable>
-                                               <h5><xsl:value-of 
select="control_item/title"/></h5>                                            
-                                       </li>
-                               </xsl:for-each>
-                       </ul>
-               </div>
-               
-               <a class="btn">
-                       <xsl:attribute name="href">
-                               
<xsl:text>index.php?menuaction=controller.uierror_report_message.create_error_report_message</xsl:text>
-                               <xsl:text>&amp;check_list_id=</xsl:text>
-                               <xsl:value-of select="check_list/id"/>
-                       </xsl:attribute>
-             Registrer ny melding
-           </a>
-               <a class="btn">
-               <xsl:attribute name="href">
-                               
<xsl:text>index.php?menuaction=controller.uicheck_list_for_location.edit_check_list_for_location</xsl:text>
-                               <xsl:text>&amp;check_list_id=</xsl:text>
-                               <xsl:value-of select="check_list/id"/>
-                       </xsl:attribute>
-             Endre sjekkliste
-           </a>
-</div>
-</xsl:template>

Modified: branches/Version-1_0-branch/property/inc/class.botts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.botts.inc.php        
2012-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/property/inc/class.botts.inc.php        
2012-01-10 09:51:11 UTC (rev 8551)
@@ -1043,6 +1043,36 @@
                                }
                        }
 
+
+                       $notify_list = execMethod('property.notify.read', array
+                               (
+                                       'location_id'           => 
$GLOBALS['phpgw']->locations->get_id('property', $this->acl_location),
+                                       'location_item_id'      => $id
+                               )
+                       );
+
+                       $sms_text = "{$subject}. 
\r\n{$GLOBALS['phpgw_info']['user']['fullname']} 
\r\n{$GLOBALS['phpgw_info']['user']['preferences']['property']['email']}";
+                       $sms    = CreateObject('sms.sms');
+
+                       foreach($notify_list as $entry)
+                       {
+                               if($entry['is_active'] && 
$entry['notification_method'] == 'email' && $entry['email'])
+                               {
+                                       $toarray[] = "{$entry['first_name']} 
{$entry['last_name']}<{$entry['email']}>";
+                               }
+                               else if($entry['is_active'] && 
$entry['notification_method'] == 'sms' && $entry['sms'])
+                               {
+                                       
$sms->websend2pv($this->account,$entry['sms'],$sms_text);
+                                       $toarray_sms[] = 
"{$entry['first_name']} {$entry['last_name']}({$entry['sms']})";
+                                       
$receipt['message'][]=array('msg'=>lang('%1 is 
notified',"{$entry['first_name']} {$entry['last_name']}"));
+                               }
+                       }
+                       unset($entry);
+                       if($toarray_sms)
+                       {
+                               $this->historylog->add('MS',$id,"{$subject}::" 
. implode(',',$toarray_sms));                                            
+                       }
+
                        if($toarray)
                        {
                                $to = implode(';',$toarray);

Modified: branches/Version-1_0-branch/property/inc/class.notify.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.notify.inc.php       
2012-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/property/inc/class.notify.inc.php       
2012-01-10 09:51:11 UTC (rev 8551)
@@ -186,6 +186,8 @@
 
                        $lang_view = lang('view');
                        $code = <<<JS
+       var  myPaginator_{$count}, myDataTable_{$count};
+       var Button_{$count}_0, Button_{$count}_1, Button_{$count}_2;
        var notify_table_count = {$count};
        var notify_lang_view = "{$lang_view}";
        var notify_lang_alert = "Posten må lagres før kontakter kan tilordnes";
@@ -194,13 +196,13 @@
        {
                if(document.getElementById('notify_contact').value)
                {
-                       base_java_url['contact_id'] = 
document.getElementById('notify_contact').value;
+                       base_java_notify_url['contact_id'] = 
document.getElementById('notify_contact').value;
                }
 
                if(document.getElementById('notify_contact').value != 
notify_contact)
                {
-                       base_java_url['action'] = 'refresh_notify_contact';
-                       execute_async(myDataTable_{$count});
+                       base_java_notify_url['action'] = 
'refresh_notify_contact';
+                       execute_async(myDataTable_{$count}, 
base_java_notify_url);
                        notify_contact = 
document.getElementById('notify_contact').value;
                }
        }
@@ -229,8 +231,8 @@
 
                        formObject = document.body.getElementsByTagName('form');
                        YAHOO.util.Connect.setForm(formObject[0]);//First form
-                       base_java_url['action'] = 'refresh_notify_contact';
-                       execute_async(myDataTable_{$count});
+                       base_java_notify_url['action'] = 
'refresh_notify_contact';
+                       
execute_async(myDataTable_{$count},base_java_notify_url);
                }
        }
 JS;

Modified: branches/Version-1_0-branch/property/inc/class.uiproject.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiproject.inc.php    
2012-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/property/inc/class.uiproject.inc.php    
2012-01-10 09:51:11 UTC (rev 8551)
@@ -1878,7 +1878,7 @@
                                        'value_approval_mail_address'           
=> $supervisor_email,
 
                                        'currency'                              
                        => 
$GLOBALS['phpgw_info']['user']['preferences']['common']['currency'],
-                                       'base_java_url'                         
                => 
"{menuaction:'property.notify.update_data',location_id:{$location_id},location_item_id:{$id}}",
+                                       'base_java_notify_url'                  
                        => 
"{menuaction:'property.notify.update_data',location_id:{$location_id},location_item_id:{$id}}",
                                        'edit_action'                           
                => $GLOBALS['phpgw']->link('/index.php',array('menuaction' => 
'property.uiproject.edit', 'id' => $id)),
                                        'lang_edit_statustext'                  
        => lang('Edit this entry '),
                                        'lang_edit'                             
                        => lang('Edit'),

Modified: branches/Version-1_0-branch/property/inc/class.uitts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uitts.inc.php        
2012-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/property/inc/class.uitts.inc.php        
2012-01-10 09:51:11 UTC (rev 8551)
@@ -2988,6 +2988,7 @@
                                        'values'                                
=> json_encode($additional_notes),
                                        'total_records'                 => 
count($additional_notes),
                                        'is_paginator'                  => 0,
+                                       'edit_action'                   => "''",
                                        'footer'                                
=> 0
                                );                                      
                        $myColumnDefs[0] = array
@@ -3001,6 +3002,7 @@
                                        'values'                                
=> json_encode($record_history),
                                        'total_records'                 => 
count($record_history),
                                        'is_paginator'                  => 0,
+                                       'edit_action'                   => "''",
                                        'footer'                                
=> 0
                                );                                      
                        $myColumnDefs[1] = array
@@ -3039,6 +3041,7 @@
                                        'total_records'                 => 
count($content_files),
                                        'permission'                    => "''",
                                        'is_paginator'                  => 0,
+                                       'edit_action'                   => "''",
                                        'footer'                                
=> 0
                                );
 
@@ -3077,9 +3080,25 @@
                                        'total_records'                 => 
count($content_email),
                                        'permission'                    => "''",
                                        'is_paginator'                  => 0,
+                                       'edit_action'                   => "''",
                                        'footer'                                
=> 0
                                );
 
+
+                       $location_id    = 
$GLOBALS['phpgw']->locations->get_id('property', $this->acl_location);
+                       $notify_info = 
execMethod('property.notify.get_yui_table_def',array
+                                                               (
+                                                                       
'location_id'           => $location_id,
+                                                                       
'location_item_id'      => $id,
+                                                                       'count' 
                        => count($myColumnDefs)
+                                                               )
+                                                       );
+                       
+                       $datavalues[]   = $notify_info['datavalues'];
+                       $myColumnDefs[] = $notify_info['column_defs'];
+                       $myButtons              = array();
+                       $myButtons[]    = $notify_info['buttons'];
+
                        $_filter_buildingpart = array();
                        $filter_buildingpart = 
isset($this->bo->config->config_data['filter_buildingpart']) ? 
$this->bo->config->config_data['filter_buildingpart'] : array();
                        
@@ -3117,10 +3136,11 @@
                                        'tabs'                                  
                => self::_generate_tabs(true),
                                        'td_count'                              
                => '""',
                                        'base_java_url'                         
        => "{menuaction:'property.uitts.update_data',id:{$id}}",
+                                       'base_java_notify_url'                  
=> 
"{menuaction:'property.notify.update_data',location_id:{$location_id},location_item_id:'{$id}'}",
                                        'property_js'                           
        => 
json_encode($GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property2.js"),
                                        'datatable'                             
                => $datavalues,
                                        'myColumnDefs'                          
        => $myColumnDefs,
-
+                                       'myButtons'                             
                => $myButtons,
                                        'value_origin'                          
        => $ticket['origin'],
                                        'value_target'                          
        => $ticket['target'],
                                        'value_finnish_date'                    
=> $ticket['finnish_date'],
@@ -3486,9 +3506,10 @@
 
 
                        $tabs = array
-                               (
-                                       'general'               => 
array('label' => lang('general'), 'link' => '#general')
-                               );
+                       (
+                               'general'               => array('label' => 
lang('general'), 'link' => '#general'),
+                               'notify'                => array('label' => 
lang('notify'), 'link' => '#notify')
+                       );
 
                        if($history)
                        {

Modified: branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php  
2012-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php  
2012-01-10 09:51:11 UTC (rev 8551)
@@ -1775,7 +1775,7 @@
                                        'lang_upload_file'                      
                        => lang('Upload file'),
                                        'lang_file_statustext'                  
                => lang('Select file to upload'),
                                        'value_billable_hours'                  
                => $values['billable_hours'],
-                                       'base_java_url'                         
                        => 
"{menuaction:'property.notify.update_data',location_id:{$location_id},location_item_id:'{$id}'}",
+                                       'base_java_notify_url'                  
                                => 
"{menuaction:'property.notify.update_data',location_id:{$location_id},location_item_id:'{$id}'}",
                                        'edit_action'                           
                        => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction' => 
'property.uiworkorder.edit', 'id' => $id)),
                                        'lang_edit_statustext'                  
                => lang('Edit this entry '),
                                        'lang_edit'                             
                                => lang('Edit'),

Modified: branches/Version-1_0-branch/property/js/yahoo/notify.js
===================================================================
--- branches/Version-1_0-branch/property/js/yahoo/notify.js     2012-01-10 
09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/property/js/yahoo/notify.js     2012-01-10 
09:51:11 UTC (rev 8551)
@@ -1,8 +1,6 @@
 var d;
 var notify_contact = 0;
 
-var Button_0_0, Button_0_1, Button_0_2;
-
 
/********************************************************************************/
        this.cleanValuesHiddenActionsButtons=function()
        {
@@ -75,7 +73,7 @@
 
        this.notify_contact_lookup = function()
        {
-               if(!base_java_url['location_item_id'])
+               if(!base_java_notify_url['location_item_id'])
                {
                        alert(notify_lang_alert); // notify_lang_alert is 
defined in php-class property_notify::get_yui_table_def()
                        return;
@@ -90,7 +88,7 @@
        {
        }
 */
-       this.onDOMAttrModified = function(e)
+       this.onDOMAttrModified_notify = function(e)
        {
                var attr = e.attrName || e.propertyName
                var target = e.target || e.srcElement;
@@ -107,11 +105,11 @@
                {
                        if (d.attachEvent)
                        {
-                               d.attachEvent('onpropertychange', 
onDOMAttrModified, false);
+                               d.attachEvent('onpropertychange', 
onDOMAttrModified_notify, false);
                        }
                        else
                        {
-                               d.addEventListener('DOMAttrModified', 
onDOMAttrModified, false);
+                               d.addEventListener('DOMAttrModified', 
onDOMAttrModified_notify, false);
                        }
                }
        });

Modified: branches/Version-1_0-branch/property/js/yahoo/property2.js
===================================================================
--- branches/Version-1_0-branch/property/js/yahoo/property2.js  2012-01-10 
09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/property/js/yahoo/property2.js  2012-01-10 
09:51:11 UTC (rev 8551)
@@ -527,8 +527,12 @@
        }
 
/********************************************************************************/
 
-       this.execute_async = function(datatable)
+       this.execute_async = function(datatable, incoming_url)
        {
+               if(incoming_url !='undfined')
+               {
+                       base_java_url = incoming_url;
+               }
                try     {
                                ds = phpGWLink('index.php',base_java_url,true);
                                //ds = url;

Modified: branches/Version-1_0-branch/property/templates/base/project.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/project.xsl     
2012-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/property/templates/base/project.xsl     
2012-01-10 09:51:11 UTC (rev 8551)
@@ -434,7 +434,7 @@
                                                <!--  DATATABLE DEFINITIONS-->
                                                <script type="text/javascript">
                                                        var property_js = 
<xsl:value-of select="property_js"/>;
-                                                       var base_java_url = 
<xsl:value-of select="base_java_url"/>;
+                                                       var 
base_java_notify_url = <xsl:value-of select="base_java_notify_url"/>;
                                                        var datatable = new 
Array();
                                                        var myColumnDefs = new 
Array();
                                                        var myButtons = new 
Array();
@@ -476,7 +476,7 @@
                                                                                
        <td>
                                                                                
                <input type="hidden" id="notify_contact" name="notify_contact" 
value="" title="{$lang_contact_statustext}">
                                                                                
                </input>
-                                                                               
                <input size="30" type="text" name="notify_contact_name" 
value="" onClick="notify_contact_lookup();" readonly="readonly" 
title="{$lang_contact_statustext}"/>
+                                                                               
                <input type="hidden" name="notify_contact_name" value="" 
onClick="notify_contact_lookup();" readonly="readonly" 
title="{$lang_contact_statustext}"/>
                                                                                
        </td>
                                                                                
</tr>
                                                                        </table>

Modified: branches/Version-1_0-branch/property/templates/base/tts.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/tts.xsl 2012-01-10 
09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/property/templates/base/tts.xsl 2012-01-10 
09:51:11 UTC (rev 8551)
@@ -1402,6 +1402,41 @@
                                                        </xsl:choose>
                                                </table>
                                        </div>
+                                       <div id="notify">
+                                               <table cellpadding="2" 
cellspacing="2" width="80%" align="center">
+                                                       <xsl:variable 
name="lang_contact_statustext">
+                                                               <xsl:value-of 
select="php:function('lang', 'click this link to select')"/>
+                                                       </xsl:variable>
+                                                       <tr>
+                                                               <td 
valign="top">
+                                                                       <a 
href="javascript:notify_contact_lookup()" title="{$lang_contact_statustext}">
+                                                                               
<xsl:value-of select="php:function('lang', 'contact')"/>
+                                                                       </a>
+                                                               </td>
+                                                               <td>
+                                                                       <table>
+                                                                               
<tr>
+                                                                               
        <td>
+                                                                               
                <input type="hidden" id="notify_contact" name="notify_contact" 
value="" title="{$lang_contact_statustext}">
+                                                                               
                </input>
+                                                                               
                <input type="hidden" name="notify_contact_name" value="" 
onClick="notify_contact_lookup();" readonly="readonly" 
title="{$lang_contact_statustext}"/>
+                                                                               
        </td>
+                                                                               
</tr>
+                                                                       </table>
+                                                               </td>
+                                                       </tr>
+                                                       <tr>
+                                                               <td 
valign="top" class="th_text">
+                                                                       
<xsl:value-of select="php:function('lang', 'notify')"/>
+                                                               </td>
+                                                               <td>
+                                                                       <div 
id="paging_4"> </div>
+                                                                       <div 
id="datatable-container_4"/>
+                                                                       <div 
id="datatable-buttons_4"/>
+                                                               </td>
+                                                       </tr>
+                                               </table>
+                                       </div>
                                        <div id="history">
                                                <div id="paging_1"/>
                                                <div 
id="datatable-container_1"/>
@@ -1533,6 +1568,7 @@
                <script type="text/javascript">
                        var property_js = <xsl:value-of select="property_js"/>;
                        var base_java_url = <xsl:value-of 
select="base_java_url"/>;
+                       var base_java_notify_url = <xsl:value-of 
select="base_java_notify_url"/>;
                        var datatable = new Array();
                        var myColumnDefs = new Array();
                        var myButtons = new Array();
@@ -1544,6 +1580,7 @@
                                                values:<xsl:value-of 
select="values"/>,
                                                total_records: <xsl:value-of 
select="total_records"/>,
                                                is_paginator:  <xsl:value-of 
select="is_paginator"/>,
+                                               edit_action:  <xsl:value-of 
select="edit_action"/>,
                                                <!--permission:<xsl:value-of 
select="permission"/>, -->
                                                footer:<xsl:value-of 
select="footer"/>
                                        }

Modified: branches/Version-1_0-branch/property/templates/base/workorder.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/workorder.xsl   
2012-01-10 09:47:57 UTC (rev 8550)
+++ branches/Version-1_0-branch/property/templates/base/workorder.xsl   
2012-01-10 09:51:11 UTC (rev 8551)
@@ -580,7 +580,7 @@
                                                                                
                        <td>
                                                                                
                                <input type="hidden" id="notify_contact" 
name="notify_contact" value="" title="{$lang_contact_statustext}">
                                                                                
                                </input>
-                                                                               
                                <input size="30" type="text" 
name="notify_contact_name" value="" onClick="notify_contact_lookup();" 
readonly="readonly" title="{$lang_contact_statustext}"/>
+                                                                               
                                <input type="hidden" name="notify_contact_name" 
value="" onClick="notify_contact_lookup();" readonly="readonly" 
title="{$lang_contact_statustext}"/>
                                                                                
                        </td>
                                                                                
                </tr>
                                                                                
        </table>
@@ -673,7 +673,7 @@
                                        </xsl:choose>
                                        <script type="text/javascript">
                                                var property_js = <xsl:value-of 
select="property_js"/>;
-                                               var base_java_url = 
<xsl:value-of select="base_java_url"/>;
+                                               var base_java_notify_url = 
<xsl:value-of select="base_java_notify_url"/>;
                                                var datatable = new Array();
                                                var myColumnDefs = new Array();
                                                var myButtons = new Array();




reply via email to

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