fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10698] Merge 10695:10697 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [10698] Merge 10695:10697 from trunk
Date: Mon, 21 Jan 2013 09:49:59 +0000

Revision: 10698
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10698
Author:   sigurdne
Date:     2013-01-21 09:49:59 +0000 (Mon, 21 Jan 2013)
Log Message:
-----------
Merge 10695:10697 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/property/inc/class.boproject.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.soworkorder.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/js/portico/ajax_invoice.js
    branches/Version-1_0-branch/property/setup/phpgw_no.lang
    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/project.xsl
    branches/Version-1_0-branch/property/templates/base/workorder.xsl
    branches/Version-1_0-branch/sms/bin/default/set_workorder_status.php

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


Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066,8068-8087,8089,8091-8108,8110-8124,8126-8129,8131,8133-8150,8152-8154,8156-8162,8164-8167,8169-8170,8172-8179,8181,8183-8196,8198-8207,8209-8211,8213-8214,8216-8217,8219-8220,8222,8224-8225,8227-8247,8249,8251,8253-8282,8284-8352,8354-8368,8370-8396,8398-8430,8432,8434-8440,8442-8445,8447-8453,8455-8456,8458,8460,8462-8464,8466-8473,8475-8479,8481,8483-8501,8503-8523,8525,8527-8531,8533,8535-8536,8538-8550,8552-8554,8556-8557,8559-8579,8581-8587,8589,8591-8592,8594-8595,8597-8601,8603-8610,8612-8613,8615,8617,8619-8645,8647-8650,8652-8661,8663-8666,8668-8669,8671-8683,8685-8691,8693-8730,8732-8737,8739,8741-8767,8769,8771-8772,8774,8776-8797,8799-8812,8814-8819,8821,8823-8833,8835-8837,8839,8841,8843-8849,8852-8858,8860-8867,8869-8870,8872,8874-8877,8879,8881,8883-8888,8890,8892-8901,8903-8911,8913-8917,8920-8923,8925-8933,8935-8938,8940-8943,8945,8947-8948,8950,8952-8953,8955-8962,8964,8966,8968-8970,8972-8975,8977-8983,8985-8993,8995-9001,9003,9005,9007,9009,9011-9019,9021-9023,9025,9027-9028,9030-9044,9046-9047,9049-9050,9052-9056,9058-9059,9061,9063-9064,9066-9068,9071-9092,9094-9112,9114-9117,9119,9121-9160,9162-9166,9169-9207,9209-9211,9213-9215,9217,9219,9221-9253,9255,9257,9259-9260,9262,9264-9269,9271-9273,9275,9277-9278,9280,9282-9283,9285-9289,9291-9299,9301-9310,9312-9313,9315-9320,9322-9324,9326-9338,9340-9342,9344,9346-9348,9350-9358,9360-9362,9364-9366,9368-9374,9376-9382,9384,9386,9388-9390,9392-9396,9398-9402,9404-9410,9412,9414,9416-9417,9419-9425,9427,9429-9430,9432,9434-9463,9465-9502,9504-9506,9508-9521,9523-9526,9528,9530-9537,9539,9541-9551,9553,9555-9556,9558-9578,9580-9581,9583,9585,9587,9589,9591-9624,9626-9655,9657-9700,9702-9726,9728-9729,9731-9749,9751,9753-9754,9756-9832,9834-9836,9838-9839,9841-9846,9848-9850,9852-9858,9860-9863,9865,9867,9869-9871,9873-9893,9895,9897-9912,9914-9919,9921-9928,9930-9952,9954,9956,9958-9963,9965-9993,9995-9997,9999-10001,10003-10004,10006-10007,10009-10012,10014-10031,10033-10073,10075-10107,10109-10165,10167-10210,10222-10226,10228-10311,10313-10378,10380,10382,10384-10393,10395-10478,10480-10482,10484-10494,10496-10503,10505,10507,10509-10521,10523,10525-10528,10530-10540,10542-10543,10545-10568,10570-10584,10586-10590,10592-10594,10596,10598-10599,10601-10611,10613,10615,10617-10626,10628-10636,10638,10640-10654,10656-10658,10660,10662-10672,10674,10676-10682,10684,10686,10688-10690,10692-10694
   + 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066,8068-8087,8089,8091-8108,8110-8124,8126-8129,8131,8133-8150,8152-8154,8156-8162,8164-8167,8169-8170,8172-8179,8181,8183-8196,8198-8207,8209-8211,8213-8214,8216-8217,8219-8220,8222,8224-8225,8227-8247,8249,8251,8253-8282,8284-8352,8354-8368,8370-8396,8398-8430,8432,8434-8440,8442-8445,8447-8453,8455-8456,8458,8460,8462-8464,8466-8473,8475-8479,8481,8483-8501,8503-8523,8525,8527-8531,8533,8535-8536,8538-8550,8552-8554,8556-8557,8559-8579,8581-8587,8589,8591-8592,8594-8595,8597-8601,8603-8610,8612-8613,8615,8617,8619-8645,8647-8650,8652-8661,8663-8666,8668-8669,8671-8683,8685-8691,8693-8730,8732-8737,8739,8741-8767,8769,8771-8772,8774,8776-8797,8799-8812,8814-8819,8821,8823-8833,8835-8837,8839,8841,8843-8849,8852-8858,8860-8867,8869-8870,8872,8874-8877,8879,8881,8883-8888,8890,8892-8901,8903-8911,8913-8917,8920-8923,8925-8933,8935-8938,8940-8943,8945,8947-8948,8950,8952-8953,8955-8962,8964,8966,8968-8970,8972-8975,8977-8983,8985-8993,8995-9001,9003,9005,9007,9009,9011-9019,9021-9023,9025,9027-9028,9030-9044,9046-9047,9049-9050,9052-9056,9058-9059,9061,9063-9064,9066-9068,9071-9092,9094-9112,9114-9117,9119,9121-9160,9162-9166,9169-9207,9209-9211,9213-9215,9217,9219,9221-9253,9255,9257,9259-9260,9262,9264-9269,9271-9273,9275,9277-9278,9280,9282-9283,9285-9289,9291-9299,9301-9310,9312-9313,9315-9320,9322-9324,9326-9338,9340-9342,9344,9346-9348,9350-9358,9360-9362,9364-9366,9368-9374,9376-9382,9384,9386,9388-9390,9392-9396,9398-9402,9404-9410,9412,9414,9416-9417,9419-9425,9427,9429-9430,9432,9434-9463,9465-9502,9504-9506,9508-9521,9523-9526,9528,9530-9537,9539,9541-9551,9553,9555-9556,9558-9578,9580-9581,9583,9585,9587,9589,9591-9624,9626-9655,9657-9700,9702-9726,9728-9729,9731-9749,9751,9753-9754,9756-9832,9834-9836,9838-9839,9841-9846,9848-9850,9852-9858,9860-9863,9865,9867,9869-9871,9873-9893,9895,9897-9912,9914-9919,9921-9928,9930-9952,9954,9956,9958-9963,9965-9993,9995-9997,9999-10001,10003-10004,10006-10007,10009-10012,10014-10031,10033-10073,10075-10107,10109-10165,10167-10210,10222-10226,10228-10311,10313-10378,10380,10382,10384-10393,10395-10478,10480-10482,10484-10494,10496-10503,10505,10507,10509-10521,10523,10525-10528,10530-10540,10542-10543,10545-10568,10570-10584,10586-10590,10592-10594,10596,10598-10599,10601-10611,10613,10615,10617-10626,10628-10636,10638,10640-10654,10656-10658,10660,10662-10672,10674,10676-10682,10684,10686,10688-10690,10692-10694,10696-10697

