New: More surface control into project edition
This commit is contained in:
parent
6709d3d377
commit
83ab8c05e2
@ -61,6 +61,9 @@ if ($object->id > 0)
|
|||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$date_start=dol_mktime(0,0,0,GETPOST('projectmonth','int'),GETPOST('projectday','int'),GETPOST('projectyear','int'));
|
||||||
|
$date_end=dol_mktime(0,0,0,GETPOST('projectendmonth','int'),GETPOST('projectendday','int'),GETPOST('projectendyear','int'));;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -129,8 +132,8 @@ if ($action == 'add' && $user->rights->projet->creer)
|
|||||||
$object->description = GETPOST('description','alpha');
|
$object->description = GETPOST('description','alpha');
|
||||||
$object->public = GETPOST('public','alpha');
|
$object->public = GETPOST('public','alpha');
|
||||||
$object->datec=dol_now();
|
$object->datec=dol_now();
|
||||||
$object->date_start=dol_mktime(0,0,0,GETPOST('projectmonth','int'),GETPOST('projectday','int'),GETPOST('projectyear','int'));
|
$object->date_start=$date_start;
|
||||||
$object->date_end=dol_mktime(0,0,0,GETPOST('projectendmonth','int'),GETPOST('projectendday','int'),GETPOST('projectendyear','int'));
|
$object->date_end=$date_end;
|
||||||
|
|
||||||
$result = $object->create($user);
|
$result = $object->create($user);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
@ -193,13 +196,13 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer)
|
|||||||
|
|
||||||
$old_start_date = $object->date_start;
|
$old_start_date = $object->date_start;
|
||||||
|
|
||||||
$object->ref = GETPOST('ref','alpha');
|
$object->ref = GETPOST('ref','alpha');
|
||||||
$object->title = GETPOST('title','alpha');
|
$object->title = GETPOST('title','alpha');
|
||||||
$object->socid = GETPOST('socid','int');
|
$object->socid = GETPOST('socid','int');
|
||||||
$object->description = GETPOST('description','alpha');
|
$object->description = GETPOST('description','alpha');
|
||||||
$object->public = GETPOST('public','alpha');
|
$object->public = GETPOST('public','alpha');
|
||||||
$object->date_start = empty($_POST["project"])?'':dol_mktime(0,0,0,GETPOST('projectmonth'),GETPOST('projectday'),GETPOST('projectyear'));
|
$object->date_start = empty($_POST["project"])?'':$date_start;
|
||||||
$object->date_end = empty($_POST["projectend"])?'':dol_mktime(0,0,0,GETPOST('projectendmonth'),GETPOST('projectendday'),GETPOST('projectendyear'));
|
$object->date_end = empty($_POST["projectend"])?'':$date_end;
|
||||||
|
|
||||||
$result=$object->update($user);
|
$result=$object->update($user);
|
||||||
|
|
||||||
@ -387,12 +390,12 @@ if ($action == 'create' && $user->rights->projet->creer)
|
|||||||
|
|
||||||
// Date start
|
// Date start
|
||||||
print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
|
print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
|
||||||
print $form->select_date('','project');
|
print $form->select_date(($date_start?$date_start:''),'project');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Date end
|
// Date end
|
||||||
print '<tr><td>'.$langs->trans("DateEnd").'</td><td>';
|
print '<tr><td>'.$langs->trans("DateEnd").'</td><td>';
|
||||||
print $form->select_date(-1,'projectend');
|
print $form->select_date(($date_end?$date_end:-1),'projectend');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
@ -519,10 +522,10 @@ else
|
|||||||
|
|
||||||
// Date start
|
// Date start
|
||||||
print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
|
print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
|
||||||
print $form->select_date($object->date_start,'project');
|
print $form->select_date($object->date_start?$object->date_start:-1,'project');
|
||||||
print '<input type="checkbox" name="reportdate" value="yes" ';
|
print ' <input type="checkbox" name="reportdate" value="yes" ';
|
||||||
if ($comefromclone){print ' checked="checked" ';}
|
if ($comefromclone){print ' checked="checked" ';}
|
||||||
print '/>'. $langs->trans("ProjectReportDate");
|
print '/> '. $langs->trans("ProjectReportDate");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Date end
|
// Date end
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -212,7 +212,10 @@ if ($id > 0 || ! empty($ref))
|
|||||||
else print $langs->trans('PrivateProject');
|
else print $langs->trans('PrivateProject');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Date start
|
// Statut
|
||||||
|
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
|
||||||
|
|
||||||
|
// Date start
|
||||||
print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
|
print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
|
||||||
print dol_print_date($object->date_start,'day');
|
print dol_print_date($object->date_start,'day');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -222,9 +225,6 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print dol_print_date($object->date_end,'day');
|
print dol_print_date($object->date_end,'day');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Statut
|
|
||||||
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user