fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [6728] property: notify client by sms


From: Sigurd Nes
Subject: [Fmsystem-commits] [6728] property: notify client by sms
Date: Tue, 04 Jan 2011 13:21:00 +0000

Revision: 6728
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6728
Author:   sigurdne
Date:     2011-01-04 13:20:59 +0000 (Tue, 04 Jan 2011)
Log Message:
-----------
property: notify client by sms

Modified Paths:
--------------
    trunk/property/inc/class.botts.inc.php
    trunk/property/inc/class.boworkorder.inc.php
    trunk/property/inc/class.uiwo_hour.inc.php
    trunk/property/setup/phpgw_no.lang
    trunk/property/templates/base/config.tpl
    trunk/property/templates/base/wo_hour.xsl
    trunk/sms/bin/default/set_workorder_status.php
    trunk/sms/inc/plugin/gateway/carrot/send.php

Modified: trunk/property/inc/class.botts.inc.php
===================================================================
--- trunk/property/inc/class.botts.inc.php      2011-01-04 10:01:50 UTC (rev 
6727)
+++ trunk/property/inc/class.botts.inc.php      2011-01-04 13:20:59 UTC (rev 
6728)
@@ -234,7 +234,7 @@
                                'H' => lang('Billing hours'),
                                'F' => lang('finnish date'),
                                'SC' => lang('Status changed'),
-                               'M' => lang('Sendt by email to'),
+                               'M' => lang('Sent by email to'),
                                'AC'=> lang('actual cost changed'),
                        );
 
@@ -579,14 +579,14 @@
                                case 'L': $type = lang('Location changed'); 
break;
                                case 'AC': $type = lang('actual cost changed'); 
break;
                                case 'M':
-                                       $type = lang('Sendt by email to');
+                                       $type = lang('Sent by email to');
                                        $this->order_sent_adress = 
$value['new_value']; // in case we want to resend the order as an reminder
                                        break;
                                default:
                                        // nothing
                                }
 
