fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [12004] property: custom js at ticet


From: Sigurd Nes
Subject: [Fmsystem-commits] [12004] property: custom js at ticet
Date: Wed, 04 Jun 2014 06:50:30 +0000

Revision: 12004
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12004
Author:   sigurdne
Date:     2014-06-04 06:50:29 +0000 (Wed, 04 Jun 2014)
Log Message:
-----------
property: custom js at ticet

Modified Paths:
--------------
    trunk/property/inc/class.uitts.inc.php

Added Paths:
-----------
    trunk/property/inc/custom/default/ticket_NLSH_validate.js

Modified: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php      2014-06-03 13:21:33 UTC (rev 
12003)
+++ trunk/property/inc/class.uitts.inc.php      2014-06-04 06:50:29 UTC (rev 
12004)
@@ -2086,6 +2086,7 @@
                        $function_msg                                   = 
lang('add ticket');
 
                        $GLOBALS['phpgw']->js->validate_file( 'yahoo', 
'tts.add', 'property' );
+                       $this->_insert_custom_js();
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('tts','files','attributes_form'));
                        $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('add' 
=> $data));
@@ -2239,6 +2240,8 @@
                        $appname                                        = 
lang('helpdesk');
                        $function_msg                           = lang('add 
ticket');
 
+                       //$this->_insert_custom_js();
+
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('add2' => $data));
                        //      $GLOBALS['phpgw']->xslttpl->pp();
@@ -3420,6 +3423,7 @@
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/paginator/assets/skins/sam/paginator.css');
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/container/assets/skins/sam/container.css');
                        $GLOBALS['phpgw']->js->validate_file( 'yahoo', 
'tts.view', 'property' );
+                       $this->_insert_custom_js();
                        //-----------------------datatable settings---
 
                        //_debug_array($data);die();
@@ -3979,4 +3983,49 @@
                        }
                }
 
+               /**
+                * 
+                */
+               private function _insert_custom_js()
+               {
+
+                       $criteria = array
+                       (
+                               'appname'       => 'property',
+                               'location'      => $this->acl_location,
+                               'allrows'       => true
+                       );
+
+                       if(! $custom_functions = 
$GLOBALS['phpgw']->custom_functions->find($criteria))
+                       {
+                               return false;
+                       }
+
+                       $js_found = false;
+
+                       foreach ( $custom_functions as $entry )
+                       {
+                               // prevent path traversal
+                               if ( preg_match('/\.\./', $entry['file_name']) )
+                               {
+                                       continue;
+                               }
+
+                               $file = PHPGW_SERVER_ROOT . 
"/property/inc/custom/{$GLOBALS['phpgw_info']['user']['domain']}/{$entry['file_name']}";
+
+                               if ( $entry['active'] && $entry['client_side'] 
&& is_file($file))
+                               {
+                                       
$GLOBALS['phpgw']->js->add_external_file($file);
+                                       $js_found = true;
+                               }
+                       }
+
+                       if($js_found)
+                       {
+                               phpgw::import_class('phpgwapi.jquery');
+                               phpgwapi_jquery::load_widget('core');
+                       }
+
+               }
+
        }

Added: trunk/property/inc/custom/default/ticket_NLSH_validate.js
===================================================================
--- trunk/property/inc/custom/default/ticket_NLSH_validate.js                   
        (rev 0)
+++ trunk/property/inc/custom/default/ticket_NLSH_validate.js   2014-06-04 
06:50:29 UTC (rev 12004)
@@ -0,0 +1,4 @@
+
+$(document).ready(function(){
+alert('test');
+});




reply via email to

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