Merge branch 'develop' of github.com:Dolibarr/dolibarr into develop

This commit is contained in:
abb 2020-07-27 13:48:12 +01:00
commit ad85671265
7 changed files with 813 additions and 528 deletions

View File

@ -39,7 +39,7 @@ TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes
JS libraries:
Ace 1.4.8 BSD Yes JS library to get code syntaxique coloration in a textarea.
ChartJS 2.9.3 MIT License Yes JS library for graph
jQuery 3.4.1 MIT License Yes JS library
jQuery 3.5.1 MIT License Yes JS library
jQuery UI 1.12.1 GPL and MIT License Yes JS library plugin UI
jQuery select2 4.0.13 GPL and Apache License Yes JS library plugin for sexier multiselect. Warning: 4.0.6+ create troubles without patching css
jQuery blockUI 2.70.0 GPL and MIT License Yes JS library plugin blockUI (to use ajax popups)

View File

@ -167,6 +167,7 @@ In htdocs/includes/tecnickcom/tcpdf/tcpdf.php
TCPDI:
------
Add fpdf_tpl.php 1.2
Add tcpdi.php
Add tcpdi_parser.php and replace:
@ -205,8 +206,6 @@ with
JCROP:
------
* Remove analytics tag into file index.html

View File

@ -54,48 +54,48 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
$extrafields_collapse_num = '';
$extrafields_collapse_num_old = '';
$i = 0;
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label)
foreach ($extrafields->attributes[$object->table_element]['label'] as $tmpkeyextra => $tmplabelextra)
{
$i++;
// Discard if extrafield is a hidden field on form
$enabled = 1;
if ($enabled && isset($extrafields->attributes[$object->table_element]['enabled'][$key]))
if ($enabled && isset($extrafields->attributes[$object->table_element]['enabled'][$tmpkeyextra]))
{
$enabled = dol_eval($extrafields->attributes[$object->table_element]['enabled'][$key], 1);
$enabled = dol_eval($extrafields->attributes[$object->table_element]['enabled'][$tmpkeyextra], 1);
}
if ($enabled && isset($extrafields->attributes[$object->table_element]['list'][$key]))
if ($enabled && isset($extrafields->attributes[$object->table_element]['list'][$tmpkeyextra]))
{
$enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1);
$enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$tmpkeyextra], 1);
}
$perms = 1;
if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$key]))
if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$tmpkeyextra]))
{
$perms = dol_eval($extrafields->attributes[$object->table_element]['perms'][$key], 1);
$perms = dol_eval($extrafields->attributes[$object->table_element]['perms'][$tmpkeyextra], 1);
}
//print $key.'-'.$enabled.'-'.$perms.'-'.$label.$_POST["options_" . $key].'<br>'."\n";
//print $tmpkeyextra.'-'.$enabled.'-'.$perms.'-'.$tmplabelextra.$_POST["options_" . $tmpkeyextra].'<br>'."\n";
if (empty($enabled)) continue; // 0 = Never visible field
if (abs($enabled) != 1 && abs($enabled) != 3 && abs($enabled) != 5 && abs($enabled) != 4) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list <> 4 = not visible at the creation
if (empty($perms)) continue; // 0 = Not visible
// Load language if required
if (!empty($extrafields->attributes[$object->table_element]['langfile'][$key])) $langs->load($extrafields->attributes[$object->table_element]['langfile'][$key]);
if (!empty($extrafields->attributes[$object->table_element]['langfile'][$tmpkeyextra])) $langs->load($extrafields->attributes[$object->table_element]['langfile'][$tmpkeyextra]);
if ($action == 'edit_extras')
{
$value = (isset($_POST["options_".$key]) ? $_POST["options_".$key] : $object->array_options["options_".$key]);
$value = (isset($_POST["options_".$tmpkeyextra]) ? $_POST["options_".$tmpkeyextra] : $object->array_options["options_".$tmpkeyextra]);
} else {
$value = $object->array_options["options_".$key];
//var_dump($key.' - '.$value);
$value = $object->array_options["options_".$tmpkeyextra];
//var_dump($tmpkeyextra.' - '.$value);
}
// Print line tr of extra field
if ($extrafields->attributes[$object->table_element]['type'][$key] == 'separate')
if ($extrafields->attributes[$object->table_element]['type'][$tmpkeyextra] == 'separate')
{
$extrafields_collapse_num = '';
$extrafield_param = $extrafields->attributes[$object->table_element]['param'][$key];
$extrafield_param = $extrafields->attributes[$object->table_element]['param'][$tmpkeyextra];
if (!empty($extrafield_param) && is_array($extrafield_param)) {
$extrafield_param_list = array_keys($extrafield_param['options']);
@ -103,14 +103,14 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
$extrafield_collapse_display_value = intval($extrafield_param_list[0]);
if ($extrafield_collapse_display_value == 1 || $extrafield_collapse_display_value == 2) {
$extrafields_collapse_num = $extrafields->attributes[$object->table_element]['pos'][$key];
$extrafields_collapse_num = $extrafields->attributes[$object->table_element]['pos'][$tmpkeyextra];
}
}
}
print $extrafields->showSeparator($key, $object);
print $extrafields->showSeparator($tmpkeyextra, $object);
$lastseparatorkeyfound = $key;
$lastseparatorkeyfound = $tmpkeyextra;
} else {
print '<tr class="trextrafields_collapse'.$extrafields_collapse_num;
/*if ($extrafields_collapse_num && $extrafields_collapse_num_old && $extrafields_collapse_num != $extrafields_collapse_num_old) {
@ -126,10 +126,10 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
print '<tr>';
print '<td class="';
if ((!empty($action) && ($action == 'create' || $action == 'edit')) && !empty($extrafields->attributes[$object->table_element]['required'][$key])) print ' fieldrequired';
if ((!empty($action) && ($action == 'create' || $action == 'edit')) && !empty($extrafields->attributes[$object->table_element]['required'][$tmpkeyextra])) print ' fieldrequired';
print '">';
if (!empty($extrafields->attributes[$object->table_element]['help'][$key])) print $form->textwithpicto($langs->trans($label), $langs->trans($extrafields->attributes[$object->table_element]['help'][$key]));
else print $langs->trans($label);
if (!empty($extrafields->attributes[$object->table_element]['help'][$tmpkeyextra])) print $form->textwithpicto($langs->trans($tmplabelextra), $langs->trans($extrafields->attributes[$object->table_element]['help'][$tmpkeyextra]));
else print $langs->trans($tmplabelextra);
print '</td>';
//TODO Improve element and rights detection
@ -147,52 +147,52 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
if ($object->element == 'mo') $permok = $user->rights->mrp->write;
$isdraft = ((isset($object->statut) && $object->statut == 0) || (isset($object->status) && $object->status == 0));
if (($isdraft || !empty($extrafields->attributes[$object->table_element]['alwayseditable'][$key]))
&& $permok && $enabled != 5 && ($action != 'edit_extras' || GETPOST('attribute') != $key)
&& empty($extrafields->attributes[$object->table_element]['computed'][$key]))
if (($isdraft || !empty($extrafields->attributes[$object->table_element]['alwayseditable'][$tmpkeyextra]))
&& $permok && $enabled != 5 && ($action != 'edit_extras' || GETPOST('attribute') != $tmpkeyextra)
&& empty($extrafields->attributes[$object->table_element]['computed'][$tmpkeyextra]))
{
$fieldid = 'id';
if ($object->table_element == 'societe') $fieldid = 'socid';
print '<td class="right"><a class="reposition editfielda" href="'.$_SERVER['PHP_SELF'].'?'.$fieldid.'='.$object->id.'&action=edit_extras&attribute='.$key.'&ignorecollapsesetup=1">'.img_edit().'</a></td>';
print '<td class="right"><a class="reposition editfielda" href="'.$_SERVER['PHP_SELF'].'?'.$fieldid.'='.$object->id.'&action=edit_extras&attribute='.$tmpkeyextra.'&ignorecollapsesetup=1">'.img_edit().'</a></td>';
}
print '</tr></table>';
print '</td>';
$html_id = !empty($object->id) ? $object->element.'_extras_'.$key.'_'.$object->id : '';
$html_id = !empty($object->id) ? $object->element.'_extras_'.$tmpkeyextra.'_'.$object->id : '';
print '<td id="'.$html_id.'" class="'.$object->element.'_extras_'.$key.' wordbreak"'.($cols ? ' colspan="'.$cols.'"' : '').'>';
print '<td id="'.$html_id.'" class="'.$object->element.'_extras_'.$tmpkeyextra.' wordbreak"'.($cols ? ' colspan="'.$cols.'"' : '').'>';
// Convert date into timestamp format
if (in_array($extrafields->attributes[$object->table_element]['type'][$key], array('date', 'datetime')))
if (in_array($extrafields->attributes[$object->table_element]['type'][$tmpkeyextra], array('date', 'datetime')))
{
$datenotinstring = $object->array_options['options_'.$key];
// print 'X'.$object->array_options['options_' . $key].'-'.$datenotinstring.'x';
if (!is_numeric($object->array_options['options_'.$key])) // For backward compatibility
$datenotinstring = $object->array_options['options_'.$tmpkeyextra];
// print 'X'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.'x';
if (!is_numeric($object->array_options['options_'.$tmpkeyextra])) // For backward compatibility
{
$datenotinstring = $db->jdate($datenotinstring);
}
//print 'x'.$object->array_options['options_' . $key].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour');
$value = isset($_POST["options_".$key]) ? dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]) : $datenotinstring;
//print 'x'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour');
$value = isset($_POST["options_".$tmpkeyextra]) ? dol_mktime($_POST["options_".$tmpkeyextra."hour"], $_POST["options_".$tmpkeyextra."min"], 0, $_POST["options_".$tmpkeyextra."month"], $_POST["options_".$tmpkeyextra."day"], $_POST["options_".$tmpkeyextra."year"]) : $datenotinstring;
}
//TODO Improve element and rights detection
if ($action == 'edit_extras' && $permok && GETPOST('attribute', 'none') == $key)
if ($action == 'edit_extras' && $permok && GETPOST('attribute', 'none') == $tmpkeyextra)
{
$fieldid = 'id';
if ($object->table_element == 'societe') $fieldid = 'socid';
print '<form enctype="multipart/form-data" action="'.$_SERVER["PHP_SELF"].'" method="post" name="formextra">';
print '<input type="hidden" name="action" value="update_extras">';
print '<input type="hidden" name="attribute" value="'.$key.'">';
print '<input type="hidden" name="attribute" value="'.$tmpkeyextra.'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="'.$fieldid.'" value="'.$object->id.'">';
print $extrafields->showInputField($key, $value, '', '', '', 0, $object->id, $object->table_element);
print $extrafields->showInputField($tmpkeyextra, $value, '', '', '', 0, $object->id, $object->table_element);
print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans('Modify')).'">';
print '</form>';
} else {
//var_dump($key.'-'.$value.'-'.$object->table_element);
print $extrafields->showOutputField($key, $value, '', $object->table_element);
//var_dump($tmpkeyextra.'-'.$value.'-'.$object->table_element);
print $extrafields->showOutputField($tmpkeyextra, $value, '', $object->table_element);
}
print '</td>';

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -235,10 +235,11 @@ if ($user->rights->projet->all->creer || $user->rights->projet->creer) {
$linktocreatetask = dolGetButtonTitle($langs->trans('AddTask'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id.'&action=create'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id), '', $linktocreatetaskUserRight, $linktocreatetaskParam);
$linktolist = dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt paddingleft imgforviewmode', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id, '', 1, array('morecss'=>'reposition'));
$linktotasks = dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt paddingleft imgforviewmode', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id, '', 1, array('morecss'=>'reposition'));
$linktotasks .= dolGetButtonTitle($langs->trans('ViewGantt'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/projet/ganttview.php?id='.$object->id.'&withproject=1', '', 1, array('morecss'=>'reposition marginleftonly btnTitleSelected'));
//print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'generic', 0, '', '', 0, 1);
print load_fiche_titre($title, $linktolist.' &nbsp; '.$linktocreatetask, 'generic');
print load_fiche_titre($title, $linktotasks.' &nbsp; '.$linktocreatetask, 'generic');
// Get list of tasks in tasksarray and taskarrayfiltered
@ -369,7 +370,17 @@ if (count($tasksarray) > 0)
//var_dump($dateformatinput);
//var_dump($dateformatinput2);
print '<br>';
$moreforfilter = '<div class="liste_titre liste_titre_bydiv centpercent">';
$moreforfilter .= '<div class="divsearchfield">';
//$moreforfilter .= $langs->trans("TasksAssignedTo").': ';
//$moreforfilter .= $form->select_dolusers($tmpuser->id > 0 ? $tmpuser->id : '', 'search_user_id', 1);
$moreforfilter .= '&nbsp;';
$moreforfilter .= '</div>';
$moreforfilter .= '</div>';
print $moreforfilter;
print '<div class="div-table-responsive">';

View File

@ -632,7 +632,8 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$title = $langs->trans("ListOfTasks");
$linktotasks = dolGetButtonTitle($langs->trans('ViewGantt'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/projet/ganttview.php?id='.$object->id.'&withproject=1', '', 1, array('morecss'=>'reposition'));
$linktotasks = dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt paddingleft imgforviewmode', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id, '', 1, array('morecss'=>'reposition btnTitleSelected'));
$linktotasks .= dolGetButtonTitle($langs->trans('ViewGantt'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/projet/ganttview.php?id='.$object->id.'&withproject=1', '', 1, array('morecss'=>'reposition marginleftonly'));
//print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'generic', 0, '', '', 0, 1);
print load_fiche_titre($title, $linktotasks.' &nbsp; '.$linktocreatetask, 'generic');