fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8369] Merge 8353:8368 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [8369] Merge 8353:8368 from trunk
Date: Mon, 19 Dec 2011 11:59:12 +0000

Revision: 8369
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8369
Author:   sigurdne
Date:     2011-12-19 11:59:11 +0000 (Mon, 19 Dec 2011)
Log Message:
-----------
Merge 8353:8368 from trunk

Modified Paths:
--------------
    
branches/Version-1_0-branch/activitycalendarfrontend/inc/class.uiactivity.inc.php
    
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new.php
    branches/Version-1_0-branch/controller/images/status_icon_light_green.png
    branches/Version-1_0-branch/controller/images/status_icon_light_green.psd
    
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
    branches/Version-1_0-branch/controller/templates/base/css/base.css
    
branches/Version-1_0-branch/controller/templates/base/view_calendar_month.xsl
    branches/Version-1_0-branch/controller/templates/base/view_calendar_year.xsl
    branches/Version-1_0-branch/controller/templates/base/view_check_lists.xsl
    branches/Version-1_0-branch/phpgwapi/inc/class.custom_functions.inc.php
    branches/Version-1_0-branch/phpgwapi/inc/class.phpgw.inc.php
    branches/Version-1_0-branch/phpgwapi/inc/class.sessions.inc.php
    branches/Version-1_0-branch/phpgwapi/inc/class.xslttemplates.inc.php
    branches/Version-1_0-branch/property/inc/class.boalarm.inc.php
    branches/Version-1_0-branch/property/inc/class.botts.inc.php
    branches/Version-1_0-branch/property/inc/class.menu.inc.php
    branches/Version-1_0-branch/property/inc/class.sotts.inc.php
    branches/Version-1_0-branch/property/inc/class.uiproject.inc.php
    branches/Version-1_0-branch/property/inc/class.uitts.inc.php
    branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php

Added Paths:
-----------
    branches/Version-1_0-branch/controller/images/status_icon_dark_blue.png
    branches/Version-1_0-branch/controller/images/status_icon_dark_blue.psd
    branches/Version-1_0-branch/controller/images/status_icon_dark_green.png
    branches/Version-1_0-branch/controller/images/status_icon_dark_green.psd
    branches/Version-1_0-branch/controller/images/status_icon_light_blue.png
    branches/Version-1_0-branch/controller/images/status_icon_light_blue.psd
    
branches/Version-1_0-branch/property/inc/custom/default/catch_ticket_export.php

Removed Paths:
-------------
    branches/Version-1_0-branch/controller/images/status_icon_blue.png
    branches/Version-1_0-branch/controller/images/status_icon_blue.psd
    branches/Version-1_0-branch/controller/images/status_icon_dark_green.png
    branches/Version-1_0-branch/controller/images/status_icon_red.psd

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

Modified: 
branches/Version-1_0-branch/activitycalendarfrontend/inc/class.uiactivity.inc.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendarfrontend/inc/class.uiactivity.inc.php
   2011-12-19 10:43:14 UTC (rev 8368)
+++ 
branches/Version-1_0-branch/activitycalendarfrontend/inc/class.uiactivity.inc.php
   2011-12-19 11:59:11 UTC (rev 8369)
@@ -125,6 +125,13 @@
                                //$persons = 
$this->so_organization->get_contacts($o_id);                               
                                //$organization = 
$this->so_organization->get_single($o_id);
                                
+                               $get_org_from_local = false;
+                               $new_org = phpgw::get_var('new_org');
+                               if($new_org != null && $new_org == 'yes')
+                               {
+                                       $get_org_from_local = true;
+                               }
+                               
                                if($o_id == "new_org")
                                {
                                        $activity->set_new_org(true);
@@ -169,6 +176,7 @@
                                        $person_ids = 
$this->so_organization->get_contacts_local($o_id);
                                        $desc = 
phpgw::get_var('org_description');
                                        $organization = 
$this->so_organization->get_organization_local($o_id);
+                                       $new_org = true;
                                        //var_dump($organization);
                                }
                                else if(is_numeric($o_id) && $o_id > 0)
@@ -224,15 +232,30 @@
                                        }
                                        else if(isset($o_id) && 
is_numeric($o_id) && $o_id > 0)
                                        {
-                                               $person_ids = 
$this->so_organization->get_contacts($o_id);
-                                               $person_arr = 
$this->so_contact->get_local_contact_persons($o_id);
-                                               foreach($person_arr as $p)
+                                               if($get_org_from_local)
                                                {
-                                                       //var_dump($p);
-                                                       $persons[] = $p;
+                                                       $person_arr = 
$this->so_contact->get_local_contact_persons($o_id);
+                                                       foreach($person_arr as 
$p)
+                                                       {
+                                                               //var_dump($p);
+                                                               $persons[] = $p;
+                                                       }
+                                                       $person_ids = 
$this->so_organization->get_contacts_local($o_id);
+                                                       $desc = 
$this->so_organization->get_description_local($o_id);
+                                                       $organization = 
$this->so_organization->get_organization_local($o_id);
                                                }
-                                               $desc = 
$this->so_organization->get_description($o_id);
-                                               $organization = 
$this->so_organization->get_single($o_id);
+                                               else
+                                               {
+                                                       $person_ids = 
$this->so_organization->get_contacts($o_id);
+                                                       $person_arr = 
$this->so_contact->get_local_contact_persons($o_id);
+                                                       foreach($person_arr as 
$p)
+                                                       {
+                                                               //var_dump($p);
+                                                               $persons[] = $p;
+                                                       }
+                                                       $desc = 
$this->so_organization->get_description($o_id);
+                                                       $organization = 
$this->so_organization->get_single($o_id);
+                                               }
                                        }
                                }
                                
