fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8286] property: more on notification


From: Sigurd Nes
Subject: [Fmsystem-commits] [8286] property: more on notification
Date: Tue, 13 Dec 2011 21:41:54 +0000

Revision: 8286
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8286
Author:   sigurdne
Date:     2011-12-13 21:41:53 +0000 (Tue, 13 Dec 2011)
Log Message:
-----------
property: more on notification

Modified Paths:
--------------
    trunk/property/inc/class.uilookup.inc.php
    trunk/property/inc/class.uiproject.inc.php
    trunk/property/js/yahoo/project.edit.js
    trunk/property/templates/base/project.xsl

Modified: trunk/property/inc/class.uilookup.inc.php
===================================================================
--- trunk/property/inc/class.uilookup.inc.php   2011-12-13 14:19:10 UTC (rev 
8285)
+++ trunk/property/inc/class.uilookup.inc.php   2011-12-13 21:41:53 UTC (rev 
8286)
@@ -291,6 +291,10 @@
 
                        $function_exchange_values .= 
'opener.document.getElementsByName("'.$contact_id.'")[0].value = 
data.getData("contact_id");' ."\r\n";
                        $function_exchange_values .= 
'opener.document.getElementsByName("'.$contact_name.'")[0].value = 
data.getData("contact_name");' ."\r\n";
+                       //trigger ajax-call
+                       $function_exchange_values .= 
"opener.document.getElementsByName('{$contact_id}')[0].setAttribute('{$contact_id}','{$contact_id}',0);\r\n";
+                       //Reset - waiting for next change
+                       $function_exchange_values .= 
"opener.document.getElementsByName('{$contact_id}')[0].removeAttribute('{$contact_id}');\r\n";
 
                        $function_exchange_values .= 'window.close()';
 

Modified: trunk/property/inc/class.uiproject.inc.php
===================================================================
--- trunk/property/inc/class.uiproject.inc.php  2011-12-13 14:19:10 UTC (rev 
8285)
+++ trunk/property/inc/class.uiproject.inc.php  2011-12-13 21:41:53 UTC (rev 
8286)
@@ -57,7 +57,8 @@
                                'edit'                  => true,
                                'delete'                => true,
                                'date_search'   => true,
-                               'columns'               => true
+                               'columns'               => true,
+                               'update_data'   => true,
                        );
 
                function property_uiproject()
@@ -1650,8 +1651,38 @@
                                                                                
                                array('key' => 
'budsjettsigndato','label'=>lang('budsjettsigndato'),'sortable'=>false,'resizeable'=>true),
                                                                                
                                array('key' => 
'transfer_time','label'=>lang('transfer 
time'),'sortable'=>false,'resizeable'=>true),
                                                                                
                                ))
+
                                );
 
