fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [9326]


From: Erik Holm-Larsen
Subject: [Fmsystem-commits] [9326]
Date: Wed, 09 May 2012 07:04:28 +0000

Revision: 9326
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9326
Author:   erikhl
Date:     2012-05-09 07:04:12 +0000 (Wed, 09 May 2012)
Log Message:
-----------


Modified Paths:
--------------
    trunk/activitycalendar/inc/class.socontactperson.inc.php
    trunk/activitycalendar/inc/model/class.activity.inc.php
    trunk/activitycalendarfrontend/inc/class.uiactivity.inc.php
    trunk/activitycalendarfrontend/setup/phpgw_no.lang
    trunk/activitycalendarfrontend/templates/base/activity_new.php

Added Paths:
-----------
    trunk/activitycalendarfrontend/templates/base/activity_new_org.php

Modified: trunk/activitycalendar/inc/class.socontactperson.inc.php
===================================================================
--- trunk/activitycalendar/inc/class.socontactperson.inc.php    2012-05-09 
06:54:11 UTC (rev 9325)
+++ trunk/activitycalendar/inc/class.socontactperson.inc.php    2012-05-09 
07:04:12 UTC (rev 9326)
@@ -195,7 +195,7 @@
        function get_group_contact_name($id)
        {
                $result = "Ingen";
-       if(isset($id)){
+       if(isset($id) && $id != ''){
                $q1="SELECT name, phone, email FROM bb_group_contact WHERE 
id={$id}";
                        $this->db->query($q1, __LINE__, __FILE__);
                        while($this->db->next_record()){
@@ -208,7 +208,7 @@
        function get_group_contact_name_local($id)
        {
                $result = "Ingen";
-       if(isset($id)){
+       if(isset($id) && $id != ''){
                $q1="SELECT name, phone, email FROM activity_contact_person 
WHERE id={$id}";
                        $this->db->query($q1, __LINE__, __FILE__);
                        while($this->db->next_record()){
@@ -221,7 +221,7 @@
        function get_org_contact_name($id)
        {
                $result = "Ingen";
-       if(isset($id)){
+       if(isset($id) && $id != ''){
                $q1="SELECT name, phone, email FROM bb_organization_contact 
WHERE id={$id}";
                        $this->db->query($q1, __LINE__, __FILE__);
                        while($this->db->next_record()){
@@ -234,7 +234,7 @@
        function get_org_contact_name_local($id)
        {
                $result = "Ingen";
-       if(isset($id)){
+       if(isset($id) && $id != ''){
                $q1="SELECT name, phone, email FROM activity_contact_person 
WHERE id={$id}";
                        $this->db->query($q1, __LINE__, __FILE__);
                        while($this->db->next_record()){

Modified: trunk/activitycalendar/inc/model/class.activity.inc.php
===================================================================
--- trunk/activitycalendar/inc/model/class.activity.inc.php     2012-05-09 
06:54:11 UTC (rev 9325)
+++ trunk/activitycalendar/inc/model/class.activity.inc.php     2012-05-09 
07:04:12 UTC (rev 9326)
@@ -251,8 +251,9 @@
                                if($this->get_new_org())
                                {
                                        $group_name = 
activitycalendar_sogroup::get_instance()->get_group_name_local($this->get_group_id());
-                                       $contact_1 = 
activitycalendar_socontactperson::get_instance()->get_group_contact_name_local($this->get_contact_person_1());
-                                       $contact_2 = 
activitycalendar_socontactperson::get_instance()->get_group_contact_name_local($this->get_contact_person_2());
+                                       
$this->set_contact_persons(activitycalendar_socontactperson::get_instance()->get_local_contact_persons($this->get_group_id(),
 true));
+                                       $contact_1 = 
activitycalendar_socontactperson::get_instance()->get_group_contact_name_local($this->get_contact_person_1()->get_id());
+                                       $contact_2 = 
activitycalendar_socontactperson::get_instance()->get_group_contact_name_local($this->get_contact_person_2()->get_id());
                                        $desc = 
activitycalendar_sogroup::get_instance()->get_description_local($this->get_group_id());
                                }
                                else
@@ -270,8 +271,9 @@
                                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());
+                                       
$this->set_contact_persons(activitycalendar_socontactperson::get_instance()->get_local_contact_persons($this->get_organization_id()));
+                                       $contact_1 = 
activitycalendar_socontactperson::get_instance()->get_org_contact_name_local($this->get_contact_person_1()->get_id());
+                                       $contact_2 = 
activitycalendar_socontactperson::get_instance()->get_org_contact_name_local($this->get_contact_person_2()->get_id());
                                        $desc = 
activitycalendar_soorganization::get_instance()->get_description_local($this->get_organization_id());
                                }
                                else

Modified: trunk/activitycalendarfrontend/inc/class.uiactivity.inc.php
===================================================================
--- trunk/activitycalendarfrontend/inc/class.uiactivity.inc.php 2012-05-09 
06:54:11 UTC (rev 9325)
+++ trunk/activitycalendarfrontend/inc/class.uiactivity.inc.php 2012-05-09 
07:04:12 UTC (rev 9326)
@@ -67,7 +67,7 @@
                                if($o_id == "new_org")
                                {
                                        $new_org = true;
-                                       $this->render('activity_new.php', array
+                                       $this->render('activity_new_org.php', 
array
                                                (
                                                        'activity'      => 
$activity,
                                                        'new_organization' => 
true,
@@ -121,6 +121,80 @@
                                        );
                                }
                        }
+                       else if(isset($_POST['save_organization']))
+                       {
+                               //add new organization to internal 
activitycalendar organization register
+                               $org_info['name'] = phpgw::get_var('orgname');
+                               $org_info['orgnr'] = phpgw::get_var('orgno');
+                               $org_info['homepage'] = 
phpgw::get_var('homepage');
+                               $org_info['phone'] = phpgw::get_var('phone');
+                               $org_info['email'] = phpgw::get_var('email');
+                               $org_info['description'] = 
phpgw::get_var('org_description');
+                               $org_info['street'] = phpgw::get_var('address') 
. ' ' . phpgw::get_var('number') . ', ' . phpgw::get_var('postaddress');
+                               //$org_info['zip'] = 
phpgw::get_var('postaddress');
+                               $org_info['district'] = 
phpgw::get_var('org_district'); 
+                               $org_info['status'] = "new";
+                               $o_id = 
$this->so_activity->add_organization_local($org_info);
+                               
+                               //add contact persons
+                               $contact1 = array();
+                               $contact1['name'] = 
phpgw::get_var('org_contact1_name');
+                               $contact1['phone'] = 
phpgw::get_var('org_contact1_phone');
+                               $contact1['mail'] = 
phpgw::get_var('org_contact1_mail');
+                               $contact1['org_id'] = $o_id;
+                               $contact1['group_id'] = 0;
+                               
$this->so_activity->add_contact_person_local($contact1);
+                               
+                               $contact2 = array();
+                               $contact2['name'] = 
phpgw::get_var('org_contact2_name');
+                               $contact2['phone'] = 
phpgw::get_var('org_contact2_phone');
+                               $contact2['mail'] = 
phpgw::get_var('org_contact2_mail');
+                               $contact2['org_id'] = $o_id;
+                               $contact2['group_id'] = 0;
+                               
$this->so_activity->add_contact_person_local($contact2);
+                               
+                               //$persons = 
$this->so_organization->get_contacts_local_as_objects($o_id);
+                               //var_dump($persons);
+                               $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 = phpgw::get_var('org_description');
+                               $organization = 
$this->so_organization->get_organization_local($o_id);
+                               $new_org = true;
+
+                               $organization = 
$this->so_organization->get_organization_local($o_id);
+                               $person_arr = 
$this->so_organization->get_contacts_local_as_objects($o_id);
+                               foreach($person_arr as $p)
+                               {
+                                       //var_dump($p);
+                                       $persons[] = $p;
+                               }
+                               
+                               $this->render('activity_new.php', array
+                                       (
+                                               'activity'      => $activity,
+                                               'new_organization' => true,
+                                               'organization' => $organization,
+                                               'contact1' => $persons[0],
+                                               'contact2' => $persons[1],
+                                               '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(isset($_POST['save_activity']))
                        {
                                //$persons = 
$this->so_organization->get_contacts($o_id);                               
@@ -134,41 +208,9 @@
                                        $get_org_from_local = true;
                                }
                                
-                               if($o_id == "new_org")
+                               if($get_org_from_local)
                                {
                                        $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');
-                                       $org_info['homepage'] = 
phpgw::get_var('homepage');
-                                       $org_info['phone'] = 
phpgw::get_var('phone');
-                                       $org_info['email'] = 
phpgw::get_var('email');
-                                       $org_info['description'] = 
phpgw::get_var('org_description');
-                                       $org_info['street'] = 
phpgw::get_var('address') . ' ' . phpgw::get_var('number') . ', ' . 
phpgw::get_var('postaddress');
-                                       //$org_info['zip'] = 
phpgw::get_var('postaddress');
-                                       $org_info['district'] = 
phpgw::get_var('org_district'); 
-                                       $org_info['status'] = "new";
-                                       $o_id = 
$this->so_activity->add_organization_local($org_info);
-                                       
-                                       //add contact persons
-                                       $contact1 = array();
-                                       $contact1['name'] = 
phpgw::get_var('org_contact1_name');
-                                       $contact1['phone'] = 
phpgw::get_var('org_contact1_phone');
-                                       $contact1['mail'] = 
phpgw::get_var('org_contact1_mail');
-                                       $contact1['org_id'] = $o_id;
-                                       $contact1['group_id'] = 0;
-                                       
$this->so_activity->add_contact_person_local($contact1);
-                                       
-                                       $contact2 = array();
-                                       $contact2['name'] = 
phpgw::get_var('org_contact2_name');
-                                       $contact2['phone'] = 
phpgw::get_var('org_contact2_phone');
-                                       $contact2['mail'] = 
phpgw::get_var('org_contact2_mail');
-                                       $contact2['org_id'] = $o_id;
-                                       $contact2['group_id'] = 0;
-                                       
$this->so_activity->add_contact_person_local($contact2);
-                                       
-                                       //$persons = 
$this->so_organization->get_contacts_local_as_objects($o_id);
-                                       //var_dump($persons);
                                        $person_arr = 
$this->so_contact->get_local_contact_persons($o_id);
                                        foreach($person_arr as $p)
                                        {
@@ -176,7 +218,7 @@
                                                $persons[] = $p;
                                        }
                                        $person_ids = 
$this->so_organization->get_contacts_local($o_id);
-                                       $desc = 
phpgw::get_var('org_description');
+                                       $desc = 
$this->so_organization->get_description_local($o_id);
                                        $organization = 
$this->so_organization->get_organization_local($o_id);
                                        $new_org = true;
                                        $new_org_group = true;
@@ -303,6 +345,8 @@
                                $activity->set_time(phpgw::get_var('time'));
                                $activity->set_contact_persons($person_ids);
                                
$activity->set_special_adaptation(phpgw::get_var('special_adaptation'));
+                               
$activity->set_contact_person_2_address(phpgw::get_var('contact2_address') . ", 
" . phpgw::get_var('contact2_number'));
+                               
$activity->set_contact_person_2_zip(phpgw::get_var('contact2_postaddress'));
                                $activity->set_frontend(true);
                                $activity->set_new_org($new_org_group);
                                

Modified: trunk/activitycalendarfrontend/setup/phpgw_no.lang
===================================================================
--- trunk/activitycalendarfrontend/setup/phpgw_no.lang  2012-05-09 06:54:11 UTC 
(rev 9325)
+++ trunk/activitycalendarfrontend/setup/phpgw_no.lang  2012-05-09 07:04:12 UTC 
(rev 9326)
@@ -94,4 +94,6 @@
 address        activitycalendarfrontend        no      Adresse
 activity_edit_helptext_step1   activitycalendarfrontend        no      Skal du 
endre opplysninger knyttet til en aktivitet må du være registrert som 
kontaktperson for organisasjonen.<br/>Du velger organisasjon og aktivitet i 
bildet under, og får en e-post i retur med en lenke til endringsskjema.
 mail_body_update_frontend      activitycalendarfrontend        no      Dette 
er en melding fra Bergen kommune/AktivBy.<br/><br/>I aktivitetsoversikten som 
ligger i kommuneportalen på internett, står du registrert som kontaktperson for 
%1.<br/>Det har kommet inn et endringsønske på denne aktiviteten. Bruk lenken 
under for å endre opplysningene om aktiviteten.<br/>%2<br/><br/><br/> Mvh %3 
kulturkontor
-mail_subject_update    activitycalendarfrontend        no      Melding fra 
AktivBy - Aktivitetsoversikt
\ No newline at end of file
+mail_subject_update    activitycalendarfrontend        no      Melding fra 
AktivBy - Aktivitetsoversikt
+save_organization_next activitycalendarfrontend        no      Lagre 
organisasjon og gå videre til Ny aktivitet
+new_organization       activitycalendarfrontend        no      Ny organisasjon
\ No newline at end of file

Modified: trunk/activitycalendarfrontend/templates/base/activity_new.php
===================================================================
--- trunk/activitycalendarfrontend/templates/base/activity_new.php      
2012-05-09 06:54:11 UTC (rev 9325)
+++ trunk/activitycalendarfrontend/templates/base/activity_new.php      
2012-05-09 07:04:12 UTC (rev 9326)
@@ -594,102 +594,53 @@
                                                ?>
                                        </select>
                                </dd>
+                               <dt>Kontaktinformasjon for kulturkontoret</dt>
+                               <dt><label 
for="contact2_address">Adresse</label>
+                               <dd><input type="text" 
name="contact2_address_txt" id="contact2_address_txt" 
onkeyup="javascript:get_address_search_cp2()"/>
+                               <div id="contact2_address_container"></div></dd>
+                               <dt><label 
for="contact2_number">Husnummer</label></dt>
+                               <dd><input type="text" 
name="contact2_number"/></dd>
+                               <dt><label 
for="contact2_postaddress">Postnummer og Sted</label>
+                               <dd><input type="text" 
name="contact2_postaddress" size="100"/></dd>
                                <hr />
                                <h2><?php echo lang('who')?></h2>
                                <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>
-                                               <dd><input type="text" 
name="orgname" size="100"/></dd>
-                                               <dt><label 
for="orgno">Organisasjonsnummer</label></dt>
-                                               <dd><input type="text" 
name="orgno"/></dd>
-                                               <dt><label 
for="district">Bydel</label></dt>
-                                               <dd><select name="org_district">
-                                                               <option 
value="0">Ingen bydel valgt</option>
-                                               <?php 
-                                               foreach($districts as $d)
-                                               {
-                                               ?>
-                                                       <option value="<?php 
echo $d['part_of_town_id']?>"><?php echo $d['name']?></option>
-                                               <?php
-                                               }?>
-                                               </select></dd>
-                                               <dt><label 
for="homepage">Hjemmeside</label></dt>
-                                               <dd><input type="text" 
name="homepage" size="100"/></dd>
-                                               <dt><label 
for="email">E-post</label></dt>
-                                               <dd><input type="text" 
name="email"/></dd>
-                                               <dt><label 
for="phone">Telefon</label></dt>
-                                               <dd><input type="text" 
name="phone"/></dd>
-                                               <dt><label 
for="street">Gate</label></dt>
-                                               <dd><input type="text" 
name="address_txt" id="address_txt" onkeyup="javascript:get_address_search()"/>
-                                               <div 
id="address_container"></div>
-                                               <label 
for="number">Nummer</label>
-                                               <input type="text" 
name="number"/><br/>
-                                               <label 
for="postaddress">Postnummer og Sted</label>
-                                               <input type="text" 
name="postaddress" size="100"/></dd>
-                                               <dt><label 
for="org_description">Beskrivelse</label></dt>
-                                               <dd><textarea rows="10" 
cols="100" name="org_description"></textarea></dd>
-                                       <hr/>
-                                       <b>Kontaktperson 1</b><br/>
-                                       <dt><label 
for="contact1_name">Navn</label>
-                                       <input type="text" 
name="org_contact1_name" size="100"/><br/>
-                                       <dt><label 
for="contact1_phone">Telefon</label>
-                                       <input type="text" 
name="org_contact1_phone"/><br/>
-                                       <dt><label 
for="contact1_mail">E-post</label>
-                                       <input type="text" 
name="org_contact1_mail"/><br/>
-                                       <b>Kontaktperson 2</b><br/>
-                                       <dt><label 
for="contact2_name">Navn</label>
-                                       <input type="text" 
name="org_contact2_name" size="100"/><br/>
-                                       <dt><label 
for="contact2_phone">Telefon</label>
-                                       <input type="text" 
name="org_contact2_phone"/><br/>
-                                       <dt><label 
for="contact2_mail">E-post</label>
-                                       <input type="text" 
name="org_contact2_mail"/><br/>
-                                       <dt><label 
for="contact2_address">Adresse</label>
-                                       <input type="text" 
name="contact2_address_txt" id="contact2_address_txt" 
onkeyup="javascript:get_address_search_cp2()"/>
-                                       <div 
id="contact2_address_container"></div><br/>
-                                       <label 
for="contact2_number">Nummer</label>
-                                       <input type="text" 
name="org_contact2_number"/><br/>
-                                       <dt><label 
for="contact2_postaddress">Postnummer og Sted</label>
-                                       <input type="text" 
name="org_contact2_postaddress" size="100"/>
-                                       <hr/>
-                                       <?php }else{?>
-                                               <input type="hidden" 
name="organization_id" id="organization_id" value="<?php echo 
$organization->get_id()?>" />
-                                               <dt><label 
for="orgname">Organisasjonsnavn</label></dt>
-                                               <dd><?php echo 
$organization->get_name()?></dd>
-                                               <dt><label 
for="orgno">Organisasjonsnummer</label></dt>
-                                               <dd><?php echo 
$organization->get_organization_number()?></dd>
-                                               <dt><label 
for="homepage">Hjemmeside</label></dt>
-                                               <dd><?php echo 
$organization->get_homepage()?></dd>
-                                               <dt><label 
for="email">E-post</label></dt>
-                                               <dd><?php echo 
$organization->get_email()?></dd>
-                                               <dt><label 
for="phone">Telefon</label></dt>
-                                               <dd><?php echo 
$organization->get_phone()?></dd>
-                                               <dt><label 
for="street">Adresse</label></dt>
-                                               <dd><?php echo 
$organization->get_address()?></dd>
-                                               <dt><label 
for="org_description">Beskrivelse av aktiviteten</label></dt>
-                                               <dd><?php echo 
$organization->get_description()?></dd>
-                                       <hr/>
-                                       <dt>Kontaktperson 1</dt>
-                                       <dt><label 
for="contact1_name">Navn</label></dt>
-                                       <dd><?php echo 
isset($contact1)?$contact1->get_name():''?></dd>
-                                       <dt><label 
for="contact1_phone">Telefon</label></dt>
-                                       <dd><?php echo 
isset($contact1)?$contact1->get_phone():''?></dd>
-                                       <dt><label 
for="contact1_mail">E-post</label></dt>
-                                       <dd><?php echo 
isset($contact1)?$contact1->get_email():''?></dd>
-                                       <dt>Kontaktperson 2</dt>
-                                       <dt><label 
for="contact2_name">Navn</label></dt>
-                                       <dd><?php echo 
isset($contact2)?$contact2->get_name():''?></dd>
-                                       <dt><label 
for="contact2_phone">Telefon</label></dt>
-                                       <dd><?php echo 
isset($contact2)?$contact2->get_phone():''?></dd>
-                                       <dt><label 
for="contact2_mail">E-post</label></dt>
-                                       <dd><?php echo 
isset($contact2)?$contact2->get_email():''?></dd>
-                                       <hr/>
-                                       <?php }?>
+                               <?php if($new_organization){?>
+                                       <input type="hidden" name="new_org" 
id="new_org" value="yes" />
+                               <?php }?>
+                                       <input type="hidden" 
name="organization_id" id="organization_id" value="<?php echo 
$organization->get_id()?>" />
+                                       <dt><label 
for="orgname">Organisasjonsnavn</label></dt>
+                                       <dd><?php echo 
$organization->get_name()?></dd>
+                                       <dt><label 
for="orgno">Organisasjonsnummer</label></dt>
+                                       <dd><?php echo 
$organization->get_organization_number()?></dd>
+                                       <dt><label 
for="homepage">Hjemmeside</label></dt>
+                                       <dd><?php echo 
$organization->get_homepage()?></dd>
+                                       <dt><label 
for="email">E-post</label></dt>
+                                       <dd><?php echo 
$organization->get_email()?></dd>
+                                       <dt><label 
for="phone">Telefon</label></dt>
+                                       <dd><?php echo 
$organization->get_phone()?></dd>
+                                       <dt><label 
for="street">Adresse</label></dt>
+                                       <dd><?php echo 
$organization->get_address()?></dd>
+                                       <dt><label 
for="org_description">Beskrivelse av aktiviteten</label></dt>
+                                       <dd><?php echo 
$organization->get_description()?></dd>
+                               <hr/>
+                               <dt>Kontaktperson 1</dt>
+                               <dt><label for="contact1_name">Navn</label></dt>
+                               <dd><?php echo 
isset($contact1)?$contact1->get_name():''?></dd>
+                               <dt><label 
for="contact1_phone">Telefon</label></dt>
+                               <dd><?php echo 
isset($contact1)?$contact1->get_phone():''?></dd>
+                               <dt><label 
for="contact1_mail">E-post</label></dt>
+                               <dd><?php echo 
isset($contact1)?$contact1->get_email():''?></dd>
+                               <dt>Kontaktperson 2</dt>
+                               <dt><label for="contact2_name">Navn</label></dt>
+                               <dd><?php echo 
isset($contact2)?$contact2->get_name():''?></dd>
+                               <dt><label 
for="contact2_phone">Telefon</label></dt>
+                               <dd><?php echo 
isset($contact2)?$contact2->get_phone():''?></dd>
+                               <dt><label 
for="contact2_mail">E-post</label></dt>
+                               <dd><?php echo 
isset($contact2)?$contact2->get_email():''?></dd>
+                               <hr/>
                                <?php if(!$new_organization){?>
                                <dt>
                                        <label for="group_id" 
id="group_label"><?php echo lang('group') ?></label>
@@ -724,13 +675,6 @@
                                        <dd><input type="text" 
name="group_contact2_phone" value="<?php echo 
isset($contact2)?$contact2->get_phone():''?>"/></dd>
                                        <dt><label 
for="contact2_mail">E-post</label></dt>
                                        <dd><input type="text" 
name="group_contact2_mail" value="<?php echo 
isset($contact2)?$contact2->get_email():''?>"/></dd>
-                                       <dt><label 
for="contact2_address">Adresse</label></dt>
-                                       <dd><input type="text" 
name="contact2_address_txt" id="contact2_address_txt" 
onkeyup="javascript:get_address_search_cp2()" />
-                                       <div 
id="contact2_address_container"></div><br/>
-                                       <label 
for="contact2_number">Nummer</label>
-                                       <input type="text" 
name="group_contact2_number"/><br/>
-                                       <label 
for="contact2_postaddress">Postnummer og Sted</label>
-                                       <input type="text" 
name="group_contact2_postaddress"/></dd>
                                        <hr/>
                                </span>
                                <?php }?>

Added: trunk/activitycalendarfrontend/templates/base/activity_new_org.php
===================================================================
--- trunk/activitycalendarfrontend/templates/base/activity_new_org.php          
                (rev 0)
+++ trunk/activitycalendarfrontend/templates/base/activity_new_org.php  
2012-05-09 07:04:12 UTC (rev 9326)
@@ -0,0 +1,418 @@
+<?php
+       //include common logic for all templates
+//     include("common.php");
+       $act_so = activitycalendar_soactivity::get_instance();
+       $contpers_so = activitycalendar_socontactperson::get_instance();
+?>
+
+<script type="text/javascript">
+
+function checkNewGroup()
+{
+       var group_selected = document.getElementById('group_id').value;
+       if(group_selected == 'new_group')
+       {
+               document.getElementById('new_group_fields').style.display = 
"block";
+       }
+       else
+       {
+               document.getElementById('new_group_fields').style.display = 
"none";
+       }
+}
+
+function get_address_search()
+{
+       var address = document.getElementById('address_txt').value;
+       var div_address = document.getElementById('address_container');
+
+       //url = 
"/aktivby/registreringsskjema/ny/index.php?menuaction=activitycalendarfrontend.uiactivity.get_address_search&amp;phpgw_return_as=json&amp;search="
 + address;
+       url = 
"index.php?menuaction=activitycalendarfrontend.uiactivity.get_address_search&amp;phpgw_return_as=json&amp;search="
 + address;
+
+var divcontent_start = "<select name=\"address\" id=\"address\" size\"5\">";
+var divcontent_end = "</select>";
+       
+       var callback = {
+               success: function(response){
+                                       div_address.innerHTML = 
divcontent_start + JSON.parse(response.responseText) + divcontent_end; 
+                               },
+               failure: function(o) {
+                                        alert("AJAX doesn't work"); //FAILURE
+                                }
+       }
+       var trans = YAHOO.util.Connect.asyncRequest('GET', url, callback, null);
+       
+}
+
+function allOK()
+{
+/*     if(document.getElementById('title').value == null || 
document.getElementById('title').value == '')
+       {
+               alert("Tittel må fylles ut!");
+               return false;
+       } 
+       if(document.getElementById('internal_arena_id').value == null || 
document.getElementById('internal_arena_id').value == 0)
+       {
+               if(document.getElementById('arena_id').value == null || 
document.getElementById('arena_id').value == 0)
+               {
+                       alert("Arena må fylles ut!");
+                       return false;
+               }
+       }
+       if(document.getElementById('time').value == null || 
document.getElementById('time').value == '')
+       {
+               alert("Tid må fylles ut!");
+               return false;
+       }
+       if(document.getElementById('category').value == null || 
document.getElementById('category').value == 0)
+       {
+               alert("Kategori må fylles ut!");
+               return false;
+       }
+       if(document.getElementById('office').value == null || 
document.getElementById('office').value == 0)
+       {
+               alert("Hovedansvarlig kulturkontor må fylles ut!");
+               return false;
+       }
+       else */
+               return true;
+}
+
+</script>
+<style>
+dl.proplist,
+dl.proplist-col {
+    margin: 1em 0;
+    padding-left: 2em;
+}
+dl.proplist dt,
+dl.proplist-col dt { 
+    font-style: italic; 
+    font-weight: bolder; 
+    font-size: 90%; 
+    margin: .8em 0 .1em 0;
+}
+
+dl.proplist-col,
+dl.form-col {
+    width: 18em;
+    float: left;
+    text-align: left;
+}
+
+#frontend dl.proplist-col {
+    width: 600px; !important
+}
+
+table#header {
+       margin: 2em;
+       
+       }
+
+div#unit_selector {
+       
+}
+
+div#all_units_key_data {
+       padding-left: 2em;
+       }
+
+div#unit_image {
+       margin-left: 2em;
+       }
+
+div#unit_image img {
+       height:170px;
+}
+
+div.yui-navset {
+       padding-left: 2em;
+       padding-right: 2em;
+       }
+       
+div#contract_selector {
+       padding-left: 1em;
+       padding-top: 1em;
+       }
+       
+img.list_image {
+       margin-right: 5px;
+       float:left;
+       }
+
+a.list_image {
+       float:left;
+       display:inline;
+       }
+
+ol.list_image {
+       float: left;
+       }
+       
+ol.list_image li {
+       padding: 1px;
+}
+       
+dl#key_data  {
+       padding: 2px;
+       }
+       
+       
+dl#key_data dd {
+       padding-bottom: 1em;
+}
+
+table#key_data td {
+       padding-right: 1em;
+       padding: 5px;
+       }
+
+
+.user_menu {
+       list-style:none;
+       height: 100%;
+       padding: 2px;
+       border-style: none none none solid;
+       border-width: 1px;
+       border-color: grey;
+       padding-left: 5px;
+}
+
+.user_menu li {
+       margin: 13px;
+       }
+       
+#area_and_price {
+       list-style:none;
+       height: 100%;
+       padding: 2px;
+       padding-left: 5px;
+       float:right;
+       padding:0.5em 1em 0 0;
+}
+
+#area_and_price li {
+       margin: 13px;
+       }
+       
+#org_units {
+       list-style: none;
+       height: 100%;
+       padding: 2px;
+       padding-left: 5px;
+       float:right;
+       padding:0.5em 1em 0 0;
+}
+
+#org_units li {
+       margin: 13px;
+       }
+       
+#information {
+       list-style:none;
+       height: 100%;
+       padding: 2px;
+       padding-left: 5px;
+       float:right;
+       padding:0.5em 1em 0 0;
+}
+
+#information li {
+       margin: 13px;
+       }
+
+a.header_link {
+       text-decoration: none;
+       float: none;
+       }
+       
+#logo_holder {
+       border: 0 none;
+       font-family:Arial,sans-serif;
+font-size:65%;
+line-height:1.166;
+position: absolute;
+padding:2em;
+}
+
+em#bold {
+       font-weight: bold;
+       }
+
+div#header a {
+       float: none;
+}
+
+.yui-skin-sam .yui-navset .yui-nav, .yui-skin-sam .yui-navset .yui-navset-top 
.yui-nav {
+       border-color: #BF0005;
+       border-width:0 0 2px;
+       }
+       
+.yui-skin-sam .yui-navset .yui-content {
+       background: none repeat scroll 0 0 #F4F2ED;
+}
+
+.yui-skin-sam .yui-navset .yui-nav .selected a, .yui-skin-sam .yui-navset 
.yui-nav .selected a:focus, .yui-skin-sam .yui-navset .yui-nav .selected 
a:hover {
+       background:url("../../../../assets/skins/sam/sprite.png") repeat-x 
scroll left -1400px #2647A0;
+       }
+       
+div.tickets {
+       margin-top: 1em;
+       }
+
+em.select_header {
+       font-size: larger;
+       padding-top: 10px;
+       }
+
+#contract_price_and_area {
+       float: left;
+       margin: 1em 2em 0 0;
+}
+
+#contract_price_and_area li {
+               margin-bottom: 1em;
+       }
+
+#contract_essentials {
+       float: left;
+       margin: 1em 2em 0 2em;
+       }
+       
+#composites {
+       float: left;
+       margin: 1em 2em 0 2em;
+       }
+       
+       
+#comment {
+       float: left;
+       margin: 1em 2em 0 2em;
+       }
+       
+       #contract_essentials li {
+               margin-bottom: 1em;
+       }
+       
+#contract_parts {
+       float: left;
+       margin: 1em 2em 0 2em;
+       }
+       
+div.toolbar {
+background-color:#EEEEEE;
+border:1px solid #BBBBBB;
+float:left;
+width:100%;
+}
+
+div.toolbar_manual {
+background-color:#EEEEEE;
+border:1px solid #BBBBBB;
+float:left;
+width:100%;
+}
+
+.yui-pg-container {
+       white-space: normal;
+       }
+       
+li.ticket_detail {
+       padding: 5px;
+       margin-left: 5px;
+       }
+
+div.success {
+       font-weight: normal;
+       margin:10px;
+       padding:5px;
+       font-size:1.1em;
+       text-align: left;
+       background-color: green;
+       border:1px solid #9F6000;
+       color: white;
+}
+
+div.error {
+       font-weight: normal;
+       margin:10px;
+       padding:5px;
+       font-size:1.1em;
+       text-align: left;
+       background-color: red;
+       border:1px solid #9F6000;
+       color: white;
+}
+</style>
+<div class="yui-content" style="width: 100%;">
+       <div id="details">
+       
+       <?php if($message){?>
+       <div class="success">
+               <?php echo $message;?>
+       </div>
+       <?php }else if($error){?>
+       <div class="error">
+               <?php echo $error;?>
+       </div>
+       <?php }?>
+       </div>
+               <h1><?php echo lang('new_organization') ?></h1>
+               <form action="#" method="post">
+                       <input type="hidden" name="activity" value="<?php 
if($activity->get_id()){ echo $activity->get_id(); } else { echo '0'; }  ?>"/>
+                       <dl class="proplist-col" style="width: 200%">
+                               <input type="hidden" name="organization_id" 
id="organization_id" value="new_org" />
+                               <dt><label 
for="orgname">Organisasjonsnavn</label></dt>
+                               <dd><input type="text" name="orgname" 
size="100"/></dd>
+                               <dt><label 
for="orgno">Organisasjonsnummer</label></dt>
+                               <dd><input type="text" name="orgno"/></dd>
+                               <dt><label for="district">Bydel</label></dt>
+                               <dd><select name="org_district">
+                                               <option value="0">Ingen bydel 
valgt</option>
+                               <?php 
+                               foreach($districts as $d)
+                               {
+                               ?>
+                                       <option value="<?php echo 
$d['part_of_town_id']?>"><?php echo $d['name']?></option>
+                               <?php
+                               }?>
+                               </select></dd>
+                               <dt><label 
for="homepage">Hjemmeside</label></dt>
+                               <dd><input type="text" name="homepage" 
size="100"/></dd>
+                               <dt><label for="email">E-post</label></dt>
+                               <dd><input type="text" name="email"/></dd>
+                               <dt><label for="phone">Telefon</label></dt>
+                               <dd><input type="text" name="phone"/></dd>
+                               <dt><label for="street">Gate</label></dt>
+                               <dd><input type="text" name="address_txt" 
id="address_txt" onkeyup="javascript:get_address_search()"/>
+                               <div id="address_container"></div></dd>
+                               <dt><label for="number">Husnummer</label></dt>
+                               <dd><input type="text" name="number"/><br/></dd>
+                               <dt><label for="postaddress">Postnummer og 
Sted</label></dt>
+                               <dd><input type="text" name="postaddress" 
size="100"/></dd>
+                               <dt><label 
for="org_description">Beskrivelse</label></dt>
+                               <dd><textarea rows="10" cols="100" 
name="org_description"></textarea></dd>
+                               <hr/>
+                               <b>Kontaktperson 1</b><br/>
+                               <dt><label for="contact1_name">Navn</label>
+                               <input type="text" name="org_contact1_name" 
size="100"/></dt>
+                               <dt><label for="contact1_phone">Telefon</label>
+                               <input type="text" 
name="org_contact1_phone"/></dt>
+                               <dt><label for="contact1_mail">E-post</label>
+                               <input type="text" 
name="org_contact1_mail"/></dt><br/><br/><br/>
+                               <b>Kontaktperson 2</b><br/>
+                               <dt><label for="contact2_name">Navn</label>
+                               <input type="text" name="org_contact2_name" 
size="100"/></dt>
+                               <dt><label for="contact2_phone">Telefon</label>
+                               <input type="text" 
name="org_contact2_phone"/></dt>
+                               <dt><label for="contact2_mail">E-post</label>
+                               <input type="text" 
name="org_contact2_mail"/></dt>
+                               <hr/>
+                               <div class="form-buttons">
+                                       <input type="submit" 
name="save_organization" value="<?php echo lang('save_organization_next') ?>" 
onclick="return allOK();"/>
+                               </div>
+                       </dl>
+                       
+               </form>
+               
+       </div>
+</div>
\ No newline at end of file




reply via email to

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