fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8502] Merge 8482:8501 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [8502] Merge 8482:8501 from trunk
Date: Thu, 05 Jan 2012 18:22:43 +0000

Revision: 8502
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8502
Author:   sigurdne
Date:     2012-01-05 18:22:42 +0000 (Thu, 05 Jan 2012)
Log Message:
-----------
Merge 8482:8501 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
    
branches/Version-1_0-branch/activitycalendarfrontend/inc/class.uiactivity.inc.php
    branches/Version-1_0-branch/activitycalendarfrontend/setup/phpgw_no.lang
    
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_edit_step_1.php
    branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
    
branches/Version-1_0-branch/controller/inc/class.socontrol_group_list.inc.php
    branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php
    branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
    branches/Version-1_0-branch/controller/inc/class.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.uicontrol_item.inc.php
    
branches/Version-1_0-branch/controller/inc/class.uierror_report_message.inc.php
    branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php
    branches/Version-1_0-branch/controller/js/controller/ajax.js
    
branches/Version-1_0-branch/controller/templates/base/add_check_list_for_location.xsl
    
branches/Version-1_0-branch/controller/templates/base/create_error_report_message.xsl
    branches/Version-1_0-branch/controller/templates/base/css/base.css
    
branches/Version-1_0-branch/controller/templates/base/view_calendar_month.xsl
    branches/Version-1_0-branch/property/inc/class.bocommon.inc.php
    branches/Version-1_0-branch/property/inc/class.borequest.inc.php
    branches/Version-1_0-branch/property/inc/class.custom_fields.inc.php
    branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
    branches/Version-1_0-branch/property/inc/class.uirequest.inc.php
    branches/Version-1_0-branch/property/js/yahoo/request.index.js
    branches/Version-1_0-branch/property/setup/phpgw_no.lang

Added Paths:
-----------
    branches/Version-1_0-branch/controller/templates/base/check_list/
    branches/Version-1_0-branch/controller/templates/base/control/
    branches/Version-1_0-branch/controller/templates/base/control_group/
    branches/Version-1_0-branch/controller/templates/base/control_item/
    branches/Version-1_0-branch/controller/templates/base/procedure/

Removed Paths:
-------------
    
branches/Version-1_0-branch/controller/templates/base/choose_control_items.xsl
    branches/Version-1_0-branch/controller/templates/base/control.xsl
    branches/Version-1_0-branch/controller/templates/base/control_group.xsl
    branches/Version-1_0-branch/controller/templates/base/control_groups.xsl
    branches/Version-1_0-branch/controller/templates/base/control_item.xsl
    branches/Version-1_0-branch/controller/templates/base/control_tabs.xsl
    branches/Version-1_0-branch/controller/templates/base/edit_check_list.xsl
    
branches/Version-1_0-branch/controller/templates/base/procedure_documents.xsl
    branches/Version-1_0-branch/controller/templates/base/procedure_item.xsl
    branches/Version-1_0-branch/controller/templates/base/procedure_tabs.xsl
    branches/Version-1_0-branch/controller/templates/base/sort_check_list.xsl
    branches/Version-1_0-branch/controller/templates/base/view_check_list.xsl
    branches/Version-1_0-branch/controller/templates/base/view_check_lists.xsl
    
branches/Version-1_0-branch/controller/templates/base/view_control_item_list.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
   + 
/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

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-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php   
2012-01-05 18:22:42 UTC (rev 8502)
@@ -152,6 +152,10 @@
                        $activity_state = 
$this->marshal($filters['activity_state'],'int');
                        $filter_clauses[] = "activity.state = 
{$activity_state}";
                }
+               if(isset($filters['activity_org']) && $filters['activity_org'] 
!= '0'){
+                       $activity_org = 
$this->marshal($filters['activity_org'],'int');
+                       $filter_clauses[] = "activity.organization_id = 
{$activity_org}";
+               }
                if(isset($filters['activity_category']) && 
$filters['activity_category'] != 'all'){
                        $activity_category = 
$this->marshal($filters['activity_category'],'int');
                        $filter_clauses[] = "activity.category = 
{$activity_category}";

Modified: 
branches/Version-1_0-branch/activitycalendarfrontend/inc/class.uiactivity.inc.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendarfrontend/inc/class.uiactivity.inc.php
   2012-01-05 18:16:12 UTC (rev 8501)
+++ 
branches/Version-1_0-branch/activitycalendarfrontend/inc/class.uiactivity.inc.php
   2012-01-05 18:22:42 UTC (rev 8502)
@@ -27,7 +27,8 @@
                        'index'                 =>      true,
                        'get_organization_groups'       =>      true,
                        'get_address_search'    => true,
-                       'edit_organization_values' => true
+                       'edit_organization_values' => true,
+                       'get_organization_activities' => true
                );
                
                public function __construct()
@@ -427,12 +428,14 @@
                        {
                                $activity_id = phpgw::get_var('activity_id');
                                $activity = 
$this->so_activity->get_single($activity_id);
+                               $org = 
$this->so_organization->get_single($activity->get_organization_id());
                                
+                               
                                //store update-request
                                $activity->set_state(2);
                                if($this->so_activity->store($activity))
                                {
-                                       $message = lang('update_request_sent', 
$activity->get_title());
+                                       $message = lang('update_request_sent', 
$activity->get_title(), $org->get_name());
                                        return 
$this->render('activity_edit_step_1.php', array
                                                (
                                                        'activities' => 
$activities,
@@ -448,9 +451,11 @@
                                {
                                        //select activity to edit
                                        $activities = 
$this->so_activity->get(null, null, 'title', true, null, null, 
array('activity_state' => 3));
+                                       $organizations = 
$this->so_organization->get(null, null, 'org.name', true, null, null, null);
                                        return 
$this->render('activity_edit_step_1.php', array
                                                (
-                                                       'activities' => 
$activities
+                                                       'activities' => 
$activities,
+                                                       'organizations' => 
$organizations
                                                )       
                                        );
                                }
@@ -763,4 +768,30 @@
                                }
                        }
                }
+               
+               public function get_organization_activities()
+               {
+                       $GLOBALS['phpgw_info']['flags']['noheader'] = true; 
+                       $GLOBALS['phpgw_info']['flags']['nofooter'] = true; 
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
+                       
+                       $org_id = phpgw::get_var('orgid');
+                       $returnHTML = "<option value='0'>Ingen aktivitet 
valgt</option>";
+                       if($org_id)
+                       {
+                               $activities = $this->so_activity->get(null, 
null, 'title', true, null, null, array('activity_state' => 3, 'activity_org' => 
$org_id));
+                               foreach ($activities as $act) {
+                                       if(isset($act))
+                                       {
+                                               //$res_g = $group->serialize();
+                                               $activity_html[] = "<option 
value='" . $act->get_id() . "'>" . $act->get_title() . "</option>";
+                                       }
+                               }
+                           $html = implode(' ' , $activity_html);
+                           $returnHTML = $returnHTML . ' ' . $html;
+                       }
+                       
+                       
+                       return $returnHTML;
+               }
        }

Modified: 
branches/Version-1_0-branch/activitycalendarfrontend/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/activitycalendarfrontend/setup/phpgw_no.lang    
2012-01-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/activitycalendarfrontend/setup/phpgw_no.lang    
2012-01-05 18:22:42 UTC (rev 8502)
@@ -83,9 +83,10 @@
 store_org_group        activitycalendarfrontend        no      Lagre 
organisasjon/gruppe
 save_activity  activitycalendarfrontend        no      Send
 org_helptext_step1     activitycalendarfrontend        no      Velg 
organisasjon aktiviteten skal knyttes til i nedtrekksmenyen, du kan søke ved å 
skrive inn navnet.<br/>Dersom din organisasjon ikke finnes, velg "Ny 
organisasjon"<br/>Klikk deretter på "Neste" for å registrere aktivitet.
+activity_org_helptext_step1    activitycalendarfrontend        no      Velg 
organisasjon aktiviteten som skal endres er tilknyttet i nedtrekksmenyen, du 
kan søke ved å skrive inn navnet.
 next   activitycalendarfrontend        no      Neste
 new_activity   activitycalendarfrontend        no      Ny aktivitet
-update_request_sent    activitycalendarfrontend        no      
Oppdateringsforespørsel er sendt for aktiviteten "%1"
+update_request_sent    activitycalendarfrontend        no      
Oppdateringsforespørsel er sendt for aktiviteten "%1" tilknyttet organisasjon 
"%2"
 edit_activity  activitycalendarfrontend        no      Endre aktivitet
 activity_edit_helptext activitycalendarfrontend        no      Velg 
aktiviteten du ønsker å endre fra listen under.
 send_change_request    activitycalendarfrontend        no      Send inn 
endringsønske

Modified: 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_edit_step_1.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_edit_step_1.php
        2012-01-05 18:16:12 UTC (rev 8501)
+++ 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_edit_step_1.php
        2012-01-05 18:22:42 UTC (rev 8502)
@@ -2,7 +2,7 @@
 <script type="text/javascript">
 function isOK()
 {
-       if(document.getElementById('activity_id').value == null || 
document.getElementById('activity_id').value == '')
+       if(document.getElementById('activity_id').value == null || 
document.getElementById('activity_id').value == '' || 
document.getElementById('activity_id').value == 0)
        {
                alert("Du må velge en aktivitet som skal endres!");
                return false;
@@ -12,28 +12,65 @@
                return true;
        }
 }
+function get_activities()
+{
+       var org_id = document.getElementById('organization_id').value;
+       var div_select = document.getElementById('activity_select');
+
+       url = 
"index.php?menuaction=activitycalendarfrontend.uiactivity.get_organization_activities&amp;phpgw_return_as=json&amp;orgid="
 + org_id;
+
+var divcontent_start = "<select name=\"activity_id\" id=\"activity_id\">";
+var divcontent_end = "</select>";
+       
+       var callback = {
+               success: function(response){
+                                       div_select.innerHTML = divcontent_start 
+ JSON.parse(response.responseText) + divcontent_end; 
+                               },
+               failure: function(o) {
+                                        alert("AJAX doesn't work"); //FAILURE
+                                }
+       }
+       var trans = YAHOO.util.Connect.asyncRequest('GET', url, callback, null);
+       
+}
+
+YAHOO.util.Event.onDOMReady(function()
+{
+       get_activities();
+});
 </script>
 <div class="yui-content" style="width: 100%;">
        <h1><?php echo lang('edit_activity');?></h1>
        <form action="#" method="post">
                <dl class="proplist-col" style="width: 200%">
                        <dt>
-                               <?php echo 
lang('activity_edit_helptext');?><br/><br/>
+                               <?php echo 
lang('activity_org_helptext_step1')?><br/><br/>
                        </dt>
                        <dd>
                        <?php if($message){?>
                        <?php echo $message;?>
                        <?php }else{?>
-                               <select name="activity_id" id="activity_id">
-                                       <option value="">Ingen aktivitet 
valgt</option>
+                               <select name="organization_id" 
id="organization_id" onchange="javascript: get_activities();">
+                                       <option value="">Ingen organisasjon 
valgt</option>
                                        <?php
-                                       foreach($activities as $activity)
+                                       foreach($organizations as $organization)
                                        {
-                                               echo "<option 
value=\"{$activity->get_id()}\">".$activity->get_title()."</option>";
+                                               echo "<option 
value=\"{$organization->get_id()}\">".$organization->get_name()."</option>";
                                        }
                                        ?>
                                </select>
                                <br/><br/>
+                       </dd>
+                       <dt>
+                               <?php echo 
lang('activity_edit_helptext');?><br/><br/>
+                       </dt>
+                       <dd>
+                               <div id="activity_select">
+                                       <select name="activity_id" 
id="activity_id">
+                                               <option value="0">Ingen 
aktivitet valgt</option>
+                                       </select>
+                               </div>
+                               <br/><br/>
                        <?php }?>
                        </dd>
                        <?php if(!$message){?>

Modified: branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php  
2012-01-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php  
2012-01-05 18:22:42 UTC (rev 8502)
@@ -349,7 +349,6 @@
                        
$control->set_responsibility_name($this->unmarshal($this->db->f('responsibility_name',
 true), 'string'));
                        
$control->set_control_area_id($this->unmarshal($this->db->f('control_area_id', 
true), 'int'));
                        
$control->set_control_area_name($this->unmarshal($this->db->f('control_area_name',
 true), 'string'));
-       //                      
$control->set_control_group_id($this->unmarshal($this->db->f('control_group_id',
 true), 'int'));
                        
$control->set_component_type_id($this->unmarshal($this->db->f('component_type_id',
 true), 'int'));
                        
$control->set_component_id($this->unmarshal($this->db->f('component_id', true), 
'int'));
                        
$control->set_location_code($this->unmarshal($this->db->f('location_code', 
true), 'int'));

Modified: 
branches/Version-1_0-branch/controller/inc/class.socontrol_group_list.inc.php
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/class.socontrol_group_list.inc.php   
    2012-01-05 18:16:12 UTC (rev 8501)
+++ 
branches/Version-1_0-branch/controller/inc/class.socontrol_group_list.inc.php   
    2012-01-05 18:22:42 UTC (rev 8502)
@@ -166,7 +166,7 @@
                        return isset($result);
                }
 
-               function get_control_groups_by_control_id($control_id)
+               function get_control_groups_by_control($control_id, $returnType 
= "object")
                {
                        $this->db->query("SELECT cg.*, cgl.order_nr FROM 
controller_control_group_list cgl, controller_control_group cg WHERE 
cgl.control_id=$control_id AND cgl.control_group_id=cg.id ORDER BY 
cgl.order_nr", __LINE__, __FILE__);
 
@@ -180,7 +180,10 @@
                                
$control_group->set_control_area_id($this->unmarshal($this->db->f('control_area_id'),
 'int'));
                                
$control_group->set_building_part_id($this->unmarshal($this->db->f('building_part_id'),
 'int'));
 
-                               $control_group_list[] = $control_group;
+                               if($returnType == "array")
+                                       $control_group_list[] = 
$control_group->toArray();
+                               else    
+                                       $control_group_list[] = $control_group;
                        }
 
                        return $control_group_list;

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-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol_item.inc.php     
2012-01-05 18:22:42 UTC (rev 8502)
@@ -266,7 +266,7 @@
                        return "SELECT {$cols} FROM {$tables} {$joins} WHERE 
{$condition} {$order}";
                }
 
-               function get_control_items(int $control_group_id)
+               function get_control_items($control_group_id)
                {
                        $results = array();
 
@@ -308,7 +308,7 @@
                        return $results;
                }
 
-               function get_control_items_by_control_id($control_id)
+               function get_control_items_by_control_id($control_id, 
$returnType = "object")
                {
                        $results = array();
 
@@ -325,8 +325,10 @@
                                
$control_item->set_control_group_id($this->unmarshal($this->db->f('control_group_id',
 true), 'int'));
                                
$control_item->set_type($this->unmarshal($this->db->f('type', true), 'string'));
 
-                               $results[] = $control_item;
+                               if($returnType == "array")
+                                       $results[] = $control_item->toArray();
                        }
+                       
                        return $results;
                }
 

Modified: branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php 
2012-01-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/controller/inc/class.uicalendar.inc.php 
2012-01-05 18:22:42 UTC (rev 8502)
@@ -107,6 +107,8 @@
                                $heading_array[$i] = "$i";      
                        }
                                                        
+                       //print_r( $controls_calendar_array );
+                       
                        $data = array
                        (               
                                'location_array'                  => 
$location_array,
@@ -225,7 +227,7 @@
                        $control_id = phpgw::get_var('control_id');
                        $control = $this->so_control->get_single($control_id);
                                                
-                       $control_groups_array = 
$this->so_control_group_list->get_control_groups_by_control_id( $control_id );
+                       $control_groups_array = 
$this->so_control_group_list->get_control_groups_by_control( $control_id );
 
                        $saved_groups_with_items_array = array();
                        

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-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/controller/inc/class.uicheck_list.inc.php       
2012-01-05 18:22:42 UTC (rev 8502)
@@ -56,7 +56,9 @@
                        'get_check_list_info'                           =>      
true,
                        'control_calendar_status_overview'      =>      true,
                        'add_check_item_to_list'                        =>      
true,
-                       'update_check_list'                                     
=>      true
+                       'update_check_list'                                     
=>      true,
+                       'view_control_items'                            =>      
true,
+                       'view_control_details'                          =>      
true
                );
 
                public function __construct()
@@ -261,7 +263,88 @@
                        
self::render_template_xsl('control_calendar_status_overview', $data);
                }
 
