fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7810] Merge 7783:7809 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [7810] Merge 7783:7809 from trunk
Date: Tue, 04 Oct 2011 11:20:24 +0000

Revision: 7810
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7810
Author:   sigurdne
Date:     2011-10-04 11:20:02 +0000 (Tue, 04 Oct 2011)
Log Message:
-----------
Merge 7783:7809 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
    branches/Version-1_0-branch/activitycalendar/inc/class.soarena.inc.php
    
branches/Version-1_0-branch/activitycalendar/inc/class.socontactperson.inc.php
    
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php
    branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
    
branches/Version-1_0-branch/activitycalendar/inc/model/class.activity.inc.php
    
branches/Version-1_0-branch/activitycalendar/inc/model/class.organization.inc.php
    branches/Version-1_0-branch/activitycalendar/setup/setup.inc.php
    branches/Version-1_0-branch/activitycalendar/setup/tables_update.inc.php
    branches/Version-1_0-branch/activitycalendar/templates/base/activity.php
    branches/Version-1_0-branch/activitycalendar/templates/base/organization.php
    
branches/Version-1_0-branch/activitycalendarfrontend/inc/class.uiactivity.inc.php
    branches/Version-1_0-branch/activitycalendarfrontend/setup/phpgw_no.lang
    branches/Version-1_0-branch/activitycalendarfrontend/setup/setup.inc.php
    
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity.php
    
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/css/base.css
    branches/Version-1_0-branch/rental/inc/class.uiparty.inc.php
    branches/Version-1_0-branch/rental/inc/plugins/fellesdata/party.edit.php
    branches/Version-1_0-branch/rental/js/rental/common.js
    branches/Version-1_0-branch/rental/setup/phpgw_no.lang
    branches/Version-1_0-branch/rental/templates/base/css/base.css
    branches/Version-1_0-branch/rental/templates/base/party.php

Added Paths:
-----------
    branches/Version-1_0-branch/controller/images/bg_collapse.png
    branches/Version-1_0-branch/controller/images/bg_expand_blue.png
    branches/Version-1_0-branch/controller/images/bg_expand_grey.png

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

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php   
2011-10-04 09:12:59 UTC (rev 7809)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php   
2011-10-04 11:20:02 UTC (rev 7810)
@@ -198,6 +198,8 @@
                        $columns[] = 'activity.contact_person_2_zip';
                        $columns[] = 'activity.special_adaptation';
                        $columns[] = 'activity.secret';
+                       $columns[] = 'activity.frontend';
+                       $columns[] = 'activity.new_org';                        
                        
                        $cols = implode(',',$columns);
                }
@@ -268,7 +270,9 @@
                        'contact_person_2 = '          . 
$this->marshal($activity->get_contact_person_2(), 'int'),
                        'contact_person_2_address = '          . 
$this->marshal($activity->get_contact_person_2_address(), 'string'),
                        'contact_person_2_zip = '          . 
$this->marshal($activity->get_contact_person_2_zip(), 'string'),
-                       'special_adaptation = '                 
.($activity->get_special_adaptation() ? "true" : "false")
+                       'special_adaptation = '                 
.($activity->get_special_adaptation() ? "true" : "false"),
+                       'frontend = '                   
.($activity->get_frontend() ? "true" : "false"),
+                       'new_org = '                    
.($activity->get_new_org() ? "true" : "false")
                );
                
                //var_dump('UPDATE activity_activity SET ' . join(',', $values) 
. " WHERE id=$id");
@@ -374,6 +378,8 @@
                        
$activity->set_secret($this->unmarshal($this->db->f('secret'), 'string'));
                        
$activity->set_contact_person_2_address($this->unmarshal($this->db->f('contact_person_2_address'),
 'string'));
                        
$activity->set_contact_person_2_zip($this->unmarshal($this->db->f('contact_person_2_zip'),
 'string'));
