diff --git a/htdocs/adherents/admin/member_emails.php b/htdocs/adherents/admin/member_emails.php index a1e28904d8c..2bfd3a1d630 100644 --- a/htdocs/adherents/admin/member_emails.php +++ b/htdocs/adherents/admin/member_emails.php @@ -63,6 +63,7 @@ $constantes = array( 'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>array('type'=>'emailtemplate:member'), 'ADHERENT_EMAIL_TEMPLATE_EXCLUSION' =>array('type'=>'emailtemplate:member'), 'ADHERENT_MAIL_FROM' =>array('type'=>'string'), + 'ADHERENT_CC_MAIL_FROM' =>array('type'=>'string'), 'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT' =>array('type'=>'string'), 'ADHERENT_AUTOREGISTER_NOTIF_MAIL' =>array('type'=>'html', 'tooltip'=>$helptext) ); diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index f70a23dabab..6b99c7bbb0c 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -3146,12 +3146,13 @@ class Adherent extends CommonObject $msg = make_substitutions($arraydefaultmessage->content, $substitutionarray, $outputlangs); $from = getDolGlobalString('ADHERENT_MAIL_FROM'); $to = $adherent->email; + $cc = getDolGlobalString('ADHERENT_CC_MAIL_FROM'); $trackid = 'mem'.$adherent->id; $moreinheader = 'X-Dolibarr-Info: sendReminderForExpiredSubscription'."\r\n"; include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $cmail = new CMailFile($subject, $to, $from, $msg, array(), array(), array(), '', '', 0, 1, '', '', $trackid, $moreinheader); + $cmail = new CMailFile($subject, $to, $from, $msg, array(), array(), array(), $cc, '', 0, 1, '', '', $trackid, $moreinheader); $result = $cmail->sendfile(); if (!$result) { $error++; diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index f14f8c756f5..2fd3f13f88b 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -50,6 +50,9 @@ $action = GETPOST('action', 'aZ09'); */ if ($action == 'update') { + if (GETPOSTISSET('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING')) { + dolibarr_set_const($db, "MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", GETPOST("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING"), 'chaine', 0, '', $conf->entity); + } if (GETPOSTISSET('PROPOSAL_PDF_HIDE_PAYMENTTERM')) { dolibarr_set_const($db, "PROPOSAL_PDF_HIDE_PAYMENTTERM", GETPOST("PROPOSAL_PDF_HIDE_PAYMENTTERM"), 'chaine', 0, '', $conf->entity); } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index f6298af1cff..5601eb5838d 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -5211,7 +5211,7 @@ if ($action == 'create') { print ''; print ''.price($obj->amount_ttc).''; print ''; - print 'rowid.'">'.img_delete().''; + print 'rowid.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; print ''; $i++; if ($invoice->type == Facture::TYPE_CREDIT_NOTE) { diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index 893a71fad3f..8cf005d9ade 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -22,7 +22,7 @@ /** * \file htdocs/compta/prelevement/list.php * \ingroup prelevement - * \brief Page list of direct debit orders or credit transfers orders + * \brief Page to list direct debit orders or credit transfers orders */ // Load Dolibarr environment @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page $langs->loadLangs(array('banks', 'withdrawals', 'companies', 'categories')); -$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation @@ -43,17 +43,19 @@ $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'directdebitcredittransferlinelist'; // 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') -$mode = GETPOST('mode', 'alpha'); +$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) $type = GETPOST('type', 'aZ09'); +// Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); -if (empty($page) || $page == -1) { +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; -} // If $page is not defined, or '' or -1 +} $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -107,7 +109,11 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $form = new Form($db); -llxHeader('', $langs->trans("WithdrawalsLines")); +$title = $langs->trans("WithdrawalsLines"); +if ($type == 'bank-transfer') { + $title = $langs->trans("CreditTransferLines"); +} +$help_url = ''; $sql = "SELECT p.rowid, p.ref, p.statut as status, p.datec"; $sql .= " , f.rowid as facid, f.ref as invoiceref, f.total_ttc"; @@ -170,193 +176,315 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { dol_print_error($db); } - if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 + if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0 $page = 0; $offset = 0; } $db->free($resql); } +// Complete request and execute it with limit $sql .= $db->order($sortfield, $sortorder); if ($limit) { $sql .= $db->plimit($limit + 1, $offset); } -$result = $db->query($sql); -if ($result) { - $num = $db->num_rows($result); - $i = 0; +$resql = $db->query($sql); +if (!$resql) { + dol_print_error($db); + exit; +} - $param = "&statut=".urlencode($statut); - $param .= "&search_bon=".urlencode($search_bon); - if (!empty($mode)) { - $param .= '&mode='.urlencode($mode); - } - if ($type == 'bank-transfer') { - $param .= '&type=bank-transfer'; - } - if ($limit > 0 && $limit != $conf->liste_limit) { - $param .= '&limit='.((int) $limit); - } - $newcardbutton = ''; - $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); - $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$num = $db->num_rows($resql); - print"\n\n"; - print '
'."\n"; - if ($optioncss != '') { - print ''; - } - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; +// Output page +// -------------------------------------------------------------------- - if ($type != '') { - print ''; - } +llxHeader('', $title, $help_url); - $title = $langs->trans("WithdrawalsLines"); - if ($type == 'bank-transfer') { - $title = $langs->trans("CreditTransferLines"); - } - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1); +$arrayofselected = is_array($toselect) ? $toselect : array(); - $moreforfilter = ''; +$param = ''; +$param .= "&statut=".urlencode($statut); +$param .= "&search_bon=".urlencode($search_bon); +if ($type == 'bank-transfer') { + $param .= '&type=bank-transfer'; +} +if (!empty($mode)) { + $param .= '&mode='.urlencode($mode); +} +if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { + $param .= '&contextpage='.urlencode($contextpage); +} +if ($limit > 0 && $limit != $conf->liste_limit) { + $param .= '&limit='.((int) $limit); +} +if ($optioncss != '') { + $param .= '&optioncss='.urlencode($optioncss); +} - print '
'; - print ''."\n"; +print ''."\n"; +print ''; +if ($optioncss != '') { + print ''; +} +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; +} + +$db->free($result); + +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + +print '
   '; +if ($type != '') { + print ''; +} + +$newcardbutton = ''; +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); + +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1); + +$moreforfilter = ''; +/*$moreforfilter.='