+               public function view_control_items(){
+                       $control_id = phpgw::get_var('control_id');
+                       
+                       $control = $this->so_control->get_single($control_id);
+                       
+                       $control_groups = 
$this->so_control_group_list->get_control_groups_by_control($control_id);
+                       
+                       $saved_groups_with_items_array = array();
+                       
+                       //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_id, 
$control_group->get_id());
+                               
+                               $control_item = 
$this->so_control_item->get_single($control_item_id);
+                               
+                               $saved_groups_with_items_array[] = 
array("control_group" => $control_group->toArray(), "control_items" => 
$saved_control_items);
+                       }
+                       
+                       $data = array
+                       (
+                               'saved_groups_with_items_array' => 
$saved_groups_with_items_array
+                       );
+                       
+                       $xslttemplate = CreateObject('phpgwapi.xslttemplates');
+                       
+            $xslttemplate->add_file(array(PHPGW_SERVER_ROOT . 
'/controller/templates/base/control_item/view_control_items'));
+           
+            $xslttemplate->set_var('phpgw',array('view_control_items' => 
$data));
+            
+            $xslttemplate->xsl_parse();
+               $xslttemplate->xml_parse();
+       
+               $xml = new DOMDocument;
+               $xml->loadXML($xslttemplate->xmldata);
 
+               $xsl = new DOMDocument;
+               $xsl->loadXML($xslttemplate->xsldata);
+
+               // Configure the transformer
+               $proc = new XSLTProcessor;
+               $proc->importStyleSheet($xsl); // attach the xsl rules
+       
+               $html = $proc->transformToXML($xml);
+
+               echo $html;
+               }
+               
+               public function view_control_details(){
+                       $control_id = phpgw::get_var('control_id');
+                       
+                       $control = $this->so_control->get_single($control_id);
+                       
+                       $data = array
+                       (
+                               'control'       => $control->toArray()
+                       );
+                       
+                       $xslttemplate = CreateObject('phpgwapi.xslttemplates');
+                       
+            $xslttemplate->add_file(array(PHPGW_SERVER_ROOT . 
'/controller/templates/base/control/view_control_details'));
+           
+            $xslttemplate->set_var('phpgw',array('view_control_details' => 
$data));
+            
+            $xslttemplate->xsl_parse();
+               $xslttemplate->xml_parse();
+       
+               $xml = new DOMDocument;
+               $xml->loadXML($xslttemplate->xmldata);
+
+               $xsl = new DOMDocument;
+               $xsl->loadXML($xslttemplate->xsldata);
+
+               // Configure the transformer
+               $proc = new XSLTProcessor;
+               $proc->importStyleSheet($xsl); // attach the xsl rules
+       
+               $html = $proc->transformToXML($xml);
+
+               echo $html;
+               }
+
                public function view_check_lists_for_control()
                {
                        $control_id = phpgw::get_var('id');
@@ -284,10 +367,10 @@
                public function view_control_items_for_control()
                {
                        $control_id = phpgw::get_var('control_id');
+                       
                        $control = $this->so_control->get_single($control_id);
+                       $control_groups_array = 
$this->so_control_group_list->get_control_groups_by_control( $control_id );
 
-                       $control_groups_array = 
$this->so_control_group_list->get_control_groups_by_control_id( $control_id );
-
                        $saved_groups_with_items_array = array();
 
                        foreach ($control_groups_array as $control_group)

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-05 18:16:12 UTC (rev 8501)
+++ 
branches/Version-1_0-branch/controller/inc/class.uicheck_list_for_location.inc.php
  2012-01-05 18:22:42 UTC (rev 8502)
@@ -52,15 +52,17 @@
                private $so_check_list;
                private $so_control_item;
                private $so_check_item;
+               private $so_procedure;
        
                var $public_functions = array(
                                                                                
'index' => true,
-                                                                               
'view_locations_for_control' => true,
-                                                                               
'add_location_to_control' => true,
-                                                                               
'add_check_list_for_location' => true,
-                                                                               
'save_check_list_for_location' => true,
-                                                                               
'edit_check_list_for_location' => true,
-                                                                               
'create_error_report_message' => true
+                                                                               
'view_locations_for_control'    => true,
+                                                                               
'add_location_to_control'               => true,
+                                                                               
'add_check_list_for_location'   => true,
+                                                                               
'save_check_list_for_location'  => true,
+                                                                               
'edit_check_list_for_location'  => true,
+                                                                               
'create_error_report_message'   => true,
+                                                                               
'view_control_info'                     => true
                                                                        );
 
                function __construct()
@@ -74,6 +76,7 @@
                        $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->so_procedure                     = 
CreateObject('controller.soprocedure');
                        
                        $this->type_id                          = 
$this->bo->type_id;
                        
@@ -365,7 +368,7 @@
                        $check_list_id = phpgw::get_var('check_list_id');
                        
                        $check_list = 
$this->so_check_list->get_single($check_list_id);
-                       print_r($check_list);
+                       
                        // Fetches with check items
                        $open_check_items = 
$this->so_check_item->get_check_items($check_list_id, 'open', 
'control_item_type_1');
 
@@ -486,6 +489,53 @@
                        
self::render_template_xsl('create_error_report_message', $data);
                }
                
+               public function view_control_info(){
+                       $check_list_id = phpgw::get_var('check_list_id');
+                       
+                       $check_list = 
$this->so_check_list->get_single($check_list_id);
+                       $control = 
$this->so_control->get_single($check_list->get_control_id());
+                       
+                       $cats   = CreateObject('phpgwapi.categories', -1, 
'controller', '.control');
+                       $cats->supress_info     = true;
+                       
+                       $control_areas = 
$cats->formatted_xslt_list(array('format'=>'filter','selected' => 
$control_area_id,'globals' => true,'use_acl' => $this->_category_acl));
+                       array_unshift($control_areas['cat_list'],array 
('cat_id'=>'','name'=> lang('select value')));
+                       $control_areas_array2 = array();
+                       
+                       foreach($control_areas['cat_list'] as $cat_list)
+                       {
+                               $control_areas_array2[] = array
+                               (
+                                       'id'    => $cat_list['cat_id'],
+                                       'name'  => $cat_list['name'],
+                               );              
+                       }
+
+                       // Fetches prosedures that are related to first control 
area in list
+                       $control_area_id = $control_areas_array2[1]['id'];
+                       $procedures_array = 
$this->so_procedure->get_procedures_by_control_area_id($control_area_id);
+                       $role_array = $this->so_control->get_roles();
+                       
+                       $location_code = $check_list->get_location_code();  
+                       $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
+                       
+                       $data = array
+                       (
+                               'location_array'                => 
$location_array,
+                               'control'                               => 
$control->toArray(),
+                               'check_list'                    => 
$check_list->toArray(),
+                               'date_format'                   => $date_format,
+                               'control_areas_array2'  => array('options' => 
$control_areas_array2),
+                               'procedures_array'              => 
$procedures_array,
+                               'role_array'                    => $role_array
+                       );
+
+                       self::add_javascript('controller', 'controller', 
'jquery.js');
+                       self::add_javascript('controller', 'controller', 
'jquery-ui.custom.min.js');
+                       
+                       
self::render_template_xsl('check_list/view_control_info', $data);
+               }
+               
                function get_timestamp_from_date( $date_string ){
                        $pos_day = strpos($date_string, "/"); 
                        $day =  substr($date_string, 0, $pos_day);

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-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php  
2012-01-05 18:22:42 UTC (rev 8502)
@@ -296,7 +296,7 @@
                        
                        
$GLOBALS['phpgw']->css->add_external_file('controller/templates/base/css/jquery-ui.custom.css');
                        
-                       self::render_template_xsl(array('control_tabs', 
'control'), $data);
+                       self::render_template_xsl(array('control/control_tabs', 
'control/control'), $data);
                        
                        $this->use_yui_editor(array('description'));
                }
@@ -332,7 +332,7 @@
                        $control = $this->so->get_single($control_id);  
                                                                        
                        // Fetches saved control groups from db
-                       $saved_control_groups = 
$this->so_control_group_list->get_control_groups_by_control_id($control_id);
+                       $saved_control_groups = 
$this->so_control_group_list->get_control_groups_by_control($control_id);
                        $saved_control_group_ids = array();
                        
                        foreach($saved_control_groups as $control_group){
@@ -383,7 +383,7 @@
                        );
                        
                        self::add_javascript('controller', 'yahoo', 
'control_tabs.js');
-                       self::render_template_xsl(array('control_tabs', 
'control_groups'), $data);
+                       self::render_template_xsl(array('control/control_tabs', 
'control_group/control_groups'), $data);
                }
                
                public function save_control_groups(){
@@ -485,7 +485,7 @@
                        self::add_javascript('controller', 'yahoo', 
'control_tabs.js');
                        self::add_javascript('controller', 'controller', 
'jquery.js');
                        self::add_javascript('controller', 'controller', 
'custom_ui.js');
-                       self::render_template_xsl(array('control_tabs', 
'choose_control_items'), $data); 
+                       self::render_template_xsl(array('control/control_tabs', 
'control_item/choose_control_items'), $data); 
                }
                
                // Saves chosen control items through receiving a comma 
separated list of control tags (1:2, control_group_id:control_item_id) 
@@ -543,7 +543,7 @@
                        
                        $control_group_ids = array();
                        
-                       //Putting control_group_ids in array control_group_ids
+                       // Putting control_group_ids in array control_group_ids
                        foreach ($control_tag_ids as $control_tag)
                        {       
                                // Fetching group id from tag   
@@ -602,9 +602,10 @@
                        self::add_javascript('controller', 'controller', 
'yui_min_3_4_3.js');
                        self::add_javascript('controller', 'controller', 
'custom_drag_drop.js');
                        self::add_javascript('controller', 'controller', 
'ajax.js');
-                       self::render_template_xsl(array('control_tabs', 
'sort_check_list'), $data);
+                       self::render_template_xsl(array('control/control_tabs', 
'control_item/sort_check_list'), $data);
                }
                
+               
                public function generate_check_lists_for_control(){
                        $control_id = phpgw::get_var('control_id');
                        $control = $this->so->get_single($control_id);
@@ -686,7 +687,7 @@
                                'date_format'           => $date_format
                        );
                        
-                       self::render_template_xsl(array('control_tabs', 
'tab_view_check_lists'), $data);
+                       self::render_template_xsl(array('control/control_tabs', 
'tab_view_check_lists'), $data);
                        self::add_javascript('controller', 'yahoo', 
'control_tabs.js');
                }
                        

Modified: 
branches/Version-1_0-branch/controller/inc/class.uicontrol_item.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol_item.inc.php     
2012-01-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol_item.inc.php     
2012-01-05 18:22:42 UTC (rev 8502)
@@ -338,7 +338,7 @@
                                
$GLOBALS['phpgw']->richtext->replace_element('how_to_do');
                                $GLOBALS['phpgw']->richtext->generate_script();
 
-                               self::render_template_xsl('control_item', 
$data);
+                               
self::render_template_xsl('control_item/control_item', $data);
                        }
                }
 
@@ -458,7 +458,7 @@
 
                                $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('controller') . '::' . lang('Control item');
 
-                               self::render_template_xsl('control_item', 
$data);
+                               
self::render_template_xsl('control_item/control_item', $data);
                        }
                }
 

Modified: 
branches/Version-1_0-branch/controller/inc/class.uierror_report_message.inc.php
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/class.uierror_report_message.inc.php 
    2012-01-05 18:16:12 UTC (rev 8501)
+++ 
branches/Version-1_0-branch/controller/inc/class.uierror_report_message.inc.php 
    2012-01-05 18:22:42 UTC (rev 8502)
@@ -128,16 +128,18 @@
                                $message_details .=  $check_item->get_comment() 
. "<br>";
                        }
                        
+                       $location_id    = 
$GLOBALS['phpgw']->locations->get_id("controller", ".checklist");
+                       
                        $ticket = array
                        (
                                'origin'                        => $location_id,
-                               'origin_id'                     => 
$location_item_id,
+                               'origin_id'                     => 
$check_list_id, 
                                'location_code'         => $location_code,
                                'cat_id'                        => 
$message_cat_id,
                                'priority'                      => $priority, 
//valgfri (1-3)
                                'title'                         => 
$message_title,
                                'details'                       => 
$message_details,
-                               'file_input_name'       => 'file' // default, 
men valgfri
+                               'file_input_name'       => 'file' // navn på 
felt som inneholder fil
                        );
                        
                        $botts = CreateObject('property.botts',true);

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-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/controller/inc/class.uiprocedure.inc.php        
2012-01-05 18:22:42 UTC (rev 8502)
@@ -31,6 +31,7 @@
        phpgw::import_class('controller.uicommon');
        phpgw::import_class('controller.soprocedure');
        phpgw::import_class('controller.socontrol_area');
+       phpgw::import_class('controller.socontrol');
 
        include_class('controller', 'procedure', 'inc/model/');
 
@@ -38,15 +39,18 @@
        {
                private $so;
                private $so_control_area;
+               private $so_control;
+               private $so_control_group_list;
 
                public $public_functions = array
                (
-                       'index'                         =>      true,
-                       'query'                         =>      true,
-                       'edit'                          =>      true,
-                       'view'                          =>      true,
-                       'add'                           =>      true,
-                       'get_procedures'        =>      true
+                       'index'                                                 
=>      true,
+                       'query'                                                 
=>      true,
+                       'edit'                                                  
=>      true,
+                       'view'                                                  
=>      true,
+                       'add'                                                   
=>      true,
+                       'get_procedures'                                =>      
true,
+                       'view_procedures_for_control'   =>      true
                );
 
                public function __construct()
@@ -55,6 +59,9 @@
 
                        $this->so = CreateObject('controller.soprocedure');
                        $this->so_control_area = 
CreateObject('controller.socontrol_area');
+                       $this->so_control = 
CreateObject('controller.socontrol');
+                       $this->so_control_group_list = 
CreateObject('controller.socontrol_group_list');
+                       
                        $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"controller::procedure";
                        //$this->bo = CreateObject('property.boevent',true);
                }
@@ -290,9 +297,18 @@
                                }
                                $procedure_array = $procedure->toArray();
                                //_debug_array($procedure_array);
+                               
+                               $tabs = array( array(
+                                       'label' => lang('Procedure')
 
+                               ), array(
+                                       'label' => 
lang('View_documents_for_procedure')
+                               ));
+
                                $data = array
                                (
+                                       'tabs'                                  
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 0),
+                                       'view'                                  
=> "view_procedure",
                                        'value_id'                              
=> !empty($procedure) ? $procedure->get_id() : 0,
                                        'start_date'                    => 
$GLOBALS['phpgw']->yuical->add_listener('start_date',date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],
 ($procedure->get_start_date())?$procedure->get_start_date():time())),
                                        'end_date'                              
=> 
$GLOBALS['phpgw']->yuical->add_listener('end_date',date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],
 ($procedure->get_end_date())?$procedure->get_end_date():'')),
@@ -308,7 +324,7 @@
 
                                
$this->use_yui_editor(array('responsibility','description'));
 
-                               self::render_template_xsl('procedure_item', 
$data);
+                               
self::render_template_xsl(array('procedure/procedure_tabs', 'common', 
'procedure/procedure_item'), $data);
                        }
                }
 
@@ -420,10 +436,57 @@
                                $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('controller') . '::' . lang('Procedure');
 
                                //self::render_template_xsl('procedure_item', 
$data);
-                               
self::render_template_xsl(array('procedure_tabs', 'common', 'procedure_item'), 
$data);
+                               
self::render_template_xsl(array('procedure/procedure_tabs', 'common', 
'procedure/procedure_item'), $data);
                        }
                }
 