@@ -334,7 +357,11 @@
                                                (
                                                        'activity'      => 
$activity,
                                                        'organizations' => 
$organizations,
+                                                       'organization' => 
$organization,
+                                                       'contact1' => 
$persons[0],
+                                                       'contact2' => 
$persons[1],
                                                        'org_name' => $org_name,
+                                                       'new_org' => $new_org,
                                                        'groups' => $groups,
                                                        'arenas' => $arenas,
                                                        'buildings' => 
$buildings,

Modified: 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new.php
        2011-12-19 10:43:14 UTC (rev 8368)
+++ 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity_new.php
        2011-12-19 11:59:11 UTC (rev 8369)
@@ -332,6 +332,9 @@
                                <dt>
                                        <label for="organization_id"><?php echo 
lang('organization') ?></label>
                                </dt>
+                                       <?php if($new_org){?>
+                                               <input type="hidden" 
name="new_org" id="new_org" value="yes" />
+                                       <?php }?>
                                        <?php if($new_organization){?>
                                        <input type="hidden" 
name="organization_id" id="organization_id" value="new_org" />
                                                <dt><label 
for="orgname">Organisasjonsnavn</label></dt>

Deleted: branches/Version-1_0-branch/controller/images/status_icon_blue.png
===================================================================
(Binary files differ)

Deleted: branches/Version-1_0-branch/controller/images/status_icon_blue.psd
===================================================================
(Binary files differ)

Copied: branches/Version-1_0-branch/controller/images/status_icon_dark_blue.png 
(from rev 8368, trunk/controller/images/status_icon_dark_blue.png)
===================================================================
(Binary files differ)

Copied: branches/Version-1_0-branch/controller/images/status_icon_dark_blue.psd 
(from rev 8368, trunk/controller/images/status_icon_dark_blue.psd)
===================================================================
(Binary files differ)

Deleted: 
branches/Version-1_0-branch/controller/images/status_icon_dark_green.png
===================================================================
(Binary files differ)

Copied: 
branches/Version-1_0-branch/controller/images/status_icon_dark_green.png (from 
rev 8368, trunk/controller/images/status_icon_dark_green.png)
===================================================================
(Binary files differ)

Copied: 
branches/Version-1_0-branch/controller/images/status_icon_dark_green.psd (from 
rev 8368, trunk/controller/images/status_icon_dark_green.psd)
===================================================================
(Binary files differ)

Copied: 
branches/Version-1_0-branch/controller/images/status_icon_light_blue.png (from 
rev 8368, trunk/controller/images/status_icon_light_blue.png)
===================================================================
(Binary files differ)

Copied: 
branches/Version-1_0-branch/controller/images/status_icon_light_blue.psd (from 
rev 8368, trunk/controller/images/status_icon_light_blue.psd)
===================================================================
(Binary files differ)

Modified: 
branches/Version-1_0-branch/controller/images/status_icon_light_green.png
===================================================================
(Binary files differ)

Modified: 
branches/Version-1_0-branch/controller/images/status_icon_light_green.psd
===================================================================
(Binary files differ)

Deleted: branches/Version-1_0-branch/controller/images/status_icon_red.psd
===================================================================
(Binary files differ)

Modified: 
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
===================================================================
--- 
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
 2011-12-19 10:43:14 UTC (rev 8368)
+++ 
branches/Version-1_0-branch/controller/inc/component/class.calendar_builder.inc.php
 2011-12-19 11:59:11 UTC (rev 8369)
@@ -29,12 +29,12 @@
                                if( $period_type == "view_months" )
                                {
                                        $calendar_array[ date("n", $date) 
]["status"]  = 0;
-                                       $calendar_array[ date("n", $date) 
]["info"]  = array("date" => $date);
+                                       $calendar_array[ date("n", $date) 
]["info"]  = array("date" => $date, "control_id" => $control->get_id());
                                }
                                else if( $period_type == "view_days" )
                                {
                                        $calendar_array[ date("j", $date) 
]["status"]  = 0;
-                                       $calendar_array[ date("j", $date) 
]["info"]  = array("date" => $date);  
+                                       $calendar_array[ date("j", $date) 
]["info"]  = array("date" => $date, "control_id" => $control->get_id());      
                                }
                        }
                        
@@ -47,34 +47,47 @@
 
                                if( $check_list->get_status() == 0 ){
                                        $check_list_status_info->set_status(0);
+                                       $status = 0;
                                }
-                               else if( $check_list->get_status() == 1 & 
$check_list->get_planned_date() == 0)
+                               else if( $check_list->get_status() == 1)
                                {
                                        $check_list_status_info->set_status(1);
+                                       $status = 1;
                                }
                                else if( $check_list->get_status() == 2 & 
$check_list->get_completed_date() < $check_list->get_deadline() )
                                {
                                        $check_list_status_info->set_status(2);
+                                       $status = 2;
                                }
                                else if( $check_list->get_status() == 3 & 
$check_list->get_completed_date() > $check_list->get_deadline() )
                                {
                                        $check_list_status_info->set_status(3);
+                                       $status = 3;
                                }
                                else if( $check_list->get_status() == 4 )
                                {
                                        $check_list_status_info->set_status(4);
+                                       $status = 4;
                                }
+                               else if( $check_list->get_status() == 5 )
+                               {
+                                       $check_list_status_info->set_status(5);
+                                       $status = 5;
+                               }
                                
                                $check_list_status_info->set_deadline( 
date("d/m-Y", $check_list->get_deadline()) );
                                
+                               echo "  " .  date("d/m-Y", 
$check_list->get_deadline()) . " ";
+                               echo $check_list_status_info->get_id();
+                               
                                if($period_type == "view_months")
                                {
-                                       $calendar_array[ date("n", 
$check_list->get_deadline()) ]["status"] = 1;
+                                       $calendar_array[ date("n", 
$check_list->get_deadline()) ]["status"] = $status;
                                        $calendar_array[ date("n", 
$check_list->get_deadline()) ]["info"] = $check_list_status_info->serialize();  
     
                                }
                                else if( $period_type == "view_days" )
                                {
-                                       $calendar_array[ date("j", 
$check_list->get_deadline()) ]["status"] = 1;
+                                       $calendar_array[ date("j", 
$check_list->get_deadline()) ]["status"] = $status;
                                        $calendar_array[ date("j", 
$check_list->get_deadline()) ]["info"] = $check_list_status_info->serialize();
                                }
                        }

