fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8550] property: notify at ticket


From: Sigurd Nes
Subject: [Fmsystem-commits] [8550] property: notify at ticket
Date: Tue, 10 Jan 2012 09:47:58 +0000

Revision: 8550
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8550
Author:   sigurdne
Date:     2012-01-10 09:47:57 +0000 (Tue, 10 Jan 2012)
Log Message:
-----------
property: notify at ticket

Modified Paths:
--------------
    trunk/property/inc/class.botts.inc.php
    trunk/property/inc/class.notify.inc.php
    trunk/property/inc/class.uiproject.inc.php
    trunk/property/inc/class.uitts.inc.php
    trunk/property/inc/class.uiworkorder.inc.php
    trunk/property/js/yahoo/notify.js
    trunk/property/js/yahoo/property2.js
    trunk/property/templates/base/project.xsl
    trunk/property/templates/base/tts.xsl
    trunk/property/templates/base/workorder.xsl

Modified: trunk/property/inc/class.botts.inc.php
===================================================================
--- trunk/property/inc/class.botts.inc.php      2012-01-10 08:19:28 UTC (rev 
8549)
+++ trunk/property/inc/class.botts.inc.php      2012-01-10 09:47:57 UTC (rev 
8550)
@@ -1043,6 +1043,36 @@
                                }
                        }
 
+
+                       $notify_list = execMethod('property.notify.read', array
+                               (
+                                       'location_id'           => 
$GLOBALS['phpgw']->locations->get_id('property', $this->acl_location),
+                                       'location_item_id'      => $id
+                               )
+                       );
+
+                       $sms_text = "{$subject}. 
\r\n{$GLOBALS['phpgw_info']['user']['fullname']} 
\r\n{$GLOBALS['phpgw_info']['user']['preferences']['property']['email']}";
+                       $sms    = CreateObject('sms.sms');
+
+                       foreach($notify_list as $entry)
+                       {
+                               if($entry['is_active'] && 
$entry['notification_method'] == 'email' && $entry['email'])
+                               {
+                                       $toarray[] = "{$entry['first_name']} 
{$entry['last_name']}<{$entry['email']}>";
+                               }
+                               else if($entry['is_active'] && 
$entry['notification_method'] == 'sms' && $entry['sms'])
+                               {
+                                       
$sms->websend2pv($this->account,$entry['sms'],$sms_text);
+                                       $toarray_sms[] = 
"{$entry['first_name']} {$entry['last_name']}({$entry['sms']})";
+                                       
$receipt['message'][]=array('msg'=>lang('%1 is 
notified',"{$entry['first_name']} {$entry['last_name']}"));
+                               }
+                       }
+                       unset($entry);
+                       if($toarray_sms)
+                       {
+                               $this->historylog->add('MS',$id,"{$subject}::" 
. implode(',',$toarray_sms));                                            
+                       }
+
                        if($toarray)
                        {
                                $to = implode(';',$toarray);

Modified: trunk/property/inc/class.notify.inc.php
===================================================================
--- trunk/property/inc/class.notify.inc.php     2012-01-10 08:19:28 UTC (rev 
8549)
+++ trunk/property/inc/class.notify.inc.php     2012-01-10 09:47:57 UTC (rev 
8550)
@@ -186,6 +186,8 @@
 
                        $lang_view = lang('view');
                        $code = <<<JS
+       var  myPaginator_{$count}, myDataTable_{$count};
+       var Button_{$count}_0, Button_{$count}_1, Button_{$count}_2;
        var notify_table_count = {$count};
        var notify_lang_view = "{$lang_view}";
        var notify_lang_alert = "Posten må lagres før kontakter kan tilordnes";
@@ -194,13 +196,13 @@
        {
                if(document.getElementById('notify_contact').value)
                {
-                       base_java_url['contact_id'] = 
document.getElementById('notify_contact').value;
+                       base_java_notify_url['contact_id'] = 
document.getElementById('notify_contact').value;
                }
 
                if(document.getElementById('notify_contact').value != 
notify_contact)
                {
-                       base_java_url['action'] = 'refresh_notify_contact';
-                       execute_async(myDataTable_{$count});
+                       base_java_notify_url['action'] = 
'refresh_notify_contact';
+                       execute_async(myDataTable_{$count}, 
base_java_notify_url);
                        notify_contact = 
document.getElementById('notify_contact').value;
                }
        }
@@ -229,8 +231,8 @@
 
                        formObject = document.body.getElementsByTagName('form');
                        YAHOO.util.Connect.setForm(formObject[0]);//First form
-                       base_java_url['action'] = 'refresh_notify_contact';
-                       execute_async(myDataTable_{$count});
+                       base_java_notify_url['action'] = 
'refresh_notify_contact';
+                       
execute_async(myDataTable_{$count},base_java_notify_url);
                }
        }
 JS;

Modified: trunk/property/inc/class.uiproject.inc.php
===================================================================
--- trunk/property/inc/class.uiproject.inc.php  2012-01-10 08:19:28 UTC (rev 
8549)
+++ trunk/property/inc/class.uiproject.inc.php  2012-01-10 09:47:57 UTC (rev 
8550)
@@ -1878,7 +1878,7 @@
                                        'value_approval_mail_address'           
=> $supervisor_email,
 
                                        'currency'                              
                        => 
$GLOBALS['phpgw_info']['user']['preferences']['common']['currency'],
-                                       'base_java_url'                         
                => 
"{menuaction:'property.notify.update_data',location_id:{$location_id},location_item_id:{$id}}",
+                                       'base_java_notify_url'                  
                        => 
"{menuaction:'property.notify.update_data',location_id:{$location_id},location_item_id:{$id}}",
                                        'edit_action'                           
                => $GLOBALS['phpgw']->link('/index.php',array('menuaction' => 
'property.uiproject.edit', 'id' => $id)),
                                        'lang_edit_statustext'                  
        => lang('Edit this entry '),
                                        'lang_edit'                             
                        => lang('Edit'),

Modified: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php      2012-01-10 08:19:28 UTC (rev 
8549)
+++ trunk/property/inc/class.uitts.inc.php      2012-01-10 09:47:57 UTC (rev 
8550)
@@ -2988,6 +2988,7 @@
                                        'values'                                
=> json_encode($additional_notes),
                                        'total_records'                 => 
count($additional_notes),
                                        'is_paginator'                  => 0,
+                                       'edit_action'                   => "''",
                                        'footer'                                
=> 0
                                );                                      
                        $myColumnDefs[0] = array
