fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8208] Merge 8197:8207 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [8208] Merge 8197:8207 from trunk
Date: Tue, 29 Nov 2011 08:04:02 +0000

Revision: 8208
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8208
Author:   sigurdne
Date:     2011-11-29 08:04:02 +0000 (Tue, 29 Nov 2011)
Log Message:
-----------
Merge 8197:8207 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
    branches/Version-1_0-branch/activitycalendar/inc/class.soarena.inc.php
    
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php
    branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
    branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
    
branches/Version-1_0-branch/activitycalendar/templates/base/activity_list_partial.php
    branches/Version-1_0-branch/controller/inc/class.socontrol.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/js/controller/controller_datatable_test.js
    branches/Version-1_0-branch/controller/setup/phpgw_no.lang
    branches/Version-1_0-branch/controller/setup/setup.inc.php
    branches/Version-1_0-branch/controller/setup/tables_update.inc.php
    branches/Version-1_0-branch/controller/templates/base/locations.xsl
    branches/Version-1_0-branch/property/inc/class.soXport.inc.php
    branches/Version-1_0-branch/property/inc/class.soadmin.inc.php
    branches/Version-1_0-branch/property/inc/class.socommon.inc.php
    branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
    branches/Version-1_0-branch/property/inc/class.soproject.inc.php
    branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
    branches/Version-1_0-branch/property/inc/class.soworkorder.inc.php
    branches/Version-1_0-branch/property/inc/class.uiadmin.inc.php
    branches/Version-1_0-branch/property/inc/class.uiinvoice.inc.php
    branches/Version-1_0-branch/property/inc/class.uiproject.inc.php
    branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php
    
branches/Version-1_0-branch/property/inc/cron/default/Import_fra_basware_X205.php
    branches/Version-1_0-branch/property/inc/export/default/Basware_X114
    branches/Version-1_0-branch/property/js/yahoo/invoice.index.js
    branches/Version-1_0-branch/property/js/yahoo/project.edit.js
    branches/Version-1_0-branch/property/js/yahoo/property2.js
    branches/Version-1_0-branch/property/js/yahoo/workorder.edit.js
    branches/Version-1_0-branch/property/setup/setup.inc.php
    branches/Version-1_0-branch/property/setup/tables_current.inc.php
    branches/Version-1_0-branch/property/setup/tables_update.inc.php
    branches/Version-1_0-branch/property/templates/base/admin.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
   + 
/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

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php   
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php   
2011-11-29 08:04:02 UTC (rev 8208)
@@ -801,7 +801,7 @@
        
        function get_targetgroups()
        {
-               $sql = "SELECT * FROM bb_agegroup where active=1 ORDER BY sort";
+               $sql = "SELECT * FROM bb_agegroup where active=1 AND NOT name 
like 'Tilskuer%' ORDER BY sort";
                $this->db->query($sql, __LINE__, __FILE__);
                while($this->db->next_record()){
                        $targets[] = array(

Modified: branches/Version-1_0-branch/activitycalendar/inc/class.soarena.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.soarena.inc.php      
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.soarena.inc.php      
2011-11-29 08:04:02 UTC (rev 8208)
@@ -49,6 +49,11 @@
                        }
                        $order = "ORDER BY 
{$this->marshal($sort_field,'field')} $dir";
                }
+               else if(!$return_count)
+               {
+                       $dir = $ascending ? 'ASC' : 'DESC';
+                       $order = "ORDER BY arena.arena_name $dir";
+               }
                
                if($search_for)
                {
@@ -134,7 +139,7 @@
                //{$this->left_join} rental_contract contract ON (contract.id = 
c_p.contract_id)";
 
                $joins = $join_contracts;
-               //var_dump("SELECT {$cols} FROM {$tables} {$joins} WHERE 
{$condition} {$order}");
+               var_dump("SELECT {$cols} FROM {$tables} {$joins} WHERE 
{$condition} {$order}");
                return "SELECT {$cols} FROM {$tables} {$joins} WHERE 
{$condition} {$order}";
        }
        

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php   
    2011-11-29 06:44:47 UTC (rev 8207)
+++ 
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php   
    2011-11-29 08:04:02 UTC (rev 8208)
@@ -54,7 +54,7 @@
                else if(!$return_count)
                {
                        $dir = $ascending ? 'ASC' : 'DESC';
-                       $order = "ORDER BY org.id $dir";
+                       $order = "ORDER BY org.name $dir";
                }
                if($search_for)
                {

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php 
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php 
2011-11-29 08:04:02 UTC (rev 8208)
@@ -146,7 +146,7 @@
                {
                        $desc = substr($desc,0,254);
                }
-               $arenas = $so_arena->get(null, null, null, null, null, null, 
null);
+               $arenas = $so_arena->get(null, null, 'arena.arena_name', true, 
null, null, null);
                if($activity->get_new_org())
                {
                        $org_name = 
$so_org->get_organization_name_local($activity->get_organization_id());
@@ -218,7 +218,7 @@
                                        if($new_state == 3 || $new_state == 5 )
                                        {
                                                $kontor = 
$so_activity->get_office_name($activity->get_office());
-                                               $subject = "Melding fra 
AktivBy";
+                                               $subject = 
lang('mail_subject_update');
                                                $body = lang('mail_body_state_' 
. $new_state, $kontor);
                                                
                                                if(isset($g_id) && $g_id > 0)
@@ -392,7 +392,7 @@
                                $value['ajax'][] = false;
                                $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'activitycalendar.uiactivities.view', 'id' => $value['id'])));
                                $value['labels'][] = lang('show');
-                               $value['ajax'][] = false;
+                               $value['ajax'][] = true;
                                $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'activitycalendar.uiactivities.send_mail', 'activity_id' => 
$value['id'],'message_type' => 'update')));
                                $value['labels'][] = lang('send_mail');
                                break;
@@ -415,7 +415,9 @@
                
                //$activity = 
activitycalendar_soactivity::get_instance()->get_single($activity_id);
                $subject = lang('mail_subject_update');
-               $body = lang('mail_body_update', $activity->get_id() . ', ' . 
$activity->get_title());
+               $link_text = 
"http://www.bergen.kommune.no/portico/activitycalendarfrontend/?menuaction=activitycalendarfrontend.uiactivity.edit&id={$activity->get_id()}&secret={$activity->get_secret()}";
+               $office_name = 
activitycalendar_soactivity::get_instance()->get_office_name($activity->get_office());
+               $body = lang('mail_body_update', $activity->get_id() . ', ' . 
$activity->get_title(), $link_text, $office_name);
                
                //var_dump($subject);
                //var_dump($body);
@@ -450,7 +452,8 @@
                //$subject = lang('mail_subject_update', $avtivity->get_id() . 
'-' . $activity->get_title(), $activity->get_link());
                $subject = lang('mail_subject_update');
                $link_text = 
"http://www.bergen.kommune.no/portico/activitycalendarfrontend/?menuaction=activitycalendarfrontend.uiactivity.edit&id={$activity->get_id()}&secret={$activity->get_secret()}";
-               $body = lang('mail_body_update', $activity->get_id() . ', ' . 
$activity->get_title(), $link_text);
+               $office_name = 
activitycalendar_soactivity::get_instance()->get_office_name($activity->get_office());
+               $body = lang('mail_body_update', $activity->get_id() . ', ' . 
$activity->get_title(), $link_text, $office_name);
        }
        else
        {
@@ -458,9 +461,9 @@
                $body = "testmelding fra Aktivitetsoversikt";
        }
        