Modified: branches/Version-1_0-branch/controller/templates/base/css/base.css
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/css/base.css  
2011-12-19 10:43:14 UTC (rev 8368)
+++ branches/Version-1_0-branch/controller/templates/base/css/base.css  
2011-12-19 11:59:11 UTC (rev 8369)
@@ -989,4 +989,14 @@
 }
 #days_view div{
        font-weight:bold;
-}
\ No newline at end of file
+}
+.calendar .months {
+    margin-left: 20px;
+    width: 440px;
+    padding:0;
+}
+.calendar .months a{
+    text-decoration: none;
+    color:#000;
+}
+

Modified: 
branches/Version-1_0-branch/controller/templates/base/view_calendar_month.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/view_calendar_month.xsl   
    2011-12-19 10:43:14 UTC (rev 8368)
+++ 
branches/Version-1_0-branch/controller/templates/base/view_calendar_month.xsl   
    2011-12-19 11:59:11 UTC (rev 8369)
@@ -1,6 +1,7 @@
 <!-- $Id$ -->
 <xsl:template match="data" name="view_check_lists" 
xmlns:php="http://php.net/xsl";>
 <xsl:variable name="date_format">d/m-Y</xsl:variable>
+<xsl:variable name="location_code"><xsl:value-of 
select="location_array/location_code"/></xsl:variable>
 
 <div id="main_content">
                        
@@ -52,7 +53,6 @@
                
                <xsl:choose>
                        <xsl:when test="controls_calendar_array/child::node()">
-                       
                        <ul style="clear:left;" class="calendar info">
                                <li class="heading">
                                        <div class="id">ID</div>
@@ -114,15 +114,29 @@
                                                                                
                <xsl:text>&amp;date=</xsl:text>
                                                                                
                <xsl:value-of select="info/date"/>
                                                                                
                <xsl:text>&amp;control_id=</xsl:text>
-                                                                               
                <xsl:value-of select="//control/id"/>
+                                                                               
                <xsl:value-of select="info/control_id"/>
                                                                                
                <xsl:text>&amp;location_code=</xsl:text>
-                                                                               
                <xsl:value-of select="//location_array/location_code"/>
+                                                                               
                <xsl:value-of select="$location_code"/>
                                                                                
        </xsl:attribute>
                                                                                
        <img height="15" src="controller/images/status_icon_yellow.png" />
                                                                                
</a>
                                                                                
</div>
                                                                        
</xsl:when>
                                                                        
<xsl:when test="status = 1">
+                                                                               
<div>
+                                                                               
        <a class="view_check_list">
+                                                                               
                <xsl:attribute name="href">
+                                                                               
                        
<xsl:text>index.php?menuaction=controller.uicheck_list.get_check_list_info</xsl:text>
+                                                                               
                        <xsl:text>&amp;phpgw_return_as=json</xsl:text>
+                                                                               
                        <xsl:text>&amp;check_list_id=</xsl:text>
+                                                                               
                        <xsl:value-of select="info/id"/>
+                                                                               
                </xsl:attribute>
+                                                                               
                <span style="display:none"><xsl:value-of 
select="info/id"/></span>
+                                                                               
                <img height="15" 
src="controller/images/status_icon_light_green.png" />
+                                                                               
        </a>
+                                                                               
</div>
+                                                                       
</xsl:when>
+                                                                       
<xsl:when test="status = 2">
                                                                                
<div style="position:relative;">
                                                                                
<div id="info_box" style="position:absolute;display:none;"></div>
                                                                                
        <a class="view_check_list">
@@ -137,6 +151,11 @@
                                                                                
        </a>
                                                                                
</div>
                                                                        
</xsl:when>
+                                                                       
<xsl:when test="status = 5">
+                                                                               
<div>
+                                                                               
        <img height="12" src="controller/images/status_icon_red_cross.png" />
+                                                                               
</div>
+                                                                       
</xsl:when>
                                                                        
<xsl:otherwise>
                                                                        
<div></div>
                                                                        
</xsl:otherwise>

Modified: 
branches/Version-1_0-branch/controller/templates/base/view_calendar_year.xsl
===================================================================
--- 
branches/Version-1_0-branch/controller/templates/base/view_calendar_year.xsl    
    2011-12-19 10:43:14 UTC (rev 8368)
+++ 
branches/Version-1_0-branch/controller/templates/base/view_calendar_year.xsl    
    2011-12-19 11:59:11 UTC (rev 8369)
@@ -25,6 +25,7 @@
                                        <div class="date">Slutt dato</div>
                                        <div 
class="frequency">Frekvenstype</div>
                                        <div 
class="frequency">Frekvensintervall</div>
+                                       <div class="months">
                                        <xsl:for-each select="heading_array">
                                                <div>
                                                        <a>
@@ -39,6 +40,7 @@
                                                        </a>                    
        
                                                </div>
                                        </xsl:for-each>
+                                       </div>
                                </li>
                        
                                <xsl:for-each select="controls_calendar_array">
@@ -69,6 +71,7 @@
                                                <div class="frequency">
                                                <xsl:value-of 