-                               //              if ( $value['status'] == 'X' || 
$value['status'] == 'R' || (strlen($value['status']) == 2 && 
substr($value['new_value'], 0, 1) == 'C') ) // if custom status
+               //              if ( $value['status'] == 'X' || 
$value['status'] == 'R' || (strlen($value['status']) == 2 && 
substr($value['new_value'], 0, 1) == 'C') ) // if custom status
                                if ( $value['status'] == 'X' || 
$value['status'] == 'R' || preg_match('/^C/i', $value['status']) || ( 
$value['status'] == 'R' && preg_match('/^C/i', $value['new_value']))) // if 
custom status
                                {
                                        switch ($value['status'])

Modified: trunk/property/inc/class.boworkorder.inc.php
===================================================================
--- trunk/property/inc/class.boworkorder.inc.php        2011-01-04 10:01:50 UTC 
(rev 6727)
+++ trunk/property/inc/class.boworkorder.inc.php        2011-01-04 13:20:59 UTC 
(rev 6728)
@@ -577,11 +577,14 @@
                                case 'A': $type = lang('Re-assigned'); break;
                                case 'P': $type = lang('Priority changed'); 
break;
                                case 'M':
-                                       $type = lang('Sendt by email to');
+                                       $type = lang('Sent by email to');
                                        $_order_sent_adress = explode(' 
',$value['new_value']);
                                        $this->order_sent_adress = 
$_order_sent_adress[0]; // in case we want to resend the order as an reminder
                                        unset($_order_sent_adress);
                                        break;
+                               case 'MS':
+                                       $type = lang('Sent by sms');
+                                       break;
                                case 'B': $type = lang('Budget changed'); break;
                                case 'CO': $type = lang('Initial Coordinator'); 
break;
                                case 'C': $type = lang('Coordinator changed'); 
break;

Modified: trunk/property/inc/class.uiwo_hour.inc.php
===================================================================
--- trunk/property/inc/class.uiwo_hour.inc.php  2011-01-04 10:01:50 UTC (rev 
6727)
+++ trunk/property/inc/class.uiwo_hour.inc.php  2011-01-04 13:20:59 UTC (rev 
6728)
@@ -1291,7 +1291,7 @@
 
                                $sms_data['heading'] = lang('Send the following 
SMS-message to %1 to update status for this 
order:',$config_sms->config_data['common']['gateway_number']);
                                $sms_data['message'] = 'status ' . 
$workorder_id . ' [' . lang('status code') .']';
-                               $sms_data['status_code'][0]['name'] = '1 => ' . 
lang('closed');
+                               $sms_data['status_code'][0]['name'] = '1 => ' . 
lang('performed');
                                $sms_data['status_code'][1]['name'] = '2 => ' . 
lang('No access');
                                $sms_data['status_code'][2]['name'] = '3 => ' . 
'I arbeid';
                                $sms_data['status_code_text'] = lang('status 
code');
@@ -1540,6 +1540,22 @@
                                                
$receipt['message'][]=array('msg' => $attachment_log);
                                        }
 
+                                       if( 
phpgw::get_var('notify_client_by_sms', 'bool') 
+                                               && 
isset($this->config->config_data['sms_client_order_notice']) 
+                                               && 
$this->config->config_data['sms_client_order_notice']
+                                               && 
(isset($project['contact_phone'])
+                                               && $project['contact_phone']
+                                               || 
phpgw::get_var('to_sms_phone')))
+                                       {
+                                               $to_sms_phone = 
phpgw::get_var('to_sms_phone');
+                                               $to_sms_phone = $to_sms_phone ? 
$to_sms_phone : $project['contact_phone'];
+                                               $project['contact_phone'] = 
$to_sms_phone;
+                                               
+                                               $sms    = 
CreateObject('sms.sms');
+                                               
$sms->websend2pv($this->account,$to_sms_phone,$this->config->config_data['sms_client_order_notice']);
+                                               
$historylog->add('MS',$workorder_id,$to_sms_phone);
+                                       }
+                                       
                                        if( 
$this->boworkorder->order_sent_adress )
                                        {
                                                $action_params = array
@@ -1657,6 +1673,8 @@
                                        'lang_mail'                             
                        => lang('E-Mail'),
                                        'lang_update_email'                     
                => lang('Update email'),
                                        'lang_update_email_statustext'          
=> lang('Check to update the email-address for this vendor'),
+                                       'value_sms_client_order_notice'         
=> isset($this->config->config_data['sms_client_order_notice']) ? 
$this->config->config_data['sms_client_order_notice'] : '',
+                                       'value_sms_phone'                       
                => $project['contact_phone'],
                                        'lang_to_email_address_statustext'      
=> lang('The address to which this order will be sendt'),
                                        'to_email'                              
                        => $to_email,
                                        'email_list'                            
                => $email_list,

Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang  2011-01-04 10:01:50 UTC (rev 6727)
+++ trunk/property/setup/phpgw_no.lang  2011-01-04 13:20:59 UTC (rev 6728)
@@ -957,7 +957,7 @@
 list voucher   property        no      list underbilag
 list workorder property        no      List arbeidsordre
 location       property        no      Lokalisering
-loc1_name      property        no      Navn
+loc1 name      property        no      Navn
 local files    property        no      Lokale filer
 location changed       property        no      Lokalisering er endret
 location code  property        no      Lokaliserings kode
@@ -1078,6 +1078,7 @@
 no workorder budget    property        no      Ingen budsjett 
arbeidsordre/bestilling
 no workorder bugdet    property        no      Ingen arbeidsordrer er 
budsjettert
 no year        property        no      Ingen årstall
+notify client by sms   property        no      Varsle kunde via SMS
 ns3420 property        no      NS3420
 ns3420 description     property        no      NS3420 beskrivelse
 nullable       property        no      Kan være NULL
@@ -1121,6 +1122,7 @@
 per agreement  property        no      pr avtale
 per cent       property        no      Prosent
 percentage addition    property        no      prosentvis tillegg
+performed      property        no      Utført
 period property        no      Periode
 permission     property        no      rettighet
 permissions    property        no      Rettigheter
@@ -1517,7 +1519,8 @@
 send e-mail    property        no      Send epost
 send order     property        no      Send ordre
 Send pdf as attachment to email        property        no      Send PDF som 
vedlegg til epost
-sendt by email to      property        no      send med e-post til
+sent by email to       property        no      sendt med e-post til
+Sent by sms    property        no      sendt med SMS
 send the following sms-message to %1 to update status for this order:  
property        no      Send følgende SMS-melding til %1 for å oppdatere status 
for denne ordren:
 send this order by email       property        no      send denne ordren med 
e-post
 send workorder property        no      Send ordre

Modified: trunk/property/templates/base/config.tpl
===================================================================
--- trunk/property/templates/base/config.tpl    2011-01-04 10:01:50 UTC (rev 
6727)
+++ trunk/property/templates/base/config.tpl    2011-01-04 13:20:59 UTC (rev 
6728)
@@ -26,35 +26,42 @@
                                <textarea cols="40" rows="4" 
name="newsettings[delivery_address]" 
wrap="virtual">{value_delivery_address}</textarea>
                        </td>
                </tr>
-               <tr class="row_on">
+               <tr class="row_off">
                        <td>{lang_invoice_address}:</td>
                        <td>
                                <textarea cols="40" rows="4" 
name="newsettings[invoice_address]" 
wrap="virtual">{value_invoice_address}</textarea>
                        </td>
                </tr>
 
-               <tr class="row_off">
+               <tr class="row_on">
                        <td>{lang_order_footer_header}:</td>
                        <td><input name="newsettings[order_footer_header]" 
value="{value_order_footer_header}"></td>
                </tr>
 
-               <tr class="row_on">
+               <tr class="row_off">
                        <td>{lang_order_footer}:</td>
                        <td>
                                <textarea cols="40" rows="4" 
name="newsettings[order_footer]" wrap="virtual">{value_order_footer}</textarea>
                        </td>
                </tr>
 
-               <tr class="row_off">
+               <tr class="row_on">
                        <td>{lang_order_logo}:</td>
                        <td><input name="newsettings[order_logo]" 
value="{value_order_logo}"></td>
                </tr>
 
-               <tr class="row_on">
+               <tr class="row_off">
                        <td>{lang_order_logo_width}:</td>
                        <td><input name="newsettings[order_logo_width]" 
value="{value_order_logo_width}"></td>
                </tr>
 
+               <tr class="row_on">
+                       <td>{lang_SMS_client_order_notice}:</td>
+                       <td>
+                               <textarea cols="40" rows="4" 
name="newsettings[sms_client_order_notice]" 
wrap="virtual">{value_sms_client_order_notice}</textarea>
+                       </td>
+               </tr>
+
                <tr class="row_off">
                        <td>{lang_needed_for_invoice_approval}:</td>
                        <td>

Modified: trunk/property/templates/base/wo_hour.xsl
===================================================================
--- trunk/property/templates/base/wo_hour.xsl   2011-01-04 10:01:50 UTC (rev 
6727)
+++ trunk/property/templates/base/wo_hour.xsl   2011-01-04 13:20:59 UTC (rev 
6728)
@@ -402,11 +402,9 @@
                                                                                
                        <xsl:value-of select="lang_mail"/>
                                                                                
                </td>
                                                                                
                <td  align="left">
-                                                                               
                        <input type="text" name="to_email" value="{to_email}"  
onMouseout="window.status='';return true;">
-                                                                               
                                <xsl:attribute name="onMouseover">
-                                                                               
                                        <xsl:text>window.status='</xsl:text>
+                                                                               
                        <input type="text" name="to_email" value="{to_email}">
+                                                                               
                                <xsl:attribute name="title">
                                                                                
                                        <xsl:value-of 
select="lang_to_email_address_statustext"/>
-                                                                               
                                        <xsl:text>'; return true;</xsl:text>
                                                                                
                                </xsl:attribute>
                                                                                
                        </input>
                                                                                
                </td>
@@ -417,10 +415,8 @@
                                                                                
                </td>
                                                                                
                <td  align="left">
                                                                                
                        <input type="checkbox" name="update_email" value="true" 
 onMouseout="window.status='';return true;">
-                                                                               
                                <xsl:attribute name="onMouseover">
-                                                                               
                                        <xsl:text>window.status='</xsl:text>
+                                                                               
                                <xsl:attribute name="title">
                                                                                
                                        <xsl:value-of 
select="lang_update_email_statustext"/>
-                                                                               
                                        <xsl:text>'; return true;</xsl:text>
                                                                                
                                </xsl:attribute>
                                                                                
                        </input>
                                                                                
                </td>
@@ -439,6 +435,32 @@
                                                                                
        </tr>
                                                                                
        <tr>
                                                                                
                <td class="th_text"  align="left">
+                                                                               
                        <xsl:value-of select="php:function('lang', 'notify 
client by sms')" />
+                                                                               
                </td>
+                                                                               
                <td  align="left">
+                                                                               
                        <table>
+                                                                               
                        <tr>
+                                                                               
                        <td>
+                                                                               
                        <input type="checkbox" name="notify_client_by_sms" 
value="true">
+                                                                               
                                <xsl:attribute name="title">
+                                                                               
                                        <xsl:value-of 
select="value_sms_client_order_notice"/>
+                                                                               
                                </xsl:attribute>
+                                                                               
                        </input>
+                                                                               
                        </td>
+                                                                               
                        <td>
+                                                                               
                        <input type="text" name="to_sms_phone" 
value="{value_sms_phone}">
+                                                                               
                                <xsl:attribute name="title">
+                                                                               
                                        <xsl:value-of 
select="value_sms_client_order_notice"/>
+                                                                               
                                </xsl:attribute>
+                                                                               
                        </input>
+                                                                               
                        </td>
+                                                                               
                        </tr>
+                                                                               
                        </table>
+                                                                               
                </td>
+                                                                               
        </tr>
+
+                                                                               
        <tr>
+                                                                               
                <td class="th_text"  align="left">
                                                                                
                        <xsl:value-of select="php:function('lang', 'show 
calculated cost')" />
                                                                                
                </td>
                                                                                
                <td  align="left">
@@ -647,10 +669,8 @@
                                                                        <br/>   
                        
                                                                        
<xsl:choose>
                                                                                
<xsl:when test="ressursnr !=''">
-                                                                               
        <b>
                                                                                
                <xsl:text>RessursNr: </xsl:text>
                                                                                
                <xsl:value-of select="ressursnr"/>
-                                                                               
        </b>
                                                                                
        <br/>
                                                                                
</xsl:when>
                                                                        
</xsl:choose>

Modified: trunk/sms/bin/default/set_workorder_status.php
===================================================================
--- trunk/sms/bin/default/set_workorder_status.php      2011-01-04 10:01:50 UTC 
(rev 6727)
+++ trunk/sms/bin/default/set_workorder_status.php      2011-01-04 13:20:59 UTC 
(rev 6728)
@@ -16,8 +16,9 @@
         * @package sms
         */
 
-       $status_code = array(
-               1 => 'closed',
+       $status_code = array
+       (
+               1 => 'utført',
                2 => 'ikke_tilgang',
                3 => 'i_arbeid',
        );
@@ -29,10 +30,10 @@
                $workorder_id   = $param[0];
                $status         = $status_code[$param[1]];
 
-               $this->db->query("SELECT status FROM fm_workorder where 
id='$workorder_id'",__LINE__,__FILE__);
+               $this->db->query("SELECT status FROM fm_workorder where 
id='{$workorder_id}'",__LINE__,__FILE__);
                if($this->db->next_record())
                {
-                       $this->db->query("UPDATE fm_workorder set status = 
'$status' WHERE id='$workorder_id'" ,__LINE__,__FILE__);
+                       $this->db->query("UPDATE fm_workorder set status = 
'{$status}' WHERE id='{$workorder_id}'" ,__LINE__,__FILE__);
                        $historylog     = 
CreateObject('property.historylog','workorder');
        // temporary - fix this
                        $historylog->account = 6;

Modified: trunk/sms/inc/plugin/gateway/carrot/send.php
===================================================================
--- trunk/sms/inc/plugin/gateway/carrot/send.php        2011-01-04 10:01:50 UTC 
(rev 6727)
+++ trunk/sms/inc/plugin/gateway/carrot/send.php        2011-01-04 13:20:59 UTC 
(rev 6728)
@@ -29,7 +29,7 @@
                function 
gw_send_sms($mobile_sender,$sms_sender,$sms_to,$sms_msg,$gp_code="",$uid="",$smslog_id="",$flash=false)
                {
                        $result = array();
-                       $sms_msg = utf8_decode($sms_msg);
+//                     $sms_msg = utf8_decode($sms_msg);
                        
                        $sms_to = ltrim($sms_to, '+');
                        




reply via email to

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