+               public function view_procedures_for_control(){
+                               $control_id = phpgw::get_var('control_id');
+                               
+                               $control = 
$this->so_control->get_single($control_id);
+                               
+                               $control_procedure = $this->so->get_single( 
$control->get_procedure_id() );
+                               
+                               $control_groups = 
$this->so_control_group_list->get_control_groups_by_control($control_id);
+                       
+                               $group_procedures_array = array();
+                               
+                               foreach ($control_groups as $control_group)
+                               {       
+                                       $group_procedure = 
$this->so->get_single( $control_group->get_procedure_id() );
+                                       $group_procedures_array[] = 
array("control_group" => $control_group->toArray(), "procedure" => 
$group_procedure->toArray());
+                               }
+                               
+                               $data = array
+                               (
+                                       'control_procedure'                     
=> $control_procedure->toArray(),
+                                       'group_procedures_array'        => 
$group_procedures_array
+                               );
+                               
+                               $xslttemplate = 
CreateObject('phpgwapi.xslttemplates');
+                               
+                   $xslttemplate->add_file(array(PHPGW_SERVER_ROOT . 
'/controller/templates/base/procedure/view_procedures_for_control'));
+                  
+                   
$xslttemplate->set_var('phpgw',array('view_procedures_for_control' => $data));
+                   
+                   $xslttemplate->xsl_parse();
+                       $xslttemplate->xml_parse();
+               
+                       $xml = new DOMDocument;
+                       $xml->loadXML($xslttemplate->xmldata);
+       
+                       $xsl = new DOMDocument;
+                       $xsl->loadXML($xslttemplate->xsldata);
+       
+                       // Configure the transformer
+                       $proc = new XSLTProcessor;
+                       $proc->importStyleSheet($xsl); // attach the xsl rules
+               
+                       $html = $proc->transformToXML($xml);
+       
+                       echo $html;
+               }
+               
                public function query()
                {
                        $params = array(

Modified: branches/Version-1_0-branch/controller/js/controller/ajax.js
===================================================================
--- branches/Version-1_0-branch/controller/js/controller/ajax.js        
2012-01-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/controller/js/controller/ajax.js        
2012-01-05 18:22:42 UTC (rev 8502)
@@ -223,7 +223,7 @@
                                                  
                                                // Changes text on save button 
back to original
                                                window.setTimeout(function() {
-                                                 $(submitBnt).val('Lagre 
sjekkpunkt');
+                                                 $(submitBnt).val('Oppdater 
håndtert avvik');
                                                  
$(submitBnt).addClass("not_active");
                                                         }, 1000);
                                          }
@@ -293,4 +293,12 @@
                var submitBnt = $(thisForm).find("input[type='submit']");
                $(submitBnt).removeClass("not_active");
        });
+       
+
+       // file: add_check_list_for_location.xsl
+       $("#frm_add_check_list").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/templates/base/add_check_list_for_location.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/add_check_list_for_location.xsl
       2012-01-05 18:16:12 UTC (rev 8501)
+++ 
branches/Version-1_0-branch/controller/templates/base/add_check_list_for_location.xsl
       2012-01-05 18:22:42 UTC (rev 8502)
@@ -23,6 +23,7 @@
        
        <h1>Registrere sjekkliste for <xsl:value-of 
select="location_array/loc1_name"/></h1>
        
+       <div class="tab_menu"><a class="active">Sjekklistedetaljer</a></div>
        <fieldset class="check_list_details">
                <form id="frm_add_check_list" 
action="index.php?menuaction=controller.uicheck_list_for_location.save_check_list_for_location"
 method="post">
                                        
@@ -79,9 +80,9 @@
                            </div>
                                <div><label>Utstyr</label><input 
name="equipment_id" /></div>
                        </fieldset>
-                       <div>
-                               <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save')" /></xsl:variable>
-                               <input type="submit" name="save" 
value="{$lang_save}" title = "{$lang_save}" />
+                       <div class="form-buttons">
+                               <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_list')" /></xsl:variable>
+                               <input style="width: 170px;" class="btn 
not_active" type="submit" name="save_control" value="Lagre detaljer" />
                        </div>
                </form>
        </fieldset>

Deleted: 
branches/Version-1_0-branch/controller/templates/base/choose_control_items.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/choose_control_items.xsl  
    2012-01-05 18:16:12 UTC (rev 8501)
+++ 
branches/Version-1_0-branch/controller/templates/base/choose_control_items.xsl  
    2012-01-05 18:22:42 UTC (rev 8502)
@@ -1,58 +0,0 @@
-<!-- $Id$ -->
-<xsl:template name="control_items" xmlns:php="http://php.net/xsl";>
-
-<div class="yui-content tab_content">
-       <div>
-          <!-- ===========================  CHOOSE CONTROL ITEMS  
=============================== -->  
-          <h2>Velg dine kontrollpunkt</h2>
-          
-          <!-- ==== CHOOSE NONE/ALL ===== -->
-               <h4 class="expand_header"><div class="expand_all">Vis 
alle</div><div class="collapse_all">Skjul alle</div></h4>
-               
-               <form id="frm_control_items" 
action="index.php?menuaction=controller.uicontrol.save_control_items" 
method="post">       
-                       <xsl:variable name="control_id"><xsl:value-of 
select="control/id"/></xsl:variable>
-                       <input type="hidden" name="control_id" 
value="{$control_id}" />
-                       
-                       <xsl:variable name="control_group_ids"><xsl:value-of 
select="control_group_ids"/></xsl:variable>
-                       <input type="hidden" name="control_group_ids" 
value="{control_group_ids}" />            
-                       
-                       <ul class="control_items">
-                               <xsl:for-each 
select="groups_with_control_items">
-                                       <ul class="itemlist expand_list">
-                                       <li>
-                                               <xsl:choose>
-                                                       <xsl:when 
test="group_control_items/child::node()">
-                                                               <h4><img 
src="controller/images/arrow_left.png" width="14"/><span><xsl:value-of 
select="control_group/group_name"/></span></h4>
-                                                               <xsl:variable 
name="control_group_id"><xsl:value-of select="control_group/id"/></xsl:variable>
-                                                               <ul>            
-                                                                       
<xsl:for-each select="group_control_items">
-                                                                               
<xsl:variable name="control_item_id"><xsl:value-of 
select="control_item/id"/></xsl:variable>
-                                                                               
<xsl:choose>
-                                                                               
        <xsl:when test="checked = 1">
-                                                                               
                <li><xsl:number/>.  <input type="checkbox"  checked="checked" 
id="ch_{$control_group_id}:{$control_item_id}" 
value="{$control_group_id}:{$control_item_id}" /><xsl:value-of 
select="control_item/title"/></li>
-                                                                               
        </xsl:when>
-                                                                               
        <xsl:otherwise>
-                                                                               
                <li><xsl:number/>.  <input type="checkbox"  
id="ch_{$control_group_id}:{$control_item_id}" 
value="{$control_group_id}:{$control_item_id}" /><xsl:value-of 
select="control_item/title"/></li>
-                                                                               
        </xsl:otherwise>
-                                                                               
</xsl:choose>
-                                                                       
</xsl:for-each>
-                                                               </ul>
-                                                       </xsl:when>
-                                               <xsl:otherwise>
-                                                       <div 
class="empty_list"><span><xsl:value-of 
select="control_group/group_name"/></span></div>
-                                                       <div>Ingen 
kontrollpunkt</div>
-                                               </xsl:otherwise>
-                                               </xsl:choose>
-                                       </li>
-                               </ul>
-                               </xsl:for-each>
-                       </ul>
-                       
-                       <div>
-                               <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save')" /></xsl:variable>
-                               <input type="submit" name="save_control_items" 
value="{$lang_save}" title = "{$lang_save}" />
-                       </div>
-               </form>                                 
-       </div>
-</div>
-</xsl:template>

Deleted: branches/Version-1_0-branch/controller/templates/base/control.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/control.xsl   
2012-01-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/controller/templates/base/control.xsl   
2012-01-05 18:22:42 UTC (rev 8502)
@@ -1,212 +0,0 @@
-<!-- $Id$ -->
-<xsl:template name="control" xmlns:php="http://php.net/xsl";>
-
-<xsl:variable name="control_id"><xsl:value-of 
select="control/id"/></xsl:variable>
-<xsl:variable name="control_area_id"><xsl:value-of 
select="control/control_area_id"/></xsl:variable>
-<xsl:variable name="control_procedure_id"><xsl:value-of 
select="control/procedure_id"/></xsl:variable>
-<xsl:variable name="date_format">d/m-Y</xsl:variable>
-
-<script>
-               $(function() {
-                       $( "#start_date" ).datepicker({ 
-                               monthNames: 
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
-                               dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 
'Fr', 'Lø'],
-                               dateFormat: 'd/m-yy' 
-                       });
-                       $( "#end_date" ).datepicker({ 
-                               monthNames: 
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
-                               dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 
'Fr', 'Lø'],
-                               dateFormat: 'd/m-yy' 
-                       });     
-               });
-       </script>
-
-<div class="yui-content">
-       <div id="control_details">
-               <form 
action="index.php?menuaction=controller.uicontrol.save_control_details" 
method="post">
-                       <input type="hidden" name="control_id" 
value="{$control_id}" /> 
-       
-                       <dl class="proplist-col">
-                               <dt>
-                                       <label>Kontrollområde</label>
-                               </dt>
-                               <dd>
-                               <xsl:choose>
-                                       <xsl:when test="editable">
-                                               <select id="control_area_id" 
name="control_area_id">
-                                                       <xsl:for-each 
select="control_areas_array">
-                                                               <xsl:choose>
-                                                                       
<xsl:when test="id != $control_area_id">
-                                                                               
<option value="{id}">
-                                                                               
        <xsl:value-of disable-output-escaping="yes" select="title"/>
-                                                                               
</option>
-                                                                       
</xsl:when>
-                                                                       
<xsl:otherwise>
-                                                                               
<option value="{id}" selected="selected">
-                                                                               
        <xsl:value-of disable-output-escaping="yes" select="title"/>
-                                                                               
</option>
-                                                                       
</xsl:otherwise>
-                                                               </xsl:choose>   
                                                        
-                                                       </xsl:for-each>
-                                               </select>
-                                               <select id="control_area_id" 
name="control_area_id">
-                                                       <xsl:apply-templates 
select="control_areas_array2/options"/>
-                                               </select>
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               <xsl:value-of 
select="control/control_area_name" />
-                                       </xsl:otherwise>
-                               </xsl:choose>
-                               </dd>
-                               <dt>
-                                       <label>Prosedyre</label>
-                               </dt>
-                               <dd>
-                               <xsl:choose>
-                                       <xsl:when test="editable">
-                                               <select id="procedure_id" 
name="procedure_id">
-                                                       <xsl:for-each 
select="procedures_array">
-                                                               <xsl:choose>
-                                                                       
<xsl:when test="id != $control_procedure_id">
-                                                                               
<option value="{id}">
-                                                                               
        <xsl:value-of disable-output-escaping="yes" select="title"/>
-                                                                               
</option>
-                                                                       
</xsl:when>
-                                                                       
<xsl:otherwise>
-                                                                               
<option value="{id}" selected="selected">
-                                                                               
        <xsl:value-of disable-output-escaping="yes" select="title"/>
-                                                                               
</option>
-                                                                       
</xsl:otherwise>
-                                                               </xsl:choose>   
                                                        
-                                                       </xsl:for-each>
-                                               </select>
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               <xsl:value-of 
select="control/procedure_name" />
-                                       </xsl:otherwise>
-                               </xsl:choose>
-                               </dd>
-                               <dt>
-                                       <label for="title">Tittel</label>
-                               </dt>
-                               <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <input type="text" 
name="title" id="title" value="{control/title}" size="80"/>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:value-of 
select="control/title" />
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                               </dd>
-                               <dt>
-                                       <label 
for="start_date">Startdato</label>
-                               </dt>
-                               <dd>
-                                       <input>
-                                     <xsl:attribute 
name="id">start_date</xsl:attribute>
-                                     <xsl:attribute 
name="name">start_date</xsl:attribute>
-                                     <xsl:attribute 
name="type">text</xsl:attribute>
-                                     <xsl:if test="control/start_date != ''">
-                                       <xsl:attribute 
name="value"><xsl:value-of select="php:function('date', $date_format, 
number(control/start_date))"/></xsl:attribute>
-                                     </xsl:if>
-                                   </input>
-                               </dd>
-                               <dt>
-                                       <label for="end_date">Sluttdato</label>
-                               </dt>
-                               <dd>
-                                       <input>
-                                     <xsl:attribute 
name="id">end_date</xsl:attribute>
-                                     <xsl:attribute 
name="name">end_date</xsl:attribute>
-                                     <xsl:attribute 
name="type">text</xsl:attribute>
-                                     <xsl:if test="control/end_date != 0">
-                                       <xsl:attribute 
name="value"><xsl:value-of select="php:function('date', $date_format, 
number(control/end_date))"/></xsl:attribute>
-                                     </xsl:if>
-                                   </input>
-                               </dd>
-                               <dt>
-                                       <label>Frekvenstype</label>
-                               </dt>
-                               <dd>
-                                       <select id="repeat_type" 
name="repeat_type">
-                                               <option value="0">Ikke 
angitt</option>
-                                               <option value="1">Dag</option>
-                                               <option value="2">Uke</option>
-                                               <option value="3">Måned</option>
-                                               <option value="5">År</option>
-                                       </select>
-                               </dd>
-                               <dt>
-                                       <label>Frekvens</label>
-                               </dt>
-                               <dd>
-                               <xsl:choose>
-                                       <xsl:when test="editable">
-                                               <input size="2" type="text" 
name="repeat_interval" value="{control/repeat_interval}" />
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               <xsl:value-of 
select="control/repeat_interval" />
-                                       </xsl:otherwise>
-                               </xsl:choose>
-                               </dd>
-                               <dt>
-                                       <label>Rolle</label>
-                               </dt>
-                               <dd>
-                               <xsl:choose>
-                                       <xsl:when test="editable">
-                                               <select id="responsibility_id" 
name="responsibility_id">
-                                                       <xsl:for-each 
select="role_array">
-                                                               <option 
value="{id}">
-                                                                       
<xsl:value-of disable-output-escaping="yes" select="name"/>
-                                                               </option>
-                                                       </xsl:for-each>
-                                               </select>
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               <xsl:value-of 
select="control/role_name" />
-                                       </xsl:otherwise>
-                               </xsl:choose>
-                               </dd>
-                               <dt>
-                                       <label 
for="description">Beskrivelse</label>
-                               </dt>
-                               <dd>
-                               <xsl:choose>
-                                       <xsl:when test="editable">
-                                               <textarea cols="70" rows="5" 
name="description" id="description"><xsl:value-of select="control/description" 
/></textarea>
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               <xsl:value-of 
select="control/description" disable-output-escaping="yes"/>
-                                       </xsl:otherwise>
-                               </xsl:choose>
-                               </dd>
-                       </dl>
-                       
-                       <div class="form-buttons">
-                               <xsl:choose>
-                                       <xsl:when test="editable">
-                                               <xsl:variable 
name="lang_save"><xsl:value-of select="php:function('lang', 'save')" 
/></xsl:variable>
-                                               <input type="submit" 
name="save_control" value="{$lang_save}" title = "{$lang_save}" />
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               <xsl:variable 
name="lang_edit"><xsl:value-of select="php:function('lang', 'edit')" 
/></xsl:variable>
-                                               <input type="submit" 
name="edit_control" value="{$lang_edit}" title = "{$lang_edit}" />
-                                       </xsl:otherwise>
-                               </xsl:choose>
-                       </div>
-               </form>                                 
-       </div>
-</div>
-</xsl:template>
-
-<xsl:template match="options">
-       <option value="{id}">
-               <xsl:if test="selected != 0">
-                       <xsl:attribute name="selected" value="selected" />
-               </xsl:if>
-               <xsl:value-of disable-output-escaping="yes" select="name"/>
-       </option>
-</xsl:template>
-

