fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7589] property: email at order


From: Sigurd Nes
Subject: [Fmsystem-commits] [7589] property: email at order
Date: Wed, 14 Sep 2011 16:45:50 +0000

Revision: 7589
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7589
Author:   sigurdne
Date:     2011-09-14 16:45:50 +0000 (Wed, 14 Sep 2011)
Log Message:
-----------
property: email at order

Modified Paths:
--------------
    trunk/property/inc/class.bowo_hour.inc.php
    trunk/property/inc/class.sowo_hour.inc.php
    trunk/property/inc/class.uiwo_hour.inc.php
    trunk/property/templates/base/wo_hour.xsl

Modified: trunk/property/inc/class.bowo_hour.inc.php
===================================================================
--- trunk/property/inc/class.bowo_hour.inc.php  2011-09-14 14:19:43 UTC (rev 
7588)
+++ trunk/property/inc/class.bowo_hour.inc.php  2011-09-14 16:45:50 UTC (rev 
7589)
@@ -408,35 +408,15 @@
                        return $receipt;
                }
 
-               function get_email($to_email,$vendor_id)
+               function get_email($selected, $vendor_id)
                {
-                       $selected = $to_email;
+                       $email_list = $this->so->get_email($vendor_id);
 
-                       $email_ist = $this->so->get_email($vendor_id);
-
-                       while (is_array($email_ist) && list(,$email_entry) = 
each($email_ist))
+                       foreach( $email_list as &$email_entry )
                        {
-                               $sel_email = '';
-                               if ($email_entry['email']==$selected)
-                               {
-                                       $sel_email = 'selected';
-                               }
-
-                               $email_list[] = array
-                                       (
-                                               'email'         => 
$email_entry['email'],
-                                               'selected'      => $sel_email
-                                       );
+                               $email_entry['selected'] = 
trim($email_entry['email']) == trim($selected) ? 1 : 0;
                        }
 
-                       for ($i=0;$i<count($email_list);$i++)
-                       {
-                               if ($email_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($email_list[$i]['selected']);
-                               }
-                       }
-
                        return  $email_list;
                }
 

Modified: trunk/property/inc/class.sowo_hour.inc.php
===================================================================
--- trunk/property/inc/class.sowo_hour.inc.php  2011-09-14 14:19:43 UTC (rev 
7588)
+++ trunk/property/inc/class.sowo_hour.inc.php  2011-09-14 16:45:50 UTC (rev 
7589)
@@ -683,16 +683,19 @@
                {
                        $vendor_id=(int)$vendor_id;
                        $location_id = 
$GLOBALS['phpgw']->locations->get_id('property', '.vendor');
-                       $this->db->query("select column_name from 
phpgw_cust_attribute WHERE location_id = {$location_id} AND 
datatype='email'",__LINE__,__FILE__);
+                       $this->db->query("SELECT column_name FROM 
phpgw_cust_attribute WHERE location_id = {$location_id} AND 
datatype='email'",__LINE__,__FILE__);
                        $email_list = array();
                        while ($this->db->next_record())
                        {
-                               $this->db2->query("select " . 
$this->db->f('column_name') . " from fm_vendor where 
id=$vendor_id",__LINE__,__FILE__);
+                               $this->db2->query("SELECT " . 
$this->db->f('column_name') . " FROM fm_vendor WHERE 
id=$vendor_id",__LINE__,__FILE__);
                                while ($this->db2->next_record())
                                {
                                        
if($this->db2->f($this->db->f('column_name')))
                                        {
-                                               $email_list[] = array('email' 
=> $this->db2->f($this->db->f('column_name')));
+                                               $email_list[] = array
+                                               (
+                                                       'email' => 
$this->db2->f($this->db->f('column_name'))
+                                               );
                                        }
                                }
                        }

Modified: trunk/property/inc/class.uiwo_hour.inc.php
===================================================================
--- trunk/property/inc/class.uiwo_hour.inc.php  2011-09-14 14:19:43 UTC (rev 
7588)
+++ trunk/property/inc/class.uiwo_hour.inc.php  2011-09-14 16:45:50 UTC (rev 
7589)
@@ -1609,15 +1609,12 @@
                        {
                                $to_email= 
$this->boworkorder->order_sent_adress;
                        }
-                       else
+
+                       $email_list     = 
$this->bo->get_email($to_email,$workorder['vendor_id']);
+                       if(count($email_list)==1)
                        {
-                               //FIXME
-                               $email_list     = 
$this->bo->get_email($to_email,$workorder['vendor_id']);
-                               if(count($email_list)==1)
-                               {
-                                       $to_email= $email_list[0]['email'];
-                                       unset($email_list);
-                               }
+                               $to_email= $email_list[0]['email'];
+                               unset($email_list);
                        }
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);

Modified: trunk/property/templates/base/wo_hour.xsl
===================================================================
--- trunk/property/templates/base/wo_hour.xsl   2011-09-14 14:19:43 UTC (rev 
7588)
+++ trunk/property/templates/base/wo_hour.xsl   2011-09-14 16:45:50 UTC (rev 
7589)
@@ -331,7 +331,7 @@
        <xsl:template match="email_list">
                <xsl:variable name="email"><xsl:value-of 
select="email"/></xsl:variable>
                <xsl:choose>
-                       <xsl:when test="selected">
+                       <xsl:when test="selected != 0">
                                <option value="{$email}" 
selected="selected"><xsl:value-of disable-output-escaping="yes" 
select="email"/></option>
                        </xsl:when>
                        <xsl:otherwise>
@@ -407,7 +407,7 @@
                                                                                
                </td>
                                                                                
                <td  align="left">
                                                                                
                        <xsl:variable 
name="lang_to_email_address_statustext"><xsl:value-of 
select="lang_to_email_address_statustext"/></xsl:variable>
-                                                                               
                        <select name="to_email" class="forms" 
onMouseover="window.status='{$lang_to_email_address_statustext}'; return true;" 
onMouseout="window.status='';return true;">
+                                                                               
                        <select name="to_email" class="forms" 
title="{$lang_to_email_address_statustext}">
                                                                                
                                <option value=""><xsl:value-of 
select="lang_select_email"/></option>
                                                                                
                                <xsl:apply-templates select="email_list"/>
                                                                                
                        </select>




reply via email to

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