diff --git a/dev/skeletons/skeleton_list.php b/dev/skeletons/skeleton_list.php index f571af9873e..c064c74b0ac 100644 --- a/dev/skeletons/skeleton_list.php +++ b/dev/skeletons/skeleton_list.php @@ -243,7 +243,7 @@ $sql.=$db->order($sortfield,$sortorder); //$sql.= $db->plimit($conf->liste_limit+1, $offset); // Count total nb of records -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 3edda4f8587..47dcce5031b 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -172,7 +172,7 @@ if (strlen(trim($search_pcgsubtype))) { $sql .= $db->order($sortfield, $sortorder); // Count total nb of records -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $resql = $db->query($sql); diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 4127f5e4ee2..c5a1bffc694 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -90,7 +90,7 @@ $sql .= " WHERE f.entity = " . $conf->entity; $sql.=$db->order($sortfield,$sortorder); // Count total nb of records -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 1cb37e92baa..69d0fdc7f94 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -248,7 +248,7 @@ if (strlen(trim($search_desc))) { } $sql .= $db->order($sortfield, $sortorder); -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 79d642ffcef..557f786b4b8 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -65,14 +65,6 @@ $formventilation = new FormVentilation($db); $formother = new FormOther($db); $form = new Form($db); -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers -{ - $search_accountancy_code_start = ''; - $search_accountancy_code_end = ''; - $search_date_start = ''; - $search_date_end = ''; -} - if (empty($search_date_start)) { $search_date_start = dol_mktime(0, 0, 0, 1, 1, dol_print_date(dol_now(), '%Y')); $search_date_end = dol_mktime(0, 0, 0, 12, 31, dol_print_date(dol_now(), '%Y')); @@ -106,6 +98,19 @@ if (! empty($search_accountancy_code_end)) { * Action */ +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +{ + $search_accountancy_code_start = ''; + $search_accountancy_code_end = ''; + $search_date_start = ''; + $search_date_end = ''; +} + + +/* + * View + */ + if ($action == 'export_csv') { $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; $journal = 'bookkepping'; @@ -132,155 +137,148 @@ if ($action == 'export_csv') { } else { + $title_page = $langs->trans("AccountBalance") . ' ' . dol_print_date($search_date_start) . '-' . dol_print_date($search_date_end); + + llxHeader('', $title_page); + + // List - $title_page = $langs->trans("AccountBalance") . ' ' . dol_print_date($search_date_start) . '-' . dol_print_date($search_date_end); - - llxHeader('', $title_page); - - /* - * List - */ - $nbtotalofrecords = 0; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $nbtotalofrecords = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter); - if ($nbtotalofrecords < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } - } - - $result = $object->fetchAllBalance($sortorder, $sortfield, $limit, $offset, $filter); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } - - print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, '', $result, 0, 'title_accountancy'); - - print '
'; - print '
' . "\n"; - print '
'; - print '
'; - - $moreforfilter=''; - - $moreforfilter.='
'; - $moreforfilter.=$langs->trans('DateStart') . ': '; - $moreforfilter.=$form->select_date($search_date_start, 'date_start', 0, 0, 1, '', 1, 0, 1); - $moreforfilter.=$langs->trans('DateEnd') . ': '; - $moreforfilter.=$form->select_date($search_date_end, 'date_end', 0, 0, 1, '', 1, 0, 1); - $moreforfilter.='
'; - - if (! empty($moreforfilter)) - { - print '
'; - print $moreforfilter; - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - print '
'; - } - - print ''; - print ''; - print_liste_field_titre($langs->trans("AccountAccounting"), $_SERVER['PHP_SELF'], "t.numero_compte", "", $options, "", $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Labelcompte"), $_SERVER['PHP_SELF'], "t.label_compte", "", $options, "", $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Solde"), $_SERVER["PHP_SELF"], "", $options, "", 'align="right"', $sortfield, $sortorder); - print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder); - print "\n"; - - print ''; - print ''; - - print ''; - print ''; - print ''; - - print ''; - - print ''; - - $var = True; - - $total_debit = 0; - $total_credit = 0; - $sous_total_debit = 0; - $sous_total_credit = 0; - $displayed_account = ""; - - foreach ( $object->lines as $line ) { - $var = ! $var; - $link = ''; - $total_debit += $line->debit; - $total_credit += $line->credit; - $description = $object->get_compte_desc($line->numero_compte); // Search description of the account - $root_account_description = $object->get_compte_racine($line->numero_compte); - if(empty($description)){ - $link = '' . img_edit_add() .''; - } - print ''; - - - // Permet d'afficher le compte comptable - if ($root_account_description != $displayed_account) { - - // Affiche un Sous-Total par compte comptable - if ($displayed_account != "") { - print ''; - print "\n"; - print ''; - } - - // Affiche le compte comptable en d�but de ligne - print ""; - print ''; - print ''; - - $displayed_account = $root_account_description; - $sous_total_debit = 0; - $sous_total_credit = 0; + $nbtotalofrecords = -1; + if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + $nbtotalofrecords = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter); + if ($nbtotalofrecords < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } } - - // $object->get_compte_racine($line->numero_compte); - - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - - // Comptabilise le sous-total - $sous_total_debit += $line->debit; - $sous_total_credit += $line->credit; - - } - - print ''; - print "\n"; - print ''; - - print ''; - print "\n"; - print ''; - - - print "
'; - print $langs->trans('From'); - print $formventilation->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, ''); - print '
'; - print $langs->trans('to'); - print $formventilation->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array (), 1, 1, ''); - print '
   '; - print ''; - print ' '; - print ''; - print '
'.$langs->trans("SubTotal") . ':'.price($sous_total_debit).''.price($sous_total_credit).''.price($sous_total_credit-$sous_total_debit).' 
'. $root_account_description .'
' . length_accountg($line->numero_compte) . '' . $description . '' . number_format($line->debit, 2, ',', ' ') . '' . number_format($line->credit, 2, ',', ' ') . '' . number_format($line->credit - $line->debit, 2, ',', ' ') . '' . $link; - print '
'.$langs->trans("SubTotal") . ':'.price($sous_total_debit).''.price($sous_total_credit).''.price($sous_total_credit-$sous_total_debit).' 
'.$langs->trans("AccountBalance") . ':'.price($total_debit).''.price($total_credit).''.price($total_credit-$total_debit).' 
"; - print '
'; - - llxFooter(); + + $result = $object->fetchAllBalance($sortorder, $sortfield, $limit, $offset, $filter); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + + + print '
'; + + $button = ''; + print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, '', $result, 0, 'title_accountancy', 0, $button); + + + $moreforfilter = ''; + + $moreforfilter .= '
'; + $moreforfilter .= $langs->trans('DateStart') . ': '; + $moreforfilter .= $form->select_date($search_date_start, 'date_start', 0, 0, 1, '', 1, 0, 1); + $moreforfilter .= $langs->trans('DateEnd') . ': '; + $moreforfilter .= $form->select_date($search_date_end, 'date_end', 0, 0, 1, '', 1, 0, 1); + $moreforfilter .= '
'; + + if (! empty($moreforfilter)) { + print '
'; + print $moreforfilter; + $parameters = array(); + $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print '
'; + } + + print ''; + print ''; + print_liste_field_titre($langs->trans("AccountAccounting"), $_SERVER['PHP_SELF'], "t.numero_compte", "", $options, "", $sortfield, $sortorder); + print_liste_field_titre($langs->trans("Labelcompte"), $_SERVER['PHP_SELF'], "t.label_compte", "", $options, "", $sortfield, $sortorder); + print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre($langs->trans("Solde"), $_SERVER["PHP_SELF"], "", $options, "", 'align="right"', $sortfield, $sortorder); + print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder); + print "\n"; + + print ''; + print ''; + + print ''; + print ''; + print ''; + + print ''; + + print ''; + + $var = True; + + $total_debit = 0; + $total_credit = 0; + $sous_total_debit = 0; + $sous_total_credit = 0; + $displayed_account = ""; + + foreach ($object->lines as $line) { + $var = ! $var; + $link = ''; + $total_debit += $line->debit; + $total_credit += $line->credit; + $description = $object->get_compte_desc($line->numero_compte); // Search description of the account + $root_account_description = $object->get_compte_racine($line->numero_compte); + if (empty($description)) { + $link = '' . img_edit_add() . ''; + } + print ''; + + // Permet d'afficher le compte comptable + if ($root_account_description != $displayed_account) { + + // Affiche un Sous-Total par compte comptable + if ($displayed_account != "") { + print ''; + print "\n"; + print ''; + } + + // Affiche le compte comptable en d�but de ligne + print ""; + print ''; + print ''; + + $displayed_account = $root_account_description; + $sous_total_debit = 0; + $sous_total_credit = 0; + } + + // $object->get_compte_racine($line->numero_compte); + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + + // Comptabilise le sous-total + $sous_total_debit += $line->debit; + $sous_total_credit += $line->credit; + } + + print ''; + print "\n"; + print ''; + + print ''; + print "\n"; + print ''; + + print "
'; + print $langs->trans('From'); + print $formventilation->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array(), 1, 1, ''); + print '
'; + print $langs->trans('to'); + print $formventilation->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, ''); + print '
   '; + print ''; + print ' '; + print ''; + print '
' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price($sous_total_credit - $sous_total_debit) . ' 
' . $root_account_description . '
' . length_accountg($line->numero_compte) . '' . $description . '' . number_format($line->debit, 2, ',', ' ') . '' . number_format($line->credit, 2, ',', ' ') . '' . number_format($line->credit - $line->debit, 2, ',', ' ') . '' . $link; + print '
' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price($sous_total_credit - $sous_total_debit) . ' 
' . $langs->trans("AccountBalance") . ':' . price($total_debit) . '' . price($total_credit) . '' . price($total_credit - $total_debit) . ' 
"; + print '
'; + + llxFooter(); } $db->close(); \ No newline at end of file diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index a650100918e..f60b1584455 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -288,12 +288,12 @@ if ($action == 'export_csv') { } $title_page = $langs->trans("Bookkeeping"); -if ($search_date_start || $search_date_end) $title_page .= ' ' . dol_print_date($search_date_start, 'day') . ' - ' . dol_print_date($search_date_end, 'day'); + llxHeader('', $title_page); // List -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter); if ($nbtotalofrecords < 0) { @@ -356,20 +356,21 @@ print ''; print ''; -print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $result, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); +$button = ''; +if (count($filter)) $button.= $langs->trans("ExportFilteredList"); +else $button.= $langs->trans("ExportList"); +$button.= ''; + +$groupby = ' ' . $langs->trans("GroupByAccountAccounting") . ''; + +print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, $groupby, '', $limit); print '
' . "\n"; print '
' . $langs->trans("NewAccountingMvt") . '
'; -print '
'; -if (count($filter)) print $langs->trans("ExportFilteredList"); -else print $langs->trans("ExportList"); -print '
'; print '
' . $langs->trans("DelBookKeeping") . '
'; print '
'; -print ' ' . $langs->trans("GroupByAccountAccounting") . '

'; - print ''; print ''; print_liste_field_titre($langs->trans("TransactionNumShort"), $_SERVER['PHP_SELF'], "t.piece_num", "", $param, "", $sortfield, $sortorder); diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 9d8c7429964..6308c2d3edc 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -156,13 +156,13 @@ if ($action == 'delmouvconfirm') { * View */ -$title_page = $langs->trans("Bookkeeping") . ' ' . strtolower($langs->trans("By")) . ' ' . $langs->trans("AccountAccounting") . ' ' . dol_print_date($search_date_start) . '-' . dol_print_date($search_date_end); +$title_page = $langs->trans("Bookkeeping") . ' ' . strtolower($langs->trans("By")) . ' ' . $langs->trans("AccountAccounting"); llxHeader('', $title_page); // List -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $nbtotalofrecords = $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter); if ($nbtotalofrecords < 0) { @@ -207,7 +207,9 @@ if ($action == 'delbookkeepingyear') { print ''; -print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, '', $result, $nbtotalofrecords,'title_accountancy',0,'','',$limit); +$viewflat = ' ' . $langs->trans("ViewFlatList") . ''; + +print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, '', $result, $nbtotalofrecords,'title_accountancy',0,$viewflat,'',$limit); // Reverse sort order if ( preg_match('/^asc/i', $sortorder) ) @@ -219,8 +221,6 @@ print '
' . "\n"; print '
' . $langs->trans("NewAccountingMvt") . '
'; print '
'; -print ' ' . $langs->trans("ViewFlatList") . '

'; - print '
'; print ''; print ''; @@ -331,14 +331,15 @@ foreach ( $object->lines as $line ) { } // Affiche un Sous-Total du dernier compte comptable affiché -print ''; +print ''; +print ''; print "\n"; print ''; // Affiche le Total print ''; -print ''; +print ''; print ''; diff --git a/htdocs/accountancy/bookkeeping/listbyyear.php b/htdocs/accountancy/bookkeeping/listbyyear.php index d8df8eb5007..b607d055a7a 100644 --- a/htdocs/accountancy/bookkeeping/listbyyear.php +++ b/htdocs/accountancy/bookkeeping/listbyyear.php @@ -158,7 +158,7 @@ if (! empty($search_code_journal)) { * Mode List */ -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0); if ($nbtotalofrecords < 0) { diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index b63d7ce2fda..9749e38007f 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -60,10 +60,10 @@ class AccountingAccount extends CommonObject /** * Load record in memory * - * @param int $rowid Id - * @param string $account_number Account number - * @param int $limittocurrentchart 1=Do not load record if it is into another accounting system - * @return int <0 if KO, >0 if OK + * @param int $rowid Id + * @param string $account_number Account number + * @param int $limittocurrentchart 1=Do not load record if it is into another accounting system + * @return int <0 if KO, Id of record if OK and found */ function fetch($rowid = null, $account_number = null, $limittocurrentchart = 0) { global $conf; diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index b133e505d5c..7882c3b9320 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -200,7 +200,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't sha $sql .= $db->order($sortfield, $sortorder); // Count total nb of records -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 83a01abadc3..7f214ffdf3c 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -215,7 +215,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't sha $sql .= $db->order($sortfield, $sortorder); // Count total nb of records -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index 5ac3f5b7a01..8c47627f2f7 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -178,7 +178,7 @@ $sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don' $sql .= $db->order($sortfield, $sortorder); // Count total nb of records -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 0d058ffc402..396095eee5a 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -208,7 +208,7 @@ $sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don' $sql .= $db->order($sortfield, $sortorder); // Count total nb of records -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/accountancy/report/result.php b/htdocs/accountancy/report/result.php index 0031fa3c3b4..e31e1c92f17 100644 --- a/htdocs/accountancy/report/result.php +++ b/htdocs/accountancy/report/result.php @@ -75,9 +75,12 @@ $form = new Form($db); $textprevyear = '' . img_previous() . ''; $textnextyear = ' ' . img_next() . ''; -print load_fiche_titre($langs->trans('ReportInOut') . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear, '', 'title_accountancy'); +print load_fiche_titre($langs->trans('ReportInOut'), $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear, 'title_accountancy'); -print '
' . $langs->trans("AccountAccounting") . '
'.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).'
'.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).' 
'.$langs->trans("Total").':'.$langs->trans("Total").':'; print price($total_debit); print '
'; +$moreforfilter=''; + +print '
'; +print '
'."\n"; $months = array( $langs->trans("JanuaryMin"), $langs->trans("FebruaryMin"), @@ -93,7 +96,8 @@ $months = array( $langs->trans("JanuaryMin"), $langs->trans("DecemberMin"), ); -print ''; +print ''; +print ''; print ''; print ''; print ''; @@ -257,6 +261,7 @@ if (!empty($cats)) } print "
'.$langs->trans("Account").'
'.$langs->trans("Account").''.$langs->trans("Description").'N-1'.$langs->trans("NReal").'
"; +print ''; llxFooter(); $db->close(); \ No newline at end of file diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 41d62a60f22..d4428dbcb1a 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -182,7 +182,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't $sql .= $db->order($sortfield, $sortorder); // Count total nb of records -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 2bbc150428b..2f19ff0bc75 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -217,7 +217,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't $sql .= $db->order($sortfield, $sortorder); // Count total nb of records -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 33925e8d130..77519b0e570 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -250,7 +250,7 @@ $sql.=$hookmanager->resPrint; $sql.= $db->order($sortfield,$sortorder); // Count total nb of records with no order and no limits -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $resql = $db->query($sql); diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 5ab73082a96..078eb1e0e6f 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -110,7 +110,7 @@ if ($search_account > 0) $sql.= " AND b.fk_account = ".$search_account; if ($search_amount) $sql.= natural_search('c.subscription', $search_amount, 1); $sql.= $db->order($sortfield,$sortorder); -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 155656e92eb..3bbccd2693a 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -414,7 +414,7 @@ if ($rowid > 0) $sql.=" AND datefin < '".$db->idate($now)."'"; } // Count total nb of records - $nbtotalofrecords = 0; + $nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $resql = $db->query($sql); diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 3cb111c4d53..54990b45913 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -46,27 +46,27 @@ if (!$user->admin) accessforbidden(); $modules = array( 'SOCIETE' => 'FCKeditorForCompany', 'PRODUCTDESC' => 'FCKeditorForProduct', -'MAILING' => 'FCKeditorForMailing', 'DETAILS' => 'FCKeditorForProductDetails', 'USERSIGN' => 'FCKeditorForUserSignature', +'MAILING' => 'FCKeditorForMailing', 'MAIL' => 'FCKeditorForMail' ); // Conditions pour que l'option soit proposee $conditions = array( 'SOCIETE' => 1, 'PRODUCTDESC' => (! empty($conf->product->enabled) || ! empty($conf->service->enabled)), -'MAILING' => ! empty($conf->mailing->enabled), 'DETAILS' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled) || ! empty($conf->supplier_proposal->enabled) || ! empty($conf->fournisseur->enabled)), 'USERSIGN' => 1, +'MAILING' => ! empty($conf->mailing->enabled), 'MAIL' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled)) ); // Picto $picto = array( 'SOCIETE' => 'generic', 'PRODUCTDESC' => 'product', -'MAILING' => 'email', -'DETAILS' => 'generic', +'DETAILS' => 'product', 'USERSIGN' => 'user', +'MAILING' => 'email', 'MAIL' => 'email' ); diff --git a/htdocs/cache.manifest b/htdocs/cache.manifest index 9119290941b..a3d1b1c554f 100644 --- a/htdocs/cache.manifest +++ b/htdocs/cache.manifest @@ -33,5 +33,5 @@ NETWORK: # If the browser is unable to retrieve the original content, the fallback resource will be used. # In the example above, we display a static image in case the dynamic one is unavailable. FALLBACK: -#/ public/offline.php -#theme/amarok/img/* theme/eldy/img/ +#/ public/notice.php +#theme/eldy/img/* theme/md/img/* diff --git a/htdocs/categories/class/api_categories.class.php b/htdocs/categories/class/api_categories.class.php index e6743546b2f..471c6b2fdde 100644 --- a/htdocs/categories/class/api_categories.class.php +++ b/htdocs/categories/class/api_categories.class.php @@ -209,7 +209,7 @@ class Categories extends DolibarrApi $sql.= ' AND s.rowid = sub.fk_categorie'; $sql.= ' AND sub.'.$subcol_name.' = '.$item; - $nbtotalofrecords = 0; + $nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/categories/class/api_deprecated_category.class.php b/htdocs/categories/class/api_deprecated_category.class.php index 7bff4d16082..2cb25b70779 100644 --- a/htdocs/categories/class/api_deprecated_category.class.php +++ b/htdocs/categories/class/api_deprecated_category.class.php @@ -124,7 +124,7 @@ class CategoryApi extends DolibarrApi $sql.= ' WHERE s.entity IN ('.getEntity('category', 1).')'; $sql.= ' AND s.type='.array_search($type,CategoryApi::$TYPES); - $nbtotalofrecords = 0; + $nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); @@ -205,7 +205,7 @@ class CategoryApi extends DolibarrApi $sql.= ' AND s.rowid = sub.fk_categorie'; $sql.= ' AND sub.'.$subcol_name.' = '.$item; - $nbtotalofrecords = 0; + $nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index e0ccf854b89..1584e28bad9 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -245,7 +245,7 @@ if ($datestart > 0) $sql.= " AND a.datep BETWEEN '".$db->idate($datestart)."' AN if ($dateend > 0) $sql.= " AND a.datep2 BETWEEN '".$db->idate($dateend)."' AND '".$db->idate($dateend+3600*24-1)."'"; $sql.= $db->order($sortfield,$sortorder); -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index 95c2874150a..fdc94005cdb 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -85,7 +85,7 @@ $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')'; $sql.= " GROUP BY year, month, df"; $sql.= " ORDER BY year DESC, month DESC, df DESC"; -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index e9883a78ec7..3c2608b8088 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -592,7 +592,7 @@ if ($id > 0) $propal_static->total_tva = $objp->total_tva; $propal_static->total_ttc = $objp->total_ttc; print $propal_static->getNomUrl(1); - if ( ($db->jdate($objp->dp) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1 ) { + if ( ($db->jdate($objp->datelimite) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1 ) { print " ".img_warning(); } print ''.dol_print_date($db->jdate($objp->dp),'day')."\n"; diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index e22b8538a66..ab7ee3c7c8a 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -412,7 +412,7 @@ if ($object->fetch($id) >= 0) $sql .= $db->order($sortfield,$sortorder); // Count total nb of records - $nbtotalofrecords = 0; + $nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index bd52652d9c5..cdcedf9bbcc 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -333,7 +333,7 @@ $sql.= $db->order($sortfield,$sortorder); $sql.=', p.ref DESC'; // Count total nb of records -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/commande/class/api_deprecated_commande.class.php b/htdocs/commande/class/api_deprecated_commande.class.php index 16e37cc6235..b0b22764ec7 100644 --- a/htdocs/commande/class/api_deprecated_commande.class.php +++ b/htdocs/commande/class/api_deprecated_commande.class.php @@ -138,7 +138,7 @@ class CommandeApi extends DolibarrApi $sql .= " AND sc.fk_user = ".$search_sale; } - $nbtotalofrecords = 0; + $nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 2fd7b4822ef..0262187b342 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -560,7 +560,7 @@ $sql.=$hookmanager->resPrint; $sql.= $db->order($sortfield,$sortorder); // Count total nb of records -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/compta/bank/bankentries.php b/htdocs/compta/bank/bankentries.php index 49113ed7d58..189fbaa188f 100644 --- a/htdocs/compta/bank/bankentries.php +++ b/htdocs/compta/bank/bankentries.php @@ -501,7 +501,7 @@ $sql.=$hookmanager->resPrint; $sql.= $db->order($sortfield,$sortorder); -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; $nbtotalofpages = 0; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index 51cb5c636fd..b3c9a903028 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -175,7 +175,7 @@ $sql.=$hookmanager->resPrint; $sql.= $db->order($sortfield,$sortorder); // Count total nb of records -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/compta/facture/class/api_deprecated_invoice.class.php b/htdocs/compta/facture/class/api_deprecated_invoice.class.php index 0b2949ca9bb..a2706b3150f 100644 --- a/htdocs/compta/facture/class/api_deprecated_invoice.class.php +++ b/htdocs/compta/facture/class/api_deprecated_invoice.class.php @@ -137,7 +137,7 @@ class InvoiceApi extends DolibarrApi $sql .= " AND sc.fk_user = ".$search_sale; } - $nbtotalofrecords = 0; + $nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 51295cd0cf1..fccb1d00106 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -1555,7 +1555,7 @@ else $sql.= " AND f.date_when BETWEEN '".$db->idate(dol_get_first_day($year_date_when,1,false))."' AND '".$db->idate(dol_get_last_day($year_date_when,12,false))."'"; } - $nbtotalofrecords = 0; + $nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index ea012cb3672..0e2ac88fe83 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -401,7 +401,7 @@ $listfield=explode(',',$sortfield); foreach ($listfield as $key => $value) $sql.= $listfield[$key].' '.$sortorder.','; $sql.= ' f.rowid DESC '; -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index df507490aec..8fd4eee5339 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -112,7 +112,7 @@ else if ($year > 0) } $sql.= $db->order($sortfield,$sortorder); -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 9495b56e90b..f55d5917750 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -186,7 +186,7 @@ else } $sql.= $db->order($sortfield,$sortorder); -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 8c21bf32ceb..79401b57798 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -2,6 +2,7 @@ /* Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2016 Frédéric France + * Copyright (C) 2016 Alexandre Spangaro * * 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 @@ -72,6 +73,14 @@ if ($action == 'reopen' && $user->rights->tax->charges->creer) { } } +if ($action == 'setlib' && $user->rights->tax->charges->creer) +{ + $object->fetch($id); + $result = $object->setValueFrom('libelle', GETPOST('lib'), '', '', 'text', '', $user, 'TAX_MODIFY'); + if ($result < 0) + setEventMessages($object->error, $object->errors, 'errors'); +} + // payment mode if ($action == 'setmode' && $user->rights->tax->charges->creer) { $object->fetch($id); @@ -278,14 +287,16 @@ if ($action == 'create') dol_fiche_head(); print ''; - print ""; + // Label - print '"; + print ''; - print ''; + print ''; print ''; print ''; + // Type print ''; print ''; + // Date end period print ''; print ''; print ''; + // Amount print ''; print ''; print ''; print ''; + // Payment Mode print ''; + // Bank Account if (! empty($conf->banque->enabled)) { @@ -321,6 +336,7 @@ if ($action == 'create') $form->select_comptes($fk_account, 'fk_account', 0, '', 1); print ''; } + // Date due print ''; print '
'; + print "
'; print $langs->trans("Label"); print '
'; print $langs->trans("Type"); @@ -294,6 +305,7 @@ if ($action == 'create') $formsocialcontrib->select_type_socialcontrib(GETPOST("actioncode")?GETPOST("actioncode"):'','actioncode',1); print '
'; @@ -303,6 +315,7 @@ if ($action == 'create') print $form->select_date(! empty($dateperiod)?$dateperiod:'-1', 'period', 0, 0, 0, 'charge', 1); print '
'; @@ -310,10 +323,12 @@ if ($action == 'create') print '
' . $langs->trans('PaymentMode') . ''; $form->select_types_paiements($mode_reglement_id, 'mode_reglement_id'); print '
'; @@ -337,7 +353,9 @@ if ($action == 'create') print '
'; print ''; - print '
'; + print '     '; + print ''; + print '
'; print ''; } @@ -356,6 +374,8 @@ if ($id > 0) { $head=tax_prepare_head($object); + $totalpaye = $object->getSommePaiement(); + // Clone confirmation if ($action === 'clone') { @@ -386,101 +406,47 @@ if ($id > 0) print ''; } - dol_fiche_head($head, 'card', $langs->trans("SocialContribution"),0,'bill'); + + $morehtmlref='
'; + // Ref customer + $morehtmlref.=$form->editfieldkey("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1); + $morehtmlref.='
'; + + $linkback = '' . $langs->trans("BackToList") . ''; + + $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright); + + print '
'; + print '
'; + print '
'; print ''; - $linkback = '' . $langs->trans("BackToList") . ''; - + /* // Ref - print '"; + */ // Label - if ($action == 'edit') + /*if ($action == 'edit') { - print ''; } else { print ''; - } - + }*/ + // Type print ""; - - $rowspan=6; - if (! empty($conf->banque->enabled)) $rowspan++; - print '"; - print ""; // Period end date @@ -555,13 +521,85 @@ if ($id > 0) } // Status - print ''; + //print ''; print '
'.$langs->trans("Ref").''; + print '
'.$langs->trans("Ref").''; print $form->showrefnav($object,'id',$linkback); print "
'.$langs->trans("Label").''; + print '
'.$langs->trans("Label").''; print ''; print '
'.$langs->trans("Label").''.$object->lib.'
".$langs->trans("Type")."".$object->type_libelle."'; - - /* - * Payments - */ - $sql = "SELECT p.rowid, p.num_paiement, datep as dp, p.amount,"; - $sql.= "c.code as type_code,c.libelle as paiement_type"; - $sql.= " FROM ".MAIN_DB_PREFIX."paiementcharge as p"; - $sql.= ", ".MAIN_DB_PREFIX."c_paiement as c "; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql.= " WHERE p.fk_charge = ".$id; - $sql.= " AND p.fk_charge = cs.rowid"; - $sql.= " AND cs.entity = ".$conf->entity; - $sql.= " AND p.fk_typepaiement = c.id"; - $sql.= " ORDER BY dp DESC"; - - //print $sql; - $resql = $db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); - $i = 0; $total = 0; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - $var=True; - while ($i < $num) - { - $objp = $db->fetch_object($resql); - $var=!$var; - print "'; - print '\n"; - $labeltype=$langs->trans("PaymentType".$objp->type_code)!=("PaymentType".$objp->type_code)?$langs->trans("PaymentType".$objp->type_code):$objp->paiement_type; - print "\n"; - print '\n"; - print ""; - $totalpaye += $objp->amount; - $i++; - } - - if ($object->paye == 0) - { - print "\n"; - print "\n"; - - $resteapayer = $object->amount - $totalpaye; - - print ""; - print "\n"; - } - print "
'.$langs->trans("RefPayment").''.$langs->trans("Date").''.$langs->trans("Type").''.$langs->trans("Amount").' 
"; - print ''.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.''.dol_print_date($db->jdate($objp->dp),'day')."".$labeltype.' '.$objp->num_paiement."'.price($objp->amount)." ".$langs->trans("Currency".$conf->currency)."
".$langs->trans("AlreadyPaid")." :".price($totalpaye)." ".$langs->trans("Currency".$conf->currency)."
".$langs->trans("AmountExpected")." :".price($object->amount)." ".$langs->trans("Currency".$conf->currency)."
".$langs->trans("RemainderToPay")." :".price($resteapayer)." ".$langs->trans("Currency".$conf->currency)."
"; - $db->free($resql); - } - else - { - dol_print_error($db); - } - print "
'.$langs->trans("Status").''.$object->getLibStatut(4, $totalpaye).'
'.$langs->trans("Status").''.$object->getLibStatut(4, $totalpaye).'
'; + print '
'; + print '
'; + print '
'; + + /* + * Payments + */ + $sql = "SELECT p.rowid, p.num_paiement, datep as dp, p.amount,"; + $sql.= "c.code as type_code,c.libelle as paiement_type"; + $sql.= " FROM ".MAIN_DB_PREFIX."paiementcharge as p"; + $sql.= ", ".MAIN_DB_PREFIX."c_paiement as c "; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; + $sql.= " WHERE p.fk_charge = ".$id; + $sql.= " AND p.fk_charge = cs.rowid"; + $sql.= " AND cs.entity = ".$conf->entity; + $sql.= " AND p.fk_typepaiement = c.id"; + $sql.= " ORDER BY dp DESC"; + + //print $sql; + $resql = $db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; $total = 0; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + $var=True; + while ($i < $num) + { + $objp = $db->fetch_object($resql); + $var=!$var; + print "'; + print '\n"; + $labeltype=$langs->trans("PaymentType".$objp->type_code)!=("PaymentType".$objp->type_code)?$langs->trans("PaymentType".$objp->type_code):$objp->paiement_type; + print "\n"; + print '\n"; + print ""; + $totalpaye += $objp->amount; + $i++; + } + + if ($object->paye == 0) + { + print "\n"; + print "\n"; + + $resteapayer = $object->amount - $totalpaye; + + print ""; + print "\n"; + } + print "
'.$langs->trans("RefPayment").''.$langs->trans("Date").''.$langs->trans("Type").''.$langs->trans("Amount").' 
"; + print ''.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.''.dol_print_date($db->jdate($objp->dp),'day')."".$labeltype.' '.$objp->num_paiement."'.price($objp->amount)." ".$langs->trans("Currency".$conf->currency)."
".$langs->trans("AlreadyPaid")." :".price($totalpaye)." ".$langs->trans("Currency".$conf->currency)."
".$langs->trans("AmountExpected")." :".price($object->amount)." ".$langs->trans("Currency".$conf->currency)."
".$langs->trans("RemainderToPay")." :".price($resteapayer)." ".$langs->trans("Currency".$conf->currency)."
"; + $db->free($resql); + } + else + { + dol_print_error($db); + } + + print '
'; + print '
'; + print '
'; + + print '
'; + dol_fiche_end(); - - + if ($action == 'edit') { print '
'; @@ -587,7 +625,7 @@ if ($id > 0) { print "id&action=reopen\">".$langs->trans("ReOpen").""; } - + // Edit if ($object->paye == 0 && $user->rights->tax->charges->creer) { diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index ca9af965758..1ba0773afff 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -34,7 +34,8 @@ class ChargeSociales extends CommonObject public $element='chargesociales'; public $table='chargesociales'; public $table_element='chargesociales'; - + public $picto = 'bill'; + /** * {@inheritdoc} */ @@ -371,7 +372,7 @@ class ChargeSociales extends CommonObject /** * Retourne le libelle du statut d'une charge (impaye, payee) * - * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) * @return string Label */ @@ -384,7 +385,7 @@ class ChargeSociales extends CommonObject * Renvoi le libelle d'un statut donne * * @param int $statut Id statut - * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) * @return string Label */ @@ -428,7 +429,13 @@ class ChargeSociales extends CommonObject if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3'); if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6'); } - + if ($mode == 6) + { + if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1'); + if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3'); + if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6'); + } + return "Error, mode/status not found"; } diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index befc9d5c208..236e22ba981 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -1,7 +1,7 @@ - * Copyright (C) 2013 Laurent Destailleur - * Copyright (C) 2015 Raphaël Doursenaud +/* Copyright (C) 2013 Antoine Iauch + * Copyright (C) 2013-2016 Laurent Destailleur + * Copyright (C) 2015 Raphaël Doursenaud * * 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 @@ -262,7 +262,11 @@ if ($modecompta == 'CREANCES-DETTES') print ''; } - print ''; + $moreforfilter=''; + + print '
'; + print '
'."\n"; + // Category filter print ''; print '
'; @@ -418,6 +422,8 @@ if ($modecompta == 'CREANCES-DETTES') $db->free($result); } print "
"; + print '
'; + print ''; } else { // $modecompta != 'CREANCES-DETTES' diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index e5a4bc37f78..d72b06a1bb0 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2013 Antoine Iauch * @@ -260,8 +260,11 @@ if ($modecompta != 'CREANCES-DETTES') { } } -$i = 0; -print ""; +$morefilter=''; + +print '
'; +print '
'."\n"; + print ""; print_liste_field_titre( $langs->trans("User"), @@ -346,6 +349,8 @@ if (count($amount)) { $arrayforsort=$amount; } + $i = 0; + foreach($arrayforsort as $key => $value) { $var=!$var; print ""; @@ -432,6 +437,8 @@ if (count($amount)) { } print "
"; +print '
'; +print ''; llxFooter(); diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index e2e092b032f..26063587c5d 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2013 Antoine Iauch @@ -22,7 +22,7 @@ /** * \file htdocs/compta/stats/casoc.php - * \brief Page reporting CA par societe + * \brief Page reporting Turnover (CA) by thirdparty */ require '../../main.inc.php'; @@ -151,6 +151,7 @@ foreach($allparams as $key => $value) { $paramslink .= '&' . $key . '=' . $value; } + /* * View */ @@ -338,8 +339,13 @@ foreach($headerparams as $key => $value) { print ''; } -print ""; - // Category filter + +$moreforfilter=''; + +print '
'; +print '
'."\n"; + +// Category filter print ''; print '
'; print $langs->trans("Category") . ': ' . $formother->select_categories(Categorie::TYPE_CUSTOMER, $selected_cat, 'search_categ', true); @@ -614,6 +620,8 @@ if (count($amount)) { } print "
"; +print ""; + print ''; llxFooter(); diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 1a343cbcb0b..a32a67bb9fe 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -178,12 +178,11 @@ if ($modecompta != 'CREANCES-DETTES') } } +$moreforfilter=''; -/* - * Show result array - */ +print '
'; +print ''."\n"; -print '
'; print ''; for ($annee = $year_start ; $annee <= $year_end ; $annee++) @@ -433,6 +432,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) } print "\n"; print "
 
