[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [7724] Removed field repeat_day form populating funct
From: |
Torstein |
Subject: |
[Fmsystem-commits] [7724] Removed field repeat_day form populating function. |
Date: |
Tue, 27 Sep 2011 05:51:01 +0000 |
Revision: 7724
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7724
Author: vator
Date: 2011-09-27 05:51:01 +0000 (Tue, 27 Sep 2011)
Log Message:
-----------
Removed field repeat_day form populating function. Removed garbish content from
populate function.
Modified Paths:
--------------
trunk/controller/inc/class.socontrol.inc.php
Modified: trunk/controller/inc/class.socontrol.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol.inc.php 2011-09-27 05:45:52 UTC
(rev 7723)
+++ trunk/controller/inc/class.socontrol.inc.php 2011-09-27 05:51:01 UTC
(rev 7724)
@@ -21,7 +21,7 @@
}
/**
- * Function for adding a new activity to the database. Updates the
activity object.
+ * Function for adding a new control to the database. Updates the
control object.
*
* @param activitycalendar_activity $activity the party to be added
* @return bool true if successful, false otherwise
@@ -35,8 +35,10 @@
$result = $this->db->query($sql, __LINE__,__FILE__);
if(isset($result)) {
- // Set the new party ID
+
+ // Set the new control ID
$control->set_id($this->db->get_last_insert_id('controller_control', 'id'));
+
// Forward this request to the update method
return $this->update($control);
}
@@ -53,31 +55,40 @@
* @param $activity the activity to be updated
* @return boolean true if successful, false otherwise
*/
-
-
function update($control)
{
$id = intval($control->get_id());
-
+
$values = array(
'title = ' . $this->marshal($control->get_title(),
'string'),
'description = ' .
$this->marshal($control->get_description(), 'string'),
'start_date = ' .
$this->marshal($control->get_start_date(), 'int'),
'end_date = ' .
$this->marshal($control->get_end_date(), 'int'),
- 'repeat_day = ' .
$this->marshal($control->get_repeat_day(), 'int'),
- 'repeat_type = ' .
$this->marshal($control->get_repeat_type(), 'int'),
- 'repeat_interval = ' .
$this->marshal($control->get_repeat_interval(), 'int'),
-
+ 'repeat_type = ' .
$this->marshal($control->get_repeat_type(), 'string'),
+ 'repeat_interval = ' .
$this->marshal($control->get_repeat_interval(), 'string'),
+ 'procedure_id = ' .
$this->marshal($control->get_procedure_id(), 'int')
);
- //var_dump('UPDATE activity_activity SET ' . join(',', $values)
. " WHERE id=$id");
$result = $this->db->query('UPDATE controller_control SET ' .
join(',', $values) . " WHERE id=$id", __LINE__,__FILE__);
- return isset($result);
+ if( isset($result) ){
+ return $id;
+ }else{
+ return 0;
+ }
+
+ // Kommenterte denne ut midlertidig.
+ //Trenger id-en som ble lagret når controllen blir lagret.
+ //return isset($result);
}
+
+
+
+
+
function get_procedure_list(){
@@ -86,22 +97,7 @@
function get_id_field_name($extended_info = false)
{
- /*
- if(!$extended_info)
- {
- $ret = 'id';
- }
- else
- {
- $ret = array
- (
- 'table' => 'activity', // alias
- 'field' => 'id',
- 'translated' => 'id'
- );
- }
- */
- return $ret;
+
}
protected function get_query(string $sort_field, boolean $ascending,
string $search_for, string $search_type, array $filters, boolean $return_count)
@@ -112,30 +108,8 @@
function populate(int $control_id, &$control)
{
- /*
- if($control == null) {
- $control = new activitycalendar_activity((int)
$activity_id);
-
-
$control->set_title($this->unmarshal($this->db->f('title'), 'string'));
-
$control->set_organization_id($this->unmarshal($this->db->f('organization_id'),
'int'));
-
$control->set_group_id($this->unmarshal($this->db->f('group_id'), 'int'));
-
$control->set_district($this->unmarshal($this->db->f('district'), 'int'));
-
$control->set_office($this->unmarshal($this->db->f('office'), 'int'));
-
$control->set_category($this->unmarshal($this->db->f('category'), 'int'));
-
$control->set_state($this->unmarshal($this->db->f('state'), 'int'));
-
$control->set_target($this->unmarshal($this->db->f('target'), 'string'));
-
$control->set_description($this->unmarshal($this->db->f('description'),
'string'));
-
$control->set_arena($this->unmarshal($this->db->f('arena'), 'string'));
-
$control->set_internal_arena($this->unmarshal($this->db->f('internal_arena'),
'string'));
-
$control->set_time($this->unmarshal($this->db->f('time'), 'string'));
-
$control->set_last_change_date($this->unmarshal($this->db->f('last_change_date'),
'int'));
-
$control->set_special_adaptation($this->unmarshal($this->db->f('special_adaptation',
'bool')));
-
$control->set_secret($this->unmarshal($this->db->f('secret'), 'string'));
-
-
- }
- */
- return $control;
+
}
+
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [7724] Removed field repeat_day form populating function.,
Torstein <=