Modified: branches/Version-1_0-branch/property/inc/class.boproject.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.boproject.inc.php    
2013-01-21 09:47:38 UTC (rev 10697)
+++ branches/Version-1_0-branch/property/inc/class.boproject.inc.php    
2013-01-21 09:49:59 UTC (rev 10698)
@@ -884,9 +884,9 @@
                        $this->so->delete($project_id);
                }
 
-               function bulk_update_status($start_date, $end_date, 
$status_filter, $status_new, $execute, $type, 
$user_id,$ids,$paid,$closed_orders,$ecodimb)
+               function bulk_update_status($start_date, $end_date, 
$status_filter, $status_new, $execute, $type, 
$user_id,$ids,$paid,$closed_orders,$ecodimb,$transfer_budget)
                {
-                       return $this->so->bulk_update_status($start_date, 
$end_date, $status_filter, $status_new, $execute, $type, 
$user_id,$ids,$paid,$closed_orders,$ecodimb);
+                       return $this->so->bulk_update_status($start_date, 
$end_date, $status_filter, $status_new, $execute, $type, 
$user_id,$ids,$paid,$closed_orders,$ecodimb,$transfer_budget);
                }
 
                public function get_user_list($selected = 0)

Modified: branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php    
2013-01-21 09:47:38 UTC (rev 10697)
+++ branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php    
2013-01-21 09:49:59 UTC (rev 10698)
@@ -1426,7 +1426,7 @@
                        }                       
 
                        $sql = "SELECT {$table}.*,fm_workorder_status.descr as 
status, fm_workorder.charge_tenant,org_name,"
-                               . "fm_workorder.claim_issued, 
fm_workorder_status.closed FROM {$table}"
+                               . " fm_workorder.claim_issued, 
fm_workorder.continuous, fm_workorder_status.closed FROM {$table}"
                                . " {$this->left_join} fm_workorder ON 
fm_workorder.id = {$table}.pmwrkord_code"
                                . " {$this->left_join} fm_workorder_status ON 
fm_workorder.status = fm_workorder_status.id"
                                . " {$this->left_join} fm_project ON 
fm_workorder.project_id = fm_project.id"
@@ -1482,6 +1482,7 @@
                                                'period'                        
        => $this->db->f('periode'),
                                                'periodization'                 
=> $this->db->f('periodization'),
                                                'periodization_start'   => 
$this->db->f('periodization_start'),
+                                               'continuous'                    
=> $this->db->f('continuous'),
                                        );
                        }
 

