Commit 23df88df authored by Jean-Paul Saman's avatar Jean-Paul Saman

Show selected timesheet

parent 4be46f9b
This diff is collapsed.
......@@ -45,7 +45,6 @@ class CTimesheet extends w2p_Core_BaseObject {
// the constructor of the CTimesheet class, always combined with the table name and the unique key of the table
public function __construct() {
parent::__construct('timesheet', 'timesheet_id');
$this->timesheet_id=$_POST["timesheet_id"];
}
public function isValid() {
......@@ -56,8 +55,16 @@ class CTimesheet extends w2p_Core_BaseObject {
return (count($this->_error)) ? false : true;
}
public function loadFull() {
// loadFull information for this timesheet
public function loadFull($notUsed = null, $timesheet_id) {
// loadFull information for this timesheet\
}
public function load($notUsed = null, $timesheet_id) {
$q = $this->_getQuery();
$q->addQuery('*');
$q->addTable('timesheet');
$q->addWhere('timesheet_id =' . (int)$timesheet_id);
$q->loadObject($this, true, false);
}
protected function init() {
......@@ -80,7 +87,7 @@ class CTimesheet extends w2p_Core_BaseObject {
{
$q = $this->_getQuery();
$q->setDelete('timesheet_project');
$q->addWhere('timesheet_id = '. $this->timesheet_id);
$q->addWhere('timesheet_id = '. (int) $this->timesheet_id);
if (!($q->exec())) {
$this->_error['project-purge-timesheet'] = db_error();
return false;
......@@ -92,7 +99,7 @@ class CTimesheet extends w2p_Core_BaseObject {
{
// Get the current timesheet period
$period = new w2p_UtilitiesDate($_POST['timesheet_period']);
//$period->setDate($_POST['timesheet_period'],DATE_FORMAT_UNIXTIME);
$period->setDate($_POST['timesheet_period'],DATE_FORMAT_UNIXTIME);
$q = $this->_getQuery();
$q->addQuery('project_id');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment