fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8411] property: more on bulk update status


From: Sigurd Nes
Subject: [Fmsystem-commits] [8411] property: more on bulk update status
Date: Thu, 22 Dec 2011 15:18:00 +0000

Revision: 8411
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8411
Author:   sigurdne
Date:     2011-12-22 15:17:59 +0000 (Thu, 22 Dec 2011)
Log Message:
-----------
property: more on bulk update status

Modified Paths:
--------------
    trunk/property/inc/class.boproject.inc.php
    trunk/property/inc/class.menu.inc.php
    trunk/property/inc/class.soproject.inc.php
    trunk/property/inc/class.soworkorder.inc.php
    trunk/property/inc/class.uiproject.inc.php
    trunk/property/js/yahoo/admin_entity.edit_category.js
    trunk/property/js/yahoo/project.bulk_update_status.js
    trunk/property/templates/base/project.xsl

Modified: trunk/property/inc/class.boproject.inc.php
===================================================================
--- trunk/property/inc/class.boproject.inc.php  2011-12-22 08:46:58 UTC (rev 
8410)
+++ trunk/property/inc/class.boproject.inc.php  2011-12-22 15:17:59 UTC (rev 
8411)
@@ -806,8 +806,8 @@
                        $this->so->delete($project_id);
                }
 
-               function bulk_update_status($start_date, $end_date, 
$status_filter, $status_new, $execute, $type, $user_id)
+               function bulk_update_status($start_date, $end_date, 
$status_filter, $status_new, $execute, $type, $user_id,$ids)
                {
-                       return $this->so->bulk_update_status($start_date, 
$end_date, $status_filter, $status_new, $execute, $type, $user_id);
+                       return $this->so->bulk_update_status($start_date, 
$end_date, $status_filter, $status_new, $execute, $type, $user_id,$ids);
                }
        }

Modified: trunk/property/inc/class.menu.inc.php
===================================================================
--- trunk/property/inc/class.menu.inc.php       2011-12-22 08:46:58 UTC (rev 
8410)
+++ trunk/property/inc/class.menu.inc.php       2011-12-22 15:17:59 UTC (rev 
8411)
@@ -451,11 +451,6 @@
                                                        'text'  => 
lang('project status'),
                                                        'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uigeneric.index', 'type' => 'project_status') )
                                                ),
-                                               'project_bulk_update_status'    
=> array
-                                               (
-                                                       'text'  => 
lang('project bulk update status'),
-                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiproject.bulk_update_status') )
-                                               ),
                                                'project_group' => array
                                                (
                                                        'text'  => 
lang('project group'),
@@ -740,6 +735,11 @@
                                                                'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitemplate.index')),
                                                                'text'  => 
lang('template'),
                                                                'image'         
=> array('property', 'project_template')
+                                                       ),
+                                                       
'project_bulk_update_status'    => array
+                                                       (
+                                                               'text'  => 
lang('project bulk update status'),
+                                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiproject.bulk_update_status') )
                                                        )
                                                )
                                        );

Modified: trunk/property/inc/class.soproject.inc.php
===================================================================
--- trunk/property/inc/class.soproject.inc.php  2011-12-22 08:46:58 UTC (rev 
8410)
+++ trunk/property/inc/class.soproject.inc.php  2011-12-22 15:17:59 UTC (rev 
8411)
@@ -1285,22 +1285,22 @@
                }
 
 
-               function bulk_update_status($start_date, $end_date, 
$status_filter, $status_new, $execute, $type, $user_id = 0)
+               function bulk_update_status($start_date, $end_date, 
$status_filter, $status_new, $execute, $type, $user_id = 0,$ids)
                {
-                       $start_date = 
phpgwapi_datetime::date_to_timestamp($start_date);
-                       $end_date = 
phpgwapi_datetime::date_to_timestamp($end_date);
+                       $start_date = $start_date ? 
phpgwapi_datetime::date_to_timestamp($start_date) : time();
+                       $end_date = $end_date ? 
phpgwapi_datetime::date_to_timestamp($end_date) : time();
 
                        $filter = '';
                        if($user_id)
                        {
                                $user_id = (int) $user_id;
-                               $filter = "AND user_id = $user_id";
+                               $filter = "AND fm_{$type}.user_id = $user_id";
                        }
 
                        if($status_filter)
                        {
                                $user_id = (int) $user_id;
-                               $filter .= "AND status = '{$status_filter}'";
+                               $filter .= "AND fm_{$type}.status = 
'{$status_filter}'";
                        }
 
                        switch($type)
@@ -1309,38 +1309,161 @@
                                        $table = 'fm_project';
                                        $status_table = 'fm_project_status';
                                        $title_field = 'fm_project.name as 
title';
+                                       $this->_update_status_project($execute, 
$status_new, $ids);
+                                       $sql = "SELECT DISTINCT {$table}.id, 
$status_table.descr as status ,{$title_field},{$table}.start_date, 
count(project_id) as num_open FROM {$table}"
+                                       . " {$this->join} {$status_table} ON  
{$table}.status = {$status_table}.id "
+                                       . " {$this->left_join} fm_workorder ON 
{$table}.id = fm_workorder.project_id "
+                                       . " {$this->join} fm_workorder_status 
ON  fm_workorder.status = fm_workorder_status.id "
+                                       . " WHERE ({$table}.start_date > 
{$start_date} AND {$table}.start_date < {$end_date} {$filter}) AND 
fm_workorder_status.delivered IS NULL AND fm_workorder_status.closed IS NULL"
+                                       . " GROUP BY {$table}.id, 
$status_table.descr ,{$table}.name, {$table}.start_date"
+                                       . " ORDER BY {$table}.id DESC";
+
                                        break;
                                case 'workorder':
                                        $table = 'fm_workorder';
                                        $status_table = 'fm_workorder_status';
                                        $title_field = 'fm_workorder.title';
+                                       $actual_cost = ',(act_mtrl_cost + 
act_vendor_cost) as actual_cost';
+                                       
$this->_update_status_workorder($execute, $status_new, $ids);
+                                       $sql = "SELECT {$table}.id, 
$status_table.descr as status ,{$title_field},start_date {$actual_cost} FROM 
{$table}"
+                                       . " {$this->join} {$status_table} ON  
{$table}.status = {$status_table}.id  WHERE (start_date > {$start_date} AND 
start_date < {$end_date} {$filter}) OR start_date is NULL"
+                                       . " ORDER BY {$table}.id DESC";
                                        break;
                                default:
                                        return array();
                        }
 
-                       $sql = "SELECT {$table}.id, $status_table.descr as 
status ,{$title_field} FROM {$table}"
-                       . " {$this->join} {$status_table} ON  {$table}.status = 
{$status_table}.id  WHERE start_date > {$start_date} AND start_date < 
{$end_date} {$filter}";
-//_debug_array($sql);                  
                        $this->db->query($sql,__LINE__,__FILE__);
                        $values = array();
+                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+
                        while ($this->db->next_record())
                        {
                                $values[] = array
                                (
-                                       'id'            => $this->db->f('id'),
-                                       'title'         => 
$this->db->f('title',true),
-                                       'status'        => 
$this->db->f('status',true)
+                                       'id'                    => 
$this->db->f('id'),
+                                       'title'                 => 
$this->db->f('title',true),
+                                       'status'                => 
$this->db->f('status',true),
+                                       'actual_cost'   => 
$this->db->f('actual_cost'),
+                                       'start_date'    => 
$GLOBALS['phpgw']->common->show_date($this->db->f('start_date'),$dateformat),
+                                       'num_open'              => 
(int)$this->db->f('num_open'),
                                );
                        }
 
                        return $values;
 
 
