diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index f1fbbd4b286..2dbc601c264 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; // Load translation files required by the page -$langs->loadLangs(array("admin", "other", "orders")); +$langs->loadLangs(array("admin", "other", "orders", "stocks")); if (!$user->admin) accessforbidden(); @@ -561,25 +561,31 @@ print '' print "\n"; // Option to add a quality/validation step, on products, after reception. -$langs->load("stocks"); print ''; print ''.$langs->trans("UseDispatchStatus").''; print ''; print ''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("SUPPLIER_ORDER_USE_DISPATCH_STATUS", $arrval, $conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS); +if ($conf->reception->enabled) +{ + print ''.$langs->trans("FeatureNotAvailableWithReceptionModule").''; } -print "\n\n"; +else +{ + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("SUPPLIER_ORDER_USE_DISPATCH_STATUS", $arrval, $conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS); + } +} +print "\n"; +print "\n"; print '
'; print ''; - /* * Notifications */ diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php index 74a2243d633..c2fed2895a8 100644 --- a/htdocs/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php @@ -81,8 +81,8 @@ if (count($linkedObjectBlock) > 1) trans("Total"); ?> - - + + diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index 301f2f532b1..1276194b6c3 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -239,6 +239,23 @@ if ($id > 0 || $ref) dol_fiche_end(); + $formconfirm = ''; + + // Confirmation to delete + if ($action == 'delete') + { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('Delete'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); + } + + // Call Hook formConfirm + /*$parameters = array(); + $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if (empty($reshook)) $formconfirm.=$hookmanager->resPrint; + elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;*/ + + // Print form confirm + print $formconfirm; + if (empty($object->date_trans) && $user->rights->prelevement->bons->send && $action=='settransmitted') { @@ -298,7 +315,7 @@ if ($id > 0 || $ref) print "id."\">".$langs->trans("ClassCredited").""; } - print "id."\">".$langs->trans("Delete").""; + print "id."\">".$langs->trans("Delete").""; print ""; } @@ -356,8 +373,6 @@ if ($id > 0 || $ref) print_liste_field_titre(''); print "\n"; - $var=false; - $total = 0; while ($i < min($num, $conf->liste_limit)) @@ -406,7 +421,10 @@ if ($id > 0 || $ref) print ''.$langs->trans("Total").''; print ' '; print ''; - if ($total != $object->amount) print img_warning("AmountOfFileDiffersFromSumOfInvoices"); + if (empty($offset) && $num <= $limit) // If we have all record on same page, then the following test/warning can be done + { + if ($total != $object->amount) print img_warning("TotalAmountOfdirectDebitOrderDiffersFromSumOfLines"); + } print price($total); print "\n"; print ' '; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index c9dd592c6a9..92ba7f621cb 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -739,14 +739,13 @@ class BonPrelevement extends CommonObject $sql = "SELECT count(f.rowid) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql.= ", ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; - $sql.= " WHERE f.fk_statut = 1"; + $sql.= " WHERE f.fk_statut = ".Facture::STATUS_VALIDATED; $sql.= " AND f.entity IN (".getEntity('invoice').")"; $sql.= " AND f.rowid = pfd.fk_facture"; - $sql.= " AND f.paye = 0"; $sql.= " AND pfd.traite = 0"; $sql.= " AND f.total_ttc > 0"; - dol_syslog(get_class($this)."::SommeAPrelever"); + dol_syslog(get_class($this)."::NbFactureAPrelever"); $resql = $this->db->query($sql); if ( $resql ) @@ -759,7 +758,7 @@ class BonPrelevement extends CommonObject } else { - $this->error=get_class($this)."::SommeAPrelever Erreur -1 sql=".$this->db->error(); + $this->error=get_class($this)."::NbFactureAPrelever Erreur -1 sql=".$this->db->error(); return -1; } } @@ -1629,8 +1628,8 @@ class BonPrelevement extends CommonObject public static function buildRumNumber($row_code_client, $row_datec, $row_drum) { global $langs; - $pre = $langs->trans('RUM').'-'; - return $pre.$row_code_client.'-'.$row_drum.'-'.date('U', $row_datec); + $pre = substr(dol_string_nospecial(dol_string_unaccent($langs->transnoentitiesnoconv('RUM'))), 0, 3); // Must always be on 3 char ('RUM' or 'UMR'. This is a protection against bad translation) + return $pre.'-'.$row_code_client.'-'.$row_drum.'-'.date('U', $row_datec); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index eaef92a1abc..dce08c5c66b 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page -$langs->loadLangs(array('banks', 'categories', 'widthdrawals', 'companies', 'bills')); +$langs->loadLangs(array('banks', 'categories', 'withdrawals', 'companies', 'bills')); // Security check if ($user->societe_id) $socid=$user->societe_id; @@ -105,6 +105,7 @@ if (empty($reshook)) /* * View */ + $form = new Form($db); $thirdpartystatic=new Societe($db); @@ -207,9 +208,11 @@ $sql.= " ".MAIN_DB_PREFIX."societe as s,"; $sql.= " ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; $sql.= " WHERE s.rowid = f.fk_soc"; $sql.= " AND f.entity IN (".getEntity('invoice').")"; +$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; +$sql.= " AND f.total_ttc > 0"; $sql.= " AND pfd.traite = 0"; $sql.= " AND pfd.fk_facture = f.rowid"; -if ($socid) $sql.= " AND f.fk_soc = ".$socid; +if ($socid > 0) $sql.= " AND f.fk_soc = ".$socid; $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) @@ -293,7 +296,7 @@ if ($resql) $i++; } } - else print ''.$langs->trans("None").''; + else print ''.$langs->trans("None").''; print ""; print ""; print "
\n"; diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 8f9df284291..a34fde042e5 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -35,31 +35,43 @@ $langs->loadLangs(array('banks', 'categories', 'withdrawals', 'companies')); // Security check $socid = GETPOST('socid', 'int'); +$status = GETPOST('status', 'int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'prelevement', '', '', 'bons'); -// Get supervariables -$page = GETPOST('page', 'int'); -$sortorder = GETPOST('sortorder', 'alpha'); -$sortfield = GETPOST('sortfield', 'alpha'); +$contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'myobjectlist'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +// Load variable for pagination $limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); $page = GETPOST("page", 'int'); -if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 +if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="f.ref"; +$massactionbutton = ''; + /* * View */ -llxHeader(); +if (!$status) +{ + $title = $langs->trans("RequestStandingOrderToTreat"); +} +else +{ + $title = $langs->trans("RequestStandingOrderTreated"); +} + +llxHeader('', $title); $thirdpartystatic=new Societe($db); $invoicestatic=new Facture($db); @@ -78,95 +90,126 @@ $sql.= " WHERE s.rowid = f.fk_soc"; $sql.= " AND f.entity IN (".getEntity('invoice').")"; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND f.fk_soc = ".$socid; -if (!$statut) $sql.= " AND pfd.traite = 0"; -if ($statut) $sql.= " AND pfd.traite = ".$statut; +if (!$status) $sql.= " AND pfd.traite = 0"; +if ($status) $sql.= " AND pfd.traite = ".$status; +$sql.= " AND f.total_ttc > 0"; +$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; $sql.= " AND pfd.fk_facture = f.rowid"; if (dol_strlen(trim(GETPOST('search_societe', 'alpha')))) { $sql.= natural_search("s.nom", 'search_societe'); } -$sql.= " ORDER BY $sortfield $sortorder "; -$sql.= $db->plimit($limit+1, $offset); +$sql.=$db->order($sortfield, $sortorder); -$resql=$db->query($sql); -if ($resql) + +// Count total nb of records +$nbtotalofrecords = ''; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $num = $db->num_rows($resql); - $i = 0; - - if (!$statut) + $resql = $db->query($sql); + $nbtotalofrecords = $db->num_rows($resql); + if (($page * $limit) > $nbtotalofrecords) // if total of record found is smaller than page * limit, goto and load page 0 { - print_barre_liste($langs->trans("RequestStandingOrderToTreat"), $page, "demandes.php", $urladd, $sortfield, $sortorder, '', $num); + $page = 0; + $offset = 0; } - else - { - print_barre_liste($langs->trans("RequestStandingOrderTreated"), $page, "demandes.php", $urladd, $sortfield, $sortorder, '', $num); - } - - print '
'; - - print ''; - - print ''; - print_liste_field_titre("Bill", $_SERVER["PHP_SELF"]); - print_liste_field_titre("Company", $_SERVER["PHP_SELF"]); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "", "", $param, 'class="right"'); - print_liste_field_titre("DateRequest", $_SERVER["PHP_SELF"], "", "", $param, 'class="center"'); - print_liste_field_titre(''); - print ''; - - print ''; - print ''; - print ''; - print ''; - print ''; - // Action column - print ''; - print ''; - - $users = array(); - - while ($i < min($num, $limit)) - { - $obj = $db->fetch_object($resql); - - print ''; - - // Ref facture - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - $i++; - } - - print "
'; - $searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); - print $searchpicto; - print '
'; - $invoicestatic->id=$obj->rowid; - $invoicestatic->ref=$obj->ref; - print $invoicestatic->getNomUrl(1, 'withdraw'); - print ''; - $thirdpartystatic->id=$obj->socid; - $thirdpartystatic->name=$obj->name; - print $thirdpartystatic->getNomUrl(1, 'customer'); - print ''.price($obj->total_ttc).''.dol_print_date($db->jdate($obj->date_demande), 'day').'