+                       
+                       $content_notify = array();
+                       $datavalues[3] = array
+                               (
+                                       'name'                                  
=> "3",
+                                       'values'                                
=> json_encode($content_notify),
+                                       'total_records'                 => 
count($content_notify),
+                                       'edit_action'                   => 
json_encode($GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvoice.index'))),
+                                       'is_paginator'                  => 1,
+                                       'footer'                                
=> 0
+                               );
+
+                       $myColumnDefs[3] = array
+                               (
+                                       'name'          => "3",
+                                       'values'        =>      
json_encode(array(      array('key' => 
'workorder_id','label'=>lang('Workorder'),'sortable'=>true,'resizeable'=>true),
+                                                                               
                                array('key' => 
'voucher_id','label'=>lang('bilagsnr'),'sortable'=>false,'resizeable'=>true,'formatter'=>'YAHOO.widget.DataTable.formatLink_voucher'),
+                                                                               
                                array('key' => 
'invoice_id','label'=>lang('invoice 
number'),'sortable'=>false,'resizeable'=>true),
+                                                                               
                                array('key' => 
'vendor','label'=>lang('vendor'),'sortable'=>false,'resizeable'=>true),
+                                                                               
                                array('key' => 
'amount','label'=>lang('amount'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterRight'),
+                                                                               
                                array('key' => 
'approved_amount','label'=>lang('approved 
amount'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterRight'),
+                                                                               
                                array('key' => 
'currency','label'=>lang('currency'),'sortable'=>false,'resizeable'=>true),
+                                                                               
                                array('key' => 
'budget_responsible','label'=>lang('budget 
responsible'),'sortable'=>false,'resizeable'=>true),
+                                                                               
                                array('key' => 
'budsjettsigndato','label'=>lang('budsjettsigndato'),'sortable'=>false,'resizeable'=>true),
+                                                                               
                                array('key' => 
'transfer_time','label'=>lang('transfer 
time'),'sortable'=>false,'resizeable'=>true),
+                                                                               
                                ))
+
+                               );
+
                        
//----------------------------------------------datatable settings--------
 
 
@@ -1790,7 +1821,8 @@
                                        'lang_ask_approval_statustext'          
=> lang('Check this to send a mail to your supervisor for approval'),
                                        'value_approval_mail_address'           
=> $supervisor_email,
 
-                                       'currency'                              
                        => 
$GLOBALS['phpgw_info']['user']['preferences']['common']['currency']
+                                       'currency'                              
                        => 
$GLOBALS['phpgw_info']['user']['preferences']['common']['currency'],
+                                       'base_java_url'                         
        => "{menuaction:'property.uiproject.update_data',id:{$id}}",
                                );
                        //_debug_array($data);die;
 
@@ -2111,4 +2143,66 @@
 
                        return  phpgwapi_yui::tabview_generate($tabs, 
'general');
                }
+
+               function update_data()
+               {
+                       $action = phpgw::get_var('action', 'string', 'GET');
+                       switch($action)
+                       {
+                               case 'refresh_notify_contact':
+                                       return $this->refresh_notify_contact();
+                                       break;
+                               default:
+                       }
+               }
+
+               function refresh_notify_contact()
+               {
+                       $id     = phpgw::get_var('id', 'int');
+
+                       if( !$this->acl_read)
+                       {
+                               return;
+                       }
+
+//FIXME
+                       $link_file_data = array
+                       (
+                               'menuaction'    => 'property.uitts.view_file',
+                               'id'                    => $id
+                       );
+
+                       $link_to_files = 
isset($this->bo->config->config_data['files_url']) ? 
$this->bo->config->config_data['files_url']:'';
+
+                       $link_view_file = 
$GLOBALS['phpgw']->link('/index.php',$link_file_data);
+                       $values = $this->bo->read_single($id);
+
+                       $content_files = array();
+
+                       foreach($values['files'] as $_entry )
+                       {
+                               $content_files[] = array
+                               (
+                                       'file_name' => '<a 
href="'.$link_view_file.'&amp;file_name='.$_entry['name'].'" target="_blank" 
title="'.lang('click to view file').'">'.$_entry['name'].'</a>',
+                                       'delete_file' => '<input 
type="checkbox" name="values[file_action][]" value="'.$_entry['name'].'" 
title="'.lang('Check to delete file').'">',
+                                       'attach_file' => '<input 
type="checkbox" name="values[file_attach][]" value="'.$_entry['name'].'" 
title="'.lang('Check to attach file').'">'
+                               );
+                       }                                                       
+
+                       if( phpgw::get_var('phpgw_return_as') == 'json' )
+                       {
+
+                               if(count($content_files))
+                               {
+                                       return json_encode($content_files);
+                               }
+                               else
+                               {
+                                       return "";
+                               }
+                       }
+                       return $content_files;
+               }
+
+
        }

Modified: trunk/property/js/yahoo/project.edit.js
===================================================================
--- trunk/property/js/yahoo/project.edit.js     2011-12-13 14:19:10 UTC (rev 
8285)
+++ trunk/property/js/yahoo/project.edit.js     2011-12-13 21:41:53 UTC (rev 
8286)
@@ -1,6 +1,9 @@
 var  myPaginator_0, myDataTable_0
 var  myPaginator_1, myDataTable_1;
 var  myPaginator_2, myDataTable_2;
+var  myPaginator_3, myDataTable_3;
+var d;
+var notify_contact = 0;
 
 
/********************************************************************************/
        YAHOO.widget.DataTable.formatLink = function(elCell, oRecord, oColumn, 
oData)
@@ -106,14 +109,11 @@
 
        this.notify_contact_lookup = function()
        {
-               //self.name ="first_Window";
                var oArgs = 
{menuaction:'property.uilookup.addressbook',column:'notify_contact'};
                var strURL = phpGWLink('index.php', oArgs);
                
Window1=window.open(strURL,"Search","left=50,top=100,width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");
        }               
 
-
-
        this.refresh_notify_contact=function()
        {
                if(document.getElementById('notify_contact').value)
@@ -124,8 +124,7 @@
                if(document.getElementById('notify_contact').value != 
notify_contact)
                {
                        base_java_url['action'] = 'refresh_notify_contact';
-alert('refresh_notify_contact');
-//                     execute_async(myDataTable_3);
+                       execute_async(myDataTable_3);
                        notify_contact = 
document.getElementById('notify_contact').value;
                }
        }
@@ -133,19 +132,14 @@
 
        this.onDOMAttrModified = function(e)
        {
-alert('refresh_notify_contact');
                var attr = e.attrName || e.propertyName
                var target = e.target || e.srcElement;
                if (attr.toLowerCase() == 'notify_contact')
                {
-
                        refresh_notify_contact();
                }
        }
 
-
-
-
 YAHOO.util.Event.addListener(window, "load", function()
 {
        loader = new YAHOO.util.YUILoader();
@@ -174,5 +168,3 @@
                }
        }
 });
-
-

Modified: trunk/property/templates/base/project.xsl
===================================================================
--- trunk/property/templates/base/project.xsl   2011-12-13 14:19:10 UTC (rev 
8285)
+++ trunk/property/templates/base/project.xsl   2011-12-13 21:41:53 UTC (rev 
8286)
@@ -569,6 +569,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 datatable = new Array();
                                                var myColumnDefs = new Array();
 
@@ -606,13 +607,21 @@
                                                </a>
                                        </td>
                                        <td><table><tr><td>
-                                               <input size="5" type="text" id 
= "notify_contact" name="notify_contact" value="0" 
title="{$lang_contact_statustext}">
+                                               <input size="5" type="text" 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}"/>
                                        </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_3"> </div>
+                                               <div 
id="datatable-container_3"></div>
+                                       </td>
+                               </tr>
+                               <tr>
                                        <td valign="top">
                                                <xsl:value-of 
select="lang_branch"/>
                                        </td>




reply via email to

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