Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop Conflicts: htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php
This commit is contained in:
commit
79a25248cd
@ -106,7 +106,7 @@ $search_pos_source = GETPOST('search_pos_source', 'alpha');
|
|||||||
$search_town = GETPOST('search_town', 'alpha');
|
$search_town = GETPOST('search_town', 'alpha');
|
||||||
$search_zip = GETPOST('search_zip', 'alpha');
|
$search_zip = GETPOST('search_zip', 'alpha');
|
||||||
$search_state = GETPOST("search_state");
|
$search_state = GETPOST("search_state");
|
||||||
$search_country = GETPOST("search_country", 'int');
|
$search_country = GETPOST("search_country", 'alpha');
|
||||||
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
|
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
|
||||||
$search_user = GETPOST('search_user', 'int');
|
$search_user = GETPOST('search_user', 'int');
|
||||||
$search_sale = GETPOST('search_sale', 'int');
|
$search_sale = GETPOST('search_sale', 'int');
|
||||||
@ -652,8 +652,26 @@ if ($search_zip) {
|
|||||||
if ($search_state) {
|
if ($search_state) {
|
||||||
$sql .= natural_search("state.nom", $search_state);
|
$sql .= natural_search("state.nom", $search_state);
|
||||||
}
|
}
|
||||||
if ($search_country) {
|
if (strlen(trim($search_country))) {
|
||||||
$sql .= " AND s.fk_pays IN (".$db->sanitize($db->escape($search_country)).')';
|
$arrayofcode = getCountriesInEEC();
|
||||||
|
$country_code_in_EEC = $country_code_in_EEC_without_me = '';
|
||||||
|
foreach ($arrayofcode as $key => $value) {
|
||||||
|
$country_code_in_EEC .= ($country_code_in_EEC ? "," : "")."'".$value."'";
|
||||||
|
if ($value != $mysoc->country_code) {
|
||||||
|
$country_code_in_EEC_without_me .= ($country_code_in_EEC_without_me ? "," : "")."'".$value."'";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($search_country == 'special_allnotme') {
|
||||||
|
$sql .= " AND country.code <> '".$db->escape($mysoc->country_code)."'";
|
||||||
|
} elseif ($search_country == 'special_eec') {
|
||||||
|
$sql .= " AND country.code IN (".$db->sanitize($country_code_in_EEC, 1).")";
|
||||||
|
} elseif ($search_country == 'special_eecnotme') {
|
||||||
|
$sql .= " AND country.code IN (".$db->sanitize($country_code_in_EEC_without_me, 1).")";
|
||||||
|
} elseif ($search_country == 'special_noteec') {
|
||||||
|
$sql .= " AND country.code NOT IN (".$db->sanitize($country_code_in_EEC, 1).")";
|
||||||
|
} else {
|
||||||
|
$sql .= natural_search("country.code", $search_country);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ($search_type_thirdparty != '' && $search_type_thirdparty != '-1') {
|
if ($search_type_thirdparty != '' && $search_type_thirdparty != '-1') {
|
||||||
$sql .= " AND s.fk_typent IN (".$db->sanitize($db->escape($search_type_thirdparty)).')';
|
$sql .= " AND s.fk_typent IN (".$db->sanitize($db->escape($search_type_thirdparty)).')';
|
||||||
@ -941,6 +959,9 @@ if ($resql) {
|
|||||||
if ($search_zip) {
|
if ($search_zip) {
|
||||||
$param .= '&search_zip='.urlencode($search_zip);
|
$param .= '&search_zip='.urlencode($search_zip);
|
||||||
}
|
}
|
||||||
|
if ($search_country) {
|
||||||
|
$param .= "&search_country=".urlencode($search_country);
|
||||||
|
}
|
||||||
if ($search_sale > 0) {
|
if ($search_sale > 0) {
|
||||||
$param .= '&search_sale='.urlencode($search_sale);
|
$param .= '&search_sale='.urlencode($search_sale);
|
||||||
}
|
}
|
||||||
@ -1259,7 +1280,7 @@ if ($resql) {
|
|||||||
// Country
|
// Country
|
||||||
if (!empty($arrayfields['country.code_iso']['checked'])) {
|
if (!empty($arrayfields['country.code_iso']['checked'])) {
|
||||||
print '<td class="liste_titre" align="center">';
|
print '<td class="liste_titre" align="center">';
|
||||||
print $form->select_country($search_country, 'search_country', '', 0, 'minwidth100imp maxwidth100');
|
print $form->select_country($search_country, 'search_country', '', 0, 'minwidth150imp maxwidth150', 'code2', 1, 0, 1, null, 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Company type
|
// Company type
|
||||||
|
|||||||
@ -317,7 +317,7 @@ class modKnowledgeManagement extends DolibarrModules
|
|||||||
// Define condition to show or hide menu entry. Use '$conf->knowledgemanagement->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
// Define condition to show or hide menu entry. Use '$conf->knowledgemanagement->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||||
'enabled'=>'$conf->knowledgemanagement->enabled',
|
'enabled'=>'$conf->knowledgemanagement->enabled',
|
||||||
// Use 'perms'=>'$user->rights->knowledgemanagement->level1->level2' if you want your menu with a permission rules
|
// Use 'perms'=>'$user->rights->knowledgemanagement->level1->level2' if you want your menu with a permission rules
|
||||||
'perms'=>'1',
|
'perms'=>'$user->rights->knowledgemanagement->knowledgerecord->read',
|
||||||
'target'=>'',
|
'target'=>'',
|
||||||
// 0=Menu for internal users, 1=external users, 2=both
|
// 0=Menu for internal users, 1=external users, 2=both
|
||||||
'user'=>2,
|
'user'=>2,
|
||||||
@ -337,7 +337,7 @@ class modKnowledgeManagement extends DolibarrModules
|
|||||||
// Define condition to show or hide menu entry. Use '$conf->knowledgemanagement->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
// Define condition to show or hide menu entry. Use '$conf->knowledgemanagement->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||||
'enabled'=>'$conf->knowledgemanagement->enabled',
|
'enabled'=>'$conf->knowledgemanagement->enabled',
|
||||||
// Use 'perms'=>'$user->rights->knowledgemanagement->level1->level2' if you want your menu with a permission rules
|
// Use 'perms'=>'$user->rights->knowledgemanagement->level1->level2' if you want your menu with a permission rules
|
||||||
'perms'=>'1',
|
'perms'=>'$user->rights->knowledgemanagement->knowledgerecord->read',
|
||||||
'target'=>'',
|
'target'=>'',
|
||||||
// 0=Menu for internal users, 1=external users, 2=both
|
// 0=Menu for internal users, 1=external users, 2=both
|
||||||
'user'=>2,
|
'user'=>2,
|
||||||
@ -357,7 +357,7 @@ class modKnowledgeManagement extends DolibarrModules
|
|||||||
// Define condition to show or hide menu entry. Use '$conf->knowledgemanagement->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
// Define condition to show or hide menu entry. Use '$conf->knowledgemanagement->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||||
'enabled'=>'$conf->knowledgemanagement->enabled',
|
'enabled'=>'$conf->knowledgemanagement->enabled',
|
||||||
// Use 'perms'=>'$user->rights->knowledgemanagement->level1->level2' if you want your menu with a permission rules
|
// Use 'perms'=>'$user->rights->knowledgemanagement->level1->level2' if you want your menu with a permission rules
|
||||||
'perms'=>'1',
|
'perms'=>'$user->rights->knowledgemanagement->knowledgerecord->write',
|
||||||
'target'=>'',
|
'target'=>'',
|
||||||
// 0=Menu for internal users, 1=external users, 2=both
|
// 0=Menu for internal users, 1=external users, 2=both
|
||||||
'user'=>2
|
'user'=>2
|
||||||
|
|||||||
@ -274,6 +274,7 @@ NewInter=New intervention
|
|||||||
OneLinePerTask=One line per task
|
OneLinePerTask=One line per task
|
||||||
OneLinePerPeriod=One line per period
|
OneLinePerPeriod=One line per period
|
||||||
OneLinePerTimeSpentLine=One line for each time spent declaration
|
OneLinePerTimeSpentLine=One line for each time spent declaration
|
||||||
|
AddDetailDateAndDuration=With date and duration into line description
|
||||||
RefTaskParent=Ref. Parent Task
|
RefTaskParent=Ref. Parent Task
|
||||||
ProfitIsCalculatedWith=Profit is calculated using
|
ProfitIsCalculatedWith=Profit is calculated using
|
||||||
AddPersonToTask=Add also to tasks
|
AddPersonToTask=Add also to tasks
|
||||||
|
|||||||
@ -449,6 +449,7 @@ if ($action == 'confirm_generateinvoice') {
|
|||||||
}
|
}
|
||||||
} elseif ($generateinvoicemode == 'onelineperperiod') { // One line for each time spent line
|
} elseif ($generateinvoicemode == 'onelineperperiod') { // One line for each time spent line
|
||||||
$arrayoftasks = array();
|
$arrayoftasks = array();
|
||||||
|
$withdetail=GETPOST('detail_time_duration', 'alpha');
|
||||||
foreach ($toselect as $key => $value) {
|
foreach ($toselect as $key => $value) {
|
||||||
// Get userid, timepent
|
// Get userid, timepent
|
||||||
$object->fetchTimeSpent($value);
|
$object->fetchTimeSpent($value);
|
||||||
@ -462,8 +463,13 @@ if ($action == 'confirm_generateinvoice') {
|
|||||||
$arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration;
|
$arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration;
|
||||||
$arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm;
|
$arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm;
|
||||||
$arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username.($object->timespent_note ? ' - '.$object->timespent_note : ''); // TODO Add user name in note
|
$arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username.($object->timespent_note ? ' - '.$object->timespent_note : ''); // TODO Add user name in note
|
||||||
if (!empty($conf->global->PROJECT_TIME_SPENT_INTO_INVOICE_ADD_TIME_DT)) {
|
if (!empty($withdetail)) {
|
||||||
$arrayoftasks[$object->timespent_id]['note'] .= "\n";
|
if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_DETAILS)) {
|
||||||
|
$arrayoftasks[$object->timespent_id]['note'] .= "<br/>";
|
||||||
|
} else {
|
||||||
|
$arrayoftasks[$object->timespent_id]['note'] .= "\n";
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($object->timespent_withhour)) {
|
if (!empty($object->timespent_withhour)) {
|
||||||
$arrayoftasks[$object->timespent_id]['note'] .= $langs->trans("Date") . ': ' . dol_print_date($object->timespent_datehour);
|
$arrayoftasks[$object->timespent_id]['note'] .= $langs->trans("Date") . ': ' . dol_print_date($object->timespent_datehour);
|
||||||
} else {
|
} else {
|
||||||
@ -1103,6 +1109,25 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
|
|||||||
'onelineperperiod'=>'OneLinePerTimeSpentLine',
|
'onelineperperiod'=>'OneLinePerTimeSpentLine',
|
||||||
);
|
);
|
||||||
print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1);
|
print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1);
|
||||||
|
print "\n".'<script type="text/javascript">';
|
||||||
|
print '
|
||||||
|
$(document).ready(function () {
|
||||||
|
setDetailVisibility();
|
||||||
|
$("#generateinvoicemode").change(function() {
|
||||||
|
setDetailVisibility();
|
||||||
|
});
|
||||||
|
function setDetailVisibility() {
|
||||||
|
generateinvoicemode = $("#generateinvoicemode option:selected").val();
|
||||||
|
if (generateinvoicemode=="onelineperperiod") {
|
||||||
|
$("#detail_time_duration").show();
|
||||||
|
} else {
|
||||||
|
$("#detail_time_duration").hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
';
|
||||||
|
print '</script>'."\n";
|
||||||
|
print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>'.$langs->trans('AddDetailDateAndDuration').'</span>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user