WIP Option PROJECT_BILL_TIME_SPENT
This commit is contained in:
parent
de89893d57
commit
82475e2e5f
@ -55,6 +55,7 @@ TasksOnOpenedProject=Tasks on open projects
|
||||
WorkloadNotDefined=Workload not defined
|
||||
NewTimeSpent=Time spent
|
||||
MyTimeSpent=My time spent
|
||||
BillTime=Bill the time spent
|
||||
Tasks=Tasks
|
||||
Task=Task
|
||||
TaskDateStart=Task start date
|
||||
|
||||
@ -161,6 +161,7 @@ if (empty($reshook))
|
||||
$object->statut = $status;
|
||||
$object->opp_status = $opp_status;
|
||||
$object->opp_percent = $opp_percent;
|
||||
$object->bill_time = (GETPOST('bill_time','alpha')=='on'?1:0);
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||
@ -261,6 +262,7 @@ if (empty($reshook))
|
||||
if (isset($_POST['budget_amount'])) $object->budget_amount= price2num(GETPOST('budget_amount','alpha'));
|
||||
if (isset($_POST['opp_status'])) $object->opp_status = $opp_status;
|
||||
if (isset($_POST['opp_percent'])) $object->opp_percent = $opp_percent;
|
||||
$object->bill_time = (GETPOST('bill_time','alpha')=='on'?1:0);
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||
@ -599,6 +601,14 @@ if ($action == 'create' && $user->rights->projet->creer)
|
||||
print '<textarea name="description" wrap="soft" class="centpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST("description",'none')).'</textarea>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Bill time
|
||||
if (! empty($conf->global->PROJECT_BILL_TIME_SPENT))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BillTime").'</td>';
|
||||
print '<td><input type="checkbox" name="bill_time"'.(GETPOST('bill_time','alpha')!=''?' checked="checked"':'').'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if ($conf->categorie->enabled) {
|
||||
// Categories
|
||||
print '<tr><td>'.$langs->trans("Categories").'</td><td colspan="3">';
|
||||
@ -826,6 +836,14 @@ elseif ($object->id > 0)
|
||||
print '<textarea name="description" wrap="soft" class="centpercent" rows="'.ROWS_3.'">'.$object->description.'</textarea>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Bill time
|
||||
if (! empty($conf->global->PROJECT_BILL_TIME_SPENT))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BillTime").'</td>';
|
||||
print '<td><input type="checkbox" name="bill_time"'.((GETPOSTISSET('bill_time')?GETPOST('bill_time','alpha'):$object->bill_time) ? ' checked="checked"' : '').'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Tags-Categories
|
||||
if ($conf->categorie->enabled)
|
||||
{
|
||||
@ -948,6 +966,14 @@ elseif ($object->id > 0)
|
||||
print nl2br($object->description);
|
||||
print '</td></tr>';
|
||||
|
||||
// Bill time
|
||||
if (! empty($conf->global->PROJECT_BILL_TIME_SPENT))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("BillTime").'</td>';
|
||||
print '<td>'.yn($object->bill_time).'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Categories
|
||||
if($conf->categorie->enabled) {
|
||||
print '<tr><td valign="middle">'.$langs->trans("Categories").'</td><td>';
|
||||
|
||||
@ -64,6 +64,7 @@ class Project extends CommonObject
|
||||
var $user_close_id;
|
||||
var $public; //!< Tell if this is a public or private project
|
||||
var $budget_amount;
|
||||
var $bill_time; // Is the time spent on project must be invoiced or not
|
||||
|
||||
var $statuts_short;
|
||||
var $statuts_long;
|
||||
@ -178,6 +179,7 @@ class Project extends CommonObject
|
||||
$sql.= ", datee";
|
||||
$sql.= ", opp_amount";
|
||||
$sql.= ", budget_amount";
|
||||
$sql.= ", bill_time";
|
||||
$sql.= ", entity";
|
||||
$sql.= ") VALUES (";
|
||||
$sql.= "'" . $this->db->escape($this->ref) . "'";
|
||||
@ -297,6 +299,7 @@ class Project extends CommonObject
|
||||
$sql.= ", opp_amount = " . (strcmp($this->opp_amount, '') ? price2num($this->opp_amount) : "null");
|
||||
$sql.= ", budget_amount = " . (strcmp($this->budget_amount, '') ? price2num($this->budget_amount) : "null");
|
||||
$sql.= ", fk_user_modif = " . $user->id;
|
||||
$sql.= ", bill_time = " . ($this->bill_time ? 1 : 0);
|
||||
$sql.= " WHERE rowid = " . $this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||
@ -394,7 +397,8 @@ class Project extends CommonObject
|
||||
if (empty($id) && empty($ref)) return -1;
|
||||
|
||||
$sql = "SELECT rowid, ref, title, description, public, datec, opp_amount, budget_amount,";
|
||||
$sql.= " tms, dateo, datee, date_close, fk_soc, fk_user_creat, fk_user_modif, fk_user_close, fk_statut, fk_opp_status, opp_percent, note_private, note_public, model_pdf";
|
||||
$sql.= " tms, dateo, datee, date_close, fk_soc, fk_user_creat, fk_user_modif, fk_user_close, fk_statut, fk_opp_status, opp_percent,";
|
||||
$sql.= " note_private, note_public, model_pdf, bill_time";
|
||||
$sql.= " FROM " . MAIN_DB_PREFIX . "projet";
|
||||
if (! empty($id))
|
||||
{
|
||||
@ -441,6 +445,7 @@ class Project extends CommonObject
|
||||
$this->opp_percent = $obj->opp_percent;
|
||||
$this->budget_amount = $obj->budget_amount;
|
||||
$this->modelpdf = $obj->model_pdf;
|
||||
$this->bill_time = (int) $obj->bill_time;
|
||||
|
||||
$this->db->free($resql);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user