Modified: branches/Version-1_0-branch/property/inc/class.soproject.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soproject.inc.php    
2013-01-21 09:47:38 UTC (rev 10697)
+++ branches/Version-1_0-branch/property/inc/class.soproject.inc.php    
2013-01-21 09:49:59 UTC (rev 10698)
@@ -82,7 +82,7 @@
                        while ($this->db->next_record())
                        {
                                $branch[] = array
-                                       ( 
+                                       (
                                                'id' => $this->db->f('id'),
                                                'name'  => 
$this->db->f('descr',true)
                                        );
@@ -97,7 +97,7 @@
                        while ($this->db->next_record())
                        {
                                $location[] = array
-                                       ( 
+                                       (
                                                'id' => $this->db->f('id'),
                                                'name'  => 
$this->db->f('descr',true)
                                        );
@@ -478,7 +478,7 @@
                                        {
                                                $_status_filter[] = 
$this->db->f('id');
                                        }
-                                       $filtermethod .= " $where 
fm_project.status IN ('" . implode("','", $_status_filter) . "')"; 
+                                       $filtermethod .= " $where 
fm_project.status IN ('" . implode("','", $_status_filter) . "')";
                                }
                                else
                                {
@@ -710,7 +710,7 @@
 
 */
 
-                                       $get_spesific = false; 
+                                       $get_spesific = false;
                                        if ($filter_year && $filter_year != 
'all')
                                        {
                                                $this->db->query("SELECT 
sum(fm_project_budget.budget) AS budget"
@@ -718,7 +718,7 @@
                                                $this->db->next_record();
                                                $project['budget'] =  
$this->db->f('budget');
 
-                                               $get_spesific = true; 
+                                               $get_spesific = true;
                                                $_year_arr = array();
                                                for ($i=1;$i<14;$i++)
                                                {
@@ -1177,7 +1177,7 @@
 
                        if($project['budget'])
                        {
-                               $this->update_budget($id, 
$project['budget_year'], $project['budget_periodization'], 
$project['budget'],$project['budget_periodization_all']);
+                               $this->update_budget($id, 
$project['budget_year'], $project['budget_periodization'], 
$project['budget'],$project['budget_periodization_all'],'update', 
$project['budget_periodization_activate']);
                        }
 
                        if($project['extra']['contact_phone'] && 
$project['extra']['tenant_id'])
@@ -1461,7 +1461,7 @@
 
                                if($project['budget'])
                                {
-                                       $this->update_budget($project['id'], 
$project['budget_year'], $project['budget_periodization'], 
$project['budget'],$project['budget_periodization_all']);
+                                       $this->update_budget($project['id'], 
$project['budget_year'], $project['budget_periodization'], 
$project['budget'],$project['budget_periodization_all'], 'update', 
$project['budget_periodization_activate']);
                                }
 
                                $this->db->query("SELECT sum(budget) AS 
sum_budget FROM fm_project_budget WHERE active = 1 AND project_id = " . 
(int)$project['id'],__LINE__,__FILE__);
@@ -1653,7 +1653,7 @@
                                        unset($action_params);
                                }
 
-                               $workorder_closed_status = 
isset($this->config->config_data['workorder_closed_status']) && 
$this->config->config_data['workorder_closed_status'] ? 
$this->config->config_data['workorder_closed_status'] : 'closed'; 
+                               $workorder_closed_status = 
isset($this->config->config_data['workorder_closed_status']) && 
$this->config->config_data['workorder_closed_status'] ? 
$this->config->config_data['workorder_closed_status'] : 'closed';
 
                                if($old_status != $project['status'])
                                {
@@ -1867,7 +1867,7 @@
                }
 
 
-               function update_budget($project_id, $year, $periodization_id, 
$budget, $budget_periodization_all = false, $action = 'update')
+               function update_budget($project_id, $year, $periodization_id, 
$budget, $budget_periodization_all = false, $action = 'update', $activate = 0)
                {
                        $project_id = (int) $project_id;
                        $year = $year ? (int) $year : date('Y');
@@ -1901,7 +1901,7 @@
                                                                else
                                                                {
                                                                        
$partial_budget = $budget;
-                                                                       
$partial_budget = $partial_budget > 0 ? $partial_budget : 0; 
+                                                                       
$partial_budget = $partial_budget > 0 ? $partial_budget : 0;
                                                                        $budget 
= 0;
                                                                }
                                                        }
@@ -1918,7 +1918,7 @@
                                                                else
                                                                {
                                                                        
$partial_budget = $budget;
-                                                                       
$partial_budget = $partial_budget < 0 ? $partial_budget : 0; 
+                                                                       
$partial_budget = $partial_budget < 0 ? $partial_budget : 0;
                                                                        $budget 
= 0;
                                                                }
                                                        }
@@ -1937,12 +1937,12 @@
 
                                        $acc_partial += $budget;
 
-                                       $this->_update_budget($project_id, 
$year, $month, $budget, $action);                                    
+                                       $this->_update_budget($project_id, 
$year, $month, $budget, $action);
                                }
-                               
+
                                if(!$hit)
                                {
-                                       throw new 
Exception('property_soproject::update_buffer_budget() - found no active budget 
to transfer from');                            
+                                       throw new 
Exception('property_soproject::update_buffer_budget() - found no active budget 
to transfer from');
                                }
 
                                return $acc_partial;
@@ -2021,7 +2021,7 @@
                                }
                                $partial_budget = $partial_budget * (1 + 
$percentage_to_move);
 
-                               $this->_update_budget($project_id, $year, 
$outline['month'], $partial_budget, $action);
+                               $this->_update_budget($project_id, $year, 
$outline['month'], $partial_budget, $action, $activate);
                        }
 
                        $sql = "SELECT sum(budget) as sum_budget FROM 
fm_project_budget WHERE active = 1 AND project_id = {$project_id}";
@@ -2034,13 +2034,13 @@
                }
 
 
-               private function _update_budget($project_id, $year, $month, 
$budget, $action = 'update')
+               private function _update_budget($project_id, $year, $month, 
$budget, $action = 'update', $active = 0)
                {
                        $month = (int) $month;
                        $budget = (int) $budget;
                        $now = time();
-
-                       $sql = "SELECT budget FROM fm_project_budget WHERE 
project_id = {$project_id} AND year = {$year} AND month = {$month}";
+                       $active = (int) $active;
+                       $sql = "SELECT budget,active FROM fm_project_budget 
WHERE project_id = {$project_id} AND year = {$year} AND month = {$month}";
 //_debug_array($sql);
                        $this->db->query($sql,__LINE__,__FILE__);
                        $this->db->next_record();
@@ -2052,14 +2052,16 @@
                                }
                                else if ($action == 'update')
                                {
-                                       $new_budget = $budget;                  
        
+                                       $new_budget = $budget;
+//                                     $active = (int)$this->db->f('active');
                                }
                                else if ($action == 'subtract')
                                {
                                        $new_budget = $old_budget - $budget;
+//                                     $active = (int)$this->db->f('active');
                                }
 
-                               $sql = "UPDATE fm_project_budget SET budget = 
{$new_budget}, modified_date = {$now} WHERE project_id = {$project_id} AND year 
= {$year} AND month = {$month}";                          
+                               $sql = "UPDATE fm_project_budget SET budget = 
{$new_budget}, modified_date = {$now} WHERE project_id = {$project_id} AND year 
= {$year} AND month = {$month}";
 //_debug_array($sql);
                                $this->db->query($sql,__LINE__,__FILE__);
                        }
@@ -2074,9 +2076,11 @@
                                        'user_id'                       => 
$this->account,
                                        'entry_date'            => $now,
                                        'modified_date'         => $now,
-//                                     'active'                        => 1
+                                       'active'                        => 
$active // only for new entries
                                );
 
+//_debug_array($value_set);die();
+
                                $cols = implode(',', array_keys($value_set));
                                $values = 
$this->db->validate_insert(array_values($value_set));
                                $this->db->query("INSERT INTO fm_project_budget 
({$cols}) VALUES ({$values})",__LINE__,__FILE__);
@@ -2570,8 +2574,16 @@
                }
 
 
-               function bulk_update_status($start_date, $end_date, 
$status_filter, $status_new, $execute, $type, $user_id = 0,$ids,$paid = false, 
$closed_orders = false, $ecodimb = 0)
+               function bulk_update_status($start_date, $end_date, 
$status_filter, $status_new, $execute, $type, $user_id = 0,$ids,$paid = false, 
$closed_orders = false, $ecodimb = 0, $transfer_budget=0)
                {
+
+                       if($transfer_budget)
+                       {
+                               echo "<H1> Overføre budsjett for valgte 
prosjekt/bestillinger til år {$transfer_budget} </H1>";
+                               _debug_array($ids);
+                               die();
+                       }
+
                        $start_date = $start_date ? 
phpgwapi_datetime::date_to_timestamp($start_date) : time();
                        $start_date -= 3600*24;
                        $end_date = $end_date ? 
phpgwapi_datetime::date_to_timestamp($end_date) : time();
@@ -2593,7 +2605,7 @@
                        {
                                if($status_filter == 'open')
                                {
-                                       $filter .= " AND 
fm_{$type}_status.closed IS NULL"; 
+                                       $filter .= " AND 
fm_{$type}_status.closed IS NULL";
 
                                }
                                else
@@ -2602,9 +2614,14 @@
                                }
                        }
 
+                       $sql_budget = "SELECT DISTINCT year, active FROM 
fm_{$type}_budget WHERE ";
+
                        switch($type)
                        {
                                case 'project':
+
+                                       $sql_budget .= 'project_id = %d ORDER 
BY year';
+
                                        if($closed_orders)
                                        {
                                                $filter .=  " AND 
fm_open_workorder_view.project_id IS NULL";
@@ -2614,22 +2631,26 @@
                                        $status_table = 'fm_project_status';
                                        $title_field = 'fm_project.name as 
title';
                                        $this->_update_status_project($execute, 
$status_new, $ids);
-                                       $sql = "SELECT DISTINCT {$table}.id, 
$status_table.descr as status ,{$title_field},{$table}.start_date, 
count(project_id) as num_open FROM {$table}"
+                                       $sql = "SELECT DISTINCT {$table}.id, 
$status_table.descr as status 
,{$title_field},{$table}.start_date,{$table}.project_type_id, count(project_id) 
as num_open FROM {$table}"
                                        . " {$this->join} {$status_table} ON  
{$table}.status = {$status_table}.id "
                                        . " {$this->left_join} 
fm_open_workorder_view ON {$table}.id = fm_open_workorder_view.project_id "
-                                       . " WHERE ({$table}.start_date > 
{$start_date} AND {$table}.start_date < {$end_date} {$filter})"
-                                       . " GROUP BY {$table}.id, 
$status_table.descr ,{$table}.name, {$table}.start_date"
+                                       . " WHERE ({$table}.start_date > 
{$start_date} AND {$table}.start_date < {$end_date} OR {$table}.start_date IS 
NULL)  {$filter}"
+                                       . " GROUP BY {$table}.id, 
$status_table.descr ,{$table}.name, {$table}.start_date,project_type_id"
                                        . " ORDER BY {$table}.id DESC";
 
                                        break;
                                case 'workorder':
 
+                                       $sql_budget .= 'order_id = %d ORDER BY 
year';
+
                                        $table = 'fm_workorder';
                                        $status_table = 'fm_workorder_status';
                                        $title_field = 'fm_workorder.title';
                                        $actual_cost = ',actual_cost';
 
                                        $join_method = "{$this->join} 
{$status_table} ON  {$table}.status = {$status_table}.id";
+                                       $join_method .= " {$this->join} 
fm_project ON  {$table}.project_id = fm_project.id";
+
                                        if($paid)
                                        {
                                                $join_method .=  " 
{$this->join} fm_orders_actual_cost_view ON fm_workorder.id = 
fm_orders_actual_cost_view.order_id";
@@ -2637,15 +2658,22 @@
                                        }
 
                                        
$this->_update_status_workorder($execute, $status_new, $ids);
-                                       $sql = "SELECT {$table}.id, project_id, 
$status_table.descr as status ,{$title_field},start_date {$actual_cost} FROM 
{$table}"
-                                       . " {$join_method}"
-                                       . " WHERE ({$table}.start_date > 
{$start_date} AND {$table}.start_date < {$end_date} {$filter}) OR start_date is 
NULL"
+                                       $sql = "SELECT {$table}.id, project_id, 
$status_table.descr as status ,{$title_field},{$table}.start_date 
{$actual_cost},project_type_id"
+                                       . " FROM {$table} {$join_method}"
+                                       . " WHERE ({$table}.start_date > 
{$start_date} AND {$table}.start_date < {$end_date} {$filter}) OR 
{$table}.start_date is NULL"
                                        . " ORDER BY {$table}.id DESC";
                                        break;
                                default:
                                        return array();
                        }
 