Deleted: branches/Version-1_0-branch/controller/templates/base/control_group.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/control_group.xsl     
2012-01-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/controller/templates/base/control_group.xsl     
2012-01-05 18:22:42 UTC (rev 8502)
@@ -1,117 +0,0 @@
-<!-- $Id$ -->
-<!-- item  -->
-<xsl:template name="control_group" xmlns:php="http://php.net/xsl";>
-<!-- <xsl:template match="data" xmlns:php="http://php.net/xsl";>  -->
-
-<xsl:call-template name="yui_booking_i18n"/>
-<div class="identifier-header">
-<h1><img src="{img_go_home}" /> 
-               <xsl:value-of select="php:function('lang', 'Control_group')" />
-</h1>
-</div>
-
-<div class="yui-content">
-               <div id="details">
-                       <form action="#" method="post">
-                               <input type="hidden" name="id" value = 
"{value_id}">
-                               </input>
-                               <dl class="proplist-col">
-                                       <dt>
-                                               <label 
for="title">Tittel</label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <input type="text" 
name="group_name" id="group_name" value="{control_group/group_name}" />
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:value-of 
select="control_group/group_name"/>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>
-                                       <dt>
-                                               <label 
for="control_area">Kontrollområde</label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <select 
id="control_area" name="control_area">
-                                                               
<xsl:apply-templates select="control_area/options"/>
-                                                       </select>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:value-of 
select="control_group/control_area_name" />
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>
-                                       <dt>
-                                               <label 
for="proecdure">Prosedyre</label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <select id="procedure" 
name="procedure">
-                                                               
<xsl:apply-templates select="procedure/options"/>
-                                                       </select>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:value-of 
select="control_group/procedure_name" />
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>
-                                       <dt>
-                                               <label 
for="building_part">Bygningsdel</label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <select 
id="building_part" name="building_part">
-                                                               
<xsl:apply-templates select="building_part/building_part_options"/>
-                                                       </select>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:value-of 
select="control_group/building_part_id" /> - <xsl:value-of 
select="control_group/building_part_descr" />
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>
-                               </dl>
-                               
-                               <div class="form-buttons">
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <xsl:variable 
name="lang_save"><xsl:value-of select="php:function('lang', 'save')" 
/></xsl:variable>
-                                                       <xsl:variable 
name="lang_cancel"><xsl:value-of select="php:function('lang', 'cancel')" 
/></xsl:variable>
-                                                       <input type="submit" 
name="save_control_group" value="{$lang_save}" title = "{$lang_save}" />
-                                                       <input type="submit" 
name="cancel_control_group" value="{$lang_cancel}" title = "{$lang_cancel}" />
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:variable 
name="lang_edit"><xsl:value-of select="php:function('lang', 'edit')" 
/></xsl:variable>
-                                                       <input type="submit" 
name="edit_control_group" value="{$lang_edit}" title = "{$lang_edit}" />
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                               </div>
-                               
-                       </form>
-                                               
-               </div>
-       </div>
-</xsl:template>
-       
-<xsl:template match="options">
-       <option value="{id}">
-               <xsl:if test="selected != 0">
-                       <xsl:attribute name="selected" value="selected" />
-               </xsl:if>
-               <xsl:value-of disable-output-escaping="yes" select="name"/>
-       </option>
-</xsl:template>
-
-<xsl:template match="building_part_options">
-       <option value="{id}">
-               <xsl:if test="selected != 0">
-                       <xsl:attribute name="selected" value="selected" />
-               </xsl:if>
-               <xsl:value-of select="id"/> - <xsl:value-of 
disable-output-escaping="yes" select="name"/>
-       </option>
-</xsl:template>
-

Deleted: 
branches/Version-1_0-branch/controller/templates/base/control_groups.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/control_groups.xsl    
2012-01-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/controller/templates/base/control_groups.xsl    
2012-01-05 18:22:42 UTC (rev 8502)
@@ -1,38 +0,0 @@
-<!-- $Id$ -->
-<xsl:template name="control_groups" xmlns:php="http://php.net/xsl";>
-
-<div class="yui-content tab_content">
-       <div id="control_groups">
-       
-               <h2><xsl:value-of select="control_area/title"/></h2>
-               
-               <form 
action="index.php?menuaction=controller.uicontrol.save_control_groups" 
method="post">
-                       <xsl:variable name="control_area_id"><xsl:value-of 
select="control_area/id"/></xsl:variable>
-                       <input type="hidden" name="control_area_id" 
value="{$control_area_id}" />
-                       
-                       <xsl:variable name="control_id"><xsl:value-of 
select="control/id"/></xsl:variable>
-                       <input type="hidden" name="control_id" 
value="{$control_id}" />
-                       
-                       <ul class="itemlist">
-                               <xsl:for-each select="//control_groups">
-                                       <xsl:variable 
name="control_group_id"><xsl:value-of select="control_group/id"/></xsl:variable>
-                                       
-                                       <xsl:choose>
-                                               <xsl:when test="checked = 1">
-                                                       <li><input 
type="checkbox" checked="checked" name="control_group_ids[]" 
value="{$control_group_id}" /><xsl:value-of 
select="control_group/group_name"/></li>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <li><input 
type="checkbox" name="control_group_ids[]" value="{$control_group_id}" 
/><xsl:value-of select="control_group/group_name"/></li>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       
-                               </xsl:for-each>
-                       </ul>
-                       <div>
-                               <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save')" /></xsl:variable>
-                               <input type="submit" name="save_control_groups" 
value="{$lang_save}" title = "{$lang_save}" />
-                       </div>
-               </form>                                 
-       </div>
-</div>
-</xsl:template>

Deleted: branches/Version-1_0-branch/controller/templates/base/control_item.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/control_item.xsl      
2012-01-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/controller/templates/base/control_item.xsl      
2012-01-05 18:22:42 UTC (rev 8502)
@@ -1,156 +0,0 @@
-<!-- $Id$ -->
-<!-- item  -->
-
-<xsl:template match="data" xmlns:php="http://php.net/xsl";>
-
-<xsl:call-template name="yui_booking_i18n"/>
-<div class="identifier-header">
-<h1><img src="{img_go_home}" /> 
-               <xsl:value-of select="php:function('lang', 'Control_item')" />
-</h1>
-</div>
-
-<ul class="check_list">
-                       <xsl:for-each select="check_list_array">
-                               <li>
-                                       <span>Tittel:</span><xsl:value-of 
select="title"/><span>Start dato:</span><xsl:value-of select="start_date"/>
-                               </li>
-                       </xsl:for-each>
-               </ul>                                   
-               
-       <div class="yui-content">
-               <div id="details">
-                       <form action="#" method="post">
-                               <input type="hidden" name="id" value = 
"{value_id}">
-                               </input>
-                               <dl class="proplist-col">
-                                       <dt>
-                                               <label 
for="title">Tittel</label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <input type="text" 
name="title" id="title" value="{control_item/title}" />
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:value-of 
select="control_item/title"/>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>
-                                       <dt>
-                                               <label 
for="required">Obligatorisk</label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:variable 
name="required_item"><xsl:value-of select="control_item/required" 
/></xsl:variable>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <xsl:choose>
-                                                               <xsl:when 
test="$required_item=1">
-                                                                       <input 
type="checkbox" name="required" id="required" checked="true"/>
-                                                               </xsl:when>
-                                                               <xsl:otherwise>
-                                                                       <input 
type="checkbox" name="required" id="required"/>
-                                                               </xsl:otherwise>
-                                                       </xsl:choose>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:choose>
-                                                               <xsl:when 
test="$required_item=1">
-                                                                       <input 
type="checkbox" name="required" id="required" checked="true" disabled="true"/>
-                                                               </xsl:when>
-                                                               <xsl:otherwise>
-                                                                       <input 
type="checkbox" name="required" id="required" disabled="true" />
-                                                               </xsl:otherwise>
-                                                       </xsl:choose>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>
-                                       <dt>
-                                               <label for="what_to_do">Hva 
skal utføres</label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <textarea 
name="what_to_do" id="what_to_do" rows="5" cols="60"><xsl:value-of 
select="control_item/what_to_do" disable-output-escaping="yes" /></textarea>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:value-of 
select="control_item/what_to_do" disable-output-escaping="yes" />
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>
-                                       <dt>
-                                               <label 
for="how_to_do">Utførelsesbeskrivelse</label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <textarea 
name="how_to_do" id="how_to_do" rows="5" cols="60"><xsl:value-of 
select="control_item/how_to_do" disable-output-escaping="yes" /></textarea>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:value-of 
select="control_item/how_to_do" disable-output-escaping="yes" />
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>
-                                       <dt>
-                                               <label 
for="control_group">Kontrollgruppe</label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <select 
id="control_group" name="control_group">
-                                                               <option 
value="0">Ingen valgt</option>
-                                                               
<xsl:apply-templates select="control_group/options"/>
-                                                       </select>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:value-of 
select="control_item/control_group_name" />
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>
-                                       <dt>
-                                               <label 
for="control_area">Kontrollområde</label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <select 
id="control_area" name="control_area">
-                                                               
<xsl:apply-templates select="control_area/options"/>
-                                                       </select>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:value-of 
select="control_item/control_area_name" />
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>                           
-                               </dl>
-                               
-                               <div class="form-buttons">
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <xsl:variable 
name="lang_save"><xsl:value-of select="php:function('lang', 'save')" 
/></xsl:variable>
-                                                       <xsl:variable 
name="lang_cancel"><xsl:value-of select="php:function('lang', 'cancel')" 
/></xsl:variable>
-                                                       <input type="submit" 
name="save_control_item" value="{$lang_save}" title = "{$lang_save}" />
-                                                       <input type="submit" 
name="cancel_control_item" value="{$lang_cancel}" title = "{$lang_cancel}" />
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:variable 
name="lang_edit"><xsl:value-of select="php:function('lang', 'edit')" 
/></xsl:variable>
-                                                       <input type="submit" 
name="edit_control_item" value="{$lang_edit}" title = "{$lang_edit}" />
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                               </div>
-                               
-                       </form>
-                                               
-               </div>
-       </div>
-</xsl:template>
-       
-<xsl:template match="options">
-       <option value="{id}">
-               <xsl:if test="selected != 0">
-                       <xsl:attribute name="selected" value="selected" />
-               </xsl:if>
-               <xsl:value-of disable-output-escaping="yes" select="name"/>
-       </option>
-</xsl:template>
-

Deleted: branches/Version-1_0-branch/controller/templates/base/control_tabs.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/control_tabs.xsl      
2012-01-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/controller/templates/base/control_tabs.xsl      
2012-01-05 18:22:42 UTC (rev 8502)
@@ -1,53 +0,0 @@
-<!-- $Id$ -->
-<!-- separate tabs and  inline tables-->
-
-<xsl:template match="data" xmlns:php="http://php.net/xsl";>
-<div class="yui-navset yui-navset-top" id="control_tabview">
-       <xsl:choose>
-               <xsl:when test="view = 'control_details'">
-               <xsl:call-template name="yui_booking_i18n"/>
-                       <div class="identifier-header">
-                               <h1><xsl:value-of select="php:function('lang', 
'Control')"/></h1>
-                       </div>
-                       <xsl:value-of disable-output-escaping="yes" 
select="tabs" />
-                       <xsl:call-template name="control" />
-               </xsl:when>
-               <xsl:when test="view = 'control_groups'">
-                       <div class="identifier-header">
-                               <h1><xsl:value-of select="php:function('lang', 
'Control_groups')"/> for <xsl:value-of select="control/title" /></h1>
-                       </div>
-                       <xsl:value-of disable-output-escaping="yes" 
select="tabs" />
-                       <xsl:call-template name="control_groups" />
-               </xsl:when>
-               <xsl:when test="view = 'control_locations'">
-                       <div class="identifier-header">
-                               <h1><xsl:value-of select="php:function('lang', 
'Control_locations')"/> for <xsl:value-of select="control/title" /></h1>
-                       </div>
-                       <xsl:value-of disable-output-escaping="yes" 
select="tabs" />
-                       <xsl:call-template name="control_locations" />
-               </xsl:when>
-               <xsl:when test="view = 'control_component'">
-                       <div class="identifier-header">
-                               <h1><xsl:value-of select="php:function('lang', 
'Control_component')"/> for <xsl:value-of select="control/title" /></h1>
-                       </div>
-                       <xsl:value-of disable-output-escaping="yes" 
select="tabs" />
-                       <xsl:call-template name="control_component" />
-               </xsl:when>
-               <xsl:when test="view = 'control_items'">
-                       <div class="identifier-header">
-                               <h1><xsl:value-of select="php:function('lang', 
'Control_items')"/> for <xsl:value-of select="control/title" /></h1>
-                       </div>
-                       <xsl:value-of disable-output-escaping="yes" 
select="tabs" />
-                       <xsl:call-template name="control_items" />
-               </xsl:when>
-               <xsl:when test="view = 'sort_check_list'">
-                       <div class="identifier-header">
-                               <h1><xsl:value-of select="php:function('lang', 
'Check_list')"/> for <xsl:value-of select="control/title" /></h1>
-                       </div>
-                       <xsl:value-of disable-output-escaping="yes" 
select="tabs" />
-                       <xsl:call-template name="sort_check_list" />
-               </xsl:when>
-       </xsl:choose>
-</div>
-       
-</xsl:template>

Modified: 
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-05 18:16:12 UTC (rev 8501)
+++ 
branches/Version-1_0-branch/controller/templates/base/create_error_report_message.xsl
       2012-01-05 18:22:42 UTC (rev 8502)
@@ -75,7 +75,7 @@
                                        
                                          <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="{$lang_save}" title="{$lang_save}" />
+                                               <input class="btn" 
type="submit" name="save_control" value="Registrer avviksmelding" 
title="{$lang_save}" />
                                          </div>
                                </form>                 
                                </xsl:when>

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-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/controller/templates/base/css/base.css  
2012-01-05 18:22:42 UTC (rev 8502)
@@ -1027,7 +1027,7 @@
 .tab_menu {
     overflow: hidden;
 }
-.tab_menu a {
+.tab_menu a, .hor_menu a {
     background: none repeat scroll 0 0 #FAFAFA;
     border-left: 1px solid #A3A3A3;
     border-right: 1px solid #A3A3A3;
@@ -1044,13 +1044,19 @@
     text-decoration: none;
     width: 150px;
 }
-.tab_menu a.active {
+.hor_menu a {
+       border-bottom: 1px solid #A3A3A3;
+}
+.tab_menu a.active, .hor_menu a.active {
        background: #2647A0;
        border-left: 1px solid #173073;
        border-right: 1px solid #173073;
        border-top: 1px solid #173073;
        color: #FFF;
 }
+.hor_menu a.active {
+       border-bottom: 1px solid #173073;
+}
 .tab_item {
     background: none repeat scroll 0 0 #EDF5FF;
     border: 1px solid #A3A3A3;
@@ -1149,14 +1155,14 @@
 }
 #error_message_menu a {
     text-align: center;
-    width: 130px;
+    width: 140px;
     margin: 2px 0;  
     display:block;
 }
 
 #view_errors {
        float:left;
-    margin: 20px 0 0 20px;   
+    margin: 20px 0 0 10px;   
 }
 #register_errors {
        display:none;
@@ -1166,4 +1172,20 @@
 
 a#view_errors_measurements{
        display:none;
+}
+#edit_check_list_menu a{
+               float:left;
+               width: 150px;
+               text-align:center;
+}
+#edit_check_list_menu{
+               height:30px;
+               margin:0 0 20px 0;
+}
+.content_wrp {
+       background: none repeat scroll 0 0 #EDF5FF;
+    border: 1px solid #DDDDDD;
+    margin-bottom: 20px;
+    padding: 15px;
+    width: 800px;
 }
\ No newline at end of file