select="control/repeat_interval"/>
                                                </div>                          
                        
+                                               <div class="months">
                                                <xsl:for-each 
select="calendar_array">
                                                <xsl:choose>
                                                                <xsl:when 
test="status = 0">
@@ -120,6 +123,7 @@
                                                                </xsl:otherwise>
                                                        </xsl:choose>
                                                </xsl:for-each>
+                                               </div>
                                        </li>   
                                </xsl:for-each> 
                        </xsl:when>

Modified: 
branches/Version-1_0-branch/controller/templates/base/view_check_lists.xsl
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/view_check_lists.xsl  
2011-12-19 10:43:14 UTC (rev 8368)
+++ branches/Version-1_0-branch/controller/templates/base/view_check_lists.xsl  
2011-12-19 11:59:11 UTC (rev 8369)
@@ -12,11 +12,11 @@
                <fieldset class="check_list_details">
                        <label>Tittel</label><xsl:value-of 
select="control_as_array/title"/><br/>
                        <label>Startdato</label>
-                       <xsl:if test="control_as_array/start_date != ''">
+                       <xsl:if test="control_as_array/start_date != 0">
                                <xsl:value-of select="php:function('date', 
$date_format, number(control_as_array/start_date))"/><br/>
                        </xsl:if>
                        <label>Sluttdato</label>
-                       <xsl:if test="control_as_array/end_date != ''">
+                       <xsl:if test="control_as_array/end_date != 0">
                                <xsl:value-of select="php:function('date', 
$date_format, number(control_as_array/end_date))"/><br/>
                        </xsl:if>
                        <label>Frekvenstype</label><xsl:value-of 
select="control_as_array/repeat_type"/><br/>

Modified: 
branches/Version-1_0-branch/phpgwapi/inc/class.custom_functions.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.custom_functions.inc.php     
2011-12-19 10:43:14 UTC (rev 8368)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.custom_functions.inc.php     
2011-12-19 11:59:11 UTC (rev 8369)
@@ -339,7 +339,7 @@
                        $location = $this->_db->db_addslashes($location);
                        $id = (int)$id;
                        
-                       $sql = 'SELECT * FROM phpgw_cust_function '
+                       $sql = 'SELECT phpgw_cust_function.* FROM 
phpgw_cust_function '
                                . " {$this->_join} phpgw_locations ON 
phpgw_cust_function.location_id = phpgw_locations.location_id"
                                . " {$this->_join} phpgw_applications ON 
phpgw_applications.app_id = phpgw_locations.app_id"
                                . " WHERE phpgw_applications.app_name = 
'{$appname}'"

Modified: branches/Version-1_0-branch/phpgwapi/inc/class.phpgw.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.phpgw.inc.php        
2011-12-19 10:43:14 UTC (rev 8368)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.phpgw.inc.php        
2011-12-19 11:59:11 UTC (rev 8369)
@@ -174,15 +174,16 @@
                 * will use PHP_SELF. Wrapper to session->link()
                 *
                 * @access public
-                * @param string $string The url the link is for
-                * @param string $extravars     Extra params to be passed to 
the url
-                * @param string $redirect is the resultant link being used in 
a header('Location:' ... redirect?
+                * @param string  $string The url the link is for
+                * @param array   $extravars    Extra params to be passed to 
the url
+                * @param boolean $redirect is the resultant link being used in 
a header('Location:' ... redirect?
+                * @param boolean $external is the resultant link being used as 
external access (i.e url in emails..)
                 * @return string The full url after processing
                 * @see session->link()
                 */
-               public function link($url = '', $extravars = array(), $redirect 
= false)
+               public function link($url = '', $extravars = array(), $redirect 
= false, $external = false)
                {
-                       return $this->session->link($url, $extravars, 
$redirect);
+                       return $this->session->link($url, $extravars, 
$redirect, $external);
                }
 
                /**

Modified: branches/Version-1_0-branch/phpgwapi/inc/class.sessions.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.sessions.inc.php     
2011-12-19 10:43:14 UTC (rev 8368)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.sessions.inc.php     
2011-12-19 11:59:11 UTC (rev 8369)
@@ -535,10 +535,11 @@
                * @param string  $url       a url relative to the phpgroupware 
install root
                * @param array   $extravars query string arguements
                * @param boolean $redirect  is this for a redirect link ?
+               * @param boolean $external is the resultant link being used as 
external access (i.e url in emails..)
                *
                * @return string generated url
                */
-               public function link($url, $extravars = array(), 
$redirect=false)
+               public function link($url, $extravars = array(), 
$redirect=false, $external = false)
                {
                        //W3C Compliant in markup       
                        $term = '&amp;'; 
@@ -582,6 +583,14 @@
                                }
                        }
 
+                       if($external)
+                       {
+                               if(substr($url, 0, 4) != 'http')
+                               {
+                                       $url = 
"http://{$GLOBALS['phpgw_info']['server']['hostname']}{$url}";
+                               }
+                       }
+
                        if ( 
isset($GLOBALS['phpgw_info']['server']['enforce_ssl'])
                                && 
$GLOBALS['phpgw_info']['server']['enforce_ssl'])
                        {
@@ -625,29 +634,32 @@
                                }
                        }
 
