phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property inc/class.bocommon.inc.php inc/class.u...


From: Sigurd Nes
Subject: [Phpgroupware-cvs] property inc/class.bocommon.inc.php inc/class.u...
Date: Fri, 05 Jan 2007 14:33:36 +0000

CVSROOT:        /sources/phpgroupware
Module name:    property
Changes by:     Sigurd Nes <sigurdne>   07/01/05 14:33:36

Modified files:
        inc            : class.bocommon.inc.php class.uiXport.inc.php 
                         class.uidocument.inc.php 
                         class.uiinvestment.inc.php 
                         class.uiinvoice.inc.php 
                         class.uipricebook.inc.php 
        templates/base : document.xsl investment.xsl invoice.xsl 
                         pricebook.xsl 

Log message:
        jscalendar

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.bocommon.inc.php?cvsroot=phpgroupware&r1=1.57&r2=1.58
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.uiXport.inc.php?cvsroot=phpgroupware&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.uidocument.inc.php?cvsroot=phpgroupware&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.uiinvestment.inc.php?cvsroot=phpgroupware&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.uiinvoice.inc.php?cvsroot=phpgroupware&r1=1.46&r2=1.47
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.uipricebook.inc.php?cvsroot=phpgroupware&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/property/templates/base/document.xsl?cvsroot=phpgroupware&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/property/templates/base/investment.xsl?cvsroot=phpgroupware&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/property/templates/base/invoice.xsl?cvsroot=phpgroupware&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/property/templates/base/pricebook.xsl?cvsroot=phpgroupware&r1=1.3&r2=1.4