Deleted: 
branches/Version-1_0-branch/controller/templates/base/edit_check_list.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/edit_check_list.xsl   
2012-01-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/controller/templates/base/edit_check_list.xsl   
2012-01-05 18:22:42 UTC (rev 8502)
@@ -1,429 +0,0 @@
-<!-- $Id$ -->
-<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">
-               
-       <script>
-               $(function() {
-                       $( "#planned_date" ).datepicker({ 
-                               monthNames: 
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
-                               dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 
'Fr', 'Lø'],
-                               dateFormat: 'dd/mm-yy' 
-                       });
-                       $( "#completed_date" ).datepicker({ 
-                               monthNames: 
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
-                               dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 
'Fr', 'Lø'],
-                               dateFormat: 'dd/mm-yy' 
-                       });
-                       $( "#deadline_date" ).datepicker({ 
-                               monthNames: 
['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember'],
-                               dayNamesMin: ['Sø', 'Ma', 'Ti', 'On', 'To', 
'Fr', 'Lø'],
-                               dateFormat: 'dd/mm-yy' 
-                       });
-                       
-                       $(".tab_menu a").click(function(){
-                               var thisTabA = $(this);
-                               var thisTabMenu = $(this).parent(".tab_menu");
-                                                               
-                               var showId = $(thisTabA).attr("href");
-                               var hideId = 
$(thisTabMenu).find("a.active").attr("href");
-                                                       
-                               $(thisTabMenu).find("a").removeClass("active");
-                               $(thisTabA).addClass('active');
-                                                                               
                
-                               $(hideId).hide();
-                               $(hideId).removeClass("active")
-                               $(showId).fadeIn('10', function(){
-                                       $(showId).addClass('active');
-                                       
-                               });
-                       
-                               return false;
-                       });
-                                               
-                       $("#reg_errors").click(function(){
-                               var thisA = $(this);
-                               var showId = $(thisA).attr("href");
-                               var hideId = "#view_errors";
-                                                                       
-                               $(hideId).hide();
-                               $(showId).fadeIn('10');
-                               $(thisA).hide();
-                               $("a#view_errors_measurements").css("display", 
"block");
-                       
-                               return false;
-                       });
-                       
-                       $("#view_errors_measurements").click(function(){
-                               var thisA = $(this);
-                               var showId = $(thisA).attr("href");
-                               var hideId = "#register_errors";
-                                                                       
-                               $(hideId).hide();
-                               $(showId).fadeIn('10');
-                               $(thisA).hide();
-                               $("a#reg_errors").css("display", "block");
-                       
-                               return false;
-                       });
-                       
-               });
-       </script>
-               
-               <h1>Sjekkliste for <xsl:value-of 
select="location_array/loc1_name"/></h1>
-               
-               <div class="tab_menu"><a class="active">Detaljer</a></div>
-               <fieldset class="check_list_details">
-               
-               <form id="frm_update_check_list" 
action="index.php?menuaction=controller.uicheck_list.update_check_list" 
method="post">
-                               
-                       <xsl:variable name="check_list_id"><xsl:value-of 
select="check_list/id"/></xsl:variable>
-                       <input type="hidden" name="check_list_id" 
value="{$check_list_id}" />
-                               
-                       <div>
-                               <label>ID</label>
-                               <input>
-                            <xsl:attribute 
name="name">check_list_id</xsl:attribute>
-                            <xsl:attribute name="value"><xsl:value-of 
select="check_list/id"/></xsl:attribute>
-                           </input>
-                   </div>
-                       <div>
-                               <label>Status</label>
-                               <xsl:variable name="status"><xsl:value-of 
select="check_list/status"/></xsl:variable>
-                               <select name="status">
-                                       <xsl:choose>
-                                               <xsl:when 
test="check_list/status = 0">
-                                                       <option value="0" 
SELECTED="SELECTED">Ikke utført</option>
-                                                       <option value="1" 
>Utført</option>
-                                               </xsl:when>
-                                               <xsl:when 
test="check_list/status = 1">
-                                                       <option value="0">Ikke 
utført</option>
-                                                       <option value="1" 
SELECTED="SELECTED">Utført</option>
-                                               </xsl:when>
-                                       </xsl:choose>
-                               </select>
-                       </div>
-                       <div>
-                               <label>Skal utføres innen</label>
-                               <input>
-                             <xsl:attribute 
name="id">deadline_date</xsl:attribute>
-                             <xsl:attribute 
name="name">deadline_date</xsl:attribute>
-                             <xsl:attribute name="type">text</xsl:attribute>
-                             <xsl:if test="check_list/deadline != 0">
-                               <xsl:attribute name="value"><xsl:value-of 
select="php:function('date', $date_format, 
number(check_list/deadline))"/></xsl:attribute>
-                                 </xsl:if>
-                           </input>
-                       </div>
-                       <div>
-                               <label>Planlagt dato</label>
-                               <input>
-                             <xsl:attribute 
name="id">planned_date</xsl:attribute>
-                             <xsl:attribute 
name="name">planned_date</xsl:attribute>
-                             <xsl:attribute name="type">text</xsl:attribute>
-                             <xsl:if test="check_list/planned_date != 0">
-                               <xsl:attribute name="value"><xsl:value-of 
select="php:function('date', $date_format, 
number(check_list/planned_date))"/></xsl:attribute>
-                             </xsl:if>
-                           </input>
-                   </div>
-                   <div>
-                               <label>Utført dato</label>
-                               <input>
-                             <xsl:attribute 
name="id">completed_date</xsl:attribute>
-                             <xsl:attribute 
name="name">completed_date</xsl:attribute>
-                             <xsl:attribute name="type">text</xsl:attribute>
-                                 <xsl:if test="check_list/completed_date != 0">
-                               <xsl:attribute name="value"><xsl:value-of 
select="php:function('date', $date_format, 
number(check_list/completed_date))"/></xsl:attribute>
-                             </xsl:if>
-                           </input>
-                   </div>
-                       <div>
-                               <label class="comment">Kommentar</label>
-                               <textarea>
-                                 <xsl:attribute 
name="name">comment</xsl:attribute>
-                                 <xsl:value-of select="check_list/comment"/>
-                               </textarea>
-                       </div>
-                       
-                       <div class="form-buttons">
-                               <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_list')" /></xsl:variable>
-                               <input style="width: 170px;" class="btn 
not_active" type="submit" name="save_control" value="Lagre detaljer" />
-                       </div>
-                       </form>
-               </fieldset>
-               
-               <div id="error_message_menu">
-                       <a class="btn">
-                               <xsl:attribute name="id">
-                                       <xsl:text>reg_errors</xsl:text>
-                               </xsl:attribute>                                
        
-                               <xsl:attribute name="href">
-                                       <xsl:text>#register_errors</xsl:text>
-                               </xsl:attribute>
-                               Registrer avvik/måling
-                       </a>
-                       <a class="btn">
-                               <xsl:attribute name="id">
-                                       
<xsl:text>view_errors_measurements</xsl:text>
-                               </xsl:attribute>                                
        
-                               <xsl:attribute name="href">
-                                       <xsl:text>#view_errors</xsl:text>
-                               </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>
-                               Send avviksmelding
-                       </a>
-               </div>
-               
-               <div id="register_errors">
-                       <div class="tab_menu"><a class="active">Registrer 
avvik/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>
-               
-               <div id="view_errors">
-               
-               <div class="tab_menu">
-                       <a class="active" href="#view_open_errors">Vis åpne 
avvik</a>
-                       <a href="#view_handled_errors">Vis håndterte avvik</a>
-                       <a href="#view_measurements">Vis målinger</a>
-               </div>  
-               
-               <div id="view_open_errors" 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 
class="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 id="view_handled_errors" 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 
class="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">Feil på 
sjekkpunkt</option>
-                                                                               
                                <option value="1">Feil fikset</option>
-                                                                               
                        </xsl:when>
-                                                                               
                        <xsl:when test="status = 1">
-                                                                               
                                <option value="0">Feil på sjekkpunkt</option>
-                                                                               
                                <option value="1" SELECTED="SELECTED">Feil 
fikset</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 id="view_measurements" class="tab_item">
-                       <xsl:choose>
-                               <xsl:when 
test="measurement_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="measurement_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 
class="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}" />
-                                                                               
<input type="hidden" name="type" value="measurement" />
-                                                                               
 
-                                                                               
<div class="check_item">
-                                                                               
  <div>
-                                                                               
       <label>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', 'save_check_item')" /></xsl:variable>
-                                                                               
                <input type="submit" name="save_control" value="Oppdatert 
registert måling" class="not_active" title="{$lang_save}" />
-                                                                               
        </div>
-                                                                               
</div>
-                                                                       </form>
-                                                               </xsl:if>
-                                                   </li>
-                                               </xsl:for-each>
-                                       </ul>                   
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               Ingen registrerte målinger
-                                       </xsl:otherwise>
-                       </xsl:choose>
-               </div>
-               
-       </div>
-</div>
-</xsl:template>

Deleted: 
branches/Version-1_0-branch/controller/templates/base/procedure_documents.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/procedure_documents.xsl   
    2012-01-05 18:16:12 UTC (rev 8501)
+++ 
branches/Version-1_0-branch/controller/templates/base/procedure_documents.xsl   
    2012-01-05 18:22:42 UTC (rev 8502)
@@ -1,61 +0,0 @@
-<!-- $Id$ -->
-<!-- document  -->
-
-<xsl:template name="view_procedure_documents" xmlns:php="http://php.net/xsl";>
-
-<xsl:variable name="dateformat"><xsl:value-of select="dateformat" 
/></xsl:variable>
-
-<div class="yui-content">
-               <div id="details">
-                       <form enctype="multipart/form-data" 
action="?menuaction=controller.uidocument.add" method="POST">
-                               <xsl:variable name="lang_upload"><xsl:value-of 
select="php:function('lang', 'upload')" /></xsl:variable>
-                               <input type="hidden" name="procedure_id" value 
= "{procedure_id}" />
-                               <input type="hidden" name="document_type" 
value="1" />
-                               <fieldset>
-                                       <h3><xsl:value-of 
select="php:function('lang','upload')" /></h3>
-                                       <input type="file" id="file_path" 
name="file_path" />
-                                       <xsl:value-of 
select="php:function('lang','title')" />:
-                                       <input type="text" id="document_title" 
name="document_title" /><br/>
-                                       <xsl:value-of 
select="php:function('lang','description')" />:
-                                       <textarea id="document_description" 
name="document_description" rows="5" cols="60"></textarea>
-                                       <input type="submit" id="upload_button" 
value="{$lang_upload}" />
-                               </fieldset>
-                       </form>
-               </div>
-               <div id="details">
-                       <table cellpadding="10" cellspacing="10" align="left" 
style="margin-left: 1em;">
-                               <xsl:call-template 
name="table_header_documents"/>
-                               <xsl:call-template name="values_documents"/>
-                       </table>
-               </div>
-       </div>
-</xsl:template>
-
-<xsl:template name="table_header_documents">
-       <tr class="th">
-               <xsl:for-each select="table_header" >
-                       <td class="th_text" style="padding-right: 10px;">
-                               <xsl:value-of select="header"/>
-                       </td>
-               </xsl:for-each>
-       </tr>
-</xsl:template>
-
-<xsl:template name="values_documents">
-       <xsl:for-each select="values" >
-               <tr>
-                       <xsl:for-each select="document" >
-                               <xsl:variable name="doc_link"><xsl:value-of 
select='link'/></xsl:variable>
-                               <td align="left" style="padding-right: 10px;">
-                                       <a href="{$doc_link}"><xsl:value-of 
select="title"/></a>
-                               </td>
-                               <td align="left" style="padding-right: 10px;">
-                                       <xsl:value-of select="name"/>
-                               </td>
-                               <td align="left" style="padding-right: 10px;">
-                                       <xsl:value-of select="description" 
disable-output-escaping="yes"/>
-                               </td>
-                       </xsl:for-each>
-               </tr>
-       </xsl:for-each>
-</xsl:template>
\ No newline at end of file

Deleted: 
branches/Version-1_0-branch/controller/templates/base/procedure_item.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/procedure_item.xsl    
2012-01-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/controller/templates/base/procedure_item.xsl    
2012-01-05 18:22:42 UTC (rev 8502)
@@ -1,235 +0,0 @@
-<!-- $Id$ -->
-<!-- item  -->
-
-<xsl:template name="view_procedure" xmlns:php="http://php.net/xsl";>
-
-<xsl:call-template name="yui_booking_i18n"/>
-<xsl:variable name="dateformat"><xsl:value-of select="dateformat" 
/></xsl:variable>
-
-<div class="yui-content">
-               <div id="details">
-                       <form action="#" method="post">
-                               <input type="hidden" name="id" value = 
"{value_id}">
-                               </input>
-                               <dl class="proplist-col">
-                                       <dt>
-                                               <label 
for="title"><xsl:value-of select="php:function('lang','Procedure title')" 
/></label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <input type="text" 
name="title" id="title" value="{procedure/title}" size="100"/>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:value-of 
select="procedure/title" />
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>
-                                       <dt>
-                                               <label 
for="revision_no"><xsl:value-of select="php:function('lang','Procedure 
revision')" /></label>
-                                       </dt>
-                                       <dd>
-                                               <xsl:value-of 
select="procedure/revision_no" />
-                                       </dd>
-                                       <dt>
-                                               <label 
for="control_area"><xsl:value-of select="php:function('lang','Control area')" 
/></label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <select 
id="control_area" name="control_area">
-                                                               <option 
value="0">Ingen valgt</option>
-                                                               
<xsl:apply-templates select="control_area/options"/>
-                                                       </select>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:value-of 
select="procedure/control_area_name" />
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>
-                                       <dt>
-                                               <label 
for="start_date"><xsl:value-of select="php:function('lang','Procedure start 
date')" /></label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <xsl:value-of 
disable-output-escaping="yes" select="start_date"/>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:variable 
name="startdate"><xsl:value-of select="procedure/start_date" /></xsl:variable>
-                                                       <xsl:value-of 
select="php:function('date', $dateformat, $startdate)" />
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>
-                                       <dt>
-                                               <label 
for="revision_date"><xsl:value-of select="php:function('lang','Procedure 
revision date')" /></label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <xsl:value-of 
disable-output-escaping="yes" select="revision_date"/>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:if 
test="procedure/revision_date != 0">
-                                                               <xsl:variable 
name="revisiondate"><xsl:value-of select="procedure/revision_date" 
/></xsl:variable>
-                                                               <xsl:value-of 
select="php:function('date', $dateformat, $revisiondate)" />
-                                                       </xsl:if>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>
-                                       <xsl:if test="procedure/end_date != 0">
-                                       <dt>
-                                               <label 
for="end_date"><xsl:value-of select="php:function('lang','Procedure end date')" 
/></label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <xsl:value-of 
disable-output-escaping="yes" select="end_date"/>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:variable 
name="enddate"><xsl:value-of select="procedure/end_date" /></xsl:variable>
-                                                       <xsl:value-of 
select="php:function('date', $dateformat, $enddate)" />
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>
-                                       </xsl:if>
-                                       <dt>
-                                               <label 
for="purpose"><xsl:value-of select="php:function('lang','Procedure purpose')" 
/></label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <textarea id="purpose" 
name="purpose" rows="5" cols="60"><xsl:value-of select="procedure/purpose" 
disable-output-escaping="yes"/></textarea>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:value-of 
select="procedure/purpose" disable-output-escaping="yes"/>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>
-                                       <dt>
-                                               <label 
for="responsibility"><xsl:value-of select="php:function('lang','Procedure 
responsibility')" /></label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <textarea 
id="responsibility" name="responsibility" rows="5" cols="60"><xsl:value-of 
select="procedure/responsibility" /></textarea>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:value-of 
select="procedure/responsibility" />
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>
-                                       <dt>
-                                               <label 
for="description"><xsl:value-of select="php:function('lang','Procedure 
description')" /></label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <textarea 
id="description" name="description" rows="5" cols="60"><xsl:value-of 
select="procedure/description" disable-output-escaping="yes"/></textarea>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:value-of 
select="procedure/description" disable-output-escaping="yes"/>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>
-                                       <dt>
-                                               <label 
for="reference"><xsl:value-of select="php:function('lang','Procedure 
Reference')" /></label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <input type="text" 
name="reference" id="reference" value="{procedure/reference}"  />
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:value-of 
select="procedure/reference" />
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>   
-                                       <dt>
-                                       <label for="attachment"><xsl:value-of 
select="php:function('lang','Procedure Attachment')" /></label>
-                                       </dt>
-                                       <dd>
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <input type="text" 
name="attachment" id="attachment" value="{procedure/attachment}"  />
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:value-of 
select="procedure/attachment" />
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                                       </dd>                   
-                               </dl>
-                               
-                               <div class="form-buttons">
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <xsl:variable 
name="lang_save"><xsl:value-of select="php:function('lang', 'save')" 
/></xsl:variable>
-                                                       <xsl:variable 
name="lang_revisit"><xsl:value-of select="php:function('lang', 'revisit')" 
/></xsl:variable>
-                                                       <xsl:variable 
name="lang_cancel"><xsl:value-of select="php:function('lang', 'cancel')" 
/></xsl:variable>
-                                                       <input type="submit" 
name="save_procedure" value="{$lang_save}" title = "{$lang_save}" />
-                                                       <input type="submit" 
name="revisit_procedure" value="{$lang_revisit}" title = "{$lang_revisit}" />
-                                                       <input type="submit" 
name="cancel_procedure" value="{$lang_cancel}" title = "{$lang_cancel}" />
-                                               </xsl:when>
-                                               <xsl:when test="inactive">
-                                                       <xsl:variable 
name="lang_back"><xsl:value-of select="php:function('lang', 'back')" 
/></xsl:variable>
-                                                       <input type="button" 
value="{$lang_back}" title="{$lang_back}" onclick="javascript: history.go(-1);" 
style="margin: 0 0 15px 15px; padding: 1px 15px;"/>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:variable 
name="lang_edit"><xsl:value-of select="php:function('lang', 'edit')" 
/></xsl:variable>
-                                                       <input type="submit" 
name="edit_procedure" value="{$lang_edit}" title = "{$lang_edit}" />
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                               </div>
-                       </form>
-                       <xsl:choose>
-                               <xsl:when test="values != ''">
-                                       <table cellpadding="10" 
cellspacing="10" align="left" style="margin-left: 1em;">
-                                               <xsl:call-template 
name="table_header_history"/>
-                                               <xsl:call-template 
name="values_history"/>
-                                       </table>
-                               </xsl:when>
-                       </xsl:choose>
-               </div>
-       </div>
-</xsl:template>
-
-<xsl:template name="table_header_history">
-               <tr class="th">
-                       <xsl:for-each select="table_header" >
-                               <td class="th_text" style="padding-right: 
10px;">
-                                       <xsl:value-of select="header"/>
-                               </td>
-                       </xsl:for-each>
-               </tr>
-       </xsl:template>
-
-       <xsl:template name="values_history">
-               <xsl:for-each select="values" >
-                       <tr>
-                               <xsl:for-each select="row" >
-                                       <xsl:variable 
name="proc_link"><xsl:value-of select='link'/></xsl:variable>
-                                       <td align="right" style="padding-right: 
10px;">
-                                               <a 
href="{$proc_link}"><xsl:value-of select="revision_no"/></a>
-                                       </td>
-                                       <td align="left" style="padding-right: 
10px;">
-                                               <xsl:value-of select="title"/>
-                                       </td>
-                                       <td align="left" style="padding-right: 
10px;">
-                                               <xsl:value-of 
select="start_date"/>
-                                       </td>
-                                       <td align="left" style="padding-right: 
10px;">
-                                               <xsl:value-of 
select="end_date"/>
-                                       </td>
-                               </xsl:for-each>
-                       </tr>
-               </xsl:for-each>
-       </xsl:template>
-       
-       <xsl:template match="options">
-               <option value="{id}">
-                       <xsl:if test="selected != 0">
-                               <xsl:attribute name="selected" value="selected" 
/>
-                       </xsl:if>
-                       <xsl:value-of disable-output-escaping="yes" 
select="name"/>
-               </option>
-       </xsl:template>

