fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11571] property: update cron-jobs


From: Sigurd Nes
Subject: [Fmsystem-commits] [11571] property: update cron-jobs
Date: Fri, 27 Dec 2013 08:26:42 +0000

Revision: 11571
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11571
Author:   sigurdne
Date:     2013-12-27 08:26:40 +0000 (Fri, 27 Dec 2013)
Log Message:
-----------
property: update cron-jobs

Modified Paths:
--------------
    trunk/property/inc/cron/class.cron_parent.inc.php
    trunk/property/inc/cron/default/Import_fra_agresso_X205.php
    trunk/property/inc/cron/default/catch_ppc.php
    trunk/property/inc/cron/default/forward_mail_as_sms.php
    
trunk/property/inc/cron/default/import_oppdatering_av_bestilling_fra_agresso_bkb.php
    trunk/property/inc/cron/default/oppdater_antall_leieobjekt.php
    trunk/property/inc/cron/default/oppdater_namssakstatus_pr_leietaker.php
    trunk/property/inc/cron/default/oppdater_utgaatt_objekt.php
    trunk/property/inc/cron/default/reset_workorder_cached_budget.php
    trunk/property/inc/cron/default/synkroniser_med_boei.php
    trunk/property/inc/cron/default/update_googlemap.php
    trunk/property/inc/cron/default/update_phpgw.php
    trunk/property/inc/cron/default/update_workorder_status.php

Modified: trunk/property/inc/cron/class.cron_parent.inc.php
===================================================================
--- trunk/property/inc/cron/class.cron_parent.inc.php   2013-12-27 07:22:18 UTC 
(rev 11570)
+++ trunk/property/inc/cron/class.cron_parent.inc.php   2013-12-27 08:26:40 UTC 
(rev 11571)
@@ -40,7 +40,7 @@
                protected $receipt = array();
                protected $sub_location = 'sub_location';
                protected $function_msg = 'function_msg';