-                       /* add session params if not using cookies */
-                       if ( 
!isset($GLOBALS['phpgw_info']['server']['usecookies'])
-                               || 
!$GLOBALS['phpgw_info']['server']['usecookies'])
+                       if(!$external)
                        {
-                               if ( is_array($extravars) )
+                               /* add session params if not using cookies */
+                               if ( 
!isset($GLOBALS['phpgw_info']['server']['usecookies'])
+                                       || 
!$GLOBALS['phpgw_info']['server']['usecookies'])
                                {
-                                       $extravars = array_merge($extravars, 
$this->_get_session_vars());
+                                       if ( is_array($extravars) )
+                                       {
+                                               $extravars = 
array_merge($extravars, $this->_get_session_vars());
+                                       }
+                                       else
+                                       {
+                                               $extravars = 
$this->_get_session_vars();
+                                       }
                                }
-                               else
+
+                               //used for repost prevention
+                               $extravars['click_history'] = 
$this->generate_click_history();
+
+                               /* enable easy use of xdebug */
+                               if ( isset($_REQUEST['XDEBUG_PROFILE']) )
                                {
-                                       $extravars = $this->_get_session_vars();
+                                       $extravars['XDEBUG_PROFILE'] = 1;
                                }
                        }
 
-                       //used for repost prevention
-                       $extravars['click_history'] = 
$this->generate_click_history();
-
-                       /* enable easy use of xdebug */
-                       if ( isset($_REQUEST['XDEBUG_PROFILE']) )
-                       {
-                               $extravars['XDEBUG_PROFILE'] = 1;
-                       }
-
                        if ( is_array($extravars) ) //we have something to 
append
                        {
                                $url .= '?' . http_build_query($extravars, 
null, $term);

Modified: branches/Version-1_0-branch/phpgwapi/inc/class.xslttemplates.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.xslttemplates.inc.php        
2011-12-19 10:43:14 UTC (rev 8368)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.xslttemplates.inc.php        
2011-12-19 11:59:11 UTC (rev 8369)
@@ -397,7 +397,7 @@
                        {
                                $message ='Systemfeil - kontakt adminstrator';
 
-                               
if(isset($GLOBALS['phpgw_info']['user']['apps']['admin']) && 
$GLOBALS['phpgw_info']['user']['apps']['admin'])
+                               
if(!isset($GLOBALS['phpgw_info']['user']['apps']['admin']) || 
!$GLOBALS['phpgw_info']['user']['apps']['admin'])
                                {
                                        phpgwapi_cache::message_set($message, 
'error');
                                }
@@ -408,15 +408,14 @@
                                        echo '<div class="error">';
                                        echo $message;
                                        echo '</div>';
+                                       _debug_array(libxml_get_last_error());
+                                       echo "<h2>xml-data</h2>";
+                                       $this->list_lineno($this->xmldata, 
true);
+
+                                       echo "<h2>xsl-data</h2>";
+                                       $this->list_lineno($this->xsldata);
                                }
-/*
-                               _debug_array(libxml_get_last_error());
-                               echo "<h2>xml-data</h2>";
-                               $this->list_lineno($this->xmldata, true);
 
-                               echo "<h2>xsl-data</h2>";
-                               $this->list_lineno($this->xsldata);
-*/
                                return '';
                        }
                        return preg_replace('/<!DOCTYPE([^>])+>/', '', $html);

Modified: branches/Version-1_0-branch/property/inc/class.boalarm.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.boalarm.inc.php      
2011-12-19 10:43:14 UTC (rev 8368)
+++ branches/Version-1_0-branch/property/inc/class.boalarm.inc.php      
2011-12-19 11:59:11 UTC (rev 8369)
@@ -400,7 +400,7 @@
 
                        $body = lang('Alarm').' #'.$alarm['event_id']."\n";
                        $body .= lang('Name').': '.$alarm['event_name']."\n";
-                       $body .= '<a href ="http://' . 
$GLOBALS['phpgw_info']['server']['hostname'] . 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
"property.ui{$info[0]}.edit", 'id'=> $info[1])).'">' . $alarm['event_name'] 
."</a>\n";
+                       $body .= '<a href ="' . 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
"property.ui{$info[0]}.edit", 'id'=> $info[1]),false,true).'">' . 
$alarm['event_name'] ."</a>\n";
                        if(!is_array($alarm['time']))
                        {
                                $dateformat     = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];

Modified: branches/Version-1_0-branch/property/inc/class.botts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.botts.inc.php        
2011-12-19 10:43:14 UTC (rev 8368)
+++ branches/Version-1_0-branch/property/inc/class.botts.inc.php        
2011-12-19 11:59:11 UTC (rev 8369)
@@ -814,7 +814,7 @@
                        //-----------from--------
                        // build body
                        $body  = '';
-                       $body .= '<a href ="http://' . 
$GLOBALS['phpgw_info']['server']['hostname'] . 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uitts.view', 'id' => $id)).'">' . lang('Ticket').' #' .$id 
.'</a>'."\n";
+                       $body .= '<a href ="' . 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uitts.view', 'id' => $id),false,true).'">' . lang('Ticket').' #' .$id 
.'</a>'."\n";
                        $body .= lang('Date Opened').': '.$entry_date."\n";
                        $body .= lang('Category').': '. 
$this->get_category_name($ticket['cat_id']) ."\n";
 //                     $body .= lang('Subject').': '. $ticket['subject'] ."\n";

Modified: branches/Version-1_0-branch/property/inc/class.menu.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.menu.inc.php 2011-12-19 
10:43:14 UTC (rev 8368)
+++ branches/Version-1_0-branch/property/inc/class.menu.inc.php 2011-12-19 
11:59:11 UTC (rev 8369)
@@ -357,6 +357,11 @@
                                                        'text'  => lang('Ticket 
status'),
                                                        'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uigeneric.index', 'type' => 'ticket_status') )
                                                ),
+                                               'ticket_config' => array
+                                               (
+                                                       'text'  => lang('ticket 
config'),
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uiconfig2.index', 'location_id' => 
$GLOBALS['phpgw']->locations->get_id('property', '.ticket')) )
+                                               ),
                                                'tenant'        => array
                                                (
                                                        'text'  => 
lang('Tenant'),

Modified: branches/Version-1_0-branch/property/inc/class.sotts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sotts.inc.php        
2011-12-19 10:43:14 UTC (rev 8368)
+++ branches/Version-1_0-branch/property/inc/class.sotts.inc.php        
2011-12-19 11:59:11 UTC (rev 8369)
@@ -635,7 +635,7 @@
                        }
                }
 