-       //var_dump($subject);
-       //var_dump($body);
-       //var_dump($activity->get_organization_id() . " ; " . 
$activity->get_group_id());
+       var_dump($subject);
+       var_dump($body);
+       var_dump($activity->get_organization_id() . " ; " . 
$activity->get_group_id());
        
        if($activity->get_group_id() && $activity->get_group_id() > 0)
        {

Modified: branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang    
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang    
2011-11-29 08:04:02 UTC (rev 8208)
@@ -373,9 +373,9 @@
 activity_import        activitycalendar        no      Importer aktiviteter
 office activitycalendar        no      Hovedansvarlig kulturkontor
 activity_helptext      activitycalendar        no      Aktivitetsoversikten 
henter kontaktinformasjon og beskrivelse fra bookingmodulen.<br/>Før ny 
aktivitet kan registreres må du sjekke at organisasjon/gruppe finnes og er 
oppdatert,<br/>og at arena finnes og er oppdatert. Feltet vis i portal skal 
være satt til JA, i organisasjonsregisteret og evt. lag/gruppe. For nye 
aktiviteter vil dette bli satt automatisk.
-mail_subject_update    activitycalendar        no      Melding om oppdatering 
av aktivitet
-mail_body_update       activitycalendar        no      Du må oppdatere 
informasjonen som er registrert på aktivitet %1 . Bruk følgende lenke for å gå 
inn på aktiviteten: %2
-mail_body_state_3      activitycalendar        no      Ditt tips er publisert 
i kommuneportalen. Mvh %1 kulturkontor
+mail_subject_update    activitycalendar        no      Melding fra AktivBy - 
aktivitetsoversikt
+mail_body_update       activitycalendar        no      Dette er en melding fra 
Bergen kommune/AktivBy.<br/>I aktivitetsoversikten som ligger i kommuneportalen 
på internett, står du registrert som kontaktperson for %1.<br/>Ber om at du 
kontrollerer at data er korrekt, og eventuelt endrer.<br/>%2<br/><br/><br/> Mvh 
%3 kulturkontor
+mail_body_state_3      activitycalendar        no      Informasjon om din 
aktivitet er publisert i kommuneportalen.<br/>De som er registrert som 
kontaktpersoner får endre informasjonen, dette gjøres via nettsiden. 
https://www.bergen.kommune.no/tjenestetilbud/aktivitetsoversikt/<br/><br/><br/> 
Mvh %1 kulturkontor
 mail_body_state_4      activitycalendar        no      Ditt tips er behandlet 
og publisert i kommuneportalen. Mvh %1 kulturkontor
 mail_body_state_5      activitycalendar        no      Ditt tips er behandlet, 
men vil ikke bli publisert i kommuneportalen. Mvh %1 kulturkontor
 send_mail      activitycalendar        no      Send e-post

Modified: 
branches/Version-1_0-branch/activitycalendar/templates/base/activity_list_partial.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendar/templates/base/activity_list_partial.php
       2011-11-29 06:44:47 UTC (rev 8207)
+++ 
branches/Version-1_0-branch/activitycalendar/templates/base/activity_list_partial.php
       2011-11-29 08:04:02 UTC (rev 8208)
@@ -151,24 +151,28 @@
 
     function activity_email(ptype) {
 
-        var query = document.getElementById('<?php echo $list_id 
?>_ctrl_search_query').value;
-        var office = document.getElementById('<?php echo $list_id 
?>_ctrl_toggle_activity_district').value;
-        var state = document.getElementById('<?php echo $list_id 
?>_ctrl_toggle_activity_state').value;
-        var category = document.getElementById('<?php echo $list_id 
?>_ctrl_toggle_activity_category').value;
-        <?php
-        /* FIXME Search queries will affect ALL data tables listed on one page 
(of that type) when exporting
-         * even though the search only affects one of the data tables.
-         * F.ex on /index.php?menuaction=rental.uicontract.edit&id=1 -> Parties
-         */
-        ?>
-        
-        window.location = 
'index.php?menuaction=activitycalendar.uiactivities.query'+
-            '<?php echo $url_add_on; ?>'+
-            '&amp;query='+query+
-            '&amp;activity_district='+office+
-            '&amp;activity_state='+state+
-            '&amp;activity_category='+category+
-               '&amp;email=true';
+       var confirm_res = confirm("Du er i ferd med å sende e-post til flere 
mottakere.\n\nVil du gjøre dette?");
+        if(confirm_res==true)
+        {      
+               var query = document.getElementById('<?php echo $list_id 
?>_ctrl_search_query').value;
+               var office = document.getElementById('<?php echo $list_id 
?>_ctrl_toggle_activity_district').value;
+               var state = document.getElementById('<?php echo $list_id 
?>_ctrl_toggle_activity_state').value;
+               var category = document.getElementById('<?php echo $list_id 
?>_ctrl_toggle_activity_category').value;
+               <?php
+               /* FIXME Search queries will affect ALL data tables listed on 
one page (of that type) when exporting
+                * even though the search only affects one of the data tables.
+                * F.ex on /index.php?menuaction=rental.uicontract.edit&id=1 -> 
Parties
+                */
+               ?>
+               
+               window.location = 
'index.php?menuaction=activitycalendar.uiactivities.query'+
+                   '<?php echo $url_add_on; ?>'+
+                   '&amp;query='+query+
+                   '&amp;activity_district='+office+
+                   '&amp;activity_state='+state+
+                   '&amp;activity_category='+category+
+                       '&amp;email=true';
+        }
     }
 
 </script>
@@ -239,7 +243,7 @@
        $export_format = 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['export_format'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['export_format'] 
? $GLOBALS['phpgw_info']['user']['preferences']['property']['export_format'] : 
'csv';
        ?>
        <div id="export">
-               <a href="javascript:activity_export('<?php echo $list_id ?>')" 
title="<?php echo lang('Download as excel') ?>"><img src="<?php echo 
ACTIVITYCALENDAR_IMAGE_PATH 
?>images/16x16/mimetypes/x-office-spreadsheet.png"/></a>&nbsp;&nbsp;<a 
href="javascript:activity_email('<?php echo $list_id ?>')" title="<?php echo 
lang('Send email to selection') ?>"><button><?php echo lang('Send mail to 
selection') ?></button></a>
+               <a href="javascript:activity_export('<?php echo $list_id ?>')" 
title="<?php echo lang('Download as excel') ?>"><img src="<?php echo 
ACTIVITYCALENDAR_IMAGE_PATH 
?>images/16x16/mimetypes/x-office-spreadsheet.png"/></a>&nbsp;&nbsp;<button 
onclick="javascript:activity_email('<?php echo $list_id ?>')"><?php echo 
lang('Send mail to selection') ?></button>
        </div>
 </fieldset>
 <?php }?>

Modified: branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php  
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/controller/inc/class.socontrol.inc.php  
2011-11-29 08:04:02 UTC (rev 8208)
@@ -125,7 +125,37 @@
                }
        }
        
+       function get_locations_for_control($control_id)
+       {
+               $results = array();
+               
+               $sql =  "SELECT DISTINCT c.id, c.title, cl.location_code "; 
+               $sql .= "FROM controller_control c, controller_check_list cl ";
+               $sql .= "WHERE c.id = $control_id ";
+               $sql .= "AND cl.control_id = c.id";
+
+               $this->db->query($sql);
+               
+               while($this->db->next_record()) {
+                       $control_id = $this->unmarshal($this->db->f('id', 
true), 'int');
+                       $title = $this->unmarshal($this->db->f('title', true), 
'string');
+                       $location_code = 
$this->unmarshal($this->db->f('location_code', true), 'int');
+                                               
+                       $controls_array[] = array("id" => $control_id, "title" 
=> $title, "location_code" => $location_code);
+               }
+               
+               if( count( $controls_array ) > 0 ){
+                       return $controls_array; 
+               }
+               else
+               {
+                       return null;
+               }
+       }
        
+       
+       
+       
        function get_id_field_name($extended_info = false)
        {
                if(!$extended_info)

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
  2011-11-29 06:44:47 UTC (rev 8207)
+++ 
branches/Version-1_0-branch/controller/inc/class.uicheck_list_for_location.inc.php
  2011-11-29 08:04:02 UTC (rev 8208)
@@ -17,8 +17,9 @@
                var $type_id;
                var $location_code;
                
-               private $so_control_area; 
-
+               private $so_control_area;
+               private $so_control;
+       
                var $public_functions = array(
                                                                                
'index' => true,
                                                                        );
@@ -33,7 +34,8 @@
                        $this->bo                                       = 
CreateObject('property.bolocation',true);
                        $this->bocommon                         = & 
$this->bo->bocommon;
                        $this->so_control_area          = 
CreateObject('controller.socontrol_area');
-
+                       $this->so_control                       = 
CreateObject('controller.socontrol');
+       
                        $this->type_id                          = 
$this->bo->type_id;
                        
                        $this->start                            = 
$this->bo->start;
@@ -87,10 +89,15 @@
                        array_unshift ($responsibility_roles,$default_value);
                        
                        $control_areas_array = 
$this->so_control_area->get_control_areas_as_array();
-
-                       // Fetches prosedures that are related to first control 
area in list
-                       $control_area_id = $control_areas_array[0]['id'];
                        
+                       $control_id = 186;
+                       
+                       $locations_for_control_array = 
$this->so_control->get_locations_for_control($control_id);
+                                               
+                       
+                       
+                       
+               /*
                        $lists = array
                        (
                                'building_types'                        => 
$building_types,
@@ -100,11 +107,48 @@
                                'responsibility_roles_list'     => 
$responsibility_roles_list,
                                'control_area_list'                     => 
$control_areas_array,
                        );
+*/
 
-               
-                       
-
                        $data = array(
+                               'form' => array(
+                                       'toolbar' => array(
+                                               'item' => array(
+                                                       array('type' => 
'filter',
+                                                               'name' => 
'building_types',
+                                'text' => lang('Building_types').':',
+                                'list' => $building_types
+                                                       ),
+                                                       array('type' => 
'filter',
+                                                               'name' => 
'cat_id',
+                                'text' => lang('Category_types').':',
+                                'list' => $category_types
+                                                       ),
+                                                       array('type' => 
'filter',
+                                                               'name' => 
'district_id',
+                                'text' => lang('District_list').':',
+                                'list' => $district_list
+                                                       ),
+                                                       array('type' => 
'filter',
+                                                               'name' => 
'part_of_town_list',
+                                'text' => lang('Part_of_town_list').':',
+                                'list' => $part_of_town_list
+                                                       ),
+                                                       array('type' => 
'filter',
+                                                               'name' => 
'responsibility_roles_list',
+                                'text' => 
lang('responsibility_roles_list').':',
+                                'list' => $responsibility_roles_list
+                                                       ),
+                                                       array('type' => 'text', 
+                                  'name' => 'query'
+                                                       ),
+                                                       array(
+                                                               'type' => 
'submit',
+                                                               'name' => 
'search',
+                                                               'value' => 
lang('Search')
+                                                       ),
+                                               ),
+                                       ),
+                               ),
                                'datatable' => array(
                                        'source' => 
self::link(array('menuaction' => 'controller.uicheck_list_for_location.index', 
'phpgw_return_as' => 'json')),
                                        'field' => array(
@@ -151,7 +195,9 @@
                                                )
                                        )
                                ),
-                               'lists' => $lists
+                               'lists'                                 => 
$lists,
+                               'locations_for_control' => 
$locations_for_control_array,
+                               'control_area_list'             => 
$control_areas_array
                        );                      
                        
                        //self::add_javascript('controller', 'yahoo', 
'datatable.js');
@@ -174,8 +220,6 @@
                        $location_list = $this->bo->read(array('user_id' => 
$user_id, 'role_id' =>$role_id, 
'type_id'=>$type_id,'lookup_tenant'=>$lookup_tenant,
                                                                                
                   'lookup'=>$lookup,'allrows'=>$this->allrows,'dry_run' 
=>$dry_run));
 
-                       $uicols = $this->bo->uicols;
-               
                        $results = array();
 
                        foreach($location_list as $location)
@@ -205,7 +249,7 @@
                        $value['labels'][] = lang('show');
                        
                        $value['ajax'][] = true;
-                       $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'rental.uicomposite.add_unit', 'location_code' => $value['location_code'])));
+                       $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'controller.uilocation_check_list', 'location_code' => 
$value['location_code'])));
                        $value['labels'][] = lang('add_location');
                }
        }
\ No newline at end of file

Modified: branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php  
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/controller/inc/class.uicontrol.inc.php  
2011-11-29 08:04:02 UTC (rev 8208)
@@ -610,7 +610,7 @@
                        self::render_template_xsl(array('control_tabs', 
'tab_view_check_lists'), $data);
                        self::add_javascript('controller', 'yahoo', 
'control_tabs.js');
                }