'; + $moreforfilter.= $langs->trans('MyFilter') . ': '; + $moreforfilter.= '
';*/ + +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +if (empty($reshook)) { + $moreforfilter .= $hookmanager->resPrint; +} else { + $moreforfilter = $hookmanager->resPrint; +} + +if (!empty($moreforfilter)) { + print '
'; + print $moreforfilter; + $parameters = array(); + $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print '
'; +} + +$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); + +print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table +print ''."\n"; + +// Fields title search +// -------------------------------------------------------------------- +print ''; +// Action column +if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; +} +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +// Action column +if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; - print ''; +} +print ''."\n"; - $columntitle = "WithdrawalsReceipts"; - $columntitlethirdparty = "CustomerCode"; - $columncodethirdparty = "s.code_client"; - if ($type == 'bank-transfer') { - $columntitle = "BankTransferReceipts"; - $columntitlethirdparty = "SupplierCode"; - $columncodethirdparty = "s.code_fournisseur"; - } +$totalarray = array(); +$totalarray['nbfield'] = 0; - print ''; - print_liste_field_titre($columntitle, $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder); - print_liste_field_titre("Line", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); - print_liste_field_titre("Bill", $_SERVER["PHP_SELF"], "f.ref", '', $param, '', $sortfield, $sortorder); - print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder); - print_liste_field_titre($columntitlethirdparty, $_SERVER["PHP_SELF"], $columncodethirdparty, '', $param, '', $sortfield, $sortorder, 'center '); - print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center '); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "pl.amount", "", $param, '', $sortfield, $sortorder, 'right '); - print_liste_field_titre(''); - print "\n"; +$columntitle = "WithdrawalsReceipts"; +$columntitlethirdparty = "CustomerCode"; +$columncodethirdparty = "s.code_client"; +if ($type == 'bank-transfer') { + $columntitle = "BankTransferReceipts"; + $columntitlethirdparty = "SupplierCode"; + $columncodethirdparty = "s.code_fournisseur"; +} - if ($num) { - $imaxinloop = ($limit ? min($num, $limit) : $num); - while ($i < $imaxinloop) { - $obj = $db->fetch_object($result); +// Fields title label +// -------------------------------------------------------------------- +print ''; +// Action column +if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; + $totalarray['nbfield']++; +} +print_liste_field_titre($columntitle, $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder); +$totalarray['nbfield']++; +print_liste_field_titre("Line", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); +$totalarray['nbfield']++; +print_liste_field_titre("Bill", $_SERVER["PHP_SELF"], "f.ref", '', $param, '', $sortfield, $sortorder); +$totalarray['nbfield']++; +print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder); +$totalarray['nbfield']++; +print_liste_field_titre($columntitlethirdparty, $_SERVER["PHP_SELF"], $columncodethirdparty, '', $param, '', $sortfield, $sortorder, 'center '); +$totalarray['nbfield']++; +print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center '); +$totalarray['nbfield']++; +print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "pl.amount", "", $param, '', $sortfield, $sortorder, 'right '); +$totalarray['nbfield']++; +// Action column +if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; + $totalarray['nbfield']++; +} +print ''."\n"; - $bon->id = $obj->rowid; - $bon->ref = $obj->ref; - $bon->statut = $obj->status; - $bon->date_echeance = $obj->datec; - $bon->total = $obj->amount; +// Loop on record +// -------------------------------------------------------------------- +$i = 0; +$savnbfield = $totalarray['nbfield']; +$totalarray = array(); +$totalarray['nbfield'] = 0; - $company->id = $obj->socid; - $company->name = $obj->name; - $company->email = $obj->email; - $company->code_client = $obj->code_client; +$imaxinloop = ($limit ? min($num, $limit) : $num); +while ($i < $imaxinloop) { + $obj = $db->fetch_object($resql); - if ($mode == 'kanban') { - if ($i == 0) { - print ''; - } - } else { - print ''; + $bon->id = $obj->rowid; + $bon->ref = $obj->ref; + $bon->statut = $obj->status; + $bon->date_echeance = $obj->datec; + $bon->total = $obj->amount; - print '\n"; + $object = $bon; - print ''; + $company->id = $obj->socid; + $company->name = $obj->name; + $company->email = $obj->email; + $company->code_client = $obj->code_client; - print '\n"; - print ''; - print ''; - - print '\n"; - - - print '\n"; - - print '\n"; - - print '\n"; - - print ''; - - print "\n"; + if ($mode == 'kanban') { + if ($i == 0) { + print ''; } } else { - print ''; + // Show line of result + $j = 0; + print ''; + + // Action column + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + print '\n"; + + print ''; + + print '\n"; + print ''; + print ''; + + print '\n"; + + + print '\n"; + + print '\n"; + + print '\n"; + + // Action column + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + print ''."\n"; } - print "
'; + $searchpicto = $form->showFilterButtons('left'); + print $searchpicto; + print '   '; $searchpicto = $form->showFilterButtons(); print $searchpicto; print '
'; - print '
'; - } - // Output Kanban - print $bon->getKanbanView('', array('selected' => in_array($bon->id, $arrayofselected))); - if ($i == ($imaxinloop - 1)) { - print '
'; - print '
'; - print $bon->getNomUrl(1); - print "'; - print $line->LibStatut($obj->statut_ligne, 2); - print " "; - print ''; - print substr('000000'.$obj->rowid_ligne, -6); - print ''; - $link_to_bill = '/compta/facture/card.php?facid='; - $link_title = 'Invoice'; - $link_picto = 'bill'; - if ($type == 'bank-transfer') { - $link_to_bill = '/fourn/facture/card.php?facid='; - $link_title = 'SupplierInvoice'; - $link_picto = 'supplier_invoice'; - } - print ''; - print img_object($langs->trans($link_title), $link_picto); - print ' '.$obj->invoiceref."'; - print $company->getNomUrl(1); - print "'; - $link_to_tab = '/comm/card.php?socid='; - $link_code = $obj->code_client; - if ($type == 'bank-transfer') { - $link_to_tab = '/fourn/card.php?socid='; - $link_code = $obj->code_fournisseur; - } - print ''.$link_code."'.dol_print_date($db->jdate($obj->datec), 'day')."'.price($obj->amount)." 
'; + print '
'; + } + // Output Kanban + 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; } - $i++; + } + print $object->getKanbanView('', array('selected' => in_array($bon->id, $arrayofselected))); + if ($i == ($imaxinloop - 1)) { + print '
'; + print '
'.$langs->trans("None").'
'; + 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 ''; + } + print ''; + print $bon->getNomUrl(1); + print "'; + print $line->LibStatut($obj->statut_ligne, 2); + print " "; + print ''; + print substr('000000'.$obj->rowid_ligne, -6); + print ''; + $link_to_bill = '/compta/facture/card.php?facid='; + $link_title = 'Invoice'; + $link_picto = 'bill'; + if ($type == 'bank-transfer') { + $link_to_bill = '/fourn/facture/card.php?facid='; + $link_title = 'SupplierInvoice'; + $link_picto = 'supplier_invoice'; + } + print ''; + print img_object($langs->trans($link_title), $link_picto); + print ' '.$obj->invoiceref."'; + print $company->getNomUrl(1); + print "'; + $link_to_tab = '/comm/card.php?socid='; + $link_code = $obj->code_client; + if ($type == 'bank-transfer') { + $link_to_tab = '/fourn/card.php?socid='; + $link_code = $obj->code_fournisseur; + } + print ''.$link_code."'.dol_print_date($db->jdate($obj->datec), 'day')."'.price($obj->amount)."'; + 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 ''; + } + print '
"; - print '
'; - - print ''; - - $db->free($result); -} else { - dol_print_error($db); + $i++; } +if ($num == 0) { + print '
'.$langs->trans("None").'
'."\n"; +print '
'."\n"; + +print ''."\n"; + + // End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/prelevement/orders_list.php b/htdocs/compta/prelevement/orders_list.php index 699dcf587ff..d9f5e7b1d19 100644 --- a/htdocs/compta/prelevement/orders_list.php +++ b/htdocs/compta/prelevement/orders_list.php @@ -32,17 +32,27 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page $langs->loadLangs(array('banks', 'categories', 'withdrawals')); +$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation +$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'directdebitcredittransferlist'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'alpha'); +$mode = GETPOST('mode', 'alpha'); $type = GETPOST('type', 'aZ09'); +// Load variable for pagination $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); -if (empty($page) || $page == -1) { +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; -} // If $page is not defined, or '' or -1 +} $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -53,10 +63,6 @@ if (!$sortfield) { $sortfield = "p.datec"; } -$optioncss = GETPOST('optioncss', 'alpha'); -$mode = GETPOST('mode', 'alpha'); - - // Get supervariables $statut = GETPOST('statut', 'int'); $search_ref = GETPOST('search_ref', 'alpha'); @@ -96,7 +102,16 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' * View */ -llxHeader('', $langs->trans("WithdrawalsReceipts")); +$directdebitorder = new BonPrelevement($db); + +$titlekey = "WithdrawalsReceipts"; +$title = $langs->trans("WithdrawalsReceipts"); +if ($type == 'bank-transfer') { + $titlekey = "BankTransferReceipts"; + $title = $langs->trans("BankTransferReceipts"); +} +$help_url = ''; + $sql = "SELECT p.rowid, p.ref, p.amount, p.statut, p.datec"; @@ -130,7 +145,7 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { dol_print_error($db); } - if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 + if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0 $page = 0; $offset = 0; } @@ -143,142 +158,252 @@ if ($limit) { $sql .= $db->plimit($limit + 1, $offset); } -$result = $db->query($sql); -if ($result) { - $num = $db->num_rows($result); - $i = 0; +$resql = $db->query($sql); +if (!$resql) { + dol_print_error($db); + exit; +} - $param = ''; - if (!empty($mode)) { - $param .= '&mode='.urlencode($mode); - } - if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { - $param .= '&contextpage='.urlencode($contextpage); - } - if ($type == 'bank-transfer') { - $param .= '&type=bank-transfer'; - } - if ($limit > 0 && $limit != $conf->liste_limit) { - $param .= '&limit='.((int) $limit); - } - $param .= "&statut=".urlencode($statut); +$num = $db->num_rows($resql); - $selectedfields = ''; +// Output page +// -------------------------------------------------------------------- - $newcardbutton = ''; - $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); - $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); - if ($usercancreate) { - $newcardbutton .= dolGetButtonTitle($langs->trans('NewStandingOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/prelevement/create.php?type='.urlencode($type)); - } +llxHeader('', $title, $help_url); - // Lines of title fields - print '
'; - print ''; - if ($optioncss != '') { - print ''; - } - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; +$arrayofselected = is_array($toselect) ? $toselect : array(); - if ($type != '') { - print ''; - } - $titlekey = "WithdrawalsReceipts"; - $title = $langs->trans("WithdrawalsReceipts"); - if ($type == 'bank-transfer') { - $titlekey = "BankTransferReceipts"; - $title = $langs->trans("BankTransferReceipts"); - } +$param = ''; +$param .= "&statut=".urlencode($statut); +if ($type == 'bank-transfer') { + $param .= '&type=bank-transfer'; +} +if (!empty($mode)) { + $param .= '&mode='.urlencode($mode); +} +if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { + $param .= '&contextpage='.urlencode($contextpage); +} +if ($limit > 0 && $limit != $conf->liste_limit) { + $param .= '&limit='.((int) $limit); +} +if ($optioncss != '') { + $param .= '&optioncss='.urlencode($optioncss); +} - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1); - $moreforfilter = ''; +print ''."\n"; +print ''; +if ($optioncss != '') { + print ''; +} +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; - print '
'; - print ''."\n"; +if ($type != '') { + print ''; +} - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; +} + +$db->free($result); + +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + +print '
  '; +$newcardbutton = ''; +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +if ($usercancreate) { + $newcardbutton .= dolGetButtonTitle($langs->trans('NewStandingOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/prelevement/create.php?type='.urlencode($type)); +} + +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1); + +$moreforfilter = ''; +/*$moreforfilter.='
'; + $moreforfilter.= $langs->trans('MyFilter') . ': '; + $moreforfilter.= '
';*/ + +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +if (empty($reshook)) { + $moreforfilter .= $hookmanager->resPrint; +} else { + $moreforfilter = $hookmanager->resPrint; +} + +if (!empty($moreforfilter)) { + print '
'; + print $moreforfilter; + $parameters = array(); + $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print '
'; +} + +$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); + +print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table +print ''."\n"; + +// Fields title search +// -------------------------------------------------------------------- +print ''; +// Action column +if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; +} +print ''; +print ''; +print ''; +print ''; +// Action column +if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; - print ''; +} +print ''."\n"; - print ''; - print_liste_field_titre($titlekey, $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder); - print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center '); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "p.amount", "", $param, '', $sortfield, $sortorder, 'right '); - print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right '); - print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'maxwidthsearch center ')."\n"; - print "\n"; +$totalarray = array(); +$totalarray['nbfield'] = 0; - $directdebitorder = new BonPrelevement($db); +// Fields title label +// -------------------------------------------------------------------- +print ''; +// Action column +if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; + $totalarray['nbfield']++; +} +print_liste_field_titre($titlekey, $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder); +$totalarray['nbfield']++; +print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center '); +$totalarray['nbfield']++; +print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "p.amount", "", $param, '', $sortfield, $sortorder, 'right '); +$totalarray['nbfield']++; +print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right '); +$totalarray['nbfield']++; +// Action column +if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; + $totalarray['nbfield']++; +} +print ''."\n"; - if ($num) { - while ($i < min($num, $limit)) { - $obj = $db->fetch_object($result); +// Loop on record +// -------------------------------------------------------------------- - $directdebitorder->id = $obj->rowid; - $directdebitorder->ref = $obj->ref; - $directdebitorder->date_echeance = $obj->datec; - $directdebitorder->total = $obj->amount; - $directdebitorder->statut = $obj->statut; +$i = 0; +$savnbfield = $totalarray['nbfield']; +$totalarray = array(); +$totalarray['nbfield'] = 0; - if ($mode == 'kanban') { - if ($i == 0) { - print ''; - } - } else { - print ''; +$imaxinloop = ($limit ? min($num, $limit) : $num); +while ($i < $imaxinloop) { + $obj = $db->fetch_object($resql); - print '\n"; + $directdebitorder->id = $obj->rowid; + $directdebitorder->ref = $obj->ref; + $directdebitorder->date_echeance = $obj->datec; + $directdebitorder->total = $obj->amount; + $directdebitorder->statut = $obj->statut; - print '\n"; + $object = $directdebitorder; - print '\n"; - - print ''; - - print ''."\n"; - - print "\n"; + if ($mode == 'kanban') { + if ($i == 0) { + print ''; } } else { - print ''; + // Show line of result + $j = 0; + print ''; + + // Action column + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + print '\n"; + + print '\n"; + + print '\n"; + + print ''; + + // Action column + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + print ''."\n"; } - - print "
'; + $searchpicto = $form->showFilterButtons('left'); + print $searchpicto; + print '  '; $searchpicto = $form->showFilterButtons(); print $searchpicto; print '
'; - print '
'; - } - // Output Kanban - print $directdebitorder->getKanbanView('', array('selected' => in_array($obj->id, $arrayofselected))); - if ($i == (min($num, $limit) - 1)) { - print '
'; - print '
'; - print $directdebitorder->getNomUrl(1); - print "'.dol_print_date($db->jdate($obj->datec), 'day')."'.price($obj->amount)."'; - print $bon->LibStatut($obj->statut, 5); - print '
'; + print '
'; + } + // Output Kanban + 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; } - $i++; + } + print $directdebitorder->getKanbanView('', array('selected' => in_array($obj->id, $arrayofselected))); + if ($i == ($imaxinloop - 1)) { + print '
'; + print '
'.$langs->trans("None").'
'; + 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 ''; + } + print ''; + print $directdebitorder->getNomUrl(1); + print "'.dol_print_date($db->jdate($obj->datec), 'day')."'.price($obj->amount)."'; + print $bon->LibStatut($obj->statut, 5); + print ''; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($object->id, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print '
"; - print '
'; - - print ''; - - $db->free($result); -} else { - dol_print_error($db); + $i++; } +if ($num == 0) { + print '
'.$langs->trans("None").'
'."\n"; +print '
'."\n"; + +print ''."\n"; + + // End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index 32c0ce58587..3d515a81609 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -118,23 +118,30 @@ if ($resql) { while ($i < $num) { $row = $db->fetch_row($resql); - print ''; + print ''; + print ''; print $ligne->LibStatut($row[2], 1); //print $st[$row[2]]; - print ''; + print ''; + + print ''; print $row[1]; + print ''; - print ''; + print ''; print round($row[1] / $nbtotal * 100, 2)." %"; + print ''; - print ''; - + print ''; print price($row[0]); + print ''; - print ''; + print ''; print round($row[0] / $total * 100, 2)." %"; - print ''; + print ''; + + print ''; $i++; } diff --git a/htdocs/core/boxes/box_members_by_tags.php b/htdocs/core/boxes/box_members_by_tags.php index c4f192e7490..e9404254b0a 100644 --- a/htdocs/core/boxes/box_members_by_tags.php +++ b/htdocs/core/boxes/box_members_by_tags.php @@ -160,7 +160,7 @@ class box_members_by_tags extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"', - 'text' => ''.dol_trunc(($adhtag->ref ? $adhtag->ref : $adhtag->label), dol_size(32)).'', + 'text' => ''.dol_trunc(($adhtag->ref ? $adhtag->ref : $adhtag->label), dol_size(32)).'', 'asis' => 1, ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 03f6d40ced0..417ad2db365 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1766,7 +1766,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '', $text = 'Valu } print ''; //print 'http://lists.example.com/cgi-bin/mailman/admin/%LISTE%/members/remove?adminpw=%MAILMAN_ADMINPW%&unsubscribees=%EMAIL%'; - } elseif ($const == 'ADHERENT_MAIL_FROM') { + } elseif (in_array($const, ['ADHERENT_MAIL_FROM', 'ADHERENT_CC_MAIL_FROM'])) { print ' '.img_help(1, $langs->trans("EMailHelpMsgSPFDKIM")); } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 1410b9fe9f9..3238ea875d7 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -3621,7 +3621,7 @@ if ($action == 'create') { print ' :'; print ''.price($obj->amount_ttc).''; print ''; - print 'rowid.'">'.img_delete().''; + print 'rowid.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; print ''; $i++; if ($invoice->type == FactureFournisseur::TYPE_CREDIT_NOTE) { diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index ba800994837..228460c4d2b 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -162,6 +162,7 @@ DescADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION=Email template to use to send emai DescADHERENT_EMAIL_TEMPLATE_CANCELATION=Email template to use to send email to a member on member cancelation DescADHERENT_EMAIL_TEMPLATE_EXCLUSION=Email template to use to send email to a member on member exclusion DescADHERENT_MAIL_FROM=Sender Email for automatic emails +DescADHERENT_CC_MAIL_FROM=Send automatic email copy to DescADHERENT_ETIQUETTE_TYPE=Format of labels page DescADHERENT_ETIQUETTE_TEXT=Text printed on member address sheets DescADHERENT_CARD_TYPE=Format of cards page diff --git a/htdocs/langs/fr_FR/members.lang b/htdocs/langs/fr_FR/members.lang index 1d27ca89964..5f9dea36700 100644 --- a/htdocs/langs/fr_FR/members.lang +++ b/htdocs/langs/fr_FR/members.lang @@ -158,6 +158,7 @@ DescADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION=Modèle d'email électronique à u DescADHERENT_EMAIL_TEMPLATE_CANCELATION=Modèle d'email utilisé pour envoyer un email à un adhérent lors de l'annulation d'adhésion DescADHERENT_EMAIL_TEMPLATE_EXCLUSION=Modèle de courriel à utiliser pour envoyer un courriel à un adhérent lors de son exclusion DescADHERENT_MAIL_FROM=Email émetteur pour les mails automatiques +DescADHERENT_CC_MAIL_FROM=Email en copie des mails automatiques DescADHERENT_ETIQUETTE_TYPE=Format pages étiquettes DescADHERENT_ETIQUETTE_TEXT=Texte imprimé sur les planches d'adresses adhérent DescADHERENT_CARD_TYPE=Format pages cartes d'adhérent diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index b1bee9165c5..858b7846906 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -6,7 +6,7 @@ * Copyright (C) 2016 Francis Appels * Copyright (C) 2021 Noé Cendrier * Copyright (C) 2021 Frédéric France - * Copyright (C) 2022 Charlene Benke + * Copyright (C) 2022-2023 Charlene Benke * * 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 @@ -56,6 +56,8 @@ $id = GETPOST('id', 'int'); $socid = GETPOST('socid', 'int'); $ref = GETPOST('ref', 'alpha'); +// Load variable for pagination +$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); if (!$sortfield) { @@ -632,6 +634,8 @@ if ($action == 'create') { print_liste_field_titre("EstimatedStockValueShort", "", "", "&id=".$id, "", '', $sortfield, $sortorder, 'right '); $totalarray['nbfield']++; $totalarray['pos'][$totalarray['nbfield']] = 'totalvalue'; + $totalarray['type'][$totalarray['nbfield']] = ''; + if (empty($conf->global->PRODUIT_MULTIPRICES)) { print_liste_field_titre("SellPriceMin", "", "p.price", "&id=".$id, "", '', $sortfield, $sortorder, 'right '); @@ -641,6 +645,8 @@ if ($action == 'create') { print_liste_field_titre("EstimatedStockValueSellShort", "", "", "&id=".$id, "", '', $sortfield, $sortorder, 'right '); $totalarray['nbfield']++; $totalarray['pos'][$totalarray['nbfield']] = 'totalvaluesell'; + $totalarray['type'][$totalarray['nbfield']] = ''; + } if ($user->rights->stock->mouvement->creer) { print_liste_field_titre('');