+               }
+
+               protected function _update_status_project($execute, 
$status_new, $ids)
+               {
+                       if(!$execute || !$status_new)
+                       {
+                               return;
+                       }
+                       $historylog     = 
CreateObject('property.historylog','project');
+
+
                        $this->db->transaction_begin();
+                       foreach ($ids as $id)
+                       {
+                               $this->db->query("SELECT status, vendor_id FROM 
fm_project WHERE id = '{$id}'",__LINE__,__FILE__);
+                               $this->db->next_record();
+                               $old_status     = $this->db->f('status');
 
+                               if ($old_status != $status_new)
+                               {
+                                       $this->db->query("UPDATE fm_project SET 
status = '{$status_new}' WHERE id = '{$id}'",__LINE__,__FILE__);
+                                       $historylog->add('S', $id, $status_new, 
$old_status);
+                               }
 
+                               $action_params_approved = array
+                                       (
+                                               'appname'                       
=> 'property',
+                                               'location'                      
=> '.project',
+                                               'id'                            
=> $id,
+                                               'responsible'           => 
$this->account,
+                                               'responsible_type'  => 'user',
+                                               'action'                        
=> 'approval',
+                                               'remark'                        
=> '',
+                                               'deadline'                      
=> ''
+                                       );
+       
+                               $this->db->query("SELECT * FROM 
fm_project_status WHERE id = '{$status_new}'");
+                               $this->db->next_record();
+                               if ($this->db->f('approved') || 
$this->db->f('closed'))
+                               {
+                                       
execMethod('property.sopending_action.close_pending_action', 
$action_params_approved);
+                               }
+                       }
+
                        $this->db->transaction_commit();
+
                }
 
+               protected function _update_status_workorder($execute, 
$status_new, $ids)
+               {
+                       if(!$execute || !$status_new)
+                       {
+                               return;
+                       }
+                       $historylog     = 
CreateObject('property.historylog','workorder');
+
+                       $this->db->transaction_begin();
+                       foreach ($ids as $id)
+                       {
+                               $this->db->query("SELECT status, vendor_id FROM 
fm_workorder WHERE id = '{$id}'",__LINE__,__FILE__);
+                               $this->db->next_record();
+                               $old_status     = $this->db->f('status');
+                               $vendor_id      = $this->db->f('vendor_id');
+
+                               if ($old_status != $status_new)
+                               {
+                                       $this->db->query("UPDATE fm_workorder 
SET status = '{$status_new}' WHERE id = '{$id}'",__LINE__,__FILE__);
+                                       $historylog->add('S', $id, $status_new, 
$old_status);
+                               }
+
+                               $action_params_approved = array
+                                       (
+                                               'appname'                       
=> 'property',
+                                               'location'                      
=> '.project.workorder',
+                                               'id'                            
=> $id,
+                                               'responsible'           => 
$this->account,
+                                               'responsible_type'  => 'user',
+                                               'action'                        
=> 'approval',
+                                               'remark'                        
=> '',
+                                               'deadline'                      
=> ''
+                                       );
+
+                               $action_params_progress = array
+                                       (
+                                               'appname'                       
=> 'property',
+                                               'location'                      
=> '.project.workorder',
+                                               'id'                            
=> $id,
+                                               'responsible'           => 
$vendor_id,
+                                               'responsible_type'  => 'vendor',
+                                               'action'                        
=> 'remind',
+                                               'remark'                        
=> '',
+                                               'deadline'                      
=> ''
+                                       );
+
+                               $this->db->query("SELECT * FROM 
fm_workorder_status WHERE id = '{$status_new}'");
+                               $this->db->next_record();
+                               if ($this->db->f('approved') )
+                               {
+                                       
execMethod('property.sopending_action.close_pending_action', 
$action_params_approved);
+                               }
+                               if ($this->db->f('in_progress') )
+                               {
+                                       
execMethod('property.sopending_action.close_pending_action', 
$action_params_progress);
+                               }
+                               if ($this->db->f('delivered') || 
$this->db->f('closed'))
+                               {
+                                       
execMethod('property.sopending_action.close_pending_action', 
$action_params_approved);
+                                       
execMethod('property.sopending_action.close_pending_action', 
$action_params_progress);
+                               }
+                       }
+
+                       $this->db->transaction_commit();
+               }
        }

Modified: trunk/property/inc/class.soworkorder.inc.php
===================================================================
--- trunk/property/inc/class.soworkorder.inc.php        2011-12-22 08:46:58 UTC 
(rev 8410)
+++ trunk/property/inc/class.soworkorder.inc.php        2011-12-22 15:17:59 UTC 
(rev 8411)
@@ -1161,7 +1161,7 @@
                                        unset($action_params);
 
                                }
-                               if ($this->db->f('delivered') )
+                               if ($this->db->f('delivered') || 
$this->db->f('closed'))
                                {
                                        //close
                                }

Modified: trunk/property/inc/class.uiproject.inc.php
===================================================================
--- trunk/property/inc/class.uiproject.inc.php  2011-12-22 08:46:58 UTC (rev 
8410)
+++ trunk/property/inc/class.uiproject.inc.php  2011-12-22 15:17:59 UTC (rev 
8411)
@@ -1948,7 +1948,6 @@
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-                       //      $GLOBALS['phpgw']->xslttpl->pp();
                }
 
 
@@ -1959,7 +1958,8 @@
                                
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>PHPGW_ACL_PRIVATE, 
'acl_location'=>$this->acl_location));
                        }
 
