diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index f16fec910b4..352e1db5e6b 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -324,11 +324,11 @@ if ($action == 'create') // Ref print ''.$langs->trans("Ref").''; - print 'ref).'" maxlength="12">'; + print 'ref).'" maxlength="12" autofocus>'; // Label print ''.$langs->trans("LabelBankCashAccount").''; - print ''; + print ''; // Type print ''.$langs->trans("AccountType").''; @@ -349,7 +349,7 @@ if ($action == 'create') // Status print ''.$langs->trans("Status").''; print ''; - print $form->selectarray("clos", $object->status,(isset($_POST["clos"])?$_POST["clos"]:$object->clos)); + print $form->selectarray("clos", $object->status,(GETPOST("clos",'int')!=''?GETPOST("clos",'int'):$object->clos)); print ''; // Country diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 151a9abd057..f95c75f3017 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3830,7 +3830,7 @@ function vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0) * @param float $amount Amount to format * @param integer $form Type of format, HTML or not (not by default) * @param Translate $outlangs Object langs for output - * @param int $trunc 1=Truncate if there is more decimals than MAIN_MAX_DECIMALS_SHOWN (default), 0=Does not truncate. Deprecated because amount are rounded (to unit or total amount accurancy) before inserted into database or after a computation, so this parameter should be useless. + * @param int $trunc 1=Truncate if there is more decimals than MAIN_MAX_DECIMALS_SHOWN (default), 0=Does not truncate. Deprecated because amount are rounded (to unit or total amount accurancy) before beeing inserted into database or after a computation, so this parameter should be useless. * @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOTAL) * @param int $forcerounding Force the number of decimal to forcerounding decimal (-1=do not force) * @param string $currency_code To add currency symbol (''=add nothing, 'auto'=Use default currency, 'XXX'=add currency symbols for XXX currency) diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index 5d87f42faed..1f3ae70a294 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -41,6 +41,8 @@ ALTER TABLE llx_website_page ADD COLUMN fk_user_modif integer; -- For 7.0 +ALTER TABLE llx_user ADD COLUMN birth date; + -- VMYSQL4.1 ALTER TABLE llx_holiday_users DROP PRIMARY KEY; ALTER TABLE llx_holiday_users ADD UNIQUE INDEX uk_holiday_users(fk_user, fk_type, nb_holiday); diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index ed837b49b51..71ea5a559f5 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -47,6 +47,7 @@ create table llx_user town varchar(50), -- town fk_state integer DEFAULT 0, -- fk_country integer DEFAULT 0, -- + birth date, -- birthday job varchar(128), skype varchar(255), office_phone varchar(20), diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 233e4339bca..1ec51989ee6 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -80,4 +80,5 @@ PermissionsDefDesc=Define here the new permissions provided by your module (once HooksDefDesc=Define in the module_parts['hooks'] property, in the module descriptor, the context of hooks you want to manage (list of contexts can be found by a search on 'initHooks(' in core code).
Edit the hook file to add code of your hooked functions (hookable functions can be found by a search on 'executeHooks' in core code). TriggerDefDesc=Define in the trigger file the code you want to execute for each business event executed. SeeIDsInUse=See IDs in use in your installation -SeeReservedIDsRangeHere=See range of reserved IDs \ No newline at end of file +SeeReservedIDsRangeHere=See range of reserved IDs +ToolkitForDevelopers=Toolkit for Dolibarr developers \ No newline at end of file diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index 1a9b5cde8d0..3ae08747510 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -96,7 +96,8 @@ HierarchicView=Hierarchical view UseTypeFieldToChange=Use field Type to change OpenIDURL=OpenID URL LoginUsingOpenID=Use OpenID to login -WeeklyHours=Weekly hours +WeeklyHours=Hours worked (per week) +ExpectedWorkedHours=Expected worked hours per week ColorUser=Color of the user DisabledInMonoUserMode=Disabled in maintenance mode UserAccountancyCode=User accounting code diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index c9c577742e6..93a81437b3f 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -501,7 +501,10 @@ if (count($tasksarray) > 0) if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY)) $colspan++; print ' - '.$langs->trans("Total").' + '; + print $langs->trans("Total"); + //print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; + print '
 
diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index b808017123d..50e7c4f465f 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -514,7 +514,10 @@ if (count($tasksarray) > 0) if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY)) $colspan++; print ' - '.$langs->trans("Total").' + '; + print $langs->trans("Total"); + print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; + print '
 
 
 
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 6fc06b3e51a..eb5cd9cfe48 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -511,12 +511,12 @@ if ($action == 'create' && $user->rights->projet->creer) // Ref $suggestedref=($_POST["ref"]?$_POST["ref"]:$defaultref); - print ''.$langs->trans("Ref").''; + print ''.$langs->trans("Ref").''; print ' '.$form->textwithpicto('', $langs->trans("YouCanCompleteRef", $suggestedref)); print ''; // Label - print ''.$langs->trans("Label").''; + print ''.$langs->trans("Label").''; // Thirdparty if ($conf->societe->enabled) @@ -576,20 +576,20 @@ if ($action == 'create' && $user->rights->projet->creer) // Opportunity probability print ''.$langs->trans("OpportunityProbability").''; - print ' %'; - print ''; + print ' %'; + print ''; print ''; print ''; // Opportunity amount print ''.$langs->trans("OpportunityAmount").''; - print ''; + print ''; print ''; } // Budget print ''.$langs->trans("Budget").''; - print ''; + print ''; print ''; // Description diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 40fa4db7a37..264b8665730 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -197,6 +197,8 @@ if (empty($reshook)) { $object->login = GETPOST("login", 'alpha'); $object->api_key = GETPOST("api_key", 'alpha'); $object->gender = GETPOST("gender", 'alpha'); + $birth = dol_mktime(0, 0, 0, GETPOST('birthmonth'), GETPOST('birthday'), GETPOST('birthyear')); + $object->birth = $birth; $object->admin = GETPOST("admin", 'alpha'); $object->address = GETPOST('address', 'alpha'); $object->zip = GETPOST('zipcode', 'alpha'); @@ -337,6 +339,8 @@ if (empty($reshook)) { $object->firstname = GETPOST("firstname", 'alpha'); $object->login = GETPOST("login", 'alpha'); $object->gender = GETPOST("gender", 'alpha'); + $birth = dol_mktime(0, 0, 0, GETPOST('birthmonth'), GETPOST('birthday'), GETPOST('birthyear')); + $object->birth = $birth; $object->pass = GETPOST("password"); $object->api_key = (GETPOST("api_key", 'alpha')) ? GETPOST("api_key", 'alpha') : $object->api_key; if (! empty($user->admin)) $object->admin = GETPOST("admin"); // admin flag can only be set/unset by an admin user. A test is also done later when forging sql request @@ -791,6 +795,13 @@ if ($action == 'create' || $action == 'adduserldap') print $form->selectarray('gender', $arraygender, GETPOST('gender'), 1); print ''; + // Date employment + print ''.$langs->trans("DateToBirth").''; + print ''; + echo $form->select_date(GETPOST('birth'),'birth',0,0,1,'createuser',1,0,1); + print ''; + print "\n"; + // Login print ''.$langs->trans("Login").''; print ''; @@ -1366,6 +1377,13 @@ else if ($object->gender) print $langs->trans("Gender".$object->gender); print ''; + // Date of birth + print ''.$langs->trans("DateToBirth").''; + print ''; + print dol_print_date($object->birth, 'day'); + print ''; + print "\n"; + // API key if(! empty($conf->api->enabled) && $user->admin) { print ''.$langs->trans("ApiKey").''; @@ -2004,6 +2022,13 @@ else print $form->selectarray('gender', $arraygender, GETPOST('gender')?GETPOST('gender'):$object->gender, 1); print ''; + // Date birth + print ''.$langs->trans("DateToBirth").''; + print ''; + echo $form->select_date(GETPOST('birth')?GETPOST('birth'):$object->birth,'birth',0,0,1,'updateuser',1,0,1); + print ''; + print "\n"; + // Login print "".''.$langs->trans("Login").''; print ''; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 980faafc028..df3b0d626c1 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -47,6 +47,7 @@ class User extends CommonObject public $search_sid; public $employee; public $gender; + public $birth; public $email; public $skype; public $job; @@ -179,7 +180,7 @@ class User extends CommonObject $login=trim($login); // Get user - $sql = "SELECT u.rowid, u.lastname, u.firstname, u.employee, u.gender, u.email, u.job, u.skype, u.signature, u.office_phone, u.office_fax, u.user_mobile,"; + $sql = "SELECT u.rowid, u.lastname, u.firstname, u.employee, u.gender, u.birth, u.email, u.job, u.skype, u.signature, u.office_phone, u.office_fax, u.user_mobile,"; $sql.= " u.address, u.zip, u.town, u.fk_state as state_id, u.fk_country as country_id,"; $sql.= " u.admin, u.login, u.note,"; $sql.= " u.pass, u.pass_crypted, u.pass_temp, u.api_key,"; @@ -260,6 +261,7 @@ class User extends CommonObject $this->login = $obj->login; $this->gender = $obj->gender; + $this->birth = $this->db->jdate($obj->birth); $this->pass_indatabase = $obj->pass; $this->pass_indatabase_crypted = $obj->pass_crypted; $this->pass = $obj->pass; @@ -1341,6 +1343,7 @@ class User extends CommonObject $this->employee = $this->employee?$this->employee:0; $this->login = trim($this->login); $this->gender = trim($this->gender); + $this->birth = trim($this->birth); $this->pass = trim($this->pass); $this->api_key = trim($this->api_key); $this->address = $this->address?trim($this->address):trim($this->address); @@ -1389,6 +1392,7 @@ class User extends CommonObject $sql.= ", login = '".$this->db->escape($this->login)."'"; $sql.= ", api_key = ".($this->api_key ? "'".$this->db->escape($this->api_key)."'" : "null"); $sql.= ", gender = ".($this->gender != -1 ? "'".$this->db->escape($this->gender)."'" : "null"); // 'man' or 'woman' + $sql.= ", birth=".(strval($this->birth)!='' ? "'".$this->db->idate($this->birth)."'" : 'null'); if (! empty($user->admin)) $sql.= ", admin = ".$this->admin; // admin flag can be set/unset only by an admin user $sql.= ", address = '".$this->db->escape($this->address)."'"; $sql.= ", zip = '".$this->db->escape($this->zip)."'"; @@ -1470,6 +1474,7 @@ class User extends CommonObject $adh->lastname=$this->lastname; $adh->login=$this->login; $adh->gender=$this->gender; + $adh->birth=$this->birth; $adh->pass=$this->pass;