-               
+                       
                // Returns control list info as JSON
                public function get_controls_by_control_area()
                {

Modified: 
branches/Version-1_0-branch/controller/js/controller/controller_datatable_test.js
===================================================================
--- 
branches/Version-1_0-branch/controller/js/controller/controller_datatable_test.js
   2011-11-29 06:44:47 UTC (rev 8207)
+++ 
branches/Version-1_0-branch/controller/js/controller/controller_datatable_test.js
   2011-11-29 08:04:02 UTC (rev 8208)
@@ -205,18 +205,23 @@
 
                //...create a handler for context menu clicks
                var onContextMenuClick = function(eventString, args, table) {
-
                        //... the argument holds the selected index number in 
the context menu
                        var task = args[1];
+                       
                        //... only act on a data table
                        if(table instanceof YAHOO.widget.DataTable) {
                                //... retrieve the record based on the selected 
table row
                                var row = 
table.getTrEl(this.contextEventTarget);
                                var record = table.getRecord(row);
-
+                                                                               
                
                                //... check whether this action should be an 
AJAX call
-                               if(record.getData().ajax[task.index]) {
-                                                                               
                                
+                               if( record.getData().ajax[task.index] ) {
+                               
+                                       if(task.index == 1) {
+                                               
+                                               
+                                       }
+                                       
                                        var alertStatus = false;
 
                                        // Check if confirm box should be 
displayed before request is executed
@@ -508,7 +513,7 @@
         */
        function formListener(event){
                YAHOO.util.Event.stopEvent(event);
-               var qs = YAHOO.controller.serializeForm(this.properties.form);
+               var qs = YAHOO.portico.serializeForm(this.properties.form);
            this.source.liveData = this.url + qs + '&';
            this.source.sendRequest('', {success: function(sRequest, oResponse, 
oPayload) {
                this.table.onDataReturnInitializeTable(sRequest, oResponse, 
this.paginator);

Modified: branches/Version-1_0-branch/controller/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/controller/setup/phpgw_no.lang  2011-11-29 
06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/controller/setup/phpgw_no.lang  2011-11-29 
08:04:02 UTC (rev 8208)
@@ -1,3 +1,4 @@
+Assign location to control     controller      no      Knytte kontrol til bygg
 control        controller      no      Kontroll
 controller     common  no      Kontroll
 control_helptext       controller      no      Her kommer hjelpetekst for å 
opprette en kontroll

Modified: branches/Version-1_0-branch/controller/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/setup/setup.inc.php  2011-11-29 
06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/controller/setup/setup.inc.php  2011-11-29 
08:04:02 UTC (rev 8208)
@@ -1,6 +1,6 @@
 <?php
        $setup_info['controller']['name'] = 'controller';
-       $setup_info['controller']['version'] = '0.1.8';
+       $setup_info['controller']['version'] = '0.1.9';
        $setup_info['controller']['app_order'] = 100;
        $setup_info['controller']['enable'] = 1;
        $setup_info['controller']['app_group']  = 'office';

Modified: branches/Version-1_0-branch/controller/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/controller/setup/tables_update.inc.php  
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/controller/setup/tables_update.inc.php  
2011-11-29 08:04:02 UTC (rev 8208)
@@ -147,4 +147,27 @@
                $GLOBALS['setup_info']['controller']['currentver'] = '0.1.8';
                return $GLOBALS['setup_info']['controller']['currentver'];
        }
+       
+       /* Update Controller from v 0.1.8 to 0.1.9 */
+       
+       $test[] = '0.1.8';
+       function controller_upgrade0_1_8()
+       {
+               $GLOBALS['phpgw_setup']->oProc->CreateTable(
+                       'controller_control_location_list', array(
+                               'fd' => array(
+                                       'id' => array('type' => 'auto', 
'nullable' => false),
+                                       'control_id' => array('type' => 'int', 
'precision' => '4', 'nullable' => false),
+                                       'location_code' => array('type' => 
'int', 'precision' => '4', 'nullable' => false)
+                               ),
+                               'pk' => array('id'),
+                       'fk' => array(),
+                       'ix' => array(),
+                       'uc' => array()
+                       )
+               );      
+                       
+               $GLOBALS['setup_info']['controller']['currentver'] = '0.1.9';
+               return $GLOBALS['setup_info']['controller']['currentver'];
+       }
 ?>
\ No newline at end of file

Modified: branches/Version-1_0-branch/controller/templates/base/locations.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/locations.xsl 
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/controller/templates/base/locations.xsl 
2011-11-29 08:04:02 UTC (rev 8208)
@@ -15,17 +15,236 @@
        </func:result>
 </func:function>
 
-
 <xsl:template match="data">
+       
+       <div id="addedProperties">
+               <ul id="locations_for_control" name="locations_for_control">
+                       <xsl:for-each select="locations_for_control">
+                               <li>
+                                       <div><xsl:value-of select="id"/></div>
+                                       <div><xsl:value-of 
select="title"/></div>
+                                       <div><xsl:value-of 
select="location_code"/></div>
+                               </li>                   
+                   </xsl:for-each>
+               </ul>
+       </div>
+       
+       <iframe id="yui-history-iframe" 
src="phpgwapi/js/yahoo/history/assets/blank.html" 
style="position:absolute;top:0; left:0;width:1px; 
height:1px;visibility:hidden;"></iframe>
+       <input id="yui-history-field" type="hidden"/>
        <xsl:call-template name="yui_booking_i18n"/>
-       <xsl:apply-templates select="lists"/>
+       <xsl:apply-templates select="form" />
        <xsl:apply-templates select="paging"/>
+       <div id="list_flash">
+               <xsl:call-template name="msgbox"/>
+       </div>
        <xsl:apply-templates select="datatable"/> 
+       <xsl:apply-templates select="form/list_actions"/>
+       
 </xsl:template>
 
+<xsl:template match="form">
+       <form id="queryForm" style="margin: 20px; width: 65%;">
+               <xsl:attribute name="method">
+                       <xsl:value-of select="phpgw:conditional(not(method), 
'GET', method)"/>
+               </xsl:attribute>
+
+               <xsl:attribute name="action">
+                       <xsl:value-of select="phpgw:conditional(not(action), 
'', action)"/>
+               </xsl:attribute>
+        <xsl:apply-templates select="toolbar"/>
+       </form>
+
+       <form id="update_table_dummy" method='POST' action='' >
+       </form>
+
+</xsl:template>
+
+
+<xsl:template match="toolbar">
+    <div id="toolbar">
+                 <table class='yui-skin-sam' border="0" cellspacing="0" 
cellpadding="0" style="padding:0px; margin:0px;">
+                       <tr>
+        <xsl:for-each select="item">
+                       <xsl:variable name="filter_key" 
select="concat('filter_', name)"/>
+                       <xsl:variable name="filter_key_name" 
select="concat(concat('filter_', name), '_name')"/>
+                       <xsl:variable name="filter_key_id" 
select="concat(concat('filter_', name), '_id')"/>
+               
+                       <xsl:choose>
+                               <xsl:when test="type = 'date-picker'">
+                                       <td valign="top">
+                                       <div class="date-picker">
+                       <input id="filter_{name}" name="filter_{name}" 
type="text">
+                                                       <xsl:attribute 
name="value"><xsl:value-of select="../../../filters/*[local-name() = 
$filter_key]"/></xsl:attribute>
+                                               </input>
+                </div>
+                                       </td>
+                               </xsl:when>
+                               <xsl:when test="type = 'autocomplete'">
+                                       <td valign="top" width="160px">
+                                               <div style="width:140px">
+                                                       <input 
id="filter_{name}_name" name="filter_{name}_name" type="text">
+                                                               <xsl:attribute 
name="value"><xsl:value-of select="../../../filters/*[local-name() = 
$filter_key_name]"/></xsl:attribute>
+                                                       </input>
+                                                       <input 
id="filter_{name}_id" name="filter_{name}_id" type="hidden">
+                                                               <xsl:attribute 
name="value"><xsl:value-of select="../../../filters/*[local-name() = 
$filter_key_id]"/></xsl:attribute>
+                                                       </input>
+                                                       <div 
id="filter_{name}_container"/>
+                                               </div>
+                                               <script type="text/javascript"> 
+                                               
YAHOO.util.Event.onDOMReady(function() {
+                                                  var name = "<xsl:value-of 
select="name"/>";
+                                                       var ui = "<xsl:value-of 
select="ui"/>";
+
+                                                       var itemSelectCallback 
= false;
+                                                       <xsl:if 
test="onItemSelect">
+                                                               
itemSelectCallback = <xsl:value-of select="onItemSelect"/>;
+                                                       </xsl:if>
+
+                                                       var 
onClearSelectionCallback = false;
+                                                       <xsl:if 
test="onClearSelection">
+                                                               
onClearSelectionCallback = <xsl:value-of select="onClearSelection"/>;
+                                                       </xsl:if>
+
+                                                       var requestGenerator = 
false;
+                                                       <xsl:if 
test="requestGenerator">
+                                                               
requestGenerator = <xsl:value-of select="requestGenerator"/>;
+                                                       </xsl:if>
+
+                                                       <![CDATA[
+                                                       var oAC = 
YAHOO.portico.autocompleteHelper('index.php?menuaction=booking.ui'+ui+'.index&phpgw_return_as=json&',
 
+                                                                               
 'filter_'+name+'_name', 'filter_'+name+'_id', 'filter_'+name+'_container');
+
+                                                       if (requestGenerator) {
+                                                               
oAC.generateRequest = requestGenerator;
+                                                       }
+
+                                                       if (itemSelectCallback) 
{
+                                                               
oAC.itemSelectEvent.subscribe(itemSelectCallback);
+                                                       }
+
+                                                       
YAHOO.util.Event.addBlurListener('filter_'+name+'_name', function()
+                                                       {
+                                                               if 
(YAHOO.util.Dom.get('filter_'+name+'_name').value == "")
+                                                               {
+                                                                       
YAHOO.util.Dom.get('filter_'+name+'_id').value = "";
+                                                                       if 
(onClearSelectionCallback) {
+                                                                               
onClearSelectionCallback();
+                                                                       }
+                                                               }
+                                                       });
+
+                                                       
YAHOO.portico.addPreSerializeQueryFormListener(function(form)
+                                                       {
+                                                               if 
(YAHOO.util.Dom.get('filter_'+name+'_name').value == "")
+                                                               {
+                                                                       
YAHOO.util.Dom.get('filter_'+name+'_id').value = "";
+                                                               } 
+                                                       });
+                                                       ]]>
+                                               });
+                                               </script>
+                                       </td>
+                               </xsl:when>
+                               <xsl:when test="type = 'filter'">
+                                       <td valign="top">
+                    <xsl:variable name="name"><xsl:value-of 
select="name"/></xsl:variable>
+                       
+                       <select id="{$name}" name="{$name}" 
onMouseout="window.status='';return true;">
+                        <xsl:for-each select="list">
+                               <xsl:variable name="id"><xsl:value-of 
select="id"/></xsl:variable>
+                                                       <xsl:if test="id = 
'NEW'">
+                                       <option value="{$id}" 
selected="selected">
+                                                                       
<xsl:value-of select="name"/>
+                                                               </option>
+                                                       </xsl:if>
+                                                       <xsl:if test="id != 
'NEW'">
+                                       <option value="{$id}">
+                                                                       
<xsl:value-of select="name"/>
+                                                               </option>
+                                                       </xsl:if>
+                        </xsl:for-each>
+                       </select>
+                    </td>
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <td valign="top">
+                                       <input id="innertoolbar">
+                                               <xsl:attribute 
name="type"><xsl:value-of select="phpgw:conditional(not(type), '', 
type)"/></xsl:attribute>
+                                               <xsl:attribute 
name="name"><xsl:value-of select="phpgw:conditional(not(name), '', 
name)"/></xsl:attribute>
+                                               <xsl:attribute 
name="onclick"><xsl:value-of select="phpgw:conditional(not(onClick), '', 
onClick)"/></xsl:attribute>
+                                               <xsl:attribute 
name="value"><xsl:value-of select="phpgw:conditional(not(value), '', 
value)"/></xsl:attribute>
+                                               <xsl:attribute 
name="href"><xsl:value-of select="phpgw:conditional(not(href), '', 
href)"/></xsl:attribute>
+                                               <xsl:attribute 
name="class"><xsl:value-of select="phpgw:conditional(not(class), '', 
class)"/></xsl:attribute>
+                                       </input>
+                                       </td>
+                               </xsl:otherwise>
+                       </xsl:choose>
+        </xsl:for-each>
+                 </tr>
+                       <xsl:if test="item/text and normalize-space(item/text)">
+                               <thead style="background:none">
+                                       <tr>
+                                               <xsl:for-each select="item">
+                                                       <td>
+                                                               <xsl:if 
test="name">
+                                                                       <label 
style='margin:auto 0.25em'>
+                                                                               
<xsl:attribute name="for"><xsl:value-of select="phpgw:conditional(not(name), 
'', name)"/></xsl:attribute>
+                                                                               
<xsl:value-of select="phpgw:conditional(not(text), '', text)"/>
+                                                                       </label>
+                                                               </xsl:if>
+                                                       </td>
+                                               </xsl:for-each>
+                                       </tr>
+                               </thead>
+                       </xsl:if>
+               </table>
+    </div>
+</xsl:template>
+
+<xsl:template match="datatable">
+    <div id="paginator"/>
+    <div id="datatable-container"/>
+       <xsl:call-template name="datasource-definition" />
+</xsl:template>
+
+
+<xsl:template name="datasource-definition">
+       <script>
+               YAHOO.namespace('controller');
+        
+               YAHOO.controller.columnDefs = [
+                               <xsl:for-each select="//datatable/field">
+                                       {
+                                               key: "<xsl:value-of 
select="key"/>",
+                                               <xsl:if test="label">
+                                               label: "<xsl:value-of 
select="label"/>",
+                                           </xsl:if>
+                                               sortable: <xsl:value-of 
select="phpgw:conditional(not(sortable = 0), 'true', 'false')"/>,
+                                               <xsl:if test="hidden">
+                                               hidden: true,
+                                           </xsl:if>
+                                               <xsl:if test="formatter">
+                                               formatter: <xsl:value-of 
select="formatter"/>,
+                                           </xsl:if>
+                                               className: "<xsl:value-of 
select="className"/>"
+                                       }<xsl:value-of 
select="phpgw:conditional(not(position() = last()), ',', '')"/>
+                               </xsl:for-each>
+                       ];
+
+               setDataSource('<xsl:value-of select="source"/>', 
YAHOO.controller.columnDefs, 'queryForm', ['building_types', 'cat_id', 
'district_id', 'part-of_town_list', 'responsibility_roles_list'], 
'datatable-container', '_form', '_paginator', null); 
+               
+       </script>
+        
+</xsl:template>
+<!-- 
 <xsl:template match="lists">