@@ -3001,6 +3002,7 @@
                                        'values'                                
=> json_encode($record_history),
                                        'total_records'                 => 
count($record_history),
                                        'is_paginator'                  => 0,
+                                       'edit_action'                   => "''",
                                        'footer'                                
=> 0
                                );                                      
                        $myColumnDefs[1] = array
@@ -3039,6 +3041,7 @@
                                        'total_records'                 => 
count($content_files),
                                        'permission'                    => "''",
                                        'is_paginator'                  => 0,
+                                       'edit_action'                   => "''",
                                        'footer'                                
=> 0
                                );
 
@@ -3077,9 +3080,25 @@
                                        'total_records'                 => 
count($content_email),
                                        'permission'                    => "''",
                                        'is_paginator'                  => 0,
+                                       'edit_action'                   => "''",
                                        'footer'                                
=> 0
                                );
 
+
+                       $location_id    = 
$GLOBALS['phpgw']->locations->get_id('property', $this->acl_location);
+                       $notify_info = 
execMethod('property.notify.get_yui_table_def',array
+                                                               (
+                                                                       
'location_id'           => $location_id,
+                                                                       
'location_item_id'      => $id,
+                                                                       'count' 
                        => count($myColumnDefs)
+                                                               )
+                                                       );
+                       
+                       $datavalues[]   = $notify_info['datavalues'];
+                       $myColumnDefs[] = $notify_info['column_defs'];
+                       $myButtons              = array();
+                       $myButtons[]    = $notify_info['buttons'];
+
                        $_filter_buildingpart = array();
                        $filter_buildingpart = 
isset($this->bo->config->config_data['filter_buildingpart']) ? 
$this->bo->config->config_data['filter_buildingpart'] : array();
                        
@@ -3117,10 +3136,11 @@
                                        'tabs'                                  
                => self::_generate_tabs(true),
                                        'td_count'                              
                => '""',
                                        'base_java_url'                         
        => "{menuaction:'property.uitts.update_data',id:{$id}}",
+                                       'base_java_notify_url'                  
=> 
"{menuaction:'property.notify.update_data',location_id:{$location_id},location_item_id:'{$id}'}",
                                        'property_js'                           
        => 
