Helix Installation   Getting Started   Reference Documentation   Global Functions   Quick Start
ModulesClassesFunctions
 

Class Reference

class task extends task_ext

Hide Inherited MembersProject Management
Description
No description.
 
Constants
constantTABLENAME ["prj_task"][ task ]
 
Properties
protected_cdate[ task_db ]
protected_cdate_dirty[ task_db ]
protected_code[ task_db ]
protected_code_dirty[ task_db ]
protected_deleted[ task_db ]
protected_deleted_dirty[ task_db ]
protected_description[ task_db ]
protected_description_dirty[ task_db ]
protected_dirty[ obj ]
protected_id[ task_db ]
protected_id_dirty[ task_db ]
protected_mdate[ task_db ]
protected_mdate_dirty[ task_db ]
protected_name[ task_db ]
protected_name_dirty[ task_db ]
publicproperty_objects_array[ obj ]
protected_taskpriority_id[ task_db ]
protected_taskpriority_id_dirty[ task_db ]
protected_taskstatus_id[ task_db ]
protected_taskstatus_id_dirty[ task_db ]
 
Methods
publiccommit ( )[ task_db ]
Parameters
No parameters for this method
Code
110  public function commit()
111  {
112      if ($this->_id > 0)
113      {
114          $this->update();
115      }
116      else
117      {
118          $this->insert();
119      }
120 
121      foreach ($this->property_objects_array as $property=>$object)
122      {
123          $this->{$property} = $object;
124      }
125 
126      return true;
127  }
public__construct ( id , code , project_code )[ task_ext ]
Parameters
optionalid
optionalcode
optionalproject_code
Code
007  public function __construct($__id = null, $__code = null, $__project_code = null)
008  {
009      parent::__construct();
010     
011      if (is_null($__code) && is_null($__project_code))
012      {
013          parent::__construct($__id);
014      }
015      else
016      {
017          $db = task::db();
018          $q  = "SELECT t.* FROM prj_task t ";
019          $q .= "INNER JOIN prj_projectentity_task p_t ";
020          $q .= "ON p_t.task_id = t.id AND p_t.deleted = 0 ";
021          $q .= "INNER JOIN prj_projectentity p ";
022          $q .= "on p_t.projectentity_id = p.id AND p.deleted = 0 ";
023          $q .= "WHERE t.deleted = 0 AND t.code = '$__code' AND p.code = '$__project_code'";
024          $db->query($q);
025         
026          $this->code = $__code;
027          if ($db->next_record() && $db->num_rows() == 1)
028          {
029              $this->id = $db->f("id");
030              parent::__construct($this->id);
031          }
032         
033      }
034     
035  }
protected staticdb ( )[ task_db ]
Parameters
No parameters for this method
Code
1158  protected static function db()
1159  {
1160      return new db();
1161  }
publicdelete ( )[ task_db ]
Parameters
No parameters for this method
Code
172  public function delete()
173  {
174      $db = task::db();
175      $q  = " UPDATE prj_task SET ";
176      $q .= " deleted = 1 ";
177      $q .= " WHERE id = " . $this->_id;
178      $db->query($q);
179      $this->deleted = true;
180      return true;
181  }
public staticdelete_all ( )[ task_db ]
Parameters
No parameters for this method
Code
280  public static function delete_all()
281  {
282      $db = task::db();
283      $q  = " UPDATE prj_task SET ";
284      $q .= " deleted = 1 ";
285     
286      $db->query($q);
287      return true;
288  }
public__get ( p )[ obj ]
Parameters
requiredp
Code
007  public function __get($p)
008  {
009      $methods = get_class_methods($this);
010      $properties = get_object_vars($this);
011      if (in_array("get_$p",$methods))
012      {
013          return $this->{"get_$p"}();
014      }
015      else if (array_key_exists("_$p",$properties))
016      {
017          return $this->{"_$p"};
018      }
019      else if (in_array("get_" . substr($p,strpos($p,"_")+1), $methods))
020      {
021          return $this->{"get_" . substr($p,strpos($p,"_")+1)}(substr($p,0,strpos($p,"_")));
022      }
023      else
024      {
025          trigger_error("This object [" . get_class($this) . ":$this->id] has no private property '_$p' for the requested public property '$p'",E_USER_WARNING);
026          return null;
027      }
028  }
publicget_array ( )[ obj ]
Parameters
No parameters for this method
Code
096  public function get_array()
097  {
098      return get_object_vars($this);
099  }
publicget_budget ( type ["default"] )[ task_db ]
Parameters
optionaltype ["default"]
Code
960  public function get_budget($__type="default")
961  {
962      $object = is_null(keyval($this->property_objects_array,"{$__type}_budget")) ? new budget($this->get_budget_id($__type)) : $this->property_objects_array["{$__type}_budget"];
963      $this->property_objects_array["{$__type}_budget"] = $object;
964      return $object;
965  }
publicget_budget_id ( type ["default"] )[ task_db ]
Parameters
optionaltype ["default"]
Code
966  public function get_budget_id($__type="default")
967  {
968      $ids = $this->get_budget_ids($__type, true);
969      return (count($ids)==1 ? $ids[0] : null);
970  }
publicget_budget_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ task_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
971  public function get_budget_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
972  {
973      $budget_ids = array();
974      $db = task::db();
975      $q  = " SELECT fa_budget.id FROM prj_budget_task INNER JOIN fa_budget ON prj_budget_task.budget_id=fa_budget.id AND prj_budget_task.deleted=0 AND fa_budget.deleted=0 AND prj_budget_task.task_id='$this->id' " . (is_null($__type) ? "" : " AND prj_budget_task.budget_task_type_id='" . budget_task::type_id($__type) . "'") . ($__get_primary ? " AND prj_budget_task.primary=1 " : "");
976      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
977      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
978      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
979      $db->query($q);
980      while ($db->next_record())
981      {
982          $budget_ids[] = $db->f("id");
983      }
984      return $budget_ids;
985  }
publicget_budget_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ task_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
986  public function get_budget_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
987  {
988      $ids = $this->get_budget_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
989      $objects = array();
990      foreach ($ids as $index=>$id)
991      {
992          $objects[$index] = new budget($id);
993      }
994      return $objects;
995  }
publicget_classname ( )[ obj ]
Parameters
No parameters for this method
Code
086  public function get_classname()
087  {
088      return get_class($this);
089  }
public staticget_columns ( columns , order , lookups , where_clause , limit , offset [0] )[ task_db ]
Parameters
requiredcolumns
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
203  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
204  {
205      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
206      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
207      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
208 
209      $db = task::db();
210      $data = array();
211      $q  = " SELECT $colstring ";
212      $q .= " FROM prj_task ";
213      $q .= " WHERE prj_task.deleted = 0 ";
214      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
215      $q .= array_key_exists("taskstatus_id",$lookups) ? " AND prj_task.taskstatus_id='" . $lookups["taskstatus_id"] . "' " : "";
216      $q .= array_key_exists("taskpriority_id",$lookups) ? " AND prj_task.taskpriority_id='" . $lookups["taskpriority_id"] . "' " : "";
217 
218      if (is_string($__order))
219      {
220          $q .= "ORDER BY " . $__order;
221      }
222      else if (is_array($__order) and count($__order)>0)
223      {
224          $orderings = array();
225          foreach ($__order as $col=>$dir)
226          {
227              $orderings[] = " $col $dir ";
228          }
229          $q .= "ORDER BY " . implode(", ", $orderings);
230      }
231      else if (is_object($__order))
232      {
233          $q .= "";
234      }
235      else
236      {
237          // THERE IS NO `order` COLUMN ON THIS OBJECT
238      }
239 
240      if (!is_null($__limit))
241      {
242          $q .= " LIMIT $__offset , $__limit ";
243      }
244 
245      $db->query($q);
246 
247      if (count($colarray)>1 || $colstring=="*")
248      {
249          while ($db->next_record())
250          {
251              $data[] = $db->record;
252          }
253      }
254      else
255      {
256          while ($db->next_record())
257          {
258              $data[] = $db->f(0);
259          }
260      }
261 
262      return $data;
263  }
publicget_comment ( type ["default"] )[ task_db ]
Parameters
optionaltype ["default"]
Code
367  public function get_comment($__type="default")
368  {
369      $object = is_null(keyval($this->property_objects_array,"{$__type}_comment")) ? new comment($this->get_comment_id($__type)) : $this->property_objects_array["{$__type}_comment"];
370      $this->property_objects_array["{$__type}_comment"] = $object;
371      return $object;
372  }
publicget_comment_id ( type ["default"] )[ task_db ]
Parameters
optionaltype ["default"]
Code
373  public function get_comment_id($__type="default")
374  {
375      $ids = $this->get_comment_ids($__type, true);
376      return (count($ids)==1 ? $ids[0] : null);
377  }
publicget_comment_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ task_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
378  public function get_comment_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
379  {
380      $comment_ids = array();
381      $db = task::db();
382      $q  = " SELECT cor_comment.id FROM prj_comment_task INNER JOIN cor_comment ON prj_comment_task.comment_id=cor_comment.id AND prj_comment_task.deleted=0 AND cor_comment.deleted=0 AND prj_comment_task.task_id='$this->id' " . (is_null($__type) ? "" : " AND prj_comment_task.comment_task_type_id='" . comment_task::type_id($__type) . "'") . ($__get_primary ? " AND prj_comment_task.primary=1 " : "");
383      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
384      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
385      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
386      $db->query($q);
387      while ($db->next_record())
388      {
389          $comment_ids[] = $db->f("id");
390      }
391      return $comment_ids;
392  }
publicget_comment_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ task_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
393  public function get_comment_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
394  {
395      $ids = $this->get_comment_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
396      $objects = array();
397      foreach ($ids as $index=>$id)
398      {
399          $objects[$index] = new comment($id);
400      }
401      return $objects;
402  }
publicget_dirty ( )[ obj ]
Parameters
No parameters for this method
Code
063  public function get_dirty()
064  {
065      if ($this->id === 0)
066      {
067          $this->_dirty = true;
068      }
069      else
070      {
071          foreach (get_object_vars($this) as $k=>$v)
072          {
073              if ($this->_dirty)
074              {
075                  break;
076              }
077              if (preg_match('/_dirty$/',$k))
078              {
079                  $this->_dirty = $this->_dirty || $v;
080              }
081          }
082      }
083      return $this->_dirty;
084  }
publicget_document ( type ["default"] )[ task_db ]
Parameters
optionaltype ["default"]
Code
466  public function get_document($__type="default")
467  {
468      $object = is_null(keyval($this->property_objects_array,"{$__type}_document")) ? new document($this->get_document_id($__type)) : $this->property_objects_array["{$__type}_document"];
469      $this->property_objects_array["{$__type}_document"] = $object;
470      return $object;
471  }
publicget_document_id ( type ["default"] )[ task_db ]
Parameters
optionaltype ["default"]
Code
472  public function get_document_id($__type="default")
473  {
474      $ids = $this->get_document_ids($__type, true);
475      return (count($ids)==1 ? $ids[0] : null);
476  }
publicget_document_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ task_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
477  public function get_document_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
478  {
479      $document_ids = array();
480      $db = task::db();
481      $q  = " SELECT doc_document.id FROM prj_document_task INNER JOIN doc_document ON prj_document_task.document_id=doc_document.id AND prj_document_task.deleted=0 AND doc_document.deleted=0 AND prj_document_task.task_id='$this->id' " . (is_null($__type) ? "" : " AND prj_document_task.document_task_type_id='" . document_task::type_id($__type) . "'") . ($__get_primary ? " AND prj_document_task.primary=1 " : "");
482      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
483      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
484      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
485      $db->query($q);
486      while ($db->next_record())
487      {
488          $document_ids[] = $db->f("id");
489      }
490      return $document_ids;
491  }
publicget_document_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ task_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
492  public function get_document_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
493  {
494      $ids = $this->get_document_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
495      $objects = array();
496      foreach ($ids as $index=>$id)
497      {
498          $objects[$index] = new document($id);
499      }
500      return $objects;
501  }
publicget_entity ( type ["default"] )[ task_db ]
Parameters
optionaltype ["default"]
Code
664  public function get_entity($__type="default")
665  {
666      $object = is_null(keyval($this->property_objects_array,"{$__type}_entity")) ? new entity($this->get_entity_id($__type)) : $this->property_objects_array["{$__type}_entity"];
667      $this->property_objects_array["{$__type}_entity"] = $object;
668      return $object;
669  }
publicget_entity_id ( type ["default"] )[ task_db ]
Parameters
optionaltype ["default"]
Code
670  public function get_entity_id($__type="default")
671  {
672      $ids = $this->get_entity_ids($__type, true);
673      return (count($ids)==1 ? $ids[0] : null);
674  }
publicget_entity_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ task_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
675  public function get_entity_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
676  {
677      $entity_ids = array();
678      $db = task::db();
679      $q  = " SELECT cor_entity.id FROM prj_entity_task INNER JOIN cor_entity ON prj_entity_task.entity_id=cor_entity.id AND prj_entity_task.deleted=0 AND cor_entity.deleted=0 AND prj_entity_task.task_id='$this->id' " . (is_null($__type) ? "" : " AND prj_entity_task.entity_task_type_id='" . entity_task::type_id($__type) . "'") . ($__get_primary ? " AND prj_entity_task.primary=1 " : "");
680      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
681      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
682      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
683      $db->query($q);
684      while ($db->next_record())
685      {
686          $entity_ids[] = $db->f("id");
687      }
688      return $entity_ids;
689  }
publicget_entity_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ task_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
690  public function get_entity_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
691  {
692      $ids = $this->get_entity_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
693      $objects = array();
694      foreach ($ids as $index=>$id)
695      {
696          $objects[$index] = new entity($id);
697      }
698      return $objects;
699  }
publicget_grid_comments ( )[ task_ext ]
Parameters
No parameters for this method
Code
037  public function get_grid_comments()
038  {
039      $comments = array();
040      foreach (comment_task::get_ids(null,$this->id,null,"cdate DESC") as $comment_task_id)
041      {
042          $comment_task = new comment_task($comment_task_id);
043          $comment = new comment($comment_task->comment_id);
044          $document_text = "";
045          if ($comment->user_id > 0)
046          {
047              if (count($comment->document_ids)>0)
048              {
049                  foreach ($comment->document_list as $document)
050                  {
051                      $document_text .= "<br />";
052                      $document_text .= $document->resource_id > 0 ? "<a href=\"{$document->resource->url}?attachment\" style=\"margin-bottom:10px;\">" . ent($document->resource->name) . "</a>" : (is_null($document->code) ? $document->url : $document->code);
053                  }
054              }
055              $comments[] = str_replace("<br />","<br /><br />",$comment->body) . $document_text . " <span style=\"color:#aaaaaa;\">[{$comment->user->name} " . date("d-M-Y",strtotime($comment->cdate)) . "]</span>";
056          }
057      }
058  //        $comment_string = str_replace("<br />","",implode("\n\n",$comments));
059      $comment_string = implode("<br /><br />",$comments);
060      return $comment_string;
061  }
publicget_grid_log ( )[ task_ext ]
Parameters
No parameters for this method
Code
063  public function get_grid_log()
064  {
065      $comments = array();
066      foreach (comment_task::get_ids(null,$this->id,null,"cdate DESC") as $comment_task_id)
067      {
068          $comment_task = new comment_task($comment_task_id);
069          $comment = new comment($comment_task->comment_id);
070          if ($comment->user_id == 0)
071          {
072              $comments[] = str_replace("<br />","<br /><br />",$comment->body) . " <span style=\"color:#aaaaaa;\">[" . date("d-M-Y",strtotime($comment->cdate)) . "]</span>";
073          }
074      }
075  //        $comment_string = str_replace("<br />","",implode("\n\n",$comments));
076      $comment_string = implode("<br /><br />",$comments);
077      return $comment_string;
078  }
public staticget_ids ( order , lookups , where_clause , limit , offset [0] )[ task_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
265  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
266  {
267      return task::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
268  }
publicget_json ( )[ obj ]
Parameters
No parameters for this method
Code
101  public function get_json()
102  {
103      $class = new ReflectionClass($this->classname);
104      $methods = $class->getMethods();
105      usort($methods,"sort_reflection_objects");
106      $accessors = array();
107      foreach ($methods as $index=>$method)
108      {
109          $declarer = $method->getDeclaringClass()->name;
110          if (preg_match('/^(get|set|)_(.+)$/',$method->name,$matches))
111          {
112              $accessor = $matches[2];
113              $getset = $matches[1];
114              eval("\$accessors[\$accessor] = \$this->".$accessor.";");
115          }
116      }
117      //return json_encode($this->get_array());
118      return json_encode($accessors);
119  }
public staticget_objects ( order , lookups , where_clause , limit , offset [0] )[ task_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
270  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
271  {
272      $objects = array();
273      foreach (task::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
274      {
275          $objects[] = new task($id);
276      }
277      return $objects;
278  }
publicget_orgposition ( type ["default"] )[ task_db ]
Parameters
optionaltype ["default"]
Code
763  public function get_orgposition($__type="default")
764  {
765      $object = is_null(keyval($this->property_objects_array,"{$__type}_orgposition")) ? new orgposition($this->get_orgposition_id($__type)) : $this->property_objects_array["{$__type}_orgposition"];
766      $this->property_objects_array["{$__type}_orgposition"] = $object;
767      return $object;
768  }
publicget_orgposition_id ( type ["default"] )[ task_db ]
Parameters
optionaltype ["default"]
Code
769  public function get_orgposition_id($__type="default")
770  {
771      $ids = $this->get_orgposition_ids($__type, true);
772      return (count($ids)==1 ? $ids[0] : null);
773  }
publicget_orgposition_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ task_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
774  public function get_orgposition_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
775  {
776      $orgposition_ids = array();
777      $db = task::db();
778      $q  = " SELECT bus_orgposition.id FROM prj_orgposition_task INNER JOIN bus_orgposition ON prj_orgposition_task.orgposition_id=bus_orgposition.id AND prj_orgposition_task.deleted=0 AND bus_orgposition.deleted=0 AND prj_orgposition_task.task_id='$this->id' " . (is_null($__type) ? "" : " AND prj_orgposition_task.orgposition_task_type_id='" . orgposition_task::type_id($__type) . "'") . ($__get_primary ? " AND prj_orgposition_task.primary=1 " : "");
779      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
780      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
781      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
782      $db->query($q);
783      while ($db->next_record())
784      {
785          $orgposition_ids[] = $db->f("id");
786      }
787      return $orgposition_ids;
788  }
publicget_orgposition_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ task_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
789  public function get_orgposition_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
790  {
791      $ids = $this->get_orgposition_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
792      $objects = array();
793      foreach ($ids as $index=>$id)
794      {
795          $objects[$index] = new orgposition($id);
796      }
797      return $objects;
798  }
publicget_percentcomplete ( type ["default"] )[ task_db ]
Parameters
optionaltype ["default"]
Code
1059  public function get_percentcomplete($__type="default")
1060  {
1061      $object = is_null(keyval($this->property_objects_array,"{$__type}_percentcomplete")) ? new percentcomplete($this->get_percentcomplete_id($__type)) : $this->property_objects_array["{$__type}_percentcomplete"];
1062      $this->property_objects_array["{$__type}_percentcomplete"] = $object;
1063      return $object;
1064  }
publicget_percentcomplete_id ( type ["default"] )[ task_db ]
Parameters
optionaltype ["default"]
Code
1065  public function get_percentcomplete_id($__type="default")
1066  {
1067      $ids = $this->get_percentcomplete_ids($__type, true);
1068      return (count($ids)==1 ? $ids[0] : null);
1069  }
publicget_percentcomplete_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ task_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1070  public function get_percentcomplete_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1071  {
1072      $percentcomplete_ids = array();
1073      $db = task::db();
1074      $q  = " SELECT prj_percentcomplete.id FROM prj_percentcomplete_task INNER JOIN prj_percentcomplete ON prj_percentcomplete_task.percentcomplete_id=prj_percentcomplete.id AND prj_percentcomplete_task.deleted=0 AND prj_percentcomplete.deleted=0 AND prj_percentcomplete_task.task_id='$this->id' " . (is_null($__type) ? "" : " AND prj_percentcomplete_task.percentcomplete_task_type_id='" . percentcomplete_task::type_id($__type) . "'") . ($__get_primary ? " AND prj_percentcomplete_task.primary=1 " : "");
1075      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
1076      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
1077      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
1078      $db->query($q);
1079      while ($db->next_record())
1080      {
1081          $percentcomplete_ids[] = $db->f("id");
1082      }
1083      return $percentcomplete_ids;
1084  }
publicget_percentcomplete_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ task_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1085  public function get_percentcomplete_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1086  {
1087      $ids = $this->get_percentcomplete_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
1088      $objects = array();
1089      foreach ($ids as $index=>$id)
1090      {
1091          $objects[$index] = new percentcomplete($id);
1092      }
1093      return $objects;
1094  }
publicget_projectentity ( type ["default"] )[ task_db ]
Parameters
optionaltype ["default"]
Code
565  public function get_projectentity($__type="default")
566  {
567      $object = is_null(keyval($this->property_objects_array,"{$__type}_projectentity")) ? new projectentity($this->get_projectentity_id($__type)) : $this->property_objects_array["{$__type}_projectentity"];
568      $this->property_objects_array["{$__type}_projectentity"] = $object;
569      return $object;
570  }
publicget_projectentity_id ( type ["default"] )[ task_db ]
Parameters
optionaltype ["default"]
Code
571  public function get_projectentity_id($__type="default")
572  {
573      $ids = $this->get_projectentity_ids($__type, true);
574      return (count($ids)==1 ? $ids[0] : null);
575  }
publicget_projectentity_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ task_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
576  public function get_projectentity_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
577  {
578      $projectentity_ids = array();
579      $db = task::db();
580      $q  = " SELECT prj_projectentity.id FROM prj_projectentity_task INNER JOIN prj_projectentity ON prj_projectentity_task.projectentity_id=prj_projectentity.id AND prj_projectentity_task.deleted=0 AND prj_projectentity.deleted=0 AND prj_projectentity_task.task_id='$this->id' " . (is_null($__type) ? "" : " AND prj_projectentity_task.projectentity_task_type_id='" . projectentity_task::type_id($__type) . "'") . ($__get_primary ? " AND prj_projectentity_task.primary=1 " : "");
581      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
582      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
583      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
584      $db->query($q);
585      while ($db->next_record())
586      {
587          $projectentity_ids[] = $db->f("id");
588      }
589      return $projectentity_ids;
590  }
publicget_projectentity_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ task_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
591  public function get_projectentity_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
592  {
593      $ids = $this->get_projectentity_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
594      $objects = array();
595      foreach ($ids as $index=>$id)
596      {
597          $objects[$index] = new projectentity($id);
598      }
599      return $objects;
600  }
publicget_properties ( )[ obj ]
Parameters
No parameters for this method
Code
121  public function get_properties()
122  {
123      return array_keys($this->array);
124  }
protectedget_string ( )[ obj ]
Parameters
No parameters for this method
Code
091  protected function get_string()
092  {
093      return method_exists($this,"__toString") ? $this->__toString() : null;
094  }
publicget_taskdate ( type ["default"] )[ task_db ]
Parameters
optionaltype ["default"]
Code
862  public function get_taskdate($__type="default")
863  {
864      $object = is_null(keyval($this->property_objects_array,"{$__type}_taskdate")) ? new taskdate($this->get_taskdate_id($__type)) : $this->property_objects_array["{$__type}_taskdate"];
865      $this->property_objects_array["{$__type}_taskdate"] = $object;
866      return $object;
867  }
publicget_taskdate_id ( type ["default"] )[ task_db ]
Parameters
optionaltype ["default"]
Code
868  public function get_taskdate_id($__type="default")
869  {
870      $ids = $this->get_taskdate_ids($__type, true);
871      return (count($ids)==1 ? $ids[0] : null);
872  }
publicget_taskdate_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ task_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
873  public function get_taskdate_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
874  {
875      $taskdate_ids = array();
876      $db = task::db();
877      $q  = " SELECT prj_taskdate.id FROM prj_task_taskdate INNER JOIN prj_taskdate ON prj_task_taskdate.taskdate_id=prj_taskdate.id AND prj_task_taskdate.deleted=0 AND prj_taskdate.deleted=0 AND prj_task_taskdate.task_id='$this->id' " . (is_null($__type) ? "" : " AND prj_task_taskdate.task_taskdate_type_id='" . task_taskdate::type_id($__type) . "'") . ($__get_primary ? " AND prj_task_taskdate.primary=1 " : "");
878      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
879      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
880      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
881      $db->query($q);
882      while ($db->next_record())
883      {
884          $taskdate_ids[] = $db->f("id");
885      }
886      return $taskdate_ids;
887  }
publicget_taskdate_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ task_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
888  public function get_taskdate_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
889  {
890      $ids = $this->get_taskdate_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
891      $objects = array();
892      foreach ($ids as $index=>$id)
893      {
894          $objects[$index] = new taskdate($id);
895      }
896      return $objects;
897  }
publicget_taskpriority ( )[ task_db ]
Parameters
No parameters for this method
Code
355  public function get_taskpriority()
356  {
357      return new taskpriority($this->taskpriority_id);
358  }
publicget_taskstatus ( )[ task_db ]
Parameters
No parameters for this method
Code
343  public function get_taskstatus()
344  {
345      return new taskstatus($this->taskstatus_id);
346  }
protectedinsert ( )[ task_db ]
Parameters
No parameters for this method
Code
129  protected function insert()
130  {
131      $db = task::db();
132      $q  = " INSERT INTO prj_task ( ";
133      $q .= $db->param_string("name") . ", ";
134      $q .= $db->param_string("code") . ", ";
135      $q .= $db->param_string("description") . ", ";
136      $q .= $db->param_string("taskstatus_id") . ", ";
137      $q .= $db->param_string("taskpriority_id") . ", ";
138      $q .= $db->param_string("mdate") . ", ";
139      $q .= $db->param_string("cdate") . ", ";
140      $q .= $db->param_string("deleted");
141      $q .= " ) VALUES ( ";
142      $q .= $db->value_string($this->_name) . ", ";
143      $q .= $db->value_string($this->_code) . ", ";
144      $q .= $db->value_string($this->_description) . ", ";
145      $q .= $db->value_string($this->_taskstatus_id) . ", ";
146      $q .= $db->value_string($this->_taskpriority_id) . ", ";
147      $q .= $db->value_string(timestamp()) . ", ";
148      $q .= $db->value_string(timestamp()) . ", ";
149      $q .= $this->deleted ? "'1'" : "'0'";
150      $q .= " ) ";
151      $db->query($q);
152      $this->_id = $db->insert_id;
153      return true;
154  }
publicmap ( )[ task_db ]
Parameters
No parameters for this method
Code
098  public function map()
099  {
100      $this->_name = array_key_exists("task:name",$_REQUEST) ? reqval("task:name") : $this->_name;
101      $this->_code = array_key_exists("task:code",$_REQUEST) ? reqval("task:code") : $this->_code;
102      $this->_description = array_key_exists("task:description",$_REQUEST) ? reqval("task:description") : $this->_description;
103      $this->_taskstatus_id = array_key_exists("task:taskstatus_id",$_REQUEST) ? reqval("task:taskstatus_id") : $this->_taskstatus_id;
104      $this->_taskpriority_id = array_key_exists("task:taskpriority_id",$_REQUEST) ? reqval("task:taskpriority_id") : $this->_taskpriority_id;
105      $this->_mdate = array_key_exists("task:mdate",$_REQUEST) ? reqval("task:mdate") : $this->_mdate;
106      $this->_cdate = array_key_exists("task:cdate",$_REQUEST) ? reqval("task:cdate") : $this->_cdate;
107      $this->_deleted = array_key_exists("task:deleted",$_REQUEST) ? reqval("task:deleted") : $this->_deleted;
108  }
publicpurge ( )[ task_db ]
Parameters
No parameters for this method
Code
194  public function purge()
195  {
196      $db = task::db();
197      $q  = " DELETE FROM prj_task ";
198      $q .= " WHERE id = " . $this->_id;
199      $db->query($q);
200      return true;
201  }
public staticsearch ( keyword )[ task_db ]
public__set ( p , v )[ obj ]
Parameters
requiredp
requiredv
Code
030  public function __set($p,$v)
031  {
032      $methods = get_class_methods($this);
033      $properties = get_object_vars($this);
034      if (in_array("set_$p",$methods))
035      {
036          $this->{"set_$p"}($v);
037      }
038      else if (array_key_exists("_$p",$properties))
039      {
040          if (!preg_match('/_dirty$/',$p) && property_exists($this,"_{$p}_dirty"))
041          {
042              if (is_object($this->{"_$p"}))
043              {
044                  $this->{"_$p"}->dirty = true;
045              }
046              else
047              {
048                  $this->{"_{$p}_dirty"} = $this->{$p}==$v ? false : true;
049              }
050          }
051          $this->{"_$p"} = $v;
052      }
053      else if (in_array("set_" . substr($p,strpos($p,"_")+1), $methods))
054      {
055          $this->{"set_" . substr($p,strpos($p,"_")+1)}($v,substr($p,0,strpos($p,"_")));
056      }
057      else
058      {
059          trigger_error("This object [" . get_class($this) . ":$this->id] has no private property '_$p' for the requested public property '$p'",E_USER_WARNING);
060      }
061  }
publicset_budget ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
997  public function set_budget($__v, $__type="default")
998  {
999      $object = is_null(keyval($this->property_objects_array,"{$__type}_budget")) ? new budget($this->get_budget_id($__type)) : $this->property_objects_array["{$__type}_budget"];
1000      if (is_null($__v))
1001      {
1002          $rel = new budget_task(null,$object->id,$this->id,budget_task::type_id($__type));
1003          $rel->delete();
1004          if (!is_null(keyval($this->property_objects_array,"{$__type}_budget")))
1005          {
1006              $this->property_objects_array["{$__type}_budget"] = null;
1007          }
1008      }
1009      else
1010      {
1011          $id = $object->id;
1012          $object = $__v;
1013          $object->id = $__v->id>0 ? $__v->id : $id;
1014          $object->commit();
1015          $this->set_budget_ids(array($object->id),$__type);
1016      }
1017  }
publicset_budget_id ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1018  public function set_budget_id($__v, $__type="default")
1019  {
1020      $this->set_budget_ids(array($__v),$__type);
1021  }
publicset_budget_ids ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1022  public function set_budget_ids($__v, $__type="default")
1023  {
1024      if ($this->id == 0)
1025      {
1026          $this->commit();
1027      }
1028      $type_id = budget_task::type_id($__type);
1029      budget_task::delete_all(null,$this->id,$type_id);
1030      if (is_array($__v))
1031      {
1032          foreach ($__v as $index=>$id)
1033          {
1034              $object = new budget_task(null,$id,$this->id,$type_id);
1035              $object->deleted = false;
1036              $object->budget_task_type_id = $type_id;
1037              $object->commit();
1038              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_budget")))
1039              {
1040                  $this->property_objects_array["{$__type}_budget"] = new budget($object->budget_id);
1041              }
1042          }
1043          $this->_dirty = true;
1044      }
1045  }
publicset_budget_list ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1046  public function set_budget_list($__v, $__type="default")
1047  {
1048      if (is_array($__v))
1049      {
1050          $ids = array();
1051          foreach ($__v as $index=>$object)
1052          {
1053              $ids[] = $object->id;
1054          }
1055          $this->set_budget_ids($ids,$__type);
1056      }
1057  }
publicset_comment ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
404  public function set_comment($__v, $__type="default")
405  {
406      $object = is_null(keyval($this->property_objects_array,"{$__type}_comment")) ? new comment($this->get_comment_id($__type)) : $this->property_objects_array["{$__type}_comment"];
407      if (is_null($__v))
408      {
409          $rel = new comment_task(null,$object->id,$this->id,comment_task::type_id($__type));
410          $rel->delete();
411          if (!is_null(keyval($this->property_objects_array,"{$__type}_comment")))
412          {
413              $this->property_objects_array["{$__type}_comment"] = null;
414          }
415      }
416      else
417      {
418          $id = $object->id;
419          $object = $__v;
420          $object->id = $__v->id>0 ? $__v->id : $id;
421          $object->commit();
422          $this->set_comment_ids(array($object->id),$__type);
423      }
424  }
publicset_comment_id ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
425  public function set_comment_id($__v, $__type="default")
426  {
427      $this->set_comment_ids(array($__v),$__type);
428  }
publicset_comment_ids ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
429  public function set_comment_ids($__v, $__type="default")
430  {
431      if ($this->id == 0)
432      {
433          $this->commit();
434      }
435      $type_id = comment_task::type_id($__type);
436      comment_task::delete_all(null,$this->id,$type_id);
437      if (is_array($__v))
438      {
439          foreach ($__v as $index=>$id)
440          {
441              $object = new comment_task(null,$id,$this->id,$type_id);
442              $object->deleted = false;
443              $object->comment_task_type_id = $type_id;
444              $object->commit();
445              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_comment")))
446              {
447                  $this->property_objects_array["{$__type}_comment"] = new comment($object->comment_id);
448              }
449          }
450          $this->_dirty = true;
451      }
452  }
publicset_comment_list ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
453  public function set_comment_list($__v, $__type="default")
454  {
455      if (is_array($__v))
456      {
457          $ids = array();
458          foreach ($__v as $index=>$object)
459          {
460              $ids[] = $object->id;
461          }
462          $this->set_comment_ids($ids,$__type);
463      }
464  }
publicset_document ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
503  public function set_document($__v, $__type="default")
504  {
505      $object = is_null(keyval($this->property_objects_array,"{$__type}_document")) ? new document($this->get_document_id($__type)) : $this->property_objects_array["{$__type}_document"];
506      if (is_null($__v))
507      {
508          $rel = new document_task(null,$object->id,$this->id,document_task::type_id($__type));
509          $rel->delete();
510          if (!is_null(keyval($this->property_objects_array,"{$__type}_document")))
511          {
512              $this->property_objects_array["{$__type}_document"] = null;
513          }
514      }
515      else
516      {
517          $id = $object->id;
518          $object = $__v;
519          $object->id = $__v->id>0 ? $__v->id : $id;
520          $object->commit();
521          $this->set_document_ids(array($object->id),$__type);
522      }
523  }
publicset_document_id ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
524  public function set_document_id($__v, $__type="default")
525  {
526      $this->set_document_ids(array($__v),$__type);
527  }
publicset_document_ids ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
528  public function set_document_ids($__v, $__type="default")
529  {
530      if ($this->id == 0)
531      {
532          $this->commit();
533      }
534      $type_id = document_task::type_id($__type);
535      document_task::delete_all(null,$this->id,$type_id);
536      if (is_array($__v))
537      {
538          foreach ($__v as $index=>$id)
539          {
540              $object = new document_task(null,$id,$this->id,$type_id);
541              $object->deleted = false;
542              $object->document_task_type_id = $type_id;
543              $object->commit();
544              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_document")))
545              {
546                  $this->property_objects_array["{$__type}_document"] = new document($object->document_id);
547              }
548          }
549          $this->_dirty = true;
550      }
551  }
publicset_document_list ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
552  public function set_document_list($__v, $__type="default")
553  {
554      if (is_array($__v))
555      {
556          $ids = array();
557          foreach ($__v as $index=>$object)
558          {
559              $ids[] = $object->id;
560          }
561          $this->set_document_ids($ids,$__type);
562      }
563  }
publicset_entity ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
701  public function set_entity($__v, $__type="default")
702  {
703      $object = is_null(keyval($this->property_objects_array,"{$__type}_entity")) ? new entity($this->get_entity_id($__type)) : $this->property_objects_array["{$__type}_entity"];
704      if (is_null($__v))
705      {
706          $rel = new entity_task(null,$object->id,$this->id,entity_task::type_id($__type));
707          $rel->delete();
708          if (!is_null(keyval($this->property_objects_array,"{$__type}_entity")))
709          {
710              $this->property_objects_array["{$__type}_entity"] = null;
711          }
712      }
713      else
714      {
715          $id = $object->id;
716          $object = $__v;
717          $object->id = $__v->id>0 ? $__v->id : $id;
718          $object->commit();
719          $this->set_entity_ids(array($object->id),$__type);
720      }
721  }
publicset_entity_id ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
722  public function set_entity_id($__v, $__type="default")
723  {
724      $this->set_entity_ids(array($__v),$__type);
725  }
publicset_entity_ids ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
726  public function set_entity_ids($__v, $__type="default")
727  {
728      if ($this->id == 0)
729      {
730          $this->commit();
731      }
732      $type_id = entity_task::type_id($__type);
733      entity_task::delete_all(null,$this->id,$type_id);
734      if (is_array($__v))
735      {
736          foreach ($__v as $index=>$id)
737          {
738              $object = new entity_task(null,$id,$this->id,$type_id);
739              $object->deleted = false;
740              $object->entity_task_type_id = $type_id;
741              $object->commit();
742              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_entity")))
743              {
744                  $this->property_objects_array["{$__type}_entity"] = new entity($object->entity_id);
745              }
746          }
747          $this->_dirty = true;
748      }
749  }
publicset_entity_list ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
750  public function set_entity_list($__v, $__type="default")
751  {
752      if (is_array($__v))
753      {
754          $ids = array();
755          foreach ($__v as $index=>$object)
756          {
757              $ids[] = $object->id;
758          }
759          $this->set_entity_ids($ids,$__type);
760      }
761  }
publicset_orgposition ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
800  public function set_orgposition($__v, $__type="default")
801  {
802      $object = is_null(keyval($this->property_objects_array,"{$__type}_orgposition")) ? new orgposition($this->get_orgposition_id($__type)) : $this->property_objects_array["{$__type}_orgposition"];
803      if (is_null($__v))
804      {
805          $rel = new orgposition_task(null,$object->id,$this->id,orgposition_task::type_id($__type));
806          $rel->delete();
807          if (!is_null(keyval($this->property_objects_array,"{$__type}_orgposition")))
808          {
809              $this->property_objects_array["{$__type}_orgposition"] = null;
810          }
811      }
812      else
813      {
814          $id = $object->id;
815          $object = $__v;
816          $object->id = $__v->id>0 ? $__v->id : $id;
817          $object->commit();
818          $this->set_orgposition_ids(array($object->id),$__type);
819      }
820  }
publicset_orgposition_id ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
821  public function set_orgposition_id($__v, $__type="default")
822  {
823      $this->set_orgposition_ids(array($__v),$__type);
824  }
publicset_orgposition_ids ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
825  public function set_orgposition_ids($__v, $__type="default")
826  {
827      if ($this->id == 0)
828      {
829          $this->commit();
830      }
831      $type_id = orgposition_task::type_id($__type);
832      orgposition_task::delete_all(null,$this->id,$type_id);
833      if (is_array($__v))
834      {
835          foreach ($__v as $index=>$id)
836          {
837              $object = new orgposition_task(null,$id,$this->id,$type_id);
838              $object->deleted = false;
839              $object->orgposition_task_type_id = $type_id;
840              $object->commit();
841              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_orgposition")))
842              {
843                  $this->property_objects_array["{$__type}_orgposition"] = new orgposition($object->orgposition_id);
844              }
845          }
846          $this->_dirty = true;
847      }
848  }
publicset_orgposition_list ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
849  public function set_orgposition_list($__v, $__type="default")
850  {
851      if (is_array($__v))
852      {
853          $ids = array();
854          foreach ($__v as $index=>$object)
855          {
856              $ids[] = $object->id;
857          }
858          $this->set_orgposition_ids($ids,$__type);
859      }
860  }
publicset_percentcomplete ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1096  public function set_percentcomplete($__v, $__type="default")
1097  {
1098      $object = is_null(keyval($this->property_objects_array,"{$__type}_percentcomplete")) ? new percentcomplete($this->get_percentcomplete_id($__type)) : $this->property_objects_array["{$__type}_percentcomplete"];
1099      if (is_null($__v))
1100      {
1101          $rel = new percentcomplete_task(null,$object->id,$this->id,percentcomplete_task::type_id($__type));
1102          $rel->delete();
1103          if (!is_null(keyval($this->property_objects_array,"{$__type}_percentcomplete")))
1104          {
1105              $this->property_objects_array["{$__type}_percentcomplete"] = null;
1106          }
1107      }
1108      else
1109      {
1110          $id = $object->id;
1111          $object = $__v;
1112          $object->id = $__v->id>0 ? $__v->id : $id;
1113          $object->commit();
1114          $this->set_percentcomplete_ids(array($object->id),$__type);
1115      }
1116  }
publicset_percentcomplete_id ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1117  public function set_percentcomplete_id($__v, $__type="default")
1118  {
1119      $this->set_percentcomplete_ids(array($__v),$__type);
1120  }
publicset_percentcomplete_ids ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1121  public function set_percentcomplete_ids($__v, $__type="default")
1122  {
1123      if ($this->id == 0)
1124      {
1125          $this->commit();
1126      }
1127      $type_id = percentcomplete_task::type_id($__type);
1128      percentcomplete_task::delete_all(null,$this->id,$type_id);
1129      if (is_array($__v))
1130      {
1131          foreach ($__v as $index=>$id)
1132          {
1133              $object = new percentcomplete_task(null,$id,$this->id,$type_id);
1134              $object->deleted = false;
1135              $object->percentcomplete_task_type_id = $type_id;
1136              $object->commit();
1137              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_percentcomplete")))
1138              {
1139                  $this->property_objects_array["{$__type}_percentcomplete"] = new percentcomplete($object->percentcomplete_id);
1140              }
1141          }
1142          $this->_dirty = true;
1143      }
1144  }
publicset_percentcomplete_list ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1145  public function set_percentcomplete_list($__v, $__type="default")
1146  {
1147      if (is_array($__v))
1148      {
1149          $ids = array();
1150          foreach ($__v as $index=>$object)
1151          {
1152              $ids[] = $object->id;
1153          }
1154          $this->set_percentcomplete_ids($ids,$__type);
1155      }
1156  }
publicset_projectentity ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
602  public function set_projectentity($__v, $__type="default")
603  {
604      $object = is_null(keyval($this->property_objects_array,"{$__type}_projectentity")) ? new projectentity($this->get_projectentity_id($__type)) : $this->property_objects_array["{$__type}_projectentity"];
605      if (is_null($__v))
606      {
607          $rel = new projectentity_task(null,$object->id,$this->id,projectentity_task::type_id($__type));
608          $rel->delete();
609          if (!is_null(keyval($this->property_objects_array,"{$__type}_projectentity")))
610          {
611              $this->property_objects_array["{$__type}_projectentity"] = null;
612          }
613      }
614      else
615      {
616          $id = $object->id;
617          $object = $__v;
618          $object->id = $__v->id>0 ? $__v->id : $id;
619          $object->commit();
620          $this->set_projectentity_ids(array($object->id),$__type);
621      }
622  }
publicset_projectentity_id ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
623  public function set_projectentity_id($__v, $__type="default")
624  {
625      $this->set_projectentity_ids(array($__v),$__type);
626  }
publicset_projectentity_ids ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
627  public function set_projectentity_ids($__v, $__type="default")
628  {
629      if ($this->id == 0)
630      {
631          $this->commit();
632      }
633      $type_id = projectentity_task::type_id($__type);
634      projectentity_task::delete_all(null,$this->id,$type_id);
635      if (is_array($__v))
636      {
637          foreach ($__v as $index=>$id)
638          {
639              $object = new projectentity_task(null,$id,$this->id,$type_id);
640              $object->deleted = false;
641              $object->projectentity_task_type_id = $type_id;
642              $object->commit();
643              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_projectentity")))
644              {
645                  $this->property_objects_array["{$__type}_projectentity"] = new projectentity($object->projectentity_id);
646              }
647          }
648          $this->_dirty = true;
649      }
650  }
publicset_projectentity_list ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
651  public function set_projectentity_list($__v, $__type="default")
652  {
653      if (is_array($__v))
654      {
655          $ids = array();
656          foreach ($__v as $index=>$object)
657          {
658              $ids[] = $object->id;
659          }
660          $this->set_projectentity_ids($ids,$__type);
661      }
662  }
publicset_taskdate ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
899  public function set_taskdate($__v, $__type="default")
900  {
901      $object = is_null(keyval($this->property_objects_array,"{$__type}_taskdate")) ? new taskdate($this->get_taskdate_id($__type)) : $this->property_objects_array["{$__type}_taskdate"];
902      if (is_null($__v))
903      {
904          $rel = new task_taskdate(null,$this->id,$object->id,task_taskdate::type_id($__type));
905          $rel->delete();
906          $object->delete();
907          if (!is_null(keyval($this->property_objects_array,"{$__type}_taskdate")))
908          {
909              $this->property_objects_array["{$__type}_taskdate"] = null;
910          }
911      }
912      else
913      {
914          $object->value = is_object($__v) ? $__v->value : $__v;
915          $object->commit();
916          $this->set_taskdate_ids(array($object->id),$__type);
917      }
918  }
publicset_taskdate_id ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
919  public function set_taskdate_id($__v, $__type="default")
920  {
921      $this->set_taskdate_ids(array($__v),$__type);
922  }
publicset_taskdate_ids ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
923  public function set_taskdate_ids($__v, $__type="default")
924  {
925      if ($this->id == 0)
926      {
927          $this->commit();
928      }
929      $type_id = task_taskdate::type_id($__type);
930      task_taskdate::delete_all($this->id,null,$type_id);
931      if (is_array($__v))
932      {
933          foreach ($__v as $index=>$id)
934          {
935              $object = new task_taskdate(null,$this->id,$id,$type_id);
936              $object->deleted = false;
937              $object->task_taskdate_type_id = $type_id;
938              $object->commit();
939              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_taskdate")))
940              {
941                  $this->property_objects_array["{$__type}_taskdate"] = new taskdate($object->taskdate_id);
942              }
943          }
944          $this->_dirty = true;
945      }
946  }
publicset_taskdate_list ( v , type ["default"] )[ task_db ]
Parameters
requiredv
optionaltype ["default"]
Code
947  public function set_taskdate_list($__v, $__type="default")
948  {
949      if (is_array($__v))
950      {
951          $ids = array();
952          foreach ($__v as $index=>$object)
953          {
954              $ids[] = $object->id;
955          }
956          $this->set_taskdate_ids($ids,$__type);
957      }
958  }
publicset_taskpriority ( v )[ task_db ]
Parameters
requiredv
Code
359  public function set_taskpriority($v)
360  {
361      if ($v->id > 0)
362      {
363          $this->taskpriority_id = $v->id;
364      }
365  }
publicset_taskstatus ( v )[ task_db ]
Parameters
requiredv
Code
347  public function set_taskstatus($v)
348  {
349      if ($v->id > 0)
350      {
351          $this->taskstatus_id = $v->id;
352      }
353  }
public__toString ( )[ task_db ]
Parameters
No parameters for this method
Code
338  public function __toString()
339  {
340      return (is_null($this->name) ? "" : $this->name);
341  }
publicundelete ( )[ task_db ]
Parameters
No parameters for this method
Code
183  public function undelete()
184  {
185      $db = task::db();
186      $q  = " UPDATE prj_task SET ";
187      $q .= " deleted = 0 ";
188      $q .= " WHERE id = " . $this->_id;
189      $db->query($q);
190      $this->deleted = false;
191      return true;
192  }
protectedupdate ( )[ task_db ]
Parameters
No parameters for this method
Code
156  protected function update()
157  {
158      $db = task::db();
159      $q  = " UPDATE prj_task SET ";
160      $q .= $db->param_string("name") . " = " . $db->value_string($this->_name) . ", ";
161      $q .= $db->param_string("code") . " = " . $db->value_string($this->_code) . ", ";
162      $q .= $db->param_string("description") . " = " . $db->value_string($this->_description) . ", ";
163      $q .= $db->param_string("taskstatus_id") . " = " . $db->value_string($this->_taskstatus_id) . ", ";
164      $q .= $db->param_string("taskpriority_id") . " = " . $db->value_string($this->_taskpriority_id) . ", ";
165      $q .= $db->param_string("mdate") . " = " . $db->value_string(timestamp()) . ", ";
166      $q .= $db->param_string("deleted") . " = " . ($this->deleted ? "'1'" : "'0'");
167      $q .= " WHERE id = " . $this->_id;
168      $db->query($q);
169      return true;
170  }
 
Accessors
publicarray[ obj ]
Code
096  public function get_array()
097  {
098      return get_object_vars($this);
099  }
publicbudget[ task_db ]
Code
960  public function get_budget($__type="default")
961  {
962      $object = is_null(keyval($this->property_objects_array,"{$__type}_budget")) ? new budget($this->get_budget_id($__type)) : $this->property_objects_array["{$__type}_budget"];
963      $this->property_objects_array["{$__type}_budget"] = $object;
964      return $object;
965  }
Code
997  public function set_budget($__v, $__type="default")
998  {
999      $object = is_null(keyval($this->property_objects_array,"{$__type}_budget")) ? new budget($this->get_budget_id($__type)) : $this->property_objects_array["{$__type}_budget"];
1000      if (is_null($__v))
1001      {
1002          $rel = new budget_task(null,$object->id,$this->id,budget_task::type_id($__type));
1003          $rel->delete();
1004          if (!is_null(keyval($this->