"; - - print '
'; +} +// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set. +if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) +{ + $num = $nbtotalofrecords; } else { - dol_print_error($db); + $sql.= $db->plimit($limit+1, $offset); + + $resql=$db->query($sql); + if (! $resql) + { + dol_print_error($db); + exit; + } + + $num = $db->num_rows($resql); } + + +$newcardbutton = ''.$langs->trans("Back").''; + +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic', 0, $newcardbutton, '', $limit); + +print '
'; +if ($optioncss != '') print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + + +print ''; + +print ''; +print_liste_field_titre("Bill", $_SERVER["PHP_SELF"]); +print_liste_field_titre("Company", $_SERVER["PHP_SELF"]); +print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "", "", $param, 'class="right"'); +print_liste_field_titre("DateRequest", $_SERVER["PHP_SELF"], "", "", $param, 'class="center"'); +print_liste_field_titre(''); +print ''; + +print ''; +print ''; +print ''; +print ''; +print ''; +// Action column +print ''; +print ''; + +$users = array(); + +$i = 0; +while ($i < min($num, $limit)) +{ + $obj = $db->fetch_object($resql); + if (empty($obj)) break; // Should not happen + + print ''; + + // Ref facture + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + $i++; +} + +print "
'; +$searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); +print $searchpicto; +print '
'; + $invoicestatic->id=$obj->rowid; + $invoicestatic->ref=$obj->ref; + print $invoicestatic->getNomUrl(1, 'withdraw'); + print ''; + $thirdpartystatic->id=$obj->socid; + $thirdpartystatic->name=$obj->name; + print $thirdpartystatic->getNomUrl(1, 'customer'); + print ''.price($obj->total_ttc).''.dol_print_date($db->jdate($obj->date_demande), 'day').'