Patches:
Index: inc/class.bocommon.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.bocommon.inc.php,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -b -r1.57 -r1.58
--- inc/class.bocommon.inc.php  4 Jan 2007 12:21:02 -0000       1.57
+++ inc/class.bocommon.inc.php  5 Jan 2007 14:33:36 -0000       1.58
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage core
-       * @version $Id: class.bocommon.inc.php,v 1.57 2007/01/04 12:21:02 
sigurdne Exp $
+       * @version $Id: class.bocommon.inc.php,v 1.58 2007/01/05 14:33:36 
sigurdne Exp $
        */
 
        /**
@@ -105,37 +105,6 @@
 
                }
 
-               function jscalendar()
-               {
-                       $phpgw_js_url = 
$GLOBALS['phpgw_info']['server']['webserver_url'].'/phpgwapi/js';
-                       $img = 
$GLOBALS['phpgw']->common->image('phpgwapi','cal');
-
-                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-                       $jsDateFormat = str_replace(array('d', 'm', 'M', 'Y'), 
array('%d', '%m', '%b', '%Y'), $dateformat);
-                       
-                       $java_script ='</script>
-                       <link rel="stylesheet" type="text/css" media="all" 
href="'.$phpgw_js_url.'/jscalendar/calendar-win2k-cold-1.css" 
title="win2k-cold-1" >
-                       <script type="text/javascript" 
src="'.$phpgw_js_url.'/jscalendar/calendar.js"></script>
-                       <script type="text/javascript" 
src="'.$phpgw_js_url.'/jscalendar/calendar-setup.js"></script>
-                       <script type="text/javascript" 
src="'.$phpgw_js_url.'/jscalendar/lang/calendar-'.substr($GLOBALS['phpgw_info']['user']['preferences']['common']['lang'],0,2)
 .'.js"></script>
-                       ';
-                       
-                       
if(isset($GLOBALS['phpgw_info']['flags']['java_script']))
-                       {
-                               $GLOBALS['phpgw_info']['flags']['java_script'] 
.= $java_script;
-                       }
-                       else
-                       {
-                               $GLOBALS['phpgw_info']['flags']['java_script'] 
= $java_script;
-                       }
-
-                       $cal_info=array(
-                               'jsDateFormat'          => $jsDateFormat,
-                               'img'                   => $img,
-                               );
-                       return $cal_info;
-               }
-
                function check_perms($rights, $required)
                {
                        return ($rights & $required);

Index: inc/class.uiXport.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.uiXport.inc.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- inc/class.uiXport.inc.php   27 Dec 2006 10:37:59 -0000      1.20
+++ inc/class.uiXport.inc.php   5 Jan 2007 14:33:36 -0000       1.21
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: class.uiXport.inc.php,v 1.20 2006/12/27 10:37:59 
sigurdne Exp $
+       * @version $Id: class.uiXport.inc.php,v 1.21 2007/01/05 14:33:36 
sigurdne Exp $
        */
 
        /**
@@ -265,19 +265,17 @@
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
-                       $cal_info       = $this->bocommon->jscalendar();
-                       $jsDateFormat=$cal_info['jsDateFormat'];
+                       $jscal = CreateObject('phpgwapi.jscalendar');
+                       $jscal->add_listener('invoice_date');
+                       $jscal->add_listener('payment_date');
 
                        $data = array
                        (
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'links'                                         
=> $links,
 
-                               'jsDateFormat'                                  
=> $jsDateFormat,
-                               'date_img'                                      
=> $cal_info['img'],
+                               'img_cal'                                       
        => $GLOBALS['phpgw']->common->image('phpgwapi','cal'),
                                'lang_datetitle'                                
=> lang('Select date'),
-                               'calendar_setup_invoice'                        
=> "Calendar.setup({inputField  : 'invoice_date',ifFormat  : '" . $jsDateFormat 
. "',button : 'invoice_date-trigger'});",
-                               'calendar_setup_payment'                        
=> "Calendar.setup({inputField  : 'payment_date',ifFormat  : '" . $jsDateFormat 
. "',button : 'payment_date-trigger'});",
 
                                'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
                                'cancel_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvoice.index', 'sub'=> $sub)),
@@ -374,8 +372,6 @@
                                'lang_budget_responsible_statustext'            
=> lang('You have to select a budget responsible for this invoice in order to 
make the import')
                        );
 
-//_debug_array($data);
-
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('invoice','menu'));
 
                        $appname        = lang('Invoice');
@@ -641,8 +637,8 @@
                        $dateformat= (implode($sep,$dlarr));
 
 //_debug_array($receipt);
-                       $cal_info       = $this->bocommon->jscalendar();
-                       $jsDateFormat=$cal_info['jsDateFormat'];
+                       $jscal = CreateObject('phpgwapi.jscalendar');
+                       $jscal->add_listener('date');
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
@@ -651,8 +647,7 @@
                                'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'links'                                 => 
$links,
 
-                               'jsDateFormat'                          => 
$jsDateFormat,
-                               'date_img'                              => 
$cal_info['img'],
+                               'img_cal'                                       
=> $GLOBALS['phpgw']->common->image('phpgwapi','cal'),
                                'lang_datetitle'                        => 
lang('Select date'),
                                'calendar_setup'                        => 
"Calendar.setup({inputField  : 'date',ifFormat  : '" . $jsDateFormat . 
"',button : 'date-trigger'});",
 

Index: inc/class.uidocument.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.uidocument.inc.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- inc/class.uidocument.inc.php        27 Dec 2006 10:37:59 -0000      1.18
+++ inc/class.uidocument.inc.php        5 Jan 2007 14:33:36 -0000       1.19
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage document
-       * @version $Id: class.uidocument.inc.php,v 1.18 2006/12/27 10:37:59 
sigurdne Exp $
+       * @version $Id: class.uidocument.inc.php,v 1.19 2007/01/05 14:33:36 
sigurdne Exp $
        */
 
        /**
@@ -753,7 +753,6 @@
 
                        if ($values['save'])
                        {
-                               $values['document_date']        = 
get_var('document_date',array('POST'));
                                $values['vendor_id']            = 
get_var('vendor_id',array('POST'));
 
                                if(!$values['link'])
@@ -900,19 +899,10 @@
                                'cat_id'        => $this->cat_id,
                        );
 
-                       $dateformat = 
strtolower($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
-                       $sep = '/';
-                       $dlarr[strpos($dateformat,'y')] = 'yyyy';
-                       $dlarr[strpos($dateformat,'m')] = 'MM';
-                       $dlarr[strpos($dateformat,'d')] = 'DD';
-                       ksort($dlarr);
-
-                       $dateformat= (implode($sep,$dlarr));
-
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
-                       $cal_info       = $this->bocommon->jscalendar();
-                       $jsDateFormat=$cal_info['jsDateFormat'];
+                       $jscal = CreateObject('phpgwapi.jscalendar');
+                       $jscal->add_listener('values_document_date');
 
                        $data = array
                        (
@@ -923,10 +913,8 @@
                                'lang_history'                                  
=> lang('History'),
                                'lang_no_history'                               
=> lang('No history'),
 
-                               'jsDateFormat'                                  
=> $jsDateFormat,
-                               'date_img'                                      
=> $cal_info['img'],
+                               'img_cal'                                       
=> $GLOBALS['phpgw']->common->image('phpgwapi','cal'),
                                'lang_datetitle'                                
=> lang('Select date'),
-                               'calendar_setup'                                
=> "Calendar.setup({inputField  : 'document_date',ifFormat  : '" . 
$jsDateFormat . "',button : 'document_date-trigger'});",
 
                                'lang_document_date_statustext'                 
=> lang('Select date the document was created'),
                                'lang_document_date'                            
=> lang('document date'),

Index: inc/class.uiinvestment.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.uiinvestment.inc.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- inc/class.uiinvestment.inc.php      4 Jan 2007 12:04:02 -0000       1.18
+++ inc/class.uiinvestment.inc.php      5 Jan 2007 14:33:36 -0000       1.19
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage eco
-       * @version $Id: class.uiinvestment.inc.php,v 1.18 2007/01/04 12:04:02 
sigurdne Exp $
+       * @version $Id: class.uiinvestment.inc.php,v 1.19 2007/01/05 14:33:36 
sigurdne Exp $
        */
 
        /**
@@ -95,7 +95,7 @@
                        $links = $this->menu->links('investment');
                        $preserve       = 
get_var('preserve',array('POST','GET'));
                        $values         = get_var('values',array('POST'));
-                       $date           = get_var('date',array('POST'));
+
 
                        if($preserve)
                        {
@@ -111,11 +111,6 @@
                                $this->allrows                  = 
$this->bo->allrows;
                        }
 
-                       if($date)
-                       {
-                               $values['date'] = $date;
-                       }
-
                        if($values)
                        {
                                $receipt=$this->update_investment($values);
@@ -182,16 +177,13 @@
                                'lang_select'                   => 
lang('Select')
                        );
 
-
-                       $cal_info       = $this->bocommon->jscalendar();
-                       $jsDateFormat=$cal_info['jsDateFormat'];
+                       $jscal = CreateObject('phpgwapi.jscalendar');
+                       $jscal->add_listener('values_date');
 
                        $table_update[] = array
                        (
-                               'jsDateFormat'                  => 
$jsDateFormat,
-                               'date_img'                      => 
$cal_info['img'],
+                               'img_cal'                                       
=> $GLOBALS['phpgw']->common->image('phpgwapi','cal'),
                                'lang_datetitle'                => lang('Select 
date'),
-                               'calendar_setup'                => 
"Calendar.setup({inputField  : 'date',ifFormat  : '" . $jsDateFormat . 
"',button : 'date-trigger'});",
 
                                'lang_new_index'                => lang('New 
index'),
                                'lang_new_index_statustext'     => lang('Enter 
a new index'),
@@ -319,15 +311,10 @@
 
                        $links = $this->menu->links();
                        $values         = get_var('values',array('POST'));
-                       $date           = get_var('date',array('POST','GET'));
                        $entity_type    = 
get_var('entity_type',array('POST','GET'));
                        $entity_id      = 
get_var('entity_id',array('POST','GET'));
                        $investment_id  = 
get_var('investment_id',array('POST','GET'));
 
-                       if($date)
-                       {
-                               $values['date'] = $date;
-                       }
 //_debug_array($values);
 
                        if($values)
@@ -382,18 +369,16 @@
                        );
 
 
-                       $cal_info       = $this->bocommon->jscalendar();
-                       $jsDateFormat=$cal_info['jsDateFormat'];
+                       $jscal = CreateObject('phpgwapi.jscalendar');
+                       $jscal->add_listener('values_date');
 
                        $table_update[] = array
                        (
                                'lang_new_index'                => lang('New 
index'),
                                'lang_new_index_statustext'     => lang('Enter 
a new index'),
 
-                               'jsDateFormat'                  => 
$jsDateFormat,
-                               'date_img'                      => 
$cal_info['img'],
+                               'img_cal'                                       
=> $GLOBALS['phpgw']->common->image('phpgwapi','cal'),
                                'lang_datetitle'                => lang('Select 
date'),
-                               'calendar_setup'                => 
"Calendar.setup({inputField  : 'date',ifFormat  : '" . $jsDateFormat . 
"',button : 'date-trigger'});",
 
                                'lang_date_statustext'          => lang('Select 
the date for the update'),
                                'lang_update'                   => 
lang('Update'),
@@ -478,7 +463,6 @@
                                
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>2, 'acl_location'=> 
$this->acl_location));
                        }
                        $values                                 = 
get_var('values',array('POST'));
-                       $values['date']                 = 
get_var('date',array('POST'));
 
                        $insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp);
                        $insert_record_entity = 
$GLOBALS['phpgw']->session->appsession('insert_record_entity',$this->currentapp);
@@ -578,21 +562,19 @@
                                'menuaction'    => 
$this->currentapp.'.uiinvestment.add'
                        );
 
-
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
-                       $cal_info       = $this->bocommon->jscalendar();
-                       $jsDateFormat=$cal_info['jsDateFormat'];
+                       $jscal = CreateObject('phpgwapi.jscalendar');
+                       $jscal->add_listener('values_date');
 
                        $data = array
                        (
                                'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'location_data'                         => 
$location_data,
 
-                               'jsDateFormat'                          => 
$jsDateFormat,
-                               'date_img'                              => 
$cal_info['img'],
+
+                               'img_cal'                                       
=> $GLOBALS['phpgw']->common->image('phpgwapi','cal'),
                                'lang_datetitle'                        => 
lang('Select date'),
-                               'calendar_setup'                        => 
"Calendar.setup({inputField  : 'date',ifFormat  : '" . $jsDateFormat . 
"',button : 'date-trigger'});",
 
                                'lang_date_statustext'                  => 
lang('insert the date for the initial value'),
 

Index: inc/class.uiinvoice.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.uiinvoice.inc.php,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -b -r1.46 -r1.47
--- inc/class.uiinvoice.inc.php 4 Jan 2007 12:04:02 -0000       1.46
+++ inc/class.uiinvoice.inc.php 5 Jan 2007 14:33:36 -0000       1.47
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage eco
-       * @version $Id: class.uiinvoice.inc.php,v 1.46 2007/01/04 12:04:02 
sigurdne Exp $
+       * @version $Id: class.uiinvoice.inc.php,v 1.47 2007/01/05 14:33:36 
sigurdne Exp $
        */
 
        /**
@@ -424,8 +424,9 @@
                        $appname        = lang('invoice');
                        $function_msg   = lang('list voucher');
 
-                       $cal_info       = $this->bocommon->jscalendar();
-                       $jsDateFormat=$cal_info['jsDateFormat'];
+                       $jscal = CreateObject('phpgwapi.jscalendar');
+                       $jscal->add_listener('start_date');
+                       $jscal->add_listener('end_date');
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
 
@@ -440,11 +441,8 @@
                                $data['end_date']                               
                = $end_date;
                                $data['vendor_id']                              
                = $vendor_id;
 
-                               $data['jsDateFormat']                           
        = $jsDateFormat;
-                               $data['date_img']                               
                = $cal_info['img'];
+                               $data['img_cal']                                
                = $GLOBALS['phpgw']->common->image('phpgwapi','cal');
                                $data['lang_datetitle']                         
        = lang('Select date');
-                               $data['calendar_setup_start']                   
= "Calendar.setup({inputField  : 'start_date',ifFormat  : '" . $jsDateFormat . 
"',button : 'start_date-trigger'});";
-                               $data['calendar_setup_end']                     
        = "Calendar.setup({inputField  : 'end_date',ifFormat  : '" . 
$jsDateFormat . "',button : 'end_date-trigger'});";
 
                                $data['lang_workorder']                         
        = lang('Workorder ID');
                                $data['lang_workorder_statustext']              
= lang('enter the Workorder ID to search by workorder - at any date');
@@ -900,7 +898,6 @@
                        $data['query']                                  = 
$this->query;
                        $data['form_action']                            = 
$GLOBALS['phpgw']->link('/index.php',$link_data);
 
-
                        $data['district_list']                          = 
$this->bocommon->select_district_list('select',$district_id);
                        $data['cat_list']                               = 
$this->bo->select_category('select',$this->cat_id);
                        $data['start_date']                             = 
$start_date;
@@ -913,14 +910,12 @@
                        $data['lang_account_class_statustext']          = 
lang('Select the account class the selection belongs to');
                        $data['select_account_class_name']              = 
'b_account_class';
 
-                       $cal_info                                       = 
$this->bocommon->jscalendar();
-                       $jsDateFormat                                   = 
$cal_info['jsDateFormat'];
+                       $jscal = CreateObject('phpgwapi.jscalendar');
+                       $jscal->add_listener('start_date');
+                       $jscal->add_listener('end_date');
 
-                       $data['jsDateFormat']                           = 
$jsDateFormat;
-                       $data['date_img']                               = 
$cal_info['img'];
+                       $data['img_cal']                                        
        = $GLOBALS['phpgw']->common->image('phpgwapi','cal');
                        $data['lang_datetitle']                         = 
lang('Select date');
-                       $data['calendar_setup_start']                   = 
"Calendar.setup({inputField  : 'start_date',ifFormat  : '" . $jsDateFormat . 
"',button : 'start_date-trigger'});";
-                       $data['calendar_setup_end']                     = 
"Calendar.setup({inputField  : 'end_date',ifFormat  : '" . $jsDateFormat . 
"',button : 'end_date-trigger'});";
 
                        $data['lang_workorder']                         = 
lang('Workorder ID');
                        $data['lang_workorder_statustext']              = 
lang('enter the Workorder ID to search by workorder - at any date');
@@ -1225,19 +1220,17 @@
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
-                       $cal_info       = $this->bocommon->jscalendar();
-                       $jsDateFormat=$cal_info['jsDateFormat'];
+                       $jscal = CreateObject('phpgwapi.jscalendar');
+                       $jscal->add_listener('invoice_date');
+                       $jscal->add_listener('payment_date');
 
                        $data = array
                        (
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'links'                                         
=> $links,
 
-                               'jsDateFormat'                                  
=> $jsDateFormat,
-                               'date_img'                                      
=> $cal_info['img'],
+                               'img_cal'                                       
=> $GLOBALS['phpgw']->common->image('phpgwapi','cal'),
                                'lang_datetitle'                                
=> lang('Select date'),
-                               'calendar_setup_invoice'                        
=> "Calendar.setup({inputField  : 'invoice_date',ifFormat  : '" . $jsDateFormat 
. "',button : 'invoice_date-trigger'});",
-                               'calendar_setup_payment'                        
=> "Calendar.setup({inputField  : 'payment_date',ifFormat  : '" . $jsDateFormat 
. "',button : 'payment_date-trigger'});",
 
                                'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
                                'cancel_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvoice.index')),

Index: inc/class.uipricebook.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.uipricebook.inc.php,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- inc/class.uipricebook.inc.php       4 Jan 2007 12:04:02 -0000       1.23
+++ inc/class.uipricebook.inc.php       5 Jan 2007 14:33:36 -0000       1.24
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage agreement
-       * @version $Id: class.uipricebook.inc.php,v 1.23 2007/01/04 12:04:02 
sigurdne Exp $
+       * @version $Id: class.uipricebook.inc.php,v 1.24 2007/01/05 14:33:36 
sigurdne Exp $
        */
 
        /**
@@ -126,7 +126,6 @@
                        $links = $this->menu->links('price_vendor');
 
                        $values                 = 
get_var('values',array('POST'));
-                       $values['date']         = get_var('date',array('POST'));
 
 //_debug_array($values);
                        if($values['submit_update'])
@@ -216,15 +215,13 @@
 
                        if($this->acl_manage)
                        {
-                               $cal_info       = $this->bocommon->jscalendar();
-                               $jsDateFormat=$cal_info['jsDateFormat'];
+                               $jscal = CreateObject('phpgwapi.jscalendar');
+                               $jscal->add_listener('values_date');
 
                                $table_update[] = array
                                (
-                                       'jsDateFormat'                  => 
$jsDateFormat,
-                                       'date_img'                      => 
$cal_info['img'],
+                                       'img_cal'                               
        => $GLOBALS['phpgw']->common->image('phpgwapi','cal'),
                                        'lang_datetitle'                => 
lang('Select date'),
-                                       'calendar_setup'                => 
"Calendar.setup({inputField  : 'date',ifFormat  : '" . $jsDateFormat . 
"',button : 'date-trigger'});",
                                        'lang_new_index'                => 
lang('New index'),
                                        'lang_new_index_statustext'     => 
lang('Enter a new index'),
                                        'lang_date_statustext'          => 
lang('Select the date for the update'),
@@ -579,8 +576,6 @@
                        $activity_id            = 
get_var('activity_id',array('GET'));
                        $vendor_id              = 
get_var('vendor_id',array('GET'));
                        $values                 = 
get_var('values',array('POST'));
-                       $values['date']         = get_var('date',array('POST'));
-
 
                        $referer        = 
$GLOBALS['phpgw']->session->appsession('referer',$this->currentapp);
                        if(!$referer)
@@ -673,15 +668,13 @@
                                'lang_delete'           => lang('Delete')
                        );
 
-                       $cal_info       = $this->bocommon->jscalendar();
-                       $jsDateFormat=$cal_info['jsDateFormat'];
+                       $jscal = CreateObject('phpgwapi.jscalendar');
+                       $jscal->add_listener('values_date');
 
                        $table_update[] = array
                        (
-                               'jsDateFormat'                          => 
$jsDateFormat,
-                               'date_img'                              => 
$cal_info['img'],
+                               'img_cal'                                       
=> $GLOBALS['phpgw']->common->image('phpgwapi','cal'),
                                'lang_datetitle'                        => 
lang('Select date'),
-                               'calendar_setup'                        => 
"Calendar.setup({inputField  : 'date',ifFormat  : '" . $jsDateFormat . 
"',button : 'date-trigger'});",
                                'lang_new_index'                        => 
lang('New index'),
                                'lang_new_index_statustext'             => 
lang('Enter a new index'),
                                'lang_date_statustext'                  => 
lang('Select the date for the update'),
@@ -691,10 +684,8 @@
 
                        $table_first_entry[] = array
                        (
-                               'jsDateFormat'                          => 
$jsDateFormat,
-                               'date_img'                              => 
$cal_info['img'],
+                               'img_cal'                                       
=> $GLOBALS['phpgw']->common->image('phpgwapi','cal'),
                                'lang_datetitle'                        => 
lang('Select date'),
-                               'calendar_setup'                        => 
"Calendar.setup({inputField  : 'date',ifFormat  : '" . $jsDateFormat . 
"',button : 'date-trigger'});",
                                'lang_m_cost'                           => 
lang('Material cost'),
                                'lang_m_cost_statustext'                => 
lang('Enter a value for the material cost'),
                                'lang_w_cost'                           => 
lang('Labour cost'),

Index: templates/base/document.xsl
===================================================================
RCS file: /sources/phpgroupware/property/templates/base/document.xsl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- templates/base/document.xsl 17 Apr 2006 11:36:05 -0000      1.2
+++ templates/base/document.xsl 5 Jan 2007 14:33:36 -0000       1.3
@@ -1,4 +1,4 @@
-<!-- $Id: document.xsl,v 1.2 2006/04/17 11:36:05 sigurdne Exp $ -->
+<!-- $Id: document.xsl,v 1.3 2007/01/05 14:33:36 sigurdne Exp $ -->
 
        <xsl:template name="app_data">
                <xsl:choose>
@@ -429,18 +429,14 @@
                                        <xsl:value-of 
select="lang_document_date"/>
                                </td>
                                <td>
-                                       <input type="text" id="document_date" 
name="document_date" size="10" value="{value_document_date}" 
readonly="readonly" onMouseout="window.status='';return true;" >
+                                       <input type="text" 
id="values_document_date" name="values[document_date]" size="10" 
value="{value_document_date}" readonly="readonly" 
onMouseout="window.status='';return true;" >
                                                <xsl:attribute 
name="onMouseover">
                                                        
<xsl:text>window.status='</xsl:text>
                                                                <xsl:value-of 
select="lang_document_date_statustext"/>
                                                        <xsl:text>'; return 
true;</xsl:text>
                                                </xsl:attribute>
                                        </input>
-
-                                       <script type="text/javascript">
-                                       document.writeln('<img 
id="document_date-trigger" src="{date_img}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;"/>');
-                                       <xsl:value-of select="calendar_setup"/>
-                                       </script>
+                                       <img id="values_document_date-trigger" 
src="{img_cal}" alt="{lang_datetitle}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;" />
                                </td>
                        </tr>
                        <tr>

Index: templates/base/investment.xsl
===================================================================
RCS file: /sources/phpgroupware/property/templates/base/investment.xsl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- templates/base/investment.xsl       22 Dec 2006 14:43:54 -0000      1.2
+++ templates/base/investment.xsl       5 Jan 2007 14:33:36 -0000       1.3
@@ -1,4 +1,4 @@
-<!-- $Id: investment.xsl,v 1.2 2006/12/22 14:43:54 sigurdne Exp $ -->
+<!-- $Id: investment.xsl,v 1.3 2007/01/05 14:33:36 sigurdne Exp $ -->
 
        <xsl:template name="app_data">
                <xsl:choose>
@@ -240,18 +240,14 @@
                                        </input>
                                </td>
                                <td>
-                                       <input type="text" id="date" 
name="date" size="10" value="{value_date}" readonly="readonly" 
onMouseout="window.status='';return true;" >
+                                       <input type="text" id="values_date" 
name="values[date]" size="10" value="{value_date}" readonly="readonly" 
onMouseout="window.status='';return true;" >
                                                <xsl:attribute 
name="onMouseover">
                                                        
<xsl:text>window.status='</xsl:text>
                                                                <xsl:value-of 
select="lang_date_statustext"/>
                                                        <xsl:text>'; return 
true;</xsl:text>
                                                </xsl:attribute>
                                        </input>
-
-                                       <script type="text/javascript">
-                                       document.writeln('<img 
id="date-trigger" src="{date_img}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;"/>');
-                                       <xsl:value-of select="calendar_setup"/>
-                                       </script>
+                                       <img id="values_date-trigger" 
src="{img_cal}" alt="{lang_datetitle}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;" />
                                </td>
 
                                <td height="50">
@@ -548,18 +544,14 @@
                                        <xsl:value-of select="lang_date"/>
                                </td>
                                <td>
-                                       <input type="text" id="date" 
name="date" size="10" value="{value_date}" readonly="readonly" 
onMouseout="window.status='';return true;" >
+                                       <input type="text" id="values_date" 
name="values[date]" size="10" value="{value_date}" readonly="readonly" 
onMouseout="window.status='';return true;" >
                                                <xsl:attribute 
name="onMouseover">
                                                        
<xsl:text>window.status='</xsl:text>
                                                                <xsl:value-of 
select="lang_date_statustext"/>
                                                        <xsl:text>'; return 
true;</xsl:text>
                                                </xsl:attribute>
                                        </input>
-
-                                       <script type="text/javascript">
-                                       document.writeln('<img 
id="date-trigger" src="{date_img}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;"/>');
-                                       <xsl:value-of select="calendar_setup"/>
-                                       </script>
+                                       <img id="values_date-trigger" 
src="{img_cal}" alt="{lang_datetitle}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;" />
                                </td>
 
                        </tr>

Index: templates/base/invoice.xsl
===================================================================
RCS file: /sources/phpgroupware/property/templates/base/invoice.xsl,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- templates/base/invoice.xsl  3 Jan 2007 10:40:16 -0000       1.22
+++ templates/base/invoice.xsl  5 Jan 2007 14:33:36 -0000       1.23
@@ -1,4 +1,4 @@
-<!-- $Id: invoice.xsl,v 1.22 2007/01/03 10:40:16 sigurdne Exp $ -->
+<!-- $Id: invoice.xsl,v 1.23 2007/01/05 14:33:36 sigurdne Exp $ -->
 
        <xsl:template name="app_data">
                <xsl:choose>
@@ -598,11 +598,7 @@
                                                        <xsl:text>'; return 
true;</xsl:text>
                                                </xsl:attribute>
                                        </input>
-
-                                       <script type="text/javascript">
-                                       document.writeln('<img 
id="start_date-trigger" src="{date_img}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;"/>');
-                                       <xsl:value-of 
select="calendar_setup_start"/>
-                                       </script>
+                                       <img id="start_date-trigger" 
src="{img_cal}" alt="{lang_datetitle}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;" />
                                </td>
                                <td>
                                        <input type="text" id="end_date" 
name="end_date" size="10" value="{end_date}" readonly="readonly" 
onMouseout="window.status='';return true;" >
@@ -612,11 +608,7 @@
                                                        <xsl:text>'; return 
true;</xsl:text>
                                                </xsl:attribute>
                                        </input>
-
-                                       <script type="text/javascript">
-                                       document.writeln('<img 
id="end_date-trigger" src="{date_img}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;"/>');
-                                       <xsl:value-of 
select="calendar_setup_end"/>
-                                       </script>
+                                       <img id="end_date-trigger" 
src="{img_cal}" alt="{lang_datetitle}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;" />
                                </td>
                                <td>
                                        <input type="text" size="8" 
name="workorder_id" value="{workorder_id}" onMouseout="window.status='';return 
true;">
@@ -894,11 +886,7 @@
                                                        <xsl:text>'; return 
true;</xsl:text>
                                                </xsl:attribute>
                                        </input>
-
-                                       <script type="text/javascript">
-                                       document.writeln('<img 
id="start_date-trigger" src="{date_img}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;"/>');
-                                       <xsl:value-of 
select="calendar_setup_start"/>
-                                       </script>
+                                       <img id="start_date-trigger" 
src="{img_cal}" alt="{lang_datetitle}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;" />
                                </td>
                                <td>
                                        <input type="text" id="end_date" 
name="end_date" size="10" value="{end_date}" readonly="readonly" 
onMouseout="window.status='';return true;" >
@@ -908,11 +896,7 @@
                                                        <xsl:text>'; return 
true;</xsl:text>
                                                </xsl:attribute>
                                        </input>
-
-                                       <script type="text/javascript">
-                                       document.writeln('<img 
id="end_date-trigger" src="{date_img}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;"/>');
-                                       <xsl:value-of 
select="calendar_setup_end"/>
-                                       </script>
+                                       <img id="end_date-trigger" 
src="{img_cal}" alt="{lang_datetitle}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;" />
                                </td>
                                <td>
                                        <input type="text" size="8" 
name="workorder_id" value="{workorder_id}" onMouseout="window.status='';return 
true;">
@@ -1510,11 +1494,7 @@
                                                        <xsl:text>'; return 
true;</xsl:text>
                                                </xsl:attribute>
                                        </input>
-
-                                       <script type="text/javascript">
-                                       document.writeln('<img 
id="invoice_date-trigger" src="{date_img}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;"/>');
-                                       <xsl:value-of 
select="calendar_setup_invoice"/>
-                                       </script>
+                                       <img id="invoice_date-trigger" 
src="{img_cal}" alt="{lang_datetitle}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;" />
                                </td>
                        </tr>
                        <tr>
@@ -1546,11 +1526,7 @@
                                                        <xsl:text>'; return 
true;</xsl:text>
                                                </xsl:attribute>
                                        </input>
-
-                                       <script type="text/javascript">
-                                       document.writeln('<img 
id="payment_date-trigger" src="{date_img}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;"/>');
-                                       <xsl:value-of 
select="calendar_setup_payment"/>
-                                       </script>
+                                       <img id="payment_date-trigger" 
src="{img_cal}" alt="{lang_datetitle}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;" />
                                </td>
                        </tr>
                        <tr>
@@ -1805,11 +1781,7 @@
                                                        <xsl:text>'; return 
true;</xsl:text>
                                                </xsl:attribute>
                                        </input>
-
-                                       <script type="text/javascript">
-                                       document.writeln('<img 
id="invoice_date-trigger" src="{date_img}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;"/>');
-                                       <xsl:value-of 
select="calendar_setup_invoice"/>
-                                       </script>
+                                       <img id="invoice_date-trigger" 
src="{img_cal}" alt="{lang_datetitle}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;" />
                                </td>
                        </tr>
                        <tr>
@@ -1841,11 +1813,7 @@
                                                        <xsl:text>'; return 
true;</xsl:text>
                                                </xsl:attribute>
                                        </input>
-
-                                       <script type="text/javascript">
-                                       document.writeln('<img 
id="payment_date-trigger" src="{date_img}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;"/>');
-                                       <xsl:value-of 
select="calendar_setup_payment"/>
-                                       </script>
+                                       <img id="payment_date-trigger" 
src="{img_cal}" alt="{lang_datetitle}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;" />
                                </td>
                        </tr>
 
@@ -2212,14 +2180,9 @@
                                                        <xsl:text>'; return 
true;</xsl:text>
                                                </xsl:attribute>
                                        </input>
-
-                                       <script type="text/javascript">
-                                       document.writeln('<img 
id="date-trigger" src="{date_img}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;"/>');
-                                       <xsl:value-of select="calendar_setup"/>
-                                       </script>
+                                       <img id="date-trigger" src="{img_cal}" 
alt="{lang_datetitle}" title="{lang_datetitle}" style="cursor:pointer; 
cursor:hand;" />
                                </td>
                        </tr>
-
                        <tr height="50">
                                <td>
                                        <xsl:variable 
name="lang_submit"><xsl:value-of select="lang_submit"/></xsl:variable>

Index: templates/base/pricebook.xsl
===================================================================
RCS file: /sources/phpgroupware/property/templates/base/pricebook.xsl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- templates/base/pricebook.xsl        22 Dec 2006 14:43:54 -0000      1.3
+++ templates/base/pricebook.xsl        5 Jan 2007 14:33:36 -0000       1.4
@@ -1,4 +1,4 @@
-<!-- $Id: pricebook.xsl,v 1.3 2006/12/22 14:43:54 sigurdne Exp $ -->
+<!-- $Id: pricebook.xsl,v 1.4 2007/01/05 14:33:36 sigurdne Exp $ -->
 
        <xsl:template name="app_data">
                <xsl:choose>
@@ -795,18 +795,14 @@
                                        <xsl:value-of select="lang_date"/>
                                </td>
                                <td>
-                                       <input type="text" id="date" 
name="date" size="10" value="{date}" readonly="readonly" 
onMouseout="window.status='';return true;" >
+                                       <input type="text" id="values_date" 
name="values[date]" size="10" value="{date}" readonly="readonly" 
onMouseout="window.status='';return true;" >
                                                <xsl:attribute 
name="onMouseover">
                                                        
<xsl:text>window.status='</xsl:text>
                                                                <xsl:value-of 
select="lang_date_statustext"/>
                                                        <xsl:text>'; return 
true;</xsl:text>
                                                </xsl:attribute>
                                        </input>
-
-                                       <script type="text/javascript">
-                                       document.writeln('<img 
id="date-trigger" src="{date_img}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;"/>');
-                                       <xsl:value-of select="calendar_setup"/>
-                                       </script>
+                                       <img id="values_date-trigger" 
src="{img_cal}" alt="{lang_datetitle}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;" />
                                </td>
                        </tr>
                        <tr>
@@ -837,18 +833,14 @@
                                        </input>
                                </td>
                                <td>
-                                       <input type="text" id="date" 
name="date" size="10" value="{date}" readonly="readonly" 
onMouseout="window.status='';return true;" >
+                                       <input type="text" id="values_date" 
name="values[date]" size="10" value="{date}" readonly="readonly" 
onMouseout="window.status='';return true;" >
                                                <xsl:attribute 
name="onMouseover">
                                                        
<xsl:text>window.status='</xsl:text>
                                                                <xsl:value-of 
select="lang_date_statustext"/>
                                                        <xsl:text>'; return 
true;</xsl:text>
                                                </xsl:attribute>
                                        </input>
-
-                                       <script type="text/javascript">
-                                       document.writeln('<img 
id="date-trigger" src="{date_img}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;"/>');
-                                       <xsl:value-of select="calendar_setup"/>
-                                       </script>
+                                       <img id="values_date-trigger" 
src="{img_cal}" alt="{lang_datetitle}" title="{lang_datetitle}" 
style="cursor:pointer; cursor:hand;" />
                                </td>
                                <td height="50">
                                        <xsl:variable 
name="lang_update"><xsl:value-of select="lang_update"/></xsl:variable>




reply via email to

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