+                       $project_types = array
+                       (
+                               1       => lang('operation'),
+                               2       => lang('investment'),
+                               3       => lang('buffer')
+                       );
+
                        $this->db->query($sql,__LINE__,__FILE__);
                        $values = array();
                        $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
@@ -2654,19 +2682,32 @@
                        {
                                $values[] = array
                                (
-                                       'id'                    => 
$this->db->f('id'),
-                                       'project_id'    => 
$this->db->f('project_id'),
-                                       'title'                 => 
htmlspecialchars_decode($this->db->f('title',true)),
-                                       'status'                => 
$this->db->f('status',true),
-                                       'actual_cost'   => 
(float)$this->db->f('actual_cost'),
-                                       'start_date'    => 
$GLOBALS['phpgw']->common->show_date($this->db->f('start_date'),$dateformat),
-                                       'num_open'              => 
(int)$this->db->f('num_open'),
+                                       'id'                            => 
$this->db->f('id'),
+                                       'project_id'            => 
$this->db->f('project_id'),
+                                       'title'                         => 
htmlspecialchars_decode($this->db->f('title',true)),
+                                       'status'                        => 
$this->db->f('status',true),
+                                       'actual_cost'           => 
(float)$this->db->f('actual_cost'),
+                                       'start_date'            => 
$GLOBALS['phpgw']->common->show_date($this->db->f('start_date'),$dateformat),
+                                       'num_open'                      => 
(int)$this->db->f('num_open'),
+                                       'project_type'          => 
$project_types[$this->db->f('project_type_id')],
                                );
                        }
 