-               protected $cron = false
+               protected $cron = false;
 
                function __construct()
                {

Modified: trunk/property/inc/cron/default/Import_fra_agresso_X205.php
===================================================================
--- trunk/property/inc/cron/default/Import_fra_agresso_X205.php 2013-12-27 
07:22:18 UTC (rev 11570)
+++ trunk/property/inc/cron/default/Import_fra_agresso_X205.php 2013-12-27 
08:26:40 UTC (rev 11571)
@@ -53,7 +53,7 @@
                {
                        parent::__construct();
 
-                       $this->function_name = 'Import_fra_agresso_X205';
+                       $this->function_name = get_class($this);
                        $this->sub_location = lang('invoice');
                        $this->function_msg     = 'Importer faktura fra 
Agresso';
 

Modified: trunk/property/inc/cron/default/catch_ppc.php
===================================================================
--- trunk/property/inc/cron/default/catch_ppc.php       2013-12-27 07:22:18 UTC 
(rev 11570)
+++ trunk/property/inc/cron/default/catch_ppc.php       2013-12-27 08:26:40 UTC 
(rev 11571)
@@ -41,7 +41,7 @@
                {
                        parent::__construct();
 
-                       $this->function_name = 'catch_ppc';
+                       $this->function_name = get_class($this);
                        $this->sub_location = lang('catch');
                        $this->function_msg     = 'Import info from files';
 

Modified: trunk/property/inc/cron/default/forward_mail_as_sms.php
===================================================================
--- trunk/property/inc/cron/default/forward_mail_as_sms.php     2013-12-27 
07:22:18 UTC (rev 11570)
+++ trunk/property/inc/cron/default/forward_mail_as_sms.php     2013-12-27 
08:26:40 UTC (rev 11571)
@@ -25,7 +25,7 @@
                {
                        parent::__construct();
 
-                       $this->function_name = 'forward_mail_as_sms';
+                       $this->function_name = get_class($this);
                        $this->sub_location = lang('Async service');
                        $this->function_msg     = 'Forward email as SMS';
 

Modified: 
trunk/property/inc/cron/default/import_oppdatering_av_bestilling_fra_agresso_bkb.php
===================================================================
--- 
trunk/property/inc/cron/default/import_oppdatering_av_bestilling_fra_agresso_bkb.php
        2013-12-27 07:22:18 UTC (rev 11570)
+++ 
trunk/property/inc/cron/default/import_oppdatering_av_bestilling_fra_agresso_bkb.php
        2013-12-27 08:26:40 UTC (rev 11571)
@@ -45,7 +45,7 @@
                {
                        parent::__construct();
 
-                       $this->function_name = 
'import_oppdatering_av_bestilling_fra_agresso_bkb';
+                       $this->function_name = get_class($this);
                        $this->sub_location = lang('ticket');
                        $this->function_msg     = 'Importer rapport fra Agresso 
for oppdatering av meldinger';
 
@@ -213,15 +213,14 @@
                        $file_name = basename($file);
 
                        $fp = fopen($file,'rb');
-                       $row = 1;
 
                        while (($data = fgetcsv($handle, 1000, ";")) !== false 
&& $ok == true )
                        {
-                               if($row > 1 && stripos( $file_name, 'penger' ) 
=== 0)
+                               if( preg_match('/^penger/i', $file_name) )
                                {
                                        $ok = $this->update_amount($data);
                                }
-                               else if($row > 1 && stripos( $file_name, 
'status' ) === 0)
+                               else if( preg_match('/^status/i', $file_name) )
                                {
                                        $ok = $this->update_status($data);
                                }
@@ -231,7 +230,6 @@
                        fclose($fp);
 
                        return $ok;
-
                }
 
                private function update_amount($data)

Modified: trunk/property/inc/cron/default/oppdater_antall_leieobjekt.php
===================================================================
--- trunk/property/inc/cron/default/oppdater_antall_leieobjekt.php      
2013-12-27 07:22:18 UTC (rev 11570)
+++ trunk/property/inc/cron/default/oppdater_antall_leieobjekt.php      
2013-12-27 08:26:40 UTC (rev 11571)
@@ -32,92 +32,23 @@
         * @package property
         */
 
-       class oppdater_antall_leieobjekt
-       {
-               var     $function_name = 'oppdater_antall_leieobjekt';
+       include_class('property', 'cron_parent', 'inc/cron/');
 
-               function oppdater_antall_leieobjekt()
+       class oppdater_antall_leieobjekt extends property_cron_parent
+       {
+               public function __construct()
                {
-                       $this->bocommon                 = 
CreateObject('property.bocommon');
-                       $this->db                               = & 
$GLOBALS['phpgw']->db;
-                       $this->db2                              = 
clone($this->db);
-                       $this->join                             = 
$this->db->join;
-               }
+                       parent::__construct();
 
-               function pre_run($data='')
-               {
-                       if($data['enabled']==1)
-                       {
-                               $confirm        = true;
-                               $cron           = true;
-                       }
-                       else
-                       {
-                               $confirm        = phpgw::get_var('confirm', 
'bool', 'POST');
-                               $execute        = phpgw::get_var('execute', 
'bool', 'GET');
-                       }
-
-                       if ($confirm)
-                       {
-                               $this->execute($cron);
-                       }
-                       else
-                       {
-                               $this->confirm($execute=false);
-                       }
+                       $this->function_name = get_class($this);
+                       $this->sub_location = lang('location');
+                       $this->function_msg     = 'Oppdater antall leieobjekter 
for tv-anlegg';
                }
 
-
-               function confirm($execute='')
+               function execute()
                {
-                       $link_data = array
-                       (
-                               'menuaction' => 
'property.custom_functions.index',
-                               'function'      =>$this->function_name,
-                               'execute'       => $execute,
-                       );
-
-
-                       if(!$execute)
-                       {
-                               $lang_confirm_msg       = lang('do you want to 
perform this action');
-                       }
-
-                       $lang_yes                       = lang('yes');
-
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('confirm_custom'));
-
-
-                       $msgbox_data = 
$this->bocommon->msgbox_data($this->receipt);
-
-                       $data = array
-                       (
-                               'msgbox_data'                   => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/admin/index.php'),
-                               'run_action'                    => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'message'                               => 
$this->receipt['message'],
-                               'lang_confirm_msg'              => 
$lang_confirm_msg,
-                               'lang_yes'                              => 
$lang_yes,
-                               'lang_yes_statustext'   => 'Oppdater antall 
leieobjekter for tv-anlegg',
-                               'lang_no_statustext'    => 'tilbake',
-                               'lang_no'                               => 
lang('no'),
-                               'lang_done'                             => 
'Avbryt',
-                               'lang_done_statustext'  => 'tilbake'
-                       );
-
-                       $appname                = lang('location');
-                       $function_msg   = 'Oppdater antall leieobjekter for 
tv-anlegg';
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('confirm' => $data));
-                       $GLOBALS['phpgw']->xslttpl->pp();
-               }
-
-               function execute($cron='')
-               {
-
                        $this->db->transaction_begin();
 
-
                        $sql = "SELECT kunde_nr_lev, fm_entity_1_3.loc1, 
fm_entity_1_3.loc2, Count(fm_location4.location_code) AS antall_leieobjekt, 
fm_entity_1_3.location_code
                                        FROM fm_entity_1_3 INNER JOIN 
fm_location4 ON (fm_entity_1_3.loc1 = fm_location4.loc1) AND 
(fm_entity_1_3.loc2 = fm_location4.loc2)
                                        WHERE fm_location4.category IN 
(1,2,3,4,6,10,14,15,17,22,23,24,25)
@@ -149,25 +80,6 @@
 
                        $this->db->transaction_commit();
 
-                       if(!$cron)
-                       {
-                               $this->confirm($execute=false);
-                       }
-
-                       $msgbox_data = 
$this->bocommon->msgbox_data($this->receipt);
-
-                       $insert_values= array(
-                               $cron,
-                               date($this->db->datetime_format()),
-                               $this->function_name,
-                               implode(',',(array_keys($msgbox_data)))
-                               );
-
-                       $insert_values  = 
$this->db->validate_insert($insert_values);
-
-                       $sql = "INSERT INTO fm_cron_log 
(cron,cron_date,process,message) "
-                                       . "VALUES ($insert_values)";
-                       $this->db->query($sql,__LINE__,__FILE__);
                }
        }
 

Modified: 
trunk/property/inc/cron/default/oppdater_namssakstatus_pr_leietaker.php
===================================================================
--- trunk/property/inc/cron/default/oppdater_namssakstatus_pr_leietaker.php     
2013-12-27 07:22:18 UTC (rev 11570)
+++ trunk/property/inc/cron/default/oppdater_namssakstatus_pr_leietaker.php     
2013-12-27 08:26:40 UTC (rev 11571)
@@ -32,12 +32,19 @@
         * @package property
         */
 
-       class oppdater_namssakstatus_pr_leietaker
+       include_class('property', 'cron_parent', 'inc/cron/');
+
+       class oppdater_namssakstatus_pr_leietaker extends property_cron_parent
        {
-               var     $function_name = 'oppdater_namssakstatus_pr_leietaker';
 
-               function oppdater_namssakstatus_pr_leietaker()
+               function __construct()
                {
+                       parent::__construct();
+
+                       $this->function_name = get_class($this);
+                       $this->sub_location = lang('location');
+                       $this->function_msg     = 'Oppdatere namssaksstatus pr 
leietater';
+
                        $this->bocommon                 = 
CreateObject('property.bocommon');
                        $this->db                               = & 
$GLOBALS['phpgw']->db;
                        $this->db2                              = 
clone($this->db);
@@ -68,107 +75,10 @@
                        }
                }
 
-               function pre_run($data='')
-               {
-                       if($data['enabled']==1)
-                       {
-                               $confirm        = true;
-                               $cron           = true;
-                       }
-                       else
-                       {
-                               $confirm        = phpgw::get_var('confirm', 
'bool', 'POST');
-                               $execute        = phpgw::get_var('execute', 
'bool', 'GET');
-                       }
 
-                       if ($confirm)
-                       {
-                               $this->execute($cron);
-                       }
-                       else
-                       {
-                               $this->confirm($execute=false);
-                       }
-               }
-
-
-               function confirm($execute='')
+               function execute()
                {
-                       $link_data = array
-                       (
-                               'menuaction' => 
'property.custom_functions.index',
-                               'function'      =>$this->function_name,
-                               'execute'       => $execute,
-                       );
 
-
-                       if(!$execute)
-                       {
-                               $lang_confirm_msg       = lang('do you want to 
perform this action');
-                       }
-
-                       $lang_yes                       = lang('yes');
-
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('confirm_custom'));
-
-
-                       $msgbox_data = 
$this->bocommon->msgbox_data($this->receipt);
-
-                       $data = array
-                       (
-                               'msgbox_data'                   => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/admin/index.php'),
-                               'run_action'                    => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'message'                               => 
$this->receipt['message'],
-                               'lang_confirm_msg'              => 
$lang_confirm_msg,
-                               'lang_yes'                              => 
$lang_yes,
-                               'lang_yes_statustext'   => lang('Update the 
category to not active based on if there is only nonactive apartments'),
-                               'lang_no_statustext'    => 'tilbake',
-                               'lang_no'                               => 
lang('no'),
-                               'lang_done'                             => 
'Avbryt',
-                               'lang_done_statustext'  => 'tilbake'
-                       );
-
-                       $appname                = lang('location');
-                       $function_msg   = 'Oppdatere namssaksstatus pr 
leietater';
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('confirm' => $data));
-                       $GLOBALS['phpgw']->xslttpl->pp();
-               }
-
-               function execute($cron='')
-               {
-
-                       $receipt = $this->oppdater_namssakstatus();
-                       $this->cron_log($receipt,$cron);
-
-                       if(!$cron)
-                       {
-                               $this->confirm($execute=false);
-                       }
-
-               }
-
-               function cron_log($receipt='',$cron='')
-               {
-
-                       $insert_values= array(
-                               $cron,
-                               date($this->db->datetime_format()),
-                               $this->function_name,
-                               $receipt
-                               );
-
-                       $insert_values  = 
$this->db->validate_insert($insert_values);
-
-                       $sql = "INSERT INTO fm_cron_log 
(cron,cron_date,process,message) "
-                                       . "VALUES ($insert_values)";
-                       $this->db->query($sql,__LINE__,__FILE__);
-               }
-
-               function oppdater_namssakstatus()
-               {
-
                        $sql = "SELECT TOP 100 PERCENT fm_tenant.id"
                                        . " FROM  fm_tenant LEFT OUTER JOIN"
                     . " v_Leietaker ON fm_tenant.id = v_Leietaker.leietaker_id 
AND "
@@ -219,8 +129,5 @@
 
                        $msg = $i . ' namssakstatus er oppdatert';
                        $this->receipt['message'][]=array('msg'=> $msg);
-                       return $msg;
-
                }
        }
-

Modified: trunk/property/inc/cron/default/oppdater_utgaatt_objekt.php
===================================================================
--- trunk/property/inc/cron/default/oppdater_utgaatt_objekt.php 2013-12-27 
07:22:18 UTC (rev 11570)
+++ trunk/property/inc/cron/default/oppdater_utgaatt_objekt.php 2013-12-27 
08:26:40 UTC (rev 11571)
@@ -32,94 +32,26 @@
         * @package property
         */
 
-       class oppdater_utgaatt_objekt
-       {
-               var     $function_name = 'oppdater_utgaatt_objekt';
+       include_class('property', 'cron_parent', 'inc/cron/');
 
-               function __construct()
+       class oppdater_utgaatt_objekt extends property_cron_parent
+       {
+               public function __construct()
                {
-                       $this->db                               = & 
$GLOBALS['phpgw']->db;
-                       $this->like                     = & $this->db->like;
-                       $this->join                     = & $this->db->join;
-                       $this->left_join                = & 
$this->db->left_join;
+                       parent::__construct();
+
+                       $this->function_name = get_class($this);
+                       $this->sub_location = lang('location');
+                       $this->function_msg     = lang('Update the not active 
category for locations');
                        $this->soadmin_location = 
CreateObject('property.soadmin_location');
                }
 
-               function pre_run($data = array())
+               function execute()
                {
-                       if($data['enabled']==1)
-                       {
-                               $confirm        = true;
-                               $cron           = true;
-                       }
-                       else
-                       {
-                               $confirm        = phpgw::get_var('confirm', 
'bool', 'POST');
-                               $execute        = phpgw::get_var('execute', 
'bool', 'GET');
-                       }
-
-                       if ($confirm)
-                       {
-                               $this->execute($cron);
-                       }
-                       else
-                       {
-                               $this->confirm($execute=false);
-                       }
-               }
-
-
-               function confirm($execute='')
-               {
-                       $link_data = array
-                       (
-                               'menuaction' => 
'property.custom_functions.index',
-                               'function'      =>$this->function_name,
-                               'execute'       => $execute,
-                       );
-
-
-                       if(!$execute)
-                       {
-                               $lang_confirm_msg       = lang('do you want to 
perform this action');
-                       }
-
-                       $lang_yes                       = lang('yes');
-
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('confirm_custom'));
-
-
-                       $msgbox_data = 
$GLOBALS['phpgw']->common->msgbox_data($this->receipt);
-
-                       $data = array
-                       (
-                               'msgbox_data'                   => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/admin/index.php'),
-                               'run_action'                    => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'message'                               => 
$this->receipt['message'],
-                               'lang_confirm_msg'              => 
$lang_confirm_msg,
-                               'lang_yes'                              => 
$lang_yes,
-                               'lang_yes_statustext'   => lang('Update the 
category to not active based on if there is only nonactive apartments'),
-                               'lang_no_statustext'    => 'tilbake',
-                               'lang_no'                               => 
lang('no'),
-                               'lang_done'                             => 
'Avbryt',
-                               'lang_done_statustext'  => 'tilbake'
-                       );
-
-                       $appname                = lang('location');
-                       $function_msg   = lang('Update the not active category 
for locations');
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('confirm' => $data));
-                       $GLOBALS['phpgw']->xslttpl->pp();
-               }
-
-               function execute($cron='')
-               {
                        $location_types = 
$this->soadmin_location->select_location_type();
 
                        $m= count($location_types);
 
-
                        $this->db->query("UPDATE fm_location" . $m. " set       
status= 2  WHERE category='99'",__LINE__,__FILE__);
 
                        for ($type_id=$m; $type_id>1; $type_id--)
@@ -213,26 +145,5 @@
                                unset($metadata);
                                $this->db->transaction_commit();
                        }
-
-
-                       if(!$cron)
-                       {
-                               $this->confirm($execute=false);
-                       }
-
-                       $msgbox_data = 
$GLOBALS['phpgw']->common->msgbox_data($this->receipt);
-
-                       $insert_values= array(
-                               $cron,
-                               date($this->db->datetime_format()),
-                               $this->function_name,
-                               implode(',',(array_keys($msgbox_data)))
-                               );
-
-                       $insert_values  = 
$this->db->validate_insert($insert_values);
-
-                       $sql = "INSERT INTO fm_cron_log 
(cron,cron_date,process,message) "
-                                       . "VALUES ($insert_values)";
-                       $this->db->query($sql,__LINE__,__FILE__);
                }
        }

Modified: trunk/property/inc/cron/default/reset_workorder_cached_budget.php
===================================================================
--- trunk/property/inc/cron/default/reset_workorder_cached_budget.php   
2013-12-27 07:22:18 UTC (rev 11570)
+++ trunk/property/inc/cron/default/reset_workorder_cached_budget.php   
2013-12-27 08:26:40 UTC (rev 11571)
@@ -40,7 +40,7 @@
                {
                        parent::__construct();
 
-                       $this->function_name = 'reset_workorder_cached_budget';
+                       $this->function_name = get_class($this);
                        $this->sub_location = lang('workorder');
                        $this->function_msg     = 'reset workorder cached 
budget';
                }

Modified: trunk/property/inc/cron/default/synkroniser_med_boei.php
===================================================================
--- trunk/property/inc/cron/default/synkroniser_med_boei.php    2013-12-27 
07:22:18 UTC (rev 11570)
+++ trunk/property/inc/cron/default/synkroniser_med_boei.php    2013-12-27 
08:26:40 UTC (rev 11571)
@@ -41,7 +41,7 @@
                {
                        parent::__construct();
 
-                       $this->function_name = 'synkroniser_med_boei';
+                       $this->function_name = get_class($this);
                        $this->sub_location = lang('location');
                        $this->function_msg     = 'Synkroniser_med_boei';
 

Modified: trunk/property/inc/cron/default/update_googlemap.php
===================================================================
--- trunk/property/inc/cron/default/update_googlemap.php        2013-12-27 
07:22:18 UTC (rev 11570)
+++ trunk/property/inc/cron/default/update_googlemap.php        2013-12-27 
08:26:40 UTC (rev 11571)
@@ -32,112 +32,25 @@
         * @package property
         */
 
-       class update_googlemap
-       {
-               var     $function_name = 'update_googlemap';
+       include_class('property', 'cron_parent', 'inc/cron/');
 
-               function update_googlemap()
+       class update_googlemap extends property_cron_parent
+       {
+               public function __construct()
                {
+                       parent::__construct();
+
+                       $this->function_name = get_class($this);
+                       $this->sub_location = lang('location');
+                       $this->function_msg     = 'update googlemap';
+
                        $this->bocommon                 = 
CreateObject('property.bocommon');
-                       $this->db                               = & 
$GLOBALS['phpgw']->db;
                        $this->db2                              = 
clone($this->db);
-
-                       $this->join                             = 
$this->db->join;
-                       $this->like                             = 
$this->db->like;
-                       $this->left_join                = " LEFT JOIN ";
                }
 
-               function pre_run($data='')
-               {
-                       if($data['enabled']==1)
-                       {
-                               $confirm        = true;
-                               $cron           = true;
-                       }
-                       else
-                       {
-                               $confirm        = phpgw::get_var('confirm', 
'bool', 'POST');
-                               $execute        = phpgw::get_var('execute', 
'bool', 'GET');
-                       }
 
-                       if ($confirm)
-                       {
-                               $this->execute($cron);
-                       }
-                       else
-                       {
-                               $this->confirm($execute=false);
-                       }
-               }
-               function confirm($execute='')
+               function execute()
                {
-                       $link_data = array
-                       (
-                               'menuaction' => 
'property.custom_functions.index',
-                               'function'      =>$this->function_name,
-                               'execute'       => $execute,
-                       );
-
-                       if(!$execute)
-                       {
-                               $lang_confirm_msg       = lang('do you want to 
perform this action');
-                       }
-
-                       $lang_yes                       = lang('yes');
-
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('confirm_custom'));
-
-                       $msgbox_data = 
$this->bocommon->msgbox_data($this->receipt);
-
-                       $data = array
-                       (
-                               'msgbox_data'                   => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/admin/index.php'),
-                               'run_action'                    => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'message'                               => 
$this->receipt['message'],
-                               'lang_confirm_msg'              => 
$lang_confirm_msg,
-                               'lang_yes'                              => 
$lang_yes,
-                               'lang_yes_statustext'   => lang('Export info as 
files'),
-                               'lang_no_statustext'    => 'tilbake',
-                               'lang_no'                               => 
lang('no'),
-                               'lang_done'                             => 
'Avbryt',
-                               'lang_done_statustext'  => 'tilbake'
-                       );
-
-                       $appname                = lang('location');
-                       $function_msg   = lang('Export info as files');
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('confirm' => $data));
-                       $GLOBALS['phpgw']->xslttpl->pp();
-               }
-
-               function execute($cron='')
-               {
-                       $this->update_location4();
-
-                       if(!$cron)
-                       {
-                               $this->confirm($execute=false);
-                       }
-
-                       $msgbox_data = 
$this->bocommon->msgbox_data($this->receipt);
-
-                       $insert_values= array(
-                               $cron,
-                               date($this->db->datetime_format()),
-                               $this->function_name,
-                               implode(',',(array_keys($msgbox_data)))
-                               );
-
-                       $insert_values  = 
$this->db->validate_insert($insert_values);
-
-                       $sql = "INSERT INTO fm_cron_log 
(cron,cron_date,process,message) "
-                                       . "VALUES ($insert_values)";
-                       $this->db->query($sql,__LINE__,__FILE__);
-               }
-
-               function update_location4()
-               {
                        $fieldname = 'googlemap';
                        $area = "Bergen";
                        $sql = "SELECT 
fm_location4.location_code,fm_location4.loc1,fm_location4.loc2,fm_location4.loc3,fm_location4.loc4,"
@@ -154,5 +67,3 @@
                        }
                }
        }
-
-

Modified: trunk/property/inc/cron/default/update_phpgw.php
===================================================================
--- trunk/property/inc/cron/default/update_phpgw.php    2013-12-27 07:22:18 UTC 
(rev 11570)
+++ trunk/property/inc/cron/default/update_phpgw.php    2013-12-27 08:26:40 UTC 
(rev 11571)
@@ -21,11 +21,11 @@
 
        class update_phpgw extends property_cron_parent
        {
-               function update_phpgw()
+               function __construct()
                {
                        parent::__construct();
 
-                       $this->function_name = 'update_phpgw';
+                       $this->function_name = get_class($this);
                        $this->sub_location = lang('Async service');
                        $this->function_msg     = 'Update all installed apps of 
phpgw';
 

Modified: trunk/property/inc/cron/default/update_workorder_status.php
===================================================================
--- trunk/property/inc/cron/default/update_workorder_status.php 2013-12-27 
07:22:18 UTC (rev 11570)
+++ trunk/property/inc/cron/default/update_workorder_status.php 2013-12-27 
08:26:40 UTC (rev 11571)
@@ -32,110 +32,29 @@
         * @package property
         */
 
-       class update_workorder_status
-       {
-               var     $function_name = 'update_workorder_status';
+       include_class('property', 'cron_parent', 'inc/cron/');
 
-               function update_workorder_status()
+       class update_workorder_status extends property_cron_parent
+       {
+               public function __construct()
                {
-               //      $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       parent::__construct();
+
+                       $this->function_name = get_class($this);
+                       $this->sub_location = lang('workorder');
+                       $this->function_msg     = 'Manuell oppdatering av 
status';
+
                        $this->bocommon                 = 
CreateObject('property.bocommon');
                        $this->db                               = 
clone($GLOBALS['phpgw']->db);
                        $this->date                             =  
1220245200;// unix timestamp 1. Sept 2008
-               }
 
-               function pre_run($data='')
-               {
-                       if($data['enabled']==1)
-                       {
-                               $confirm        = true;
-                               $cron           = true;
-                       }
-                       else
-                       {
-                               $confirm        = phpgw::get_var('confirm', 
'bool', 'POST');
-                               $execute        = phpgw::get_var('execute', 
'bool', 'GET');
-                       }
+die('er denne konfigurert?');
 
-                       if ($confirm)
-                       {
-                               $this->execute($cron);
-                       }
-                       else
-                       {
-                               $this->confirm($execute=false);
-                       }
                }
-               function confirm($execute='')
-               {
-                       $link_data = array
-                       (
-                               'menuaction' => 
'property.custom_functions.index',
-                               'function'      =>$this->function_name,
-                               'execute'       => $execute,
-                       );
 
-                       if(!$execute)
-                       {
-                               $lang_confirm_msg       = lang('do you want to 
perform this action');
-                       }
 
-                       $lang_yes                       = lang('yes');
-
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('confirm_custom'));
-
-                       $msgbox_data = 
$this->bocommon->msgbox_data($this->receipt);
-
-                       $data = array
-                       (
-                               'msgbox_data'                   => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/admin/index.php'),
-                               'run_action'                    => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'message'                               => 
$this->receipt['message'],
-                               'lang_confirm_msg'              => 
$lang_confirm_msg,
-                               'lang_yes'                              => 
$lang_yes,
-                               'lang_yes_statustext'   => lang('Export info as 
files'),
-                               'lang_no_statustext'    => 'tilbake',
-                               'lang_no'                               => 
lang('no'),
-                               'lang_done'                             => 
'Avbryt',
-                               'lang_done_statustext'  => 'tilbake'
-                       );
-
-                       $appname                = lang('location');
-                       $dateformat             = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-                       $function_msg   = lang('close workorders older than 
%1', $GLOBALS['phpgw']->common->show_date($this->date,$dateformat));
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('confirm' => $data));
-                       $GLOBALS['phpgw']->xslttpl->pp();
-               }
-
-               function execute($cron='')
+               function execute()
                {
-                       $this->update_status();
-
-                       if(!$cron)
-                       {
-                               $this->confirm($execute=false);
-                       }
-
-                       $msgbox_data = 
$this->bocommon->msgbox_data($this->receipt);
-
-                       $insert_values= array(
-                               $cron,
-                               date($this->db->datetime_format()),
-                               $this->function_name,
-                               implode(',',(array_keys($msgbox_data)))
-                               );
-
-                       $insert_values  = 
$this->db->validate_insert($insert_values);
-
-                       $sql = "INSERT INTO fm_cron_log 
(cron,cron_date,process,message) "
-                                       . "VALUES ($insert_values)";
-                       $this->db->query($sql,__LINE__,__FILE__);
-               }
-
-               function update_status()
-               {
                        set_time_limit(0);
                        $sql = "SELECT id,status from fm_workorder WHERE 
entry_date < {$this->date} AND status !='closed'";
                        $this->db->query($sql,__LINE__,__FILE__);




reply via email to

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