-                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'property::admin::project_bulk_update_status';
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::project_bulk_update_status';
+
                        $start_date     = phpgw::get_var('start_date');
                        $end_date               = phpgw::get_var('end_date');
                        $get_list               = phpgw::get_var('get_list', 
'bool', 'POST');
@@ -1968,6 +1968,16 @@
                        $status_new     = phpgw::get_var('status_new');
                        $type                   = phpgw::get_var('type');
                        $user_id                = phpgw::get_var('user_id', 
'int');
+                       $id_to_update   = phpgw::get_var('id_to_update');
+                       
+                       if($id_to_update)
+                       {
+                               $ids = 
array_values(explode(',',trim($id_to_update,',')));
+                       }
+                       else
+                       {
+                               $ids = array();
+                       }
 
                        $link_data = array
                        (
@@ -1981,40 +1991,48 @@
 
                        if(($execute || $get_list) && $type)
                        {
-                               $list = 
$this->bo->bulk_update_status($start_date, $end_date, $status_filter, 
$status_new, $execute, $type, $user_id);
+                               $list = 
$this->bo->bulk_update_status($start_date, $end_date, $status_filter, 
$status_new, $execute, $type, $user_id,$ids);
                        }
 
-/*
-                                       'id'            => $this->db->f('id'),
-                                       'title'         => 
$this->db->f('title',true),
-                                       'status'        => 
$this->db->f('status',true)
+                       $total_records  = count($list);
+                       $datavalues[0] = array
+                       (
+                               'name'                                  => "0",
+                               'values'                                => 
json_encode($list),
+                               'total_records'                 => 
$total_records,
+                               'edit_action'                   => 
json_encode($GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
"property.ui{$type}.edit"))),
+                               'permission'                    => "''",
+                               'is_paginator'                  => 0,
+                               'footer'                                => 1
+                       );
 
-*/
-//                     _debug_array($list);
+                       switch($type)
+                       {
+                               case 'project':
+                                       $_key = 'num_open';
+                                       $_label = lang('open');
+                                       break;
+                               case 'workorder':
+                                       $_key = 'actual_cost';
+                                       $_label = lang('actual cost');
+                                       break;
+                               default:
+                                       $_key = 'num_open';
+                                       $_label = lang('open');
+                       }
 
-
-                       $datavalues[0] = array
-                               (
-                                       'name'                                  
=> "0",
-                                       'values'                                
=> json_encode($list),
-                                       'total_records'                 => 
count($list),
-                                       'edit_action'                   => 
json_encode($GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
"property.ui{$type}.edit"))),
-                                       'is_paginator'                  => 1,
-                                       'footer'                                
=> 0
-                               );
-
                        $myColumnDefs[0] = array
                                (
                                        'name'          => "0",
                                        'values'        =>      
json_encode(array(      array('key' => 
'id','label'=>lang('id'),'sortable'=>true,'resizeable'=>true,'formatter'=>'YAHOO.widget.DataTable.formatLink'),
+                                                                               
                                array('key' => 
'start_date','label'=>lang('date'),'sortable'=>false,'resizeable'=>true),
                                                                                
                                array('key' => 
'title','label'=>lang('title'),'sortable'=>true,'resizeable'=>true),
-                                                                               
                                array('key' => 
'status','label'=>lang('status'),'sortable'=>true,'resizeable'=>true)
+                                                                               
                                array('key' => 
'status','label'=>lang('status'),'sortable'=>true,'resizeable'=>true),
+                                                                               
                                array('key' => 
$_key,'label'=>$_label,'sortable'=>true,'resizeable'=>true 
,'formatter'=>'FormatterRight'),
+                                                                               
                                array('key' => 'select','label'=> 
lang('select'), 
'sortable'=>false,'resizeable'=>false,'formatter'=>'myFormatterCheck','width'=>30)
                                                                                
                                ))
-
                                );
 
