Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
timesheet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dotproject
timesheet
Commits
3946dacc
Commit
3946dacc
authored
Mar 25, 2008
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup tabs and replace them by spaces.
parent
ccd99123
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
46 deletions
+44
-46
do_timesheet_aed.php
do_timesheet_aed.php
+44
-46
No files found.
do_timesheet_aed.php
View file @
3946dacc
<?php
/*
* Copyright (C) 2007, M2X
* Copyright (C) 2007
-2008
, M2X
*
* Authors: Jean-Paul Saman
*
...
...
@@ -21,12 +21,12 @@
// create a new instance of the timesheet class
$obj
=
new
CTimesheet
();
$msg
=
''
;
// reset the message string
$msg
=
''
;
// reset the message string
// bind the informations (variables) retrieved via post to the timesheet object
if
(
!
$obj
->
bind
(
$_POST
))
{
$AppUI
->
setMsg
(
$obj
->
getError
(),
UI_MSG_ERROR
);
$AppUI
->
redirect
();
$AppUI
->
setMsg
(
$obj
->
getError
(),
UI_MSG_ERROR
);
$AppUI
->
redirect
();
}
// detect if a deleete operation has to be processed
...
...
@@ -43,47 +43,45 @@ $obj->timesheet_worked = $_POST["timesheet_worked"];
$AppUI
->
setMsg
(
'Timesheet'
);
if
(
$del
)
{
// check if there are dependencies on this object
if
(
!
$obj
->
canDelete
(
$msg
))
{
$AppUI
->
setMsg
(
$msg
,
UI_MSG_ERROR
);
$AppUI
->
redirect
();
}
// see how easy it is to run database commands with the object oriented architecture !
// simply delete a quote from db and have detailed error or success report
if
(
$msg
=
$obj
->
delete
())
{
$AppUI
->
setMsg
(
$msg
,
UI_MSG_ERROR
);
$AppUI
->
redirect
();
}
else
{
$AppUI
->
setMsg
(
"Timesheet deleted"
,
UI_MSG_ALERT
);
$AppUI
->
redirect
(
"m=timesheet"
);
}
}
else
if
(
$stat
)
{
if
(
$msg
=
$obj
->
change_status
(
$obj
->
timesheet_status
))
{
$AppUI
->
setMsg
(
$msg
,
UI_MSG_ERROR
);
$AppUI
->
redirect
();
}
else
{
$AppUI
->
setMsg
(
"Timesheet status updated"
,
UI_MSG_ALERT
);
$AppUI
->
redirect
(
"m=timesheet&a=addedit×heet_id="
.
$obj
->
timesheet_id
);
}
}
else
if
(
$period
)
{
if
(
$msg
=
$obj
->
change_period
(
$obj
->
timesheet_period
))
{
$AppUI
->
setMsg
(
$msg
,
UI_MSG_ERROR
);
$AppUI
->
redirect
();
}
else
{
$AppUI
->
setMsg
(
"Timesheet period changed"
,
UI_MSG_ALERT
);
$AppUI
->
redirect
(
"m=timesheet&a=addedit×heet_id="
.
$obj
->
timesheet_id
);
}
}
else
{
// simply store the added/edited quote in database via the store method of the timesheet
// child class of the CDpObject provided ba the dPFramework
if
((
$msg
=
$obj
->
store
()))
{
$AppUI
->
setMsg
(
$msg
,
UI_MSG_ERROR
);
}
else
{
$isNotNew
=
@
$_POST
[
'timesheet_id'
];
$AppUI
->
setMsg
(
$isNotNew
?
'Timesheet updated'
:
'Timesheet inserted'
,
UI_MSG_OK
);
}
$AppUI
->
redirect
(
"m=timesheet"
);
// check if there are dependencies on this object
if
(
!
$obj
->
canDelete
(
$msg
))
{
$AppUI
->
setMsg
(
$msg
,
UI_MSG_ERROR
);
$AppUI
->
redirect
();
}
// see how easy it is to run database commands with the object oriented architecture !
// simply delete a quote from db and have detailed error or success report
if
(
$msg
=
$obj
->
delete
())
{
$AppUI
->
setMsg
(
$msg
,
UI_MSG_ERROR
);
$AppUI
->
redirect
();
}
else
{
$AppUI
->
setMsg
(
"Timesheet deleted"
,
UI_MSG_ALERT
);
$AppUI
->
redirect
(
"m=timesheet"
);
}
}
else
if
(
$stat
)
{
if
(
$msg
=
$obj
->
change_status
(
$obj
->
timesheet_status
))
{
$AppUI
->
setMsg
(
$msg
,
UI_MSG_ERROR
);
$AppUI
->
redirect
();
}
else
{
$AppUI
->
setMsg
(
"Timesheet status updated"
,
UI_MSG_ALERT
);
$AppUI
->
redirect
(
"m=timesheet&a=addedit×heet_id="
.
$obj
->
timesheet_id
);
}
}
else
if
(
$period
)
{
if
(
$msg
=
$obj
->
change_period
(
$obj
->
timesheet_period
))
{
$AppUI
->
setMsg
(
$msg
,
UI_MSG_ERROR
);
$AppUI
->
redirect
();
}
else
{
$AppUI
->
setMsg
(
"Timesheet period changed"
,
UI_MSG_ALERT
);
$AppUI
->
redirect
(
"m=timesheet&a=addedit×heet_id="
.
$obj
->
timesheet_id
);
}
}
else
{
// simply store the added/edited quote in database via the store method of the timesheet
// child class of the CDpObject provided ba the dPFramework
if
((
$msg
=
$obj
->
store
()))
{
$AppUI
->
setMsg
(
$msg
,
UI_MSG_ERROR
);
}
else
{
$isNotNew
=
$_POST
[
'timesheet_id'
];
$AppUI
->
setMsg
(
$isNotNew
?
'Timesheet updated'
:
'Timesheet inserted'
,
UI_MSG_OK
);
}
$AppUI
->
redirect
(
"m=timesheet"
);
}
?>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment