fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7768] Merge 7760:7767 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [7768] Merge 7760:7767 from trunk
Date: Fri, 30 Sep 2011 17:48:40 +0000

Revision: 7768
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7768
Author:   sigurdne
Date:     2011-09-30 17:48:40 +0000 (Fri, 30 Sep 2011)
Log Message:
-----------
Merge 7760:7767 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/phpgwapi/inc/class.db_adodb.inc.php
    branches/Version-1_0-branch/phpgwapi/inc/class.db_pdo.inc.php
    branches/Version-1_0-branch/phpgwapi/setup/setup.inc.php
    branches/Version-1_0-branch/phpgwapi/setup/tables_current.inc.php
    branches/Version-1_0-branch/phpgwapi/setup/tables_update.inc.php
    branches/Version-1_0-branch/property/inc/class.botts.inc.php
    branches/Version-1_0-branch/property/inc/class.sotts.inc.php
    branches/Version-1_0-branch/property/inc/class.uitts.inc.php
    branches/Version-1_0-branch/property/inc/class.uiwo_hour.inc.php
    branches/Version-1_0-branch/property/setup/phpgw_no.lang
    branches/Version-1_0-branch/rental/inc/class.bofellesdata.inc.php
    branches/Version-1_0-branch/rental/inc/class.uiparty.inc.php
    branches/Version-1_0-branch/rental/js/rental/common.js

Added Paths:
-----------
    
branches/Version-1_0-branch/property/inc/custom/default/varsle_prosjektoordinator_ved_avsluttet_relatert_melding_BBB.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
   + 
/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

Modified: branches/Version-1_0-branch/phpgwapi/inc/class.db_adodb.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.db_adodb.inc.php     
2011-09-30 17:47:11 UTC (rev 7767)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.db_adodb.inc.php     
2011-09-30 17:48:40 UTC (rev 7768)
@@ -355,6 +355,11 @@
                */
                public function transaction_begin()
                {
+                       if(!$this->adodb)
+                       {
+                               $this->connect();
+                       }
+
                        $this->Transaction =  $this->adodb->StartTrans();
                        return $this->Transaction;
                }

Modified: branches/Version-1_0-branch/phpgwapi/inc/class.db_pdo.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.db_pdo.inc.php       
2011-09-30 17:47:11 UTC (rev 7767)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.db_pdo.inc.php       
2011-09-30 17:48:40 UTC (rev 7768)
@@ -543,6 +543,11 @@
                        echo "<b>db::{$bt[0]['function']} Called from file: 
{$bt[0]['file']} line: {$bt[0]['line']}</b><br/>";
                        unset($bt);
 */
+                       if(!$this->db)
+                       {
+                               $this->connect();
+                       }
+                       
                        $this->Transaction = $this->db->beginTransaction();
                        return $this->Transaction;
                }

Modified: branches/Version-1_0-branch/phpgwapi/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/setup/setup.inc.php    2011-09-30 
17:47:11 UTC (rev 7767)
+++ branches/Version-1_0-branch/phpgwapi/setup/setup.inc.php    2011-09-30 
17:48:40 UTC (rev 7768)
@@ -12,7 +12,7 @@
        // Basic information about this app
        $setup_info['phpgwapi']['name']      = 'phpgwapi';
        $setup_info['phpgwapi']['title']     = 'phpgwapi';
-       $setup_info['phpgwapi']['version']   = '0.9.17.534';
+       $setup_info['phpgwapi']['version']   = '0.9.17.535';
        $setup_info['phpgwapi']['versions']['current_header'] = '1.31';
        $setup_info['phpgwapi']['versions']['system'] = '1.0';
        $setup_info['phpgwapi']['enable']    = 3;