Deleted: 
branches/Version-1_0-branch/controller/templates/base/procedure_tabs.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/procedure_tabs.xsl    
2012-01-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/controller/templates/base/procedure_tabs.xsl    
2012-01-05 18:22:42 UTC (rev 8502)
@@ -1,32 +0,0 @@
-<!-- $Id$ -->
-<!-- separate tabs and  inline tables-->
-
-<xsl:template match="data" xmlns:php="http://php.net/xsl";>
-<xsl:call-template name="yui_booking_i18n"/>
-<div class="yui-navset yui-navset-top" id="procedure_tabview">
-       <xsl:choose>
-               <xsl:when test="view = 'view_procedure'">
-                       <div class="identifier-header">
-                               <h1><img src="{img_go_home}" /> 
-                                               <xsl:value-of 
select="php:function('lang', 'Procedure')" />
-                               </h1>
-                       </div>
-                       <!-- Prints tabs array -->
-                       <xsl:value-of disable-output-escaping="yes" 
select="tabs" />
-                        
-                       <xsl:call-template name="view_procedure" />
-               </xsl:when>
-               <xsl:when test="view = 'view_documents_for_procedure'">
-                       <div class="identifier-header">
-                               <h1><img src="{img_go_home}" /> 
-                                               <xsl:value-of 
select="php:function('lang', 'Procedure')" />
-                               </h1>
-                       </div>
-                       <!-- Prints tabs array -->
-                       <xsl:value-of disable-output-escaping="yes" 
select="tabs" />
-                       <xsl:call-template name="view_procedure_documents" />
-               </xsl:when>
-       </xsl:choose>
-</div>
-       
-</xsl:template>
\ No newline at end of file

Deleted: 
branches/Version-1_0-branch/controller/templates/base/sort_check_list.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/sort_check_list.xsl   
2012-01-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/controller/templates/base/sort_check_list.xsl   
2012-01-05 18:22:42 UTC (rev 8502)
@@ -1,60 +0,0 @@
-<!-- $Id$ -->
-<xsl:template name="sort_check_list" xmlns:php="http://php.net/xsl";>
-
-<div class="yui-content tab_content">
-               
-         <!-- ===========================  SHOWS CONTROL ITEMS RECEIPT   
=============================== -->
-
-               <xsl:variable name="control_id"><xsl:value-of 
select="control_id"/></xsl:variable>
-               <input type="hidden" id="control_id" name="control_id" 
value="{control_id}" />
-               
-               <ul class="groups">
-                       <xsl:for-each select="saved_groups_with_items_array">
-                               <li class="drag_group list_item">
-                                       <h3><span 
class="group_order_nr"><xsl:number/></span>. <xsl:value-of 
select="control_group/group_name"/></h3>
-                       
-                                       <form 
action="index.php?menuaction=controller.uicontrol_item.save_item_order" 
class="frm_save_order">
-                                               <xsl:variable 
name="control_group_id"><xsl:value-of select="control_group/id"/></xsl:variable>
-                                               <input type="hidden" 
name="control_group_id" value="{$control_group_id}" />
-                               
-                                               <ul id="list">
-                                                       <xsl:for-each 
select="control_items">
-                                                               <xsl:variable 
name="control_item_id"><xsl:value-of select="id"/></xsl:variable>
-                                                               <xsl:variable 
name="order_tag">
-                                                                       
<xsl:choose>
-                                                                               
<xsl:when test="order_nr > 0">
-                                                                               
        <xsl:value-of select="order_nr"/>
-                                                                               
</xsl:when>
-                                                                               
<xsl:otherwise>
-                                                                               
        <xsl:number/>
-                                                                               
</xsl:otherwise>
-                                                                       
</xsl:choose>:<xsl:value-of select="id"/>
-                                                               </xsl:variable>
-                                                                               
                                                
-                                                               <li 
class="list_item">
-                                                                       <span 
class="drag">
-                                                                               
<span class="order_nr"><xsl:number/></span>. <xsl:value-of 
select="title"/><input type="hidden" name="order_nr[]" value="{$order_tag}" />
-                                                                       </span>
-                                                                       <a 
class="delete">
-                                                                               
<xsl:attribute name="href">
-                                                                               
        
<xsl:text>index.php?menuaction=controller.uicontrol_item.delete_item_list</xsl:text>
-                                                                               
        <xsl:text>&amp;control_id=</xsl:text>
-                                                                               
        <xsl:value-of select="//control_id"/>
-                                                                               
        <xsl:text>&amp;control_item_id=</xsl:text>
-                                                                               
        <xsl:value-of select="id"/>
-                                                                               
</xsl:attribute>
-                                                                               
<span>x</span>
-                                                                       </a>
-                                                               </li>
-                                                       </xsl:for-each>
-                                               </ul>
-                                               <div>
-                                                       <xsl:variable 
name="lang_save"><xsl:value-of select="php:function('lang', 'save_order')" 
/></xsl:variable>
-                                                       <input type="submit" 
id="save_order" name="save_order" value="{$lang_save}" title = "{$lang_save}" 
style="opacity: 0.5;" disabled="disabled"/>
-                                               </div>
-                                       </form>
-                               </li>
-                       </xsl:for-each>
-               </ul>
-</div>
-</xsl:template>

Modified: 
branches/Version-1_0-branch/controller/templates/base/view_calendar_month.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/view_calendar_month.xsl   
    2012-01-05 18:16:12 UTC (rev 8501)
+++ 
branches/Version-1_0-branch/controller/templates/base/view_calendar_month.xsl   
    2012-01-05 18:22:42 UTC (rev 8502)
@@ -67,8 +67,8 @@
                                <li class="heading">
                                        <div class="id">ID</div>
                                        <div class="title">Tittel</div>
-                                       <div class="date">Start dato</div>
-                                       <div class="date">Slutt dato</div>
+                                       <div class="date">Startdato</div>
+                                       <div class="date">Sluttdato</div>
                                        <div 
class="frequency">Frekvenstype</div>
                                        <div 
class="frequency">Frekvensintervall</div>
                                </li>

Deleted: 
branches/Version-1_0-branch/controller/templates/base/view_check_list.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/view_check_list.xsl   
2012-01-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/controller/templates/base/view_check_list.xsl   
2012-01-05 18:22:42 UTC (rev 8502)
@@ -1,64 +0,0 @@
-<!-- $Id$ -->
-<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">
-               
-         <!-- ===========================  SHOWS CONTROL ITEMS RECEIPT   
=============================== -->
-               
-               <h1>Sjekkliste</h1>
-               <fieldset class="control_details">
-                       <label>Tittel</label><xsl:value-of 
select="check_list/status"/><br/>
-                       <label>Kommentar</label><xsl:value-of 
select="check_list/comment"/><br/>
-                       <label>Skal utføres innen</label>
-                       <xsl:if test="check_list/deadline != ''">
-                               <xsl:value-of select="php:function('date', 
$date_format, number(check_list/deadline))"/><br/>
-                       </xsl:if>
-               </fieldset>
-                               
-               <h2>Sjekkpunkter</h2>
-               <ul class="check_list">
-                       <li class="heading">
-                               <div class="status">Status</div>
-                               <div class="title">Tittel for 
kontrollpunkt</div>
-                               <div>Kommentar</div>
-                       </li>
-                       
-                       <xsl:choose>
-                               <xsl:when 
test="check_list/check_item_array/child::node()">
-                                       <xsl:for-each 
select="check_list/check_item_array">
-                                               <li>
-                                                  <div 
class="order_nr"><xsl:number/>.</div>
-                                                  <div class="status">
-                                                        <xsl:variable 
name="status"><xsl:value-of select="status"/></xsl:variable>     
-                                                        <xsl:choose>
-                                                               <xsl:when 
test="status = 1">
-                                                                       <img 
height="15" src="controller/images/status_icon_light_green.png" /> 
-                                                               </xsl:when>
-                                                               <xsl:otherwise>
-                                                                       <img 
height="15" src="controller/images/status_icon_red.png" />
-                                                               </xsl:otherwise>
-                                                       </xsl:choose>
-                                                  </div>
-                                                  <div 
class="title"><xsl:value-of select="control_item/title"/></div>
-                                                  <div><xsl:value-of 
select="comment"/></div>
-                                               </li>
-                                       </xsl:for-each>
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       Ingen sjekklister for denne kontrollen
-                               </xsl:otherwise>
-                       </xsl:choose>
-               </ul>
-               
-               <a>
-                       <xsl:attribute name="href">
-                       
<xsl:text>index.php?menuaction=controller.uicheck_list.edit_check_list</xsl:text>
-                               <xsl:text>&amp;check_list_id=</xsl:text>
-                               <xsl:value-of select="check_list/id"/>
-                       </xsl:attribute>
-                       <div>Registrer sjekkliste</div>
-               </a>
-               
-</div>
-</xsl:template>

Deleted: 
branches/Version-1_0-branch/controller/templates/base/view_check_lists.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/view_check_lists.xsl  
2012-01-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/controller/templates/base/view_check_lists.xsl  
2012-01-05 18:22:42 UTC (rev 8502)
@@ -1,93 +0,0 @@
-<!-- $Id$ -->
-<xsl:template match="data" name="view_check_lists" 
xmlns:php="http://php.net/xsl";>
-<xsl:variable name="date_format">d/m-Y</xsl:variable>
-
-<div id="main_content">
-               
-         <!-- ===========================  SHOWS CONTROL ITEMS RECEIPT   
=============================== -->
-               <xsl:variable name="control_id"><xsl:value-of 
select="control_id"/></xsl:variable>      
-               <input type="hidden" id="control_id" name="control_id" 
value="{control_id}" />
-               
-               <h1>Sjekklister for kontroll</h1>
-               <fieldset class="check_list_details">
-                       <label>Tittel</label><xsl:value-of 
select="control_as_array/title"/><br/>
-                       <label>Startdato</label>
-                       <xsl:if test="control_as_array/start_date != 0">
-                               <xsl:value-of select="php:function('date', 
$date_format, number(control_as_array/start_date))"/><br/>
-                       </xsl:if>
-                       <label>Sluttdato</label>
-                       <xsl:if test="control_as_array/end_date != 0">
-                               <xsl:value-of select="php:function('date', 
$date_format, number(control_as_array/end_date))"/><br/>
-                       </xsl:if>
-                       <label>Frekvenstype</label><xsl:value-of 
select="control_as_array/repeat_type"/><br/>
-                       <label>Frekvens</label><xsl:value-of 
select="control_as_array/repeat_interval"/><br/>
-               </fieldset>
-               
-               <h2>Sjekklister</h2>
-               <ul class="check_list">
-                       <li class="heading">
-                               <div class="status">Status</div>
-                               <div>Skal utføres innen dato</div>
-                               <div>Planlagt utført dato</div>
-                               <div>Ble utført dato</div>
-                               <div>Kommentar</div>
-                       </li>
-                       <xsl:choose>
-                               <xsl:when test="check_list_array/child::node()">
-                                       <xsl:for-each select="check_list_array">
-                                               <li>
-                                                  <div 
class="order_nr"><xsl:number/>.</div>
-                                                  <div class="status">
-                                                        <xsl:variable 
name="status"><xsl:value-of select="status"/></xsl:variable>     
-                                                        <xsl:choose>
-                                                               <xsl:when 
test="status = 1">
-                                                                       <img 
height="15" src="controller/images/status_icon_light_green.png" /> 
-                                                               </xsl:when>
-                                                               <xsl:otherwise>
-                                                                       <img 
height="15" src="controller/images/status_icon_red.png" />
-                                                               </xsl:otherwise>
-                                                       </xsl:choose>
-                                                  </div>
-                                                  <div>
-                                                          <a>
-                                                                       
<xsl:attribute name="href">
-                                                                               
<xsl:text>index.php?menuaction=controller.uicheck_list.view_check_list</xsl:text>
-                                                                               
<xsl:text>&amp;check_list_id=</xsl:text>
-                                                                               
        <xsl:value-of select="id"/>
-                                                                       
</xsl:attribute>
-                                                                       <xsl:if 
test="deadline != ''">
-                                                                               
<xsl:value-of select="php:function('date', $date_format, number(deadline))"/>
-                                                                       
</xsl:if>
-                                                               </a>    
-                                                       </div>
-                                                  <div>
-                                                               <xsl:if 
test="planned_date != ''">
-                                                                       
<xsl:value-of select="php:function('date', $date_format, 
number(planned_date))"/>
-                                                               </xsl:if>       
        
-                                                  </div>
-                                                  <div>
-                                                               <xsl:if 
test="completed_date != ''">
-                                                                       
<xsl:value-of select="php:function('date', $date_format, 
number(completed_date))"/>
-                                                               </xsl:if>
-                                                  </div>
-                                                  <div><xsl:value-of 
select="comment"/></div>
-                                               </li>
-                                       </xsl:for-each>
-                               </xsl:when>
-                               <xsl:otherwise>
-                                       Ingen sjekklister for denne kontrollen
-                               </xsl:otherwise>
-                       </xsl:choose>
-               </ul>
-                <a>
-                       <xsl:attribute name="href">
-                               
<xsl:text>index.php?menuaction=controller.uicheck_list.control_calendar_status_overview</xsl:text>
-                               <xsl:text>&amp;control_id=</xsl:text>
-                                       <xsl:value-of 
select="control_as_array/id"/>
-                       </xsl:attribute>
-                       <div style="margin-top:30px">
-                               Se kalenderoversikt for kontroll
-                       </div>
-               </a>
-</div>
-</xsl:template>

Deleted: 
branches/Version-1_0-branch/controller/templates/base/view_control_item_list.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/view_control_item_list.xsl
    2012-01-05 18:16:12 UTC (rev 8501)
+++ 
branches/Version-1_0-branch/controller/templates/base/view_control_item_list.xsl
    2012-01-05 18:22:42 UTC (rev 8502)
@@ -1,62 +0,0 @@
-<!-- $Id$ -->
-<xsl:template match="data" name="view_check_list" 
xmlns:php="http://php.net/xsl";>
-
-<div id="main_content">
-               
-         <!-- ===========================  SHOWS CONTROL ITEMS RECEIPT   
=============================== -->
-
-               <xsl:variable name="control_id"><xsl:value-of 
select="control_id"/></xsl:variable>      
-               <input type="hidden" id="control_id" name="control_id" 
value="{control_id}" />
-               
-               <fieldset>
-                       <label>Tittel</label><xsl:value-of 
select="control_as_array/title"/><br/>
-                       <label>Startdato</label><xsl:value-of 
select="control_as_array/start_date"/><br/>
-                       <label>Sluttdato</label><xsl:value-of 
select="control_as_array/end_date"/><br/>
-                       <label>Syklustype</label><xsl:value-of 
select="control_as_array/repeat_type"/><br/>
-                       <label>Syklusfrekvens</label><xsl:value-of 
select="control_as_array/repeat_interval"/><br/>
-               </fieldset>
-               
-               <ul class="check_list">
-                       <xsl:for-each select="saved_groups_with_items_array">
-                               <li>
-                                       <h3><span 
class="group_order_nr"><xsl:number/></span>. <xsl:value-of 
select="control_group/group_name"/></h3>
-                       
-                                       <xsl:variable 
name="control_group_id"><xsl:value-of select="control_group/id"/></xsl:variable>
-                                       <input type="hidden" 
name="control_group_id" value="{$control_group_id}" />
-                       
-                                       <ul id="list">
-                                               <xsl:for-each 
select="control_items">
-                                                       <xsl:variable 
name="control_item_id"><xsl:value-of select="id"/></xsl:variable>
-                                                       <xsl:variable 
name="order_tag">
-                                                               <xsl:choose>
-                                                                       
<xsl:when test="order_nr > 0">
-                                                                               
<xsl:value-of select="order_nr"/>
-                                                                       
</xsl:when>
-                                                                       
<xsl:otherwise>
-                                                                               
<xsl:number/>
-                                                                       
</xsl:otherwise>
-                                                               
</xsl:choose>:<xsl:value-of select="id"/>
-                                                       </xsl:variable>
-                                                                               
                                        
