Merge branch 'Dolibarr:develop' into fix-26066

This commit is contained in:
Pascal Hubrecht
2023-09-29 17:00:23 +02:00
committed by GitHub
59 changed files with 682 additions and 371 deletions

View File

@@ -90,8 +90,8 @@ $arrayfields = array(
'aa.pcg_type'=>array('label'=>"Pcgtype", 'checked'=>1, 'help'=>'PcgtypeDesc'),
'categories'=>array('label'=>"AccountingCategories", 'checked'=>-1, 'help'=>'AccountingCategoriesDesc'),
'aa.reconcilable'=>array('label'=>"Reconcilable", 'checked'=>1),
'aa.active'=>array('label'=>"Activated", 'checked'=>1),
'aa.import_key'=>array('label'=>"ImportId", 'checked'=>-1)
'aa.import_key'=>array('label'=>"ImportId", 'checked'=>-1),
'aa.active'=>array('label'=>"Activated", 'checked'=>1)
);
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
@@ -448,7 +448,7 @@ if ($resql) {
print '<br>';
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields
$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
$moreforfilter = '';
@@ -581,8 +581,9 @@ if ($resql) {
print_liste_field_titre($arrayfields['aa.active']['label'], $_SERVER["PHP_SELF"], 'aa.active', '', $param, '', $sortfield, $sortorder);
$totalarray['nbfield']++;
}
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
$totalarray['nbfield']++;
}
print "</tr>\n";
@@ -601,15 +602,25 @@ if ($resql) {
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="nowrap center">';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
if (in_array($obj->rowid, $arrayofselected)) {
$selected = 1;
print '<td class="center nowraponall">';
if ($user->hasRight('accounting', 'chartofaccount')) {
print '<a class="editfielda" href="./card.php?action=update&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?'.$param).'">';
print img_edit();
print '</a>';
print '&nbsp;';
print '<a class="marginleftonly" href="./card.php?action=delete&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?'.$param).'">';
print img_delete();
print '</a>';
print '&nbsp;';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
if (in_array($obj->rowid, $arrayofselected)) {
$selected = 1;
}
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
}
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
}
print '</td>';
print '</td>'."\n";
if (!$i) {
$totalarray['nbfield']++;
}
@@ -627,7 +638,7 @@ if ($resql) {
// Account label
if (!empty($arrayfields['aa.label']['checked'])) {
print "<td>";
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->label).'">';
print dol_escape_htmltag($obj->label);
print "</td>\n";
if (!$i) {
@@ -747,15 +758,25 @@ if ($resql) {
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="center">';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
if (in_array($obj->rowid, $arrayofselected)) {
$selected = 1;
print '<td class="center nowraponall">';
if ($user->hasRight('accounting', 'chartofaccount')) {
print '<a class="editfielda" href="./card.php?action=update&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?'.$param).'">';
print img_edit();
print '</a>';
print '&nbsp;';
print '<a class="marginleftonly" href="./card.php?action=delete&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?'.$param).'">';
print img_delete();
print '</a>';
print '&nbsp;';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
if (in_array($obj->rowid, $arrayofselected)) {
$selected = 1;
}
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
}
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
}
print '</td>';
print '</td>'."\n";
if (!$i) {
$totalarray['nbfield']++;
}

View File

@@ -381,7 +381,7 @@ if ($action == 'create') {
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';
print '<table class="border centpercent tableforfield">';
// Label
print '<tr><td class="titlefield">'.$langs->trans("Label").'</td>';

View File

@@ -131,8 +131,12 @@ print '<table class="border centpercent">';
// Select the category
print '<tr><td class="titlefield">'.$langs->trans("AccountingCategory").'</td>';
print '<td>';
print $formaccounting->select_accounting_category($cat_id, 'account_category', 1, 0, 0, 0);
print '<input type="submit" class="button small" value="'.$langs->trans("Select").'">';
$s = $formaccounting->select_accounting_category($cat_id, 'account_category', 1, 0, 0, 0);
if ($formaccounting->nbaccounts_category <= 0) {
print '<span class="opacitymedium">'.$s.'</span>';
} else {
print '<input type="submit" class="button small" value="'.$langs->trans("Select").'">';
}
print '</td></tr>';
print '</table>';

View File

@@ -58,9 +58,10 @@ $listlimit = GETPOST('listlimit', 'int') > 0 ?GETPOST('listlimit', 'int') : 1000
$sortfield = GETPOST("sortfield", 'aZ09comma');
$sortorder = GETPOST("sortorder", 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) {
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
// If $page is not defined, or '' or -1 or if we click on clear filters
$page = 0;
} // If $page is not defined, or '' or -1
}
$offset = $listlimit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
@@ -450,7 +451,7 @@ if (empty($sortfield)) {
$sql .= $db->order($sortfield, $sortorder);
$sql .= $db->plimit($listlimit + 1, $offset);
//print $sql;
$fieldlist = explode(',', $tabfield[$id]);
@@ -468,7 +469,9 @@ if ($sortfield) {
if (GETPOST('from', 'alpha')) {
$paramwithsearch .= '&from='.urlencode(GETPOST('from', 'alpha'));
}
if ($listlimit) {
$paramwithsearch .= '&listlimit='.urlencode(GETPOST('listlimit', 'int'));
}
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from', 'alpha')).'">';
@@ -476,7 +479,7 @@ print '<input type="hidden" name="sortfield" value="'.dol_escape_htmltag($sortfi
print '<input type="hidden" name="sortorder" value="'.dol_escape_htmltag($sortorder).'">';
print '<div class="div-table-responsive">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
// Form to add a new line
@@ -485,6 +488,10 @@ if ($tabname[$id]) {
// Line for title
print '<tr class="liste_titre">';
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td></td>';
}
foreach ($fieldlist as $field => $value) {
// Determine le nom du champ par rapport aux noms possibles
// dans les dictionnaires de donnees
@@ -524,6 +531,7 @@ if ($tabname[$id]) {
}
if ($fieldlist[$field] == 'range_account') {
$valuetoshow = $langs->trans("Comment");
$class = 'width75';
}
if ($fieldlist[$field] == 'category_type') {
$valuetoshow = $langs->trans("Calculated");
@@ -546,13 +554,20 @@ if ($tabname[$id]) {
print '<input type="hidden" name="id" value="'.$id.'">';
print '</td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td></td>';
}
print '</tr>';
// Line to enter new values
print '<tr class="oddeven nodrag nodrop nohover">';
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td></td>';
}
$obj = new stdClass();
// If data was already input, we define them in obj to populate input fields.
if (GETPOST('actionadd', 'alpha')) {
@@ -572,19 +587,29 @@ if ($tabname[$id]) {
fieldListAccountingCategories($fieldlist, $obj, $tabname[$id], 'add');
}
print '<td colspan="4" class="right">';
print '<td colspan="2" class="right">';
print '<input type="submit" class="button button-add" name="actionadd" value="'.$langs->trans("Add").'">';
print '</td>';
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td></td>';
}
print "</tr>";
$colspan = count($fieldlist) + 3;
if ($id == 32) {
$colspan++;
}
print '<tr><td colspan="'.$colspan.'">&nbsp;</td></tr>'; // Keep &nbsp; to have a line with enough height
}
print '</table>';
print '</div>';
print '<div class="div-table-responsive">';
print '<table class="noborder centpercent">';
// List of available record in database
dol_syslog("htdocs/accountancy/admin/categories_list.php", LOG_DEBUG);
@@ -595,13 +620,37 @@ if ($resql) {
// There is several pages
if ($num > $listlimit) {
print '<tr class="none"><td class="right" colspan="'.(3 + count($fieldlist)).'">';
print '<tr class="none"><td class="right" colspan="'.(2 + count($fieldlist)).'">';
print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), '<li class="pagination"><span>'.$langs->trans("Page").' '.($page + 1).'</span></li>');
print '</td></tr>';
}
$filterfound = 0;
foreach ($fieldlist as $field => $value) {
$showfield = 1; // By defaut
if ($fieldlist[$field] == 'region_id' || $fieldlist[$field] == 'country_id') {
$showfield = 0;
}
if ($showfield) {
if ($value == 'country') {
$filterfound++;
}
}
}
// Title line with search boxes
print '<tr class="liste_titre liste_titre_add liste_titre_filter">';
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="liste_titre center">';
if ($filterfound) {
$searchpicto = $form->showFilterAndCheckAddButtons(0);
print $searchpicto;
}
print '</td>';
}
$filterfound = 0;
foreach ($fieldlist as $field => $value) {
$showfield = 1; // By defaut
@@ -623,17 +672,23 @@ if ($resql) {
}
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre center">';
if ($filterfound) {
$searchpicto = $form->showFilterAndCheckAddButtons(0);
print $searchpicto;
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="liste_titre center">';
if ($filterfound) {
$searchpicto = $form->showFilterAndCheckAddButtons(0);
print $searchpicto;
}
print '</td>';
}
print '</td>';
print '</tr>';
// Title of lines
print '<tr class="liste_titre">';
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print getTitleFieldOfList('');
}
foreach ($fieldlist as $field => $value) {
// Determines the name of the field in relation to the possible names
// in data dictionaries
@@ -707,16 +762,22 @@ if ($resql) {
print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable ? $fieldlist[$field] : ''), ($page ? 'page='.$page.'&' : ''), $param, "", $sortfield, $sortorder, $class.' ');
}
}
print getTitleFieldOfList($langs->trans("ListOfAccounts"), 0, $_SERVER["PHP_SELF"], "", ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, '');
print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, 'center ');
print getTitleFieldOfList('');
print getTitleFieldOfList('');
print getTitleFieldOfList('');
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print getTitleFieldOfList('');
}
print '</tr>';
if ($num) {
$imaxinloop = ($listlimit ? min($num, $listlimit) : $num);
// Lines with values
while ($i < $num) {
while ($i < $imaxinloop) {
$obj = $db->fetch_object($resql);
//print_r($obj);
print '<tr class="oddeven" id="rowid-'.$obj->rowid.'">';
if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) {
@@ -725,12 +786,16 @@ if ($resql) {
$reshook = $hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
$error = $hookmanager->error; $errors = $hookmanager->errors;
// Actions
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td></td>';
}
// Show fields
if (empty($reshook)) {
fieldListAccountingCategories($fieldlist, $obj, $tabname[$id], 'edit');
}
print '<td></td>';
print '<td></td>';
print '<td class="center">';
print '<div name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'"></div>';
@@ -739,18 +804,52 @@ if ($resql) {
print '<input type="submit" class="button button-edit smallpaddingimp" name="actionmodify" value="'.$langs->trans("Modify").'">';
print '<input type="submit" class="button button-cancel smallpaddingimp" name="actioncancel" value="'.$langs->trans("Cancel").'">';
print '</td>';
print '<td></td>';
// Actions
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td></td>';
}
} else {
// Can an entry be erased or disabled ?
$iserasable = 1; $canbedisabled = 1; $canbemodified = 1; // true by default
if (isset($obj->code)) {
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) {
$iserasable = 0; $canbedisabled = 0;
}
}
$url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : '');
if ($param) {
$url .= '&'.$param;
}
$url .= '&';
$canbemodified = $iserasable;
$tmpaction = 'view';
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
$reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
$error = $hookmanager->error; $errors = $hookmanager->errors;
// Actions
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="center">';
if ($canbemodified) {
print '<a class="reposition editfielda marginleftonly marginrightonly" href="'.$url.'action=edit&token='.newToken().'">'.img_edit().'</a>';
}
if ($iserasable) {
if ($user->admin) {
print '<a class="marginleftonly marginrightonly" href="'.$url.'action=delete&token='.newToken().'">'.img_delete().'</a>';
}
}
print '</td>';
}
if (empty($reshook)) {
foreach ($fieldlist as $field => $value) {
$showfield = 1;
$class = "left";
$title = '';
$class = 'tddict';
$tmpvar = $fieldlist[$field];
$valuetoshow = $obj->$tmpvar;
if ($value == 'category_type') {
@@ -764,43 +863,35 @@ if ($resql) {
$key = $langs->trans("Country".strtoupper($obj->country_code));
$valuetoshow = ($key != "Country".strtoupper($obj->country_code) ? $obj->country_code." - ".$key : $obj->country);
}
} elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_country') {
$key = $langs->trans("Country".strtoupper($obj->code));
$valuetoshow = ($obj->code && $key != "Country".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
} elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_availability') {
$langs->loadLangs(array("propal"));
$key = $langs->trans("AvailabilityType".strtoupper($obj->code));
$valuetoshow = ($obj->code && $key != "AvailabilityType".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
} elseif ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_actioncomm') {
$key = $langs->trans("Action".strtoupper($obj->code));
$valuetoshow = ($obj->code && $key != "Action".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
} elseif (in_array($fieldlist[$field], array('label', 'range_account', 'formula'))) {
$class = "tdoverflowmax250";
$title = $valuetoshow;
} elseif ($fieldlist[$field] == 'region_id' || $fieldlist[$field] == 'country_id') {
$showfield = 0;
}
$class = 'tddict';
// Show value for field
if ($showfield) {
print '<!-- '.$fieldlist[$field].' --><td class="'.$class.'">'.dol_escape_htmltag($valuetoshow).'</td>';
print '<!-- '.$fieldlist[$field].' --><td class="'.$class.'"'.($title ? ' title="'.dol_escape_htmltag($title).'"': '').'>'.dol_escape_htmltag($valuetoshow).'</td>';
}
}
}
// Can an entry be erased or disabled ?
$iserasable = 1; $canbedisabled = 1; $canbemodified = 1; // true by default
if (isset($obj->code)) {
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) {
$iserasable = 0; $canbedisabled = 0;
}
}
// Link to setup the group
print '<td>';
if (empty($obj->formula)) {
// Count number of accounts into group
$nbofaccountintogroup = 0;
$listofaccountintogroup = $accountingcategory->getCptsCat($obj->rowid);
$nbofaccountintogroup = count($listofaccountintogroup);
$canbemodified = $iserasable;
$url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : '');
if ($param) {
$url .= '&'.$param;
print '<a href="'.DOL_URL_ROOT.'/accountancy/admin/categories.php?action=display&save_lastsearch_values=1&account_category='.$obj->rowid.'">';
print $langs->trans("NAccounts", $nbofaccountintogroup);
print '</a>';
} else {
print '<span class="opacitymedium">'.$langs->trans("Formula").'</span>';
}
$url .= '&';
print '</td>';
// Active
print '<td class="center" class="nowrap">';
@@ -811,49 +902,25 @@ if ($resql) {
}
print "</td>";
// Modify link
if ($canbemodified) {
print '<td class="center"><a class="reposition editfielda" href="'.$url.'action=edit&token='.newToken().'">'.img_edit().'</a></td>';
} else {
print '<td>&nbsp;</td>';
}
// Delete link
if ($iserasable) {
// Actions
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="center">';
if ($user->admin) {
print '<a href="'.$url.'action=delete&token='.newToken().'">'.img_delete().'</a>';
if ($canbemodified) {
print '<a class="reposition editfielda paddingleft marginleftonly marginrightonly paddingright" href="'.$url.'action=edit&token='.newToken().'">'.img_edit().'</a>';
}
if ($iserasable) {
if ($user->admin) {
print '<a class="paddingleft marginleftonly marginrightonly paddingright" href="'.$url.'action=delete&token='.newToken().'">'.img_delete().'</a>';
}
}
//else print '<a href="#">'.img_delete().'</a>'; // Some dictionary can be edited by other profile than admin
print '</td>';
} else {
print '<td>&nbsp;</td>';
}
// Link to setup the group
print '<td>';
if (empty($obj->formula)) {
print '<a href="'.DOL_URL_ROOT.'/accountancy/admin/categories.php?action=display&save_lastsearch_values=1&account_category='.$obj->rowid.'">';
print $langs->trans("ListOfAccounts");
print '</a>';
// Count number of accounts into group
$nbofaccountintogroup = 0;
$listofaccountintogroup = $accountingcategory->getCptsCat($obj->rowid);
$nbofaccountintogroup = count($listofaccountintogroup);
//if ($nbofaccountintogroup > 0) {
print ' <span class="opacitymedium">('.$langs->trans("NAccounts", $nbofaccountintogroup).')</span>';
//} else {
// print ' <span class="opacitymedium">(0)</span>';
//}
}
print '</td>';
}
print "</tr>\n";
$i++;
}
} else {
$colspan = 11;
$colspan = 10;
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
} else {
@@ -920,20 +987,14 @@ function fieldListAccountingCategories($fieldlist, $obj = '', $tabname = '', $co
print '<td><input type="text" class="flat minwidth100" value="'.(!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'"></td>';
} else {
print '<td>';
$size = ''; $class = '';
if ($fieldlist[$field] == 'code') {
$class = '';
if (in_array($fieldlist[$field], array('code', 'range_account', 'label', 'formula'))) {
$class = 'maxwidth100';
}
if ($fieldlist[$field] == 'position') {
$class = 'maxwidth50';
}
if ($fieldlist[$field] == 'libelle') {
$class = 'quatrevingtpercent';
}
if ($fieldlist[$field] == 'sortorder' || $fieldlist[$field] == 'category_type') {
$size = 'size="2" ';
}
print '<input type="text" '.$size.'class="flat'.($class ? ' '.$class : '').'" value="'.(isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'">';
print '<input type="text" class="flat'.($class ? ' '.$class : '').'" value="'.(isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'">';
print '</td>';
}
}

View File

@@ -356,7 +356,7 @@ if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
print '<td>'.$langs->trans("AGENDA_USE_EVENT_TYPE_DEFAULT").'</td>'."\n";
print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right nowrap">'."\n";
$formactions->select_type_actions($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT, "AGENDA_USE_EVENT_TYPE_DEFAULT", 'systemauto', 0, 1);
$formactions->select_type_actions(getDolGlobalString('AGENDA_USE_EVENT_TYPE_DEFAULT'), "AGENDA_USE_EVENT_TYPE_DEFAULT", 'systemauto', 0, 1);
print '</td></tr>'."\n";
}
@@ -386,7 +386,7 @@ if (!empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) {
// We use an option here because it adds bugs when used on agenda page "peruser" and "list"
$multiselect = (!empty($conf->global->AGENDA_USE_EVENT_TYPE));
}
$formactions->select_type_actions($conf->global->AGENDA_DEFAULT_FILTER_TYPE, "AGENDA_DEFAULT_FILTER_TYPE", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 1, $multiselect);
$formactions->select_type_actions(getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE'), "AGENDA_DEFAULT_FILTER_TYPE", '', (getDolGlobalString('AGENDA_USE_EVENT_TYPE') ? -1 : 1), 1, $multiselect);
print '</td></tr>'."\n";
// AGENDA_DEFAULT_FILTER_STATUS

View File

@@ -216,8 +216,8 @@ $tabsql[8] = "SELECT t.id as rowid, t.code as code, t.libelle, t.fk_country as
$tabsql[9] = "SELECT c.code_iso as code, c.label, c.unicode, c.active FROM ".MAIN_DB_PREFIX."c_currencies AS c";
$tabsql[10] = "SELECT t.rowid, t.entity, t.code, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, c.label as country, c.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays = c.rowid AND t.entity = ".getEntity($tabname[10]);
$tabsql[11] = "SELECT t.rowid as rowid, t.element, t.source, t.code, t.libelle, t.position, t.active FROM ".MAIN_DB_PREFIX."c_type_contact AS t";
$tabsql[12] = "SELECT c.rowid as rowid, c.code, c.libelle, c.libelle_facture, c.deposit_percent, c.nbjour, c.type_cdr, c.decalage, c.active, c.sortorder, c.entity FROM ".MAIN_DB_PREFIX."c_payment_term AS c WHERE c.entity = ".getEntity($tabname[12]);
$tabsql[13] = "SELECT c.id as rowid, c.code, c.libelle, c.type, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_paiement AS c WHERE c.entity = ".getEntity($tabname[13]);
$tabsql[12] = "SELECT c.rowid as rowid, c.code, c.libelle, c.libelle_facture, c.deposit_percent, c.nbjour, c.type_cdr, c.decalage, c.active, c.sortorder, c.entity FROM ".MAIN_DB_PREFIX."c_payment_term AS c WHERE c.entity IN (".getEntity($tabname[12]).")";
$tabsql[13] = "SELECT c.id as rowid, c.code, c.libelle, c.type, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_paiement AS c WHERE c.entity IN (".getEntity($tabname[13]).")";
$tabsql[14] = "SELECT e.rowid as rowid, e.code as code, e.label, e.price, e.organization, e.fk_pays as country_id, c.code as country_code, c.label as country, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_country as c WHERE e.fk_pays=c.rowid and c.active=1";
$tabsql[15] = "SELECT rowid as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX."c_paper_format";
$tabsql[16] = "SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_PREFIX."c_prospectlevel";
@@ -229,7 +229,7 @@ $tabsql[21] = "SELECT c.rowid as rowid, c.code, c.label, c.type_duration, c.qty,
$tabsql[22] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason";
$tabsql[23] = "SELECT t.rowid as rowid, t.taux, t.revenuestamp_type, c.label as country, c.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid";
$tabsql[24] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_type_resource";
$tabsql[25] = "SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity = ".getEntity($tabname[25]);
$tabsql[25] = "SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity IN (".getEntity($tabname[25]).")";
//$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units";
$tabsql[27] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcomm";
$tabsql[28] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newbymonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.block_if_negative, h.sortorder, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
@@ -242,7 +242,7 @@ $tabsql[34] = "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PR
$tabsql[35] = "SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_cat c";
$tabsql[36] = "SELECT r.rowid, r.fk_c_exp_tax_cat, r.range_ik, r.active, r.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_range r";
$tabsql[37] = "SELECT r.rowid, r.code, r.sortorder, r.label, r.short_label, r.unit_type, r.scale, r.active FROM ".MAIN_DB_PREFIX."c_units r";
$tabsql[38] = "SELECT s.rowid, s.entity, s.code, s.label, s.url, s.icon, s.active FROM ".MAIN_DB_PREFIX."c_socialnetworks as s WHERE s.entity = ".getEntity($tabname[38]);
$tabsql[38] = "SELECT s.rowid, s.entity, s.code, s.label, s.url, s.icon, s.active FROM ".MAIN_DB_PREFIX."c_socialnetworks as s WHERE s.entity IN (".getEntity($tabname[38]).")";
$tabsql[39] = "SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_PREFIX."c_prospectcontactlevel";
$tabsql[40] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcommcontact";
$tabsql[41] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_transport_mode";
@@ -310,8 +310,8 @@ $tabfield[8] = "code,libelle,country_id,country".(!empty($conf->global->SOCIETE_
$tabfield[9] = "code,label,unicode";
$tabfield[10] = "country_id,country,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
$tabfield[11] = "element,source,code,libelle,position";
$tabfield[12] = "code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder,entity";
$tabfield[13] = "code,libelle,type,entity";
$tabfield[12] = "code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder";
$tabfield[13] = "code,libelle,type";
$tabfield[14] = "code,label,price,organization,country";
$tabfield[15] = "code,libelle,width,height,unit";
$tabfield[16] = "code,libelle,sortorder";
@@ -336,7 +336,7 @@ $tabfield[34] = "code,label";
$tabfield[35] = "label";
$tabfield[36] = "range_ik,fk_c_exp_tax_cat";
$tabfield[37] = "code,label,short_label,unit_type,scale,sortorder";
$tabfield[38] = "code,label,url,icon,entity";
$tabfield[38] = "code,label,url,icon";
$tabfield[39] = "code,libelle,sortorder";
$tabfield[40] = "code,libelle,picto";
$tabfield[41] = "code,label";
@@ -391,7 +391,7 @@ $tabfieldvalue[42] = "code,label";
$tabfieldvalue[43] = "code,label";
$tabfieldvalue[44] = "code,label";
// Field names in the table for inserting a record
// Field names in the table for inserting a record (add field "entity" only here when dictionary is ready to personalized by entity)
$tabfieldinsert = array();
$tabfieldinsert[1] = "code,libelle,fk_pays";
$tabfieldinsert[2] = "code_departement,nom,fk_region";
@@ -417,7 +417,7 @@ $tabfieldinsert[21] = "code,label,qty,type_duration,position";
$tabfieldinsert[22] = "code,label";
$tabfieldinsert[23] = "fk_pays,taux,revenuestamp_type,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldinsert[24] = "code,label";
$tabfieldinsert[25] = "code,label";
$tabfieldinsert[25] = "code,label,entity";
//$tabfieldinsert[26]= "code,label,short_label";
$tabfieldinsert[27] = "code,libelle,picto";
$tabfieldinsert[28] = "code,label,affect,delay,newbymonth,fk_country,block_if_negative,sortorder";
@@ -890,7 +890,7 @@ if (empty($reshook)) {
}
$i = 0;
foreach ($listfieldinsert as $f => $value) {
$keycode = $listfieldvalue[$i];
$keycode = (isset($listfieldvalue[$i]) ? $listfieldvalue[$i] : '');
if (empty($keycode)) {
$keycode = $value;
}

View File

@@ -598,7 +598,7 @@ if ($action == 'edit') {
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
}
} else {
print yn(0).' ('.$langs->trans("NotSupported").')';
print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>';
}
print '</td></tr>';
@@ -611,7 +611,7 @@ if ($action == 'edit') {
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
}
} else {
print yn(0).' ('.$langs->trans("NotSupported").')';
print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>';
}
print '</td></tr>';
}

View File

@@ -1,6 +1,8 @@
<?php
/* Copyright (C) 2013-2018 Jean-François FERRY <hello@librethic.io>
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
/* Copyright (C) 2013-2018 Jean-François FERRY <hello@librethic.io>
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
* Copyright (C) 2022-2023 Udo Tamm <dev@dolibit.de>
* Copyright (C) 2023 Alexandre Spangaro <aspangaro@easya.solutions>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,17 +19,17 @@
*/
/**
* \file admin/ticket.php
* \file htdocs/admin/ticket.php
* \ingroup ticket
* \brief Page to setup module ticket
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
require_once DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php";
require_once DOL_DOCUMENT_ROOT."/core/lib/ticket.lib.php";
require_once DOL_DOCUMENT_ROOT."/core/class/html.formcategory.class.php";
require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
require_once DOL_DOCUMENT_ROOT."/core/lib/ticket.lib.php";
require_once DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php";
// Load translation files required by the page
$langs->loadLangs(array("admin", "ticket"));
@@ -111,14 +113,14 @@ if ($action == 'updateMask') {
$conf->global->TICKET_ADDON_PDF = $value;
}
// On active le modele
// Activate the model
$ret = delDocumentModel($value, $type);
if ($ret > 0) {
$ret = addDocumentModel($value, $type, $label, $scandir);
}
} elseif ($action == 'setmod') {
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
// TODO check if the chosen numbering module can be activated
// by calling the canBeActivated method
dolibarr_set_const($db, "TICKET_ADDON", $value, 'chaine', 0, '', $conf->entity);
} elseif ($action == 'setvarworkflow') {
@@ -235,8 +237,9 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
$formcategory = new FormCategory($db);
$help_url = "FR:Module_Ticket";
$page_name = "TicketSetup";
// Page Header
$help_url = 'EN:Module_Ticket|FR:Module_Ticket_FR';
$page_name = 'TicketSetup';
llxHeader('', $langs->trans($page_name), $help_url);
// Subheader
@@ -267,7 +270,7 @@ print '<td width="100">'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td>'.$langs->trans("Example").'</td>';
print '<td align="center" width="60">'.$langs->trans("Activated").'</td>';
print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
print '<td align="center" width="40">'.$langs->trans("ShortInfo").'</td>';
print "</tr>\n";
clearstatcache();
@@ -391,8 +394,8 @@ print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
print '<td class="center" width="38">'.$langs->trans("ShortInfo").'</td>';
print '<td class="center" width="38">'.$langs->trans("Preview").'</td>';
print '<td class="center" width="50">'.$langs->trans("Preview").'</td>';
print '<td class="center" width="40">'.$langs->trans("ShortInfo").'</td>';
print "</tr>\n";
clearstatcache();
@@ -439,7 +442,7 @@ foreach ($dirmodels as $reldir) {
}
print '</td>';
// Active
// Active / Status
if (in_array($name, $def)) {
print '<td class="center">'."\n";
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'">';
@@ -452,7 +455,7 @@ foreach ($dirmodels as $reldir) {
print "</td>";
}
// Default
// Default Template
print '<td class="center">';
if (getDolGlobalString("TICKET_ADDON_PDF") == $name) {
print img_picto($langs->trans("Default"), 'on');
@@ -461,6 +464,17 @@ foreach ($dirmodels as $reldir) {
}
print '</td>';
// Preview
print '<td class="center">';
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.urlencode($name).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
}
print '</td>';
print "</tr>\n";
// Info
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
$htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
@@ -480,17 +494,6 @@ foreach ($dirmodels as $reldir) {
print '<td class="center">';
print $formcategory->textwithpicto('', $htmltooltip, 1, 0);
print '</td>';
// Preview
print '<td class="center">';
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.urlencode($name).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
}
print '</td>';
print "</tr>\n";
}
}
}
@@ -509,17 +512,21 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setvarworkflow">';
print '<input type="hidden" name="page_y" value="">';
/*
* Other Parameters
*/
print load_fiche_titre($langs->trans("Other"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td></td>';
print '<td></td>';
print '<td>'.$langs->trans("Status")."</td>\n";
print '<td class="center" width="40">'.$langs->trans("ShortInfo").'</td>';
print "</tr>\n";
// Auto mark ticket read when created from backoffice
// Auto mark ticket as read when created from backoffice
print '<tr class="oddeven"><td>'.$langs->trans("TicketsAutoReadTicket").'</td>';
print '<td class="left">';
if ($conf->use_javascript_ajax) {
@@ -534,7 +541,7 @@ print $formcategory->textwithpicto('', $langs->trans("TicketsAutoReadTicketHelp"
print '</td>';
print '</tr>';
// Auto assign ticket at user who created it
// Auto assign ticket to user who created it
print '<tr class="oddeven">';
print '<td>'.$langs->trans("TicketsAutoAssignTicket").'</td>';
print '<td class="left">';
@@ -600,7 +607,7 @@ print $formcategory->textwithpicto('', $langs->trans("TicketsDelayBetweenAnswers
print '</td>';
print '</tr>';
//Allow classification modification even if the ticket is closed
// Allow classification modification even if the ticket is closed
print '<tr class="oddeven"><td>'.$langs->trans("TicketsAllowClassificationModificationIfClosed").'</td>';
print '<td class="left">';
if ($conf->use_javascript_ajax) {
@@ -621,7 +628,9 @@ print $formcategory->buttonsSaveCancel("Save", '', array(), 0, 'reposition');
print '</form>';
/*
* Notification
*/
// Admin var of module
print load_fiche_titre($langs->trans("Notification"), '', '');
@@ -633,18 +642,20 @@ print '<input type="hidden" name="action" value="setvar">';
print '<input type="hidden" name="page_y" value="">';
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("Email").'</td>';
print '<td colspan="2">'.$langs->trans("Email").'</td>';
print '<td class="center" width="40">'.$langs->trans("ShortInfo").'</td>';
print "</tr>\n";
if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) {
print '<tr>';
print '<td colspan="3"><div class="info">'.$langs->trans("TicketCkEditorEmailNotActivated").'</div></td>';
print '<td colspan="2"><div class="info">'.$langs->trans("TicketCkEditorEmailNotActivated").'</div></td>';
print '<td class="center" width="40">'.$langs->trans("ShortInfo").'</td>';
print "</tr>\n";
}
// @todo Use module notification instead...
// TODO Use module notification instead...
// Email d'envoi des notifications
// Email to send notifications
print '<tr class="oddeven"><td>'.$langs->trans("TicketEmailNotificationFrom").'</td>';
print '<td class="left">';
print '<input type="text" class="minwidth200" name="TICKET_NOTIFICATION_EMAIL_FROM" value="'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'"></td>';
@@ -656,7 +667,7 @@ print '</tr>';
// Email for notification of TICKET_CREATE
print '<tr class="oddeven"><td>'.$langs->trans("TicketEmailNotificationTo").'</td>';
print '<td class="left">';
print '<input type="text" name="TICKET_NOTIFICATION_EMAIL_TO" value="'.(!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) ? $conf->global->TICKET_NOTIFICATION_EMAIL_TO : '').'"></td>';
print '<input type="text" class="minwidth200" name="TICKET_NOTIFICATION_EMAIL_TO" value="'.(!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) ? $conf->global->TICKET_NOTIFICATION_EMAIL_TO : '').'"></td>';
print '<td class="center">';
print $formcategory->textwithpicto('', $langs->trans("TicketEmailNotificationToHelp"), 1, 'help');
print '</td>';

View File

@@ -492,9 +492,10 @@ if (empty($reshook)) {
if ($origin && $originid) {
// Parse element/subelement (ex: project_task)
$element = $subelement = $origin;
$regs = array();
if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) {
$element = $regs [1];
$subelement = $regs [2];
$element = $regs[1];
$subelement = $regs[2];
}
// For compatibility

View File

@@ -270,7 +270,7 @@ if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) {
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
$colspan++;
}
print '<tr class="oddeven"><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoInvoice").'</td></tr>';
print '<tr class="oddeven"><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoInvoice").'</span></td></tr>';
}
print '</table></div><br>';
$db->free($resql);
@@ -397,7 +397,7 @@ if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
$colspan++;
}
print '<tr class="oddeven"><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoInvoice").'</td></tr>';
print '<tr class="oddeven"><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoInvoice").'</span></td></tr>';
}
print '</table></div><br>';
} else {
@@ -488,7 +488,7 @@ if (isModEnabled('don') && $user->hasRight('don', 'lire')) {
print "</tr>\n";
}
} else {
print '<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
print '<tr class="oddeven"><td colspan="5"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
}
print '</table></div><br>';
} else {
@@ -578,7 +578,7 @@ if (isModEnabled('tax') && !empty($user->rights->tax->charges->lire)) {
print '<td class="right">&nbsp;</td>';
print '</tr>';
} else {
print '<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
print '<tr class="oddeven"><td colspan="5"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
}
print "</table></div><br>";
$db->free($resql);

View File

@@ -1562,7 +1562,7 @@ class Contrat extends CommonObject
// if buy price not defined, define buyprice as configured in margin admin
if ($this->pa_ht == 0) {
if ($pa_ht == 0) {
if (($result = $this->defineBuyPrice($pu_ht, $remise_percent, $fk_product)) < 0) {
return $result;
} else {

View File

@@ -261,7 +261,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box
$label = $head['text'];
//if (!empty($head['graph'])) $label.=' ('.$langs->trans("Graph").')';
if (!empty($head['graph'])) {
$label .= ' <span class="opacitymedium fa fa-bar-chart"></span>';
$label .= ' <span class="opacitymedium fas fa-chart-bar"></span>';
}
$out .= '<input type="hidden" id="boxlabelentry'.$this->box_id.'" value="'.dol_escape_htmltag($label).'">';
//$out.= '</td></tr></table>';

View File

@@ -9459,7 +9459,7 @@ abstract class CommonObject
// If we have a field ref with a default value of (PROV)
if (!$error) {
if (key_exists('ref', $this->fields) && $this->fields['ref']['notnull'] > 0 && key_exists('default', $this->fields['ref']) && $this->fields['ref']['default'] == '(PROV)') {
if (key_exists('ref', $this->fields) && key_exists('notnull', $this->fields['ref']) && $this->fields['ref']['notnull'] > 0 && key_exists('default', $this->fields['ref']) && $this->fields['ref']['default'] == '(PROV)') {
$sql = "UPDATE ".$this->db->prefix().$this->table_element." SET ref = '(PROV".((int) $this->id).")' WHERE (ref = '(PROV)' OR ref = '') AND rowid = ".((int) $this->id);
$resqlupdate = $this->db->query($sql);

View File

@@ -56,13 +56,17 @@ class DolGeoIP
if ($type == 'country') {
// geoip may have been already included with PEAR
if ($geoipversion == '2' || ($geoipversion != 'php' && !function_exists('geoip_country_code_by_name'))) {
stream_wrapper_restore('phar');
if (function_exists('stream_wrapper_restore')) {
stream_wrapper_restore('phar');
}
require_once DOL_DOCUMENT_ROOT.'/includes/geoip2/geoip2.phar';
}
} elseif ($type == 'city') {
// geoip may have been already included with PEAR
if ($geoipversion == '2' || ($geoipversion != 'php' && !function_exists('geoip_country_code_by_name'))) {
stream_wrapper_restore('phar');
if (function_exists('stream_wrapper_restore')) {
stream_wrapper_restore('phar');
}
require_once DOL_DOCUMENT_ROOT.'/includes/geoip2/geoip2.phar';
}
} else {

View File

@@ -48,6 +48,10 @@ class FormAccounting extends Form
* @var int Nb of accounts found
*/
public $nbaccounts;
/**
* @var int Nb of accounts category found
*/
public $nbaccounts_category;
/**
@@ -235,7 +239,7 @@ class FormAccounting extends Form
public function select_accounting_category($selected = '', $htmlname = 'account_category', $useempty = 0, $maxlen = 0, $help = 1, $allcountries = 0)
{
// phpcs:enable
global $db, $langs, $mysoc;
global $langs, $mysoc;
if (empty($mysoc->country_id) && empty($mysoc->country_code) && empty($allcountries)) {
dol_print_error('', 'Call to select_accounting_account with mysoc country not yet defined');
@@ -263,11 +267,15 @@ class FormAccounting extends Form
$sql .= " ORDER BY c.label ASC";
}
$this->nbaccounts_category = 0;
dol_syslog(get_class($this).'::'.__METHOD__, LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
$num = $this->db->num_rows($resql);
if ($num) {
$this->nbaccounts_category = $num;
$out = '<select class="flat minwidth200" id="'.$htmlname.'" name="'.$htmlname.'">';
$i = 0;

View File

@@ -1231,7 +1231,7 @@ class FormOther
$label = $langs->transnoentitiesnoconv($box->boxlabel);
//if (preg_match('/graph/',$box->class)) $label.=' ('.$langs->trans("Graph").')';
if (preg_match('/graph/', $box->class) && $conf->browser->layout != 'phone') {
$label = $label.' <span class="fa fa-bar-chart"></span>';
$label = $label.' <span class="fas fa-chart-bar"></span>';
}
$arrayboxtoactivatelabel[$box->id] = array('label'=>$label, 'data-html'=>img_picto('', $box->boximg, 'class="pictofixedwidth"').$langs->trans($label)); // We keep only boxes not shown for user, to show into combo list
}

View File

@@ -481,7 +481,9 @@ class Notify
$outputlangs->loadLangs(array("main", "other"));
}
$subject = '['.$mysoc->name.'] '.$outputlangs->transnoentitiesnoconv("DolibarrNotification").($projtitle ? ' '.$projtitle : '');
$appli = $mysoc->name;
$subject = '['.$appli.'] '.$outputlangs->transnoentitiesnoconv("DolibarrNotification").($projtitle ? ' '.$projtitle : '');
switch ($notifcode) {
case 'BILL_VALIDATE':
@@ -771,7 +773,9 @@ class Notify
$link = '';
$num++;
$subject = '['.$mysoc->name.'] '.$langs->transnoentitiesnoconv("DolibarrNotification").($projtitle ? ' '.$projtitle : '');
$appli = $mysoc->name;
$subject = '['.$appli.'] '.$langs->transnoentitiesnoconv("DolibarrNotification").($projtitle ? ' '.$projtitle : '');
switch ($notifcode) {
case 'BILL_VALIDATE':

View File

@@ -3407,7 +3407,7 @@ function dol_print_profids($profID, $profIDtype, $countrycode = '', $addcpButton
* @param int $cid Id of contact if known
* @param int $socid Id of third party if known
* @param string $addlink ''=no link to create action, 'AC_TEL'=add link to clicktodial (if module enabled) and add link to create event (if conf->global->AGENDA_ADDACTIONFORPHONE set), 'tel'=Force "tel:..." link
* @param string $separ Separation between numbers for a better visibility example : xx.xx.xx.xx.xx
* @param string $separ Separation between numbers for a better visibility example : xx.xx.xx.xx.xx. You can also use 'hidenum' to hide the number, keep only the picto.
* @param string $withpicto Show picto ('fax', 'phone', 'mobile')
* @param string $titlealt Text to show on alt
* @param int $adddivfloat Add div float around phone.
@@ -3613,11 +3613,12 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli
$newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2).$separ.substr($newphone, 11, 2);
}
}
$newphoneastart = $newphoneaend = '';
if (!empty($addlink)) { // Link on phone number (+ link to add action if conf->global->AGENDA_ADDACTIONFORPHONE set)
if ($addlink == 'tel' || $conf->browser->layout == 'phone' || (isModEnabled('clicktodial') && !empty($conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS))) { // If phone or option for, we use link of phone
$newphoneform = $newphone;
$newphone = '<a href="tel:'.$phone.'"';
$newphone .= '>'.$newphoneform.'</a>';
$newphoneastart = '<a href="tel:'.$phone.'">';
$newphoneaend .= '</a>';
} elseif (isModEnabled('clicktodial') && $addlink == 'AC_TEL') { // If click to dial, we use click to dial url
if (empty($user->clicktodial_loaded)) {
$user->fetch_clicktodial();
@@ -3640,33 +3641,33 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli
'__LOGIN__'=>$clicktodial_login,
'__PASS__'=>$clicktodial_password);
$url = make_substitutions($url, $substitarray);
$newphonesav = $newphone;
if (empty($conf->global->CLICKTODIAL_DO_NOT_USE_AJAX_CALL)) {
// Default and recommended: New method using ajax without submiting a page making a javascript history.go(-1) back
$newphone = '<a href="'.$url.'" class="cssforclicktodial"'; // Call of ajax is handled by the lib_foot.js.php on class 'cssforclicktodial'
$newphone .= '>'.$newphonesav.'</a>';
$newphoneastart = '<a href="'.$url.'" class="cssforclicktodial">'; // Call of ajax is handled by the lib_foot.js.php on class 'cssforclicktodial'
$newphoneaend = '</a>';
} else {
// Old method
$newphone = '<a href="'.$url.'"';
$newphoneastart = '<a href="'.$url.'"';
if (!empty($conf->global->CLICKTODIAL_FORCENEWTARGET)) {
$newphone .= ' target="_blank" rel="noopener noreferrer"';
$newphoneastart .= ' target="_blank" rel="noopener noreferrer"';
}
$newphone .= '>'.$newphonesav.'</a>';
$newphoneastart .= '>';
$newphoneaend .= '</a>';
}
}
//if (($cid || $socid) && isModEnabled('agenda') && $user->hasRight('agenda', 'myactions', 'create'))
if (isModEnabled('agenda') && $user->hasRight("agenda", "myactions", "create")) {
$type = 'AC_TEL';
$link = '';
$addlinktoagenda = '';
if ($addlink == 'AC_FAX') {
$type = 'AC_FAX';
}
if (!empty($conf->global->AGENDA_ADDACTIONFORPHONE)) {
$link = '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&amp;backtopage='. urlencode($_SERVER['REQUEST_URI']) .'&amp;actioncode='.$type.($cid ? '&amp;contactid='.$cid : '').($socid ? '&amp;socid='.$socid : '').'">'.img_object($langs->trans("AddAction"), "calendar").'</a>';
$addlinktoagenda = '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&amp;backtopage='. urlencode($_SERVER['REQUEST_URI']) .'&amp;actioncode='.$type.($cid ? '&amp;contactid='.$cid : '').($socid ? '&amp;socid='.$socid : '').'">'.img_object($langs->trans("AddAction"), "calendar").'</a>';
}
if ($link) {
$newphone = '<div>'.$newphone.' '.$link.'</div>';
if ($addlinktoagenda) {
$newphone = '<span>'.$newphone.' '.$addlinktoagenda.'</span>';
}
}
}
@@ -3699,7 +3700,14 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli
} elseif (empty($adddivfloat)) {
$rep .= '<span style="margin-right: 10px;">';
}
$rep .= ($withpicto ?img_picto($titlealt, 'object_'.$picto.'.png').' ' : '').$newphone;
$rep .= $newphoneastart;
$rep .= ($withpicto ? img_picto($titlealt, 'object_'.$picto.'.png') : '');
if ($separ != 'hidenum') {
$rep .= ' '.$newphone;
}
$rep .= $newphoneaend;
if ($adddivfloat == 1) {
$rep .= '</div>';
} elseif (empty($adddivfloat)) {
@@ -4293,7 +4301,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$fakey = $pictowithouttext;
$facolor = '';
$fasize = '';
$fa = 'fas';
$fa = getDolGlobalString('MAIN_FONTAWESOME_ICON_STYLE', 'fas');
if (in_array($pictowithouttext, array('card', 'bell', 'clock', 'establishment', 'generic', 'minus-square', 'object_generic', 'pdf', 'plus-square', 'timespent', 'note', 'off', 'on', 'object_bookmark', 'bookmark', 'vcard'))) {
$fa = 'far';
}

View File

@@ -615,7 +615,7 @@ function getCustomerInvoiceDraftTable($maxCount = 500, $socid = 0)
$result .= '<td colspan="2" class="right">'.price($tot_ttc).'</td>';
$result .= '</tr>';
} else {
$result .= '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("NoInvoice").'</td></tr>';
$result .= '<tr class="oddeven"><td colspan="3"><span class="opacitymedium">'.$langs->trans("NoInvoice").'</span></td></tr>';
}
$result .= "</table></div>";
$db->free($resql);
@@ -747,7 +747,7 @@ function getDraftSupplierTable($maxCount = 500, $socid = 0)
$result .= '<td colspan="2" class="right">'.price($tot_ttc).'</td>';
$result .= '</tr>';
} else {
$result .= '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("NoInvoice").'</td></tr>';
$result .= '<tr class="oddeven"><td colspan="3"><span class="opacitymedium">'.$langs->trans("NoInvoice").'</span></td></tr>';
}
$result .= "</table></div>";
$db->free($resql);

View File

@@ -144,6 +144,10 @@ function dolEncrypt($chain, $key = '', $ciphering = 'AES-256-CTR', $forceseed =
$newchain = $chain;
if (function_exists('openssl_encrypt') && empty($dolibarr_disable_dolcrypt_for_debug)) {
if (empty($key)) {
return $chain;
}
$ivlen = 16;
if (function_exists('openssl_cipher_iv_length')) {
$ivlen = openssl_cipher_iv_length($ciphering);

View File

@@ -1094,7 +1094,7 @@ function get_left_menu_home($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
$langs->load("users");
// Home - dashboard
$newmenu->add("/index.php?mainmenu=home&amp;leftmenu=home", $langs->trans("MyDashboard"), 0, 1, '', $mainmenu, 'home', 0, '', '', '', '<i class="fa fa-bar-chart fa-fw paddingright pictofixedwidth"></i>');
$newmenu->add("/index.php?mainmenu=home&amp;leftmenu=home", $langs->trans("MyDashboard"), 0, 1, '', $mainmenu, 'home', 0, '', '', '', '<i class="fas fa-chart-bar fa-fw paddingright pictofixedwidth"></i>');
// Setup
$newmenu->add("/admin/index.php?mainmenu=home&amp;leftmenu=setup", $langs->trans("Setup"), 0, $user->admin, '', $mainmenu, 'setup', 0, '', '', '', '<i class="fa fa-tools fa-fw paddingright pictofixedwidth"></i>');
@@ -2064,6 +2064,10 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme
$newmenu->add("/product/index.php?leftmenu=service&amp;type=1", $langs->trans("Services"), 0, $user->hasRight('service', 'read'), '', $mainmenu, 'service', 0, '', '', '', img_picto('', 'service', 'class="pictofixedwidth"'));
$newmenu->add("/product/card.php?leftmenu=service&amp;action=create&amp;type=1", $langs->trans("NewService"), 1, $user->hasRight('service', 'creer'));
$newmenu->add("/product/list.php?leftmenu=service&amp;type=1", $langs->trans("List"), 1, $user->hasRight('service', 'read'));
if (isModEnabled('Stock') && getDolGlobalString('STOCK_SUPPORTS_SERVICES')) {
$newmenu->add("/product/reassort.php?type=1", $langs->trans("MenuStocks"), 1, $user->hasRight('service', 'read') && $user->hasRight('stock', 'lire'));
}
if (isModEnabled('variants')) {
$newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->hasRight('service', 'read'));
}

View File

@@ -4,6 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2023 Charlene Benke <charlene@patas-monkey.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1284,7 +1285,7 @@ class pdf_espadon extends ModelePdfExpedition
$this->cols['subprice'] = array(
'rank' => $rank,
'width' => 19, // in mm
'status' => !empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT) ? 1 : 0,
'status' => !empty($conf->global->SHIPPING_PDF_DISPLAY_AMOUNT_HT) ? 1 : 0,
'title' => array(
'textkey' => 'PriceUHT'
),
@@ -1295,7 +1296,7 @@ class pdf_espadon extends ModelePdfExpedition
$this->cols['totalexcltax'] = array(
'rank' => $rank,
'width' => 26, // in mm
'status' => !empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT) ? 1 : 0,
'status' => !empty($conf->global->SHIPPING_PDF_DISPLAY_AMOUNT_HT) ? 1 : 0,
'title' => array(
'textkey' => 'TotalHT'
),

View File

@@ -148,15 +148,15 @@ class modTicket extends DolibarrModules
"TicketDictResolution"
),
'tabsql' => array(
'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_type as f',
'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_severity as f',
'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default, f.public, f.fk_parent FROM '.MAIN_DB_PREFIX.'c_ticket_category as f',
'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_resolution as f'
'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default, f.entity FROM '.MAIN_DB_PREFIX.'c_ticket_type as f WHERE f.entity IN ('.getEntity('c_ticket_type').')',
'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default, f.entity FROM '.MAIN_DB_PREFIX.'c_ticket_severity as f WHERE f.entity IN ('.getEntity('c_ticket_severity').')',
'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default, f.public, f.fk_parent, f.entity FROM '.MAIN_DB_PREFIX.'c_ticket_category as f WHERE f.entity IN ('.getEntity('c_ticket_category').')',
'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default, f.entity FROM '.MAIN_DB_PREFIX.'c_ticket_resolution as f WHERE f.entity IN ('.getEntity('c_ticket_resolution').')'
),
'tabsqlsort' => array("pos ASC", "pos ASC", "pos ASC", "pos ASC"),
'tabfield' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public,fk_parent", "code,label,pos,use_default"),
'tabfieldvalue' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public,fk_parent", "code,label,pos,use_default"),
'tabfieldinsert' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public,fk_parent", "code,label,pos,use_default"),
'tabfieldinsert' => array("code,label,pos,use_default,entity", "code,label,pos,use_default,entity", "code,label,pos,use_default,public,fk_parent,entity", "code,label,pos,use_default,entity"),
'tabrowid' => array("rowid", "rowid", "rowid", "rowid"),
'tabcond' => array(isModEnabled("ticket"), isModEnabled("ticket"), isModEnabled("ticket"), isModEnabled("ticket") && getDolGlobalString('TICKET_ENABLE_RESOLUTION')),
'tabhelp' => array(

View File

@@ -1365,6 +1365,9 @@ class InterfaceActionsAuto extends DolibarrTriggers
$tmp = explode('_', $action);
$object->actionmsg = $langs->transnoentities($tmp[count($tmp) - 1]."InDolibarr", (empty($object->newref) ? $object->ref : $object->newref));
}
if (isModEnabled('multicompany') && property_exists($object, 'entity') && $object->entity > 1) {
$object->actionmsg .= ' ('.$langs->trans("Entity").' '.$object->entity.')';
}
}
if (!isset($object->sendtoid) || !is_array($object->sendtoid)) {

View File

@@ -60,6 +60,8 @@ class InterfaceTicketEmail extends DolibarrTriggers
*/
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
global $mysoc;
$ok = 0;
if (empty($conf->ticket) || !isModEnabled('ticket')) {
@@ -82,8 +84,10 @@ class InterfaceTicketEmail extends DolibarrTriggers
$filename = array();
$mimetype = array();
$appli = $mysoc->name;
// Send email to assigned user
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketAssignedToYou');
$subject = '['.$appli.'] '.$langs->transnoentities('TicketAssignedToYou');
$message = '<p>'.$langs->transnoentities('TicketAssignedEmailBody', $object->track_id, dolGetFirstLastname($user->firstname, $user->lastname))."</p>";
$message .= '<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
$message .= '<li>'.$langs->trans('Type').' : '.$object->type_label.'</li>';
@@ -307,8 +311,10 @@ class InterfaceTicketEmail extends DolibarrTriggers
$filename = array();
$mimetype = array();
$appli = $mysoc->name;
/* Send email to admin */
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities($base_subject, $object->ref, $object->track_id);
$subject = '['.$appli.'] '.$langs->transnoentities($base_subject, $object->ref, $object->track_id);
$message_admin = $langs->transnoentities($body, $object->track_id).'<br>';
$message_admin .= '<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
$message_admin .= '<li>'.$langs->trans('Type').' : '.$langs->getLabelFromKey($this->db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code).'</li>';
@@ -377,7 +383,7 @@ class InterfaceTicketEmail extends DolibarrTriggers
$filename = array();
$mimetype = array();
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities($base_subject);
$subject = '['.$appli.'] '.$langs->transnoentities($base_subject);
$message_customer = $langs->transnoentities($body, $object->track_id).'<br>';
$message_customer .= '<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
$message_customer .= '<li>'.$langs->trans('Type').' : '.$langs->getLabelFromKey($this->db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code).'</li>';

View File

@@ -2966,7 +2966,7 @@ class EmailCollector extends CommonObject
$tickettocreate->fk_user_create = $user->id;
$tickettocreate->datec = dol_now();
$tickettocreate->fk_project = $projectstatic->id;
$tickettocreate->notify_tiers_at_create = 0;
$tickettocreate->notify_tiers_at_create = getDolGlobalInt('TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION');
$tickettocreate->note_private = $descriptionfull;
$tickettocreate->entity = $conf->entity;
$tickettocreate->email_msgid = $msgid;

View File

@@ -751,8 +751,10 @@ print '<input type="hidden" name="mode" value="'.$mode.'">';
$params = array('morecss'=>'reposition');
$urlnew = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.(empty($confOrBooth->id) ? '' : '&conforboothid='.$confOrBooth->id).$withProjectUrl);
$newcardbutton = '';
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.(empty($confOrBooth->id) ? '' : '&conforboothid='.$confOrBooth->id).$withProjectUrl), '', $permissiontoadd, $params);
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', $urlnew, '', $permissiontoadd, $params);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);

View File

@@ -1850,7 +1850,7 @@ if ($action == 'create') {
print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border tableforfield" width="100%">';
print '<table class="border tableforfield centpercent">';
// Linked documents
if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) {
@@ -1877,7 +1877,7 @@ if ($action == 'create') {
// Delivery date planned
print '<tr><td height="10">';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print '<table class="nobordernopadding centpercent"><tr><td>';
print $langs->trans('DateDeliveryPlanned');
print '</td>';
@@ -2008,7 +2008,7 @@ if ($action == 'create') {
// Sending method
print '<tr><td height="10">';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print '<table class="nobordernopadding centpercent"><tr><td>';
print $langs->trans('SendingMethod');
print '</td>';

View File

@@ -148,6 +148,7 @@ if ($action == 'updatelines' && $usercancreate) {
$ent = "entrepot_".$reg[1].'_'.$reg[2];
$fk_commandedet = "fk_commandedet_".$reg[1].'_'.$reg[2];
$idline = GETPOST("idline_".$reg[1].'_'.$reg[2]);
$warehouse_id = GETPOSTINT($ent);
$pu = "pu_".$reg[1].'_'.$reg[2]; // This is unit price including discount
$lot = '';
$dDLUO = '';
@@ -159,11 +160,12 @@ if ($action == 'updatelines' && $usercancreate) {
}
$newqty = price2num(GETPOST($qty, 'alpha'), 'MS');
//var_dump("modebatch=".$modebatch." newqty=".$newqty." ent=".$ent." idline=".$idline);
// We ask to move a qty
if (($modebatch == "batch" && $newqty >= 0) || ($modebatch == "barcode" && $newqty != 0)) {
if ($newqty > 0) { // If we want a qty, we make test on input data
if (!(GETPOST($ent, 'int') > 0)) {
if (!($warehouse_id > 0)) {
dol_syslog('No dispatch for line '.$key.' as no warehouse was chosen.');
$text = $langs->transnoentities('Warehouse').', '.$langs->transnoentities('Line').' '.($numline);
setEventMessages($langs->trans('ErrorFieldRequired', $text), null, 'errors');
@@ -200,7 +202,7 @@ if ($action == 'updatelines' && $usercancreate) {
$qtystart = 0;
if ($idline > 0) {
$result = $expeditiondispatch->fetch($idline);
$result = $expeditiondispatch->fetch($idline); // get line from llx_expeditiondet
if ($result < 0) {
setEventMessages($expeditiondispatch->error, $expeditiondispatch->errors, 'errors');
$error++;
@@ -225,13 +227,30 @@ if ($action == 'updatelines' && $usercancreate) {
$sellby = dol_mktime(0, 0, 0, GETPOST('dlc'.$suffixkeyfordate.'month'), GETPOST('dlc'.$suffixkeyfordate.'day'), GETPOST('dlc'.$suffixkeyfordate.'year'), '');
$eatby = dol_mktime(0, 0, 0, GETPOST('dluo'.$suffixkeyfordate.'month'), GETPOST('dluo'.$suffixkeyfordate.'day'), GETPOST('dluo'.$suffixkeyfordate.'year'));
$sql = "UPDATE ".MAIN_DB_PREFIX.$expeditionlinebatch->table_element." SET";
$sql .= " eatby = ".($eatby ? "'".$db->idate($eatby)."'" : "null");
$sql .= " , sellby = ".($sellby ? "'".$db->idate($sellby)."'" : "null");
$sql .= " , qty = ".((float) $newqty);
// TODO Add a column fk_warehouse
$sql .= " WHERE fk_expeditiondet = ".((int) $idline);
$sql .= " AND batch = '".$db->escape($lot)."'";
$sqlsearchdet = "SELECT rowid FROM ".MAIN_DB_PREFIX.$expeditionlinebatch->table_element;
$sqlsearchdet .= " WHERE fk_expeditiondet = ".((int) $idline);
$sqlsearchdet .= " AND batch = '".$db->escape($lot)."'";
$resqlsearchdet = $db->query($sqlsearchdet);
if ($resqlsearchdet) {
$objsearchdet = $db->fetch_object($resqlsearchdet);
} else {
dol_print_error($db);
}
if ($objsearchdet) {
$sql = "UPDATE ".MAIN_DB_PREFIX.$expeditionlinebatch->table_element." SET";
$sql .= " eatby = ".($eatby ? "'".$db->idate($eatby)."'" : "null");
$sql .= " , sellby = ".($sellby ? "'".$db->idate($sellby)."'" : "null");
$sql .= " , qty = ".((float) $newqty);
$sql .= " , fk_warehouse = ".((int) $warehouse_id);
$sql .= " WHERE rowid = ".((int) $objsearchdet->rowid);
} else {
$sql = "INSERT INTO ".MAIN_DB_PREFIX.$expeditionlinebatch->table_element." (";
$sql .= "fk_expeditiondet, eatby, sellby, batch, qty, fk_origin_stock, fk_warehouse)";
$sql .= " VALUES (".((int) $idline).", ".($eatby ? "'".$db->idate($eatby)."'" : "null").", ".($sellby ? "'".$db->idate($sellby)."'" : "null").", ";
$sql .= " '".$db->escape($lot)."', ".((float) $newqty).", 0, ".((int) $warehouse_id).")";
}
} else {
$sql = " DELETE FROM ".MAIN_DB_PREFIX.$expeditionlinebatch->table_element;
$sql .= " WHERE fk_expeditiondet = ".((int) $idline);
@@ -239,7 +258,7 @@ if ($action == 'updatelines' && $usercancreate) {
}
$resql = $db->query($sql);
if (!$db->query($sql)) {
if (!$resql) {
dol_print_error($db);
$error++;
}
@@ -317,6 +336,7 @@ if ($action == 'updatelines' && $usercancreate) {
}
}
}
if ($error > 0) {
$db->rollback();
setEventMessages($error, $errors, 'errors');
@@ -446,7 +466,7 @@ if ($object->id > 0 || !empty($object->ref)) {
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border tableforfield" width="100%">';
print '<table class="border tableforfield centpercent">';
// Linked documents
if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) {
@@ -605,11 +625,11 @@ if ($object->id > 0 || !empty($object->ref)) {
}
print '<td class="right">'.$langs->trans("QtyOrdered").'</td>';
if ($object->status == Expedition::STATUS_DRAFT) {
print '<td class="right">'.$langs->trans("QtyToDispatchShort"); // Qty to dispatch (sum for all lines of batch detail if there is)
print '<td class="right">'.$langs->trans("QtyToShip"); // Qty to dispatch (sum for all lines of batch detail if there is)
} else {
print '<td class="right">'.$langs->trans("QtyDispatchedShort").'</td>';
}
print '<td class="right">'.$langs->trans("QtyToDispatchShort");
print '<td class="right">'.$langs->trans("Details");
print '<td width="32"></td>';
if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) {
@@ -745,7 +765,12 @@ if ($object->id > 0 || !empty($object->ref)) {
print '</td>'; // Dispatch column
print '<td></td>'; // Warehouse column
$sql = "SELECT ed.rowid, ed.qty, ed.fk_entrepot, eb.batch, eb.eatby, eb.sellby, cd.fk_product FROM ".MAIN_DB_PREFIX."expeditiondet as ed";
/*$sql = "SELECT cfd.rowid, cfd.qty, cfd.fk_entrepot, cfd.batch, cfd.eatby, cfd.sellby, cfd.fk_product";
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as cfd";
$sql .= " WHERE cfd.fk_commandefourndet = ".(int) $objp->rowid;*/
$sql = "SELECT ed.rowid, ed.qty, ed.fk_entrepot, eb.batch, eb.eatby, eb.sellby, cd.fk_product";
$sql .= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expeditiondet_batch as eb on ed.rowid = eb.fk_expeditiondet";
$sql .= " JOIN ".MAIN_DB_PREFIX."commandedet as cd on ed.fk_origin_line = cd.rowid";
$sql .= " WHERE ed.fk_origin_line =".(int) $objp->rowid;
@@ -761,7 +786,7 @@ if ($object->id > 0 || !empty($object->ref)) {
$suffix = "_".$j."_".$i;
$objd = $db->fetch_object($resultsql);
if (isModEnabled('productbatch') && !empty($objd->batch)) {
if (isModEnabled('productbatch') && (!empty($objd->batch) || (is_null($objd->batch) && $tmpproduct->status_batch > 0))) {
$type = 'batch';
// Enable hooks to append additional columns
@@ -798,7 +823,7 @@ if ($object->id > 0 || !empty($object->ref)) {
print '</td>';
print '<td>';
print '<input type="text" class="inputlotnumber quatrevingtquinzepercent" id="lot_number'.$suffix.'" name="lot_number'.$suffix.'" value="'.$objd->batch.'">';
print '<input type="text" class="inputlotnumber quatrevingtquinzepercent" id="lot_number'.$suffix.'" name="lot_number'.$suffix.'" value="'.(GETPOSTISSET('lot_number'.$suffix) ? GETPOST('lot_number'.$suffix) : $objd->batch).'">';
//print '<input type="hidden" id="lot_number'.$suffix.'" name="lot_number'.$suffix.'" value="'.$objd->batch.'">';
print '</td>';
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {

View File

@@ -80,7 +80,7 @@ $result = @include_once $conffile; // Keep @ because with some error reporting t
// Disable some not used PHP stream
$listofwrappers = stream_get_wrappers();
// We need '.phar' for geoip2. TODO Replace phar with explode files so we can disable phar.
// We need '.phar' for geoip2. TODO Replace phar in geoip with exploded files so we can disable phar.
$arrayofstreamtodisable = array('compress.zlib', 'compress.bzip2', 'ftps', 'glob', 'data', 'expect', 'ftp', 'ogg', 'rar', 'zip', 'zlib');
foreach ($arrayofstreamtodisable as $streamtodisable) {
if (!empty($listofwrappers) && in_array($streamtodisable, $listofwrappers)) {

View File

@@ -18,8 +18,8 @@
use Luracast\Restler\RestException;
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT . '/fourn/class/paiementfourn.class.php';
/**
* API class for supplier invoices
@@ -75,7 +75,7 @@ class SupplierInvoices extends DolibarrApi
}
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
}
$this->invoice->fetchObjectLinked();
@@ -123,19 +123,19 @@ class SupplierInvoices extends DolibarrApi
if (!DolibarrApiAccess::$user->hasRight("societe", "client", "voir") || $search_sale > 0) {
$sql .= ", sc.fk_soc, sc.fk_user";
}
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn AS t LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn AS t LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields
// We need this table joined to the select in order to filter by sale
if (!DolibarrApiAccess::$user->hasRight("societe", "client", "voir") || $search_sale > 0) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
}
$sql .= ' WHERE t.entity IN ('.getEntity('supplier_invoice').')';
$sql .= ' WHERE t.entity IN (' . getEntity('supplier_invoice') . ')';
if (!DolibarrApiAccess::$user->hasRight("societe", "client", "voir") || $search_sale > 0) {
$sql .= " AND t.fk_soc = sc.fk_soc";
}
if ($socids) {
$sql .= " AND t.fk_soc IN (".$this->db->sanitize($socids).")";
$sql .= " AND t.fk_soc IN (" . $this->db->sanitize($socids) . ")";
}
if ($search_sale > 0) {
$sql .= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
@@ -156,14 +156,14 @@ class SupplierInvoices extends DolibarrApi
}
// Insert sale filter
if ($search_sale > 0) {
$sql .= " AND sc.fk_user = ".((int) $search_sale);
$sql .= " AND sc.fk_user = " . ((int) $search_sale);
}
// Add sql filters
if ($sqlfilters) {
$errormessage = '';
$sql .= forgeSQLFromUniversalSearchCriteria($sqlfilters, $errormessage);
if ($errormessage) {
throw new RestException(400, 'Error when validating parameter sqlfilters -> '.$errormessage);
throw new RestException(400, 'Error when validating parameter sqlfilters -> ' . $errormessage);
}
}
@@ -191,7 +191,7 @@ class SupplierInvoices extends DolibarrApi
$i++;
}
} else {
throw new RestException(503, 'Error when retrieve supplier invoice list : '.$this->db->lasterror());
throw new RestException(503, 'Error when retrieve supplier invoice list : ' . $this->db->lasterror());
}
if (!count($obj_ret)) {
throw new RestException(404, 'No supplier invoice found');
@@ -257,7 +257,7 @@ class SupplierInvoices extends DolibarrApi
}
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
}
foreach ($request_data as $field => $value) {
@@ -296,7 +296,7 @@ class SupplierInvoices extends DolibarrApi
}
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
}
if ($this->invoice->delete(DolibarrApiAccess::$user) < 0) {
@@ -339,7 +339,7 @@ class SupplierInvoices extends DolibarrApi
}
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
}
$result = $this->invoice->validate(DolibarrApiAccess::$user, '', $idwarehouse, $notrigger);
@@ -347,13 +347,13 @@ class SupplierInvoices extends DolibarrApi
throw new RestException(304, 'Error nothing done. The invoice is already validated');
}
if ($result < 0) {
throw new RestException(500, 'Error when validating Invoice: '.$this->invoice->error);
throw new RestException(500, 'Error when validating Invoice: ' . $this->invoice->error);
}
return array(
'success' => array(
'code' => 200,
'message' => 'Invoice validated (Ref='.$this->invoice->ref.')'
'message' => 'Invoice validated (Ref=' . $this->invoice->ref . ')'
)
);
}
@@ -381,7 +381,7 @@ class SupplierInvoices extends DolibarrApi
}
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
}
$result = $this->invoice->fetch($id);
@@ -410,6 +410,7 @@ class SupplierInvoices extends DolibarrApi
* @param string $comment {@from body} Note (optional)
* @param string $chqemetteur {@from body} Payment issuer (mandatory if payment_mode_id corresponds to 'CHQ'-payment type)
* @param string $chqbank {@from body} Issuer bank name (optional)
* @param float $amount {@from body} Amount of payment if we don't want to use the remain to pay
*
* @url POST {id}/payments
*
@@ -418,7 +419,7 @@ class SupplierInvoices extends DolibarrApi
* @throws RestException 401
* @throws RestException 404
*/
public function addPayment($id, $datepaye, $payment_mode_id, $closepaidinvoices, $accountid, $num_payment = '', $comment = '', $chqemetteur = '', $chqbank = '')
public function addPayment($id, $datepaye, $payment_mode_id, $closepaidinvoices, $accountid, $num_payment = '', $comment = '', $chqemetteur = '', $chqbank = '', $amount = null)
{
global $conf;
@@ -430,7 +431,7 @@ class SupplierInvoices extends DolibarrApi
}
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
}
if (isModEnabled("banque")) {
@@ -449,18 +450,24 @@ class SupplierInvoices extends DolibarrApi
throw new RestException(404, 'Invoice not found');
}
// Calculate amount to pay
$totalpaid = $this->invoice->getSommePaiement();
$totaldeposits = $this->invoice->getSumDepositsUsed();
$resteapayer = price2num($this->invoice->total_ttc - $totalpaid - $totaldeposits, 'MT');
if (null !== $amount && $amount > 0) {
// We use the amount given in parameter
$paymentamount = $amount;
} else {
// We calculate the remain to pay, and use it as amount
$totalpaid = $this->invoice->getSommePaiement();
$totaldeposits = $this->invoice->getSumDepositsUsed();
$paymentamount = price2num($this->invoice->total_ttc - $totalpaid - $totaldeposits, 'MT');
}
$this->db->begin();
$amounts = array();
$multicurrency_amounts = array();
$resteapayer = price2num($resteapayer, 'MT');
$amounts[$id] = $resteapayer;
$paymentamount = price2num($paymentamount, 'MT');
$amounts[$id] = $paymentamount;
// Multicurrency
$newvalue = price2num($this->invoice->multicurrency_total_ttc, 'MT');
@@ -479,14 +486,14 @@ class SupplierInvoices extends DolibarrApi
$paiement_id = $paiement->create(DolibarrApiAccess::$user, ($closepaidinvoices == 'yes' ? 1 : 0)); // This include closing invoices
if ($paiement_id < 0) {
$this->db->rollback();
throw new RestException(400, 'Payment error : '.$paiement->error);
throw new RestException(400, 'Payment error : ' . $paiement->error);
}
if (isModEnabled("banque")) {
$result = $paiement->addPaymentToBank(DolibarrApiAccess::$user, 'payment_supplier', '(SupplierInvoicePayment)', $accountid, $chqemetteur, $chqbank);
if ($result < 0) {
$this->db->rollback();
throw new RestException(400, 'Add payment to bank error : '.$paiement->error);
throw new RestException(400, 'Add payment to bank error : ' . $paiement->error);
}
}
@@ -516,7 +523,7 @@ class SupplierInvoices extends DolibarrApi
}
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
}
$this->invoice->fetch_lines();
$result = array();
@@ -552,7 +559,7 @@ class SupplierInvoices extends DolibarrApi
}
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
}
$request_data = (object) $request_data;
@@ -586,7 +593,7 @@ class SupplierInvoices extends DolibarrApi
);
if ($updateRes < 0) {
throw new RestException(400, 'Unable to insert the new line. Check your inputs. '.$this->invoice->error);
throw new RestException(400, 'Unable to insert the new line. Check your inputs. ' . $this->invoice->error);
}
return $updateRes;
@@ -619,7 +626,7 @@ class SupplierInvoices extends DolibarrApi
}
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
}
$request_data = (object) $request_data;
@@ -690,7 +697,7 @@ class SupplierInvoices extends DolibarrApi
}
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
}
// TODO Check the lineid $lineid is a line of ojbect

View File

@@ -279,6 +279,7 @@ if (empty($reshook)) {
$object->date_debut = $date_debut;
$object->date_fin = $date_fin;
$object->halfday = $halfday;
$object->entity = $conf->entity;
$result = $object->create($user);
if ($result <= 0) {
@@ -657,7 +658,7 @@ if (empty($reshook)) {
$societeName = $conf->global->MAIN_APPLICATION_TITLE;
}
$subject = $societeName." - ".$langs->transnoentitiesnoconv("HolidaysValidated");
$subject = '['.$societeName."] ".$langs->transnoentitiesnoconv("HolidaysValidated");
// Content
$message = "<p>".$langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",</p>\n";

View File

@@ -260,7 +260,7 @@ if (isModEnabled('holiday') && $user->hasRight('holiday', 'read')) {
$i++;
}
} else {
print '<tr class="oddeven"><td colspan="7" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
print '<tr class="oddeven"><td colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
}
print '</table>';
print '</div>';
@@ -332,7 +332,7 @@ if (isModEnabled('expensereport') && $user->hasRight('expensereport', 'read')) {
$i++;
}
} else {
print '<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
print '<tr class="oddeven"><td colspan="5"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
}
print '</table>';
print '</div>';

View File

@@ -319,6 +319,8 @@ ErrorTheUrlOfYourDolInstanceDoesNotMatchURLIntoOAuthSetup=Error: The URL of you
ErrorMenuExistValue=A Menu already exist with this Title or URL
ErrorSVGFilesNotAllowedAsLinksWithout=SVG files are not allowed as external links without the option %s
ErrorTypeMenu=Impossible to add another menu for the same module on the navbar, not handle yet
ErrorObjectNotFound = The object <b>%s</b> is not found, please check your url
ErrorTableExist=Table <b>%s</b> already exist
ErrorDictionaryNotFound=Dictionary <b>%s</b> not found
ErrorFailedToCreateSymLinkToMedias=Failed to create the symbolic link %s to point to %s

View File

@@ -318,10 +318,12 @@ ErrorTheUrlOfYourDolInstanceDoesNotMatchURLIntoOAuthSetup=Erreur : L'URL de vot
ErrorMenuExistValue=Un menu existe déjà avec ce titre ou cette URL
ErrorSVGFilesNotAllowedAsLinksWithout=Les fichiers SVG ne sont pas autorisés en tant que liens externes sans l'option %s
ErrorTypeMenu=Impossible d'ajouter un autre menu pour le même module sur la barre de navigation, pas encore géré
ErrorObjectNotFound=L'objet <b>%s</b> est introuvable verifier votre url
ErrorTableExist=La table <b>%s</b> existe déja
ErrorDictionaryNotFound=Le dictionnaire <b>%s</b> introuvable
ErrorFailedToCreateSymLinkToMedias=Failed to create the symlinks %s to point to %s
# Warnings
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Votre paramètre PHP upload_max_filesize (%s) est supérieur au paramètre PHP post_max_size (%s). Ceci n'est pas une configuration cohérente.
WarningPasswordSetWithNoAccount=Un mot de passe a été fixé pour cet adhérent. Cependant, aucun compte d'utilisateur n'a été créé. Donc, ce mot de passe est stocké, mais ne peut être utilisé pour accéder à Dolibarr. Il peut être utilisé par un module/interface externe, mais si vous n'avez pas besoin de définir ni login ni mot de passe pour un adhérent, vous pouvez désactiver l'option «Gérer un login pour chaque adhérent" depuis la configuration du module Adhérents. Si vous avez besoin de gérer un login, mais pas de mot de passe, vous pouvez laisser ce champ vide pour éviter cet avertissement. Remarque: L'email peut également être utilisé comme login si l'adhérent est lié à un utilisateur.

View File

@@ -1802,8 +1802,8 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
if (!defined('DISABLE_FONT_AWSOME')) {
print '<!-- Includes CSS for font awesome -->'."\n";
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/theme/common/fontawesome-5/css/all.min.css'.($ext ? '?'.$ext : '').'">'."\n";
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/theme/common/fontawesome-5/css/v4-shims.min.css'.($ext ? '?'.$ext : '').'">'."\n";
$fontawesome_directory = getDolGlobalString('MAIN_FONTAWESOME_DIRECTORY', '/theme/common/fontawesome-5');
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.$fontawesome_directory.'/css/all.min.css'.($ext ? '?'.$ext : '').'">'."\n";
}
print '<!-- Includes CSS for Dolibarr theme -->'."\n";

View File

@@ -233,7 +233,6 @@ if ($dirins && $action == 'initmodule' && $modulename) {
'mymodule'=>strtolower($modulename),
'MyModule'=>$modulename
);
$result = dolCopyDir($srcdir, $destdir, 0, 0, $arrayreplacement);
//dol_mkdir($destfile);
if ($result <= 0) {
@@ -379,6 +378,11 @@ if ($dirins && $action == 'initmodule' && $modulename) {
dol_delete_file($destdir.'/README.md');
file_put_contents($destdir.'/README.md', $conf->global->MODULEBUILDER_SPECIFIC_README);
}
// for create file to add properties
// file_put_contents($destdir.'/'.strtolower($modulename).'propertycard.php','');
// $srcFileCard = DOL_DOCUMENT_ROOT.'/modulebuilder/card.php';
// $destFileCard = $dirins.'/'.strtolower($modulename).'/template/card.php';
// dol_copy($srcFileCard, $destdir.'/'.strtolower($modulename).'propertycard.php', 0,1, $arrayreplacement);
}
if (!$error) {
@@ -1677,10 +1681,10 @@ if ($dirins && ($action == 'droptable' || $action == 'droptableextrafields') &&
}
}
if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) && !empty($tabobj)) {
if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) && !empty(GETPOST('obj')) && $tabobj == "createproperty") {
$error = 0;
$objectname = $tabobj;
$objectname = GETPOST('obj');
$dirins = $dirread = $listofmodules[strtolower($module)]['moduledescriptorrootpath'];
$moduletype = $listofmodules[strtolower($module)]['moduletype'];
@@ -1689,6 +1693,11 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) &&
$destdir = $dirins.'/'.strtolower($module);
dol_mkdir($destdir);
$objects = dolGetListOfObjectClasses($destdir);
if (!in_array($objectname, array_values($objects))) {
$error++;
setEventMessages($langs->trans("ErrorObjectNotFound", $langs->transnoentities($objectname)), null, 'errors');
}
// We click on add property
if (!GETPOST('regenerateclasssql') && !GETPOST('regeneratemissing')) {
if (!GETPOST('propname', 'aZ09')) {
@@ -1708,7 +1717,7 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) &&
$addfieldentry = array(
'name'=>GETPOST('propname', 'aZ09'),
'label'=>GETPOST('proplabel', 'alpha'),
'type'=>GETPOST('proptype', 'alpha'),
'type'=>strtolower(GETPOST('proptype', 'alpha')),
'arrayofkeyval'=>GETPOST('proparrayofkeyval', 'restricthtml'), // Example json string '{"0":"Draft","1":"Active","-1":"Cancel"}'
'visible'=>GETPOST('propvisible', 'int'),
'enabled'=>GETPOST('propenabled', 'int'),
@@ -1727,8 +1736,6 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) &&
'alwayseditable'=>intval(GETPOST('propalwayseditable', 'int')),
'validate' => GETPOST('propvalidate', 'int')
);
if (!empty($addfieldentry['arrayofkeyval']) && !is_array($addfieldentry['arrayofkeyval'])) {
$addfieldentry['arrayofkeyval'] = json_decode($addfieldentry['arrayofkeyval'], true);
}
@@ -3766,6 +3773,7 @@ if ($module == 'initmodule') {
print dol_get_fiche_head($head3, $tabobj, '', -1, '', 0, '', '', 0, 'forobjectsuffix'); // Level 3
if ($tabobj == 'newobject') {
// New object tab
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
@@ -3821,6 +3829,134 @@ if ($module == 'initmodule') {
*/
print '</form>';
} elseif ($tabobj == 'createproperty') {
$attributesUnique = array (
'propname' => $form->textwithpicto($langs->trans("Code"), $langs->trans("PropertyDesc"), 1, 'help', 'extracss', 0, 3, 'propertyhelp'),
'proplabel' => $form->textwithpicto($langs->trans("Label"), $langs->trans("YouCanUseTranslationKey")),
'proptype' => $form->textwithpicto($langs->trans("Type"), $langs->trans("TypeOfFieldsHelpIntro").'<br><br>'.$langs->trans("TypeOfFieldsHelp"), 1, 'help', 'extracss', 0, 3, 'typehelp'),
'proparrayofkeyval' => $form->textwithpicto($langs->trans("ArrayOfKeyValues"), $langs->trans("ArrayOfKeyValuesDesc")),
'propnotnull' => $form->textwithpicto($langs->trans("NotNull"), $langs->trans("NotNullDesc")),
'propdefault' => $langs->trans("DefaultValue"),
'propindex' => $langs->trans("DatabaseIndex"),
'propforeignkey' => $form->textwithpicto($langs->trans("ForeignKey"), $langs->trans("ForeignKeyDesc"), 1, 'help', 'extracss', 0, 3, 'foreignkeyhelp'),
'propposition' => $langs->trans("Position"),
'propenabled' => $form->textwithpicto($langs->trans("Enabled"), $langs->trans("EnabledDesc"), 1, 'help', 'extracss', 0, 3, 'enabledhelp'),
'propvisible' => $form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc").'<br><br>'.$langs->trans("ItCanBeAnExpression"), 1, 'help', 'extracss', 0, 3, 'visiblehelp'),
'propnoteditable' => $langs->trans("NotEditable"),
'propalwayseditable' => $langs->trans("AlwaysEditable"),
'propsearchall' => $form->textwithpicto($langs->trans("SearchAll"), $langs->trans("SearchAllDesc")),
'propisameasure' => $form->textwithpicto($langs->trans("IsAMeasure"), $langs->trans("IsAMeasureDesc")),
'propcss' => $langs->trans("CSSClass"),
'propcssview' => $langs->trans("CSSViewClass"),
'propcsslist' => $langs->trans("CSSListClass"),
'prophelp' => $langs->trans("KeyForTooltip"),
'propshowoncombobox' => $langs->trans("ShowOnCombobox"),
'propvalidate' => $form->textwithpicto($langs->trans("Validate"), $langs->trans("ValidateModBuilderDesc")),
'propcomment' => $langs->trans("Comment"),
);
print '<form action="'.$_SERVER["PHP_SELF"].'?tab=objects&module='.urlencode($module).'&tabobj=createproperty&obj='.urlencode(GETPOST('obj')).'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="addproperty">';
print '<input type="hidden" name="tab" value="objects">';
print '<input type="hidden" name="module" value="'.dol_escape_htmltag($module).'">';
print '<input type="hidden" name="obj" value="'.dol_escape_htmltag(GETPOST('obj')).'">';
print '<table class="border centpercent tableforfieldcreate">'."\n";
$counter = 0;
foreach ($attributesUnique as $key => $attribute) {
if ($counter % 2 === 0) {
print '<tr>';
}
if ($key == 'propname' || $key == 'proplabel') {
print '<td class="titlefieldcreate fieldrequired">'.$attribute.'</td><td class="valuefieldcreate maxwidth"><input class="maxwidth200" id="'.$key.'" type="text" name="'.$key.'" value="'.dol_escape_htmltag(GETPOST($key, 'alpha')).'"></td>';
} elseif ($key == 'proptype') {
print '<td class="titlefieldcreate fieldrequired">'.$attribute.'</td><td class="valuefieldcreate maxwidth"><div style="position: relative;"><input class="maxwidth200" id="'.$key.'" type="text" name="'.$key.'" value="'.dol_escape_htmltag(GETPOST($key, 'alpha')).'"><div id="suggestions"></div><div></td>';
} elseif ($key == 'propvalidate') {
print '<td class="titlefieldcreate fieldrequired">'.$attribute.'</td><td class="valuefieldcreate maxwidth"><input type="number" step="1" min="0" max="1" class="text maxwidth100" value="'.dol_escape_htmltag(GETPOST($key, 'alpha')).'"></td>';
} else {
print '<td class="titlefieldcreate">'.$attribute.'</td><td class="valuefieldcreate maxwidth"><input class="maxwidth200" type="text" name="'.$key.'" value="'.dol_escape_htmltag(GETPOST($key, 'alpha')).'"></td>';
}
$counter++;
if ($counter % 2 === 0) {
print '</tr>';
}
}
if ($counter % 2 !== 0) {
while ($counter % 2 !== 0) {
print '<td></td>';
$counter++;
}
print '</tr>';
}
print '</table><br>'."\n";
print '<div class="center">';
print '<input type="submit" class="button button-save" name="add" value="' . dol_escape_htmltag($langs->trans('Create')) . '">';
print '<input type="button" class="button button-cancel" name="cancel" value="' . dol_escape_htmltag($langs->trans('Cancel')) . '" onclick="goBack()">';
print '</div>';
print '</form>';
// javascript
print '<script>
function goBack() {
var url = "'.$_SERVER["PHP_SELF"].'?tab=objects&module='.urlencode($module).'";
window.location.href = url;
}
$(document).ready(function() {
// Tableau de suggestions statiques
var suggestions = ["VARCHAR", "DOUBLE", "REAL", "TEXT", "HTML", "DATETIME", "TIMESTAMP", "INTEGER", "INTEGER:CLASSNAME:RELATIVEPATH/TO/CLASSFILE.CLASS.PHP[:1[:FILTER]]"];
function showSuggestions() {
var inputText = $("#proptype").val().toLowerCase();
var suggestionsDiv = $("#suggestions");
var filteredSuggestions = suggestions.filter(function(suggestion) {
return suggestion.toLowerCase().indexOf(inputText) !== -1;
});
//get suggestion on div
suggestionsDiv.empty();
for (var i = 0; i < filteredSuggestions.length; i++) {
var suggestion = filteredSuggestions[i];
var suggestionItem = $("<div>").text(suggestion).css({ cursor: "pointer", padding: "5px" });
suggestionsDiv.append(suggestionItem);
}
if (inputText === "" || filteredSuggestions.length === 0) {
suggestionsDiv.hide();
} else {
suggestionsDiv.show();
}
}
$("#proptype").on("input", showSuggestions);
$("#suggestions").on("click", "div", function() {
var selectedValue = $(this).text();
$("#proptype").val(selectedValue);
$("#suggestions").hide();
});
// when we click outside the input
$(document).on("click", function(event) {
if (!$(event.target).closest("#proptype, #suggestions").length) {
$("#suggestions").hide();
}
});
// when we delete the content input
$("#proptype").on("keyup", function() {
if ($(this).val() === "") {
$("#suggestions").hide();
}
});
// when hover in suggestion
$("#suggestions").on("mouseenter", "div", function() {
$(this).css("background-color", "#e0e0e0");
});
$("#suggestions").on("mouseleave", "div", function() {
$(this).css("background-color", "#fff");
});
});';
print '</script>';
} elseif ($tabobj == 'deleteobject') {
// Delete object tab
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
@@ -3850,8 +3986,7 @@ if ($module == 'initmodule') {
// Print form confirm
print $formconfirm;
}
if ($action != 'editfile' || empty($file)) {
if ($action != 'editfile' || empty($file) ) {
try {
//$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
@@ -4123,8 +4258,13 @@ if ($module == 'initmodule') {
print '<input class="button smallpaddingimp" type="submit" name="regenerateclasssql" value="'.$langs->trans("RegenerateClassAndSql").'">';
print '<br><br>';
print load_fiche_titre($langs->trans("ObjectProperties"), '', '');
$mod = strtolower($module);
$obj = strtolower($tabobj);
$newproperty = dolGetButtonTitle($langs->trans('NewProperty'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/modulebuilder/index.php?tab=objects&module='.urlencode($module).'&tabobj=createproperty&obj='.urlencode($tabobj));
print_barre_liste($langs->trans("ObjectProperties"), $page, $_SERVER["PHP_SELF"], '', '', '', '', '', 0, '', 0, $newproperty, '', '', 0, 0, 1);
//var_dump($reflectorpropdefault);exit;
print '<!-- Table with properties of object -->'."\n";
print '<div class="div-table-responsive">';
print '<table class="noborder small">';
@@ -4166,37 +4306,7 @@ if ($module == 'initmodule') {
// modified during the constructor and we want value into head of class before constructor is called.
//$properties = dol_sort_array($tmpobject->fields, 'position');
$properties = dol_sort_array($reflectorpropdefault['fields'], 'position');
if (!empty($properties)) {
// Line to add a property
print '<tr>';
print '<td class="none"><input type="text" class="maxwidth75" name="propname" value="'.dol_escape_htmltag(GETPOST('propname', 'alpha')).'"></td>';
print '<td><input type="text" class="maxwidth75" name="proplabel" value="'.dol_escape_htmltag(GETPOST('proplabel', 'alpha')).'"></td>';
print '<td><input type="text" class="maxwidth75" name="proptype" value="'.dol_escape_htmltag(GETPOST('proptype', 'alpha')).'"></td>';
print '<td><input type="text" class="maxwidth75" name="proparrayofkeyval" value="'.dol_escape_htmltag(GETPOST('proparrayofkeyval', 'restricthtml')).'"></td>';
print '<td class="center"><input type="text" class="center maxwidth50" name="propnotnull" value="'.dol_escape_htmltag(GETPOST('propnotnull', 'alpha')).'"></td>';
print '<td><input type="text" class="center maxwidth50" name="propdefault" value="'.dol_escape_htmltag(GETPOST('propdefault', 'alpha')).'"></td>';
print '<td class="center"><input type="text" class="center maxwidth50" name="propindex" value="'.dol_escape_htmltag(GETPOST('propindex', 'alpha')).'"></td>';
print '<td class="center"><input type="text" class="maxwidth100" name="propforeignkey" value="'.dol_escape_htmltag(GETPOST('propforeignkey', 'alpha')).'"></td>';
print '<td class="right"><input type="text" class="right" size="2" name="propposition" value="'.dol_escape_htmltag(GETPOST('propposition', 'alpha')).'"></td>';
print '<td class="center"><input type="text" class="center maxwidth50" name="propenabled" value="'.dol_escape_htmltag(GETPOST('propenabled', 'alpha')).'"></td>';
print '<td class="center"><input type="text" class="center maxwidth50" name="propvisible" value="'.dol_escape_htmltag(GETPOST('propvisible', 'alpha')).'"></td>';
print '<td class="center"><input type="text" class="center maxwidth50" name="propnoteditable" value="'.dol_escape_htmltag(GETPOST('propnoteditable', 'alpha')).'"></td>';
print '<td class="center"><input type="text" class="center maxwidth50" name="propalwayseditable" value="'.dol_escape_htmltag(GETPOST('propalwayseditable', 'alpha')).'"></td>';
print '<td class="center"><input type="text" class="center maxwidth50" name="propsearchall" value="'.dol_escape_htmltag(GETPOST('propsearchall', 'alpha')).'"></td>';
print '<td class="center"><input type="text" class="center maxwidth50" name="propisameasure" value="'.dol_escape_htmltag(GETPOST('propisameasure', 'alpha')).'"></td>';
print '<td class="center"><input type="text" class="maxwidth50" name="propcss" value="'.dol_escape_htmltag(GETPOST('propcss', 'alpha')).'"></td>';
print '<td class="center"><input type="text" class="maxwidth50" name="propcssview" value="'.dol_escape_htmltag(GETPOST('propcssview', 'alpha')).'"></td>';
print '<td class="center"><input type="text" class="maxwidth50" name="propcsslist" value="'.dol_escape_htmltag(GETPOST('propcsslist', 'alpha')).'"></td>';
print '<td><input type="text" class="maxwidth50" name="prophelp" value="'.dol_escape_htmltag(GETPOST('prophelp', 'alpha')).'"></td>';
print '<td class="center"><input type="text" class="center maxwidth50" name="propshowoncombobox" value="'.dol_escape_htmltag(GETPOST('propshowoncombobox', 'alpha')).'"></td>';
//print '<td class="center"><input type="text" size="2" name="propdisabled" value="'.dol_escape_htmltag(GETPOST('propdisabled', 'alpha')).'"></td>';
print '<td><input type="number" step="1" min="0" max="1" class="text maxwidth50" name="propvalidate" value="'.dol_escape_htmltag(GETPOST('propvalidate', 'alpha')).'"></td>';
print '<td><input class="text maxwidth100" name="propcomment" value="'.dol_escape_htmltag(GETPOST('propcomment', 'alpha')).'"></td>';
print '<td class="center tdstickyright tdstickyghostwhite">';
print '<input type="submit" class="button" name="add" value="'.$langs->trans("Add").'">';
print '</td></tr>';
// List of existing properties
foreach ($properties as $propkey => $propval) {
/* If from Reflection

View File

@@ -493,7 +493,7 @@ if (empty($reshook)) {
}
if (empty($ref)) {
if (empty($conf->global->PRODUCT_GENERATE_REF_AFTER_FORM)) {
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('Ref')), null, 'errors');
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('ProductRef')), null, 'errors');
$action = "create";
$error++;
}
@@ -1369,7 +1369,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (!empty($modCodeProduct->code_auto)) {
$tmpcode = $modCodeProduct->getNextValue($object, $type);
}
print '<td class="titlefieldcreate fieldrequired">'.$langs->trans("Ref").'</td><td><input id="ref" name="ref" class="maxwidth200" maxlength="128" value="'.dol_escape_htmltag(GETPOSTISSET('ref') ? GETPOST('ref', 'alphanohtml') : $tmpcode).'">';
print '<td class="titlefieldcreate fieldrequired">'.$langs->trans("ProductRef").'</td><td><input id="ref" name="ref" class="maxwidth200" maxlength="128" value="'.dol_escape_htmltag(GETPOSTISSET('ref') ? GETPOST('ref', 'alphanohtml') : $tmpcode).'">';
if ($refalreadyexists) {
print $langs->trans("RefAlreadyExists");
}

View File

@@ -6267,7 +6267,8 @@ class Product extends CommonObject
1 => $baseprice
);
for ($i = 1; $i <= getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT'); $i++) {
$nbofproducts = getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT');
for ($i = 1; $i <= $nbofproducts; $i++) {
$price = $baseprice;
$price_min = $baseprice;

View File

@@ -309,6 +309,13 @@ class Inventory extends CommonObject
$sql .= " AND cp.fk_categorie IN (".$this->db->sanitize($this->categories_product).")";
$sql .= ")";
}
if (getDolGlobalInt('PRODUIT_SOUSPRODUITS')) {
$sql .= " AND NOT EXISTS (";
$sql .= " SELECT pa.rowid";
$sql .= " FROM ".$this->db->prefix()."product_association as pa";
$sql .= " WHERE pa.fk_product_pere = ps.fk_product";
$sql .= ")";
}
$inventoryline = new InventoryLine($this->db);

View File

@@ -220,7 +220,7 @@ $alias_product_perentity = empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED) ?
// Definition of array of fields for columns
$arrayfields = array(
'p.rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'noteditable'=>1, 'notnull'=> 1, 'index'=>1, 'position'=>1, 'comment'=>'Id', 'css'=>'left'),
'p.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>10),
'p.ref'=>array('label'=>'ProductRef', 'checked'=>1, 'position'=>10),
//'pfp.ref_fourn'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'enabled'=>(isModEnabled('barcode'))),
'thumbnail'=>array('label'=>'Photo', 'checked'=>0, 'position'=>10),
'p.label'=>array('label'=>"Label", 'checked'=>1, 'position'=>10),
@@ -852,16 +852,15 @@ if ($type === "") {
if ($type === "") {
$params['forcenohideoftext'] = 1;
}
if ($type === "") {
$newcardbutton .= dolGetButtonTitle($langs->trans('NewProduct'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type=0', '', $perm, $params);
$type = Product::TYPE_SERVICE;
}
$label = 'NewProduct';
if ($type == Product::TYPE_SERVICE) {
$label = 'NewService';
}
$newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type='.$type, '', $perm, $params);
if ($type === "" || $type == Product::TYPE_PRODUCT) {
$label = 'NewProduct';
$newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type=0', '', $perm, $params);
}
if ($type === "" || $type == Product::TYPE_SERVICE) {
$label = 'NewService';
$newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type=1', '', $perm, $params);
}
print '<form id="searchFormList" action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formulaire">';
if ($optioncss != '') {

View File

@@ -773,7 +773,7 @@ print '</tr>';
// Lines of title
print '<tr class="liste_titre">';
print_liste_field_titre('<input type="checkbox" onClick="toggle(this)" />', $_SERVER["PHP_SELF"], '');
print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], 'p.ref', $param, '', '', $sortfield, $sortorder);
print_liste_field_titre('ProductRef', $_SERVER["PHP_SELF"], 'p.ref', $param, '', '', $sortfield, $sortorder);
print_liste_field_titre('Label', $_SERVER["PHP_SELF"], 'p.label', $param, '', '', $sortfield, $sortorder);
if (isModEnabled("service") && $type == 1) {
print_liste_field_titre('Duration', $_SERVER["PHP_SELF"], 'p.duration', $param, '', '', $sortfield, $sortorder, 'center ');

View File

@@ -487,7 +487,7 @@ if (!empty($search_fk_warehouse)) {
// Lines of title
print '<tr class="liste_titre">';
print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], 'p.ref', $param, '', '', $sortfield, $sortorder);
print_liste_field_titre('ProductRef', $_SERVER["PHP_SELF"], 'p.ref', $param, '', '', $sortfield, $sortorder);
print_liste_field_titre('Label', $_SERVER["PHP_SELF"], 'p.label', $param, '', '', $sortfield, $sortorder);
if ($mode == 'future') {
@@ -502,13 +502,14 @@ if ($mode == 'future') {
print_liste_field_titre('', $_SERVER["PHP_SELF"]);
print_liste_field_titre('CurrentStock', $_SERVER["PHP_SELF"], $fieldtosortcurrentstock, $param, '', '', $sortfield, $sortorder, 'right ');
}
print_liste_field_titre('', $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'right ');
// Hook fields
$parameters = array('param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print_liste_field_titre('', $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'right ');
print "</tr>\n";
$totalbuyingprice = 0;
@@ -643,14 +644,14 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
$totalcurrentstock += $currentstock;
}
// Action
print '<td class="right"></td>';
// Fields from hook
$parameters = array('objp'=>$objp);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action
print '<td class="right"></td>';
print '</tr>'."\n";
}
$i++;

View File

@@ -2447,6 +2447,12 @@ class Project extends CommonObject
}
$return .= '<span class="info-box-label">'.dol_print_date($this->date_end, 'day').'</span>';
}*/
if (property_exists($this, 'thirdparty') && is_object($this->thirdparty)) {
$return .= '<br><div class="info-box-ref tdoverflowmax150 inline-block valignmiddle">'.$this->thirdparty->getNomUrl(1);
$return .= '</div><div class="inline-block valignmiddle">';
$return .= dol_print_phone($this->thirdparty->phone, $this->thirdparty->country_code, 0, $this->thirdparty->id, 'tel', 'hidenum', 'phone');
$return .='</div>';
}
if (!empty($arraydata['assignedusers'])) {
$return .= '<br>';
if ($this->public) {
@@ -2468,9 +2474,11 @@ class Project extends CommonObject
$return .= '<br><span class="info-box-label small">'.$langs->trans("OppStatus".$this->opp_status_code).'</span>';
$return .= ' <span class="opacitymedium small">('.round($this->opp_percent).'%)</span>';
$return .= '<br><span class="amount small">'.price($this->opp_amount).'</span>';
} else {
$return .= '<br>';
}
if (method_exists($this, 'getLibStatut')) {
$return .= '<br><div class="info-box-status small">'.$this->getLibStatut(3).'</div>';
$return .= '<div class="info-box-status small marginleftonly inline-block">'.$this->getLibStatut(3).'</div>';
}
$return .= '</div>';
$return .= '</div>';

View File

@@ -1598,8 +1598,8 @@ class Task extends CommonObjectLine
if ($timespent->id > 0) {
$this->timespent_id = $timespent->id;
$this->id = $timespent->fk_element;
$this->timespent_date = $this->db->jdate($timespent->element_date);
$this->timespent_datehour = $this->db->jdate($timespent->element_datehour);
$this->timespent_date = $timespent->element_date;
$this->timespent_datehour = $timespent->element_datehour;
$this->timespent_withhour = $timespent->element_date_withhour;
$this->timespent_duration = $timespent->element_duration;
$this->timespent_fk_user = $timespent->fk_user;

View File

@@ -1451,6 +1451,8 @@ while ($i < $imaxinloop) {
$companystatic->town = $obj->town;
$companystatic->country_code = $obj->country_code;
$object->thirdparty = $companystatic;
$stringassignedusers = '';
if (!empty($arrayfields['c.assigned']['checked'])) {
@@ -1494,7 +1496,7 @@ while ($i < $imaxinloop) {
}
$selected = in_array($object->id, $arrayofselected);
$arrayofdata = array('assignedusers' => $stringassignedusers, 'selected' => $selected);
$arrayofdata = array('assignedusers' => $stringassignedusers, 'thirdparty'=>$companystatic, 'selected' => $selected);
print $object->getKanbanView('', $arrayofdata);

View File

@@ -370,7 +370,9 @@ if (empty($reshook) && $action == 'add') {
$msg = $arraydefaultmessage->content;
}
if (empty($labeltosue)) {
$labeltouse = '['.$mysoc->name.'] '.$langs->trans("YourMessage");
$appli = $mysoc->name;
$labeltouse = '['.$appli.'] '.$langs->trans("YourMessage");
$msg = $langs->trans("YourMessageHasBeenReceived");
}

View File

@@ -386,8 +386,9 @@ if (empty($reshook)) {
$mimetype = $attachedfiles['mimes'];
// Send email to customer
$appli = $mysoc->name;
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubject', $object->ref, $object->track_id);
$subject = '['.$appli.'] '.$langs->transnoentities('TicketNewEmailSubject', $object->ref, $object->track_id);
$message = ($conf->global->TICKET_MESSAGE_MAIL_NEW ? $conf->global->TICKET_MESSAGE_MAIL_NEW : $langs->transnoentities('TicketNewEmailBody')).'<br><br>';
$message .= $langs->transnoentities('TicketNewEmailBodyInfosTicket').'<br>';
@@ -423,7 +424,9 @@ if (empty($reshook)) {
// Send email to TICKET_NOTIFICATION_EMAIL_TO
$sendto = $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
if ($sendto) {
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin', $object->ref, $object->track_id);
$appli = $mysoc->name;
$subject = '['.$appli.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin', $object->ref, $object->track_id);
$message_admin = $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id).'<br><br>';
$message_admin .= '<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
$message_admin .= '<li>'.$langs->trans('Type').' : '.$object->type_label.'</li>';

View File

@@ -5349,7 +5349,7 @@ class Societe extends CommonObject
if ($code) {
$sql .= " AND tc.code = '".$this->db->escape($code)."'";
}
$sql .= " AND sc.entity = ".getEntity($this->element);
$sql .= " AND sc.entity IN (".getEntity($this->element).")";
$sql .= " AND tc.source = 'external'";
$sql .= " AND tc.active=1";

View File

@@ -219,7 +219,7 @@ button.item_value.selected {
div[aria-describedby="dialog-info"] button:before {
content: "\f788";
font-family: "Font Awesome 5 Free";
font-family: "<?php echo getDolGlobalString('MAIN_FONTAWESOME_FAMILY', 'Font Awesome 5 Free'); ?>";
font-weight: 900;
padding-right: 5px;
}

View File

@@ -132,7 +132,7 @@ div#topmenu-global-search-dropdown a::after, div#topmenu-quickadd-dropdown a::af
.dropdown-toggle::after {
font-family: "Font Awesome 5 Free";
font-family: "<?php echo getDolGlobalString('MAIN_FONTAWESOME_FAMILY', 'Font Awesome 5 Free'); ?>";
font-size: 0.7em;
font-weight: 900;
font-style: normal;
@@ -375,7 +375,7 @@ a.dropdown-item {
.dropdown-item::before {
/* font part */
font-family: "Font Awesome 5 Free";
font-family: "<?php echo getDolGlobalString('MAIN_FONTAWESOME_FAMILY', 'Font Awesome 5 Free'); ?>";
font-weight: 900;
font-style: normal;
font-variant: normal;

View File

@@ -1198,7 +1198,7 @@ div.divsearchfield {
content: "\f080";
}
.a-filter:before, .a-mesure:before {
font-family: "Font Awesome 5 Free";
font-family: "<?php echo getDolGlobalString('MAIN_FONTAWESOME_FAMILY', 'Font Awesome 5 Free'); ?>";
font-weight: 600;
padding-right: 5px;
padding-left: 5px;
@@ -3470,7 +3470,7 @@ div.tabsElem {
/*
div.tabsElem a.tabactive::before, div.tabsElem a.tabunactive::before {
content: "\f0da";
font-family: "Font Awesome 5 Free";
font-family: "<?php echo getDolGlobalString('MAIN_FONTAWESOME_FAMILY', 'Font Awesome 5 Free'); ?>";
padding-right: 2px;
font-weight: 900;
}
@@ -7526,7 +7526,7 @@ a.phpdebugbar-tab.phpdebugbar-active {
font-weight: 600 !important;
}
.phpdebugbar-fa-tags, .phpdebugbar-fa-tasks, .phpdebugbar-indicator .fa {
font-family: "Font Awesome 5 Free";
font-family: "<?php echo getDolGlobalString('MAIN_FONTAWESOME_FAMILY', 'Font Awesome 5 Free'); ?>";
font-weight: 600;
}
div.phpdebugbar-widgets-messages li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-value.phpdebugbar-widgets-warning:before,
@@ -7544,7 +7544,7 @@ div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-param-count:before,
div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-type:before,
div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before
{
font-family: "Font Awesome 5 Free" !important;
font-family: "<?php echo getDolGlobalString('MAIN_FONTAWESOME_FAMILY', 'Font Awesome 5 Free'); ?>" !important;
}
/* ============================================================================== */
@@ -8058,7 +8058,7 @@ table.jPicker {
}
}
@media only screen and (max-width: 320px)
{
.dropdown dd ul {
@@ -8099,7 +8099,5 @@ if (!empty($conf->global->THEME_CUSTOM_CSS)) {
/* Must be at end */
div.flot-text .flot-tick-label .tickLabel, .fa-color-unset {
color: unset;
}

View File

@@ -5,7 +5,7 @@
.mainmenu::before{
/* font part */
font-family: "Font Awesome 5 Free";
font-family: "<?php echo getDolGlobalString('MAIN_FONTAWESOME_FAMILY', 'Font Awesome 5 Free'); ?>";
font-weight: 900;
font-style: normal;
font-variant: normal;

View File

@@ -145,7 +145,7 @@ div#topmenu-global-search-dropdown a::after, div#topmenu-quickadd-dropdown a::af
.dropdown-toggle::after {
/* font part */
font-family: "Font Awesome 5 Free";
font-family: "<?php echo getDolGlobalString('MAIN_FONTAWESOME_FAMILY', 'Font Awesome 5 Free'); ?>";
font-size: 0.7em;
font-weight: 900;
font-style: normal;
@@ -386,7 +386,7 @@ a.dropdown-item {
.dropdown-item::before {
/* font part */
font-family: "Font Awesome 5 Free";
font-family: "<?php echo getDolGlobalString('MAIN_FONTAWESOME_FAMILY', 'Font Awesome 5 Free'); ?>";
font-weight: 900;
font-style: normal;
font-variant: normal;

View File

@@ -5,7 +5,7 @@
.mainmenu::before{
/* font part */
font-family: "Font Awesome 5 Free";
font-family: "<?php echo getDolGlobalString('MAIN_FONTAWESOME_FAMILY', 'Font Awesome 5 Free'); ?>";
font-weight: 900;
font-style: normal;
font-variant: normal;

View File

@@ -1450,7 +1450,7 @@ if ($conf->browser->layout == 'phone') {
content: "\f080";
}
.a-filter:before, .a-mesure:before {
font-family: "Font Awesome 5 Free";
font-family: "<?php echo getDolGlobalString('MAIN_FONTAWESOME_FAMILY', 'Font Awesome 5 Free'); ?>";
font-weight: 600;
padding-right: 5px;
padding-left: 5px;
@@ -7452,7 +7452,7 @@ a.phpdebugbar-tab.phpdebugbar-active {
background-image: unset !important;
}
.phpdebugbar-indicator .fa {
font-family: "Font Awesome 5 Free";
font-family: "<?php echo getDolGlobalString('MAIN_FONTAWESOME_FAMILY', 'Font Awesome 5 Free'); ?>";
font-weight: 600;
}
div.phpdebugbar-widgets-messages li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-value.phpdebugbar-widgets-warning:before,
@@ -7470,7 +7470,7 @@ div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-param-count:before,
div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-type:before,
div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before
{
font-family: "Font Awesome 5 Free" !important;
font-family: "<?php echo getDolGlobalString('MAIN_FONTAWESOME_FAMILY', 'Font Awesome 5 Free'); ?>" !important;
}

View File

@@ -1276,7 +1276,8 @@ class Ticket extends CommonObject
$sql = "SELECT rowid, code, label, use_default, pos, description";
$sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_type";
$sql .= " WHERE active > 0";
$sql .= " WHERE entity IN (".getEntity('c_ticket_type').")";
$sql .= " AND active > 0";
$sql .= " ORDER BY pos";
dol_syslog(get_class($this)."::load_cache_type_tickets", LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -1316,7 +1317,8 @@ class Ticket extends CommonObject
$sql = "SELECT rowid, code, label, use_default, pos, description, public, active, force_severity, fk_parent";
$sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_category";
$sql .= " WHERE active > 0 AND entity = ".((int) $conf->entity);
$sql .= " WHERE entity IN (".getEntity('c_ticket_category').")";
$sql .= " AND active > 0";
if ($publicgroup > -1) {
$sql .= " AND public = ".((int) $publicgroup);
}
@@ -1368,7 +1370,8 @@ class Ticket extends CommonObject
$sql = "SELECT rowid, code, label, use_default, pos, description";
$sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_severity";
$sql .= " WHERE active > 0";
$sql .= " WHERE entity IN (".getEntity('c_ticket_severity').")";
$sql .= " AND active > 0";
$sql .= " ORDER BY pos";
dol_syslog(get_class($this)."::loadCacheSeveritiesTickets", LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -2625,8 +2628,9 @@ class Ticket extends CommonObject
}
if (!empty($sendto)) {
$label_title = empty($conf->global->MAIN_APPLICATION_TITLE) ? $mysoc->name : $conf->global->MAIN_APPLICATION_TITLE;
$subject = '['.$label_title.'- ticket #'.$object->track_id.'] '.$langs->trans('TicketNewMessage');
$appli = getDolGlobalString('MAIN_APPLICATION_TITLE', $mysoc->name);
$subject = '['.$appli.'- ticket #'.$object->track_id.'] '.$langs->trans('TicketNewMessage');
// Message send
$message = $langs->trans('TicketMessageMailIntroText');
@@ -2674,8 +2678,8 @@ class Ticket extends CommonObject
$sendto = array();
if (is_array($internal_contacts) && count($internal_contacts) > 0) {
// Set default subject
$label_title = empty($conf->global->MAIN_APPLICATION_TITLE) ? $mysoc->name : $conf->global->MAIN_APPLICATION_TITLE;
$appli = $label_title;
$appli = getDolGlobalString('MAIN_APPLICATION_TITLE', $mysoc->name);
$subject = GETPOST('subject', 'alphanohtml') ? GETPOST('subject', 'alphanohtml') : '['.$appli.' - '.$langs->trans("Ticket").' #'.$object->track_id.'] '.$langs->trans('TicketNewMessage');
$message_intro = $langs->trans('TicketNotificationEmailBody', "#".$object->id);
@@ -2755,8 +2759,8 @@ class Ticket extends CommonObject
$sendto = array();
if (is_array($external_contacts) && count($external_contacts) > 0) {
// Get default subject for email to external contacts
$label_title = empty($conf->global->MAIN_APPLICATION_TITLE) ? $mysoc->name : $conf->global->MAIN_APPLICATION_TITLE;
$appli = $mysoc->name;
$appli = getDolGlobalString('MAIN_APPLICATION_TITLE', $mysoc->name);
$subject = GETPOST('subject') ? GETPOST('subject') : '['.$appli.' - '.$langs->trans("Ticket").' #'.$object->track_id.'] '.$langs->trans('TicketNewMessage');
$message_intro = GETPOST('mail_intro') ? GETPOST('mail_intro', 'restricthtml') : getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO');

View File

@@ -2428,12 +2428,9 @@ class User extends CommonObject
// Load translation files required by the page
$outputlangs->loadLangs(array("main", "errors", "users", "other"));
$appli = constant('DOL_APPLICATION_TITLE');
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
$appli = $conf->global->MAIN_APPLICATION_TITLE;
}
$appli = getDolGlobalString('MAIN_APPLICATION_TITLE', constant('DOL_APPLICATION_TITLE'));
$subject = '['.$mysoc->name.'] '.$outputlangs->transnoentitiesnoconv("SubjectNewPassword", $appli);
$subject = '['.$appli.'] '.$outputlangs->transnoentitiesnoconv("SubjectNewPassword", $appli);
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));

View File

@@ -1075,7 +1075,7 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase
/**
* testDolFormatAddress
* testDolPrintPhone
*
* @return void
*/
@@ -1092,19 +1092,19 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase
$object->country_code='FR';
$phone=dol_print_phone('1234567890', $object->country_code);
$this->assertEquals('<span style="margin-right: 10px;">12&nbsp;34&nbsp;56&nbsp;78&nbsp;90</span>', $phone, 'Phone for FR 1');
$this->assertEquals($phone, '<span style="margin-right: 10px;">12&nbsp;34&nbsp;56&nbsp;78&nbsp;90</span>', 'Phone for FR 1');
$object->country_code='FR';
$phone=dol_print_phone('1234567890', $object->country_code, 0, 0, 0, '');
$this->assertEquals('<span style="margin-right: 10px;">1234567890</span>', $phone, 'Phone for FR 2');
$this->assertEquals($phone, '<span style="margin-right: 10px;">1234567890</span>', 'Phone for FR 2');
$object->country_code='FR';
$phone=dol_print_phone('1234567890', $object->country_code, 0, 0, 0, ' ');
$this->assertEquals('<span style="margin-right: 10px;">12 34 56 78 90</span>', $phone, 'Phone for FR 3');
$this->assertEquals($phone, '<span style="margin-right: 10px;">12 34 56 78 90</span>', 'Phone for FR 3');
$object->country_code='CA';
$phone=dol_print_phone('1234567890', $object->country_code, 0, 0, 0, ' ');
$this->assertEquals('<span style="margin-right: 10px;">(123) 456-7890</span>', $phone, 'Phone for CA 1');
$this->assertEquals($phone, '<span style="margin-right: 10px;">(123) 456-7890</span>', 'Phone for CA 1');
}