fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8766] bkbooking: update event - get contact from org


From: Kjell Arne Espedal
Subject: [Fmsystem-commits] [8766] bkbooking: update event - get contact from organization
Date: Thu, 02 Feb 2012 12:44:07 +0000

Revision: 8766
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8766
Author:   kjell
Date:     2012-02-02 12:44:06 +0000 (Thu, 02 Feb 2012)
Log Message:
-----------
bkbooking: update event - get contact from organization

Modified Paths:
--------------
    trunk/booking/inc/class.soevent.inc.php
    trunk/booking/inc/class.uievent.inc.php
    trunk/booking/setup/phpgw_no.lang
    trunk/booking/templates/base/event_edit.xsl
    trunk/booking/templates/base/event_new.xsl
    trunk/booking/templates/base/organization_edit.xsl

Modified: trunk/booking/inc/class.soevent.inc.php
===================================================================
--- trunk/booking/inc/class.soevent.inc.php     2012-02-02 12:15:48 UTC (rev 
8765)
+++ trunk/booking/inc/class.soevent.inc.php     2012-02-02 12:44:06 UTC (rev 
8766)
@@ -268,7 +268,7 @@
 
                function get_org($orgnumber)
                {
-                       $sql = "SELECT id,name FROM bb_organization WHERE 
customer_organization_number='".$orgnumber."'";
+                       $sql = "SELECT id,name FROM bb_organization WHERE 
organization_number='".$orgnumber."' OR 
customer_organization_number='".$orgnumber."'";
 
                        $this->db->limit_query($sql,0, __LINE__, __FILE__, 1);
                        if($this->db->next_record())

Modified: trunk/booking/inc/class.uievent.inc.php
===================================================================
--- trunk/booking/inc/class.uievent.inc.php     2012-02-02 12:15:48 UTC (rev 
8765)
+++ trunk/booking/inc/class.uievent.inc.php     2012-02-02 12:44:06 UTC (rev 
8766)
@@ -315,6 +315,41 @@
                                $event['is_public'] = 1;
                                $event['building_name'] = 
$_POST['building_name'];
 
+                               if ($_POST['organization_name'] || 
$_POST['org_id2']) {
+                                       if ($_POST['organization_name']) {
+                                               
$event['customer_organization_name'] = $_POST['organization_name'];
+                                               
$event['customer_organization_id'] = $_POST['organization_id'];
+                                               $organization = 
$this->organization_bo->read_single(intval(phpgw::get_var('organization_id', 
'POST')));
+                                       } else {
+                                               $orgid = 
$this->bo->so->get_org($_POST['org_id2']);
+                                               $event['org_id2'] = 
$_POST['org_id2'];
+                                               
$event['customer_organization_name'] = $orgid['name'];
+                                               
$event['customer_organization_id'] = $orgid['id'];
+                                               $organization = 
$this->organization_bo->read_single(intval($orgid['id']));
+                                       }
+                                                                               
+                                       if ($organization['customer_internal'] 
== 0) {
+                                               
$_POST['customer_identifier_type'] = $organization['customer_identifier_type'];
+                                               $_POST['customer_internal'] = 
$organization['customer_internal'];
+                                               if 
(strlen($organization['customer_organization_number']) == 9) {
+                                                       
$_POST['customer_organization_number'] = 
$organization['customer_organization_number'];
+                                               } else {
+                                                       
$errors['organization_number'] = lang('The organization number is wrong or not 
present');
+                                               }
+                                       } else {
+                                               
$_POST['customer_identifier_type'] = 'organization_number';
+                                               $_POST['customer_internal'] = 
$organization['customer_internal'];
+                                               if 
(strlen($organization['customer_number']) == 5) {
+                                                       
$_POST['customer_organization_number'] = $organization['customer_number'];
+                                               } else {
+                                                       
$errors['resource_number'] = lang('The resource number is wrong or not 
present');
+                                               }
+                                       }
+                                       $_POST['contact_name'] = 
$organization['contacts'][0]['name'];
+                                       $_POST['contact_email'] = 
$organization['contacts'][0]['email'];
+                                       $_POST['contact_phone'] = 
$organization['contacts'][0]['phone'];
+                               } 
+
                                if (!$_POST['application_id'])
                                {
                     $temp_errors = array();
@@ -352,28 +387,6 @@
                                                }
                                        }  
                                }
-                               if ($_POST['organization_name']) {
-                                       $event['customer_organization_name'] = 
$_POST['organization_name'];
-                                       $event['customer_organization_id'] = 
$_POST['organization_id'];
-                                       $organization = 
$this->organization_bo->read_single(intval(phpgw::get_var('organization_id', 
'POST')));
-                                       if ($organization['customer_internal'] 
== 0) {
-                                               
$event['customer_identifier_type'] = $organization['customer_identifier_type'];
-                                               $event['customer_internal'] = 
$organization['customer_internal'];
-                                               if 
(strlen($organization['customer_organization_number']) == 9) {
-                                                       
$event['customer_organization_number'] = 
$organization['customer_organization_number'];
-                                               } else {
-                                                       
$errors['organization_number'] = lang('The organization number is wrong or not 
present');
-                                               }
-                                       } else {
-                                               
$event['customer_identifier_type'] = 'organization_number';
-                                               $event['customer_internal'] = 
$organization['customer_internal'];
-                                               if 
(strlen($organization['customer_number']) == 5) {
-                                                       
$event['customer_organization_number'] = $organization['customer_number'];
-                                               } else {
-                                                       
$errors['resource_number'] = lang('The resource number is wrong or not 
present');
-                                               }
-                                       }
-                               } 
 
                                if ($_POST['cost'] != 0 and 
!$event['customer_organization_number'] and !$event['customer_ssn']) {
                                        $errors['invoice_data'] = lang('There 
is set a cost, but no invoice data is filled inn');

Modified: trunk/booking/setup/phpgw_no.lang
===================================================================
--- trunk/booking/setup/phpgw_no.lang   2012-02-02 12:15:48 UTC (rev 8765)
+++ trunk/booking/setup/phpgw_no.lang   2012-02-02 12:44:06 UTC (rev 8766)
@@ -397,6 +397,7 @@
 A Case officer will review your application as soon as possible.       booking 
no      En saksbehandler vil behandle søknaden så fort som mulig.
 customer_ssn contains an invalid Norwegian social security number (6 or 11 
digits)     booking no      Fødselsdato/fødselsnummer er ikke gyldig. Nummeret 
må bestå av 6 eller 11 siffer
 customer_organization_number is invalid        booking no      
Organisasjonsnummer er ugyldig
+Organization_number    booking no      Organisasjonsnummer
 Select an organization first   booking no      Velg organisasjon først
 Add Resource   booking no      Ny ressurs
 %1 e-mails were sent successfully      booking no      %1 e-poster ble sendt
@@ -405,6 +406,7 @@
 contact_email  booking no      E-post
 contact_name   booking no      Navn
 customer_identifier_type       booking no      Fakturainformasjon
+Or     booking no      Eller
 group_id       booking no      Gruppe/Lag
 organization_id        booking no      Organisasjon
 season_id      booking no      Sesong
@@ -542,3 +544,4 @@
 There is a cost of %1 assosiated with the allocation you are useing    booking 
no      Det er en kostnad på %1kr knyttet til den tildelingen du bruker.
 Export booking no      Eksport
 Upload booking no      Last opp
+Get all contact and invoice information from organization      booking no      
Hent all kontakt/faktura informasjon fra Organisasjon 

Modified: trunk/booking/templates/base/event_edit.xsl
===================================================================
--- trunk/booking/templates/base/event_edit.xsl 2012-02-02 12:15:48 UTC (rev 
8765)
+++ trunk/booking/templates/base/event_edit.xsl 2012-02-02 12:44:06 UTC (rev 
8766)
@@ -204,19 +204,6 @@
                <dl class="form-col">
                        <dt class="heading"><xsl:value-of 
select="php:function('lang', 'Invoice information')" /></dt>
 
-            <dt><label for="field_org"><xsl:value-of 
select="php:function('lang', 'Organization')" /></label></dt>
-            <dd>
-                <div class="autocomplete">
-                    <input id="field_org_id" name="organization_id" 
type="hidden">
-                        <xsl:attribute name="value"><xsl:value-of 
select="event/customer_organization_id"/></xsl:attribute>
-                    </input>
-                    <input id="field_org_name" name="organization_name" 
type="text">
-                        <xsl:attribute name="value"><xsl:value-of 
select="event/customer_organization_name"/></xsl:attribute>
-                    </input>
-                    <div id="org_container"/>
-                </div>
-            </dd>
-
                        <xsl:copy-of 
select="phpgw:booking_customer_identifier(event, '')"/>
                        
                        <dt><label for="field_customer_internal"><xsl:value-of 
select="php:function('lang', 'Internal Customer')"/></label></dt>

Modified: trunk/booking/templates/base/event_new.xsl
===================================================================
--- trunk/booking/templates/base/event_new.xsl  2012-02-02 12:15:48 UTC (rev 
8765)
+++ trunk/booking/templates/base/event_new.xsl  2012-02-02 12:44:06 UTC (rev 
8766)
@@ -135,6 +135,58 @@
                        </dd>
                </dl>
                <div class="clr"/>
+               <dl class="form-col">
+                       <dt class="heading"><xsl:value-of 
select="php:function('lang', 'Cost')" /></dt>
+            <dt><label for="field_cost"><xsl:value-of 
select="php:function('lang', 'Cost')" /></label></dt>
+            <dd>
+                <input id="field_cost" name="cost" type="text">
+                    <xsl:attribute name="value"><xsl:value-of 
select="event/cost"/></xsl:attribute>
+                </input>
+            </dd>
+               </dl>
+               <dl class="form-col">
+               </dl>
+               <dl class="form-col">
+                       <dt class="heading"><xsl:value-of 
select="php:function('lang', 'send reminder for participants statistics')" 
/></dt>
+                       <dt style="visibility: hidden;">!</dt>
+                       <dd>
+                               <select name="reminder" id="field_reminder">
+                                       <xsl:choose>
+                                               <xsl:when test="event/reminder 
= 1">
+                                                       <option value="1" 
selected="selected"><xsl:value-of select="php:function('lang', 'Send 
reminder')" /></option>
+                                                       <option 
value="0"><xsl:value-of select="php:function('lang', 'Do not send reminder')" 
/></option>
+                                               </xsl:when>
+                                               <xsl:otherwise 
test="event/reminder = 0">
+                                                       <option 
value="1"><xsl:value-of select="php:function('lang', 'Send reminder')" 
/></option>
+                                                       <option value="0" 
selected="selected"><xsl:value-of select="php:function('lang', 'Do not send 
reminder')" /></option>
+                                               </xsl:otherwise>
+                                       </xsl:choose>
+                               </select>
+                       </dd>
+               </dl>
+               <div class="clr"/>
+               <dl class="form-col">
+                       <dt class="heading"><xsl:value-of 
select="php:function('lang', 'Get all contact and invoice information from 
organization')" /></dt> 
+            <dt><label for="field_org"><xsl:value-of 
select="php:function('lang', 'Organization')" /></label></dt>
+            <dd>
+                <div class="autocomplete">
+                    <input id="field_org_id" name="organization_id" 
type="hidden">
+                        <xsl:attribute name="value"><xsl:value-of 
select="event/customer_organization_id"/></xsl:attribute>
+                    </input>
+                    <input id="field_org_name" name="organization_name" 
type="text">
+                        <xsl:attribute name="value"><xsl:value-of 
select="event/customer_organization_name"/></xsl:attribute>
+                    </input>
+                    <div id="org_container"/>
+                </div>
+                               <span><xsl:value-of 
select="php:function('lang', 'Or')" /></span>
+                               <dt><label for="field_org_id2"><xsl:value-of 
select="php:function('lang', 'Organization_number')" /></label></dt>
+                               <dd>
+                                       <input id="field_org_id2" 
name="org_id2" type="text">
+                                               <xsl:attribute 
name="value"><xsl:value-of select="event/org_id2"/></xsl:attribute>
+                                       </input>
+                               </dd>
+            </dd>
+               </dl>
         <dl class="form-col">
                        <dt class="heading"><xsl:value-of 
select="php:function('lang', 'Contact information')" /></dt>
                        <dt><label for="field_contact_name"><xsl:value-of 
select="php:function('lang', 'Name')" /></label></dt>
@@ -155,54 +207,17 @@
                                        <xsl:attribute 
name="value"><xsl:value-of select="event/contact_phone"/></xsl:attribute>
                                </input>
                        </dd>
-            <dt><label for="field_cost"><xsl:value-of 
select="php:function('lang', 'Cost')" /></label></dt>
-            <dd>
-                <input id="field_cost" name="cost" type="text">
-                    <xsl:attribute name="value"><xsl:value-of 
select="event/cost"/></xsl:attribute>
-                </input>
-            </dd>
         </dl>
                <dl class="form-col">
 
                        <dt class="heading"><xsl:value-of 
select="php:function('lang', 'Invoice information')" /></dt>
 
-            <dt><label for="field_org"><xsl:value-of 
select="php:function('lang', 'Organization')" /></label></dt>
-            <dd>
-                <div class="autocomplete">
-                    <input id="field_org_id" name="organization_id" 
type="hidden">
-                        <xsl:attribute name="value"><xsl:value-of 
select="event/organization_id"/></xsl:attribute>
-                    </input>
-                    <input id="field_org_name" name="organization_name" 
type="text">
-                        <xsl:attribute name="value"><xsl:value-of 
select="event/customer_organization_name"/></xsl:attribute>
-                    </input>
-                    <div id="org_container"/>
-                </div>
-            </dd>
-
                        <xsl:copy-of 
select="phpgw:booking_customer_identifier(event, '')"/>
 
                
                        <dt><label for="field_customer_internal"><xsl:value-of 
select="php:function('lang', 'Internal Customer')"/></label></dt>
                        <dd><xsl:copy-of 
select="phpgw:option_checkbox(event/customer_internal, 
'customer_internal')"/></dd>
                </dl>
-               <dl class="form-col">
-                       <dt class="heading"><xsl:value-of 
select="php:function('lang', 'send reminder for participants statistics')" 
/></dt>
-                       <dt style="visibility: hidden;">!</dt>
-                       <dd>
-                               <select name="reminder" id="field_reminder">
-                                       <xsl:choose>
-                                               <xsl:when test="event/reminder 
= 1">
-                                                       <option value="1" 
selected="selected"><xsl:value-of select="php:function('lang', 'Send 
reminder')" /></option>
-                                                       <option 
value="0"><xsl:value-of select="php:function('lang', 'Do not send reminder')" 
/></option>
-                                               </xsl:when>
-                                               <xsl:otherwise 
test="event/reminder = 0">
-                                                       <option 
value="1"><xsl:value-of select="php:function('lang', 'Send reminder')" 
/></option>
-                                                       <option value="0" 
selected="selected"><xsl:value-of select="php:function('lang', 'Do not send 
reminder')" /></option>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                               </select>
-                       </dd>
-               </dl>
         <div class="form-buttons">
             <input type="submit">
                                <xsl:attribute name="value"><xsl:value-of 
select="php:function('lang', 'Create')"/></xsl:attribute>

Modified: trunk/booking/templates/base/organization_edit.xsl
===================================================================
--- trunk/booking/templates/base/organization_edit.xsl  2012-02-02 12:15:48 UTC 
(rev 8765)
+++ trunk/booking/templates/base/organization_edit.xsl  2012-02-02 12:44:06 UTC 
(rev 8766)
@@ -99,25 +99,6 @@
                                <xsl:attribute name="value"><xsl:value-of 
select="organization/email"/></xsl:attribute>
                            </input>
                        </dd>
-                       <dt style="margin-top: 40px;"><label 
for="field_activity"><xsl:value-of select="php:function('lang', 'Activity')" 
/></label></dt>
-                       <dd>
-                               <select name="activity_id" id="field_activity">
-                                       <option value=""><xsl:value-of 
select="php:function('lang', '-- select an activity --')" /></option>
-                                       <xsl:for-each select="activities">
-                                               <option>
-                                                       <xsl:if 
test="../organization/activity_id = id">
-                                                               <xsl:attribute 
name="selected">selected</xsl:attribute>
-                                                       </xsl:if>
-                                                       <xsl:attribute 
name="value"><xsl:value-of select="id"/></xsl:attribute>
-                                                       <xsl:value-of 
select="name"/>
-                                               </option>
-                                       </xsl:for-each>
-                               </select>
-                       </dd>
-                       <dt><label for="field_description"><xsl:value-of 
select="php:function('lang', 'Description')" /></label></dt>
-                       <dd class="yui-skin-sam">
-                           <textarea id="field-description" name="description" 
type="text"><xsl:value-of select="organization/description"/></textarea>
-                       </dd>
                </dl>
                <dl class="form-col">
             <xsl:if test="currentapp = 'booking'">
@@ -187,8 +168,30 @@
                        </dd>
                        <!--</xsl:if>-->
                </dl>
+               <div class="clr"/>
+               <dl class="form-col">
+                       <dt style="margin-top: 40px;"><label 
for="field_activity"><xsl:value-of select="php:function('lang', 'Activity')" 
/></label></dt>
+                       <dd>
+                               <select name="activity_id" id="field_activity">
+                                       <option value=""><xsl:value-of 
select="php:function('lang', '-- select an activity --')" /></option>
+                                       <xsl:for-each select="activities">
+                                               <option>
+                                                       <xsl:if 
test="../organization/activity_id = id">
+                                                               <xsl:attribute 
name="selected">selected</xsl:attribute>
+                                                       </xsl:if>
+                                                       <xsl:attribute 
name="value"><xsl:value-of select="id"/></xsl:attribute>
+                                                       <xsl:value-of 
select="name"/>
+                                               </option>
+                                       </xsl:for-each>
+                               </select>
+                       </dd>
+                       <dt><label for="field_description"><xsl:value-of 
select="php:function('lang', 'Description')" /></label></dt>
+                       <dd class="yui-skin-sam">
+                           <textarea id="field-description" name="description" 
type="text"><xsl:value-of select="organization/description"/></textarea>
+                       </dd>
+               </dl>
 
-               <div style='clear:left; padding:0; margin:0'/>
+               <div class="clr"/>
 
                <xsl:if test='new_form or organization/permission/write'>
                




reply via email to

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