+                       
$activity->set_frontend($this->unmarshal($this->db->f('frontend', 'bool')));
+                       
$activity->set_new_org($this->unmarshal($this->db->f('new_org', 'bool')));
                        
                        if($activity->get_group_id() && 
$activity->get_group_id() > 0)
                        {

Modified: branches/Version-1_0-branch/activitycalendar/inc/class.soarena.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.soarena.inc.php      
2011-10-04 09:12:59 UTC (rev 7809)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.soarena.inc.php      
2011-10-04 11:20:02 UTC (rev 7810)
@@ -187,7 +187,7 @@
        function get_buildings()
        {
                $buildings = array();
-       $q_buildings="SELECT id, name FROM bb_building WHERE active=1 ORDER BY 
id";
+       $q_buildings="SELECT id, name FROM bb_building WHERE active=1 ORDER BY 
name ASC";
        //var_dump($q_buildings);
                $this->db->query($q_buildings, __LINE__, __FILE__);
                while($this->db->next_record()){

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/class.socontactperson.inc.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendar/inc/class.socontactperson.inc.php  
    2011-10-04 09:12:59 UTC (rev 7809)
+++ 
branches/Version-1_0-branch/activitycalendar/inc/class.socontactperson.inc.php  
    2011-10-04 11:20:02 UTC (rev 7810)
@@ -208,6 +208,20 @@
                return $result;
        }
        
+       function get_org_contact_name_local($id)
+       {
+               $result = "Ingen";
+       if(isset($id)){
+               $q1="SELECT name, phone, email FROM activity_contact_person 
WHERE id={$id}";
+                       $this->db->query($q1, __LINE__, __FILE__);
+                       while($this->db->next_record()){
+                               $result = $this->db->f('name') . "<br/>" . 
$this->db->f('phone') . "<br/>" . $this->db->f('email');
+                       }
+       }
+               return $result;
+       }
+       
+       
        function get_mailaddress_for_group_contact($contact_person_id)
        {
                if($contact_person_id){

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php   
    2011-10-04 09:12:59 UTC (rev 7809)
+++ 
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php   
    2011-10-04 11:20:02 UTC (rev 7810)
@@ -42,10 +42,19 @@
                //Add columns to this array to include them in the query
                $columns = array();
 
-               if($sort_field != null) {
+               if($sort_field != null && !$return_count) {
+                       if($sort_field == 'identifier')
+                       {
+                               $sort_field = 'org.id';
+                       }
                        $dir = $ascending ? 'ASC' : 'DESC';
-                       $order = "ORDER BY id $dir";
+                       $order = "ORDER BY $sort_field $dir";
                }
+               else if(!$return_count)
+               {
+                       $dir = $ascending ? 'ASC' : 'DESC';
+                       $order = "ORDER BY org.id $dir";
+               }
                if($search_for)
                {
                        $query = $this->marshal($search_for,'string');
@@ -129,6 +138,7 @@
                                $columns[] = 'org.description';
                                $columns[] = 'org.address';
                                $columns[] = 'org.district';
+                               $columns[] = 'org.change_type';
                                $columns[] = 'org.orgno AS organization_number';
                                
                                $cols = implode(',',$columns);
@@ -192,6 +202,20 @@
                return $result;
        }
        
+       function get_organization_name_local($org_id)
+       {
+               $result = "Ingen";
+       if(isset($org_id)){
+               $q1="SELECT name FROM activity_organization WHERE id={$org_id}";
+                       $this->db->query($q1, __LINE__, __FILE__);
+                       while($this->db->next_record()){
+                               $result = $this->db->f('name');
+                       }
+       }
+               
+               return $result;
+       }
+       
        function get_contacts($organization_id)
        {
                $contacts = array();
@@ -235,6 +259,19 @@
                return $desc;
        }
        
+       function get_description_local($organization_id)
+       {
+       if(isset($organization_id)){
+               $q1="SELECT description FROM activity_organization WHERE 
id={$organization_id}";
+                       $this->db->query($q1, __LINE__, __FILE__);
+                       while($this->db->next_record()){
+                               $desc = $this->db->f('description');
+                       }
+       }
+               return $desc;
+       }
+       
+       
        function get_district_from_name($name)
        {
                $this->db->query("SELECT part_of_town_id FROM fm_part_of_town 
where name like UPPER('%{$name}%') ", __LINE__, __FILE__);
@@ -313,6 +350,7 @@
                        
$organization->set_homepage($this->unmarshal($this->db->f('homepage'), 
'string'));
                        
$organization->set_district($this->unmarshal($this->db->f('district'), 
'string'));
                        
$organization->set_description($this->unmarshal($this->db->f('description'), 
'string'));
+                       
$organization->set_change_type($this->unmarshal($this->db->f('change_type'), 
'string'));
                        
$organization->set_show_in_portal($this->unmarshal($this->db->f('show_in_portal'),
 'int'));
                }
                return $organization;

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php 
2011-10-04 09:12:59 UTC (rev 7809)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php 
2011-10-04 11:20:02 UTC (rev 7810)
@@ -97,6 +97,7 @@
                $activity_id = (int)phpgw::get_var('id');
                $so_activity = activitycalendar_soactivity::get_instance();
                $so_arena = activitycalendar_soarena::get_instance();
+               $so_org = activitycalendar_soorganization::get_instance();
                //var_dump($activity_id);
                
                $categories = $so_activity->get_categories();
@@ -123,11 +124,18 @@
                }
                else if(isset($o_id) && $o_id > 0)
                {
-                       $persons = 
activitycalendar_soorganization::get_instance()->get_contacts($o_id);
-                       $desc = 
activitycalendar_soorganization::get_instance()->get_description($o_id);
+                       $persons = $so_org->get_contacts($o_id);
+                       $desc = $so_org->get_description($o_id);
                }
                $arenas = $so_arena->get(null, null, null, null, null, null, 
null);
-               $organizations = 
activitycalendar_soorganization::get_instance()->get(null, null, null, null, 
null, null, null);
+               if($activity->get_new_org())
+               {
+                       $org_name = 
$so_org->get_organization_name_local($activity->get_organization_id());
+               }
+               else
+               {
+                       $organizations = $so_org->get(null, null, null, null, 
null, null, null);
+               }
                $groups = activitycalendar_sogroup::get_instance()->get(null, 
null, null, null, null, null, null);
 
                if(isset($_POST['save_activity'])) // The user has pressed the 
save button
@@ -197,6 +205,7 @@
                        (
                                'activity'      => $activity,
                                'organizations' => $organizations,
+                               'org_name' => $org_name,
                                'groups' => $groups,
                                'arenas' => $arenas,
                                'buildings' => $buildings,

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/model/class.activity.inc.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendar/inc/model/class.activity.inc.php   
    2011-10-04 09:12:59 UTC (rev 7809)
+++ 
branches/Version-1_0-branch/activitycalendar/inc/model/class.activity.inc.php   
    2011-10-04 11:20:02 UTC (rev 7810)
@@ -30,6 +30,8 @@
                protected $special_adaptation;
                protected $secret;
                protected $internal_arena;
+               protected $frontend;
+               protected $new_org;
                
                /**
                 * Constructor.  Takes an optional ID.  If a contract is 
created from outside
@@ -213,6 +215,20 @@
                
                public function get_internal_arena() { return 
$this->internal_arena; }
                
+               public function set_frontend(bool $frontend)
+               {
+                       $this->frontend = (bool)$frontend;
+               }
+               
+               public function get_frontend() { return $this->frontend; }
+               
+               public function set_new_org(bool $new_org)
+               {
+                       $this->new_org = (bool)$new_org;
+               }
+               
+               public function get_new_org() { return $this->new_org; }
+               
                /**
                 * Get a static reference to the storage object associated with 
this model object
                 * 
@@ -232,9 +248,20 @@
                        $date_format = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
                        if(isset($this->organization_id) && 
$this->get_organization_id() > 0)
                        {
-                               $contact_1 = 
activitycalendar_socontactperson::get_instance()->get_org_contact_name($this->get_contact_person_1());
-                               $contact_2 = 
activitycalendar_socontactperson::get_instance()->get_org_contact_name($this->get_contact_person_2());
-                               $desc = 
activitycalendar_soorganization::get_instance()->get_description($this->get_organization_id());
+                               if($this->get_new_org())
+                               {
+                                       $org_name = 
activitycalendar_soorganization::get_instance()->get_organization_name_local($this->get_organization_id());
+                                       $contact_1 = 
activitycalendar_socontactperson::get_instance()->get_org_contact_name_local($this->get_contact_person_1());
+                                       $contact_2 = 
activitycalendar_socontactperson::get_instance()->get_org_contact_name_local($this->get_contact_person_2());
+                                       $desc = 
activitycalendar_soorganization::get_instance()->get_description_local($this->get_organization_id());
+                               }
+                               else
+                               {
+                                       $org_name = 
activitycalendar_soorganization::get_instance()->get_organization_name($this->get_organization_id());
+                                       $contact_1 = 
activitycalendar_socontactperson::get_instance()->get_org_contact_name($this->get_contact_person_1());
+                                       $contact_2 = 
activitycalendar_socontactperson::get_instance()->get_org_contact_name($this->get_contact_person_2());
+                                       $desc = 
activitycalendar_soorganization::get_instance()->get_description($this->get_organization_id());
+                               }
                        }
                        else if(isset($this->group_id) && $this->get_group_id() 
> 0)
                        {
@@ -256,10 +283,11 @@
                        {
                                $arena_name = 
activitycalendar_soarena::get_instance()->get_arena_name($this->get_arena());
                        }
+                       
                        return array(
                                'id' => $this->get_id(),
                                'title' => $this->get_title(),
-                               'organization_id' => 
activitycalendar_soorganization::get_instance()->get_organization_name($this->get_organization_id()),
+                               'organization_id' => $org_name,
                                'group_id' => 
activitycalendar_sogroup::get_instance()->get_group_name($this->get_group_id()),
                                'district' => 
activitycalendar_soactivity::get_instance()->get_district_name($this->get_district()),
                                'office' => 
activitycalendar_soactivity::get_instance()->get_office_name($this->get_office()),
@@ -271,7 +299,8 @@
                                'contact_person_1' => $contact_1,
                                'contact_person_2' => $contact_2,
                                'special_adaptation' => 
$this->get_special_adaptation(),
-                               'last_change_date' => 
$this->get_last_change_date()!=NULL?date($date_format, 
$this->get_last_change_date()):''
+                               'last_change_date' => 
$this->get_last_change_date()!=NULL?date($date_format, 
$this->get_last_change_date()):'',
+                               'frontend' => $this->get_frontend()
                        );
                }
        }

Modified: 
branches/Version-1_0-branch/activitycalendar/inc/model/class.organization.inc.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendar/inc/model/class.organization.inc.php
   2011-10-04 09:12:59 UTC (rev 7809)
+++ 
branches/Version-1_0-branch/activitycalendar/inc/model/class.organization.inc.php
   2011-10-04 11:20:02 UTC (rev 7810)
@@ -119,7 +119,7 @@
                                'phone' =>      $this->get_phone(),
                                'address'       =>      $this->get_address(),
                                'show_in_portal' => $this->get_show_in_portal(),
-                               'change_type' => $this->get_change_type(),
+                               'change_type' => lang($this->get_change_type()),
                                'office' => 
$so_org->get_office_from_district($so_org->get_district_from_name($this->get_district()))
                        );
                }

Modified: branches/Version-1_0-branch/activitycalendar/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/setup/setup.inc.php    
2011-10-04 09:12:59 UTC (rev 7809)
+++ branches/Version-1_0-branch/activitycalendar/setup/setup.inc.php    
2011-10-04 11:20:02 UTC (rev 7810)
@@ -1,6 +1,6 @@
 <?php
        $setup_info['activitycalendar']['name'] = 'activitycalendar';
-       $setup_info['activitycalendar']['version'] = '0.1.5';
+       $setup_info['activitycalendar']['version'] = '0.1.7';
        $setup_info['activitycalendar']['app_order'] = 60;
        $setup_info['activitycalendar']['enable'] = 1;
        $setup_info['activitycalendar']['app_group']    = 'office';

Modified: 
branches/Version-1_0-branch/activitycalendar/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/setup/tables_update.inc.php    
2011-10-04 09:12:59 UTC (rev 7809)
+++ branches/Version-1_0-branch/activitycalendar/setup/tables_update.inc.php    
2011-10-04 11:20:02 UTC (rev 7810)
@@ -131,4 +131,29 @@
                $GLOBALS['setup_info']['activitycalendar']['currentver'] = 
'0.1.5';
                return $GLOBALS['setup_info']['activitycalendar']['currentver'];
        }
+       
+       $test[] = '0.1.5';
+       function activitycalendar_upgrade0_1_5()
+       {
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('activity_activity','frontend',array(
+                       'type' => 'bool',
+                       'default' => 'false'
+               ));
+               
+               $GLOBALS['setup_info']['activitycalendar']['currentver'] = 
'0.1.6';
+               return $GLOBALS['setup_info']['activitycalendar']['currentver'];
+       }
+       
+       $test[] = '0.1.6';
+       function activitycalendar_upgrade0_1_6()
+       {
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('activity_activity','new_org',array(
+                       'type' => 'bool',
+                       'default' => 'false',
+               ));
+               
+               $GLOBALS['setup_info']['activitycalendar']['currentver'] = 
'0.1.7';
+               return $GLOBALS['setup_info']['activitycalendar']['currentver'];
+       }
+       
 ?>

Modified: 
branches/Version-1_0-branch/activitycalendar/templates/base/activity.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/templates/base/activity.php    
2011-10-04 09:12:59 UTC (rev 7809)
+++ branches/Version-1_0-branch/activitycalendar/templates/base/activity.php    
2011-10-04 11:20:02 UTC (rev 7810)
@@ -75,17 +75,24 @@
                                        $current_organization_id = 
$activity->get_organization_id();
                                        if ($editable)
                                        {
+                                               if($activity->get_new_org())
+                                               {
+                                                       echo $org_name;
+                                               }
+                                               else
+                                               {
                                                ?>
                                                <select name="organization_id" 
id="organization_id" onchange="javascript:get_available_groups();">
                                                        <option value="">Ingen 
organisasjon valgt</option>
                                                        <?php
-                                                       foreach($organizations 
as $organization)
-                                                       {
-                                                               echo "<option 
".($current_organization_id == $organization->get_id() ? 'selected="selected"' 
: "")." 
value=\"{$organization->get_id()}\">".$organization->get_name()."</option>";
-                                                       }
-                                                       ?>
+                                                               
foreach($organizations as $organization)
+                                                               {
+                                                                       echo 
"<option ".($current_organization_id == $organization->get_id() ? 
'selected="selected"' : "")." 
value=\"{$organization->get_id()}\">".$organization->get_name()."</option>";
+                                                               }
+                                                               ?>
                                                </select>
                                                <?php
+                                               }
                                        ?>
                                        <?php
                                        }

Modified: 
branches/Version-1_0-branch/activitycalendar/templates/base/organization.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendar/templates/base/organization.php    
    2011-10-04 09:12:59 UTC (rev 7809)
+++ 
branches/Version-1_0-branch/activitycalendar/templates/base/organization.php    
    2011-10-04 11:20:02 UTC (rev 7810)
@@ -33,8 +33,12 @@
                                                        <option value="<?php 
echo $d['part_of_town_id']?>" <?php echo ($curr_district == 
$d['part_of_town_id'])? 'selected' : '' ?>><?php echo $d['name']?></option>
                                                <?php }?>
                                        </select>
-                               <?php }else{?>
-                                       <?php echo 
activitycalendar_soactivity::get_instance()->get_district_from_id($organization->get_district());?>
+                               <?php }else{
+                                               
if($organization->get_change_type() == 'new'){?>
+                                                       <?php echo 
activitycalendar_soactivity::get_instance()->get_district_from_id($organization->get_district());?>
+                                       <?php }else{?>
+                                                       <?php echo 
$organization->get_district();?>
+                                       <?php }?>
                                <?php }?>
                                </dd>
                                <dt><label 
for="homepage">Hjemmeside</label></dt>

Modified: 
branches/Version-1_0-branch/activitycalendarfrontend/inc/class.uiactivity.inc.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendarfrontend/inc/class.uiactivity.inc.php
   2011-10-04 09:12:59 UTC (rev 7809)
+++ 
branches/Version-1_0-branch/activitycalendarfrontend/inc/class.uiactivity.inc.php
   2011-10-04 11:20:02 UTC (rev 7810)
@@ -82,8 +82,8 @@
                        $offices = $so_activity->select_district_list();
                        $districts = $so_activity->get_districts();
                        $buildings = $so_arena->get_buildings();
-                       $arenas = $so_arena->get(null, null, null, null, null, 
null, null);
-                       $organizations = 
activitycalendar_soorganization::get_instance()->get(null, null, null, null, 
null, null, null);
+                       $arenas = $so_arena->get(null, null, 
'arena.arena_name', true, null, null, null);
+                       $organizations = 
activitycalendar_soorganization::get_instance()->get(null, null, 'org.name', 
true, null, null, null);
                        $groups = 
activitycalendar_sogroup::get_instance()->get(null, null, null, null, null, 
null, null);
                        
                        // Retrieve the activity object or create a new one
@@ -123,6 +123,7 @@
                        {
                                if($o_id == "new_org")
                                {
+                                       $activity->set_new_org(true);
                                        //add new organization to internal 
activitycalendar organization register
                                        $org_info['name'] = 
phpgw::get_var('orgname');
                                        $org_info['orgnr'] = 
phpgw::get_var('orgno');
@@ -157,6 +158,60 @@
                                        $desc = 
phpgw::get_var('org_description');
 
                                }
+                               else if($o_id == "change_org")
+                               {
+                                       $change_org_id = 
phpgw::get_var('change_organization_id');
+                                       $organization = 
activitycalendar_soorganization::get_instance()->get_single($change_org_id);
+                               
+                                       $org_info['name'] = 
$organization->get_name();
+                                       $org_info['orgnr'] = 
$organization->get_organization_number();
+                                       $org_info['homepage'] = 
$organization->get_homepage();
+                                       $org_info['phone'] = 
$organization->get_phone();
+                                       $org_info['email'] = 
$organization->get_email();
+                                       $org_info['description'] = 
$organization->get_description();
+                                       $org_info['street'] = 
$organization->get_address();
+                                       $org_info['district'] = 
$organization->get_district(); 
+                                       $org_info['status'] = "change";
+                                       $o_id = 
$so_activity->add_organization_local($org_info);
+                                       
+                                       //add contact persons
+                                       $contact1 = array();
+                                       $contact1['name'] = 
phpgw::get_var('contact1_name');
+                                       $contact1['phone'] = 
phpgw::get_var('contact1_phone');
+                                       $contact1['mail'] = 
phpgw::get_var('contact1_email');
+                                       $contact1['org_id'] = $o_id;
+                                       $contact1['group_id'] = 0;
+                                       
$so_activity->add_contact_person_local($contact1);
+                                       
+                                       $contact2 = array();
+                                       $contact2['name'] = 
phpgw::get_var('contact2_name');
+                                       $contact2['phone'] = 
phpgw::get_var('contact2_phone');
+                                       $contact2['mail'] = 
phpgw::get_var('contact2_email');
+                                       $contact2['org_id'] = $o_id;
+                                       $contact2['group_id'] = 0;
+                                       
$so_activity->add_contact_person_local($contact2);
+                                       
+                                       $message = lang('change_request_ok', 
$organization->get_name());
+                                       
+                                       
$GLOBALS['phpgw_info']['flags']['noframework'] = true;
+
+                                       $this->render('activity.php', array
+                                               (
+                                                       'activity'      => 
$activity,
+                                                       'organizations' => 
$organizations,
+                                                       'groups' => $groups,
+                                                       'arenas' => $arenas,
+                                                       'buildings' => 
$buildings,
+                                                       'categories' => 
$categories,
+                                                       'targets' => $targets,
+                                                       'districts' => 
$districts,
+                                                       'offices' => $offices,
+                                                       'editable' => true,
+                                                       'message' => 
isset($message) ? $message : phpgw::get_var('message'),
+                                                       'error' => 
isset($error) ? $error : phpgw::get_var('error')
+                                               )
+                       );
+                               }
                                else if(is_numeric($o_id) && $o_id > 0)
                                {
                                        if(isset($g_id) && $g_id == "new_group")
@@ -210,6 +265,7 @@
                                        $activity->set_organization_id($o_id);
                                        $activity->set_group_id($g_id);
                                        
$activity->set_arena(phpgw::get_var('arena_id'));
+                                       
$activity->set_internal_arena(phpgw::get_var('internal_arena_id'));
                                        $district_array = 
phpgw::get_var('district');
                                        $activity->set_district(implode(",", 
$district_array));
                                        
$activity->set_office(phpgw::get_var('office'));
@@ -230,6 +286,7 @@
                                        
$activity->set_time(phpgw::get_var('time'));
                                        
$activity->set_contact_persons($persons);
                                        
$activity->set_special_adaptation(phpgw::get_var('special_adaptation'));
+                                       $activity->set_frontend(true);
                                        
 //                                     var_dump("storing"); 
                                        

Modified: 
branches/Version-1_0-branch/activitycalendarfrontend/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/activitycalendarfrontend/setup/phpgw_no.lang    
2011-10-04 09:12:59 UTC (rev 7809)
+++ branches/Version-1_0-branch/activitycalendarfrontend/setup/phpgw_no.lang    
2011-10-04 11:20:02 UTC (rev 7810)
@@ -55,9 +55,10 @@
 activity_helptext      activitycalendarfrontend        no      Før ny 
aktivitet kan registreres må du sjekke at organisasjon/gruppe finnes og er 
oppdatert, og at arena finnes og er oppdatert.
 building       activitycalendarfrontend        no      Kommunale bygg
 title_helptext activitycalendarfrontend        no      Skriv inn tittel på 
aktiviteten slik du vil den skal vises i kommuneportalen
-org_helptext   activitycalendarfrontend        no      Velg organisasjon 
aktiviteten skal knyttes til. <br/>Dersom din organisasjon ikke finnes, velg 
"Ny organisasjon" og fyll ut feltene som vises under.
+org_helptext   activitycalendarfrontend        no      Velg organisasjon 
aktiviteten skal knyttes til. <br/>Dersom din organisasjon ikke finnes, velg 
"Ny organisasjon" og fyll ut feltene som vises under. <br/> For å sende inn 
forespørsel om å endre en organisasjon, velg "Endre organisasjon" og velg den 
aktuelle organisasjonen fra listen som vises. <br/>Deretter klikker du på 
"Lagre" for å sende inn endringsønsket. 
 group_helptext activitycalendarfrontend        no      Velg gruppe/lag 
aktiviteten skal knyttes til. <br/>Dersom gruppen/laget ikke finnes, velg "Ny 
gruppe" og fyll ut feltene som vises under.
 int_arena_helptext     activitycalendarfrontend        no      Dersom 
aktiviteten skal finne sted i et kommunalt bygg velges dette fra listen her.
 arena_helptext activitycalendarfrontend        no      Dersom aktiviteten skal 
finne sted på en ikke-kommunal arena, velges dette her.<br/>Dersom aktiviteten 
finner sted på flere arenaer, velg hovedarena her.
 messages_saved_form    activitycalendarfrontend        no      Aktiviteten ble 
lagret
-messages_form_error    activitycalendarfrontend        no      Det oppstod et 
problem under lagring
\ No newline at end of file
+messages_form_error    activitycalendarfrontend        no      Det oppstod et 
problem under lagring
+change_request_ok      activitycalendarfrontend        no      Endringsønske 
for organisasjon er sendt inn for organisasjon %1
\ No newline at end of file

Modified: 
branches/Version-1_0-branch/activitycalendarfrontend/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendarfrontend/setup/setup.inc.php    
2011-10-04 09:12:59 UTC (rev 7809)
+++ branches/Version-1_0-branch/activitycalendarfrontend/setup/setup.inc.php    
2011-10-04 11:20:02 UTC (rev 7810)
@@ -31,7 +31,7 @@
        
        $setup_info['activitycalendarfrontend']['depends'][] = array(
                'appname' => 'activitycalendar',
-               'versions' => Array('0.1.3','0.1.4','0.1.5')
+               'versions' => Array('0.1.3','0.1.4','0.1.5','0.1.6','0.1.7')
        );
 
        /* The hooks this app includes, needed for hooks registration */

Modified: 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity.php
===================================================================
--- 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity.php
    2011-10-04 09:12:59 UTC (rev 7809)
+++ 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity.php
    2011-10-04 11:20:02 UTC (rev 7810)
@@ -24,10 +24,17 @@
                document.getElementById('new_org').style.display = "block";
                document.getElementById('new_org_fields').style.display = 
"block";
        }
+       else if(org_id != null && org_id == 'change_org')
+       {
+               document.getElementById('new_org').style.display = "block";
+               document.getElementById('new_org_fields').style.display = 
"none";
+               document.getElementById('change_org_fields').style.display = 
"block";
+       }
        else
        {
                document.getElementById('new_org').style.display = "none";
                document.getElementById('new_org_fields').style.display = 
"none";
+               document.getElementById('change_org_fields').style.display = 
"none";
                var divcontent_start = "<select name=\"group_id\" 
id=\"group_id\" onchange=\"javascript:checkNewGroup()\">";
                var divcontent_end = "</select>";
                
@@ -109,7 +116,7 @@
 
 </script>
 
-<div class="yui-content">
+<div class="yui-content" style="width: 100%;">
        <div id="details">
        
        <?php if($message){?>
@@ -125,7 +132,7 @@
                <h1><?php echo lang('activity') ?></h1>
                <form action="#" method="post">
                        <input type="hidden" name="id" value="<?php 
if($activity->get_id()){ echo $activity->get_id(); } else { echo '0'; }  ?>"/>
-                       <dl class="proplist-col">
+                       <dl class="proplist-col" style="width: 100%;">
                                <dt>
                                        <?php if($activity->get_title() || 
$editable) { ?>
                                        <label for="title"><?php echo 
lang('title') ?></label>
@@ -161,6 +168,7 @@
                                                <select name="organization_id" 
id="organization_id" onchange="javascript:get_available_groups();">
                                                        <option value="">Ingen 
organisasjon valgt</option>
                                                        <option 
value="new_org">Ny organisasjon</option>
+                                                       <option 
value="change_org">Endre organisasjon</option>
                                                        <?php
                                                        foreach($organizations 
as $organization)
                                                        {
@@ -182,6 +190,17 @@
                                </dd>
                                <div id="new_org" style="display: none;">
                                        <hr/>
+                                       <div id="change_org_fields" 
style="display: none;">
+                                               <select 
name="change_organization_id" id="change_organization_id" >
+                                                       <option value="">Ingen 
organisasjon valgt</option>
+                                                       <?php
+                                                       foreach($organizations 
as $organization)
+                                                       {
+                                                               echo "<option 
".($current_organization_id == $organization->get_id() ? 'selected="selected"' 
: "")." 
value=\"{$organization->get_id()}\">".$organization->get_name()."</option>";
+                                                       }
+                                                       ?>
+                                               </select>
+                                       </div>
                                        <div id="new_org_fields" 
style="display: none;">
                                                <label 
for="orgname">Organisasjonsnavn</label>
                                                <input type="text" 
name="orgname"/><br/>

Modified: 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/css/base.css
===================================================================
--- 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/css/base.css
    2011-10-04 09:12:59 UTC (rev 7809)
+++ 
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/css/base.css
    2011-10-04 11:20:02 UTC (rev 7810)
@@ -19,8 +19,11 @@
     float: left;
     text-align: left;
 }
-       
 
+#frontend dl.proplist-col {
+    width: 600px; !important
+}
+
 table#header {
        margin: 2em;
        

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

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

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

Modified: branches/Version-1_0-branch/rental/inc/class.uiparty.inc.php
===================================================================
--- branches/Version-1_0-branch/rental/inc/class.uiparty.inc.php        
2011-10-04 09:12:59 UTC (rev 7809)
+++ branches/Version-1_0-branch/rental/inc/class.uiparty.inc.php        
2011-10-04 11:20:02 UTC (rev 7810)
@@ -591,6 +591,10 @@
                }
        }
        
+       /**
+        * Public method. Called when a user wants to sync data with 
Fellesdata. 
+        * Returns a json string with the following fields: email, org_name, 
unit_leader_fullname and department
+        */
        public function get_synchronize_party_info()
        {
                if(($this->isExecutiveOfficer() || $this->isAdministrator()))

Modified: 
branches/Version-1_0-branch/rental/inc/plugins/fellesdata/party.edit.php
===================================================================
--- branches/Version-1_0-branch/rental/inc/plugins/fellesdata/party.edit.php    
2011-10-04 09:12:59 UTC (rev 7809)
+++ branches/Version-1_0-branch/rental/inc/plugins/fellesdata/party.edit.php    
2011-10-04 11:20:02 UTC (rev 7810)
@@ -1,16 +1,17 @@
 <dt>
-       Organisasjonstilknytning
+       Organisasjonstilknytning 
 </dt>
 <dd>
        <?php
                if ($editable)
                {
        ?>
-                       <select name="org_enhet_id">
+                       <select name="org_enhet_id" id="org_enhet_id">
                                <option value=""><?php echo 
lang('no_party_location') ?></option>
                <?php
                        
                        $result_units = 
rental_bofellesdata::get_instance()->get_result_units();
+                       
                        $party_org_enhet_id = $party->get_org_enhet_id();
                        foreach ($result_units as $result_unit)
                        {

Modified: branches/Version-1_0-branch/rental/js/rental/common.js
===================================================================
--- branches/Version-1_0-branch/rental/js/rental/common.js      2011-10-04 
09:12:59 UTC (rev 7809)
+++ branches/Version-1_0-branch/rental/js/rental/common.js      2011-10-04 
11:20:02 UTC (rev 7810)
@@ -258,27 +258,35 @@
     }
 }
 
+// Syncronizes data with Fellesdata
 YAHOO.util.Event.addListener(
                'fetchSyncData',
                'click',
-               function(){             
+               function(){
                        
                        var org_enhet_id = 
document.getElementById('org_enhet_id').value;
                        
-                        YAHOO.util.Connect.asyncRequest (
+                       // User must select an org unit from option list
+                       if( org_enhet_id > 0){
+                               
document.getElementById('unit_errorMsg').style.display = 'none';
+                               
+                               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,
+                               
"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>" );
-                                       }
+                                               YAHOO.log( "TID: " + o.tId + ", 
HTTP Status: " + o.status + ", Message: " + o.StatusText );
+                                       }
                                }
                                );
+                       }else{
+                               
document.getElementById('unit_errorMsg').style.display = 'block'; 
+                       }
                }
 );
 
+// Displays sync data in text fields
 function syncInfo(o)
 {
        var syncInfo = YAHOO.lang.JSON.parse(o.responseText);

Modified: branches/Version-1_0-branch/rental/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/rental/setup/phpgw_no.lang      2011-10-04 
09:12:59 UTC (rev 7809)
+++ branches/Version-1_0-branch/rental/setup/phpgw_no.lang      2011-10-04 
11:20:02 UTC (rev 7810)
@@ -251,6 +251,7 @@
 gab_id rental  no      GAB
 Generate export        rental  no      Generér eksport
 Generate cs15  rental  no      Generér kundefil
+get_sync_data  rental  no      Hent data fra Fellesdata
 half-year      rental  no      Halvårig
 hidden rental  no      Skjult
 hidden_for_pick        rental  no      skjult
@@ -563,6 +564,7 @@
 unit_id        rental  no      Enhetsid
 unit_name      rental  no      Enhetsnavn
 unit_leader_name       rental  no      Navn enhetsleder
+unit_leader    rental  no      Enhetsleder
 unit_no_of_delegates   rental  no      Antall delegater
 update rental  no      Oppdatér
 upload rental  no      Last opp

Modified: branches/Version-1_0-branch/rental/templates/base/css/base.css
===================================================================
--- branches/Version-1_0-branch/rental/templates/base/css/base.css      
2011-10-04 09:12:59 UTC (rev 7809)
+++ branches/Version-1_0-branch/rental/templates/base/css/base.css      
2011-10-04 11:20:02 UTC (rev 7810)
@@ -178,6 +178,7 @@
 
 .form-buttons {
     clear: both;
+    margin: 0 0 25px 25px;
     padding-top: 2em;
 }
 .form-buttons button {
@@ -460,3 +461,9 @@
 th.yui-dt-sortable div{
        background: 
url(../../../../phpgwapi/js/yahoo/assets/skins/sam/sprite.png) repeat-x scroll 
0pt -100px rgb(216, 216, 218);
 }
+
+#unit_errorMsg{
+       display:none;
+       color:red;      
+       margin-bottom: 10px;
+}
\ No newline at end of file

Modified: branches/Version-1_0-branch/rental/templates/base/party.php
===================================================================
--- branches/Version-1_0-branch/rental/templates/base/party.php 2011-10-04 
09:12:59 UTC (rev 7809)
+++ branches/Version-1_0-branch/rental/templates/base/party.php 2011-10-04 
11:20:02 UTC (rev 7810)
@@ -437,13 +437,14 @@
                                        </dd>
                                        </dl>
                                <div class="form-buttons">
+                                       <span id="unit_errorMsg">Du må velge 
organisasjonsenhet før du kan synkronisere</span>
                                        <?php
                                                if ($editable) {
                                                        echo '<input 
type="submit" name="save_party" value="' . lang('save') . '"/>';
                                                }
                                                        
                                                if ($use_fellesdata) {
-                                                       echo '<input 
type="button" id="fetchSyncData" name="synchronize" value="' . 
lang('get_synchronization_data') . '"/>';
+                                                       echo '<input 
type="button" id="fetchSyncData" name="synchronize" value="' . 
lang('get_sync_data') . '"/>';
                                                }
                                        ?>
                                </div>




reply via email to

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