json_encode($GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property2.js"),
                                        'datatable'                             
                => $datavalues,
                                        'myColumnDefs'                          
        => $myColumnDefs,
-
+                                       'myButtons'                             
                => $myButtons,
                                        'value_origin'                          
        => $ticket['origin'],
                                        'value_target'                          
        => $ticket['target'],
                                        'value_finnish_date'                    
=> $ticket['finnish_date'],
@@ -3486,9 +3506,10 @@
 
 
                        $tabs = array
-                               (
-                                       'general'               => 
array('label' => lang('general'), 'link' => '#general')
-                               );
+                       (
+                               'general'               => array('label' => 
lang('general'), 'link' => '#general'),
+                               'notify'                => array('label' => 
lang('notify'), 'link' => '#notify')
+                       );
 
                        if($history)
                        {

Modified: trunk/property/inc/class.uiworkorder.inc.php
===================================================================
--- trunk/property/inc/class.uiworkorder.inc.php        2012-01-10 08:19:28 UTC 
(rev 8549)
+++ trunk/property/inc/class.uiworkorder.inc.php        2012-01-10 09:47:57 UTC 
(rev 8550)
@@ -1775,7 +1775,7 @@
                                        'lang_upload_file'                      
                        => lang('Upload file'),
                                        'lang_file_statustext'                  
                => lang('Select file to upload'),
                                        'value_billable_hours'                  
                => $values['billable_hours'],
-                                       'base_java_url'                         
                        => 
"{menuaction:'property.notify.update_data',location_id:{$location_id},location_item_id:'{$id}'}",
+                                       'base_java_notify_url'                  
                                => 
"{menuaction:'property.notify.update_data',location_id:{$location_id},location_item_id:'{$id}'}",
                                        'edit_action'                           
                        => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction' => 
'property.uiworkorder.edit', 'id' => $id)),
                                        'lang_edit_statustext'                  
                => lang('Edit this entry '),
                                        'lang_edit'                             
                                => lang('Edit'),

Modified: trunk/property/js/yahoo/notify.js
===================================================================
--- trunk/property/js/yahoo/notify.js   2012-01-10 08:19:28 UTC (rev 8549)
+++ trunk/property/js/yahoo/notify.js   2012-01-10 09:47:57 UTC (rev 8550)
@@ -1,8 +1,6 @@
 var d;
 var notify_contact = 0;
 
-var Button_0_0, Button_0_1, Button_0_2;
-
 
