fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [9914] fixed export to excel


From: Erik Holm-Larsen
Subject: [Fmsystem-commits] [9914] fixed export to excel
Date: Mon, 27 Aug 2012 11:07:21 +0000

Revision: 9914
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9914
Author:   erikhl
Date:     2012-08-27 11:07:20 +0000 (Mon, 27 Aug 2012)
Log Message:
-----------
fixed export to excel

Modified Paths:
--------------
    trunk/activitycalendar/inc/class.uiactivities.inc.php
    trunk/activitycalendar/inc/model/class.activity.inc.php
    trunk/activitycalendar/setup/phpgw_no.lang

Modified: trunk/activitycalendar/inc/class.uiactivities.inc.php
===================================================================
--- trunk/activitycalendar/inc/class.uiactivities.inc.php       2012-08-27 
10:32:11 UTC (rev 9913)
+++ trunk/activitycalendar/inc/class.uiactivities.inc.php       2012-08-27 
11:07:20 UTC (rev 9914)
@@ -436,12 +436,19 @@
                $rows = array();
                $mail_rows = array();
                foreach($result_objects as $result) {
-                       //var_dump($result);
+//                     var_dump($result);
                        if(isset($result))
                        {
                                // ... add a serialized result
-                               $rows[] = $result->serialize();
-                               $mail_rows[] = $result;
+                            if($export)
+                            {
+                                $rows[] = $result->serialize(true);
+                            }
+                            else
+                            {
+                                $rows[] = $result->serialize();
+                            }
+                            $mail_rows[] = $result;
                        }
                }
                

Modified: trunk/activitycalendar/inc/model/class.activity.inc.php
===================================================================
--- trunk/activitycalendar/inc/model/class.activity.inc.php     2012-08-27 
10:32:11 UTC (rev 9913)
+++ trunk/activitycalendar/inc/model/class.activity.inc.php     2012-08-27 
11:07:20 UTC (rev 9914)
@@ -1,4 +1,4 @@
-<?php
+    <?php
        phpgw::import_class('activitycalendar.soorganization');
        phpgw::import_class('activitycalendar.sogroup');
        phpgw::import_class('activitycalendar.soarena');
@@ -252,7 +252,7 @@
                        return self::$so;
                }
                
-               public function serialize()
+               public function serialize($do_export=false)
                {
                    $so_org = activitycalendar_soorganization::get_instance();
                        $date_format = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
@@ -337,6 +337,13 @@
                                $contact_1 = "";
                                $contact_2 = "";
                        }
+                        
+                        $contact_person_1_name = 
$this->get_contact_person_1()?$this->get_contact_person_1()->get_name():'';
+                        $contact_person_1_phone = 
$this->get_contact_person_1()?$this->get_contact_person_1()->get_phone():'';
+                        $contact_person_1_mail = 
$this->get_contact_person_1()?$this->get_contact_person_1()->get_email():'';
+                        $contact_person_2_name = 
$this->get_contact_person_2()?$this->get_contact_person_2()->get_name():'';
+                        $contact_person_2_phone = 
$this->get_contact_person_2()?$this->get_contact_person_2()->get_phone():'';
+                        $contact_person_2_mail = 
$this->get_contact_person_2()?$this->get_contact_person_2()->get_email():'';
                        
                        if($this->get_internal_arena() && 
$this->get_internal_arena() > 0)
                        {
@@ -348,8 +355,10 @@
                        }
                        
                        $activity_district = 
$this->get_so()->get_district_name($this->get_district());
-                       
-                       return array(
+                        if($do_export)
+                        {
+                            //var_dump($this);
+                            return array(
                                'id' => $this->get_id(),
                                'title' => $this->get_title(),
                                'organization_id' => $org_name,
@@ -361,12 +370,38 @@
                                'description' => $desc,
                                'arena' => $arena_name,
                                'time' => $this->get_time(),
+                               'contact_person_1_name' => 
$contact_person_1_name,
+                                'contact_person_1_phone' => 
$contact_person_1_phone,
+                                'contact_person_1_mail' => 
$contact_person_1_mail,
+                               'contact_person_2_name' => 
$contact_person_2_name,
+                                'contact_person_2_phone' => 
$contact_person_2_phone,
+                                'contact_person_2_mail' => 
$contact_person_2_mail,
+                               'special_adaptation' => 
$this->get_special_adaptation(),
+                               'last_change_date' => 
$this->get_last_change_date()!=NULL?date($date_format, 
$this->get_last_change_date()):'',
+                               'frontend' => $this->get_frontend()
+                            );
+                        }
+                        else
+                        {
+                            return array(
+                               'id' => $this->get_id(),
+                               'title' => $this->get_title(),
+                               'organization_id' => $org_name,
+                               'group_id' => $group_name,
+                               'district' => $activity_district,
+                               'office' => 
activitycalendar_soactivity::get_instance()->get_office_name($this->get_office()),
+                               'category' => 
$this->get_so()->get_category_name($this->get_category()),
+                               'state' => lang('state_'.$this->get_state()),
+                               'description' => $desc,
+                               'arena' => $arena_name,
+                               'time' => $this->get_time(),
                                '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()):'',
                                'frontend' => $this->get_frontend()
-                       );
+                            );
+                        }
                }
        }
 ?>
\ No newline at end of file

Modified: trunk/activitycalendar/setup/phpgw_no.lang
===================================================================
--- trunk/activitycalendar/setup/phpgw_no.lang  2012-08-27 10:32:11 UTC (rev 
9913)
+++ trunk/activitycalendar/setup/phpgw_no.lang  2012-08-27 11:07:20 UTC (rev 
9914)
@@ -434,4 +434,10 @@
 edit_contact_info_org  activitycalendar        no      Gå til 
organisasjonsopplysninger
 edit_contact_info_group        activitycalendar        no      Gå til 
gruppeopplysninger
 arena_helptext activitycalendar        no      I feltet Navn skal det stå navn 
på arena, som det heter på folkemunne.<br/>Når du redigerer feltet 
besøksadresse, gjøres det automatisk oppslag i gatetabellen, dette for å sikre 
at adresser skrives riktig, og kan kobles mot kart.<br/>Når du har funnet rett 
gateadresse , gå til feltet Husnummer og legg inn husnummer.<br/>Trykk lagre.
-org_not_transferred    activitycalendar        no      Organisasjonen som 
aktiviteten er tilknyttet er ikke overført til organisasjonsregisteret.<br/>Før 
aktiviteten kan redigeres, må denne overføres.
\ No newline at end of file
+org_not_transferred    activitycalendar        no      Organisasjonen som 
aktiviteten er tilknyttet er ikke overført til organisasjonsregisteret.<br/>Før 
aktiviteten kan redigeres, må denne overføres.
+contact_person_1_name  activitycalendar        no      Kontaktperson 1
+contact_person_1_phone activitycalendar        no      Kontaktperson 1 tlf
+contact_person_1_mail  activitycalendar        no      Kontaktperson 1 epost
+contact_person_2_name  activitycalendar        no      Kontaktperson 2
+contact_person_2_phone activitycalendar        no      Kontaktperson 2 tlf
+contact_person_2_mail  activitycalendar        no      Kontaktperson 2 epost
\ No newline at end of file




reply via email to

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