-
-
                        $user_list      = 
$this->bocommon->get_user_list('select',$user_id,$extra=false,$default=false,$start=-1,$sort='ASC',$order='account_lastname',$query='',$offset=-1);
                        foreach ($user_list as &$entry)
                        {
@@ -2074,6 +2092,7 @@
                                'user_list'                             => 
array('options' => $user_list),
                                'start_date'                    => $start_date,
                                'end_date'                              => 
$end_date,
+                               'total_records'                 => 
$total_records
                        );
 
 

Modified: trunk/property/js/yahoo/admin_entity.edit_category.js
===================================================================
--- trunk/property/js/yahoo/admin_entity.edit_category.js       2011-12-22 
08:46:58 UTC (rev 8410)
+++ trunk/property/js/yahoo/admin_entity.edit_category.js       2011-12-22 
15:17:59 UTC (rev 8411)
@@ -1,7 +1,7 @@
 var  myPaginator_0, myDataTable_0
-var d;
-var category_template = 0;
-var tableYUI;
+var d;
+var category_template = 0;
+var tableYUI;
 var values_tophp = [];
 
/********************************************************************************/
 this.myParticularRenderEvent = function(num)
@@ -13,24 +13,24 @@
                        for (x=0; x<tableObject.length; x++)
                        {
                                if (tableObject[x].parentNode.id == 
'datatable-container_0')
-                               {
-                                       tableYUI = tableObject[x];
+                               {
+                                       tableYUI = tableObject[x];
                                }
                        }
                        tableYUI.setAttribute("id","tableYUI");
                        tableYUI.deleteTFoot();
                        addFooterDatatable();
                }
-
+
 }
 
-
-
+
+
        this.addFooterDatatable = function()
        {
                //Create ROW
                newTR = document.createElement('tr');
-               //RowChecked
+               //RowChecked
                td_empty(td_count);
                CreateRowChecked("mychecks");
 
@@ -39,29 +39,29 @@
                myfoot.setAttribute("id","myfoot");
                myfoot.appendChild(newTR.cloneNode(true));
        }
-
-
+
+
        var myFormatterCheck = function(elCell, oRecord, oColumn, oData)
        {
-               elCell.innerHTML = "<center><input type='checkbox' 
class='mychecks'  value="+oRecord.getData('attrib_id')+" 
name='dummy'/></center>";
+               elCell.innerHTML = "<center><input type='checkbox' 
class='mychecks'  value="+oRecord.getData('attrib_id')+" 
name='dummy'/></center>";
        }
-
-
+
+
        this.onActionsClick=function()
        {
-               array_checks = 
YAHOO.util.Dom.getElementsByClassName('mychecks');
-
+               array_checks = 
YAHOO.util.Dom.getElementsByClassName('mychecks');
+
                for(i=0;i<array_checks.length;i++)
-               {
+               {
                        if((array_checks[i].checked) )
-                       {
+                       {
                                values_tophp[i] = array_checks[i].value;
                        }
-               }
-               document.form.template_attrib.value = values_tophp;
-       }
-
-
+               }
+               document.form.template_attrib.value = values_tophp;
+       }
+
+
 
/********************************************************************************/
     
 var FormatterCenter = function(elCell, oRecord, oColumn, oData)
 {
@@ -72,20 +72,20 @@
 
        this.get_template_attributes=function()
        {
-               if(document.getElementById('category_template').value)
-               {
-                       base_java_url['category_template'] = 
document.getElementById('category_template').value;
-               }
-               
-               if(document.getElementById('category_template').value != 
category_template)
-               {
-                       execute_async(myDataTable_0);
-                       category_template = 
document.getElementById('category_template').value;
-               }
+               if(document.getElementById('category_template').value)
+               {
+                       base_java_url['category_template'] = 
document.getElementById('category_template').value;
+               }
+               
+               if(document.getElementById('category_template').value != 
category_template)
+               {
+                       execute_async(myDataTable_0);
+                       category_template = 
document.getElementById('category_template').value;
+               }
        }
-
-
-
+
+
+
        check_all = function(myclass)
        {
                controls = YAHOO.util.Dom.getElementsByClassName(myclass);
@@ -114,8 +114,8 @@
                }
        }
 
