Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
7bbc3bab05
21 changed files with 269 additions and 164 deletions
|
|
@ -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 ' ';
|
||||
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 ' ';
|
||||
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 ' ';
|
||||
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 ' ';
|
||||
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']++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>';
|
||||
|
|
|
|||
|
|
@ -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>';
|
||||
|
|
|
|||
|
|
@ -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.'"> </td></tr>'; // Keep 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> </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> </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>';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"> </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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"> </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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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)) {
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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>';
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 != '') {
|
||||
|
|
|
|||
|
|
@ -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 ');
|
||||
|
|
|
|||
|
|
@ -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++;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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 .= " WHERE 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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue