fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [12384] property: add qrcode for SMS


From: Sigurd Nes
Subject: [Fmsystem-commits] [12384] property: add qrcode for SMS
Date: Thu, 27 Nov 2014 13:54:19 +0000

Revision: 12384
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12384
Author:   sigurdne
Date:     2014-11-27 13:54:18 +0000 (Thu, 27 Nov 2014)
Log Message:
-----------
property: add qrcode for SMS

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

Modified: trunk/property/inc/class.uiwo_hour.inc.php
===================================================================
--- trunk/property/inc/class.uiwo_hour.inc.php  2014-11-27 13:53:24 UTC (rev 
12383)
+++ trunk/property/inc/class.uiwo_hour.inc.php  2014-11-27 13:54:18 UTC (rev 
12384)
@@ -1362,6 +1362,12 @@
                                $sms_data['status_code_text'] = lang('status 
code');
                                $sms_data['example'] = 'status ' . 
$workorder_id . ' 1';
                                $sms_data['lang_example'] = lang('Example');
+
+                               phpgw::import_class('phpgwapi.phpqrcode');
+                               $code_text = 
"SMSTO:{$config_sms->config_data['common']['gateway_number']}: STATUS 
{$workorder_id} ";
+                               $filename = 
$GLOBALS['phpgw_info']['server']['temp_dir'].'/'.md5($code_text).'.png';
+                               QRcode::png($code_text,$filename);
+                               $sms_data['encoded_text'] = 
'data:image/png;base64,' . base64_encode(file_get_contents($filename));
                        }
 
                        $action_params = array
@@ -2119,6 +2125,35 @@
                                        ));
                        }
 
+                       $sms_location_id = 
$GLOBALS['phpgw']->locations->get_id('sms', 'run');
+                       $config_sms     = 
CreateObject('admin.soconfig',$sms_location_id);
+                       phpgw::import_class('phpgwapi.phpqrcode');
+                       $code_text = 
"SMSTO:{$config_sms->config_data['common']['gateway_number']}: STATUS 
{$workorder_id} ";
+                       $filename = 
$GLOBALS['phpgw_info']['server']['temp_dir'].'/'.md5($code_text).'.png';
+                       QRcode::png($code_text,$filename);
+                       $pdf->ezSetDy(-20);
+                       $pdf->ezImage($filename,$pad = 0,$width = 0,$resize = 
'',$just = 'left',$border = '');
+                       $pdf->ezText(lang('status code') .': 1 => ' . 
lang('performed'). ', 2 => ' . lang('No access') . ', 3 => I arbeid',10);
+
+               /* TODO: Library has to be 
updated..http://sourceforge.net/projects/pdf-php/?source=directory
+                       $data = array(
+                               array('col1'=>"<C:showimage:{$filename} 90>"),
+                               array('col1'=>'','col2'=>lang('status code') 
.': 1 => ' . lang('performed'). ', 2 => ' . lang('No access') . ', 3 => I 
arbeid')
+                       );
+
+
+                               
$pdf->ezTable($data,array('col1'=>'','col2'=>''),''
+                               ,array('showHeadings'=>0,'shaded'=>0,'xPos'=>0
+                               
,'xOrientation'=>'right','width'=>500,'showLines'=> 2
+                               ,'cols'=>array
+                               (
+                                       
'col1'=>array('justification'=>'right','width'=>250, 'justification'=>'left'),
+                                       
'col2'=>array('justification'=>'right','width'=>250, 'justification'=>'left'),
+                               )
+
+                       ));
+*/
+
                        
if(isset($this->config->config_data['order_footer_header']) && 
$this->config->config_data['order_footer_header'])
                        {
                                if(!$content)

Modified: trunk/property/templates/base/wo_hour.xsl
===================================================================
--- trunk/property/templates/base/wo_hour.xsl   2014-11-27 13:53:24 UTC (rev 
12383)
+++ trunk/property/templates/base/wo_hour.xsl   2014-11-27 13:54:18 UTC (rev 
12384)
@@ -2689,6 +2689,12 @@
                                <xsl:value-of select="example"/>
                        </td>
                </tr>
+               <tr>
+                       <td>
+                               <img src="{encoded_text}"/>
+                       </td>
+               </tr>
+
        </xsl:template>
 
        <!-- New template-->




reply via email to

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