-                                                       <li>
-                                                               <span 
class="drag">
-                                                                       <span 
class="order_nr"><xsl:number/></span>. <xsl:value-of select="title"/><input 
type="hidden" name="order_nr[]" value="{$order_tag}" />
-                                                               </span>
-                                                       </li>
-                                               </xsl:for-each>
-                                       </ul>
-                               </li>
-                       </xsl:for-each>
-               </ul>
-               <div style="margin:20px 0;">
-                       <a  
style="text-decoration:underline;font-size:20px;color:#333;">
-                               <xsl:attribute name="href">
-                                       
<xsl:text>index.php?menuaction=controller.uicheck_list.save_check_list</xsl:text>
-                                       <xsl:text>&amp;control_id=</xsl:text>
-                                               <xsl:value-of 
select="control_as_array/id"/>
-                               </xsl:attribute>
-                               Lag sjekkliste for kontroll
-                       </a>            
-               </div>
-</div>
-</xsl:template>

Modified: branches/Version-1_0-branch/property/inc/class.bocommon.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.bocommon.inc.php     
2012-01-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/property/inc/class.bocommon.inc.php     
2012-01-05 18:22:42 UTC (rev 8502)
@@ -1164,11 +1164,11 @@
                                }
                                $cols.= ",fm_location1.loc1_name";
                                $this->join = $this->socommon->join;
-                               $joinmethod .= " $this->join  fm_location1 ON 
($entity_table.loc1 = fm_location1.loc1))";
+                               $joinmethod .= " {$this->join}  fm_location1 ON 
($entity_table.loc1 = fm_location1.loc1))";
                                $paranthesis .='(';
-                               $joinmethod .= " $this->join  fm_part_of_town 
ON (fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id))";
+                               $joinmethod .= " {$this->join}  fm_part_of_town 
ON (fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id))";
                                $paranthesis .='(';
-                               $joinmethod .= " $this->join  fm_owner ON 
(fm_location1.owner_id = fm_owner.id))";
+                               $joinmethod .= " {$this->join}  fm_owner ON 
(fm_location1.owner_id = fm_owner.id))";
                                $paranthesis .='(';
                        }
                        else
@@ -1177,10 +1177,26 @@
                                $no_address     = true;
                        }
                        $this->type_id  = $type_id;
-
-
+                       $_level = 1;
                        for ($i=0; $i<$type_id; $i++)
                        {
+                               if($_level > 1)
+                               {
+                                       $joinmethod .= " {$this->join} 
fm_location{$_level}";
+                                       $paranthesis .='(';
+                                       $on = 'ON';
+                                       for ($k=($_level-1); $k>0; $k--)
+                                       {
+                                               $joinmethod .= " $on 
(fm_location{$_level}.loc{$k} = fm_location" . ($_level-1) . ".loc{$k})";
+                                               $on = 'AND';
+                                               if($k==1)
+                                               {
+                                                       $joinmethod .= ")";
+                                               }
+                                       }
+                               }
+                               $_level ++;
+
                                $uicols['input_type'][]         = 'text';
                                $uicols['name'][]                       = 'loc' 
. $location_types[$i]['id'];
                                $uicols['descr'][]                      = 
$location_types[$i]['name'];
@@ -1192,7 +1208,7 @@
                                $uicols['classname'][]          = '';
                                $uicols['sortable'][]           = $i === 0;
                        }
-
+//_debug_array($joinmethod);die();
                        unset($soadmin_location);
 
                        for ($i=0; $i< $this->type_id; $i++)
@@ -1202,6 +1218,7 @@
 
                        $GLOBALS['phpgw']->config->read();
                        $list_location_level = 
isset($GLOBALS['phpgw']->config->config_data['list_location_level'])     && 
$GLOBALS['phpgw']->config->config_data['list_location_level'] ? 
$GLOBALS['phpgw']->config->config_data['list_location_level'] : array();
+
                        for ($i=1;$i<($type_id+1);$i++)
                        {
                                $cols_return[]                          = 
"loc{$i}_name";

Modified: branches/Version-1_0-branch/property/inc/class.borequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.borequest.inc.php    
2012-01-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/property/inc/class.borequest.inc.php    
2012-01-05 18:22:42 UTC (rev 8502)
@@ -78,6 +78,7 @@
                        $district_id    = phpgw::get_var('district_id', 'int');
                        $cat_id                 = phpgw::get_var('cat_id', 
'int');
                        $status_id              = phpgw::get_var('status_id');
+                       $degree_id              = phpgw::get_var('degree_id', 
'int');
                        $allrows                = phpgw::get_var('allrows', 
'bool');
                        $this->p_num    = phpgw::get_var('p_num');
 
@@ -122,6 +123,10 @@
                        {
                                $this->status_id = $status_id;
                        }
+                       if(isset($_POST['degree_id']) || 
isset($_GET['degree_id']))
+                       {
+                               $this->degree_id = $degree_id;
+                       }
                        if(isset($_POST['criteria_id']) || 
isset($_GET['criteria_id']))
                        {
                                $this->criteria_id = $criteria_id;
@@ -168,6 +173,7 @@
                        $this->cat_id                   = $data['cat_id'];
                        $this->property_cat_id  = $data['property_cat_id'];
                        $this->status_id                = $data['status_id'];
+                       $this->degree_id                = $data['degree_id'];
                        $this->building_part    = $data['building_part'];
                        $this->start_date               = 
isset($data['start_date']) ? $data['start_date']: '';
                        $this->end_date                 = 
isset($data['end_date']) ? $data['end_date']: '';
@@ -410,7 +416,8 @@
                                'filter' => $this->filter,'district_id' => 
$this->district_id,'cat_id' => $this->cat_id,'status_id' => $this->status_id,
                                'project_id' => 
$data['project_id'],'allrows'=>$data['allrows'],'list_descr' => 
$data['list_descr'],
                                'dry_run'=>$data['dry_run'], 'p_num' => 
$this->p_num,'start_date'=>$this->start_date,'end_date'=>$this->end_date,
-                               'property_cat_id' => $this->property_cat_id, 
'building_part' => $this->building_part));
+                               'property_cat_id' => $this->property_cat_id, 
'building_part' => $this->building_part,
+                               'degree_id' => $this->degree_id));
 
                        $this->total_records    = $this->so->total_records;
                        $this->sum_budget               = $this->so->sum_budget;
@@ -679,4 +686,9 @@
                {
                        $this->so->delete($request_id);
                }
+
+               public function get_user_list()
+               {
+                       return $this->so->get_user_list();
+               }
        }

Modified: branches/Version-1_0-branch/property/inc/class.custom_fields.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.custom_fields.inc.php        
2012-01-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/property/inc/class.custom_fields.inc.php        
2012-01-05 18:22:42 UTC (rev 8502)
@@ -434,7 +434,7 @@
                        $attribute_table = 'phpgw_cust_attribute';
                        $attribute_filter = " location_id = {$location_id}";
                        $contacts = CreateObject('phpgwapi.contacts');
-                       //_debug_array($values);
+//                     _debug_array($values);die();
                        $location = array();
                        $ret = array();
                        $j=0;
@@ -447,7 +447,7 @@
                                                $location = 
explode('-',$data['value']);
                                        }
 
-                                       if(($data['datatype']=='R' || 
$data['datatype']=='LB') && $data['value'])
+                                       if(($data['datatype']=='R' || 
$data['datatype']=='LB') && $data['value'] && $data['attrib_id'])
                                        {
                                                $sql="SELECT value FROM 
$choice_table WHERE $attribute_filter AND attrib_id=" .$data['attrib_id']. "  
AND id=" . $data['value'];
                                                $this->_db->query($sql);

Modified: branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sorequest.inc.php    
2012-01-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/property/inc/class.sorequest.inc.php    
2012-01-05 18:22:42 UTC (rev 8502)
@@ -202,7 +202,7 @@
                        $order                  = 
isset($data['order'])?$data['order']:'';
                        $cat_id                 = 
isset($data['cat_id'])?$data['cat_id']:0;
                        $property_cat_id= 
isset($data['property_cat_id'])?$data['property_cat_id']:0;
-                       $status_id              = isset($data['status_id']) && 
$data['status_id'] ? $data['status_id']:0;
+                       $status_id              = isset($data['status_id']) && 
$data['status_id'] ? $data['status_id']:'';
                        $district_id    = isset($data['district_id']) && 
$data['district_id'] ? $data['district_id']:0;
                        $project_id             = 
isset($data['project_id'])?$data['project_id']:'';
                        $allrows                = 
isset($data['allrows'])?$data['allrows']:'';
@@ -212,6 +212,7 @@
                        $start_date             = isset($data['start_date']) && 
$data['start_date'] ? phpgwapi_datetime::date_to_timestamp($data['start_date']) 
: 0;
                        $end_date               = isset($data['end_date']) && 
$data['end_date'] ? phpgwapi_datetime::date_to_timestamp($data['end_date']) : 0;
                        $building_part  = isset($data['building_part']) && 
$data['building_part'] ? (int)$data['building_part'] : 0;
+                       $degree_id              = $data['degree_id'];
 
                        $location_id = 
$GLOBALS['phpgw']->locations->get_id('property', '.project.request');
                        $attribute_table = 'phpgw_cust_attribute';
@@ -242,12 +243,13 @@
                        $uicols['classname'][]          = '';
                        $uicols['sortable'][]           = false;
 
-                       $cols.= ",max(fm_request_condition.degree) as 
condition_degree";
-                       $cols_return[]                          = 
'condition_degree';
+                       $cols.= ",$entity_table.building_part";
+                       $cols_return[]                          = 
'building_part';
+                       $cols_group[]                           = 
'building_part';
                        $uicols['input_type'][]         = 'text';
-                       $uicols['name'][]                       = 
'condition_degree';
-                       $uicols['descr'][]                      = 
lang('condition degree');
-                       $uicols['statustext'][]         = lang('condition 
degree');
+                       $uicols['name'][]                       = 
'building_part';
+                       $uicols['descr'][]                      = 
lang('building part');
+                       $uicols['statustext'][]         = lang('building part');
                        $uicols['exchange'][]           = '';
                        $uicols['align'][]                      = '';
                        $uicols['datatype'][]           = '';
@@ -285,7 +287,7 @@
                        $cols_group[]                           = "title";
                        $uicols['input_type'][]         = 'text';
                        $uicols['name'][]                       = 'title';
-                       $uicols['descr'][]                      = lang('title');
+                       $uicols['descr'][]                      = lang('request 
description');
                        $uicols['statustext'][]         = lang('Request title');
                        $uicols['exchange'][]           = '';
                        $uicols['align'][]                      = '';
@@ -312,14 +314,12 @@
                                $uicols['sortable'][]           = false;
                        }
 
-
-                       $cols.= ",$entity_table.building_part";
-                       $cols_return[]                          = 
'building_part';
-                       $cols_group[]                           = 
'building_part';
+                       $cols.= ",max(fm_request_condition.degree) as 
condition_degree";
+                       $cols_return[]                          = 
'condition_degree';
                        $uicols['input_type'][]         = 'text';
-                       $uicols['name'][]                       = 
'building_part';
-                       $uicols['descr'][]                      = 
lang('building part');
-                       $uicols['statustext'][]         = lang('building part');
+                       $uicols['name'][]                       = 
'condition_degree';
+                       $uicols['descr'][]                      = 
lang('condition degree');
+                       $uicols['statustext'][]         = lang('condition 
degree');
                        $uicols['exchange'][]           = '';
                        $uicols['align'][]                      = '';
                        $uicols['datatype'][]           = '';
@@ -327,6 +327,7 @@
                        $uicols['classname'][]          = '';
                        $uicols['sortable'][]           = true;
 
+
                        $cols.= ",$entity_table.budget as budget";
                        $cols_return[]                          = 'budget';
                        $cols_group[]                           = 'budget';
@@ -356,21 +357,7 @@
                        $uicols['classname'][]          = '';
                        $uicols['sortable'][]           = true;
 
-                       $cols.= ",$entity_table.coordinator";
-                       $cols_return[]                          = 'coordinator';
-                       $cols_group[]                           = 'coordinator';
-                       $uicols['input_type'][]         = 'text';
-                       $uicols['name'][]                       = 'coordinator';
-                       $uicols['descr'][]                      = 
lang('Coordinator');
-                       $uicols['statustext'][]         = lang('Project 
coordinator');
-                       $uicols['exchange'][]           = '';
-                       $uicols['align'][]                      = '';
-                       $uicols['datatype'][]           = '';
-                       $uicols['formatter'][]          = '';
-                       $uicols['classname'][]          = '';
-                       $uicols['sortable'][]           = false;
 
-
                        $cols.= ",$entity_table.score";
                        $cols_return[]                          = 'score';
                        $cols_group[]                           = 'score';
@@ -385,16 +372,17 @@
                        $uicols['classname'][]          = '';
                        $uicols['sortable'][]           = true;
 
-
                        $this->db->query("SELECT * FROM $attribute_table WHERE 
list=1 AND $attribute_filter");
+                       $_attrib = array();
                        while ($this->db->next_record())
                        {
-                               $cols .= ",{$entity_table}." . 
$this->db->f('column_name');
+                               $_column_name = $this->db->f('column_name');
+                               $cols .= ",{$entity_table}.{$_column_name}";
 
-                               $cols_return[]                          = 
$this->db->f('column_name');
-                               $cols_group[]                           = 
$this->db->f('column_name');
+                               $cols_return[]                          = 
$_column_name;
+                               $cols_group[]                           = 
$_column_name;
                                $uicols['input_type'][]         = 'text';
-                               $uicols['name'][]                       = 
$this->db->f('column_name');
+                               $uicols['name'][]                       = 
$_column_name;
                                $uicols['descr'][]                      = 
$this->db->f('input_text',true);
                                $uicols['statustext'][]         = 
$this->db->f('statustext',true);
                                $uicols['exchange'][]           = '';
@@ -403,8 +391,25 @@
                                $uicols['formatter'][]          = '';
                                $uicols['classname'][]          = '';
                                $uicols['sortable'][]           = false;
+
+                               $_attrib[$_column_name] = $this->db->f('id');
                        }
 
+                       $cols.= ",$entity_table.coordinator";
+                       $cols_return[]                          = 'coordinator';
+                       $cols_group[]                           = 'coordinator';
+                       $uicols['input_type'][]         = 'text';
+                       $uicols['name'][]                       = 'coordinator';
+                       $uicols['descr'][]                      = 
lang('Coordinator');
+                       $uicols['statustext'][]         = lang('Project 
coordinator');
+                       $uicols['exchange'][]           = '';
+                       $uicols['align'][]                      = '';
+                       $uicols['datatype'][]           = '';
+                       $uicols['formatter'][]          = '';
+                       $uicols['classname'][]          = '';
+                       $uicols['sortable'][]           = false;
+
+
                        $paranthesis = '(';
                        $joinmethod = "{$this->left_join} fm_request_status ON 
{$entity_table}.status = fm_request_status.id)";
                        $paranthesis .= '(';
@@ -417,7 +422,6 @@
                        $sql    = 
$this->bocommon->generate_sql(array('entity_table'=>$entity_table,'cols'=>$cols,'cols_return'=>$cols_return,
                                
'uicols'=>array(),'joinmethod'=>$joinmethod,'paranthesis'=>$paranthesis,
                                'query'=>$query,'force_location'=>true, 
'location_level' => $_location_level));
-                       unset($_location_level);
 
                        $cols_group[] = "{$entity_table}.id";
                        $cols_group[] = 'fm_request_status.descr';
@@ -456,15 +460,36 @@
                                $where = 'AND';
                        }
 
-                       if ($status_id)
+                       if ($status_id && $status_id != 'all')
                        {
-                               $filtermethod .= " $where 
fm_request.status='{$status_id}'";
+
+                               if($status_id == 'open')
+                               {
+                                       $_status_filter = array();
+                                       $this->db->query("SELECT * FROM 
fm_request_status WHERE delivered IS NULL AND closed IS NULL");
+                                       while($this->db->next_record())
+                                       {
+                                               $_status_filter[] = 
$this->db->f('id');
+                                       }
+                                       $filtermethod .= " $where 
fm_request.status IN ('" . implode("','", $_status_filter) . "')"; 
+                               }
+                               else
+                               {
+                                       $filtermethod .= " $where 
fm_request.status='$status_id' ";
+                               }
+                               $where= 'AND';
+                       }
+
+                       if ($degree_id)
+                       {
+                               $degree_id = (int)$degree_id -1;
+                               $filtermethod .= " $where 
fm_request_condition.degree = {$degree_id}";
                                $where = 'AND';
                        }
 
                        if ($building_part)
                        {
-                               $filtermethod .= " $where 
fm_request.building_part='{$building_part}'";
+                               $filtermethod .= " $where 
fm_request.building_part {$this->like} '{$building_part}%'";
                                $where = 'AND';
                        }
 
@@ -506,7 +531,12 @@
                                else
                                {
                                        $query = 
$this->db->db_addslashes($query);
-                                       $querymethod = " $where 
(fm_request.title $this->like '%$query%' or fm_request.address $this->like 
'%$query%' or fm_request.location_code $this->like '%$query%')";
+                                       $querymethod = " $where 
(fm_request.title {$this->like} '%$query%' OR fm_request.address {$this->like} 
'%$query%' OR fm_request.location_code {$this->like} '%$query%'";
+                                       for ($i=1;$i<=($_location_level);$i++)
+                                       {
+                                               $querymethod .= " OR 
fm_location{$i}.loc{$i}_name {$this->like} '%$query%'";
+                                       }
+                                       $querymethod .= ')';
                                }
                        }
 
@@ -566,28 +596,30 @@
                                        $this->db->query($sql . 
$ordermethod,__LINE__,__FILE__);
                                }
                        }
-
+                       $_datatype = array();
+                       foreach($this->uicols['name'] as $key => $_name)
+                       {
+                               $_datatype[$_name] =  
$this->uicols['datatype'][$key];
+                       }
+                       $dataset = array();
                        $j=0;
-                       $request_list = array();
                        while ($this->db->next_record())
                        {
-                               for ($i=0;$i<count($cols_return);$i++)
+                               foreach($cols_return as $key => $field)
                                {
-                                       $request_list[$j][$cols_return[$i]] = 
$this->db->f($cols_return[$i], true);
+                                       $dataset[$j][$field] = array
+                                               (
+                                                       'value'         => 
$this->db->f($field),
+                                                       'datatype'      => 
$_datatype[$field],
+                                                       'attrib_id'     => 
$_attrib[$field]
+                                               );
                                }
+                               $j++;                           
+                       }
 
-                               $location_code= $this->db->f('location_code');
-                               $location = explode('-',$location_code);
-                               for ($m=0;$m<count($location);$m++)
-                               {
-                                       $request_list[$j]['loc' . ($m+1)] = 
$location[$m];
-                                       
$request_list[$j]['query_location']['loc' . ($m+1)]=implode("-", 
array_slice($location, 0, ($m+1)));
-                               }
+                       $values = $this->custom->translate_value($dataset, 
$location_id);
 
-                               $j++;
-                       }
-                       //_debug_array($request_list);
-                       return $request_list;
+                       return $values;
                }
 
                function read_single($request_id, $values = array())
@@ -1103,4 +1135,35 @@
                        $this->interlink->delete_at_target('property', 
'.project.request', $request_id, $this->db);
                        $this->db->transaction_commit();
                }