-                       return $values;
+                       foreach($values as &$entry)
+                       {
+                               $sql = sprintf($sql_budget,$entry['id']);
+                               $this->db->query($sql,__LINE__,__FILE__);
 
+                               $budget = array();
 
+                               while ($this->db->next_record())
+                               {
+                                       $budget[] = $this->db->f('year') . '[' 
. $this->db->f('active') . ']';
+                               }
+                               $entry['budget'] = implode(';', $budget);
+                       }
+
+                       return $values;
                }
 
                protected function _update_status_project($execute, 
$status_new, $ids)
@@ -2677,7 +2718,7 @@
                        }
                        $historylog     = 
CreateObject('property.historylog','project');
 
-                       $workorder_closed_status = 
isset($this->config->config_data['workorder_closed_status']) && 
$this->config->config_data['workorder_closed_status'] ? 
$this->config->config_data['workorder_closed_status'] : false; 
+                       $workorder_closed_status = 
isset($this->config->config_data['workorder_closed_status']) && 
$this->config->config_data['workorder_closed_status'] ? 
$this->config->config_data['workorder_closed_status'] : false;
 
                        $this->db->transaction_begin();
                        foreach ($ids as $id)

Modified: branches/Version-1_0-branch/property/inc/class.soworkorder.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soworkorder.inc.php  
2013-01-21 09:47:38 UTC (rev 10697)
+++ branches/Version-1_0-branch/property/inc/class.soworkorder.inc.php  
2013-01-21 09:49:59 UTC (rev 10698)
@@ -766,14 +766,14 @@
                                }
 
 
-                               $sql_cost = "SELECT fm_workorder.id as 
order_id,closed, actual_cost, pending_cost,fm_location1.mva,"
+                               $sql_cost = "SELECT fm_workorder.id as 
order_id,closed, sum(fm_orders_paid_or_pending_view.amount) as actual_cost, 
fm_location1.mva,"
                                . " sum(fm_workorder_budget.budget) AS budget, 
sum(fm_workorder_budget.combined_cost) AS combined_cost"
-                               . " FROM fm_workorder {$this->left_join} 
fm_orders_pending_cost_view ON fm_workorder.id = 
fm_orders_pending_cost_view.order_id"
+                               . " FROM fm_workorder {$this->left_join} 
fm_orders_paid_or_pending_view ON fm_workorder.id = 
fm_orders_paid_or_pending_view.order_id"
                                . " {$this->join} fm_workorder_status ON 
fm_workorder.status = fm_workorder_status.id"
                                . " {$this->join} fm_workorder_budget ON 
(fm_workorder.id = fm_workorder_budget.order_id)"
                                . " {$_join_district}"
                                . ' WHERE fm_workorder.id IN (' . implode(',', 
$_order_list ) .')'
-                               . " GROUP BY fm_workorder.id,closed, 
actual_cost, pending_cost, fm_location1.mva";
+                               . " GROUP BY fm_workorder.id,closed, 
fm_location1.mva";
 
                                unset($_order_list);
                                $this->db->query($sql_cost,__LINE__,__FILE__);
@@ -781,7 +781,7 @@
                                {
                                        
$_actual_cost_arr[$this->db->f('order_id')] = array
                                        (
-                                               'actual_cost'   => 
$this->db->f('actual_cost') + (float)$this->db->f('pending_cost'),
+                                               'actual_cost'   => 
$this->db->f('actual_cost'),
                                                'budget'                => 
$this->db->f('budget'),
                                                'combined_cost' => 
$this->db->f('combined_cost'),
                                                'closed'                => 
!!$this->db->f('closed'),
@@ -921,7 +921,8 @@
                                        'billable_hours'                => 
$this->db->f('billable_hours'),
                                        'approved'                              
=> $this->db->f('approved'),
                                        'mail_recipients'               => 
explode(',', trim($this->db->f('mail_recipients'),',')),
-                                       'actual_cost'                   => 
$this->db->f('actual_cost')
+                                       'actual_cost'                   => 
$this->db->f('actual_cost'),
+                                       'continuous'                    => 
$this->db->f('continuous')
                                );
 
                                $sql = "SELECT periodization_id,"
@@ -1209,14 +1210,16 @@
                                        $workorder['billable_hours'],
                                        $workorder['contract_sum'],
                                        $workorder['approved'],
+                                       $workorder['continuous'],
                                        isset($workorder['vendor_email']) && 
is_array($workorder['vendor_email']) ? implode(',', $workorder['vendor_email']) 
: ''
                                );
 
                        $values = $this->db->validate_insert($values);
 
                        $this->db->query("INSERT INTO fm_workorder 
(id,num,project_id,title,access,entry_date,start_date,end_date,status,"
-                               . 
"descr,budget,combined_cost,account_id,rig_addition,addition,key_deliver,key_fetch,vendor_id,charge_tenant,user_id,ecodimb,category,billable_hours,contract_sum,approved,mail_recipients
  $cols) "
-                               . "VALUES ( $values $vals)",__LINE__,__FILE__);
+                               . 
"descr,budget,combined_cost,account_id,rig_addition,addition,key_deliver,key_fetch,vendor_id,charge_tenant,"
+                               . 
"user_id,ecodimb,category,billable_hours,contract_sum,approved,continuous,mail_recipients
  $cols) "
+                               . "VALUES ( {$values} 
{$vals})",__LINE__,__FILE__);
 
                        $this->db->query("INSERT INTO fm_orders (id,type) 
VALUES ({$id},'workorder')");
 
@@ -1356,6 +1359,7 @@
                                'billable_hours'        => 
$workorder['billable_hours'],
 //                             'contract_sum'          => 
$workorder['contract_sum'],
                                'approved'                      => 
$workorder['approved'],
+                               'continuous'            => 
$workorder['continuous'],
                                'mail_recipients'       => 
isset($workorder['vendor_email']) && is_array($workorder['vendor_email']) ? 
implode(',', $workorder['vendor_email']) : '',
                        );
 