Modified: branches/Version-1_0-branch/phpgwapi/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/setup/tables_current.inc.php   
2011-09-30 17:47:11 UTC (rev 7767)
+++ branches/Version-1_0-branch/phpgwapi/setup/tables_current.inc.php   
2011-09-30 17:48:40 UTC (rev 7768)
@@ -608,7 +608,7 @@
                                'location_id' => array('type' => 
'int','precision' => 4,'nullable' => false),
                                'id' => array('type' => 'int','precision' => 
4,'nullable' => false),
                                'descr' => array('type' => 'text','nullable' => 
true),
-                               'file_name ' => array('type' => 
'varchar','precision' => 50,'nullable' => false),
+                               'file_name' => array('type' => 
'varchar','precision' => 255,'nullable' => false),
                                'active' => array('type' => 'int','precision' 
=> 2,'nullable' => true),
                                'custom_sort' => array('type' => 
'int','precision' => 4,'nullable' => true)
                        ),

Modified: branches/Version-1_0-branch/phpgwapi/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/setup/tables_update.inc.php    
2011-09-30 17:47:11 UTC (rev 7767)
+++ branches/Version-1_0-branch/phpgwapi/setup/tables_update.inc.php    
2011-09-30 17:48:40 UTC (rev 7768)
@@ -2933,3 +2933,20 @@
                        return $GLOBALS['setup_info']['phpgwapi']['currentver'];
                }
        }
+
+       $test[] = '0.9.17.534';
+       /**
+       * Need more space for filename
+       *
+       * @return string the new version number
+       */
+       function phpgwapi_upgrade0_9_17_534()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+               
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_cust_function','file_name', 
array('type' => 'varchar','precision' => 255,'nullable' => false));
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['phpgwapi']['currentver'] = 
'0.9.17.535';
+                       return $GLOBALS['setup_info']['phpgwapi']['currentver'];
+               }
+       }

Modified: branches/Version-1_0-branch/property/inc/class.botts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.botts.inc.php        
2011-09-30 17:47:11 UTC (rev 7767)
+++ branches/Version-1_0-branch/property/inc/class.botts.inc.php        
2011-09-30 17:48:40 UTC (rev 7768)
@@ -1011,10 +1011,42 @@
                        return $receipt;
                }
 
+               public function update_priority($data, $id = 0)
+               {
+                       $receipt        = $this->so->update_priority($data, 
$id);
+                       $this->fields_updated = $this->so->fields_updated;
+                       return $receipt;
+               }
+
                public function update_ticket($data, $id,$receipt = array())
                {
                        $receipt = $this->so->update_ticket($data, $id, 
$receipt);
-                       $this->fields_updated = $this->so->fields_updated;      
        
+                       $this->fields_updated = $this->so->fields_updated;
+
+                       $criteria = array
+                       (
+                               'appname'       => 'property',
+                               'location'      => $this->acl_location,
+                               'allrows'       => true
+                       );
+
+                       $custom_functions = 
$GLOBALS['phpgw']->custom_functions->find($criteria);
+
+                       foreach ( $custom_functions as $entry )
+                       {
+                               // prevent path traversal
+                               if ( preg_match('/\.\./', $entry['file_name']) )
+                               {
+                                       continue;
+                               }
+
+                               $file = PHPGW_SERVER_ROOT . 
"/property/inc/custom/{$GLOBALS['phpgw_info']['user']['domain']}/{$entry['file_name']}";
+                               if ( $entry['active'] && is_file($file) )
+                               {
+                                       require $file;
+                               }
+                       }
+
                        return $receipt;
                }
 

Modified: branches/Version-1_0-branch/property/inc/class.sotts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sotts.inc.php        
2011-09-30 17:47:11 UTC (rev 7767)
+++ branches/Version-1_0-branch/property/inc/class.sotts.inc.php        
2011-09-30 17:48:40 UTC (rev 7768)
@@ -779,6 +779,7 @@
                        }
                        return $status;
                }
+
                function update_status($ticket,$id = 0)
                {
                        $id = (int) $id;
@@ -841,8 +842,36 @@
 
                }
 
