fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7595]


From: Torstein
Subject: [Fmsystem-commits] [7595]
Date: Thu, 15 Sep 2011 07:19:15 +0000

Revision: 7595
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7595
Author:   vator
Date:     2011-09-15 07:19:15 +0000 (Thu, 15 Sep 2011)
Log Message:
-----------


Modified Paths:
--------------
    trunk/controller/inc/class.uicontrol_item.inc.php

Modified: trunk/controller/inc/class.uicontrol_item.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol_item.inc.php   2011-09-15 07:19:04 UTC 
(rev 7594)
+++ trunk/controller/inc/class.uicontrol_item.inc.php   2011-09-15 07:19:15 UTC 
(rev 7595)
@@ -4,14 +4,20 @@
        phpgw::import_class('controller.socontrol');
        phpgw::import_class('controller.socontrol_item');
        phpgw::import_class('controller.socontrol_group');
+       phpgw::import_class('controller.socontrol_type');
        
        include_class('controller', 'control', 'inc/model/');
-
+       include_class('controller', 'control_group', 'inc/model/');
+       include_class('controller', 'control_type', 'inc/model/');
+       
        class controller_uicontrol_item extends controller_uicommon
        {
                private $bo; 
                private $so;
-               private $so_proc; 
+               private $so_proc;
+               private $so_control_item;
+               private $so_control_group;
+               private $so_control_type;
                
                public $public_functions = array
                (
@@ -25,6 +31,7 @@
                        $this->so = CreateObject('controller.socontrol');
                        $this->so_control_item = 
CreateObject('controller.socontrol_item');
                        $this->so_control_group = 
CreateObject('controller.socontrol_group');
+                       $this->so_control_type = 
CreateObject('controller.socontrol_type');
                        $this->bo = CreateObject('property.boevent',true);
                }
                
@@ -35,47 +42,43 @@
                        $repeat_type = $this->bo->get_rpt_type_list();
                        $repeat_day = $this->bo->get_rpt_day_list();
 
-                       if(isset($_POST['save_control'])) // The user has 
pressed the save button
+                       if(isset($_POST['save_control_item'])) // The user has 
pressed the save button
                        {
-                               if(isset($control)) // Edit control
+                               if(isset($control_item)) // Edit control
                                {
-                                       
$control->set_title(phpgw::get_var('title'));
-                                       
$control->set_description(phpgw::get_var('description'));
-                                       $control->set_start_date( strtotime( 
phpgw::get_var('start_date')  ) );
-                                       $control->set_end_date( strtotime( 
phpgw::get_var('end_date') ) );
-                                       $control->set_repeat_day( strtotime( 
phpgw::get_var('repeat_day') ) );
-                                       $control->set_repeat_type( strtotime( 
phpgw::get_var('repeat_type') ) );
-                                       $control->set_repeat_interval( 
strtotime( phpgw::get_var('repeat_interval') ) );
-                                       $control->set_enabled( true );
+                                       
$control_item->set_title(phpgw::get_var('title'));
+                                       
$control_item->set_required(phpgw::get_var('required'));
+                                       $control_item->set_what_to_desc( 
strtotime( phpgw::get_var('what_to_desc')  ) );
+                                       $control_item->set_how_to_desc( 
strtotime( phpgw::get_var('how_to_desc') ) );
+                                       $control_item->set_control_group_id( 
strtotime( phpgw::get_var('control_group_id') ) );
+                                       $control_item->set_control_type_id( 
strtotime( phpgw::get_var('control_type_id') ) );
                                                                        
-                                       $this->so->add($control);
+                                       $this->so->add($control_item);
                                }
                                else // Add new control
                                {
 
-                                       $control = new controller_control();
+                                       $control_item = new 
controller_control();
                                        
-                                       
$control->set_title(phpgw::get_var('title'));
-                                       
$control->set_description(phpgw::get_var('description'));
-                                       $control->set_start_date( strtotime( 
phpgw::get_var('start_date')  ) );
-                                       $control->set_end_date( strtotime( 
phpgw::get_var('end_date') ) );
-                                       $control->set_repeat_day( strtotime( 
phpgw::get_var('repeat_day') ) );
-                                       $control->set_repeat_type( strtotime( 
phpgw::get_var('repeat_type') ) );
-                                       $control->set_repeat_interval( 
strtotime( phpgw::get_var('repeat_interval') ) );
-                                       $control->set_enabled( true );
+                                       
$control_item->set_title(phpgw::get_var('title'));
+                                       
$control_item->set_required(phpgw::get_var('required'));
+                                       $control_item->set_what_to_desc( 
strtotime( phpgw::get_var('what_to_desc')  ) );
+                                       $control_item->set_how_to_desc( 
strtotime( phpgw::get_var('how_to_desc') ) );
+                                       $control_item->set_control_group_id( 
strtotime( phpgw::get_var('control_group_id') ) );
+                                       $control_item->set_control_type_id( 
strtotime( phpgw::get_var('control_type_id') ) );
                                                                        
-                                       $this->so->add($control);
+                                       $this->so->add($control_item);
                                }
                        }
                        
-                       $control_item_array = 
$this->so_control_item->get_control_item_array();
-                       $control_group_array = 
$this->so_control_group->get_control_group_array();
+                       $control_item_type_array = 
$this->so_control_type->get_control_type_array();
+                       $control_item_group_array = 
$this->so_control_group->get_control_group_array();
                        
                        $this->render('control_item.php', array
                                                (
                                                'editable' => true,
-                                               'control_item_array' => 
$control_item_array,
-                                               'control_group_array' => 
$control_group_array 
+                                               'control_type_array' => 
$control_item_type_array,
+                                               'control_group_array' => 
$control_item_group_array 
                                                )
                                        );
                }




reply via email to

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