Modified: branches/Version-1_0-branch/property/inc/class.uiinvoice.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiinvoice.inc.php    
2013-01-21 09:47:38 UTC (rev 10697)
+++ branches/Version-1_0-branch/property/inc/class.uiinvoice.inc.php    
2013-01-21 09:49:59 UTC (rev 10698)
@@ -1869,6 +1869,10 @@
                                                        {
                                                                $_checked = 
'checked="checked"';
                                                        }
+                                                       else 
if(!$invoices['continuous'])
+                                                       {
+                                                               $_checked = 
'checked="checked"';
+                                                       }
 
                                                        
$json_row[$uicols[$i]['col_name']]  .= " <input 
name='values[close_order_orig][{$j}]' id='values[close_order_orig][{$j}]' 
class='myValuesForPHP ' type='hidden' value='{$invoices['closed']}'/>";
                                                        
$json_row[$uicols[$i]['col_name']]  .= " <input 
name='values[close_order_tmp][{$j}]' id='values[close_order_tmp][{$j}]' 
class='close_order_tmp transfer_idClass' type='checkbox' value='true' 
{$_checked}/>";

Modified: branches/Version-1_0-branch/property/inc/class.uiproject.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiproject.inc.php    
2013-01-21 09:47:38 UTC (rev 10697)
+++ branches/Version-1_0-branch/property/inc/class.uiproject.inc.php    
2013-01-21 09:49:59 UTC (rev 10698)
@@ -2244,6 +2244,7 @@
                        $id_to_update   = phpgw::get_var('id_to_update');
                        $paid                   = phpgw::get_var('paid', 
'bool', 'POST');
                        $closed_orders  = phpgw::get_var('closed_orders', 
'bool', 'POST');
+                       $transfer_budget= phpgw::get_var('transfer_budget', 
'integer');
                        
                        if(isset($_POST['user_id']))
                        {
@@ -2274,7 +2275,7 @@
 
                        if(($execute || $get_list) && $type)
                        {
-                               $list = 
$this->bo->bulk_update_status($start_date, $end_date, $status_filter, 
$status_new, $execute, $type, $user_id,$ids,$paid,$closed_orders,$ecodimb);
+                               $list = 
$this->bo->bulk_update_status($start_date, $end_date, $status_filter, 
$status_new, $execute, $type, 
$user_id,$ids,$paid,$closed_orders,$ecodimb,$transfer_budget);
                        }
 
                        $total_records  = count($list);
@@ -2300,6 +2301,8 @@
                                                                                
                                array('key' => 
'title','label'=>lang('title'),'sortable'=>true,'resizeable'=>true),
                                                                                
                                array('key' => 
'status','label'=>lang('status'),'sortable'=>true,'resizeable'=>true),
                                                                                
                                array('key' => 
'num_open','label'=>lang('open'),'sortable'=>true,'resizeable'=>true 
,'formatter'=>'FormatterRight'),
+                                                                               
                                array('key' => 
'project_type','label'=>lang('project 
type'),'sortable'=>false,'resizeable'=>true),
+                                                                               
                                array('key' => 
'budget','label'=>lang('budget'),'sortable'=>false,'resizeable'=>true),
                                                                                
                                array('key' => 'select','label'=> 
lang('select'), 
'sortable'=>false,'resizeable'=>false,'formatter'=>'myFormatterCheck','width'=>30)
                                                                                
                                ))
                                        );
@@ -2314,6 +2317,8 @@
                                                                                
                                array('key' => 
'start_date','label'=>lang('date'),'sortable'=>false,'resizeable'=>true),
                                                                                
                                array('key' => 
'title','label'=>lang('title'),'sortable'=>true,'resizeable'=>true),
                                                                                
                                array('key' => 
'status','label'=>lang('status'),'sortable'=>true,'resizeable'=>true),
+                                                                               
                                array('key' => 
'project_type','label'=>lang('project 
type'),'sortable'=>false,'resizeable'=>true),
+                                                                               
                                array('key' => 
'budget','label'=>lang('budget'),'sortable'=>false,'resizeable'=>true),
                                                                                
                                array('key' => 
'actual_cost','label'=>lang('actual cost'),'sortable'=>true,'resizeable'=>true 
,'formatter'=>'FormatterRight'),
                                                                                
                                array('key' => 'select','label'=> 
lang('select'), 
'sortable'=>false,'resizeable'=>false,'formatter'=>'myFormatterCheck','width'=>30)
                                                                                
                                ))
@@ -2375,8 +2380,24 @@
                                $entry['selected'] = $entry['id'] == $type ? 1 
: 0;
                        }
 