+               function update_priority($ticket,$id = 0)
+               {
+                       $id = (int) $id;
+                       $receipt = array();
+                       $this->db->query("SELECT priority FROM fm_tts_tickets 
WHERE id={$id}",__LINE__,__FILE__);
+                       $this->db->next_record();
+                       $oldpriority  = $this->db->f('priority');
+
+                       $this->db->transaction_begin();
+
+                       if ($oldpriority != $ticket['priority'])
+                       {
+                               $this->fields_updated = true;
+                               $this->db->query("UPDATE fm_tts_tickets set 
priority='" . $ticket['priority']
+                                       . "' WHERE id={$id}",__LINE__,__FILE__);
+                               
$this->historylog->add('P',$id,$ticket['priority'],$oldpriority);
+                       }
+
+                       $this->db->transaction_commit();
+
+                       if ($this->fields_updated)
+                       {
+                               $receipt['message'][]= array('msg' => 
lang('Ticket %1 has been updated',$id));
+                       }
+                       return $receipt;
+               }
+
                function update_ticket($ticket,$id = 0, $receipt = array())
                {
+                       $this->fields_updated = array();
                        $id = (int) $id;
                        // DB Content is fresher than http posted value.
                        $this->db->query("select * from fm_tts_tickets where 
id='$id'",__LINE__,__FILE__);
@@ -943,7 +972,7 @@
                        {
                                if ($oldfinnish_date != $finnish_date)
                                {
-                                       $this->fields_updated = true;
+                                       $this->fields_updated[] = 
'finnish_date';
                                        
$this->historylog->add('F',$id,$finnish_date,$oldfinnish_date);
                                }
                        }
@@ -953,7 +982,7 @@
                                $check_old_custom = (int) trim($old_status,'C');
                                $this->db->query("SELECT * from fm_tts_status 
WHERE id = {$check_old_custom}",__LINE__,__FILE__);
                                $this->db->next_record();
-                               $this->fields_updated = true;
+                               $this->fields_updated[] = 'status';
                                if($old_status=='X' || $this->db->f('closed'))
                                {
                                        $new_status = $ticket['status'];
@@ -971,7 +1000,7 @@
 
                        if (($oldassigned != $ticket['assignedto']) && 
$ticket['assignedto'] != 'ignore')
                        {
-                               $this->fields_updated = true;
+                               $this->fields_updated[] = 'assignedto';
 
                                $value_set=array('assignedto'   => 
$ticket['assignedto']);
                                $value_set      = 
$this->db->validate_update($value_set);
@@ -982,7 +1011,7 @@
 
                        if (($oldgroup_id != $ticket['group_id']) && 
$ticket['group_id'] != 'ignore')
                        {
-                               $this->fields_updated = true;
+                               $this->fields_updated[] = 'group_id';
 
                                $value_set=array('group_id'     => 
$ticket['group_id']);
                                $value_set      = 
$this->db->validate_update($value_set);
@@ -993,7 +1022,7 @@
 
                        if ($oldpriority != $ticket['priority'])
                        {
-                               $this->fields_updated = true;
+                               $this->fields_updated[] = 'priority';
                                $this->db->query("update fm_tts_tickets set 
priority='" . $ticket['priority']
                                        . "' where id='$id'",__LINE__,__FILE__);
                                
$this->historylog->add('P',$id,$ticket['priority'],$oldpriority);
@@ -1002,13 +1031,13 @@
                        if ($old_contact_id != $ticket['contact_id'])
                        {
                                $contact_id  = (int) $ticket['contact_id'];
-                               $this->fields_updated = true;
+                               $this->fields_updated[] = 'contact_id';
                                $this->db->query("update fm_tts_tickets set 
contact_id={$contact_id} WHERE id=$id",__LINE__,__FILE__);
                        }
 
                        if (($oldcat_id != $ticket['cat_id']) && 
$ticket['cat_id'] != 'ignore')
                        {
-                               $this->fields_updated = true;
+                               $this->fields_updated[] = 'cat_id';
                                $this->db->query("update fm_tts_tickets set 
cat_id='" . $ticket['cat_id']
                                        . "' where id='$id'",__LINE__,__FILE__);
                                
$this->historylog->add('T',$id,$ticket['cat_id'],$oldcat_id);
@@ -1016,7 +1045,7 @@
 
                        if ($old_budget != $ticket['budget'])
                        {
-                               $this->fields_updated = true;
+                               $this->fields_updated[] = 'budget';
                                $this->db->query("UPDATE fm_tts_tickets set 
budget='" . (int)$ticket['budget']
                                        . "' where id='$id'",__LINE__,__FILE__);
                                
$this->historylog->add('B',$id,$ticket['budget'],$old_budget);
@@ -1024,7 +1053,7 @@
        /*
                        if ($old_billable_rate != $ticket['billable_rate'])
                        {
-                               $this->fields_updated = true;
+                               $this->fields_updated[] = 'billable_rate';
                                $this->db->query("update fm_tts_tickets set 
billable_rate='" . $ticket['billable_rate']
                                        . "' where id='$id'",__LINE__,__FILE__);
                                
$this->historylog->add('B',$id,$ticket['billable_rate'],$old_billable_rate);
@@ -1063,7 +1092,7 @@
                                $this->db->query("UPDATE fm_tts_tickets SET 
order_cat_id='" . (int)$ticket['order_cat_id']
                                        . "' WHERE id='$id'",__LINE__,__FILE__);
                                $receipt['message'][]= array('msg' => 
lang('order category has been updated'));
-                               $this->fields_updated = true;
+                               $this->fields_updated[] = 'order_cat_id';
                        }
 
                        if ((int)$old_order_dim1 != (int)$ticket['order_dim1'])
@@ -1071,7 +1100,7 @@
                                $this->db->query("UPDATE fm_tts_tickets SET 
order_dim1='" . (int)$ticket['order_dim1']
                                        . "' WHERE id='$id'",__LINE__,__FILE__);
                                $receipt['message'][]= array('msg' => 
lang('order_dim1 has been updated'));
-                               $this->fields_updated = true;
+                               $this->fields_updated[] = 'order_dim1';
                        }
 
                        if ($old_building_part != $ticket['building_part'])
@@ -1079,12 +1108,12 @@
                                $this->db->query("UPDATE fm_tts_tickets SET 
building_part='" . $ticket['building_part']
                                        . "' WHERE id='$id'",__LINE__,__FILE__);
                                $receipt['message'][]= array('msg' => 
lang('building part has been updated'));
-                               $this->fields_updated = true;
+                               $this->fields_updated[] = 'building_part';
                        }
 
                        if (($old_note != $ticket['note']) && $ticket['note'])
                        {
-                               $this->fields_updated = true;
+                               $this->fields_updated[] = 'note';
                                
$this->historylog->add('C',$id,$ticket['note'],$old_note);
                                $_history_id = 
$this->db->get_last_insert_id('fm_tts_history','history_id');
                                $this->db->query("UPDATE fm_tts_history SET 
publish = 1 WHERE history_id = $_history_id",__LINE__,__FILE__);

Modified: branches/Version-1_0-branch/property/inc/class.uitts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uitts.inc.php        
2011-09-30 17:47:11 UTC (rev 7767)
+++ branches/Version-1_0-branch/property/inc/class.uitts.inc.php        
2011-09-30 17:48:40 UTC (rev 7768)
@@ -49,6 +49,7 @@
                        'download2'                     => true,
                        'view_file'                     => true,
                        'edit_status'           => true,
+                       'edit_priority'         => true,
                        'update_data'           => true,
                        '_print'                        => true,
                        'columns'                       => true
@@ -318,10 +319,30 @@
                        {
                                $receipt = $this->bo->mail_ticket($id, 
$this->bo->fields_updated, $receipt);
                        }
-                       //      
$GLOBALS['phpgw']->session->appsession('receipt','property',$receipt);
-                       return "id ".$id." ".lang('Status has been changed');
+                       return "id {$id} " . lang('Status has been changed');
                }
 
+               function edit_priority()
+               {
+                       if(!$this->acl_edit)
+                       {
+                               return lang('sorry - insufficient rights');
+                       }
+
+                       $new_priority = phpgw::get_var('new_priority', 
'string', 'GET');
+                       $id             = phpgw::get_var('id', 'int');
+
+                       $ticket = $this->bo->read_single($id);
+
+                       $receipt        = 
$this->bo->update_priority(array('priority'=>$new_priority),$id);
+                       if 
(isset($this->bo->config->config_data['mailnotification']) && 
$this->bo->config->config_data['mailnotification'])
+                       {
+                               $receipt = $this->bo->mail_ticket($id, 
$this->bo->fields_updated, $receipt);
+                       }
+                       return "id {$id} " . lang('priority has been changed');
+               }
+
+
                function delete()
                {
                        if(!$this->acl_delete)
@@ -1130,7 +1151,7 @@
                                                (
                                                        'my_name'               
=> 'status',
                                                        'statustext'    => 
$status_info['status'],
-                                                       'text'                  
=> lang('change to') . ':  ' .$status_info['status'],
+                                                       'text'                  
=> lang('change to') . ' status:  ' .$status_info['status'],
                                                        'confirm_msg'   => 
lang('do you really want to change the status to %1',$status_info['status']),
                                                        'action'                
=> $GLOBALS['phpgw']->link('/index.php',array
                                                        (
@@ -1151,8 +1172,38 @@
                                                        'parameters'    => 
$parameters
                                                );
                                }
+
+                               $_priorities = $this->bo->get_priority_list();
+                               foreach ($_priorities as $_priority => 
$_priority_info)
+                               {
+                                       $datatable['rowactions']['action'][] = 
array
+                                       (
+                                               'my_name'               => 
'priority',
+                                               'statustext'    => 
$_priority_info['name'],
+                                               'text'                  => 
lang('change to') . ' ' . lang('priority') .':  ' .$_priority_info['name'],
+                                               'confirm_msg'   => lang('do you 
really want to change the priority to %1',$_priority_info['name']),
+                                               'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
+                                               (
+                                                       'menuaction'            
=> 'property.uitts.edit_priority',
+                                                       'edit_status'           
=> true,
+                                                       'new_priority'          
=> $_priority,
+                                                       'second_display'        
=> true,
+                                                       'sort'                  
        => $this->sort,
+                                                       'order'                 
        => $this->order,
+                                                       'cat_id'                
        => $this->cat_id,
+                                                       'filter'                
        => $this->filter,
+                                                       'user_filter'           
=> $this->user_filter,
+                                                       'query'                 
        => $this->query,
+                                                       'district_id'           
=> $this->district_id,
+                                                       'allrows'               
        => $this->allrows,
+                                                       'delete'                
        => 'dummy'// FIXME to trigger the json in property.js.
+                                               )),
+                                               'parameters'    => $parameters
+                                       );
+                               }
                        }
 
+
                        if($this->acl_add)
                        {
                                $datatable['rowactions']['action'][] = array

Modified: branches/Version-1_0-branch/property/inc/class.uiwo_hour.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiwo_hour.inc.php    
2011-09-30 17:47:11 UTC (rev 7767)
+++ branches/Version-1_0-branch/property/inc/class.uiwo_hour.inc.php    
2011-09-30 17:48:40 UTC (rev 7768)
@@ -1404,8 +1404,6 @@
                                        'lang_contact_phone'                    
=> lang('Contact phone'),
                                        'contact_phone'                         
        => $project['contact_phone'],
 
-                                       //                              
'lang_vendor'                                   =>      lang('vendor'),
-
                                        'lang_branch'                           
        => lang('branch'),
                                        'branch_list'                           
        => $this->boproject->select_branch_p_list($project['project_id']),
                                        'other_branch'                          
        => $project['other_branch'],

Copied: 
branches/Version-1_0-branch/property/inc/custom/default/varsle_prosjektoordinator_ved_avsluttet_relatert_melding_BBB.php
 (from rev 7767, 
trunk/property/inc/custom/default/varsle_prosjektoordinator_ved_avsluttet_relatert_melding_BBB.php)
===================================================================
--- 
branches/Version-1_0-branch/property/inc/custom/default/varsle_prosjektoordinator_ved_avsluttet_relatert_melding_BBB.php
                            (rev 0)
+++ 
branches/Version-1_0-branch/property/inc/custom/default/varsle_prosjektoordinator_ved_avsluttet_relatert_melding_BBB.php
    2011-09-30 17:48:40 UTC (rev 7768)
@@ -0,0 +1,15 @@
+<?php
+       $db = & $GLOBALS['phpgw']->db;
+
+       if(in_array('status', $this->fields_updated))
+       {
+               $_status = (int) trim($data['status'],'C');
+               $db->query("SELECT * from fm_tts_status WHERE id = 
{$_status}",__LINE__,__FILE__);
+               $this->db->next_record();
+               if($db->f('closed'))
+               {
+                       _debug_array($this->fields_updated);                    
        
+               }
+       }
+       
+

Modified: branches/Version-1_0-branch/property/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/property/setup/phpgw_no.lang    2011-09-30 
17:47:11 UTC (rev 7767)
+++ branches/Version-1_0-branch/property/setup/phpgw_no.lang    2011-09-30 
17:48:40 UTC (rev 7768)
@@ -541,6 +541,7 @@
 download       common  no      Last ned
 download table to your browser common  no      Last ned tabell til din 
nettleser
 do you really want to change the status to %1  property        no      Vil du 
virkelig endre status til %1
+do you really want to change the priority to %1        property        no      
Vil du virkelig endre prioritet til %1
 do you really want to delete this entry        property        no      Vil du 
virkelig slette denne posten
 do you really want to update the categories    property        no      vil du 
virkelig oppdatere kategoriene
 do you really want to update the categories again      property        no      
vil du virkelig oppdatere kategoriene igjen

Modified: branches/Version-1_0-branch/rental/inc/class.bofellesdata.inc.php
===================================================================
--- branches/Version-1_0-branch/rental/inc/class.bofellesdata.inc.php   
2011-09-30 17:47:11 UTC (rev 7767)
+++ branches/Version-1_0-branch/rental/inc/class.bofellesdata.inc.php   
2011-09-30 17:48:40 UTC (rev 7768)
@@ -25,8 +25,8 @@
                        $config = CreateObject('phpgwapi.config','rental');
                        $config->read();
 
-//                     $db = createObject('phpgwapi.db', null, null, true);
-                       $db = createObject('property.db_oci8');
+                       $db = createObject('phpgwapi.db', null, null, true);
+//                     $db = createObject('property.db_oci8');
 
                        $db->debug = 
!!$config->config_data['external_db_debug'];
                        $db->Host = $config->config_data['external_db_host'];
@@ -143,6 +143,7 @@
                                }
                        }
                }
+       
                
                public function get_result_units()
                {
@@ -170,10 +171,11 @@
                {
                        $this->log(__class__, __function__);
 
-                       $columns = "V_ORG_ENHET.ORG_ENHET_ID, 
V_ORG_ENHET.ORG_NAVN, V_ORG_PERSON.FORNAVN, V_ORG_PERSON.ETTERNAVN, 
V_ORG_PERSON.BRUKERNAVN";
-                       $tables = "V_ORG_ENHET";
+                       $columns =      "V_ORG_ENHET.ORG_ENHET_ID, 
V_ORG_ENHET.ORG_NAVN, V_ORG_ENHET.EPOST, V_ORG_PERSON.FORNAVN, 
V_ORG_PERSON.ETTERNAVN, V_ORG_PERSON.BRUKERNAVN";
+                       $tables =       "V_ORG_ENHET";
                        $joins =        "LEFT JOIN V_ORG_PERSON_ENHET ON 
(V_ORG_ENHET.ORG_ENHET_ID = V_ORG_PERSON_ENHET.ORG_ENHET_ID AND 
V_ORG_PERSON_ENHET.prioritet = 1) ".
                                                "LEFT JOIN V_ORG_PERSON ON 
(V_ORG_PERSON.ORG_PERSON_ID = V_ORG_PERSON_ENHET.ORG_PERSON_ID)";
+                       
                        $sql = "SELECT $columns FROM $tables $joins WHERE 
V_ORG_ENHET.ORG_NIVAA = 4 AND V_ORG_ENHET.ORG_ENHET_ID = {$org_unit_id}";
                        $db = $this->get_db();
                        $db->query($sql,__LINE__,__FILE__);
@@ -185,6 +187,7 @@
                                return array(
                                                "ORG_UNIT_ID" => 
(int)$db->f('ORG_ENHET_ID'),
                                                "ORG_UNIT_NAME" => 
$db->f('ORG_NAVN'),
+                                               "ORG_EMAIL" => $db->f('EPOST'),
                                                "LEADER_FIRSTNAME" => 
$db->f('FORNAVN'),
                                                "LEADER_LASTNAME" => 
$db->f('ETTERNAVN'),
                                                "LEADER_FULLNAME" => $full_name,
@@ -192,7 +195,32 @@
                                        );
                        }
                }
+                       
+       public function get_department_for_org_unit($org_unit_id)
+               {
+                       $this->log(__class__, __function__);
+
+                       $columns =      "DEP_ORG_ENHET.ORG_ENHET_ID, 
DEP_ORG_ENHET.ORG_NAVN";
+                       $tables =       "V_ORG_ENHET";
+                       $joins =        "LEFT JOIN V_ORG_KNYTNING ON 
(V_ORG_ENHET.ORG_ENHET_ID = V_ORG_KNYTNING.ORG_ENHET_ID) " .
+                                               "LEFT JOIN V_ORG_ENHET 
DEP_ORG_ENHET ON (V_ORG_KNYTNING.ORG_ENHET_ID_KNYTNING = 
DEP_ORG_ENHET.ORG_ENHET_ID) ";                                          
+                       
+                       $sql = "SELECT $columns FROM $tables $joins WHERE 
V_ORG_ENHET.ORG_NIVAA = 4 AND V_ORG_ENHET.ORG_ENHET_ID = {$org_unit_id}";
+                                       
+                       $db = $this->get_db();
+                       $db->query($sql,__LINE__,__FILE__);
+                                               
+                       if($db->next_record())
+                       {
+                               
+                               return array(
+                                               "DEP_ORG_ID" => 
(int)$db->f('ORG_ENHET_ID'),
+                                               "DEP_ORG_NAME" => 
$db->f('ORG_NAVN')
+                                       );
+                       }
+               }
                
+               
                public function get_result_units_with_leader($start_index, 
$num_of_objects, $sort_field, $sort_ascending,$search_for, $search_type)
                {
                        $this->log(__class__, __function__);                    

Modified: branches/Version-1_0-branch/rental/inc/class.uiparty.inc.php
===================================================================
--- branches/Version-1_0-branch/rental/inc/class.uiparty.inc.php        
2011-09-30 17:47:11 UTC (rev 7767)
+++ branches/Version-1_0-branch/rental/inc/class.uiparty.inc.php        
2011-09-30 17:48:40 UTC (rev 7768)
@@ -23,7 +23,8 @@
                        'update_all_org_enhet_id'       => true,
                        'syncronize_party'      => true,
                        'syncronize_party_name' => true,
-                       'create_user_based_on_email' => true
+                       'create_user_based_on_email' => true,
+                       'get_synchronize_party_info' => true
        );
 
        public function __construct()
@@ -401,7 +402,7 @@
                                                $value['ajax'][] = true;
                                                $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'rental.uiparty.syncronize_party', 'org_unit_id' => $value['org_unit_id'], 
'party_id' => $value['id'])));
                                                $value['labels'][] = 
lang('syncronize_party');
-                                       }
+                                       }                       
                                }
                                break;
                }
@@ -487,7 +488,7 @@
                {
                        $this->render('permission_denied.php',array('error' => 
lang('permission_denied_edit')));
                }
-
+               
                if(isset($_POST['save_party'])) // The user has pressed the 
save button
                {
                        if(isset($party)) // If a party object is created
@@ -514,6 +515,7 @@
                                $party->set_comment(phpgw::get_var('comment'));
                                
//$party->set_location_id(phpgw::get_var('location_id'));
                                
$party->set_org_enhet_id(phpgw::get_var('org_enhet_id'));
+                               
$party->set_org_unit_person(phpgw::get_var('org_unit_person'));
                                
                                
if(rental_soparty::get_instance()->store($party)) // ... and then try to store 
the object
                                {
@@ -589,6 +591,39 @@
                }
        }
        
+       public function get_synchronize_party_info()
+       {
+               if(($this->isExecutiveOfficer() || $this->isAdministrator()))
+               {
+                       $org_unit_id = phpgw::get_var("org_enhet_id");
+                                       
+                       if(isset($org_unit_id) && $org_unit_id > 0)
+                       {       
+                               $use_fellesdata = 
$config->config_data['use_fellesdata'];       
+                               if(!$use_fellesdata){
+                                       return;
+                               }
+                                                               
+                               $bofelles = rental_bofellesdata::get_instance();
+                               
+                               $org_unit_with_leader = 
$bofelles->get_result_unit_with_leader($org_unit_id);
+                               $org_department = 
$bofelles->get_department_for_org_unit($org_unit_id);
+                               
+                               $org_name = 
$org_unit_with_leader['ORG_UNIT_NAME'];
+                               $org_email = $org_unit_with_leader['ORG_EMAIL'];
+                               $unit_leader_fullname = 
$org_unit_with_leader['LEADER_FULLNAME'];
+                               
+                               $dep_org_name = $org_department['DEP_ORG_NAME'];
+                                                                       
+                               $jsonArr = array("email" => trim($org_email), 
"org_name" => trim($org_name), 
+                                                                
"unit_leader_fullname" => trim($unit_leader_fullname), "department" => 
trim($dep_org_name));
+                               
+                               return json_decode( json_encode($jsonArr) );
+                               
+                       }       
+               }
+       }       
+               
        /**
         * Function to create Portico Estate users based on email, first- and 
lastname on contract parties.
         */

Modified: branches/Version-1_0-branch/rental/js/rental/common.js
===================================================================
--- branches/Version-1_0-branch/rental/js/rental/common.js      2011-09-30 
17:47:11 UTC (rev 7767)
+++ branches/Version-1_0-branch/rental/js/rental/common.js      2011-09-30 
17:48:40 UTC (rev 7768)
@@ -257,3 +257,39 @@
         YAHOO.util.Dom.replaceClass(fieldname + "_edit", "showit", "hideit");
     }
 }
+
+YAHOO.util.Event.addListener(
+               'fetchSyncData',
+               'click',
+               function(){             
+                       
+                       var org_enhet_id = 
document.getElementById('org_enhet_id').value;
+                       
+                        YAHOO.util.Connect.asyncRequest (
+                               'POST',
+                               
"http://portico/pe/index.php?menuaction=rental.uiparty.get_synchronize_party_info&phpgw_return_as=json&org_enhet_id=";
 + org_enhet_id,
+                               {
+                                       success: syncInfo,
+                                       failure: function (o) {
+                                               YAHOO.rental.Log( "TID: " + 
o.tId + ", HTTP Status: " + o.status + ", Message: " + o.StatusText );
+                                               YAHOO.rental.Log( "<br><br>" );
+                                       }
+                               }
+                               );
+               }
+);
+
+function syncInfo(o)
+{
+       var syncInfo = YAHOO.lang.JSON.parse(o.responseText);
+        
+       var email = syncInfo.email;
+       var department = syncInfo.org_name;
+       var org_name = syncInfo.org_name;
+       var unit_leader = syncInfo.unit_leader_fullname;
+           
+       document.getElementById('email').value = email;
+       document.getElementById('company_name').value = org_name;
+       document.getElementById('department').value = department;
+       document.getElementById('unit_leader').value = unit_leader;
+}




reply via email to

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