-
-
+
+
 YAHOO.util.Event.addListener(window, "load", function()
 {
        loader = new YAHOO.util.YUILoader();
@@ -128,4 +128,4 @@
        loader.require("anyone");
     loader.insert();
 });
-
+

Modified: trunk/property/js/yahoo/project.bulk_update_status.js
===================================================================
--- trunk/property/js/yahoo/project.bulk_update_status.js       2011-12-22 
08:46:58 UTC (rev 8410)
+++ trunk/property/js/yahoo/project.bulk_update_status.js       2011-12-22 
15:17:59 UTC (rev 8411)
@@ -1,4 +1,6 @@
 var  myPaginator_0, myDataTable_0
+var values_tophp = [];
+var tableYUI;
 
 
/********************************************************************************/
        YAHOO.widget.DataTable.formatLink = function(elCell, oRecord, oColumn, 
oData)
@@ -16,10 +18,91 @@
        }       
        
 
/********************************************************************************/
     
-       this.myParticularRenderEvent = function()
+       this.myParticularRenderEvent = function(num)
        {
+               if(num==0)
+               {
+                       //tableYUI = 
YAHOO.util.Dom.getElementsByClassName("yui-dt-data","tbody")[1].parentNode;
+                       tableObject = 
document.body.getElementsByTagName('table');
+                       for (x=0; x<tableObject.length; x++)
+                       {
+                               if (tableObject[x].parentNode.id == 
'datatable-container_0')
+                               {
+                                       tableYUI = tableObject[x];
+                               }
+                       }
+                       tableYUI.setAttribute("id","tableYUI");
+                       tableYUI.deleteTFoot();
+                       addFooterDatatable();
+               }
+
        }
 
+       this.addFooterDatatable = function()
+       {
+               //Create ROW
+               newTR = document.createElement('tr');
+               //RowChecked
+               td_empty(td_count);
+               CreateRowChecked("mychecks");
+
+               //Add to Table
+               myfoot = tableYUI.createTFoot();
+               myfoot.setAttribute("id","myfoot");
+               myfoot.appendChild(newTR.cloneNode(true));
+       }
+
+
+       var myFormatterCheck = function(elCell, oRecord, oColumn, oData)
+       {
+               elCell.innerHTML = "<center><input type='checkbox' 
class='mychecks'  value="+oRecord.getData('id')+" name='dummy'/></center>";
+       }
+
+
+       this.onActionsClick=function()
+       {
+               array_checks = 
YAHOO.util.Dom.getElementsByClassName('mychecks');
+
+               for(i=0;i<array_checks.length;i++)
+               {
+                       if((array_checks[i].checked) )
+                       {
+                               values_tophp[i] = array_checks[i].value;
+                       }
+               }
+               document.form.id_to_update.value = values_tophp;
+       }
+
+
+       check_all = function(myclass)
+       {
+               controls = YAHOO.util.Dom.getElementsByClassName(myclass);
+               for(i=0;i<controls.length;i++)
+               {
+                       if(!controls[i].disabled)
+                       {
+                               //for class=transfer_idClass, they have to be 
interchanged
+                               if(myclass=="mychecks")
+                               {
+                                       if(controls[i].checked)
+                                       {
+                                               controls[i].checked = false;
+                                       }
+                                       else
+                                       {
+                                               controls[i].checked = true;
+                                       }
+                               }
+                               //for the rest, always id checked
+                               else
+                               {
+                                       controls[i].checked = true;
+                               }
+                       }
+               }
+       }
+
+
 