+
+
+                       $year   = date('Y');
+                       $limit  = $year + 2;
+
+                       while ($year < $limit)
+                       {
+                               $year_list[] = array
+                               (
+                                       'id'    =>  $year,
+                                       'name'  =>  $year
+                               );
+                               $year++;
+                       }
+
                        $data = array
                        (
+                               'year_list'                             => 
array('options' => $year_list),
                                'property_js'                   => 
json_encode($GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property2.js"),
                                'datatable'                             => 
$datavalues,
                                'myColumnDefs'                  => 
$myColumnDefs,

Modified: branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php  
2013-01-21 09:47:38 UTC (rev 10697)
+++ branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php  
2013-01-21 09:49:59 UTC (rev 10698)
@@ -991,6 +991,7 @@
                                                
if(!$approve_role['is_supervisor'] && ! $approve_role['is_budget_responsible'])
                                                {
                                                        
$receipt['error'][]=array('msg'=>lang('you do not have permission to approve 
this order') );
+                                                       $values['approved'] = 
false;
                                                        $error_id=true;
                                                }
                                        }
@@ -2063,6 +2064,7 @@
                                'lang_key_deliver_statustext'                   
=> lang('Select where to deliver the key'),
 
                                'value_approved'                                
                => isset($values['approved']) ? $values['approved'] : '',
+                               'value_continuous'                              
                => isset($values['continuous']) ? $values['continuous'] : '',
                                'need_approval'                                 
                => $need_approval,
                                'lang_ask_approval'                             
                => lang('Ask for approval'),
                                'lang_ask_approval_statustext'                  
=> lang('Check this to send a mail to your supervisor for approval'),

Modified: branches/Version-1_0-branch/property/js/portico/ajax_invoice.js
===================================================================
--- branches/Version-1_0-branch/property/js/portico/ajax_invoice.js     
2013-01-21 09:47:38 UTC (rev 10697)
+++ branches/Version-1_0-branch/property/js/portico/ajax_invoice.js     
2013-01-21 09:49:59 UTC (rev 10698)
@@ -343,6 +343,15 @@
                                {
                                        checked_close_order = "checked = 
\"checked\"";
                                }
+                               else if(voucher[0].project_type_id == 1 && 
voucher[0].periodization_id) // operation projekts
+                               {
+                                       checked_close_order = "checked = 
\"checked\"";
+                               }
+                               else if(!voucher[0].continuous)
+                               {
+                                       checked_close_order = "checked = 
\"checked\"";
+                               }
+                               
                                var htmlString_close_order = "<input 
type=\"checkbox\" name=\"values[close_order]\" value=\"1\" title=\"close 
order\"" + checked_close_order + "></input>" + close_order_status;
                                $("#close_order").html( htmlString_close_order 
);
                                $("#close_order_orig").val( voucher[0].closed );

Modified: branches/Version-1_0-branch/property/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/property/setup/phpgw_no.lang    2013-01-21 
09:47:38 UTC (rev 10697)
+++ branches/Version-1_0-branch/property/setup/phpgw_no.lang    2013-01-21 
09:49:59 UTC (rev 10698)
@@ -369,6 +369,7 @@
 consume value  property        no      Beløp historisk forbruk
 consume history        property        no      Historisk forbruk
 continue       property        no      Fortsett
+continuous     property        no      Løpende
 line   property        no      Linje
 sheet  property        no      Ark
 choose file    property        no      Velg Fil
@@ -1942,6 +1943,7 @@
 you have entered an invalid end date ! property        no      Du har angitt 
en ugyldig slutt dato
 you have entered an invalid start date !       property        no      Du har 
angitt en ugyldig start dato
 you have no edit right for this project        property        no      Du har 
ikke editeringsrettigheter for dette prosjektet
+you do not have permission to approve this order       property        no      
Du har ikke rettighteter for a godkjenne bestillingen
 you have to select a budget responsible for this invoice in order to add the 
invoice   property        no      Du må velge en anviser for å kunne legge til 
en faktura
 you have to select a budget responsible for this invoice in order to make the 
import   property        no      Du må velge en anviser for å importere
 you have to select the conversion for this import      property        no      
Du må velge importformat

Modified: branches/Version-1_0-branch/property/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/setup.inc.php    2013-01-21 
09:47:38 UTC (rev 10697)
+++ branches/Version-1_0-branch/property/setup/setup.inc.php    2013-01-21 
09:49:59 UTC (rev 10698)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['property']['name']                 = 'property';
-       $setup_info['property']['version']              = '0.9.17.662';
+       $setup_info['property']['version']              = '0.9.17.663';
        $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   
2013-01-21 09:47:38 UTC (rev 10697)
+++ branches/Version-1_0-branch/property/setup/tables_current.inc.php   
2013-01-21 09:49:59 UTC (rev 10698)
@@ -529,7 +529,8 @@
                                'billable_hours' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True),
                                'contract_sum' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
                                'approved'      => array('type' => 
'int','precision' => 2, 'nullable' => True),
-                               'mail_recipients' => array('type' => 
'varchar','precision' => 255, 'nullable' => True)
+                               'mail_recipients' => array('type' => 
'varchar','precision' => 255, 'nullable' => True),
+                               'continuous'    => array('type' => 
'int','precision' => 2, 'nullable' => True),
                        ),
                        'pk' => array('id'),
                        'fk' => array(),

Modified: branches/Version-1_0-branch/property/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/tables_update.inc.php    
2013-01-21 09:47:38 UTC (rev 10697)
+++ branches/Version-1_0-branch/property/setup/tables_update.inc.php    
2013-01-21 09:49:59 UTC (rev 10698)
@@ -7252,3 +7252,29 @@
                        return $GLOBALS['setup_info']['property']['currentver'];
                }
        }
+
+       /**
+       * Update property version from 0.9.17.662 to 0.9.17.663
+       * Add continuous-flag to workorder
+       */
+       $test[] = '0.9.17.662';
+       function property_upgrade0_9_17_662()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM fm_cache");
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_workorder','continuous',array(
+                       'type'          => 'int',
+                       'precision'     => 2,
+                       'nullable'      => True
+                       )
+               );
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.663';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }
+
+

Modified: branches/Version-1_0-branch/property/templates/base/project.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/project.xsl     
2013-01-21 09:47:38 UTC (rev 10697)
+++ branches/Version-1_0-branch/property/templates/base/project.xsl     
2013-01-21 09:49:59 UTC (rev 10698)
@@ -447,9 +447,18 @@
                                                                                
                        <input type="checkbox" 
name="values[budget_periodization_all]" value="True">
                                                                                
                                <xsl:attribute name="title">
                                                                                
                                        <xsl:value-of 
select="php:function('lang', 'all')"/>
+                                                                               
                                        <xsl:text> </xsl:text>
+                                                                               
                                        <xsl:value-of 
select="php:function('lang', 'periods')"/>
                                                                                
                                </xsl:attribute>
                                                                                
                        </input>
                                                                                
                </td>
+                                                                               
                <td>
+                                                                               
                        <input type="checkbox" 
name="values[budget_periodization_activate]" value="1">
+                                                                               
                                <xsl:attribute name="title">
+                                                                               
                                        <xsl:value-of 
select="php:function('lang', 'activate')"/>
+                                                                               
                                </xsl:attribute>
+                                                                               
                        </input>
+                                                                               
                </td>
                                                                                
        </xsl:when>
                                                                                