-               function add($ticket)
+               function add(&$ticket)
                {
                        if(isset($ticket['location']) && 
is_array($ticket['location']))
                        {
@@ -754,6 +754,7 @@
 
                        $receipt['message'][]=array('msg'=>lang('Ticket %1 has 
been saved',$id));
                        $receipt['id']  = $id;
+                       $ticket['id'] = $id; //returned by reference
                        return $receipt;
                }
 
@@ -870,10 +871,11 @@
                        return $receipt;
                }
 
-               function update_ticket($ticket,$id = 0, $receipt = array())
+               function update_ticket(&$ticket,$id = 0, $receipt = array())
                {
                        $this->fields_updated = array();
                        $id = (int) $id;
+                       $ticket['id'] = $id;
                        // DB Content is fresher than http posted value.
                        $this->db->query("select * from fm_tts_tickets where 
id='$id'",__LINE__,__FILE__);
                        $this->db->next_record();

Modified: branches/Version-1_0-branch/property/inc/class.uiproject.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiproject.inc.php    
2011-12-19 10:43:14 UTC (rev 8368)
+++ branches/Version-1_0-branch/property/inc/class.uiproject.inc.php    
2011-12-19 11:59:11 UTC (rev 8369)
@@ -1190,7 +1190,7 @@
                                                
$from_email=$GLOBALS['phpgw_info']['user']['preferences']['property']['email'];
 
                                                $subject = lang(Approval).": ". 
$id;
-                                               $message = '<a href ="http://' 
. $GLOBALS['phpgw_info']['server']['hostname'] . 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.edit','id'=> $id)).'">' . lang('project %1 needs 
approval',$id) .'</a>';
+                                               $message = '<a href ="' . 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.edit','id'=> $id),false,true).'">' . lang('project %1 needs 
approval',$id) .'</a>';
 
                                                $bcc = '';//$from_email;
 
@@ -1282,7 +1282,8 @@
                                                        
$from_name=$GLOBALS['phpgw_info']['user']['fullname'];
                                                        
$from_email=$GLOBALS['phpgw_info']['user']['preferences']['property']['email'];
 
-                                                       $body = '<a href 
="http://' . $GLOBALS['phpgw_info']['server']['hostname'] . 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.edit', 'id'=> $id)).'">' . lang('project %1 has been 
edited',$id) .'</a>' . "\n";
+                                                       $body = '<a href ="' . 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.edit', 'id'=> $id),false, true).'">' . lang('project %1 has 
been edited',$id) .'</a>' . "\n";
+
                                                        
foreach($receipt['notice_owner'] as $notice)
                                                        {
                                                                $body .= 
$notice . "\n";

Modified: branches/Version-1_0-branch/property/inc/class.uitts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uitts.inc.php        
2011-12-19 10:43:14 UTC (rev 8368)
+++ branches/Version-1_0-branch/property/inc/class.uitts.inc.php        
2011-12-19 11:59:11 UTC (rev 8369)
@@ -2867,7 +2867,7 @@
                                
$coordinator_email=$GLOBALS['phpgw_info']['user']['preferences']['property']['email'];
 
                                $subject = lang(Approval).": 
".$ticket['order_id'];
-                               $message = '<a href ="http://' . 
$GLOBALS['phpgw_info']['server']['hostname'] . 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitts.view', 'id'=> $id)).'">' . lang('Workorder %1 needs 
approval',$ticket['order_id']) .'</a>';
+                               $message = '<a href ="' . 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitts.view', 'id'=> $id),false,true).'">' . lang('Workorder %1 needs 
approval',$ticket['order_id']) .'</a>';
 
                                if 
(isset($GLOBALS['phpgw_info']['server']['smtp_server']) && 
$GLOBALS['phpgw_info']['server']['smtp_server'])
                                {

Modified: branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php  
2011-12-19 10:43:14 UTC (rev 8368)
+++ branches/Version-1_0-branch/property/inc/class.uiworkorder.inc.php  
2011-12-19 11:59:11 UTC (rev 8369)
@@ -1037,7 +1037,7 @@
                                                
$coordinator_email=$GLOBALS['phpgw_info']['user']['preferences']['property']['email'];
 
                                                $subject = lang(Approval).": ". 
$id;
-                                               $message = '<a href ="http://' 
. $GLOBALS['phpgw_info']['server']['hostname'] . 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.edit', 'id'=> $values['project_id'])).'">' . 
lang('Workorder %1 needs approval',$id) .'</a>';
+                                               $message = '<a href ="' . 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.edit', 'id'=> $id),false,true).'">' . lang('Workorder %1 
needs approval',$id) .'</a>';
 
                                                if 
(isset($GLOBALS['phpgw_info']['server']['smtp_server']) && 
$GLOBALS['phpgw_info']['server']['smtp_server'])
                                                {
@@ -1131,7 +1131,7 @@
                                                $to = implode(';',$toarray);
                                                
$from_name=$GLOBALS['phpgw_info']['user']['fullname'];
                                                
$from_email=$GLOBALS['phpgw_info']['user']['preferences']['property']['email'];
-                                               $body = '<a href ="http://' . 
$GLOBALS['phpgw_info']['server']['hostname'] . 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.edit','id'=> $id)).'">' . lang('workorder %1 has been 
edited',$id) .'</a>' . "\n";
+                                               $body = '<a href ="' . 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.edit','id'=> $id),false,true).'">' . lang('workorder %1 
has been edited',$id) .'</a>' . "\n";
                                                
foreach($receipt['notice_owner'] as $notice)
                                                {
                                                        $body .= $notice . "\n";

Copied: 
branches/Version-1_0-branch/property/inc/custom/default/catch_ticket_export.php 
(from rev 8368, trunk/property/inc/custom/default/catch_ticket_export.php)
===================================================================
--- 
branches/Version-1_0-branch/property/inc/custom/default/catch_ticket_export.php 
                            (rev 0)
+++ 
branches/Version-1_0-branch/property/inc/custom/default/catch_ticket_export.php 
    2011-12-19 11:59:11 UTC (rev 8369)
@@ -0,0 +1,282 @@
+<?php
+
+               // this routine will only work with the exact configuration of 
Bergen Bolig og Byfornyelse - but can serve as an example
+
+       $export = new catch_ticket_export();
+       $export->export_ticket($ticket);
+       
+       class catch_ticket_export extends property_botts
+       {
+               protected $db;
+               protected $config = array();
+               protected $status_text = array();
+               protected $connection = false;
+               protected $custom_config;       
+
+               function __construct()
+               {
+                       parent::__construct();
+                       $this->db               = & $GLOBALS['phpgw']->db;
+                       $custom_config  = 
CreateObject('admin.soconfig',$GLOBALS['phpgw']->locations->get_id('property', 
'.ticket'));
+                       $this->config = $custom_config->config_data;
+                       $this->status_text = parent::get_status_text();
+                       if($this->acl_location != '.ticket')
+                       {
+                               throw new Exception("'catch_ticket_export'  is 
intended for location = '.ticket'");
+                       }
+
+                       if(!isset($this->config['catch_export']) || 
!$this->config['catch_export'])
+                       {
+                               $this->custom_config = $custom_config;
+                               $this->initiate_config();
+                       }
+               }
+               
+               protected function initiate_config()
+               {
+                       $receipt_section = 
$this->custom_config->add_section(array
+                               (
+                                       'name' => 'catch_export',
+                                       'descr' => 'Catch export'
+                               )
+                       );
+                       $receipt = $this->custom_config->add_attrib(array
+                               (
+                                       'section_id'    => 
$receipt_section['section_id'],
+                                       'input_type'    => 'text',
+                                       'name'                  => 'host',
+                                       'descr'                 => 'Host'
+                               )
+                       );
+                       $receipt = $this->custom_config->add_attrib(array
+                               (
+                                       'section_id'    => 
$receipt_section['section_id'],
+                                       'input_type'    => 'text',
+                                       'name'                  => 'user',
+                                       'descr'                 => 'User'
+                               )
+                       );
+                       $receipt = $this->custom_config->add_attrib(array
+                               (
+                                       'section_id'    => 
$receipt_section['section_id'],
+                                       'input_type'    => 'password',
+                                       'name'                  => 'password',
+                                       'descr'                 => 'Password'
+                               )
+                       );
+                       $receipt = $this->custom_config->add_attrib(array
+                               (
+                                       'section_id'    => 
$receipt_section['section_id'],
+                                       'input_type'    => 'listbox',
+                                       'name'                  => 
'export_method',
+                                       'descr'                 => 'Export 
method'
+                               )
+                       );
+                               $receipt = 
$this->custom_config->edit_attrib(array
+                               (
+                                       'section_id'    => 
$receipt_section['section_id'],
+                                       'attrib_id'             => 
$receipt['attrib_id'],
+                                       'input_type'    => 'listbox',
+                                       'name'                  => 
'export_method',
+                                       'descr'                 => 'Export 
method',
+                                       'new_choice'    => 'ftp'
+                               )
+                       );
+                       $receipt = $this->custom_config->edit_attrib(array
+                               (
+                                       'section_id'    => 
$receipt_section['section_id'],
+                                       'attrib_id'             => 
$receipt['attrib_id'],
+                                       'input_type'    => 'listbox',
+                                       'name'                  => 
'export_method',
+                                       'descr'                 => 'Export 
method',
+                                       'new_choice'    => 'ssh'
+                               )
+                       );
+                       $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'admin.uiconfig2.list_attrib', 'section_id' => 
$receipt_section['section_id'] , 'location_id' => 
$GLOBALS['phpgw']->locations->get_id('property', '.ticket')) );
+               }
+
+               function export_ticket($ticket)
+               {
+
+//                     _debug_array($ticket);
+//_debug_array($receipt);
+
+                       $export_values = array();
+                       $sql = 'SELECT unitid FROM fm_catch_1_1 WHERE user_ = ' 
. (int) $ticket['assignedto'] . ' ORDER BY id ASC';
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       $this->db->next_record();
+
+                       $export_values['unitid'] = $this->db->f('unitid',true);
+                       $solocation = CreateObject('property.solocation');
+                       $location = 
$solocation->read_single($ticket['location_code']);
+
+                       $values = $this->so->read_single($ticket['id']);
+//_debug_array($values);
+
+
+                       $export_values['melding_id'] = $ticket['id'];
+
+                       $export_values['eiendom_navn'] = $location['loc1_name'];
+                       $export_values['eiendomid'] = $location['loc1'];
+                       $export_values['byggid'] = $location['loc2'];
+                       $export_values['byggnavn'] = $location['loc2_name'];
+                       $export_values['etasjeid'] = $location['loc3'];
+                       $export_values['etasjenavn'] = $location['loc3_name'];
+                       $export_values['bruksenhetid'] = $location['loc4'];
+                       $export_values['bruksenhet_navn'] = 
$location['loc4_name'];
+                       $export_values['rom_id_navn'] = $location['rom_nr_id'];
+                       $export_values['rom_navn'] = $location['loc5_name'];
+                       $export_values['romid'] = $location['loc5'];
+                       $export_values['prioritet'] = $ticket['priority'];
+                       $export_values['overskrift_melding'] = 
$ticket['subject'];
+                       $export_values['detaljer_melding'] = 
"{$values['user_name']}:: {$values['details']}";
+                       $export_values['meldingskategori'] = 
$ticket['priority'];
+                       $export_values['cat_id'] = $ticket['cat_id'];
+                       $export_values['kommentarer'] = '';
+                       $export_values['status_melding'] = 
$this->status_text[$ticket['status']];
+                       $export_values['status'] = $ticket['status'];
+                       $export_values['egne_timer'] = 
$ticket['billable_hours'];
+
+                       $additional_notes = 
$this->read_additional_notes($ticket['id']);
+                       foreach ($additional_notes as $additional_note)
+                       {
+                               $export_values['detaljer_melding'] .= 
"\n{$additional_note['value_user']}::{$additional_note['value_note']}";
+                       }
+
+//_debug_array($additional_notes); die();
+               
+                       if (function_exists('com_create_guid') === true)
+                       {
+                               $guid = trim(com_create_guid(), '{}');
+                       }
+                       else
+                       {
+                               $guid = 
sprintf('%04X%04X-%04X-%04X-%04X-%04X%04X%04X', mt_rand(0, 65535), mt_rand(0, 
65535), mt_rand(0, 65535), mt_rand(16384, 20479), mt_rand(32768, 49151), 
mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535));
+                       }
+
+                       phpgw::import_class('phpgwapi.xmlhelper');
+                       $xmldata = phpgwapi_xmlhelper::toXML($export_values, 
'PPCC');
+                       $doc = new DOMDocument;
+                       $doc->preserveWhiteSpace = true;
+                       $doc->loadXML( $xmldata );
+                       $domElement = 
$doc->getElementsByTagName('PPCC')->item(0);
+                       $domAttribute = $doc->createAttribute('UUID');
+                       $domAttribute->value = $guid;
+
+                       // Don't forget to append it to the element
+                       $domElement->appendChild($domAttribute);
+
+                       // Append it to the document itself
+                       $doc->appendChild($domElement);
+                       $doc->formatOutput = true;
+                       
+                       $xml = $doc->saveXML();
+
+//                     echo $xml;
+//                     _debug_array($this->config);
+               
+                       $filename = 
"{$GLOBALS['phpgw_info']['server']['temp_dir']}/{$guid}.xml";
+
+                       $fp = fopen($filename, "wb");
+                       fwrite($fp,$xml);
+                               
+                       if(fclose($fp))
+                       {
+                               $this->transfer($xml, $filename);
+                       }
+//_debug_array($filename);
+                       die();
+               }
+
+               protected function transfer($xml,$filename)
+               {                       
+                       
if($this->config['catch_export']['export_method']=='ftp' || 
$this->config['catch_export']['export_method']=='ssh')
+                       {
+                               if(!$connection = $this->connection)
+                               {
+                                       $connection     = 
$this->phpftp_connect();
+                               }
+                               
+                               $basedir = 
$this->config['catch_export']['basedir'];
+                               if($basedir)
+                               {
+                                       $remote_file = $basedir . '/' . 
basename($filename);
+                               }
+                               else
+                               {
+                                       $remote_file = basename($filename);
+                               }
+
+                               switch 
($this->config['catch_export']['export_method'])
+                               {
+                                       case 'ftp';
+                                               $transfer_ok = 
ftp_put($connection,$remote_file, $filename, FTP_BINARY);
+                                               break;
+                                       case 'ssh';
+                                               $sftp = ssh2_sftp($connection);
+                                               $stream = 
@fopen("ssh2.sftp://$sftp$remote_file";, 'w');
+                                               $data_to_send = 
@file_get_contents($filename);
+                                               fwrite($stream, $data_to_send);
+                                               $transfer_ok = @fclose($stream);
+                                               break;
+                                       default:
+                                               $transfer_ok = false;
+                               }
+                               if ($send_ok)
+                               {
+                                       // log ok
+                               }
+                               else
+                               {
+                                       // log ok fail
+                               }
+                               if(!$transfer_ok)
+                               {
+                                       unlink($filename);
+                               }
+                       }
+                       return  $transfer_ok;
+               }
+
+               protected function phpftp_connect() 
+               {
+                       $server                         = 
$this->config['catch_export']['host'];
+                       $user                           = 
$this->config['catch_export']['user'];
+                       $password                       = 
$this->config['catch_export']['password'];
+                       $port                           = 22;
+                       
+                       switch ($this->config['catch_export']['export_method'])
+                       {
+                               case 'ftp';
+                                       if($connection = ftp_connect($server))
+                                       {
+                                               
ftp_login($connection,$user,$password);
+                                       }
+                                       break;
+                               case 'ssh';
+                                       if (!function_exists("ssh2_connect"))
+                                       {
+                                               die("function ssh2_connect 
doesn't exist");
+                                       }
+                                       if(!($connection = 
ssh2_connect("$server", $port)))
+                                       {
+                                               $message = "fail: unable to 
establish connection";
+                                               _debug_array($message);
+                                               //$receipt['error'][]= 
array('msg' => $message);
+                                       }
+                                       else
+                                       {
+                                               // try to authenticate with 
username root, password secretpassword
+                                               
if(!ssh2_auth_password($connection, $user, $password))
+                                               {
+                                                       $message = "fail: 
unable to authenticate";
+                                                       _debug_array($message);
+                                                       //$receipt['error'][]= 
array('msg' => $message);
+                                               }
+                                       }
+                                       break;
+                       }
+                       $this->connection = $connection;
+                       return $connection;
+               }
+       }




reply via email to

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