/********************************************************************************/
        this.cleanValuesHiddenActionsButtons=function()
        {
@@ -75,7 +73,7 @@
 
        this.notify_contact_lookup = function()
        {
-               if(!base_java_url['location_item_id'])
+               if(!base_java_notify_url['location_item_id'])
                {
                        alert(notify_lang_alert); // notify_lang_alert is 
defined in php-class property_notify::get_yui_table_def()
                        return;
@@ -90,7 +88,7 @@
        {
        }
 */
-       this.onDOMAttrModified = function(e)
+       this.onDOMAttrModified_notify = function(e)
        {
                var attr = e.attrName || e.propertyName
                var target = e.target || e.srcElement;
@@ -107,11 +105,11 @@
                {
                        if (d.attachEvent)
                        {
-                               d.attachEvent('onpropertychange', 
onDOMAttrModified, false);
+                               d.attachEvent('onpropertychange', 
onDOMAttrModified_notify, false);
                        }
                        else
                        {
-                               d.addEventListener('DOMAttrModified', 
onDOMAttrModified, false);
+                               d.addEventListener('DOMAttrModified', 
onDOMAttrModified_notify, false);
                        }
                }
        });

Modified: trunk/property/js/yahoo/property2.js
===================================================================
--- trunk/property/js/yahoo/property2.js        2012-01-10 08:19:28 UTC (rev 
8549)
+++ trunk/property/js/yahoo/property2.js        2012-01-10 09:47:57 UTC (rev 
8550)
@@ -527,8 +527,12 @@
        }
 
/********************************************************************************/
 
-       this.execute_async = function(datatable)
+       this.execute_async = function(datatable, incoming_url)
        {
+               if(incoming_url !='undfined')
+               {
+                       base_java_url = incoming_url;
+               }
                try     {
                                ds = phpGWLink('index.php',base_java_url,true);
                                //ds = url;

Modified: trunk/property/templates/base/project.xsl
===================================================================
--- trunk/property/templates/base/project.xsl   2012-01-10 08:19:28 UTC (rev 
8549)
+++ trunk/property/templates/base/project.xsl   2012-01-10 09:47:57 UTC (rev 
8550)
@@ -434,7 +434,7 @@
                                                <!--  DATATABLE DEFINITIONS-->
                                                <script type="text/javascript">
                                                        var property_js = 
<xsl:value-of select="property_js"/>;
-                                                       var base_java_url = 
<xsl:value-of select="base_java_url"/>;
+                                                       var 
base_java_notify_url = <xsl:value-of select="base_java_notify_url"/>;
                                                        var datatable = new 
Array();
                                                        var myColumnDefs = new 
Array();
                                                        var myButtons = new 
Array();
@@ -476,7 +476,7 @@
                                                                                
        <td>
                                                                                
                <input type="hidden" id="notify_contact" name="notify_contact" 
value="" title="{$lang_contact_statustext}">
                                                                                
                </input>
-                                                                               
                <input size="30" type="text" name="notify_contact_name" 
value="" onClick="notify_contact_lookup();" readonly="readonly" 
title="{$lang_contact_statustext}"/>
+                                                                               
                <input type="hidden" name="notify_contact_name" value="" 
onClick="notify_contact_lookup();" readonly="readonly" 
title="{$lang_contact_statustext}"/>
                                                                                
        </td>
                                                                                
</tr>
                                                                        </table>

Modified: trunk/property/templates/base/tts.xsl
===================================================================
--- trunk/property/templates/base/tts.xsl       2012-01-10 08:19:28 UTC (rev 
8549)
+++ trunk/property/templates/base/tts.xsl       2012-01-10 09:47:57 UTC (rev 
8550)
@@ -1402,6 +1402,41 @@
                                                        </xsl:choose>
                                                </table>
                                        </div>
+                                       <div id="notify">
+                                               <table cellpadding="2" 
cellspacing="2" width="80%" align="center">
+                                                       <xsl:variable 
name="lang_contact_statustext">
+                                                               <xsl:value-of 
select="php:function('lang', 'click this link to select')"/>
+                                                       </xsl:variable>
+                                                       <tr>
+                                                               <td 
valign="top">
+                                                                       <a 
href="javascript:notify_contact_lookup()" title="{$lang_contact_statustext}">
+                                                                               
<xsl:value-of select="php:function('lang', 'contact')"/>
+                                                                       </a>
+                                                               </td>
+                                                               <td>
+                                                                       <table>
+                                                                               
<tr>
+                                                                               
        <td>
+                                                                               
                <input type="hidden" id="notify_contact" name="notify_contact" 
value="" title="{$lang_contact_statustext}">
+                                                                               
                </input>
+                                                                               
                <input type="hidden" name="notify_contact_name" value="" 
onClick="notify_contact_lookup();" readonly="readonly" 
title="{$lang_contact_statustext}"/>
+                                                                               
        </td>
+                                                                               
</tr>
+                                                                       </table>
+                                                               </td>
+                                                       </tr>
+                                                       <tr>
+                                                               <td 
valign="top" class="th_text">
+                                                                       
<xsl:value-of select="php:function('lang', 'notify')"/>
+                                                               </td>
+                                                               <td>
+                                                                       <div 
id="paging_4"> </div>
+                                                                       <div 
id="datatable-container_4"/>
+                                                                       <div 
id="datatable-buttons_4"/>
+                                                               </td>
+                                                       </tr>
+                                               </table>
+                                       </div>
                                        <div id="history">
                                                <div id="paging_1"/>
                                                <div 
id="datatable-container_1"/>
@@ -1533,6 +1568,7 @@
                <script type="text/javascript">
                        var property_js = <xsl:value-of select="property_js"/>;
                        var base_java_url = <xsl:value-of 
select="base_java_url"/>;
+                       var base_java_notify_url = <xsl:value-of 
select="base_java_notify_url"/>;
                        var datatable = new Array();
                        var myColumnDefs = new Array();
                        var myButtons = new Array();
@@ -1544,6 +1580,7 @@
                                                values:<xsl:value-of 
select="values"/>,
                                                total_records: <xsl:value-of 
select="total_records"/>,
                                                is_paginator:  <xsl:value-of 
select="is_paginator"/>,
+                                               edit_action:  <xsl:value-of 
select="edit_action"/>,
                                                <!--permission:<xsl:value-of 
select="permission"/>, -->
                                                footer:<xsl:value-of 
select="footer"/>
                                        }

Modified: trunk/property/templates/base/workorder.xsl
===================================================================
--- trunk/property/templates/base/workorder.xsl 2012-01-10 08:19:28 UTC (rev 
8549)
+++ trunk/property/templates/base/workorder.xsl 2012-01-10 09:47:57 UTC (rev 
8550)
@@ -580,7 +580,7 @@
                                                                                
                        <td>
                                                                                
                                <input type="hidden" id="notify_contact" 
name="notify_contact" value="" title="{$lang_contact_statustext}">
                                                                                
                                </input>
-                                                                               
                                <input size="30" type="text" 
name="notify_contact_name" value="" onClick="notify_contact_lookup();" 
readonly="readonly" title="{$lang_contact_statustext}"/>
+                                                                               
                                <input type="hidden" name="notify_contact_name" 
value="" onClick="notify_contact_lookup();" readonly="readonly" 
title="{$lang_contact_statustext}"/>
                                                                                
                        </td>
                                                                                
                </tr>
                                                                                
        </table>
@@ -673,7 +673,7 @@
                                        </xsl:choose>
                                        <script type="text/javascript">
                                                var property_js = <xsl:value-of 
select="property_js"/>;
-                                               var base_java_url = 
<xsl:value-of select="base_java_url"/>;
+                                               var base_java_notify_url = 
<xsl:value-of select="base_java_notify_url"/>;
                                                var datatable = new Array();
                                                var myColumnDefs = new Array();
                                                var myButtons = new Array();




reply via email to

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