</xsl:choose>
                                                                                
</tr>
@@ -979,6 +988,22 @@
                                                        </select>
                                                </td>
                                        </tr>
+                                       <tr>
+                                               <td>
+                                                       <xsl:value-of 
select="php:function('lang', 'transfer budget')"/>
+                                               </td>
+                                               <td>
+                                                       <select 
name="transfer_budget">
+                                                               <xsl:attribute 
name="title">
+                                                                       
<xsl:value-of select="php:function('lang', 'transfer budget')"/>
+                                                               </xsl:attribute>
+                                                               <option 
value="0">
+                                                                       
<xsl:value-of select="php:function('lang', 'select year')"/>
+                                                               </option>
+                                                               
<xsl:apply-templates select="year_list/options"/>
+                                                       </select>
+                                               </td>
+                                       </tr>
                                        <xsl:choose>
                                                <xsl:when test="check_paid = 1">
                                                        <tr>

Modified: branches/Version-1_0-branch/property/templates/base/workorder.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/workorder.xsl   
2013-01-21 09:47:38 UTC (rev 10697)
+++ branches/Version-1_0-branch/property/templates/base/workorder.xsl   
2013-01-21 09:49:59 UTC (rev 10698)
@@ -510,14 +510,6 @@
                                                                                
                </input>
                                                                                
        </td>
                                                                                
</tr>
-                                                                               
<tr>
-                                                                               
        <td valign="top">
-                                                                               
                <xsl:value-of select="php:function('lang', 'selected mail 
addresses')"/>
-                                                                               
        </td>
-                                                                               
        <td>
-                                                                               
                <xsl:value-of select="mail_recipients"/>
-                                                                               
        </td>
-                                                                               
</tr>
                                                                        </tr>
                                                                </xsl:when>
                                                                <xsl:otherwise>
@@ -559,6 +551,32 @@
                                                                        
<xsl:call-template name="cat_sub_select"/>
                                                                </td>
                                                        </tr>
+                                                       
+                                                       <tr>
+                                                               <xsl:variable 
name="lang_continuous">
+                                                                       
<xsl:value-of select="php:function('lang', 'continuous')"/>
+                                                               </xsl:variable>
+                                                               <td 
valign="top">
+                                                                       
<xsl:value-of select="$lang_continuous"/>
+                                                               </td>
+                                                               <td>
+                                                                       <input 
type="checkbox" name="values[continuous]" value="1">
+                                                                               
<xsl:attribute name="title">
+                                                                               
        <xsl:value-of select="$lang_continuous"/>
+                                                                               
</xsl:attribute>
+                                                                               
<xsl:if test="value_continuous = '1'">
+                                                                               
        <xsl:attribute name="checked">
+                                                                               
                <xsl:text>checked</xsl:text>
+                                                                               
        </xsl:attribute>
+                                                                               
</xsl:if>
+                                                                               
<xsl:if test="mode != 'edit'">
+                                                                               
        <xsl:attribute name="disabled">
+                                                                               
                <xsl:text>disabled</xsl:text>
+                                                                               
        </xsl:attribute>
+                                                                               
</xsl:if>
+                                                                       </input>
+                                                               </td>
+                                                       </tr>
 
                                                        <tr>
                                                                <td 
valign="top">

Modified: branches/Version-1_0-branch/sms/bin/default/set_workorder_status.php
===================================================================
--- branches/Version-1_0-branch/sms/bin/default/set_workorder_status.php        
2013-01-21 09:47:38 UTC (rev 10697)
+++ branches/Version-1_0-branch/sms/bin/default/set_workorder_status.php        
2013-01-21 09:49:59 UTC (rev 10698)
@@ -28,16 +28,34 @@
        if (ctype_digit($param[0]) && ctype_digit($param[1]))
        {
                $workorder_id   = $param[0];
-               $status         = $status_code[$param[1]];
-
-               $this->db->query("SELECT status FROM fm_workorder where 
id='{$workorder_id}'",__LINE__,__FILE__);
-               if($this->db->next_record())
+               if(     $status = $status_code[$param[1]])
                {
-                       $this->db->query("UPDATE fm_workorder set status = 
'{$status}' WHERE id='{$workorder_id}'" ,__LINE__,__FILE__);
-                       $historylog     = 
CreateObject('property.historylog','workorder');
+                       $this->db->query("SELECT project_id, status FROM 
fm_workorder WHERE id='{$workorder_id}'",__LINE__,__FILE__);
+                       if($this->db->next_record())
+                       {
+                               $project_id = (int)$this->db->f('project_id');
+                               $status_old = $this->db->f('status');
+                               $this->db->query("UPDATE fm_workorder SET 
status = '{$status}' WHERE id='{$workorder_id}'" ,__LINE__,__FILE__);
+                               $historylog     = 
CreateObject('property.historylog','workorder');
        // temporary - fix this
-                       $historylog->account = 6;
-                       $historylog->add('S',$workorder_id,$status . ': endret 
av: ' . $sms_sender);
-                       $command_output = 'success';
+                               $historylog->account = 6;
+                               $historylog->add('S',$workorder_id,$status, 
$status_old);
+                               $historylog->add('RM',$workorder_id,'Status 
endret av: ' . $sms_sender);
+                               
+                               if(in_array($param[1],array(1,3)))
+                               {
+                                       $this->db->query("SELECT status FROM 
fm_project WHERE id='{$project_id}'",__LINE__,__FILE__);
+                                       $this->db->next_record();
+                                       $status_old = $this->db->f('status');
+                                       if(!$status_old == 'i_arbeid')
+                                       {
+                                               $this->db->query("UPDATE 
fm_project SET status = 'i_arbeid' WHERE id='{$project_id}'" 
,__LINE__,__FILE__);
+                                               $historylog_project     = 
CreateObject('property.historylog','project');
+                                               
$historylog_project->add('S',$project_id,'i_arbeid', $status_old);
+                                               
$historylog_project->add('RM',$project_id,$status . ': endret av: ' . 
$sms_sender);
+                                       }
+                               }
+                               $command_output = 'success';
+                       }
                }
        }




reply via email to

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