+
+               public function get_user_list()
+               {
+                       $values = array();
+                       $users = 
$GLOBALS['phpgw']->accounts->get_list('accounts', $start=-1, $sort='ASC', 
$order='account_lastname', $query,$offset=-1);
+                       $sql = 'SELECT DISTINCT coordinator FROM fm_request';
+                       $this->db->query($sql,__LINE__,__FILE__);
+
+                       $account_lastname = array();
+                       while($this->db->next_record())
+                       {
+                               $user_id        = $this->db->f('coordinator');
+                               if(isset($users[$user_id]))
+                               {
+                                       $name   = 
$users[$user_id]->__toString();
+                                       $values[] = array
+                                       (
+                                               'user_id'       => $user_id,
+                                               'name'          => $name
+                                       );
+                                       $account_lastname[]  = $name;
+                               }
+                       }
+
+                       if($values)
+                       {
+                               array_multisort($account_lastname, SORT_ASC, 
$values);
+                       }
+
+                       return $values;
+               }
        }

Modified: branches/Version-1_0-branch/property/inc/class.uirequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uirequest.inc.php    
2012-01-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/property/inc/class.uirequest.inc.php    
2012-01-05 18:22:42 UTC (rev 8502)
@@ -87,6 +87,7 @@
                        $this->property_cat_id          = 
$this->bo->property_cat_id;
                        $this->cat_id                           = 
$this->bo->cat_id;
                        $this->status_id                        = 
$this->bo->status_id;
+                       $this->degree_id                        = 
$this->bo->degree_id;
                        $this->district_id                      = 
$this->bo->district_id;
                        $this->start_date                       = 
$this->bo->start_date;
                        $this->end_date                         = 
$this->bo->end_date;
@@ -106,6 +107,7 @@
                                'filter'                        => 
$this->filter,
                                'cat_id'                        => 
$this->cat_id,
                                'status_id'                     => 
$this->status_id,
+                               'degree_id'                     => 
$this->degree_id,
                                'district_id'           => $this->district_id,
                                'allrows'                       => 
$this->allrows,
                                'start_date'            => $this->start_date,
@@ -238,6 +240,7 @@
                                        ."project_id:'{$project_id}',"
                                        ."filter:'{$this->filter}',"
                                        ."status_id:'{$this->status_id}',"
+                                       ."degree_id:'{$this->degree_id}',"
                                        
."property_cat_id:'{$this->property_cat_id}',"
                                        ."district_id: '{$this->district_id}',"
                                        ."start_date:'{$this->start_date}',"
@@ -266,13 +269,20 @@
                                array_unshift 
($values_combo_box[2]['cat_list'],$default_value);
 
                                $values_combo_box[3]  = 
$this->bo->select_status_list('filter',$this->status_id);
-                               $default_value = array ('id'=>'','name'=> 
lang('no status'));
-                               array_unshift 
($values_combo_box[3],$default_value);
+                               array_unshift ($values_combo_box[3],array 
('id'=>'all','name'=> lang('all')));
+                               array_unshift ($values_combo_box[3],array 
('id'=>'open','name'=> lang('open')));
 
-                               $values_combo_box[4]  = 
$this->bocommon->get_user_list('filter',$this->filter,$extra=false,$default=false,$start=-1,$sort='ASC',$order='account_lastname',$query='',$offset=-1);
-                               array_unshift 
($values_combo_box[4],array('user_id'=>$GLOBALS['phpgw_info']['user']['account_id'],'name'=>$GLOBALS['phpgw_info']['user']['fullname']));
+                               $values_combo_box[4]  = 
$this->bo->select_degree_list();
+                               foreach($values_combo_box[4] as &$_degree)
+                               {
+                                       $_degree['id']++;
+                               }
+                               array_unshift ($values_combo_box[4],array 
('id'=>'','name'=> lang('condition degree')));
+
+                               $values_combo_box[5]  = 
$this->bo->get_user_list('filter',$this->filter,$extra=false,$default=false,$start=-1,$sort='ASC',$order='account_lastname',$query='',$offset=-1);
+                               array_unshift 
($values_combo_box[5],array('user_id'=>$GLOBALS['phpgw_info']['user']['account_id'],'name'=>$GLOBALS['phpgw_info']['user']['fullname']));
                                $default_value = array 
('user_id'=>'','name'=>lang('no user'));
-                               array_unshift 
($values_combo_box[4],$default_value);
+                               array_unshift 
($values_combo_box[5],$default_value);
 
                                $_filter_buildingpart = array();
                                $filter_buildingpart = 
isset($this->bo->config->config_data['filter_buildingpart']) ? 
$this->bo->config->config_data['filter_buildingpart'] : array();
@@ -298,6 +308,7 @@
                                                                'cat_id'        
                => $this->cat_id,
                                                                'filter'        
                => $this->filter,
                                                                'status_id'     
                => $this->status_id,
+                                                               'degree_id'     
                => $this->degree_id,
                                                                'project_id'    
        => $project_id,
                                                                'district_id'   
    => $this->district_id,
                                                                'query'         
                => $this->query,
@@ -349,6 +360,15 @@
                                                                        
'tab_index' => 4
                                                                ),
                                                                array
+                                                               ( //boton       
STATUS
+                                                                       'id' => 
'btn_degree_id',
+                                                                       'name' 
=> 'degree_id',
+                                                                       'value' 
=> lang('condition degree'),
+                                                                       'type' 
=> 'button',
+                                                                       'style' 
=> 'filter',
+                                                                       
'tab_index' => 5
+                                                               ),
+                                                               array
                                                                (
                                                                        'id' => 
'sel_building_part', // traditional listbox for long list
                                                                        'name' 
=> 'building_part',
@@ -357,7 +377,7 @@
                                                                        'style' 
=> 'filter',
                                                                        
'values'        => $building_part_list,
                                                                        
'onchange'=> 'onChangeSelect("building_part");',
-                                                                       
'tab_index' => 5
+                                                                       
'tab_index' => 6
                                                                ),
                                                                array
                                                                ( //boton       
FILTER
@@ -366,21 +386,21 @@
                                                                        'value' 
=> lang('User'),
                                                                        'type' 
=> 'button',
                                                                        'style' 
=> 'filter',
-                                                                       
'tab_index' => 6
+                                                                       
'tab_index' => 7
                                                                ),
                                                                array
                                                                (
                                                                        'type'  
=> 'button',
                                                                        'id'    
=> 'btn_update',
                                                                        'value' 
=> lang('Update project'),
-                                                                       
'tab_index' => 14
+                                                                       
'tab_index' => 15
                                                                ),
                                                                array
                                                                (
                                                                        'type'  
=> 'button',
                                                                        'id'    
=> 'btn_export',
                                                                        'value' 
=> lang('download'),
-                                                                       
'tab_index' => 13
+                                                                       
'tab_index' => 14
                                                                ),
 
                                                                array
@@ -388,7 +408,7 @@
                                                                        'type'  
=> 'button',
                                                                        'id'    
=> 'btn_new',
                                                                        'value' 
=> lang('add'),
-                                                                       
'tab_index' => 12
+                                                                       
'tab_index' => 13
                                                                ),
                                                                array
                                                                (
@@ -416,7 +436,7 @@
                                                                                
'menuaction' => 'property.uiproject.date_search')
                                                                        
)."','','width=350,height=250')",
                                                                        'value' 
=> lang('Date search'),
-                                                                       
'tab_index' => 11
+                                                                       
'tab_index' => 12
                                                                ),
 
                                                                array
@@ -426,7 +446,7 @@
                                                                        'value' 
   => lang('search'),
                                                                        
'onkeypress' => 'return pulsar(event)',
                                                                        'type' 
=> 'button',
-                                                                       
'tab_index' => 10
+                                                                       
'tab_index' => 11
                                                                ),
                                                                array
                                                                ( //hidden 
request
@@ -443,7 +463,7 @@
                                                                        'type' 
=> 'text',
                                                                        'size'  
  => 28,
                                                                        
'onkeypress' => 'return pulsar(event)',
-                                                                       
'tab_index' => 9
+                                                                       
'tab_index' => 10
                                                                ),
                                                                array
                                                                (
@@ -454,7 +474,7 @@
                                                                        (
                                                                                
'menuaction' => 
'property.uirequest.priority_key'))."','','left=50,top=100,width=350,height=350,scrollbars=1')",
                                                                                
'value' => lang('Priority key'),
-                                                                               
'tab_index' => 8
+                                                                               
'tab_index' => 9
                                                                ),
                                                                array
                                                                (
@@ -465,7 +485,7 @@
                                                                        (
                                                                                
'menuaction' => 
'property.uirequest.columns'))."','','width=300,height=600,scrollbars=1')",
                                                                                
'value' => lang('columns'),
-                                                                               
'tab_index' => 7
+                                                                               
'tab_index' => 8
                                                                ),
                                                        ),
                                                        'hidden_value' => array
@@ -493,7 +513,12 @@
                                                                array
                                                                ( //div values  
combo_box_4
                                                                        'id' => 
'values_combo_box_4',
-                                                                       'value' 
=> $this->bocommon->select2String($values_combo_box[4], 'user_id')
+                                                                       'value' 
=> $this->bocommon->select2String($values_combo_box[4])
+                                                               ),
+                                                               array
+                                                               ( //div values  
combo_box_5
+                                                                       'id' => 
'values_combo_box_5',
+                                                                       'value' 
=> $this->bocommon->select2String($values_combo_box[5], 'user_id')
                                                                )
                                                        )
                                                )
@@ -502,17 +527,17 @@
 
                                if(!$this->acl_manage)//priority_key
                                {
-                                       
unset($datatable['actions']['form'][0]['fields']['field'][16]);
+                                       
unset($datatable['actions']['form'][0]['fields']['field'][17]);
                                }
 
                                if(!$this->acl_add) //add
                                {
-                                       
unset($datatable['actions']['form'][0]['fields']['field'][8]);
+                                       
unset($datatable['actions']['form'][0]['fields']['field'][9]);
                                }
 
                                if(!$project_id) // update project
                                {
-                                       
unset($datatable['actions']['form'][0]['fields']['field'][6]);
+                                       
unset($datatable['actions']['form'][0]['fields']['field'][7]);
                                }
                                $dry_run = true;
                        }

Modified: branches/Version-1_0-branch/property/js/yahoo/request.index.js
===================================================================
--- branches/Version-1_0-branch/property/js/yahoo/request.index.js      
2012-01-05 18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/property/js/yahoo/request.index.js      
2012-01-05 18:22:42 UTC (rev 8502)
@@ -2,13 +2,14 @@
 // Declaration of request.index vars
 //--------------------------------------------------------
        //define SelectButton
-       var oMenuButton_0, oMenuButton_1, oMenuButton_2, oMenuButton_3, 
oMenuButton_4;
+       var oMenuButton_0, oMenuButton_1, oMenuButton_2, oMenuButton_3, 
oMenuButton_4, oMenuButton_5;
        var selectsButtons = [
     {order:0, var_URL:'property_cat_id', name:'btn_property_cat',      
style:'categorybutton', dependiente:[]},
        {order:1, 
var_URL:'district_id',name:'btn_district_id',style:'districtbutton',dependiente:''},
        {order:2, 
var_URL:'cat_id',name:'btn_cat_id',style:'categorybutton',dependiente:''},
        {order:3, 
var_URL:'status_id',name:'btn_status_id',style:'districtbutton',dependiente:''},
-       {order:4, var_URL:'filter', 
name:'btn_user_id',style:'ownerIdbutton',dependiente:''}
+       {order:4, 
var_URL:'degree_id',name:'btn_degree_id',style:'districtbutton',dependiente:''},
+       {order:5, var_URL:'filter', 
name:'btn_user_id',style:'ownerIdbutton',dependiente:''}
        ]
 
        // define buttons
@@ -98,12 +99,17 @@
                        {
                                oMenuButton_3.set("label", ("<em>" + 
array_options[3][index][1] + "</em>"));
                        }
-                       //user
-                       index = 
locate_in_array_options(4,"value",path_values.filter);
+                       index = 
locate_in_array_options(4,"value",path_values.degree_id);
                        if(index)
                        {
                                oMenuButton_4.set("label", ("<em>" + 
array_options[4][index][1] + "</em>"));
                        }
+                       //user
+                       index = 
locate_in_array_options(5,"value",path_values.filter);
+                       if(index)
+                       {
+                               oMenuButton_5.set("label", ("<em>" + 
array_options[5][index][1] + "</em>"));
+                       }
 
                        oMenuButton_0.focus();
                }

Modified: branches/Version-1_0-branch/property/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/property/setup/phpgw_no.lang    2012-01-05 
18:16:12 UTC (rev 8501)
+++ branches/Version-1_0-branch/property/setup/phpgw_no.lang    2012-01-05 
18:22:42 UTC (rev 8502)
@@ -1329,7 +1329,7 @@
 request start date     property        no      anmodning startdato
 request status property        no      Behov::status
 request title  property        no      Tiltak tittel
-request description    property        no      Tilstand beskrivelse
+request description    property        no      Tilstandbeskrivelse
 requirement    property        no      Behov/pålegg
 resend workorder       property        no      Send ordre på nytt
 reserve        property        no      reserve




reply via email to

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