"; + +print '
'; + + // End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index 1be716f8f61..44db7dd2625 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -71,6 +71,7 @@ $thirdpartystatic=new Societe($db); $invoicestatic=new Facture($db); $bprev = new BonPrelevement($db); + print ''; print ''; @@ -100,6 +101,8 @@ if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX $sql.= " , ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; $sql.= " WHERE s.rowid = f.fk_soc"; $sql.= " AND f.entity IN (".getEntity('invoice').")"; +$sql.= " AND f.total_ttc > 0"; +$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; $sql.= " AND pfd.traite = 0 AND pfd.fk_facture = f.rowid"; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND f.fk_soc = ".$socid; diff --git a/htdocs/core/modules/modReception.class.php b/htdocs/core/modules/modReception.class.php index 6594d7bb04a..f85f5656afe 100644 --- a/htdocs/core/modules/modReception.class.php +++ b/htdocs/core/modules/modReception.class.php @@ -58,7 +58,7 @@ class modReception extends DolibarrModules // Data directories to create when module is enabled $this->dirs = array("/reception/receipt", "/reception/receipt/temp", - "/doctemplates/reception" + "/doctemplates/receptions" ); // Config pages diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 23d000308ef..4a16724d614 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -121,15 +121,7 @@ class pdf_squille extends ModelePdfReception // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - $outputlangs->load("main"); - $outputlangs->load("dict"); - $outputlangs->load("companies"); - $outputlangs->load("bills"); - $outputlangs->load("products"); - $outputlangs->load("propal"); - $outputlangs->load("deliveries"); - $outputlangs->load("receptions"); - $outputlangs->load("productbatch"); + $outputlangs->loadLangs(array("main","dict","companies","bills","products","propal","deliveries","receptions","productbatch","sendings")); $nblines = count($object->lines); diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index df29d329e0d..9be757cf87e 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -939,8 +939,16 @@ if ($id > 0 || ! empty($ref)) { print ''; print ''; print ''; - if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS) || !empty($conf->reception->enabled)) + + // Status + if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS) && empty($reception->rowid)) { print ''; + } + elseif(!empty($conf->reception->enabled)) { + print ''; + } + + print ''; print "\n"; @@ -1025,17 +1033,15 @@ if ($id > 0 || ! empty($ref)) { } } print ''; - }elseif(!empty($conf->reception->enabled)){ + } elseif(!empty($conf->reception->enabled)) { print ''; } - print ''; - print ''; - + print ''; print "\n"; diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 2207148e4ea..204d832a94c 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -55,13 +55,6 @@ $langs->load("holiday"); $childids = $user->getAllChildIds(1); -$cancreate = 0; -if (! empty($user->rights->holiday->write_all)) $cancreate=1; -if (! empty($user->rights->holiday->write) && in_array($fuserid, $childids)) $cancreate=1; - -$candelete = 0; -if (! empty($user->rights->holiday->delete)) $candelete=1; - $morefilter = 'AND employee = 1'; if (! empty($conf->global->HOLIDAY_FOR_NON_SALARIES_TOO)) $morefilter = ''; @@ -82,6 +75,13 @@ if ($id > 0) } } +$cancreate = 0; +if (! empty($user->rights->holiday->write_all)) $cancreate=1; +if (! empty($user->rights->holiday->write) && in_array($fuserid, $childids)) $cancreate=1; + +$candelete = 0; +if (! empty($user->rights->holiday->delete)) $candelete=1; +if ($object->statut == Holiday::STATUS_DRAFT && $user->rights->holiday->write && in_array($object->fk_user, $childids)) $candelete=1; /* * Actions @@ -1435,7 +1435,7 @@ else { print ''.$langs->trans("SetToDraft").''; } - if ($user->rights->holiday->delete && ($object->statut == Holiday::STATUS_DRAFT || $object->statut == Holiday::STATUS_CANCELED || $object->statut == Holiday::STATUS_REFUSED)) // If draft or canceled or refused + if ($candelete && ($object->statut == Holiday::STATUS_DRAFT || $object->statut == Holiday::STATUS_CANCELED || $object->statut == Holiday::STATUS_REFUSED)) // If draft or canceled or refused { print ''.$langs->trans("DeleteCP").''; } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 494e7d4a8a3..a84a052094a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1940,4 +1940,5 @@ RESTRICT_API_ON_IP=Allow available APIs to some host IP only (wildcard not allow RESTRICT_ON_IP=Allow access to some host IP only (wildcard not allowed, use space between values). Empty means every hosts can access. BaseOnSabeDavVersion=Based on the library SabreDAV version NotAPublicIp=Not a public IP -MakeAnonymousPing=Make an anonymous Ping '+1' to the Dolibarr foundation server (done 1 time only after installation) to allow the foundation to count the number of Dolibarr installation. \ No newline at end of file +MakeAnonymousPing=Make an anonymous Ping '+1' to the Dolibarr foundation server (done 1 time only after installation) to allow the foundation to count the number of Dolibarr installation. +FeatureNotAvailableWithReceptionModule=Feature not available when module Reception is enabled diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 397e562e265..a69947dfd8c 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -825,6 +825,7 @@ Mandatory=Mandatory Hello=Hello GoodBye=GoodBye Sincerely=Sincerely +ConfirmDeleteObject=Are you sure you want to delete this object? DeleteLine=Delete line ConfirmDeleteLine=Are you sure you want to delete this line? NoPDFAvailableForDocGenAmongChecked=No PDF were available for the document generation among checked record diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 28c817658f6..72bc424c53c 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -256,7 +256,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Confirmation to delete if ($action == 'delete') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyObject'), $langs->trans('ConfirmDeleteMyObject'), 'confirm_delete', '', 0, 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyObject'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); } // Confirmation to delete line if ($action == 'deleteline') diff --git a/htdocs/reception/tpl/linkedobjectblock.tpl.php b/htdocs/reception/tpl/linkedobjectblock.tpl.php index 9601c661c70..2b66b76e9dd 100644 --- a/htdocs/reception/tpl/linkedobjectblock.tpl.php +++ b/htdocs/reception/tpl/linkedobjectblock.tpl.php @@ -1,6 +1,7 @@ - * Copyright (C) 2014 Marcos García +/* Copyright (C) 2012 Regis Houssin + * Copyright (C) 2014 Marcos García + * Copyright (C) 2019 Laurent Destailleur * * 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 @@ -15,6 +16,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + +// Protection to avoid direct call of template +if (empty($conf) || ! is_object($conf)) +{ + print "Error, template page can't be called as URL"; + exit; +} + ?> @@ -22,41 +31,47 @@ load("receptions"); +$linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1); + $total=0; $ilink=0; -$var=true; foreach($linkedObjectBlock as $key => $objectlink) { $ilink++; - $trclass=($var?'pair':'impair'); + $trclass='oddeven'; if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> - - - - - + + + + - - + + ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> +
'.$langs->trans("Statistics").'
' . $langs->trans("Warehouse") . '' . $langs->trans("Comment") . '' . $langs->trans("Status") . '
'; if(!empty($reception->id)){ print $reception->getLibStatut(5); } + print ''; - print '
trans("Reception"); ?>getNomUrl(1); ?>date_delivery, 'day'); ?>trans("Reception"); ?> + global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) print ' + getNomUrl(1); ?>date_delivery, 'day'); ?>rights->reception->lire) { $total = $total + $objectlink->total_ht; echo price($objectlink->total_ht); } ?>getLibStatut(3); ?> + getLibStatut(3); ?> element != 'order_supplier') { ?> - ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>