/********************************************************************************/
 
 YAHOO.util.Event.addListener(window, "load", function()

Modified: trunk/property/templates/base/project.xsl
===================================================================
--- trunk/property/templates/base/project.xsl   2011-12-22 08:46:58 UTC (rev 
8410)
+++ trunk/property/templates/base/project.xsl   2011-12-22 15:17:59 UTC (rev 
8411)
@@ -1245,8 +1245,9 @@
 
 
        <xsl:template match="bulk_update_status" xmlns:php="http://php.net/xsl";>
-               <form method="post" action="{update_action}">
-                       <table>
+               <div align="left">
+                       <table cellpadding="2" cellspacing="2" width="80%" 
align="center">
+                       <form name="form" method="post" 
action="{update_action}">
                                <tr>
                                        <td>
                                                <xsl:value-of 
select="php:function('lang', 'start date')" />
@@ -1335,52 +1336,57 @@
                                                </select>
                                        </td>
                                </tr>
-
-               <tr>
-                       <td>
-                               <div id="paging_0"> </div>
-                               <div id="datatable-container_0"></div>
-                       </td>
-               </tr>
-
-                       </table>
-                       <input type="submit" name="get_list">
-                               <xsl:attribute name="value">
-                                       <xsl:value-of 
select="php:function('lang', 'get')" />
-                               </xsl:attribute>
-                       </input>
-                       <input type="submit" name="execute">
-                               <xsl:attribute name="value">
-                                       <xsl:value-of 
select="php:function('lang', 'submit')" />
-                               </xsl:attribute>
-                       </input>
-               </form>
-
-                                       <!--  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();
-
-                                               <xsl:for-each 
select="datatable">
-                                                       datatable[<xsl:value-of 
select="name"/>] = [
-                                                       {
-                                                       values                  
:       <xsl:value-of select="values"/>,
-                                                       total_records   :       
<xsl:value-of select="total_records"/>,
-                                                       edit_action             
:       <xsl:value-of select="edit_action"/>,
-                                                       is_paginator    :       
<xsl:value-of select="is_paginator"/>,
-                                                       footer                  
:       <xsl:value-of select="footer"/>
-                                                       }
-                                                       ]
-                                               </xsl:for-each>
-
-                                               <xsl:for-each 
select="myColumnDefs">
-                                                       
myColumnDefs[<xsl:value-of select="name"/>] = <xsl:value-of select="values"/>
-                                               </xsl:for-each>
-                                       </script>
-
-
+                               <tr>
+                                       <td>
+                                       </td>
+                                       <td>
+                                               <input type="submit" 
name="get_list">
+                                                       <xsl:attribute 
name="value">
+                                                               <xsl:value-of 
select="php:function('lang', 'get list')" />
+                                                       </xsl:attribute>
+                                               </input>
+                                               <input type="submit" 
name="execute" onClick="onActionsClick()">
+                                                       <xsl:attribute 
name="value">
+                                                               <xsl:value-of 
select="php:function('lang', 'save')" />
+                                                       </xsl:attribute>
+                                               </input>
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td valign="top">
+                                               <xsl:value-of 
select='total_records' />
+                                       </td>
+                                       <td>
+                                               <div id="paging_0"> </div>
+                                               <div 
id="datatable-container_0"></div>
+                                               <input type="hidden" 
name="id_to_update" value=""></input>
+                                       </td>
+                               </tr>
+                       </form>
+               </table>
+       </div>
+       <!--  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();
+               var td_count = 5;
+               <xsl:for-each select="datatable">
+                       datatable[<xsl:value-of select="name"/>] = [
+                       {
+                               values                  :       <xsl:value-of 
select="values"/>,
+                               total_records   :       <xsl:value-of 
select="total_records"/>,
+                               edit_action             :       <xsl:value-of 
select="edit_action"/>,
+                               is_paginator    :       <xsl:value-of 
select="is_paginator"/>,
+                               footer                  :       <xsl:value-of 
select="footer"/>
+                       }
+                       ]
+               </xsl:for-each>
+               <xsl:for-each select="myColumnDefs">
+                       myColumnDefs[<xsl:value-of select="name"/>] = 
<xsl:value-of select="values"/>
+               </xsl:for-each>
+       </script>
        </xsl:template>
 
 




reply via email to

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