-
+ 
 <div style="background: none repeat scroll 0 0 #EDF5FF;border: 1px solid 
#243356;margin: 20px;padding: 20px;">
+-->
+               <!-- When control area is chosen an ajax request is executed. 
The operation fetches controls from db and populates the control list below.
+                        The ajax opearation is handled in file ajax.js 
+                -->
+                <!-- 
                <select id="control_area_list" name="control_area_list">
                        <xsl:for-each select="control_area_list">
                                <xsl:variable 
name="control_area_id"><xsl:value-of select="id"/></xsl:variable>
@@ -96,60 +315,5 @@
                    </xsl:for-each>
                </select>
        </div>
-
-
-
-       
 </xsl:template>
-
-
-
-       
-
-<xsl:template match="datatable">
-    <div id="paginator"/>
-    <div id="datatable-container"/>
-       <xsl:call-template name="datasource-definition" />
-</xsl:template>
-
-
-<xsl:template name="datasource-definition">
-       <script>
-               YAHOO.namespace('controller');
-       <!-- 
-               YAHOO.controller.setupDatasource = function() {
-                       <xsl:if test="source">
-                   YAHOO.controller.dataSourceUrl = '<xsl:value-of 
select="source"/>';
-                                       YAHOO.controller.initialSortedBy = 
false;
-                                       YAHOO.controller.initialFilters = false;
-                                       <xsl:if test="sorted_by">
-                                               
YAHOO.controller.initialSortedBy = {key: '<xsl:value-of 
select="sorted_by/key"/>', dir: '<xsl:value-of select="sorted_by/dir"/>'};
-                                       </xsl:if>
-               </xsl:if>
-*/
- -->
- 
- YAHOO.controller.columnDefs = [
-                               <xsl:for-each select="//datatable/field">
-                                       {
-                                               key: "<xsl:value-of 
select="key"/>",
-                                               <xsl:if test="label">
-                                               label: "<xsl:value-of 
select="label"/>",
-                                           </xsl:if>
-                                               sortable: <xsl:value-of 
select="phpgw:conditional(not(sortable = 0), 'true', 'false')"/>,
-                                               <xsl:if test="hidden">
-                                               hidden: true,
-                                           </xsl:if>
-                                               <xsl:if test="formatter">
-                                               formatter: <xsl:value-of 
select="formatter"/>,
-                                           </xsl:if>
-                                               className: "<xsl:value-of 
select="className"/>"
-                                       }<xsl:value-of 
select="phpgw:conditional(not(position() = last()), ',', '')"/>
-                               </xsl:for-each>
-                       ];
-
-               setDataSource('<xsl:value-of select="source"/>', 
YAHOO.controller.columnDefs, null, null, 'datatable-container', '_form', 
'_paginator', null); 
-               
-       </script>
-        
-</xsl:template>
\ No newline at end of file
+-->
\ No newline at end of file

Modified: branches/Version-1_0-branch/property/inc/class.soXport.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soXport.inc.php      
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/property/inc/class.soXport.inc.php      
2011-11-29 08:04:02 UTC (rev 8208)
@@ -227,6 +227,7 @@
                                                $fields['kostra_id'],
                                                $fields['pmwrkord_code'],
                                                $fields['bilagsnr'],
+                                               $fields['bilagsnr_ut'],
                                                $fields['splitt'],
                                                $fields['kildeid'],
                                                $fields['kidnr'],
@@ -262,7 +263,7 @@
 
                                        $values = 
$this->db->validate_insert($values);
 
-                                       $sql= "INSERT INTO fm_ecobilag 
(project_id,kostra_id,pmwrkord_code,bilagsnr,splitt,kildeid,kidnr,typeid,fakturadato,"
+                                       $sql= "INSERT INTO fm_ecobilag 
(project_id,kostra_id,pmwrkord_code,bilagsnr,bilagsnr_ut,splitt,kildeid,kidnr,typeid,fakturadato,"
                                                . " 
forfallsdato,regtid,artid,spvend_code,dimb,oppsynsmannid,saksbehandlerid,budsjettansvarligid,"
                                                . " 
fakturanr,spbudact_code,loc1,dima,dimd,mvakode,periode,merknad,oppsynsigndato,saksigndato,"
                                                . " 
budsjettsigndato,utbetalingsigndato,item_type,item_id,external_ref,currency,belop,godkjentbelop)"
@@ -274,7 +275,11 @@
                                }
                        }
 
-                       $this->db->query("UPDATE fm_idgenerator set value = 
{$bilagsnr} WHERE name = 'Bilagsnummer'");
+                       $now = time();
+                       $this->db->query("SELECT start_date FROM fm_idgenerator 
WHERE name='Bilagsnummer' AND start_date < {$now} ORDER BY start_date DESC");
+                       $this->db->next_record();
+                       $start_date = (int)$this->db->f('start_date');
+                       $this->db->query("UPDATE fm_idgenerator set value = 
{$bilagsnr} WHERE name = 'Bilagsnummer' AND start_date = {$start_date}");
 
                        $this->db->transaction_commit();
 
@@ -286,6 +291,7 @@
                        $values= array(
                                $data['id'],
                                $data['bilagsnr'],
+                               $data['bilagsnr_ut'],
                                $data['kidnr'],
                                $data['typeid'],
                                $data['kildeid'],
@@ -329,7 +335,7 @@
 
                        $values = $this->db->validate_insert($values);
 
-                       $sql="INSERT INTO fm_ecobilagoverf 
(id,bilagsnr,kidnr,typeid,kildeid,project_id,kostra_id,pmwrkord_code,fakturadato,"
+                       $sql="INSERT INTO fm_ecobilagoverf 
(id,bilagsnr,bilagsnr_ut,kidnr,typeid,kildeid,project_id,kostra_id,pmwrkord_code,fakturadato,"
                                . " 
periode,periodization,periodization_start,forfallsdato,fakturanr,spbudact_code,regtid,artid,spvend_code,dima,loc1,"
                                . " 
dimb,mvakode,dimd,oppsynsmannid,saksbehandlerid,budsjettansvarligid,oppsynsigndato,saksigndato,"
                                . " 
budsjettsigndato,merknad,splitt,utbetalingid,utbetalingsigndato,filnavn,overftid,item_type,item_id,external_ref,"
@@ -553,21 +559,24 @@
 
                function increment_batchid()
                {
-                       $this->db->query("update fm_idgenerator  set value = 
value + 1 where name = 'Ecobatchid'");
-                       $this->db->query("select value from fm_idgenerator  
where name = 'Ecobatchid'");
+                       $name = 'Ecobatchid';
+                       $now = time();
+                       $this->db->query("SELECT value, start_date FROM 
fm_idgenerator WHERE name='{$name}' AND start_date < {$now} ORDER BY start_date 
DESC");
                        $this->db->next_record();
-                       $bilagsnr = $this->db->f('value');
-                       return $bilagsnr;
+                       $next_id = $this->db->f('value') +1;
+                       $start_date = (int)$this->db->f('start_date');
+                       $this->db->query("UPDATE fm_idgenerator SET value = 
$next_id WHERE name = '{$name}' AND start_date = {$start_date}");
+
+                       return $next_id;
                }
 
                function next_batchid()
                {
-
-                       $this->db->query("select value from fm_idgenerator  
where name = 'Ecobatchid'");
+                       $now = time();
+                       $this->db->query("SELECT value FROM fm_idgenerator 
WHERE name = 'Ecobatchid' AND start_date < {$now} ORDER BY start_date DESC");
                        $this->db->next_record();
-                       $batchid = $this->db->f('value')+1;
-
-                       return $batchid;
+                       $next_id = $this->db->f('value') +1;
+                       return $next_id;
                }
 
                function get_responsible($b_abbount_id)

Modified: branches/Version-1_0-branch/property/inc/class.soadmin.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soadmin.inc.php      
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/property/inc/class.soadmin.inc.php      
2011-11-29 08:04:02 UTC (rev 8208)
@@ -26,6 +26,7 @@
        * @subpackage admin
        * @version $Id$
        */
+       phpgw::import_class('phpgwapi.datetime');
 
        /**
         * Description
@@ -68,35 +69,80 @@
 
                function read_fm_id()
                {
-                       $sql = "select * from fm_idgenerator ";
+                       $sql = "SELECT * FROM fm_idgenerator ORDER BY descr 
DESC,start_date DESC";
                        $this->db->query($sql,__LINE__,__FILE__);
 
+                       $name = '';
+                       $fm_ids = array();
                        while ($this->db->next_record())
                        {
-                               $fm_ids[] = array(
-                                       'descr'         => $this->db->f('name'),
-                                       'value'         => 
$this->db->f('value'),
-                                       'remark'        => 
$this->db->f('remark')
+                               $old = false;
+                               if($name == $this->db->f('name'))
+                               {
+                                       $old = true;
+                               }
+                               $new_name = $this->db->f('name');
+                               $fm_ids[] = array
+                               (
+                                       'name'                  => $new_name,
+                                       'descr'                 => 
$this->db->f('descr'),
+                                       'value'                 => 
$this->db->f('value'),
+                                       'start_date'    => 
$this->db->f('start_date'),
+                                       'old'                   => $old
                                );
-
+                               $name = $new_name;
                        }
 
-                       return $fm_ids;
+                       return array_reverse($fm_ids);
                }
 
-               function edit_id($values='')
+               function edit_id($values=array())
                {
-                       $field=$values['field'];
-                       $select=$values['select'];
+                       if(!isset($values['select']) || 
!is_array($values['select']))
+                       {
+                               return $receipt['message'][] = array('msg' => 
lang('Nothing to do'));
+                       }
 
-                       while($entry=each($select))
+                       $this->db->transaction_begin();
+                       foreach($values['select'] as $field)
                        {
-                               $n=$entry[0];
+                               $start_date = 
phpgwapi_datetime::date_to_timestamp($values['start_date'][$field]);
+                               
+                               if($start_date && $start_date < time())
+                               {
+                                       $receipt['error'][] = array('msg' => 
lang('Cannot go back in time for "%1"', $field));
+                                       continue;
+                               }
 
-                               $sql = "update  fm_idgenerator set 
value='$values[$n]' where name='$field[$n]'";
+                               $sql = "SELECT value,descr, max(start_date) as 
start_date FROM fm_idgenerator WHERE name='{$field}' GROUP BY value, descr 
ORDER BY start_date ASC";
                                $this->db->query($sql,__LINE__,__FILE__);
+                               while ($this->db->next_record())
+                               {
+                                       $value                  = 
$this->db->f('value');
+                                       $descr                  = 
$this->db->f('descr');
+                                       $old_start_date = 
$this->db->f('start_date');
+                               }
+
+                               if($start_date > $old_start_date)
+                               {
+                                       $sql = "INSERT INTO fm_idgenerator 
(name, descr, value, start_date ) VALUES ('{$field}','{$descr}', 
'{$values[$field]}','{$start_date}')";
+                                       
$this->db->query($sql,__LINE__,__FILE__);
+                               }
+                               else if ($start_date < $old_start_date)
+                               {
+                                       $sql = "DELETE FROM fm_idgenerator 
WHERE name = name AND start_date > {$start_date}";
+                                       
$this->db->query($sql,__LINE__,__FILE__);
+                                       $sql = "INSERT INTO fm_idgenerator 
(name, descr, value, start_date ) VALUES ('{$field}','{$descr}', 
'{$values[$field]}','{$start_date}')";
+                                       
$this->db->query($sql,__LINE__,__FILE__);
+                               }
+                               else
+                               {
+                                       $sql = "UPDATE fm_idgenerator SET value 
= '{$values[$field]}' WHERE name='{$field}' AND start_date  = {$start_date}";
+                                       
$this->db->query($sql,__LINE__,__FILE__);
+                               }
                        }
 
+                       $this->db->transaction_commit();
                        $receipt['message'][] = array('msg' => lang('ID is 
updated'));
                        return $receipt;
                }

Modified: branches/Version-1_0-branch/property/inc/class.socommon.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.socommon.inc.php     
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/property/inc/class.socommon.inc.php     
2011-11-29 08:04:02 UTC (rev 8208)
@@ -308,6 +308,7 @@
 
                function increment_id($name)
                {
+                       $now = time();
                        if($name == 'order') // FIXME: temporary hack
                        {
                                $name = 'workorder';
@@ -316,11 +317,12 @@
                        {
                                $name = 'workorder';
                        }
-                       $this->db->query("SELECT value FROM fm_idgenerator 
WHERE name='{$name}'");
+                       $this->db->query("SELECT value, start_date FROM 
fm_idgenerator WHERE name='{$name}' AND start_date < {$now} ORDER BY start_date 
DESC" );
                        $this->db->next_record();
                        $next_id = $this->db->f('value') +1;
+                       $start_date = (int)$this->db->f('start_date');
 
-                       $this->db->query("UPDATE fm_idgenerator SET value = 
$next_id WHERE name = '{$name}'");
+                       $this->db->query("UPDATE fm_idgenerator SET value = 
$next_id WHERE name = '{$name}' AND start_date = {$start_date}");
                        return $next_id;
                }
 

Modified: branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php    
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php    
2011-11-29 08:04:02 UTC (rev 8208)
@@ -934,16 +934,22 @@
 
                function increment_bilagsnr()
                {
-                       $this->db->query("UPDATE fm_idgenerator set value = 
value + 1 where name = 'Bilagsnummer'");
-                       $this->db->query("select value from fm_idgenerator 
where name = 'Bilagsnummer'");
+                       $name = 'Bilagsnummer';
+                       $now = time();
+                       $this->db->query("SELECT value, start_date FROM 
fm_idgenerator WHERE name = '{$name}' AND start_date < {$now} ORDER BY 
start_date DESC");
                        $this->db->next_record();
-                       $bilagsnr = $this->db->f('value');
+                       $bilagsnr = $this->db->f('value') +1;
+                       $start_date = (int)$this->db->f('start_date');
+
+                       $this->db->query("UPDATE fm_idgenerator SET value = 
value + 1 WHERE name = '{$name}' AND start_date = $start_date");
                        return $bilagsnr;
                }
 
                function next_bilagsnr()
                {
-                       $this->db->query("select value from fm_idgenerator 
where name = 'Bilagsnummer'");
+                       $name = 'Bilagsnummer';
+                       $now = time();
+                       $this->db->query("SELECT value FROM fm_idgenerator 
WHERE name = '{$name}' AND start_date < {$now} ORDER BY start_date DESC" );
                        $this->db->next_record();
                        $bilagsnr = $this->db->f('value')+1;
 

Modified: branches/Version-1_0-branch/property/inc/class.soproject.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soproject.inc.php    
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/property/inc/class.soproject.inc.php    
2011-11-29 08:04:02 UTC (rev 8208)
@@ -681,15 +681,23 @@
 
                function increment_project_id()
                {
-                       $this->db->query("update fm_idgenerator set value = 
value + 1 where name = 'project'");
+                       $name = 'project';
+                       $now = time();
+                       $this->db->query("SELECT value, start_date FROM 
fm_idgenerator WHERE name='{$name}' AND start_date < {$now} ORDER BY start_date 
DESC");
+                       $this->db->next_record();
+                       $next_id = $this->db->f('value') +1;
+                       $start_date = (int)$this->db->f('start_date');
+                       $this->db->query("UPDATE fm_idgenerator SET value = 
$next_id WHERE name = '{$name}' AND start_date = {$start_date}");
                }
 
                function next_project_id()
                {
-                       $this->db->query("select value from fm_idgenerator 
where name = 'project'");
+                       $name = 'project';
+                       $now = time();
+                       $this->db->query("SELECT value FROM fm_idgenerator 
WHERE name = '{$name}' AND start_date < {$now} ORDER BY start_date DESC");
                        $this->db->next_record();
-                       $project_id = $this->db->f('value')+1;
-                       return $project_id;
+                       $id = $this->db->f('value')+1;
+                       return $id;
                }
 
                function add($project, $values_attribute = array())

Modified: branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sorequest.inc.php    
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/property/inc/class.sorequest.inc.php    
2011-11-29 08:04:02 UTC (rev 8208)
@@ -684,12 +684,21 @@
 
                function increment_request_id()
                {
-                       $this->db->query("update fm_idgenerator set value = 
value + 1 where name = 'request'");
+                       $name = 'request';
+                       $now = time();
+                       $this->db->query("SELECT value, start_date FROM 
fm_idgenerator WHERE name='{$name}' AND start_date < {$now} ORDER BY start_date 
DESC");
+                       $this->db->next_record();
+                       $next_id = $this->db->f('value') +1;
+                       $start_date = (int)$this->db->f('start_date');
+                       $this->db->query("UPDATE fm_idgenerator SET value = 
$next_id WHERE name = '{$name}' AND start_date = {$start_date}");
+                       return $next_id;
                }
 
                function next_id()
                {
-                       $this->db->query("select value from fm_idgenerator 
where name = 'request'");
+                       $name = 'request';
+                       $now = time();
+                       $this->db->query("SELECT value FROM fm_idgenerator 
WHERE name = '{$name}' AND start_date < {$now} ORDER BY start_date DESC");
                        $this->db->next_record();
                        $id = $this->db->f('value')+1;
                        return $id;

Modified: branches/Version-1_0-branch/property/inc/class.soworkorder.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soworkorder.inc.php  
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/property/inc/class.soworkorder.inc.php  
2011-11-29 08:04:02 UTC (rev 8208)
@@ -60,7 +60,9 @@
 
                function next_id()
                {
-                       $this->db->query("select value from fm_idgenerator 
where name = 'workorder'");
+                       $name = 'workorder';
+                       $now = time();
+                       $this->db->query("SELECT value FROM fm_idgenerator 
WHERE name = '{$name}' AND start_date < {$now} ORDER BY start_date DESC");
                        $this->db->next_record();
                        $id = $this->db->f('value')+1;
                        return $id;
@@ -838,7 +840,13 @@
 
                function increment_workorder_id()
                {
-                       $this->db->query("update fm_idgenerator set value = 
value + 1 where name = 'workorder'");
+                       $name = 'workorder';
+                       $now = time();
+                       $this->db->query("SELECT value, start_date FROM 
fm_idgenerator WHERE name='{$name}' AND start_date < {$now} ORDER BY start_date 
DESC");
+                       $this->db->next_record();
+                       $next_id = $this->db->f('value') +1;
+                       $start_date = (int)$this->db->f('start_date');
+                       $this->db->query("UPDATE fm_idgenerator SET value = 
$next_id WHERE name = '{$name}' AND start_date = {$start_date}");
                }
 
                function add($workorder)

Modified: branches/Version-1_0-branch/property/inc/class.uiadmin.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiadmin.inc.php      
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/property/inc/class.uiadmin.inc.php      
2011-11-29 08:04:02 UTC (rev 8208)
@@ -602,28 +602,18 @@
                                $receipt = $this->bo->edit_id($values);
                        }
 
-                       $fm_ids = $this->bo->read_fm_id();
+                       $content = $this->bo->read_fm_id();
 
-                       for ($i=0;$i<count($fm_ids);$i++)
-                       {
+                       $jscal = CreateObject('phpgwapi.jscalendar');
 
-                               $content[] = array
-                                       (
-                                               'descr'         => 
$fm_ids[$i]['descr'],
-                                               'value'         => 
$fm_ids[$i]['value'],
-                                               'remark'        => 
$fm_ids[$i]['remark'],
-                                               'key_id'        => $i
-                                       );
+                       $dateformat     = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+                       foreach($content as $i => & $entry)
+                       {
+                               $jscal->add_listener("date_{$entry['name']}");
+                               $entry['key_id'] = $i;
+                               $entry['start_date']    = 
$GLOBALS['phpgw']->common->show_date($entry['start_date'],$dateformat);
                        }
-
-                       $table_header[] = array
-                               (
-                                       'lang_select'           => 
lang('Select'),
-                                       'lang_descr'            => 
lang('Descr'),
-                                       'lang_value'            => 
lang('Value'),
-                                       'lang_remark'           => 
lang('Remark'),
-                               );
-
+//_debug_array($content);die();
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
                        $data = array
@@ -636,12 +626,9 @@
                                        'lang_add_statustext'   => lang('Edit 
ID'),
                                        'lang_done'                             
=> lang('done'),
                                        'lang_done_statustext'  => lang('Back 
to Admin'),
-                                       'lang_select'                   => 
lang('Select'),
-                                       'lang_descr'                    => 
lang('Descr'),
-                                       'lang_value'                    => 
lang('Value'),
-                                       'lang_remark'                   => 
lang('Remark'),
-                                       'id_table_header'               => 
$table_header,
                                        'id_values'                             
=> $content,
+                                       'img_cal'                               
=> $GLOBALS['phpgw']->common->image('phpgwapi','cal'),
+                                       'lang_datetitle'                => 
lang('Select date'),
                                );
 
                        $appname        = lang('ID');

Modified: branches/Version-1_0-branch/property/inc/class.uiinvoice.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiinvoice.inc.php    
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/property/inc/class.uiinvoice.inc.php    
2011-11-29 08:04:02 UTC (rev 8208)
@@ -664,11 +664,49 @@
                                        )
                                );
 
+                       $periodization_list = 
execMethod('property.bogeneric.get_list', array('type'=>'periodization'));
+
+                       $jscode = <<<JS
+                           var myPeriodizationDropDown = function(elCell, 
oRecord, oColumn, oData)
+                               {
+JS;
+                       $jscode .= <<<JS
+                               var _label = new String(oData);
+                               tmp_count = oRecord._oData.counter_num;
+                               voucher_id = oRecord._oData.voucher_id_num
+                           elCell.innerHTML = "<div 
id=\"divPeriodizationDropDown"+tmp_count+"\"></div>";
+
+                           var tmp_button = new YAHOO.widget.Button({
+                                type:"menu",
+                                id:"oPeriodizationDropDown"+tmp_count,
+                                label: "<en>" +_label+"</en>",
+                                value: oData,
+                                container: 
"divPeriodizationDropDown"+tmp_count,
+                                menu: [
+
+JS;
+                   foreach ($periodization_list as $key => 
$periodization_entry)
+               {
+                               $jscode_arr[] = "{ text: 
'{$periodization_entry['name']}', value: '{$periodization_entry['id']}', 
onclick: { fn: onPeriodizationDropDownItemClick, idvoucher: voucher_id, id: 
'{$periodization_entry['id']}'} }";
+               }
+
+                       $jscode_inner = implode(",\n",  $jscode_arr);
+                       $jscode .= <<<JS
+                       $jscode_inner
+                       ]});
+
+                                       //Define this variable in the window 
scope (GLOBAL)
+                                       
eval("window.oPeriodizationDropDown"+tmp_count+" = tmp_button");
+                               }
+JS;
+                               $GLOBALS['phpgw']->js->add_code('', $jscode);
+
                        } //-- of if( phpgw::get_var('phpgw_return_as') != 
'json' )
 
                        $content = array();
                        //the first time, $content is empty, because 
$user_lid=''.In the seconfd time, user_lid=all; It is done using  base_java_url.
                        $content = 
$this->bo->read_invoice($paid,$start_date,$end_date,$vendor_id,$loc1,$workorder_id,$voucher_id);
+                       
 
                        $uicols = array (
                                'input_type'    =>      array
@@ -1271,7 +1309,7 @@
                                        'currentPage'           => 
$datatable['sorting']['currentPage'],
                                        'records'                       => 
array(),
                                        'sum_amount'            => 
$this->bo->sum_amount,
-                                       'periodization'         => $paid ? 
array() : execMethod('property.bogeneric.get_list', 
array('type'=>'periodization'))
+                                       'periodization'         => $paid ? 
array() : $periodization_list
                                );
 
                        // values for datatable

Modified: branches/Version-1_0-branch/property/inc/class.uiproject.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiproject.inc.php    
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/property/inc/class.uiproject.inc.php    
2011-11-29 08:04:02 UTC (rev 8208)
@@ -1613,6 +1613,7 @@
                                        'dimb'                                  
=> $entry['dimb'],
                                        'dimd'                                  
=> $entry['dimd'],
                                        'amount'                                
=> $entry['amount'],
+                                       'approved_amount'               => 
$entry['approved_amount'],
                                        'vendor'                                
=> $entry['vendor'],
                                        'paid_percent'                  => 
$entry['paid_percent'],
                                        'project_group'                 => 
$entry['project_id'],
@@ -1633,7 +1634,6 @@
                                        'footer'                                
=> 0
                                );
 
-
                        $myColumnDefs[2] = array
                                (
                                        'name'          => "2",
@@ -1641,7 +1641,8 @@
                                                                                
                                array('key' => 
'voucher_id','label'=>lang('bilagsnr'),'sortable'=>false,'resizeable'=>true,'formatter'=>'YAHOO.widget.DataTable.formatLink_voucher'),
                                                                                
                                array('key' => 
'invoice_id','label'=>lang('invoice 
number'),'sortable'=>false,'resizeable'=>true),
                                                                                
                                array('key' => 
'vendor','label'=>lang('vendor'),'sortable'=>false,'resizeable'=>true),
-                                                                               
                                array('key' => 
'amount','label'=>lang('amount'),'sortable'=>false,'resizeable'=>true),
+                                                                               
                                array('key' => 
'amount','label'=>lang('amount'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterRight'),
+                                                                               
                                array('key' => 
'approved_amount','label'=>lang('approved 
amount'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterRight'),
                                                                                
                                array('key' => 
'currency','label'=>lang('currency'),'sortable'=>false,'resizeable'=>true),
                                                                                
                                array('key' => 
'budget_responsible','label'=>lang('budget 
responsible'),'sortable'=>false,'resizeable'=>true),
                                                                                
                                array('key' => 
'budsjettsigndato','label'=>lang('budsjettsigndato'),'sortable'=>false,'resizeable'=>true),

Modified: branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php  
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php  
2011-11-29 08:04:02 UTC (rev 8208)
@@ -1470,6 +1470,7 @@
                                        'dimb'                                  
=> $entry['dimb'],
                                        'dimd'                                  
=> $entry['dimd'],
                                        'amount'                                
=> $entry['amount'],
+                                       'approved_amount'               => 
$entry['approved_amount'],
                                        'vendor'                                
=> $entry['vendor'],
                                        'paid_percent'                  => 
$entry['paid_percent'],
                                        'project_group'                 => 
$entry['project_id'],
@@ -1497,7 +1498,8 @@
                                        'values'        =>      
json_encode(array(      array('key' => 
'voucher_id','label'=>lang('bilagsnr'),'sortable'=>false,'resizeable'=>true,'formatter'=>'YAHOO.widget.DataTable.formatLink'),
                                                                                
                                array('key' => 
'invoice_id','label'=>lang('invoice 
number'),'sortable'=>false,'resizeable'=>true),
                                                                                
                                array('key' => 
'vendor','label'=>lang('vendor'),'sortable'=>false,'resizeable'=>true),
-                                                                               
                                array('key' => 
'amount','label'=>lang('amount'),'sortable'=>false,'resizeable'=>true),
+                                                                               
                                array('key' => 
'amount','label'=>lang('amount'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterRight'),
+                                                                               
                                array('key' => 
'approved_amount','label'=>lang('approved 
amount'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterRight'),
                                                                                
                                array('key' => 
'currency','label'=>lang('currency'),'sortable'=>false,'resizeable'=>true),
                                                                                
                                array('key' => 
'budget_responsible','label'=>lang('budget 
responsible'),'sortable'=>false,'resizeable'=>true),
                                                                                
                                array('key' => 
'budsjettsigndato','label'=>lang('budsjettsigndato'),'sortable'=>false,'resizeable'=>true),

Modified: 
branches/Version-1_0-branch/property/inc/cron/default/Import_fra_basware_X205.php
===================================================================
--- 
branches/Version-1_0-branch/property/inc/cron/default/Import_fra_basware_X205.php
   2011-11-29 06:44:47 UTC (rev 8207)
+++ 
branches/Version-1_0-branch/property/inc/cron/default/Import_fra_basware_X205.php
   2011-11-29 08:04:02 UTC (rev 8208)
@@ -359,7 +359,7 @@
 //                                     $_data['SUPPLIERREF']; // => 7869
                                        $_data['VATAMOUNT']; // => 62500
                                        
-                                       $bilagsnr = isset($_data['VOUCHERID']) 
? $_data['VOUCHERID'] : ''; // FIXME: innkommende bilagsnummer?
+                                       $bilagsnr_ut = 
isset($_data['VOUCHERID']) ? $_data['VOUCHERID'] : ''; // FIXME: innkommende 
bilagsnummer?
 
                                        $order_id               = 
$_data['PURCHASEORDERNO'];
                                        $fakturanr              = $_data['KEY'];
@@ -395,7 +395,7 @@
                                        $buffer[$i]['godkjentbelop']    = 
$belop;
                                        
                                        $buffer[$i]['kidnr']                    
= $kidnr;
-                                       $buffer[$i]['bilagsnr']                 
= $bilagsnr;
+                                       $buffer[$i]['bilagsnr_ut']              
= $bilagsnr_ut;
                                        $buffer[$i]['referanse']                
= "ordre: {$order_id}";
 
                                        $order_info = 
$this->get_order_info($order_id);

Modified: branches/Version-1_0-branch/property/inc/export/default/Basware_X114
===================================================================
--- branches/Version-1_0-branch/property/inc/export/default/Basware_X114        
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/property/inc/export/default/Basware_X114        
2011-11-29 08:04:02 UTC (rev 8208)
@@ -187,7 +187,7 @@
                        if($rollback_voucher)
                        {
                                $rollback_voucher = (int)$rollback_voucher;
-                               $sql="SELECT * FROM fm_ecobilagoverf WHERE 
bilagsnr = {$rollback_voucher}";
+                               $sql="SELECT * FROM fm_ecobilagoverf WHERE 
bilagsnr_ut = {$rollback_voucher}";
                        }
                        else
                        {
@@ -202,6 +202,7 @@
                                (
                                        'id'                                    
=> $this->db->f('id'),
                                        'bilagsnr'                              
=> $this->db->f('bilagsnr'),
+                                       'bilagsnr_ut'                   => 
$this->db->f('bilagsnr_ut'),
                                        'kidnr'                                 
=> $this->db->f('kidnr'),
                                        'typeid'                                
=> $this->db->f('typeid'),
                                        'kildeid'                               
=> $this->db->f('kildeid'),
@@ -258,6 +259,7 @@
                                $BilagOverf['kostra_id'],
                                $BilagOverf['pmwrkord_code'],
                                $BilagOverf['bilagsnr'],
+                               $BilagOverf['bilagsnr_ut'],
                                $BilagOverf['splitt'],
                                $BilagOverf['kildeid'],
                                $BilagOverf['kidnr'],
@@ -298,7 +300,7 @@
                        
                        $values = $this->db->validate_insert($values);
 
-                       $sql= "INSERT INTO fm_ecobilag 
(project_id,kostra_id,pmwrkord_code,bilagsnr,splitt,kildeid,kidnr,typeid,"
+                       $sql= "INSERT INTO fm_ecobilag 
(project_id,kostra_id,pmwrkord_code,bilagsnr,bilagsnr_ut,splitt,kildeid,kidnr,typeid,"
                        . " 
fakturadato,forfallsdato,regtid,artid,spvend_code,dimb,oppsynsmannid,"
                        . " 
saksbehandlerid,budsjettansvarligid,fakturanr,spbudact_code,dima,loc1,dimd,mvakode,"
                        . " 
periode,periodization,periodization_start,merknad,utbetalingid,oppsynsigndato,saksigndato,budsjettsigndato,utbetalingsigndato,"
@@ -528,7 +530,30 @@
 
                        $this->db->transaction_begin();
 
-                       $tranfser_bilag = array($oRsBilag[0]['bilagsnr']);
+                       $get_bilagsnr_ut = false;
+                       if(!$bilagsnr_ut = $oRsBilag[0]['external_ref'])
+                       {
+                               foreach ($oRsBilag as $line)
+                               {
+                                       if(abs($line['godkjentbelop']) > 0)
+                                       {
+                                               $get_bilagsnr_ut = true;
+                                       }
+                               }
+
+                               if($get_bilagsnr_ut)
+                               {
+                                       $this->db->query("UPDATE fm_idgenerator 
SET value = value + 1 WHERE name = 'bilagsnr_ut'");
+                                       $this->db->query("SELECT value FROM 
fm_idgenerator WHERE name = 'bilagsnr_ut'");
+                                       $this->db->next_record();
+                                       $bilagsnr_ut = $this->db->f('value');
+
+                                       $this->db->query("UPDATE fm_ecobilag 
SET bilagsnr_ut = {$bilagsnr_ut} WHERE bilagsnr = '$voucher_id'");
+                               }
+                       }
+
+                       $tranfser_bilag = array($bilagsnr_ut);
+
                        $localtime = phpgwapi_datetime::user_localtime();
 
                        $transactioninformation = array
@@ -553,7 +578,7 @@
                                (
                                        'TRANSACTIONTYPE'                       
=> 'X114',
                                        'KEY'                                   
        => '', //dummy
-                                       'VOUCHERID'                             
        => $oRsBilag[0]['bilagsnr'], // 70903541
+                                       'VOUCHERID'                             
        => $bilagsnr_ut,
                                        'SCANNINGNO'                            
=> $oRsBilag[0]['external_ref'], // 11E28NJINL3VR6
                                        'PROFILE'                               
        => 'TRAINVPOMA',
                                        'CLIENT.CODE'                           
=> $this->client_code, //14,
@@ -787,7 +812,6 @@
                
        protected function get_voucher($bilagsnr)
        {
-                       $bilagsnr = $bilagsnr;
                        $sql= "SELECT fm_ecobilag.*,fm_ecouser.initials as 
saksbehandler FROM fm_ecobilag $this->join fm_ecouser ON 
fm_ecobilag.budsjettansvarligid=fm_ecouser.lid WHERE bilagsnr = {$bilagsnr}";
                        $this->db->query($sql,__LINE__,__FILE__);
 
@@ -798,6 +822,7 @@
                                (
                                        'id'                                    
=> $this->db->f('id'),
                                        'bilagsnr'                              
=> $bilagsnr,
+                                       'bilagsnr_ut'                   => 
$this->db->f('bilagsnr_ut'),
                                        'kidnr'                                 
=> $this->db->f('kidnr'),
                                        'typeid'                                
=> $this->db->f('typeid'),
                                        'kildeid'                               
=> $this->db->f('kildeid'),

Modified: branches/Version-1_0-branch/property/js/yahoo/invoice.index.js
===================================================================
--- branches/Version-1_0-branch/property/js/yahoo/invoice.index.js      
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/property/js/yahoo/invoice.index.js      
2011-11-29 08:04:02 UTC (rev 8208)
@@ -167,42 +167,6 @@
     }
 
        
/********************************************************************************
-       * Format column myPeriodizationDropDown
-       */
-    var myPeriodizationDropDown = function(elCell, oRecord, oColumn, oData)
-       {
-               var periodization = values_ds.periodization;
-
-               for(i=0; i<periodization.length; i++)
-               {
-//                     alert(periodization[i].name);
-               }
-
-               var _label = new String(oData);
-
-//alert(_label);
-               tmp_count = oRecord._oData.counter_num;
-               voucher_id = oRecord._oData.voucher_id_num
-           elCell.innerHTML = "<div 
id=\"divPeriodizationDropDown"+tmp_count+"\"></div>";
-
-           var tmp_button = new YAHOO.widget.Button({
-                 type:"menu",
-                 id:"oPeriodizationDropDown"+tmp_count,
-//                 label: "<en>" +periodization[0].id+"</en>",
-                 label: "<en>" +_label+"</en>",
-                 value: oData,
-                 container: "divPeriodizationDropDown"+tmp_count,
-                 menu: [
-                               { text: periodization[0].name, value: 
periodization[0].id, onclick: { fn: onPeriodizationDropDownItemClick, 
idvoucher: voucher_id, id: periodization[0].id} },
-                                           { text: periodization[1].name, 
value: periodization[1].id, onclick: { fn: onPeriodizationDropDownItemClick, 
idvoucher: voucher_id, id: periodization[1].id} },
-                                           { text: periodization[2].name, 
value: periodization[2].id, onclick: { fn: onPeriodizationDropDownItemClick, 
idvoucher: voucher_id, id: periodization[2].id} }
-                                           ]});
-           //Define this variable in the window scope (GLOBAL)
-        eval("window.oPeriodizationDropDown"+tmp_count+" = tmp_button");
-
-    }
-
-       
/********************************************************************************
         * CLick option combobox Periodization
 
         */

Modified: branches/Version-1_0-branch/property/js/yahoo/project.edit.js
===================================================================
--- branches/Version-1_0-branch/property/js/yahoo/project.edit.js       
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/property/js/yahoo/project.edit.js       
2011-11-29 08:04:02 UTC (rev 8208)
@@ -32,17 +32,18 @@
 
/********************************************************************************/
     
        this.myParticularRenderEvent = function()
        {
-               this.addFooterDatatable(myPaginator_0,myDataTable_0);
+               this.addFooterDatatable0(myPaginator_0,myDataTable_0);
+               this.addFooterDatatable1(myPaginator_2,myDataTable_2);
        }
 
 
/********************************************************************************/
-       this.addFooterDatatable = function(paginator,datatable)
+       this.addFooterDatatable0 = function(paginator,datatable)
        {
-               //call getSumPerPage(name of column) in property.js
-               tmp_sum1 = getSumPerPage('budget',2,paginator,datatable);
-               tmp_sum2 = getSumPerPage('calculation',2,paginator,datatable);
-               tmp_sum3 = getSumPerPage('actual_cost',2,paginator,datatable);
-               tmp_sum4 = getSumPerPage('contract_sum',2,paginator,datatable);
+               //call getTotalSum(name of column) in property.js
+               tmp_sum1 = getTotalSum('budget',2,paginator,datatable);
+               tmp_sum2 = getTotalSum('calculation',2,paginator,datatable);
+               tmp_sum3 = getTotalSum('actual_cost',2,paginator,datatable);
+               tmp_sum4 = getTotalSum('contract_sum',2,paginator,datatable);
 
                if(typeof(tableYUI)=='undefined')
                {
@@ -63,13 +64,44 @@
                td_sum(tmp_sum1);
                td_sum(tmp_sum2);
                td_sum(tmp_sum3);
-               td_empty(3);
+               td_empty(5);
 
                myfoot = tableYUI.createTFoot();
                myfoot.setAttribute("id","myfoot");
                myfoot.appendChild(newTR);
        }
 
+/********************************************************************************/
+       this.addFooterDatatable1 = function(paginator,datatable)
+       {
+               //call getTotalSum(name of column) in property.js
+               tmp_sum1 = getTotalSum('amount',2,paginator,datatable);
+               tmp_sum2 = getTotalSum('approved_amount',2,paginator,datatable);
+
+               if(typeof(tableYUI2)=='undefined')
+               {
+                       tableYUI2 = 
YAHOO.util.Dom.getElementsByClassName("yui-dt-data","tbody")[1].parentNode;
+                       tableYUI2.setAttribute("id","tableYUI");
+               }
+               else
+               {
+                       tableYUI2.deleteTFoot();
+               }
+
+               //Create ROW
+               newTR = document.createElement('tr');
+
+               td_sum('Sum');
+               td_empty(3);
+               td_sum(tmp_sum1);
+               td_sum(tmp_sum2);
+               td_empty(4);
+
+               myfoot = tableYUI2.createTFoot();
+               myfoot.setAttribute("id","myfoot");
+               myfoot.appendChild(newTR);
+       }
+
  
/********************************************************************************/
 
 YAHOO.util.Event.addListener(window, "load", function()

Modified: branches/Version-1_0-branch/property/js/yahoo/property2.js
===================================================================
--- branches/Version-1_0-branch/property/js/yahoo/property2.js  2011-11-29 
06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/property/js/yahoo/property2.js  2011-11-29 
08:04:02 UTC (rev 8208)
@@ -31,6 +31,27 @@
 
 
/********************************************************************************/
 
+       this.getTotalSum = function(name_column,round,paginator,datatable)
+       {
+               if(!paginator.getPageRecords())
+               {
+                       return;
+               }
+               begin = end = 0;
+               end = datatable.getRecordSet().getLength();
+
+               tmp_sum = 0;
+               for(i = begin; i < end; i++)
+               {
+                       tmp_sum = tmp_sum + 
parseFloat(datatable.getRecordSet().getRecords(0)[i].getData(name_column));
+               }
+
+               return tmp_sum = YAHOO.util.Number.format(tmp_sum, 
{decimalPlaces:round, decimalSeparator:",", thousandsSeparator:" "});
+       }
+
+
+/********************************************************************************/
+
        this.td_empty = function(colspan)
        {
                newTD = document.createElement('td');

Modified: branches/Version-1_0-branch/property/js/yahoo/workorder.edit.js
===================================================================
--- branches/Version-1_0-branch/property/js/yahoo/workorder.edit.js     
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/property/js/yahoo/workorder.edit.js     
2011-11-29 08:04:02 UTC (rev 8208)
@@ -26,7 +26,8 @@
        this.addFooterDatatable = function(paginator,datatable)
        {
                //call getSumPerPage(name of column) in property.js
-               tmp_sum1 = getSumPerPage('amount',2,paginator,datatable);
+               tmp_sum1 = getTotalSum('amount',2,paginator,datatable);
+               tmp_sum2 = getTotalSum('approved_amount',2,paginator,datatable);
 
                if(typeof(tableYUI)=='undefined')
                {
@@ -44,7 +45,8 @@
                td_sum('Sum');
                td_empty(2);
                td_sum(tmp_sum1);
-               td_empty(3);
+               td_sum(tmp_sum2);
+               td_empty(4);
 
                myfoot = tableYUI.createTFoot();
                myfoot.setAttribute("id","myfoot");
@@ -53,6 +55,13 @@
 
  
/********************************************************************************/
 
+/********************************************************************************/
     
+       var FormatterRight = function(elCell, oRecord, oColumn, oData)
+       {
+               elCell.innerHTML = "<div align=\"right\">"+oData+"</div>";
+       }       
+       
+/********************************************************************************/
     
 
 
 YAHOO.util.Event.addListener(window, "load", function()

Modified: branches/Version-1_0-branch/property/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/setup.inc.php    2011-11-29 
06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/property/setup/setup.inc.php    2011-11-29 
08:04:02 UTC (rev 8208)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['property']['name']                 = 'property';
-       $setup_info['property']['version']              = '0.9.17.626';
+       $setup_info['property']['version']              = '0.9.17.628';
        $setup_info['property']['app_order']    = 8;
        $setup_info['property']['enable']               = 1;
        $setup_info['property']['app_group']    = 'office';

Modified: branches/Version-1_0-branch/property/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/tables_current.inc.php   
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/property/setup/tables_current.inc.php   
2011-11-29 08:04:02 UTC (rev 8208)
@@ -1015,6 +1015,7 @@
                        'fd' => array(
                                'id' => array('type' => 'auto','precision' => 
'4','nullable' => False),
                                'bilagsnr' => array('type' => 'int','precision' 
=> '4','nullable' => False),
+                               'bilagsnr_ut' => array('type' => 
'int','precision' => '4','nullable' => False),
                                'kidnr' => array('type' => 
'varchar','precision' => '30','nullable' => True),
                                'typeid' => array('type' => 'int','precision' 
=> '2','nullable' => False),
                                'kildeid' => array('type' => 'int','precision' 
=> '2','nullable' => False),
@@ -1066,6 +1067,7 @@
                        'fd' => array(
                                'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
                                'bilagsnr' => array('type' => 'int','precision' 
=> '4','nullable' => False),
+                               'bilagsnr_ut' => array('type' => 
'int','precision' => '4','nullable' => False),
                                'kidnr' => array('type' => 
'varchar','precision' => '30','nullable' => True),
                                'typeid' => array('type' => 'int','precision' 
=> '2','nullable' => False),
                                'kildeid' => array('type' => 'int','precision' 
=> '2','nullable' => False),
@@ -1421,12 +1423,12 @@
                'fm_idgenerator' => array(
                        'fd' => array(
                                'name' => array('type' => 'varchar','precision' 
=> '30','nullable' => False),
+                               'start_date' => array('type' => 
'int','precision' => '4','nullable' => False,'default' => '0'),
                                'value' => array('type' => 'int','precision' => 
'4','nullable' => False),
                                'increment' => array('type' => 
'int','precision' => '4','nullable' => True),
-                               'maxvalue' => array('type' => 'int','precision' 
=> '2','nullable' => True),
-                               'descr' => array('type' => 
'varchar','precision' => '30','nullable' => True)
+                               'descr' => array('type' => 
'varchar','precision' => '30','nullable' => True),
                        ),
-                       'pk' => array('name'),
+                       'pk' => array('name','start_date'),
                        'fk' => array(),
                        'ix' => array(),
                        'uc' => array()

Modified: branches/Version-1_0-branch/property/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/tables_update.inc.php    
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/property/setup/tables_update.inc.php    
2011-11-29 08:04:02 UTC (rev 8208)
@@ -5514,6 +5514,55 @@
        }
 
        /**
+       * Update property version from 0.9.17.626 to 0.9.17.627
+       * Add assign voucher id on export from system
+       */
+       $test[] = '0.9.17.626';
+       function property_upgrade0_9_17_626()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_ecobilag','bilagsnr_ut',array('type'
 => 'int','precision' => 4,'nullable' => True));
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_ecobilagoverf','bilagsnr_ut',array('type'
 => 'int','precision' => 4,'nullable' => True));
+
+               
$GLOBALS['phpgw_setup']->oProc->DropColumn('fm_idgenerator',array(),'maxvalue');
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_idgenerator','date_from',array('type'
 => 'int','precision' => 4,'nullable' => True,'default' => '0'));
+
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
fm_idgenerator(name,value,descr) "
+                       . "VALUES('bilagsnr_ut', 0, 'Bilagsnummer 
utgående')",__LINE__,__FILE__);
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.627';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }
+
+       /**
+       * Update property version from 0.9.17.626 to 0.9.17.627
+       * Add assign voucher id on export from system
+       */
+       $test[] = '0.9.17.627';
+       function property_upgrade0_9_17_627()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               
$GLOBALS['phpgw_setup']->oProc->RenameColumn('fm_idgenerator','date_from','start_date');
+               $GLOBALS['phpgw_setup']->oProc->query('ALTER TABLE 
fm_idgenerator DROP CONSTRAINT fm_idgenerator_pkey',__LINE__,__FILE__);
+               $GLOBALS['phpgw_setup']->oProc->query('ALTER TABLE 
fm_idgenerator ADD CONSTRAINT fm_idgenerator_pkey PRIMARY 
KEY(name,start_date)',__LINE__,__FILE__);
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.628';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }
+
+
+
+
+
+       /**
        * Update property version from 0.9.17.607 to 0.9.17.608
        * Add more room for address at tickets
        * 

Modified: branches/Version-1_0-branch/property/templates/base/admin.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/admin.xsl       
2011-11-29 06:44:47 UTC (rev 8207)
+++ branches/Version-1_0-branch/property/templates/base/admin.xsl       
2011-11-29 08:04:02 UTC (rev 8208)
@@ -753,10 +753,11 @@
 
 <!-- edit_id -->       
 
-       <xsl:template match="id_values">
+       <xsl:template match="id_values" xmlns:php="http://php.net/xsl";>
                <xsl:variable name="value"><xsl:value-of 
select="value"/></xsl:variable>
                <xsl:variable name="key_id"><xsl:value-of 
select="key_id"/></xsl:variable>
                <xsl:variable name="descr"><xsl:value-of 
select="descr"/></xsl:variable>
+               <xsl:variable name="name"><xsl:value-of 
select="name"/></xsl:variable>
                <tr>
                        <xsl:attribute name="class">
                                <xsl:choose>
@@ -772,46 +773,62 @@
                                </xsl:choose>
                        </xsl:attribute>
 
-                       <td align="right">
-                               <INPUT type="checkbox" 
name="values[select][{$key_id}]" value="true"></INPUT>
+                       <td align="center">
+                               <INPUT type="checkbox" name="values[select][]" 
value="{$name}">
+                                       <xsl:if test="old = '1'">
+                                               <xsl:attribute name="disabled">
+                                                       
<xsl:text>disabled</xsl:text>
+                                               </xsl:attribute>
+                                       </xsl:if>
+                               </INPUT>
                        </td>
-                       <td align="right">
+                       <td align="left">
                                <xsl:value-of select="descr"/>
                        </td>
                        <td>
-                               <INPUT type="hidden" 
name="values[field][{$key_id}]" value="{$descr}" ></INPUT>
-                               <INPUT type="text" name="values[{$key_id}]" 
value="{$value}" ></INPUT>
+                               <INPUT type="text" name="values[{$name}]" 
value="{$value}" ></INPUT>
                        </td>
-                       <td align="center">
-                               <xsl:value-of select="remark"/>
+                       <td>
+                       <xsl:choose>
+                               <xsl:when test="old != '1'">
+                                       <input type="text" id="date_{$name}" 
name="values[start_date][{$name}]" size="10" value="{start_date}" 
readonly="readonly">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="lang_date_statustext"/>
+                                               </xsl:attribute>
+                                       </input>
+                                       <img id="date_{$name}-trigger" 
src="{//img_cal}" alt="{//lang_datetitle}" title="{//lang_datetitle}" 
style="cursor:pointer; cursor:hand;" />
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <xsl:value-of select="start_date"/>
+                               </xsl:otherwise>
+                       </xsl:choose>
                        </td>
                </tr>
        </xsl:template>
 
-       <xsl:template match="id_table_header">
+       <xsl:template name="id_table_header" xmlns:php="http://php.net/xsl";>
                <tr class="th">
-                       <td class="th_text" width="10%" align="right">
-                               <xsl:value-of select="lang_select"/>
+                       <td class="th_text" width="10%" align="center">
+                               <xsl:value-of select="php:function('lang', 
'select')" />
                        </td>
-                       <td class="th_text" width="10%" align="right">
-                               <xsl:value-of select="lang_descr"/>
+                       <td class="th_text" width="40%" align="left">
+                               <xsl:value-of select="php:function('lang', 
'descr')" />
                        </td>
-                       <td class="th_text" width="40%">
-                               <xsl:value-of select="lang_value"/>
+                       <td class="th_text" width="30%">
+                               <xsl:value-of select="php:function('lang', 
'value')" />
                        </td>
                        <td class="th_text" width="20%" align="center">
-                               <xsl:value-of select="lang_remark"/>
+                               <xsl:value-of select="php:function('lang', 
'date')" />
                        </td>
                </tr>
        </xsl:template>
 
-       <xsl:template match="edit_id">
-
-               <table cellpadding="2" cellspacing="2" width="100%" 
align="center">
+       <xsl:template match="edit_id" xmlns:php="http://php.net/xsl";>
+               <table cellpadding="2" cellspacing="2" width="90%" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">
                                        <tr>
-                                               <td align="left" colspan="3">
+                                               <td align="left" colspan="4">
                                                        <xsl:call-template 
name="msgbox"/>
                                                </td>
                                        </tr>
@@ -819,16 +836,14 @@
                        </xsl:choose>
                        <xsl:variable name="form_action"><xsl:value-of 
select="form_action"/></xsl:variable>
                        <form method="post" action="{$form_action}">
-                               <xsl:apply-templates select="id_table_header"/> 
+                               <xsl:call-template name="id_table_header"/> 
                                <xsl:apply-templates select="id_values"/> 
                                <tr height="50">
                                        <td>
                                                <xsl:variable 
name="lang_save"><xsl:value-of select="lang_save"/></xsl:variable>
-                                               <input type="submit" 
name="values[save]" value="{$lang_save}" onMouseout="window.status='';return 
true;">
-                                                       <xsl:attribute 
name="onMouseover">
-                                                               
<xsl:text>window.status='</xsl:text>
+                                               <input type="submit" 
name="values[save]" value="{$lang_save}">
+                                                       <xsl:attribute 
name="title">
                                                                <xsl:value-of 
select="lang_save_statustext"/>
-                                                               <xsl:text>'; 
return true;</xsl:text>
                                                        </xsl:attribute>
                                                </input>
                                        </td>
@@ -839,11 +854,9 @@
                                        <xsl:variable 
name="done_action"><xsl:value-of select="done_action"/></xsl:variable>
                                        <xsl:variable 
name="lang_done"><xsl:value-of select="lang_done"/></xsl:variable>
                                        <form method="post" 
action="{$done_action}">
-                                               <input type="submit" 
name="done" value="{$lang_done}" onMouseout="window.status='';return true;">
-                                                       <xsl:attribute 
name="onMouseover">
-                                                               
<xsl:text>window.status='</xsl:text>
+                                               <input type="submit" 
name="done" value="{$lang_done}">
+                                                       <xsl:attribute 
name="title">
                                                                <xsl:value-of 
select="lang_done_statustext"/>
-                                                               <xsl:text>'; 
return true;</xsl:text>
                                                        </xsl:attribute>
                                                </input>
                                        </form>




reply via email to

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