"; +print '
'; /* diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 04b73ccbb6d..33e5110153b 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -365,7 +365,7 @@ else } // Count total nb of records -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index e0f465b5389..efb2c13ea9e 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -288,7 +288,7 @@ if ($result) $totalnboflines = $db->num_rows($result); } -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index dadc470e273..05a4a8d398e 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -549,7 +549,7 @@ class FormFile $buttonlabeltoshow=$buttonlabel; if (empty($buttonlabel)) $buttonlabel=$langs->trans('Generate'); - if ($conf->browser->layout == 'phone') $urlsource.='#'.$forname.'_form'; # So we switch to form after a generation + if ($conf->browser->layout == 'phone') $urlsource.='#'.$forname.'_form'; // So we switch to form after a generation if (empty($noform)) $out.= '
'; $out.= ''; $out.= ''; @@ -935,7 +935,8 @@ class FormFile print ''; print ''; } - print ''; + print '
'."\n"; + print ''; print_liste_field_titre($langs->trans("Documents2"),$url,"name","",$param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Size"),$url,"size","",$param,'align="right"',$sortfield,$sortorder); @@ -971,6 +972,7 @@ class FormFile $editline=0; + print ''."\n"; print ''; print '
'; @@ -1131,7 +1133,7 @@ class FormFile // Show list of documents if (empty($useinecm)) print load_fiche_titre($langs->trans("AttachedFiles")); if (empty($url)) $url=$_SERVER["PHP_SELF"]; - print ''; + print '
'."\n"; print ''; $sortref="fullname"; if ($modulepart == 'invoice_supplier') $sortref='level1name'; @@ -1140,7 +1142,7 @@ class FormFile print_liste_field_titre($langs->trans("Size"),$url,"size","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Date"),$url,"date","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre('','',''); - print ''; + print ''."\n"; // To show ref or specific information according to view to show (defined by $module) if ($modulepart == 'company') @@ -1276,6 +1278,7 @@ class FormFile if (! $found > 0 || ! is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) continue; // We do not show orphelins files $var=!$var; + print ''."\n"; print ''; print ''; // Center diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index bb53a0dd1da..84f61145de7 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -20,7 +20,7 @@ insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, left insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('hrm|holiday|deplacement|expensereport', '$conf->hrm->enabled || $conf->holiday->enabled || $conf->deplacement->enabled || $conf->expensereport->enabled', 15__+MAX_llx_menu__, __HANDLER__, 'top', 'hrm', '', 0, '/hrm/index.php?mainmenu=hrm&leftmenu=', 'HRM', -1, 'holiday', '$user->rights->hrm->employee->read || $user->rights->holiday->write || $user->rights->deplacement->lire || $user->rights->expensereport->lire', '', 0, 80, __ENTITY__); -- Home - Dashboard -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 90__+MAX_llx_menu__, 'home', '', 1__+MAX_llx_menu__, '/index.php', 'Dashboard', 0, '', '', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 90__+MAX_llx_menu__, 'home', '', 1__+MAX_llx_menu__, '/index.php', 'MyDashboard', 0, '', '', '', 2, 0, __ENTITY__); -- Home - Setup insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$user->admin', __HANDLER__, 'left', 100__+MAX_llx_menu__, 'home', 'setup', 1__+MAX_llx_menu__, '/admin/index.php?leftmenu=setup', 'Setup', 0, 'admin', '', '', 2, 1, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 629db07eb77..b95e0c5bd25 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -508,7 +508,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $langs->load("users"); // Home - dashboard - $newmenu->add("/index.php?mainmenu=home&leftmenu=home", $langs->trans("Dashboard"), 0, 1, '', $mainmenu, 'home'); + $newmenu->add("/index.php?mainmenu=home&leftmenu=home", $langs->trans("MyDashboard"), 0, 1, '', $mainmenu, 'home'); // Setup $newmenu->add("/admin/index.php?mainmenu=home&leftmenu=setup", $langs->trans("Setup"), 0, $user->admin, '', $mainmenu, 'setup'); @@ -681,15 +681,15 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) $menutoshow=$langs->trans("CustomersCategoriesShort"); if (! empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) $menutoshow=$langs->trans("ProspectsCategoriesShort"); $newmenu->add("/categories/index.php?leftmenu=cat&type=2", $menutoshow, 0, $user->rights->categorie->lire, '', $mainmenu, 'cat'); - $newmenu->add("/categories/card.php?action=create&type=2", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer); + $newmenu->add("/categories/card.php?action=create&type=2", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer); } // Categories Contact - $newmenu->add("/categories/index.php?leftmenu=cat&type=4", $langs->trans("ContactCategoriesShort"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat'); + $newmenu->add("/categories/index.php?leftmenu=catcontact&type=4", $langs->trans("ContactCategoriesShort"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat'); $newmenu->add("/categories/card.php?action=create&type=4", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer); // Categories suppliers if (! empty($conf->fournisseur->enabled)) { - $newmenu->add("/categories/index.php?leftmenu=cat&type=1", $langs->trans("SuppliersCategoriesShort"), 0, $user->rights->categorie->lire); + $newmenu->add("/categories/index.php?leftmenu=catfournish&type=1", $langs->trans("SuppliersCategoriesShort"), 0, $user->rights->categorie->lire); $newmenu->add("/categories/card.php?action=create&type=1", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer); } //if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->rights->categorie->lire); diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php index ed0d537d736..1f8e06eb04d 100644 --- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php @@ -315,9 +315,9 @@ class pdf_typhon extends ModelePDFDeliveryOrder $height_note=0; } - $iniY = $tab_top + 7; - $curY = $tab_top + 7; - $nexY = $tab_top + 7; + $iniY = $tab_top + 11; + $curY = $tab_top + 11; + $nexY = $tab_top + 11; // Loop on each lines for ($i = 0 ; $i < $nblines ; $i++) @@ -637,7 +637,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder if (empty($hidetop)) { - $pdf->line($this->marge_gauche, $tab_top+6, $this->page_largeur-$this->marge_droite, $tab_top+6); + $pdf->line($this->marge_gauche, $tab_top+10, $this->page_largeur-$this->marge_droite, $tab_top+10); } $pdf->SetDrawColor(128,128,128); diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 49d916d2d9d..c400f9d167b 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -225,7 +225,7 @@ $sql.=$hookmanager->resPrint; $sql.= $db->order($sortfield,$sortorder); // Count total nb of records -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/disabled.php b/htdocs/disabled.php deleted file mode 100644 index 43c650466a6..00000000000 --- a/htdocs/disabled.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * 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 - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * or see http://www.gnu.org/ - */ - -/** - * \file htdocs/disabled.php - * \brief Page to use to replace index.php to disable all software - */ -?> - - -This feature has been disabled on this test server.
-Cette fonctionnalité a été désactivée sur ce serveur de test.
- - diff --git a/htdocs/don/card.php b/htdocs/don/card.php index aa0a27b6979..fd68b028254 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -305,9 +305,6 @@ if ($action == 'create') print '
'; if ($found > 0 && is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) print $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]->getNomUrl(1,'document'); diff --git a/htdocs/core/class/html.formpropal.class.php b/htdocs/core/class/html.formpropal.class.php index 2cfeaadd368..14e1a466275 100644 --- a/htdocs/core/class/html.formpropal.class.php +++ b/htdocs/core/class/html.formpropal.class.php @@ -101,7 +101,7 @@ class FormPropal } print ''; if ($picto && $titre) print img_picto('', $picto, 'class="hideonsmartphone valignmiddle" id="pictotitle"', $pictoisfullpath); print '
'.$titre; - if (!empty($titre) && $savtotalnboflines > 0) print ' ('.$totalnboflines.')'; + if (!empty($titre) && $savtotalnboflines >= 0) print ' ('.$totalnboflines.')'; print '
'; print ''; - $nbrows=11; - if (! empty($conf->projet->enabled)) $nbrows++; - // Date print ''; print ''; - $nbrows=12; - if (! empty($conf->projet->enabled)) $nbrows++; - // Date - print "".''; @@ -454,10 +448,10 @@ if (! empty($id) && $action == 'edit') print "\n"; $langs->load("companies"); - print "".''; - print "".''; - print "".''; - print "".''; + print ''; + print ''; + print ''; // Zip / Town @@ -468,7 +462,7 @@ if (! empty($id) && $action == 'edit') print ''; // Country - print ''; @@ -593,9 +587,6 @@ if (! empty($id) && $action != 'edit') print '
'.$langs->trans("Date").''; $form->select_date($donation_date?$donation_date:-1,'','','','',"add",1,1); @@ -428,11 +425,8 @@ if (! empty($id) && $action == 'edit') print '
'.$langs->trans("Date").''; + print '
'.$langs->trans("Date").''; $form->select_date($object->date,'','','','',"update"); print '
'.$langs->trans("Company").'
'.$langs->trans("Lastname").'
'.$langs->trans("Firstname").'
'.$langs->trans("Address").''; + print '
'.$langs->trans("Company").'
'.$langs->trans("Lastname").'
'.$langs->trans("Firstname").'
'.$langs->trans("Address").''; print '
'.$langs->trans('Country').''; + print '
'.$langs->trans('Country').''; print $form->select_country((!empty($object->country_id)?$object->country_id:$mysoc->country_code),'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'; - $nbrows=12; - if (! empty($conf->projet->enabled)) $nbrows++; - // Ref /* print ''; */ // Date - print '"; @@ -668,13 +659,13 @@ if (! empty($id) && $action != 'edit') // Other attributes $cols = 2; include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; - + print '
'.$langs->trans("Ref").''; @@ -604,7 +595,7 @@ if (! empty($id) && $action != 'edit') print '
'.$langs->trans("Date").''; + print '
'.$langs->trans("Date").''; print dol_print_date($object->date,"day"); print "
'; - + print ''; print '
'; print '
'; - + /* * Payments */ @@ -737,16 +728,13 @@ if (! empty($id) && $action != 'edit') dol_print_error($db); } - print '
'; print '
'; print ''; - + print '
'; - - + dol_fiche_end(); - $remaintopay = $object->amount - $totalpaid; @@ -821,7 +809,7 @@ if (! empty($id) && $action != 'edit') print $formfile->showdocuments('donation',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf); print '
'; - + print '
'; } diff --git a/htdocs/don/list.php b/htdocs/don/list.php index a6a60dc79c3..9ca8a79bb15 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -113,7 +113,7 @@ if (trim($search_name) != '') if ($search_amount) $sql.= natural_search(array('d.amount'), price2num(trim($search_amount)), 1); $sql.= $db->order($sortfield,$sortorder); -$nbtotalofrecords = 0; +$nbtotalofrecords = -1; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); diff --git a/htdocs/ecm/docfile.php b/htdocs/ecm/docfile.php index ce4bf480668..89caaf91824 100644 --- a/htdocs/ecm/docfile.php +++ b/htdocs/ecm/docfile.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2008-2016 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 @@ -159,14 +159,13 @@ llxHeader(); $form=new Form($db); -$fullpath=$conf->ecm->dir_output.'/'.$ecmdir->label.'/'.$urlfile; +$fullpath=$conf->ecm->dir_output.'/'.$relativepath.$urlfile; $file = new stdClass(); $file->section_id=$ecmdir->id; $file->label=$urlfile; $head = ecm_file_prepare_head($file); -dol_fiche_head($head, 'card', $langs->trans("File"), 0, 'generic'); if ($_GET["action"] == 'edit') { @@ -177,8 +176,10 @@ if ($_GET["action"] == 'edit') print ''; } +dol_fiche_head($head, 'card', $langs->trans("File"), 0, 'generic'); + print ''; -print ''; /*print ''; */ -if ($_GET["action"] == 'edit') -{ - print ''; -} + +// Define $urlwithroot +$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); +$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file +//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + +print ''; print '
'.$langs->trans("Ref").''; +print '
'.$langs->trans("Ref").''; $s=''; $tmpecmdir=new EcmDirectory($db); // Need to create a new one $tmpecmdir->fetch($ecmdir->id); @@ -203,7 +204,7 @@ while ($tmpecmdir && $result > 0) print img_picto('','object_dir').' '.$langs->trans("ECMRoot").' -> '; print $s; print ' -> '; -if (GETPOST('action') == 'edit') print ''; +if (GETPOST('action') == 'edit') print ''; else print $urlfile; print '
'.$langs->trans("Description").''; @@ -234,20 +235,39 @@ print '
'.$langs->trans("TotalSizeOfAttachedFiles").''; print dol_print_size($totalsize); print '
'; - print ''; - print '     '; - print ''; - print '
'.$langs->trans("DirectDownloadLink").''; +$modulepart='ecm'; +$forcedownload=1; +$rellink='/document.php?modulepart='.$modulepart; +if ($forcedownload) $rellink.='&attachment=1'; +if (! empty($object->entity)) $rellink.='&entity='.$object->entity; +$filepath=$relativepath.$file->label; +$rellink.='&file='.urlencode($filepath); +$fulllink=$urlwithroot.$rellink; +print img_picto('','object_globe.png').' '; +print ''; +print ' '.$langs->trans("Download").''; +print '
'; + +dol_fiche_end(); + if ($_GET["action"] == 'edit') { - print ''; + print '
'; + print ''; + print '     '; + print ''; + print '
'; + + print ''; } -print ''; // Confirmation de la suppression d'une ligne categorie diff --git a/htdocs/ecm/docmine.php b/htdocs/ecm/docmine.php index 17e1a1a4308..0099e831776 100644 --- a/htdocs/ecm/docmine.php +++ b/htdocs/ecm/docmine.php @@ -222,7 +222,7 @@ if ($action == 'edit') } print ''; -print ''; -print '
'.$langs->trans("Ref").''; +print '
'.$langs->trans("Ref").''; $s=''; $tmpecmdir=new EcmDirectory($db); // Need to create a new one $tmpecmdir->fetch($ecmdir->id); @@ -233,7 +233,7 @@ while ($tmpecmdir && $result > 0) $tmpecmdir->ref=$tmpecmdir->label; if ($i == 0 && $action == 'edit') { - $s=''; + $s=''; } else $s=$tmpecmdir->getNomUrl(1).$s; if ($tmpecmdir->fk_parent) @@ -251,7 +251,7 @@ while ($tmpecmdir && $result > 0) print img_picto('','object_dir').' '.$langs->trans("ECMRoot").' -> '; print $s; print '
'.$langs->trans("Description").''; +print '
'.$langs->trans("Description").''; if ($action == 'edit') { print '