Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git in…
Browse files Browse the repository at this point in the history
…to develop_bug2
  • Loading branch information
hregis committed Nov 15, 2018
2 parents 2d2e836 + e58dd3c commit 38b4b71
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
10 changes: 10 additions & 0 deletions htdocs/emailcollector/class/emailcollector.class.php
Expand Up @@ -702,6 +702,16 @@ public function doCollect()
*
* @return int 0=OK, Nb of error if error
*/

/**
* overwitePropertiesOfObject
*
* @param object $object Current object
* @param string $actionparam Action parameters
* @param string $messagetext Body
* @param string $subject Subject
* @return int 0=OK, Nb of error if error
*/
private function overwritePropertiesOfObject(&$object, $actionparam, $messagetext, $subject)
{
$errorforthisaction = 0;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/langs/en_US/companies.lang
Expand Up @@ -431,4 +431,4 @@ SaleRepresentativeLogin=Login of sales representative
SaleRepresentativeFirstname=First name of sales representative
SaleRepresentativeLastname=Last name of sales representative
ErrorThirdpartiesMerge=There was an error when deleting the third parties. Please check the log. Changes have been reverted.
NewCustomerSupplierCodeProposed=New customer or vendor code suggested on duplicate code
NewCustomerSupplierCodeProposed=Customer or vendor code already used, a new code is suggested
2 changes: 2 additions & 0 deletions htdocs/langs/en_US/projects.lang
Expand Up @@ -184,6 +184,7 @@ ProjectsWithThisUserAsContact=Projects with this user as contact
TasksWithThisUserAsContact=Tasks assigned to this user
ResourceNotAssignedToProject=Not assigned to project
ResourceNotAssignedToTheTask=Not assigned to the task
NoUserAssignedToTheProject=No users assigned to this project
TimeSpentBy=Time spent by
TasksAssignedTo=Tasks assigned to
AssignTaskToMe=Assign task to me
Expand Down Expand Up @@ -232,3 +233,4 @@ DontHaveTheValidateStatus=The project %s must be open to be closed
RecordsClosed=%s project(s) closed
SendProjectRef=Information project %s
ModuleSalaryToDefineHourlyRateMustBeEnabled=Module 'Payment of employee wages' must be enabled to define employee hourly rate to have time spent valorized
NewTaskRefSuggested=Task ref already used, a new task ref is suggested
22 changes: 20 additions & 2 deletions htdocs/projet/tasks.php
Expand Up @@ -246,7 +246,18 @@
}
else
{
setEventMessages($task->error,$task->errors,'errors');
if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("projects");
setEventMessages($langs->trans('NewTaskRefSuggested'),'', 'warnings');
$duplicate_code_error = true;
}
else
{
setEventMessages($task->error,$task->errors,'errors');
}
$action = 'create';
$error++;
}
}

Expand Down Expand Up @@ -462,7 +473,14 @@

// Ref
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans("Ref").'</span></td><td>';
print ($_POST["ref"]?$_POST["ref"]:$defaultref);
if (empty($duplicate_code_error))
{
print (GETPOSTISSET("ref")?GETPOST("ref",'alpha'):$defaultref);
}
else
{
print $defaultref;
}
print '<input type="hidden" name="taskref" value="'.($_POST["ref"]?$_POST["ref"]:$defaultref).'">';
print '</td></tr>';

Expand Down

0 comments on commit 38b4b71

Please sign in to comment.