Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
This commit is contained in:
commit
437539ecb9
@ -342,7 +342,7 @@ if ($sall) {
|
||||
$moreforfilter = '';
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
|
||||
if ($massactionbutton) {
|
||||
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
|
||||
}
|
||||
@ -353,7 +353,13 @@ print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwit
|
||||
|
||||
// Line for filters fields
|
||||
print '<tr class="liste_titre_filter">';
|
||||
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre right">';
|
||||
$searchpicto = $form->showFilterButtons('left');
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
// Line numbering
|
||||
if (!empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) {
|
||||
print '<td class="liste_titre"> </td>';
|
||||
@ -431,15 +437,19 @@ if (!empty($arrayfields['c.tms']['checked'])) {
|
||||
}
|
||||
|
||||
// Action column
|
||||
print '<td class="liste_titre right">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre right">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
}
|
||||
if (!empty($arrayfields['d.ref']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['d.ref']['label'], $_SERVER["PHP_SELF"], "c.rowid", $param, "", "", $sortfield, $sortorder);
|
||||
}
|
||||
@ -484,7 +494,9 @@ if (!empty($arrayfields['c.datec']['checked'])) {
|
||||
if (!empty($arrayfields['c.tms']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['c.tms']['label'], $_SERVER["PHP_SELF"], "c.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
|
||||
}
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -540,7 +552,21 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
} else {
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// 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->crowid, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$obj->crowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->crowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Ref
|
||||
if (!empty($arrayfields['d.ref']['checked'])) {
|
||||
print '<td>'.$subscription->getNomUrl(1).'</td>';
|
||||
@ -662,19 +688,20 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
}
|
||||
// Action 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->crowid, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
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->crowid, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$obj->crowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->crowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
print '<input id="cb'.$obj->crowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->crowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
$i++;
|
||||
|
||||
@ -289,6 +289,9 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
||||
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<th> </th>';
|
||||
}
|
||||
print '<th>'.$langs->trans("Ref").'</th>';
|
||||
print '<th>'.$langs->trans("Label").'</th>';
|
||||
print '<th class="center">'.$langs->trans("MembersNature").'</th>';
|
||||
@ -297,7 +300,9 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
||||
print '<th class="center">'.$langs->trans("CanEditAmountShort").'</th>';
|
||||
print '<th class="center">'.$langs->trans("VoteAllowed").'</th>';
|
||||
print '<th class="center">'.$langs->trans("Status").'</th>';
|
||||
print '<th> </th>';
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<th> </th>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
$membertype = new AdherentType($db);
|
||||
@ -333,6 +338,13 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
||||
}
|
||||
} else {
|
||||
print '<tr class="oddeven">';
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
if ($user->rights->adherent->configurer) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$objp->rowid.'">'.img_edit().'</a></td>';
|
||||
} else {
|
||||
print '<td class="right"> </td>';
|
||||
}
|
||||
}
|
||||
print '<td class="nowraponall">';
|
||||
print $membertype->getNomUrl(1);
|
||||
//<a href="'.$_SERVER["PHP_SELF"].'?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowType"),'group').' '.$objp->rowid.'</a>
|
||||
@ -352,10 +364,12 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
||||
print '<td class="center">'.yn($objp->caneditamount).'</td>';
|
||||
print '<td class="center">'.yn($objp->vote).'</td>';
|
||||
print '<td class="center">'.$membertype->getLibStatut(5).'</td>';
|
||||
if ($user->rights->adherent->configurer) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$objp->rowid.'">'.img_edit().'</a></td>';
|
||||
} else {
|
||||
print '<td class="right"> </td>';
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
if ($user->rights->adherent->configurer) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$objp->rowid.'">'.img_edit().'</a></td>';
|
||||
} else {
|
||||
print '<td class="right"> </td>';
|
||||
}
|
||||
}
|
||||
print "</tr>";
|
||||
}
|
||||
@ -708,13 +722,18 @@ if ($rowid > 0) {
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||
}
|
||||
print_liste_field_titre("NameSlashCompany", $_SERVER["PHP_SELF"], "d.lastname", $param, "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Login", $_SERVER["PHP_SELF"], "d.login", $param, "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("MemberNature", $_SERVER["PHP_SELF"], "d.morphy", $param, "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("EMail", $_SERVER["PHP_SELF"], "d.email", $param, "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "d.statut,d.datefin", $param, "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("EndSubscription", $_SERVER["PHP_SELF"], "d.datefin", $param, "", 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
$adh = new Adherent($db);
|
||||
@ -732,7 +751,17 @@ if ($rowid > 0) {
|
||||
$adh->statut = $objp->status;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Actions
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="center">';
|
||||
if ($user->hasRight('adherent', 'creer')) {
|
||||
print '<a class="editfielda marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=edit&token='.newToken().'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.img_edit().'</a>';
|
||||
}
|
||||
if ($user->hasRight('adherent', 'supprimer')) {
|
||||
print '<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=resiliate&token='.newToken().'">'.img_picto($langs->trans("Resiliate"), 'disable.png').'</a>';
|
||||
}
|
||||
print "</td>";
|
||||
}
|
||||
// Lastname
|
||||
if ($objp->company != '') {
|
||||
print '<td><a href="card.php?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowMember"), "user", 'class="paddingright"').$adh->getFullName($langs, 0, -1, 20).' / '.dol_trunc($objp->company, 12).'</a></td>'."\n";
|
||||
@ -785,15 +814,16 @@ if ($rowid > 0) {
|
||||
}
|
||||
|
||||
// Actions
|
||||
print '<td class="center">';
|
||||
if ($user->hasRight('adherent', 'creer')) {
|
||||
print '<a class="editfielda marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=edit&token='.newToken().'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.img_edit().'</a>';
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="center">';
|
||||
if ($user->hasRight('adherent', 'creer')) {
|
||||
print '<a class="editfielda marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=edit&token='.newToken().'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.img_edit().'</a>';
|
||||
}
|
||||
if ($user->hasRight('adherent', 'supprimer')) {
|
||||
print '<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=resiliate&token='.newToken().'">'.img_picto($langs->trans("Resiliate"), 'disable.png').'</a>';
|
||||
}
|
||||
print "</td>";
|
||||
}
|
||||
if ($user->hasRight('adherent', 'supprimer')) {
|
||||
print '<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=resiliate&token='.newToken().'">'.img_picto($langs->trans("Resiliate"), 'disable.png').'</a>';
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -396,7 +396,7 @@ if ($resql) {
|
||||
}
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
|
||||
$moreforfilter= '';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
@ -404,6 +404,13 @@ if ($resql) {
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
|
||||
print '<td class="liste_titre">';
|
||||
print '</td>';
|
||||
@ -507,16 +514,22 @@ if ($resql) {
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
print '</tr>';
|
||||
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch center ');
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
|
||||
print_liste_field_titre('#', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
@ -563,7 +576,9 @@ if ($resql) {
|
||||
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch center ');
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch center ');
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@ -602,6 +617,10 @@ if ($resql) {
|
||||
} else {
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td></td>';
|
||||
}
|
||||
|
||||
// No
|
||||
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
|
||||
print '<td>'.(($offset * $limit) + $i).'</td>';
|
||||
@ -751,8 +770,9 @@ if ($resql) {
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
print '<td></td>';
|
||||
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td></td>';
|
||||
}
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -447,7 +447,7 @@ if (!empty($moreforfilter)) {
|
||||
}
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
|
||||
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||
|
||||
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
@ -457,6 +457,13 @@ print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwit
|
||||
// Fields title search
|
||||
// --------------------------------------------------------------------
|
||||
print '<tr class="liste_titre">';
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons('left');
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
if ($key == 'status') {
|
||||
@ -495,16 +502,22 @@ $parameters = array('arrayfields'=>$arrayfields);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
|
||||
// Fields title label
|
||||
// --------------------------------------------------------------------
|
||||
print '<tr class="liste_titre">';
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
}
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
if ($key == 'status') {
|
||||
@ -527,7 +540,9 @@ $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
|
||||
@ -579,6 +594,20 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
// Show here line of result
|
||||
$j = 0;
|
||||
print '<tr data-rowid="'.$object->id.'" class="oddeven">';
|
||||
|
||||
// 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($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
||||
@ -636,15 +665,17 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action 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($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
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($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
print '</td>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -412,7 +412,7 @@ $moreforfilter = '';
|
||||
$massactionbutton = '';
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
|
||||
if ($massactionbutton) {
|
||||
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
|
||||
}
|
||||
@ -422,6 +422,13 @@ print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" :
|
||||
|
||||
print '<tr class="liste_titre_filter">';
|
||||
|
||||
// Filter: Buttons
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
print $form->showFilterAndCheckAddButtons(0);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Filters: Line number (placeholder)
|
||||
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
|
||||
print '<td class="liste_titre">';
|
||||
@ -522,13 +529,20 @@ $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // N
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
// Filter: Buttons
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
print $form->showFilterAndCheckAddButtons(0);
|
||||
print '</td>';
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
print $form->showFilterAndCheckAddButtons(0);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
|
||||
print_liste_field_titre('#', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
@ -571,7 +585,9 @@ $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
$i = 0;
|
||||
@ -611,6 +627,12 @@ while ($i < min($num, $limit)) {
|
||||
} else {
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td></td>';
|
||||
}
|
||||
|
||||
// Line number
|
||||
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
|
||||
print '<td>'.(($offset * $limit) + $i).'</td>';
|
||||
@ -750,8 +772,10 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
}
|
||||
|
||||
// Buttons
|
||||
print '<td></td>';
|
||||
// Action column
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td></td>';
|
||||
}
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -328,7 +328,7 @@ $newcardbutton .= dolGetButtonTitle($langs->trans('NewVATPayment'), '', 'fa fa-p
|
||||
print_barre_liste($langs->trans("VATDeclarations"), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER['PHP_SELF'] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
|
||||
if ($massactionbutton) {
|
||||
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
|
||||
}
|
||||
@ -338,6 +338,13 @@ print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" :
|
||||
|
||||
print '<tr class="liste_titre_filter">';
|
||||
|
||||
// Filter: Buttons
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
print $form->showFilterAndCheckAddButtons(0);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Filters: Lines (placeholder)
|
||||
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
|
||||
print '<td class="liste_titre">';
|
||||
@ -417,13 +424,17 @@ $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // N
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
// Filter: Buttons
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
print $form->showFilterAndCheckAddButtons(0);
|
||||
print '</td>';
|
||||
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
print $form->showFilterAndCheckAddButtons(0);
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre($selectedfields, $_SERVER['PHP_SELF'], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
}
|
||||
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
|
||||
print_liste_field_titre('#', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
@ -454,7 +465,9 @@ $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print_liste_field_titre($selectedfields, $_SERVER['PHP_SELF'], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre($selectedfields, $_SERVER['PHP_SELF'], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
$i = 0;
|
||||
@ -488,6 +501,11 @@ while ($i < min($num, $limit)) {
|
||||
} else {
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Buttons
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td></td>';
|
||||
}
|
||||
|
||||
// No
|
||||
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
|
||||
print '<td>'.(($offset * $limit) + $i).'</td>';
|
||||
@ -527,7 +545,10 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
|
||||
// Date payment
|
||||
/*if (!empty($arrayfields['t.datep']['checked'])) {
|
||||
/*if // Buttons
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td></td>';
|
||||
}(!empty($arrayfields['t.datep']['checked'])) {
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->datep), 'day').'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}*/
|
||||
@ -591,8 +612,9 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
|
||||
// Buttons
|
||||
print '<td></td>';
|
||||
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2020 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -65,6 +65,21 @@ abstract class CommonDocGenerator
|
||||
*/
|
||||
public $scandir;
|
||||
|
||||
/**
|
||||
* @var string model name
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* @var string model description (short text)
|
||||
*/
|
||||
public $description;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $format;
|
||||
|
||||
public $page_hauteur;
|
||||
public $page_largeur;
|
||||
public $marge_gauche;
|
||||
|
||||
@ -6288,7 +6288,6 @@ abstract class CommonObject
|
||||
$new_array_options[$key] = $object->id;
|
||||
} else {
|
||||
$this->error = "Id/Ref '".$value."' for object '".$object->element."' not found";
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1233,7 +1233,7 @@ class ExtraFields
|
||||
$InfoFieldList[4] = str_replace('$ID$', '0', $InfoFieldList[4]);
|
||||
}
|
||||
//We have to join on extrafield table
|
||||
if (strpos($InfoFieldList[4], 'extra') !== false) {
|
||||
if (strpos($InfoFieldList[4], 'extra.') !== false) {
|
||||
$sql .= ' as main, '.$this->db->prefix().$InfoFieldList[0].'_extrafields as extra';
|
||||
$sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]." AND ".$InfoFieldList[4];
|
||||
} else {
|
||||
@ -1690,7 +1690,7 @@ class ExtraFields
|
||||
|
||||
$sql = "SELECT ".$keyList;
|
||||
$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
|
||||
if (!empty($InfoFieldList[4]) && strpos($InfoFieldList[4], 'extra') !== false) {
|
||||
if (!empty($InfoFieldList[4]) && strpos($InfoFieldList[4], 'extra.') !== false) {
|
||||
$sql .= ' as main';
|
||||
}
|
||||
if ($selectkey == 'rowid' && empty($value)) {
|
||||
@ -1806,7 +1806,7 @@ class ExtraFields
|
||||
|
||||
$sql = "SELECT ".$keyList;
|
||||
$sql .= " FROM ".$this->db->prefix().$InfoFieldList[0];
|
||||
if (strpos($InfoFieldList[4], 'extra') !== false) {
|
||||
if (strpos($InfoFieldList[4], 'extra.') !== false) {
|
||||
$sql .= ' as main';
|
||||
}
|
||||
// $sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'";
|
||||
|
||||
@ -8948,108 +8948,116 @@ function verifCond($strToEvaluate)
|
||||
*/
|
||||
function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1')
|
||||
{
|
||||
// Only global variables can be changed by eval function and returned to caller
|
||||
global $db, $langs, $user, $conf, $website, $websitepage;
|
||||
global $action, $mainmenu, $leftmenu;
|
||||
global $rights;
|
||||
global $object;
|
||||
global $mysoc;
|
||||
try {
|
||||
// Only global variables can be changed by eval function and returned to caller
|
||||
global $db, $langs, $user, $conf, $website, $websitepage;
|
||||
global $action, $mainmenu, $leftmenu;
|
||||
global $rights;
|
||||
global $object;
|
||||
global $mysoc;
|
||||
|
||||
global $obj; // To get $obj used into list when dol_eval is used for computed fields and $obj is not yet $object
|
||||
global $soc; // For backward compatibility
|
||||
global $obj; // To get $obj used into list when dol_eval is used for computed fields and $obj is not yet $object
|
||||
global $soc; // For backward compatibility
|
||||
|
||||
// Test on dangerous char (used for RCE), we allow only characters to make PHP variable testing
|
||||
if ($onlysimplestring == '1') {
|
||||
// We must accept: '1 && getDolGlobalInt("doesnotexist1") && $conf->global->MAIN_FEATURES_LEVEL'
|
||||
// We must accept: '$conf->barcode->enabled || preg_match(\'/^AAA/\',$leftmenu)'
|
||||
// We must accept: '$user->rights->cabinetmed->read && !$object->canvas=="patient@cabinetmed"'
|
||||
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/@', '/').']/i', $s)) {
|
||||
if ($returnvalue) {
|
||||
return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s;
|
||||
} else {
|
||||
dol_syslog('Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s);
|
||||
return '';
|
||||
// Test on dangerous char (used for RCE), we allow only characters to make PHP variable testing
|
||||
if ($onlysimplestring == '1') {
|
||||
// We must accept: '1 && getDolGlobalInt("doesnotexist1") && $conf->global->MAIN_FEATURES_LEVEL'
|
||||
// We must accept: '$conf->barcode->enabled || preg_match(\'/^AAA/\',$leftmenu)'
|
||||
// We must accept: '$user->rights->cabinetmed->read && !$object->canvas=="patient@cabinetmed"'
|
||||
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/@', '/').']/i', $s)) {
|
||||
if ($returnvalue) {
|
||||
return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s;
|
||||
} else {
|
||||
dol_syslog('Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s);
|
||||
return '';
|
||||
}
|
||||
// TODO
|
||||
// We can exclude all parenthesis ( that are not '($db' and 'getDolGlobalInt(' and 'getDolGlobalString(' and 'preg_match(' and 'isModEnabled('
|
||||
// ...
|
||||
}
|
||||
} elseif ($onlysimplestring == '2') {
|
||||
// We must accept: (($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : "Parent project not found"
|
||||
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/@;[]', '/').']/i', $s)) {
|
||||
if ($returnvalue) {
|
||||
return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s;
|
||||
} else {
|
||||
dol_syslog('Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
// TODO
|
||||
// We can exclude all parenthesis ( that are not '($db' and 'getDolGlobalInt(' and 'getDolGlobalString(' and 'preg_match(' and 'isModEnabled('
|
||||
// ...
|
||||
}
|
||||
} elseif ($onlysimplestring == '2') {
|
||||
// We must accept: (($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : "Parent project not found"
|
||||
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/@;[]', '/').']/i', $s)) {
|
||||
if (strpos($s, '::') !== false) {
|
||||
if ($returnvalue) {
|
||||
return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s;
|
||||
return 'Bad string syntax to evaluate (double : char is forbidden): '.$s;
|
||||
} else {
|
||||
dol_syslog('Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s);
|
||||
dol_syslog('Bad string syntax to evaluate (double : char is forbidden): '.$s);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
if (strpos($s, '::') !== false) {
|
||||
if (strpos($s, '`') !== false) {
|
||||
if ($returnvalue) {
|
||||
return 'Bad string syntax to evaluate (backtick char is forbidden): '.$s;
|
||||
} else {
|
||||
dol_syslog('Bad string syntax to evaluate (backtick char is forbidden): '.$s);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
if (preg_match('/[^0-9]+\.[^0-9]+/', $s)) { // We refuse . if not between 2 numbers
|
||||
if ($returnvalue) {
|
||||
return 'Bad string syntax to evaluate (dot char is forbidden): '.$s;
|
||||
} else {
|
||||
dol_syslog('Bad string syntax to evaluate (dot char is forbidden): '.$s);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
// We block use of php exec or php file functions
|
||||
$forbiddenphpstrings = array('$$');
|
||||
$forbiddenphpstrings = array_merge($forbiddenphpstrings, array('_ENV', '_SESSION', '_COOKIE', '_GET', '_POST', '_REQUEST'));
|
||||
|
||||
$forbiddenphpfunctions = array("exec", "passthru", "shell_exec", "system", "proc_open", "popen", "eval", "dol_eval", "executeCLI", "verifCond", "base64_decode");
|
||||
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "require", "include", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask"));
|
||||
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("function", "call_user_func"));
|
||||
|
||||
$forbiddenphpregex = 'global\s+\$|\b('.implode('|', $forbiddenphpfunctions).')\b';
|
||||
|
||||
do {
|
||||
$oldstringtoclean = $s;
|
||||
$s = str_ireplace($forbiddenphpstrings, '__forbiddenstring__', $s);
|
||||
$s = preg_replace('/'.$forbiddenphpregex.'/i', '__forbiddenstring__', $s);
|
||||
//$s = preg_replace('/\$[a-zA-Z0-9_\->\$]+\(/i', '', $s); // Remove $function( call and $mycall->mymethod(
|
||||
} while ($oldstringtoclean != $s);
|
||||
|
||||
if (strpos($s, '__forbiddenstring__') !== false) {
|
||||
dol_syslog('Bad string syntax to evaluate: '.$s, LOG_WARNING);
|
||||
if ($returnvalue) {
|
||||
return 'Bad string syntax to evaluate: '.$s;
|
||||
} else {
|
||||
dol_syslog('Bad string syntax to evaluate: '.$s);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
//print $s."<br>\n";
|
||||
if ($returnvalue) {
|
||||
return 'Bad string syntax to evaluate (double : char is forbidden): '.$s;
|
||||
if ($hideerrors) {
|
||||
return @eval('return '.$s.';');
|
||||
} else {
|
||||
return eval('return '.$s.';');
|
||||
}
|
||||
} else {
|
||||
dol_syslog('Bad string syntax to evaluate (double : char is forbidden): '.$s);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
if (strpos($s, '`') !== false) {
|
||||
if ($returnvalue) {
|
||||
return 'Bad string syntax to evaluate (backtick char is forbidden): '.$s;
|
||||
} else {
|
||||
dol_syslog('Bad string syntax to evaluate (backtick char is forbidden): '.$s);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
if (preg_match('/[^0-9]+\.[^0-9]+/', $s)) { // We refuse . if not between 2 numbers
|
||||
if ($returnvalue) {
|
||||
return 'Bad string syntax to evaluate (dot char is forbidden): '.$s;
|
||||
} else {
|
||||
dol_syslog('Bad string syntax to evaluate (dot char is forbidden): '.$s);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
// We block use of php exec or php file functions
|
||||
$forbiddenphpstrings = array('$$');
|
||||
$forbiddenphpstrings = array_merge($forbiddenphpstrings, array('_ENV', '_SESSION', '_COOKIE', '_GET', '_POST', '_REQUEST'));
|
||||
|
||||
$forbiddenphpfunctions = array("exec", "passthru", "shell_exec", "system", "proc_open", "popen", "eval", "dol_eval", "executeCLI", "verifCond", "base64_decode");
|
||||
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "require", "include", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask"));
|
||||
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("function", "call_user_func"));
|
||||
|
||||
$forbiddenphpregex = 'global\s+\$|\b('.implode('|', $forbiddenphpfunctions).')\b';
|
||||
|
||||
do {
|
||||
$oldstringtoclean = $s;
|
||||
$s = str_ireplace($forbiddenphpstrings, '__forbiddenstring__', $s);
|
||||
$s = preg_replace('/'.$forbiddenphpregex.'/i', '__forbiddenstring__', $s);
|
||||
//$s = preg_replace('/\$[a-zA-Z0-9_\->\$]+\(/i', '', $s); // Remove $function( call and $mycall->mymethod(
|
||||
} while ($oldstringtoclean != $s);
|
||||
|
||||
if (strpos($s, '__forbiddenstring__') !== false) {
|
||||
dol_syslog('Bad string syntax to evaluate: '.$s, LOG_WARNING);
|
||||
if ($returnvalue) {
|
||||
return 'Bad string syntax to evaluate: '.$s;
|
||||
} else {
|
||||
dol_syslog('Bad string syntax to evaluate: '.$s);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
//print $s."<br>\n";
|
||||
if ($returnvalue) {
|
||||
if ($hideerrors) {
|
||||
return @eval('return '.$s.';');
|
||||
} else {
|
||||
return eval('return '.$s.';');
|
||||
}
|
||||
} else {
|
||||
if ($hideerrors) {
|
||||
@eval($s);
|
||||
} else {
|
||||
eval($s);
|
||||
if ($hideerrors) {
|
||||
@eval($s);
|
||||
} else {
|
||||
eval($s);
|
||||
}
|
||||
}
|
||||
} catch (Error $e) {
|
||||
$error = 'Caught error : ';
|
||||
$error .= $e->getMessage() . ', ';
|
||||
$error .= 'Trace : ';
|
||||
$error .= json_encode($e->getTrace());
|
||||
error_log($error, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -204,7 +204,7 @@ class modCommande extends DolibarrModules
|
||||
'co.code'=>"CountryCode", 's.phone'=>'Phone', 's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 'c.rowid'=>"Id",
|
||||
'c.ref'=>"Ref", 'c.ref_client'=>"RefCustomer", 'c.fk_soc'=>"IdCompany", 'c.date_creation'=>"DateCreation", 'c.date_commande'=>"OrderDate",
|
||||
'c.date_livraison'=>"DateDeliveryPlanned", 'c.amount_ht'=>"Amount", 'c.total_ht'=>"TotalHT",
|
||||
'c.total_ttc'=>"TotalTTC", 'c.facture'=>"Billed", 'c.fk_statut'=>'Status', 'c.note_public'=>"Note",
|
||||
'c.total_ttc'=>"TotalTTC", 'c.facture'=>"Billed", 'c.fk_statut'=>'Status', 'c.note_public'=>"Note", 'sm.code'=>'SendingMethod',
|
||||
'c.fk_user_author'=>'CreatedById', 'uc.login'=>'CreatedByLogin', 'c.fk_user_valid'=>'ValidatedById', 'uv.login'=>'ValidatedByLogin',
|
||||
'pj.ref'=>'ProjectRef', 'cd.rowid'=>'LineId', 'cd.description'=>"LineDescription", 'cd.product_type'=>'TypeOfLineServiceOrProduct',
|
||||
'cd.tva_tx'=>"LineVATRate", 'cd.qty'=>"LineQty", 'cd.total_ht'=>"LineTotalHT", 'cd.total_tva'=>"LineTotalVAT", 'cd.total_ttc'=>"LineTotalTTC",
|
||||
@ -235,7 +235,7 @@ class modCommande extends DolibarrModules
|
||||
$this->export_TypeFields_array[$r] = array(
|
||||
's.nom'=>'Text', 'ps.nom'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'co.label'=>'List:c_country:label:label', 'co.code'=>'Text', 's.phone'=>'Text',
|
||||
's.siren'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 'c.ref'=>"Text", 'c.ref_client'=>"Text", 'c.date_creation'=>"Date",
|
||||
'c.date_commande'=>"Date", 'c.date_livraison'=>"Date", 'c.amount_ht'=>"Numeric", 'c.total_ht'=>"Numeric",
|
||||
'c.date_commande'=>"Date", 'c.date_livraison'=>"Date", 'sm.code'=>"Text", 'c.amount_ht'=>"Numeric", 'c.total_ht'=>"Numeric",
|
||||
'c.total_ttc'=>"Numeric", 'c.facture'=>"Boolean", 'c.fk_statut'=>'Status', 'c.note_public'=>"Text", 'pj.ref'=>'Text',
|
||||
'cd.description'=>"Text", 'cd.product_type'=>'Boolean', 'cd.tva_tx'=>"Numeric", 'cd.qty'=>"Numeric", 'cd.total_ht'=>"Numeric", 'cd.total_tva'=>"Numeric",
|
||||
'cd.total_ttc'=>"Numeric", 'p.rowid'=>'List:product:ref::product', 'p.ref'=>'Text', 'p.label'=>'Text', 'd.nom'=>'Text',
|
||||
@ -246,7 +246,7 @@ class modCommande extends DolibarrModules
|
||||
'co.code'=>'company', 's.phone'=>'company', 's.siren'=>'company', 's.ape'=>'company', 's.idprof4'=>'company', 's.siret'=>'company', 'c.rowid'=>"order",
|
||||
'c.ref'=>"order", 'c.ref_client'=>"order", 'c.fk_soc'=>"order", 'c.date_creation'=>"order", 'c.date_commande'=>"order", 'c.amount_ht'=>"order",
|
||||
'c.total_ht'=>"order", 'c.total_ttc'=>"order", 'c.facture'=>"order", 'c.fk_statut'=>"order", 'c.note'=>"order",
|
||||
'c.date_livraison'=>"order", 'pj.ref'=>'project', 'cd.rowid'=>'order_line', 'cd.description'=>"order_line",
|
||||
'c.date_livraison'=>"order", 'sm.code'=>"order", 'pj.ref'=>'project', 'cd.rowid'=>'order_line', 'cd.description'=>"order_line",
|
||||
'cd.product_type'=>'order_line', 'cd.tva_tx'=>"order_line", 'cd.qty'=>"order_line", 'cd.total_ht'=>"order_line", 'cd.total_tva'=>"order_line",
|
||||
'cd.total_ttc'=>"order_line", 'p.rowid'=>'product', 'p.ref'=>'product', 'p.label'=>'product'
|
||||
);
|
||||
@ -277,6 +277,7 @@ class modCommande extends DolibarrModules
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON s.fk_pays = co.rowid,';
|
||||
$this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'commande as c';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_shipment_mode as sm ON c.fk_shipping_method = sm.rowid';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pj ON c.fk_projet = pj.rowid';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as uc ON c.fk_user_author = uc.rowid';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as uv ON c.fk_user_valid = uv.rowid';
|
||||
|
||||
@ -70,7 +70,7 @@ if (!empty($inputalsopricewithtax)) {
|
||||
if (in_array($object->element, array('propal', 'supplier_proposal', 'facture', 'facturerec', 'invoice', 'commande', 'order', 'order_supplier', 'invoice_supplier', 'invoice_supplier_rec'))) {
|
||||
$colspan++; // With this, there is a column move button
|
||||
}
|
||||
if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) {
|
||||
if (isModEnabled("multicurrency") && $object->multicurrency_code != $conf->currency) {
|
||||
$colspan += 2;
|
||||
}
|
||||
if (isModEnabled('asset') && $object->element == 'invoice_supplier') {
|
||||
@ -218,7 +218,7 @@ $coldisplay++;
|
||||
}
|
||||
print '></td>';
|
||||
|
||||
if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) {
|
||||
if (isModEnabled("multicurrency") && $object->multicurrency_code != $conf->currency) {
|
||||
$coldisplay++;
|
||||
print '<td class="right"><input rel="'.$object->multicurrency_tx.'" type="text" class="flat right" size="5" id="multicurrency_subprice" name="multicurrency_subprice" value="'.(GETPOSTISSET('multicurrency_subprice') ? GETPOST('multicurrency_subprice', 'alpha') : price($line->multicurrency_subprice)).'" /></td>';
|
||||
}
|
||||
@ -286,7 +286,7 @@ $coldisplay++;
|
||||
|
||||
<?php
|
||||
// Progession for situation invoices
|
||||
if ($this->situation_cycle_ref) {
|
||||
if ($object->situation_cycle_ref) {
|
||||
$coldisplay++;
|
||||
print '<td class="nowrap right linecolcycleref"><input class="right" type="text" size="1" value="'.(GETPOSTISSET('progress') ? GETPOST('progress') : $line->situation_percent).'" name="progress">%</td>';
|
||||
$coldisplay++;
|
||||
@ -490,7 +490,7 @@ jQuery(document).ready(function()
|
||||
}
|
||||
});
|
||||
|
||||
<?php if (in_array($this->table_element_line, array('propaldet', 'commandedet', 'facturedet'))) { ?>
|
||||
<?php if (in_array($object->table_element_line, array('propaldet', 'commandedet', 'facturedet'))) { ?>
|
||||
$("#date_start, #date_end").focusout(function() {
|
||||
if ( $(this).val() == '' && !$(this).hasClass('inputmandatory') ) {
|
||||
$(this).addClass('inputmandatory');
|
||||
|
||||
@ -219,6 +219,12 @@ if ($resql) {
|
||||
|
||||
// Filters lines
|
||||
print '<tr class="liste_titre_filter">';
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" size="10" type="text" name="search_ref" value="'.$search_ref.'">';
|
||||
print '</td>';
|
||||
@ -252,13 +258,18 @@ if ($resql) {
|
||||
);
|
||||
print $form->selectarray('search_status', $liststatus, $search_status, -4, 0, 0, '', 0, 0, 0, '', 'search_status maxwidth100 onrightofpage');
|
||||
print '</td>';
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre('');
|
||||
}
|
||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "d.rowid", "", $param, "", $sortfield, $sortorder);
|
||||
if (!empty($conf->global->DONATION_USE_THIRDPARTIES)) {
|
||||
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "d.fk_soc", "", $param, "", $sortfield, $sortorder);
|
||||
@ -273,7 +284,9 @@ if ($resql) {
|
||||
}
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "d.amount", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "d.fk_statut", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre('');
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre('');
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
while ($i < min($num, $limit)) {
|
||||
@ -307,6 +320,9 @@ if ($resql) {
|
||||
}
|
||||
} else {
|
||||
print '<tr class="oddeven">';
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td></td>';
|
||||
}
|
||||
$donationstatic->id = $objp->rowid;
|
||||
$donationstatic->ref = $objp->rowid;
|
||||
$donationstatic->lastname = $objp->lastname;
|
||||
@ -339,7 +355,9 @@ if ($resql) {
|
||||
}
|
||||
print '<td class="right"><span class="amount">'.price($objp->amount).'</span></td>';
|
||||
print '<td class="right">'.$donationstatic->LibStatut($objp->status, 5).'</td>';
|
||||
print '<td></td>';
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td></td>';
|
||||
}
|
||||
print "</tr>";
|
||||
}
|
||||
$i++;
|
||||
|
||||
@ -304,6 +304,7 @@ ErrorValueCantBeNull=Value for <b>%s</b> can't be null
|
||||
ErrorDateOfMovementLowerThanDateOfFileTransmission=The date of the bank transaction can't be lower than the date of the file transmission
|
||||
ErrorTooMuchFileInForm=Too much files in form, the maximum number is %s file(s)
|
||||
ErrorSessionInvalidatedAfterPasswordChange=The session was been invalidated following a change of password, status or dates of validity. Please relogin.
|
||||
ErrorExistingPermission = Permission <b>%s</b> for object <b>%s</b> already exists
|
||||
|
||||
# Warnings
|
||||
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.
|
||||
@ -342,6 +343,7 @@ WarningPaypalPaymentNotCompatibleWithStrict=The value 'Strict' makes the online
|
||||
WarningThemeForcedTo=Warning, theme has been forced to <b>%s</b> by hidden constant MAIN_FORCETHEME
|
||||
WarningPagesWillBeDeleted=Warning, this will also delete all existing pages/containers of the website. You should export your website before, so you have a backup to re-import it later.
|
||||
WarningAutoValNotPossibleWhenStockIsDecreasedOnInvoiceVal=Automatic validation is disabled when option to decrease stock is set on "Invoice validation".
|
||||
WarningModuleNeedRefrech = Module <b>%s</b> has been disabled. Don't forget to enable it
|
||||
|
||||
# Validate
|
||||
RequireValidValue = Value not valid
|
||||
|
||||
@ -165,3 +165,8 @@ BadValueForType=Bad value for type %s
|
||||
DefinePropertiesFromExistingTable=Define properties from an existing table
|
||||
DefinePropertiesFromExistingTableDesc=If a table in the database (for the object to create) already exists, you can use it to define the properties of the object.
|
||||
DefinePropertiesFromExistingTableDesc2=Keep empty if the table does not exist yet. The code generator will use different kinds of fields to build an example of table that you can edit later.
|
||||
GeneratePermissions=I want to add the rights for this object
|
||||
GeneratePermissionsHelp=generate default rights for this object
|
||||
PermissionDeletedSuccesfuly=Permission has been successfully removed
|
||||
PermissionUpdatedSuccesfuly=Permission has been successfully updated
|
||||
PermissionAddedSuccesfuly=Permission has been successfully added
|
||||
@ -303,8 +303,10 @@ ErrorValueForTooLow=La valeur pour <b>%s</b> est trop faible
|
||||
ErrorValueCantBeNull=La valeur pour <b>%s</b> ne peut pas être nulle
|
||||
ErrorDateOfMovementLowerThanDateOfFileTransmission=La date de l'opération bancaire ne peut être inférieure à la date de transmission du fichier
|
||||
ErrorTooMuchFileInForm=Trop de fichiers dans le formulaire, le nombre maximum est de %s fichier(s)
|
||||
ErrorExistingPermission = La permission <b>%s</b> pour l'objet <b>%s</b> est dejà existante
|
||||
ErrorSessionInvalidatedAfterPasswordChange=La session a été invalidée suite à un changement de mot de passe, d'état ou de dates de validité. Veuillez vous reconnecter.
|
||||
|
||||
|
||||
# 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 défini pour cet adhérent. Cependant, aucun compte d'utilisateur n'a été créé. Ce mot de passe a donc été 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.
|
||||
@ -342,6 +344,7 @@ WarningPaypalPaymentNotCompatibleWithStrict=La valeur 'Strict' fait que les fonc
|
||||
WarningThemeForcedTo=Attention, le choix du thème a été forcé à <b> %s </b> par la constante cachée MAIN_FORCETHEME
|
||||
WarningPagesWillBeDeleted=Attention, cela supprimera également toutes les pages/conteneurs existants du site. Vous devriez exporter votre site Web avant, afin d'avoir une sauvegarde pour le réimporter plus tard.
|
||||
WarningAutoValNotPossibleWhenStockIsDecreasedOnInvoiceVal=La validation automatique est désactivée lorsque l'option de diminution du stock est définie sur "Validation de la facture".
|
||||
WarningModuleNeedRefrech = Module <b>%s</b> desactivé. N'oublier pas de le réactivé
|
||||
|
||||
# Validate
|
||||
RequireValidValue = Valeur non valide
|
||||
|
||||
@ -165,3 +165,8 @@ BadValueForType=Mauvaise valeur pour le type %s
|
||||
DefinePropertiesFromExistingTable=Définir des propriétés à partir d'une table existante
|
||||
DefinePropertiesFromExistingTableDesc=Si une table dans la base de données (pour l'objet à créer) existe déjà, vous pouvez l'utiliser pour définir les propriétés de l'objet.
|
||||
DefinePropertiesFromExistingTableDesc2=Laisser vide si la table n'existe pas encore. Le générateur de code utilisera différents types de champs pour créer un exemple de table que vous pourrez modifier ultérieurement.
|
||||
GeneratePermissions=Je souhaite ajouter les droits pour cet objet
|
||||
GeneratePermissionsHelp=générer les droits par défault pour cet objet
|
||||
PermissionDeletedSuccesfuly=La permission a été supprimée avec succès
|
||||
PermissionUpdatedSuccesfuly=La permission a été mise à jour avec succès
|
||||
PermissionAddedSuccesfuly= La permission a été ajoutée avec succès
|
||||
@ -227,27 +227,41 @@ if ($resql) {
|
||||
|
||||
// Filters lines
|
||||
print '<tr class="liste_titre_filter">';
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterAndCheckAddButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
print '<td class="liste_titre"><input class="flat" size="4" type="text" name="search_ref" value="'.$search_ref.'"></td>';
|
||||
print '<td class="liste_titre"><input class="flat" size="12" type="text" name="search_label" value="'.$search_label.'"></td>';
|
||||
print '<td class="liste_titre right" ><input class="flat" size="8" type="text" name="search_amount" value="'.$search_amount.'"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterAndCheckAddButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
// Fields title label
|
||||
// --------------------------------------------------------------------
|
||||
print '<tr class="liste_titre">';
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
}
|
||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "l.rowid", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "l.label", "", $param, '', $sortfield, $sortorder, 'left ');
|
||||
print_liste_field_titre("LoanCapital", $_SERVER["PHP_SELF"], "l.capital", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "l.datestart", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "l.dateend", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "l.paid", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
print "</tr>\n";
|
||||
@ -287,6 +301,11 @@ if ($resql) {
|
||||
} else {
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td></td>';
|
||||
}
|
||||
|
||||
// Ref
|
||||
print '<td>'.$loan_static->getNomUrl(1).'</td>';
|
||||
|
||||
@ -306,7 +325,10 @@ if ($resql) {
|
||||
print $loan_static->LibStatut($obj->paid, 5, $obj->alreadypaid);
|
||||
print '</td>';
|
||||
|
||||
print '<td></td>';
|
||||
// Action column
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td></td>';
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
@ -1218,6 +1218,42 @@ if ($dirins && $action == 'initobject' && $module && $objectname) {
|
||||
'core/modules/mymodule/doc/pdf_standard_myobject.modules.php'=>'core/modules/'.strtolower($module).'/doc/pdf_standard_'.strtolower($objectname).'.modules.php'
|
||||
);
|
||||
}
|
||||
if (GETPOST('generatepermissions', 'aZ09')) {
|
||||
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
|
||||
dol_include_once($pathtofile);
|
||||
$class = 'mod'.$module;
|
||||
if (class_exists($class)) {
|
||||
try {
|
||||
$moduleobj = new $class($db);
|
||||
} catch (Exception $e) {
|
||||
$error++;
|
||||
dol_print_error($db, $e->getMessage());
|
||||
}
|
||||
}
|
||||
if (empty($firstobjectname)) {
|
||||
$rightToadd = preg_replace('/myobject/', $objectname, $rightToadd);
|
||||
}
|
||||
if ($objectname != $firstobjectname) {
|
||||
$rightToadd = "
|
||||
\$this->rights[\$r][0] = \$this->numero . sprintf('%02d', \$r + 1);
|
||||
\$this->rights[\$r][1] = 'Read objects of ".$module."';
|
||||
\$this->rights[\$r][4] = '".strtolower($objectname)."';
|
||||
\$this->rights[\$r][5] = 'read';
|
||||
\$r++;
|
||||
\$this->rights[\$r][0] = \$this->numero . sprintf('%02d', \$r + 1);
|
||||
\$this->rights[\$r][1] = 'Create/Update objects of ".$module."';
|
||||
\$this->rights[\$r][4] = '".strtolower($objectname)."';
|
||||
\$this->rights[\$r][5] = 'write';
|
||||
\$r++;
|
||||
\$this->rights[\$r][0] = \$this->numero . sprintf('%02d', \$r + 1);
|
||||
\$this->rights[\$r][1] = 'Delete objects of ".$module."';
|
||||
\$this->rights[\$r][4] = '".strtolower($objectname)."';
|
||||
\$this->rights[\$r][5] = 'delete';
|
||||
\$r++;
|
||||
";
|
||||
dolReplaceInFile($moduledescriptorfile, array('/* END MODULEBUILDER PERMISSIONS */' => '/*'.strtoupper($objectname).'*/'.$rightToadd."/*END ".strtoupper($objectname).'*/'."\n\t\t".'/* END MODULEBUILDER PERMISSIONS */'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!$error) {
|
||||
@ -1778,6 +1814,36 @@ if ($dirins && $action == 'confirm_deleteobject' && $objectname) {
|
||||
dolReplaceInFile($moduledescriptorfile, array('/*'.strtoupper($objectname).'*/' => ''));
|
||||
}
|
||||
|
||||
// regenerate permissions and delete them
|
||||
$rights = "
|
||||
\$this->rights[\$r][0] = \$this->numero . sprintf('%02d', \$r + 1);
|
||||
\$this->rights[\$r][1] = 'Read objects of ".$module."';
|
||||
\$this->rights[\$r][4] = '".strtolower($objectname)."';
|
||||
\$this->rights[\$r][5] = 'read';
|
||||
\$r++;
|
||||
\$this->rights[\$r][0] = \$this->numero . sprintf('%02d', \$r + 1);
|
||||
\$this->rights[\$r][1] = 'Create/Update objects of ".$module."';
|
||||
\$this->rights[\$r][4] = '".strtolower($objectname)."';
|
||||
\$this->rights[\$r][5] = 'write';
|
||||
\$r++;
|
||||
\$this->rights[\$r][0] = \$this->numero . sprintf('%02d', \$r + 1);
|
||||
\$this->rights[\$r][1] = 'Delete objects of ".$module."';
|
||||
\$this->rights[\$r][4] = '".strtolower($objectname)."';
|
||||
\$this->rights[\$r][5] = 'delete';
|
||||
\$r++;
|
||||
";
|
||||
|
||||
$deleteright = dolReplaceInFile($moduledescriptorfile, array('/*'.strtoupper($objectname).'*/' => '', $rights => '', "/*END ".strtoupper($objectname).'*/'."\n\t\t" => ''."\n\t\t"));
|
||||
if ($deleteright > 0) {
|
||||
if (isModEnabled(strtolower($module))) {
|
||||
$result = unActivateModule(strtolower($module));
|
||||
if ($result) {
|
||||
setEventMessages($result, null, 'errors');
|
||||
}
|
||||
setEventMessages($langs->trans("WarningModuleNeedRefrech", $langs->transnoentities($module)), null, 'warnings');
|
||||
header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?index.php?tab=description&module='.$module);
|
||||
}
|
||||
}
|
||||
$resultko = 0;
|
||||
foreach ($filetodelete as $tmpfiletodelete) {
|
||||
$resulttmp = dol_delete_file($dir.'/'.$tmpfiletodelete, 0, 0, 1);
|
||||
@ -1875,7 +1941,223 @@ if ($dirins && $action == 'generatepackage') {
|
||||
}
|
||||
}
|
||||
|
||||
// Add permission
|
||||
if ($dirins && $action == 'addright' && !empty($module) && empty($cancel)) {
|
||||
$error = 0;
|
||||
|
||||
// load class and check if right exist
|
||||
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
|
||||
dol_include_once($pathtofile);
|
||||
$class = 'mod'.$module;
|
||||
if (class_exists($class)) {
|
||||
try {
|
||||
$moduleobj = new $class($db);
|
||||
} catch (Exception $e) {
|
||||
$error++;
|
||||
dol_print_error($db, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// verify informations entred
|
||||
if (!GETPOST('label', 'alpha')) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
|
||||
}
|
||||
if (!GETPOST('permissionObj', 'alpha')) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Rights")), null, 'errors');
|
||||
}
|
||||
|
||||
$label = GETPOST('label', 'alpha');
|
||||
$objectForPerms = strtolower(GETPOST('permissionObj', 'alpha'));
|
||||
$crud = GETPOST('crud', 'alpha');
|
||||
|
||||
// check coherence between crud and label
|
||||
if ($label == "Read objects of $module" && $crud != "read") {
|
||||
$crud = "read";
|
||||
$label == "Read objects of $module";
|
||||
}
|
||||
if ($label == "Create/Update objects of $module" && $crud != "write") {
|
||||
$crud = "write";
|
||||
$label == "Create/Update objects of $module";
|
||||
}
|
||||
if ($label == "Delete objects of $module" && $crud != "delete") {
|
||||
$crud = "delete";
|
||||
$label == "Delete objects of $module";
|
||||
}
|
||||
|
||||
//check existing object permission
|
||||
$counter = 0;
|
||||
$permsForObject =array();
|
||||
$permissions = $moduleobj->rights;
|
||||
$firstRight = 0;
|
||||
$existRight = 0;
|
||||
$allObject = array();
|
||||
|
||||
$nbOfPermissions = count($permissions);
|
||||
for ($i =0; $i<$nbOfPermissions; $i++) {
|
||||
if ($permissions[$i][4] == $objectForPerms) {
|
||||
$counter++;
|
||||
if (count($permsForObject) < 3) {
|
||||
$permsForObject[] = $permissions[$i];
|
||||
}
|
||||
}
|
||||
$allObject[] = $permissions[$i][4];
|
||||
}
|
||||
$nbOfpermsInObj = count($permsForObject);
|
||||
// check if label of object already exists
|
||||
for ($j = 0; $j<$nbOfpermsInObj; $j++) {
|
||||
if (in_array($label, $permsForObject[$j])) {
|
||||
$existRight++;
|
||||
setEventMessages($langs->trans("ErrorExistingPermission", $langs->transnoentities($label), $langs->transnoentities($objectForPerms)), null, 'errors');
|
||||
}
|
||||
}
|
||||
// if not found permission for the object
|
||||
if (!in_array($objectForPerms, array_unique($allObject))) {
|
||||
$firstRight++;
|
||||
$existRight = 0;
|
||||
}
|
||||
if (!$error) {
|
||||
if (isModEnabled(strtolower($module))) {
|
||||
$result = unActivateModule(strtolower($module));
|
||||
dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity);
|
||||
if ($result) {
|
||||
setEventMessages($result, null, 'errors');
|
||||
}
|
||||
header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module);
|
||||
setEventMessages($langs->trans('WarningModuleNeedRefrech', $langs->transnoentities($module)), null, 'warnings');
|
||||
}
|
||||
//prepare stirng to add
|
||||
$rightToAdd = "
|
||||
\$this->rights[\$r][0] = \$this->numero . sprintf('%02d', \$r + 1);
|
||||
\$this->rights[\$r][1] = '$label';
|
||||
\$this->rights[\$r][4] = '$objectForPerms';
|
||||
\$this->rights[\$r][5] = '$crud';
|
||||
\$r++;
|
||||
";
|
||||
$moduledescriptorfile = $dirins.'/'.strtolower($module).'/core/modules/mod'.$module.'.class.php';
|
||||
if (!$existRight) {
|
||||
dolReplaceInFile($moduledescriptorfile, array('/*END '.strtoupper($objectForPerms).'*/' => $rightToAdd.'/*END '.strtoupper($objectForPerms).'*/'));
|
||||
setEventMessages($langs->trans('PermissionAddedSuccesfuly'), null);
|
||||
}
|
||||
if ($firstRight) {
|
||||
dolReplaceInFile($moduledescriptorfile, array('/* END MODULEBUILDER PERMISSIONS */' => '/*'.strtoupper($objectForPerms).'*/'.$rightToAdd."/*END ".strtoupper($objectForPerms).'*/'."\n\t\t".'/* END MODULEBUILDER PERMISSIONS */'));
|
||||
setEventMessages($langs->trans('PermissionAddedSuccesfuly'), null);
|
||||
}
|
||||
}
|
||||
header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
// Update permission
|
||||
if ($dirins && GETPOST('action') == 'update_right' && GETPOST('modifyright')&& empty($cancel)) {
|
||||
$error = 0;
|
||||
// load class and check if right exist
|
||||
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
|
||||
dol_include_once($pathtofile);
|
||||
$class = 'mod'.$module;
|
||||
if (class_exists($class)) {
|
||||
try {
|
||||
$moduleobj = new $class($db);
|
||||
} catch (Exception $e) {
|
||||
$error++;
|
||||
dol_print_error($db, $e->getMessage());
|
||||
}
|
||||
}
|
||||
// verify informations entred
|
||||
if (!GETPOST('label', 'alpha')) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
|
||||
}
|
||||
if (!GETPOST('permissionObj', 'alpha')) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Rights")), null, 'errors');
|
||||
}
|
||||
|
||||
$label = GETPOST('label', 'alpha');
|
||||
$objectForPerms = strtolower(GETPOST('permissionObj', 'alpha'));
|
||||
$crud = GETPOST('crud', 'alpha');
|
||||
|
||||
|
||||
if ($label == "Read objects of $module" && $crud != "read") {
|
||||
$crud = "read";
|
||||
$label == "Read objects of $module";
|
||||
}
|
||||
if ($label == "Create/Update objects of $module" && $crud != "write") {
|
||||
$crud = "write";
|
||||
$label == "Create/Update objects of $module";
|
||||
}
|
||||
if ($label == "Delete objects of $module" && $crud != "delete") {
|
||||
$crud = "delete";
|
||||
$label == "Delete objects of $module";
|
||||
}
|
||||
|
||||
$permissions = $moduleobj->rights;
|
||||
$r =(int) GETPOST('counter');
|
||||
//get permission want to delete from permissions array
|
||||
$x1 = $permissions[$r-1][1];
|
||||
$x2 = $permissions[$r-1][4];
|
||||
$x3 = $permissions[$r-1][5];
|
||||
//check existing object permission
|
||||
$permsForObject =array();
|
||||
|
||||
$allObject = array();
|
||||
$nbOfPermissions = count($permissions);
|
||||
for ($i =0; $i<$nbOfPermissions; $i++) {
|
||||
if ($permissions[$i][4] == $objectForPerms) {
|
||||
if (count($permsForObject) < 3) {
|
||||
$permsForObject[] = $permissions[$i];
|
||||
}
|
||||
}
|
||||
$allObject[] = $permissions[$i][4];
|
||||
}
|
||||
|
||||
if ($label != $x1 && $crud != $x3) {
|
||||
$x = count($permsForObject);
|
||||
for ($j = 0; $j<$x; $j++) {
|
||||
if (in_array($label, $permsForObject[$j])) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorExistingPermission", $langs->transnoentities($label), $langs->transnoentities($objectForPerms)), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//prepare right want to delete
|
||||
$right = "
|
||||
\$this->rights[\$r][0] = \$this->numero . sprintf('%02d', \$r + 1);
|
||||
\$this->rights[\$r][1] = '$x1';
|
||||
\$this->rights[\$r][4] = '$x2';
|
||||
\$this->rights[\$r][5] = '$x3';
|
||||
\$r++;
|
||||
";
|
||||
// right after editing
|
||||
$rightUpdated = "
|
||||
\$this->rights[\$r][0] = \$this->numero . sprintf('%02d', \$r + 1);
|
||||
\$this->rights[\$r][1] = '$label';
|
||||
\$this->rights[\$r][4] = '$objectForPerms';
|
||||
\$this->rights[\$r][5] = '$crud';
|
||||
\$r++;
|
||||
";
|
||||
if (!$error) {
|
||||
if (isModEnabled(strtolower($module))) {
|
||||
$result = unActivateModule(strtolower($module));
|
||||
dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity);
|
||||
if ($result) {
|
||||
setEventMessages($result, null, 'errors');
|
||||
}
|
||||
header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module);
|
||||
setEventMessages($langs->trans('WarningModuleNeedRefrech', $langs->transnoentities($module)), null, 'warnings');
|
||||
}
|
||||
|
||||
$moduledescriptorfile = $dirins.'/'.strtolower($module).'/core/modules/mod'.$module.'.class.php';
|
||||
$check = dolReplaceInFile($moduledescriptorfile, array($right => $rightUpdated));
|
||||
|
||||
header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module);
|
||||
setEventMessages($langs->trans('PermissionUpdatedSuccesfuly'), null);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
// Save file
|
||||
if ($action == 'savefile' && empty($cancel)) {
|
||||
$relofcustom = basename($dirins);
|
||||
@ -2760,6 +3042,7 @@ if ($module == 'initmodule') {
|
||||
print '<br>';
|
||||
print '<input type="checkbox" name="includerefgeneration" id="includerefgeneration" value="includerefgeneration"> <label class="margintoponly" for="includerefgeneration">'.$form->textwithpicto($langs->trans("IncludeRefGeneration"), $langs->trans("IncludeRefGenerationHelp")).'</label><br>';
|
||||
print '<input type="checkbox" name="includedocgeneration" id="includedocgeneration" value="includedocgeneration"> <label for="includedocgeneration">'.$form->textwithpicto($langs->trans("IncludeDocGeneration"), $langs->trans("IncludeDocGenerationHelp")).'</label><br>';
|
||||
print '<input type="checkbox" name="generatepermissions" id="generatepermissions" value="generatepermissions"> <label for="generatepermissions">'.$form->textwithpicto($langs->trans("GeneratePermissions"), $langs->trans("GeneratePermissionsHelp")).'</label><br>';
|
||||
print '<br>';
|
||||
print '<input type="submit" class="button small" name="create" value="'.dol_escape_htmltag($langs->trans("GenerateCode")).'"'.($dirins ? '' : ' disabled="disabled"').'>';
|
||||
print '<br>';
|
||||
@ -3820,6 +4103,36 @@ if ($module == 'initmodule') {
|
||||
|
||||
$perms = $moduleobj->rights;
|
||||
|
||||
// Scan for object class files
|
||||
$dir = $dirread.'/'.$modulelowercase.'/class';
|
||||
$listofobject = dol_dir_list($dir, 'files', 0, '\.class\.php$');
|
||||
$objects = array('myobject');
|
||||
$reg =array();
|
||||
foreach ($listofobject as $fileobj) {
|
||||
$tmpcontent = file_get_contents($fileobj['fullname']);
|
||||
if (preg_match('/class\s+([^\s]*)\s+extends\s+CommonObject/ims', $tmpcontent, $reg)) {
|
||||
$objects[] = $reg[1];
|
||||
}
|
||||
}
|
||||
// declared select list for actions and labels permissions
|
||||
$crud = array('Read','Write','Delete');
|
||||
$labels = array("Read objects of $module","Create/Update objects of $module","Delete objects of $module");
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
|
||||
if ($action == 'deleteright') {
|
||||
$formconfirm = $form->formconfirm(
|
||||
$_SERVER["PHP_SELF"].'?permskey='.urlencode(GETPOST('permskey', 'int')).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj),
|
||||
$langs->trans('Delete'),
|
||||
$langs->trans('Confirm Delete Right', GETPOST('permskey', 'alpha')),
|
||||
'confirm_deleteright',
|
||||
'',
|
||||
0,
|
||||
1
|
||||
);
|
||||
print $formconfirm;
|
||||
}
|
||||
|
||||
if ($action != 'editfile' || empty($file)) {
|
||||
print '<span class="opacitymedium">';
|
||||
$htmlhelp = $langs->trans("PermissionsDefDescTooltip", '{s1}');
|
||||
@ -3846,33 +4159,128 @@ if ($module == 'initmodule') {
|
||||
print '<table class="noborder">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("ID", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Permission", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("ID", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, "center");
|
||||
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, "center");
|
||||
print_liste_field_titre("Permission", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, "center");
|
||||
print_liste_field_titre("CRUD", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, "center");
|
||||
print_liste_field_titre("", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, "center");
|
||||
print "</tr>\n";
|
||||
|
||||
//form for add new right
|
||||
print '<tr>';
|
||||
print '<td><input type="text" readonly name="id" value="'.dol_escape_htmltag($moduleobj->numero.sprintf('%02d', $i + count($perms))).'"></td>';
|
||||
print '<td>';
|
||||
print '<select name="label" >';
|
||||
print '<option value=""></option>';
|
||||
for ($i = 0; $i<3; $i++) {
|
||||
print '<option value="'.dol_escape_htmltag($labels[$i]).'">'.$labels[$i].'</option>';
|
||||
}
|
||||
print '</select></td>';
|
||||
|
||||
print '<td ><select name="permissionObj">';
|
||||
print '<option value=""></option>';
|
||||
foreach ($objects as $obj) {
|
||||
if ($obj != 'myobject') {
|
||||
print '<option value="'.$obj.'">'.$obj.'</option>';
|
||||
}
|
||||
}
|
||||
print '</select></td>';
|
||||
|
||||
print '<td><select class="maxwidth" name="crud">';
|
||||
print '<option value=""></option>';
|
||||
for ($i = 0;$i<3;$i++) {
|
||||
print '<option value="'.$crud[$i].'">'.$langs->trans($crud[$i]).'</option>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td class="center tdstickyright tdstickyghostwhite">';
|
||||
print '<input type="submit" class="button" name="add" value="'.$langs->trans("Add").'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
if (count($perms)) {
|
||||
$i = 0;
|
||||
foreach ($perms as $perm) {
|
||||
print '<tr class="oddeven">';
|
||||
$i++;
|
||||
// section for editing right
|
||||
if ($action == 'edit_right' && $perm[0] == (int) GETPOST('permskey', 'int')) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="modifPerms">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="tab" value="permissions">';
|
||||
print '<input type="hidden" name="module" value="'.dol_escape_htmltag($module).'">';
|
||||
print '<input type="hidden" name="tabobj" value="'.dol_escape_htmltag($tabobj).'">';
|
||||
print '<input type="hidden" name="action" value="update_right">';
|
||||
print '<input type="hidden" name="counter" value="'.$i.'">';
|
||||
|
||||
print '<td>';
|
||||
print $perm[0];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $langs->trans($perm[1]);
|
||||
print '</td>';
|
||||
print '<input type="hidden" name="permskey" value="'.$perm[0].'">';
|
||||
|
||||
print '<td>';
|
||||
print $perm[4];
|
||||
print '</td>';
|
||||
print '<td class="tdsticky tdstickygray">';
|
||||
print '<input type="text" readonly value="'.dol_escape_htmltag($perm[0]).'"/>';
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $perm[5];
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<select name="label" >';
|
||||
print '<option value="'.dol_escape_htmltag($perm[1]).'">'.dol_escape_htmltag($perm[1]).'</option>';
|
||||
for ($i = 0; $i<3; $i++) {
|
||||
if ($perm[1] != $labels[$i]) {
|
||||
print '<option value="'.GETPOST('label').'">'.$labels[$i].'</option>';
|
||||
}
|
||||
}
|
||||
print '</select></td>';
|
||||
|
||||
print '</tr>';
|
||||
print '<td ><select name="permissionObj">';
|
||||
print '<option value="'.dol_escape_htmltag($perm[4]).'">'.$perm[4].'</option>';
|
||||
print '</select></td>';
|
||||
|
||||
print '<td>';
|
||||
print '<select name="crud">';
|
||||
print '<option value="'.dol_escape_htmltag($perm[5]).'">'.$langs->trans($perm[5]).'</option>';
|
||||
for ($i = 0; $i<3; $i++) {
|
||||
if ($perm[5] != $crud[$i]) {
|
||||
print '<option value="'.$crud[$i].'">'.$langs->trans($crud[$i]).'</option>';
|
||||
}
|
||||
}
|
||||
print '</select>';
|
||||
print '</td>';
|
||||
|
||||
print '<td class="center tdstickyright tdstickyghostwhite">';
|
||||
print '<input class="reposition button smallpaddingimp" type="submit" name="modifyright" value="'.$langs->trans("Modify").'"/>';
|
||||
print '<br>';
|
||||
print '<input class="reposition button button-cancel smallpaddingimp" type="submit" name="cancel" value="'.$langs->trans("Cancel").'"/>';
|
||||
print '</td>';
|
||||
|
||||
print '</form>';
|
||||
print '</tr>';
|
||||
} else {
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>';
|
||||
print $perm[0];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $langs->trans($perm[1]);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $perm[4];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $perm[5];
|
||||
print '</td>';
|
||||
|
||||
print '<td class="center tdstickyright tdstickyghostwhite">';
|
||||
if ($perm[4] != 'myobject') {
|
||||
print '<a class="editfielda reposition marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=edit_right&token='.newToken().'&permskey='.urlencode($perm[0]).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj).'">'.img_edit().'</a>';
|
||||
print '<a class="marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=deleteright&token='.newToken().'&permskey='.urlencode($i).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj).'">'.img_delete().'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
print '<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2015 Ion Agorria <ion@agorria.com>
|
||||
/* Copyright (C) 2015 Ion Agorria <ion@agorria.com>
|
||||
* Copyright (C) 2023 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* 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
|
||||
@ -183,7 +184,7 @@ if ($action != 'create_updater' && $action != 'edit_updater') {
|
||||
print '</tr>';
|
||||
}
|
||||
} else {
|
||||
print '<tr colspan="7"><td><span class="opacitymedium">';
|
||||
print '<tr><td colspan="4"><span class="opacitymedium">';
|
||||
print $langs->trans("None");
|
||||
print '</span></td></tr>';
|
||||
}
|
||||
|
||||
@ -173,7 +173,7 @@ $help_text .= '<br><br>'.$langs->trans("PriceExpressionEditorHelp3");
|
||||
$help_text .= '<br><br>'.$langs->trans("PriceExpressionEditorHelp4");
|
||||
$help_text .= '<br><br>'.$langs->trans("PriceExpressionEditorHelp5");
|
||||
foreach ($price_globals->listGlobalVariables() as $entry) {
|
||||
$help_text .= '<br><b>#globals_'.$entry->code.'#</b> '.$entry->description.' = '.$entry->value;
|
||||
$help_text .= '<br><b>#global_'.$entry->code.'#</b> '.$entry->description.' = '.$entry->value;
|
||||
}
|
||||
|
||||
//Price expression editor
|
||||
|
||||
@ -1855,7 +1855,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
}
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
|
||||
$selectedfields .= (is_array($arrayofmassactions) && count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
@ -1863,6 +1863,13 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
|
||||
// Fields title search
|
||||
print '<tr class="liste_titre_filter">';
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre center">';
|
||||
$searchpicto = $form->showFilterButtons('left');
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
// Date
|
||||
if (!empty($arrayfields['t.task_date']['checked'])) {
|
||||
print '<td class="liste_titre left">';
|
||||
@ -1954,13 +1961,18 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
print '<td class="liste_titre center">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre center">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'width="80"', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
}
|
||||
if (!empty($arrayfields['t.task_date']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.task_date']['label'], $_SERVER['PHP_SELF'], 't.task_date,t.task_datehour,t.rowid', '', $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
@ -2014,7 +2026,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
$parameters = array('arrayfields'=>$arrayfields, '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($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'width="80"', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'width="80"', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
$tasktmp = new Task($db);
|
||||
@ -2035,6 +2049,42 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="center nowraponall">';
|
||||
if (($action == 'editline' || $action == 'splitline') && GETPOST('lineid', 'int') == $task_time->rowid) {
|
||||
print '<input type="hidden" name="lineid" value="'.GETPOST('lineid', 'int').'">';
|
||||
print '<input type="submit" class="button buttongen margintoponlyshort marginbottomonlyshort button-save" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button buttongen margintoponlyshort marginbottomonlyshort button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
} elseif ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer')) { // Read project and enter time consumed on assigned tasks
|
||||
if (in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) {
|
||||
if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) {
|
||||
print ' ';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
|
||||
print img_split('', 'class="pictofixedwidth"');
|
||||
print '</a>';
|
||||
}
|
||||
|
||||
print '<a class="reposition editfielda" href="'.$_SERVER["PHP_SELF"].'?id='.$task_time->fk_task.'&action=editline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
|
||||
print img_edit('default', 0, 'class="pictofixedwidth paddingleft"');
|
||||
print '</a>';
|
||||
|
||||
print '<a class="reposition paddingleft" href="'.$_SERVER["PHP_SELF"].'?id='.$task_time->fk_task.'&action=deleteline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
|
||||
print img_delete('default', 'class="pictodelete paddingleft"');
|
||||
print '</a>';
|
||||
|
||||
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($task_time->rowid, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print ' ';
|
||||
print '<input id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Date
|
||||
if (!empty($arrayfields['t.task_date']['checked'])) {
|
||||
print '<td class="nowrap">';
|
||||
@ -2318,36 +2368,38 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
// Action column
|
||||
print '<td class="center nowraponall">';
|
||||
if (($action == 'editline' || $action == 'splitline') && GETPOST('lineid', 'int') == $task_time->rowid) {
|
||||
print '<input type="hidden" name="lineid" value="'.GETPOST('lineid', 'int').'">';
|
||||
print '<input type="submit" class="button buttongen margintoponlyshort marginbottomonlyshort button-save" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button buttongen margintoponlyshort marginbottomonlyshort button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
} elseif ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer')) { // Read project and enter time consumed on assigned tasks
|
||||
if (in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) {
|
||||
if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) {
|
||||
print ' ';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
|
||||
print img_split('', 'class="pictofixedwidth"');
|
||||
print '</a>';
|
||||
}
|
||||
|
||||
print '<a class="reposition editfielda" href="'.$_SERVER["PHP_SELF"].'?id='.$task_time->fk_task.'&action=editline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
|
||||
print img_edit('default', 0, 'class="pictofixedwidth paddingleft"');
|
||||
print '</a>';
|
||||
|
||||
print '<a class="reposition paddingleft" href="'.$_SERVER["PHP_SELF"].'?id='.$task_time->fk_task.'&action=deleteline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
|
||||
print img_delete('default', 'class="pictodelete paddingleft"');
|
||||
print '</a>';
|
||||
|
||||
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($task_time->rowid, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="center nowraponall">';
|
||||
if (($action == 'editline' || $action == 'splitline') && GETPOST('lineid', 'int') == $task_time->rowid) {
|
||||
print '<input type="hidden" name="lineid" value="'.GETPOST('lineid', 'int').'">';
|
||||
print '<input type="submit" class="button buttongen margintoponlyshort marginbottomonlyshort button-save" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button buttongen margintoponlyshort marginbottomonlyshort button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
} elseif ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer')) { // Read project and enter time consumed on assigned tasks
|
||||
if (in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) {
|
||||
if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) {
|
||||
print ' ';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
|
||||
print img_split('', 'class="pictofixedwidth"');
|
||||
print '</a>';
|
||||
}
|
||||
|
||||
print '<a class="reposition editfielda" href="'.$_SERVER["PHP_SELF"].'?id='.$task_time->fk_task.'&action=editline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
|
||||
print img_edit('default', 0, 'class="pictofixedwidth paddingleft"');
|
||||
print '</a>';
|
||||
|
||||
print '<a class="reposition paddingleft" href="'.$_SERVER["PHP_SELF"].'?id='.$task_time->fk_task.'&action=deleteline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
|
||||
print img_delete('default', 'class="pictodelete paddingleft"');
|
||||
print '</a>';
|
||||
|
||||
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($task_time->rowid, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print ' ';
|
||||
print '<input id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print ' ';
|
||||
print '<input id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -186,7 +186,7 @@ if ($action == 'delete_resource') {
|
||||
}
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage);
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN'));
|
||||
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
@ -230,6 +230,13 @@ print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||
|
||||
print '<tr class="liste_titre_filter">';
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['t.ref']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" name="search_ref" value="'.$search_ref.'" size="6">';
|
||||
@ -243,13 +250,19 @@ if (!empty($arrayfields['ty.label']['checked'])) {
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
||||
// Action column
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
}
|
||||
if (!empty($arrayfields['t.ref']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.ref']['label'], $_SERVER["PHP_SELF"], "t.ref", "", $param, "", $sortfield, $sortorder);
|
||||
}
|
||||
@ -258,7 +271,10 @@ if (!empty($arrayfields['ty.label']['checked'])) {
|
||||
}
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
// Action column
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -266,6 +282,19 @@ if ($ret) {
|
||||
foreach ($object->lines as $resource) {
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="center">';
|
||||
print '<a class="editfielda" href="./card.php?action=edit&token='.newToken().'&id='.$resource->id.'">';
|
||||
print img_edit();
|
||||
print '</a>';
|
||||
print ' ';
|
||||
print '<a href="./card.php?action=delete&token='.newToken().'&id='.$resource->id.'">';
|
||||
print img_delete('', 'class="marginleftonly"');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
if (!empty($arrayfields['t.ref']['checked'])) {
|
||||
print '<td>';
|
||||
print $resource->getNomUrl(5);
|
||||
@ -287,15 +316,18 @@ if ($ret) {
|
||||
$obj = (Object) $resource->array_options;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||
|
||||
print '<td class="center">';
|
||||
print '<a class="editfielda" href="./card.php?action=edit&token='.newToken().'&id='.$resource->id.'">';
|
||||
print img_edit();
|
||||
print '</a>';
|
||||
print ' ';
|
||||
print '<a href="./card.php?action=delete&token='.newToken().'&id='.$resource->id.'">';
|
||||
print img_delete('', 'class="marginleftonly"');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
// Action column
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="center">';
|
||||
print '<a class="editfielda" href="./card.php?action=edit&token='.newToken().'&id='.$resource->id.'">';
|
||||
print img_edit();
|
||||
print '</a>';
|
||||
print ' ';
|
||||
print '<a href="./card.php?action=delete&token='.newToken().'&id='.$resource->id.'">';
|
||||
print img_delete('', 'class="marginleftonly"');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
}
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -399,7 +399,7 @@ $newcardbutton = dolGetButtonTitle($langs->trans('NewSalaryPayment'), '', 'fa fa
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'salary', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
//$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
//$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
|
||||
$selectedfields = '';
|
||||
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||
|
||||
@ -411,6 +411,13 @@ print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwit
|
||||
// Fields title search
|
||||
// --------------------------------------------------------------------
|
||||
print '<tr class="liste_titre_filter">';
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons('left');
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
// Ref
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat width50" type="text" name="search_ref" value="'.$db->escape($search_ref).'">';
|
||||
@ -472,16 +479,22 @@ $parameters = array('arrayfields'=>$arrayfields);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
|
||||
// Fields title label
|
||||
// --------------------------------------------------------------------
|
||||
print '<tr class="liste_titre">';
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
}
|
||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "s.rowid", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "s.label", "", $param, 'class="left"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "s.datesp,s.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
@ -500,7 +513,9 @@ $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
|
||||
@ -567,6 +582,22 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
// Show here line of result
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// 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($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Ref
|
||||
print "<td>".$salstatic->getNomUrl(1)."</td>\n";
|
||||
if (!$i) {
|
||||
@ -661,19 +692,20 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action 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($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
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($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
print '</tr>'."\n";
|
||||
}
|
||||
$i++;
|
||||
|
||||
BIN
htdocs/theme/common/flags/xk.png
Normal file
BIN
htdocs/theme/common/flags/xk.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 371 B |
@ -462,7 +462,7 @@ if (!empty($moreforfilter)) {
|
||||
}
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
|
||||
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||
|
||||
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
@ -473,6 +473,13 @@ print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwit
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons('left');
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
if ($key == 'status') {
|
||||
@ -530,10 +537,12 @@ $parameters = array('arrayfields'=>$arrayfields);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
$totalarray = array();
|
||||
@ -542,6 +551,11 @@ $totalarray['nbfield'] = 0;
|
||||
// Fields title label
|
||||
// --------------------------------------------------------------------
|
||||
print '<tr class="liste_titre">';
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
if ($key == 'status') {
|
||||
@ -576,8 +590,10 @@ $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
$totalarray['nbfield']++;
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
$totalaray['nbfield']++;
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
|
||||
@ -625,6 +641,21 @@ while ($i < $imaxinloop) {
|
||||
// Show here line of result
|
||||
$j = 0;
|
||||
print '<tr data-rowid="'.$object->id.'" class="oddeven">';
|
||||
// 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($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
||||
@ -717,17 +748,19 @@ while ($i < $imaxinloop) {
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action 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($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
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($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
print '</tr>'."\n";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user