diff --git a/COPYRIGHT b/COPYRIGHT index c0d8389369c1b0a97b92fb5d910dd48bc7f8237c..fd54e10f354dc235a7fcc8c0f3c625e7bcdd1364 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -9,41 +9,41 @@ More information: http://www.gnu.org/licenses/gpl-3.0.txt Dolibarr uses some external libraries released under different licenses. This is compatibility summary: -Component Version License GPL Compatible Usage +Component Version License GPL Compatible Usage ------------------------------------------------------------------------------------- PHP libraries: -AdoDb-Date 0.32 Modified BSD License Yes Date convertion (not into rpm package) -CKEditor 4.3.3 LGPL-2.1+ Yes Editor WYSIWYG -FPDI 1.4.2 Apache Software License 2.0 Yes PDF templates management -FPDF_TPL 1.2 Apache Software License 2.0 Yes PDF templates management -GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package) -NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package) -odtPHP 1.0.1 GPL-2+ b Yes Library to build/edit ODT files -PHPExcel 1.7.8 LGPL-2.1+ Yes Read/Write XLS files, read ODS files -PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests -TCPDF 6.0.093 LGPL-3+ Yes PDF generation +AdoDb-Date 0.32 Modified BSD License Yes Date convertion (not into rpm package) +CKEditor 4.3.3 LGPL-2.1+ Yes Editor WYSIWYG +FPDI 1.4.2 Apache Software License 2.0 Yes PDF templates management +FPDF_TPL 1.2 Apache Software License 2.0 Yes PDF templates management +GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package) +NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package) +odtPHP 1.0.1 GPL-2+ b Yes Library to build/edit ODT files +PHPExcel 1.7.8 LGPL-2.1+ Yes Read/Write XLS files, read ODS files +PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests +TCPDF 6.0.093 LGPL-3+ Yes PDF generation JS libraries: -jQuery 1.8.2 MIT License Yes JS library -jQuery UI 1.9.1 GPL and MIT License Yes JS library plugin UI -jQuery UI Multiselect ? GPL and MIT License Yes JS library plugin for sexier multiselect -jQuery blockUI 2.43 GPL and MIT License Yes JS library plugin blockUI (to use ajax popups) -jQuery Colorpicker 1.1 MIT License Yes JS library for color picker for a defined list of colors -jQuery DataTables 1.9.4 BSD Yes JS library for tables output -jQuery FileUpload 5.0.3 GPL and MIT License Yes JS library to upload files -jQuery Flot 0.7 MIT License Yes JS library to build graph -jQuery JCrop 0.9.8 GPL and MIT License Yes JS library plugin Crop (to crop images) -jQuery Jeditable 1.7.1 GPL and MIT License Yes JS library plugin jeditable (to edit in place) -jQuery jNotify 1.1.00 Apache Software License 2.0 Yes JS library plugin jNotify (to use ajax popups) -jQuery jPicker 1.1.6 GPL and MIT License Yes JS library for color picker with not defined list of colors -jQuery jqueryFileTree 1.0.1 GPL and MIT License Yes JS library for color picker with not defined list of colors -jQuery jquerytreeview 1.4.1 MIT License Yes JS library for color picker with not defined list of colors -jQuery Layout 1.3.0rc30.74 GPL and MIT License Yes JS library plugin Layout (RC-29.15) -jQuery Mobile 1.3.0 GPL and MIT License Yes JS library for smartphone (not used) -jQuery TableDnD 0.6 GPL and MIT License Yes JS library plugin TableDnD (to reorder table rows) -jQuery Timepicker 1.1.0 GPL and MIT License Yes JS library Timepicker addon for Datepicker -jQuery Tiptip 1.3 GPL and MIT License Yes JS library for tooltips -jsGantt 1.2 BSD License Yes JS library (to build Gantt reports) +jQuery 1.8.2 MIT License Yes JS library +jQuery UI 1.9.1 GPL and MIT License Yes JS library plugin UI +jQuery multiple-select 1.1.0 MIT License Yes JS library plugin for sexier multiselect +jQuery blockUI 2.43 GPL and MIT License Yes JS library plugin blockUI (to use ajax popups) +jQuery Colorpicker 1.1 MIT License Yes JS library for color picker for a defined list of colors +jQuery DataTables 1.9.4 BSD Yes JS library for tables output +jQuery FileUpload 5.0.3 GPL and MIT License Yes JS library to upload files +jQuery Flot 0.7 MIT License Yes JS library to build graph +jQuery JCrop 0.9.8 GPL and MIT License Yes JS library plugin Crop (to crop images) +jQuery Jeditable 1.7.1 GPL and MIT License Yes JS library plugin jeditable (to edit in place) +jQuery jNotify 1.1.00 Apache Software License 2.0 Yes JS library plugin jNotify (to use ajax popups) +jQuery jPicker 1.1.6 GPL and MIT License Yes JS library for color picker with not defined list of colors +jQuery jqueryFileTree 1.0.1 GPL and MIT License Yes JS library for color picker with not defined list of colors +jQuery jquerytreeview 1.4.1 MIT License Yes JS library for color picker with not defined list of colors +jQuery Layout 1.3.0rc30.74 GPL and MIT License Yes JS library plugin Layout (RC-29.15) +jQuery Mobile 1.3.0 GPL and MIT License Yes JS library for smartphone (not used) +jQuery TableDnD 0.6 GPL and MIT License Yes JS library plugin TableDnD (to reorder table rows) +jQuery Timepicker 1.1.0 GPL and MIT License Yes JS library Timepicker addon for Datepicker +jQuery Tiptip 1.3 GPL and MIT License Yes JS library for tooltips +jsGantt 1.2 BSD License Yes JS library (to build Gantt reports) For licenses compatibility informations: http://www.fsf.org/licensing/licenses/index_html diff --git a/ChangeLog b/ChangeLog index c5aeb5874b39e26858b487598aadb93c4e48c9a3..5182a84cd333cdb5eedfbc6def3f32572a5f9171 100644 --- a/ChangeLog +++ b/ChangeLog @@ -163,18 +163,20 @@ Dolibarr better: ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** -- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice -- Fix: bug 1588 : relative discount +- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. +- Fix: bug 1588 : relative discount. - Fix: label of input method not tranlated. - Fix: box of customer and propsects were not correctly disabled. -- Fix: right and error management #1961 -- Fix: Fix Error when trying to clone an Order #1943 - Fix: [ bug #1618 ] PHP Error thrown when saving a barcode +- Fix: Civility & birthdate wasn't save into adherent module. +- Fix: webservice Thirdparty parameter lastname for invidual creation is now lastname and not ref +- Fix: Chars - is no more allowed into value for code for extra fields. +( Fix: [ bug #1622 ] Requesting holiday than spans across two years cause high CPU usage by Apache ***** ChangeLog for 3.6.1 compared to 3.6.* ***** For users: - Fix: Can upload files on services. -- Fix: sql errors on updat fichinter. +- Fix: sql errors on update fichinter. - Fix: debian script syntax error. - Fix: error "menu param is not inside list" into pos module. - Fix: Salary payments are not reflected on the reporting sheets. @@ -310,6 +312,9 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f - Remove add_photo_web() that is ot used anymore by core code. +***** ChangeLog for 3.5.6 compared to 3.5.5 ***** +Fix: Avoid missing class error for fetch_thirdparty method #1973 + ***** ChangeLog for 3.5.5 compared to 3.5.4 ***** Fix: Holiday module was broken. Initializaion of amount of holidays failed. Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas. diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 60ff4b125c3252e160b0d7a2470175ff24aef35e..36739254d06efc39e572d82979222892bb0f8a44 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -37,6 +37,11 @@ $mesg = ''; $action = GETPOST('action'); $id = GETPOST('id', 'int'); $rowid = GETPOST('rowid', 'int'); +$search_account = GETPOST("search_account"); +$search_label = GETPOST("search_label"); +$search_accountparent = GETPOST("search_accountparent"); +$search_pcgtype = GETPOST("search_pcgtype"); +$search_pcgsubtype = GETPOST("search_pcgsubtype"); // Security check if (!$user->admin) @@ -83,6 +88,15 @@ if ($action == 'disable') { } } +if (GETPOST("button_removefilter")) +{ + $search_account=""; + $search_label=""; + $search_accountparent=""; + $search_pcgtype=""; + $search_pcgsubtype=""; +} + /* * View * @@ -96,20 +110,20 @@ $sql .= " FROM " . MAIN_DB_PREFIX . "accountingaccount as aa, " . MAIN_DB_PREFIX $sql .= " WHERE aa.fk_pcg_version = asy.pcg_version"; $sql .= " AND asy.rowid = " . $pcgver; -if (strlen(trim($_GET["search_account"]))) { - $sql .= " AND aa.account_number like '%" . $_GET["search_account"] . "%'"; +if (strlen(trim($search_account))) { + $sql .= " AND aa.account_number like '%" . $search_account . "%'"; } -if (strlen(trim($_GET["search_label"]))) { - $sql .= " AND aa.label like '%" . $_GET["search_label"] . "%'"; +if (strlen(trim($search_label))) { + $sql .= " AND aa.label like '%" . $search_label . "%'"; } -if (strlen(trim($_GET["search_accountparent"]))) { - $sql .= " AND aa.account_parent like '%" . $_GET["search_accountparent"] . "%'"; +if (strlen(trim($search_accountparent))) { + $sql .= " AND aa.account_parent like '%" . $search_accountparent . "%'"; } -if (strlen(trim($_GET["search_pcgtype"]))) { - $sql .= " AND aa.pcg_type like '%" . $_GET["search_pcgtype"] . "%'"; +if (strlen(trim($search_pcgtype))) { + $sql .= " AND aa.pcg_type like '%" . $search_pcgtype . "%'"; } -if (strlen(trim($_GET["search_pcgsubtype"]))) { - $sql .= " AND aa.pcg_subtype like '%" . $_GET["search_pcgsubtype"] . "%'"; +if (strlen(trim($search_pcgsubtype))) { + $sql .= " AND aa.pcg_subtype like '%" . $search_pcgsubtype . "%'"; } $sql .= $db->order($sortfield, $sortorder); @@ -141,18 +155,20 @@ if ($result) { print_liste_field_titre($langs->trans("Pcgtype"), $_SERVER["PHP_SELF"], "aa.pcg_type", "", $param, "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("Pcgsubtype"), $_SERVER["PHP_SELF"], "aa.pcg_subtype", "", $param, "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("Active"), $_SERVER["PHP_SELF"], "aa.active", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre(" "); + print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder); print '</tr>'; print '<tr class="liste_titre">'; - print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_account" value="' . GETPOST("search_account") . '"></td>'; - print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_label" value="' . GETPOST("search_label") . '"></td>'; - print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_accountparent" value="' . GETPOST("search_accountparent") . '"></td>'; - print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_pcgtype" value="' . GETPOST("search_pcgtype") . '"></td>'; - print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_pcgsubtype" value="' . GETPOST("search_pcgsubtype") . '"></td>'; + print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_account" value="' . $search_account . '"></td>'; + print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_label" value="' . $search_label . '"></td>'; + print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_accountparent" value="' . $search_accountparent . '"></td>'; + print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_pcgtype" value="' . $search_pcgtype . '"></td>'; + print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_pcgsubtype" value="' . $search_pcgsubtype . '"></td>'; print '<td class="liste_titre"> </td>'; - print '<td class="liste_titre" align="right">'; - print '<input type="image" class="liste_titre" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png" name="button_search" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">'; + print '<td align="right" colspan="2" class="liste_titre">'; + print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; + print ' '; + print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; print '</td>'; print '</tr>'; @@ -180,11 +196,13 @@ if ($result) { } print '</td>'; - print '<td>'; + // Action + print '<td align="center">'; if ($user->admin) { print '<a href="./card.php?action=update&id=' . $obj->rowid . '">'; print img_edit(); - print '</a> '; + print '</a>'; + print ' '; print '<a href="./card.php?action=delete&id=' . $obj->rowid . '">'; print img_delete(); print '</a>'; diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 9ebdea5fefc9eaaceb3cf83c32c130e574b7ecd0..ad6ca01b6ca8deffb9666fe078e24ae8e58bb6ab 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -181,11 +181,6 @@ else if ($id) if ($action == 'update') { - // WYSIWYG Editor - $htmlacc = new FormVentilation($db); - - require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; - $soc = new Societe($db); if ($object->socid) { $soc->fetch($object->socid); diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 9e109c7feeb11988106460ffbc5b3d3ff9c5073b..608c62cf1d08a5980d815cafcfad1bb9a5f3202f 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -35,8 +35,6 @@ $langs->load("accounting"); $id = GETPOST('id', 'int'); if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) - accessforbidden(); $action = GETPOST('action'); $piece_num = GETPOST("piece_num"); @@ -238,7 +236,9 @@ if ($action == 'create') { print '<input type="submit" class="butAction" value="' . $langs->trans("Save") . '">'; print '</form>'; -} else { +} +else +{ $book = new BookKeeping($db); $result = $book->fetch_per_mvt($piece_num); if ($result < 0) { @@ -309,14 +309,12 @@ if ($action == 'create') { print '<td><input type="text" size="6" name="credit" value="' . price($line->credit) . '"/></td>'; print '<td>' . $line->montant . '</td>'; print '<td>' . $line->sens . '</td>'; - print '<td>'; - if ($user->rights->accounting->access) { - print '<input type="submit" class="button" value="' . $langs->trans("Update") . '">'; - } + print '<input type="submit" class="button" value="' . $langs->trans("Update") . '">'; print '</form>'; print '</td>'; - } else { + } + else { print '<td>' . $line->numero_compte . '</td>'; print '<td>' . $line->code_tiers . '</td>'; print '<td>' . $line->label_compte . '</td>'; @@ -324,16 +322,15 @@ if ($action == 'create') { print '<td>' . $line->credit . '</td>'; print '<td>' . $line->montant . '</td>'; print '<td>' . $line->sens . '</td>'; - + print '<td>'; - if ($user->rights->accouting->access) { - print '<a href="./card.php?action=update&id=' . $line->id . '&piece_num=' . $line->piece_num . '">'; - print img_edit(); - print '</a> '; - print '<a href="./card.php?action=delete&id=' . $line->id . '&piece_num=' . $line->piece_num . '">'; - print img_delete(); - print '</a>'; - } + print '<a href="./card.php?action=update&id=' . $line->id . '&piece_num=' . $line->piece_num . '">'; + print img_edit(); + print '</a> '; + print '<a href="./card.php?action=delete&id=' . $line->id . '&piece_num=' . $line->piece_num . '">'; + print img_delete(); + print '</a>'; + print '</td>'; } print "</tr>\n"; @@ -342,7 +339,7 @@ if ($action == 'create') { if ($action == "" || $action == 'add') { $var = ! $var; print "<tr $bc[$var]>"; - + print '<form action="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $book->piece_num . '" method="post">'; print '<input type="hidden" name="action" value="add">' . "\n"; print '<input type="hidden" name="doc_date" value="' . $book->doc_date . '">' . "\n"; @@ -359,14 +356,13 @@ if ($action == 'create') { print '<td></td>'; print '<td></td>'; print '<td><input type="submit" class="button" value="' . $langs->trans("Save") . '"></td>'; - print '</tr>'; } - print "</table>"; } } - } else { + } + else { print_fiche_titre($langs->trans("NoRecords")); } } diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index b0e5096699b7a117b890249dd2d4472d50e01e29..21da5bacbb9b3c77226a0dfface62340561cd3d0 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -36,6 +36,11 @@ $page = GETPOST("page"); $sortorder = GETPOST("sortorder"); $sortfield = GETPOST("sortfield"); $action = GETPOST('action', 'alpha'); +$search_doc_type = GETPOST("search_doc_type"); +$search_doc_ref = GETPOST("search_doc_ref"); +$search_account = GETPOST("search_account"); +$search_thirdparty = GETPOST("search_thirdparty"); +$search_journal = GETPOST("search_journal"); if ($sortorder == "") $sortorder = "ASC"; @@ -46,6 +51,15 @@ $offset = $conf->liste_limit * $page; $formventilation = new FormVentilation($db); +if (GETPOST("button_removefilter")) +{ + $search_doc_type=""; + $search_doc_ref=""; + $search_account=""; + $search_thirdparty=""; + $search_journal=""; +} + /* * Action */ @@ -100,25 +114,25 @@ else { $sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, bk.code_tiers, bk.numero_compte , bk.label_compte, bk.debit , bk.credit, bk.montant , bk.sens , bk.code_journal , bk.piece_num "; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk"; - if (dol_strlen(trim(GETPOST("search_doc_type")))) { + if (dol_strlen(trim($search_doc_type))) { - $sql .= " WHERE bk.doc_type LIKE '%" . GETPOST("search_doc_type") . "%'"; + $sql .= " WHERE bk.doc_type LIKE '%" . $search_doc_type . "%'"; - if (dol_strlen(trim(GETPOST("search_doc_ref")))) { - $sql .= " AND bk.doc_ref LIKE '%" . GETPOST("search_doc_ref") . "%'"; + if (dol_strlen(trim($search_doc_ref))) { + $sql .= " AND bk.doc_ref LIKE '%" . $search_doc_ref . "%'"; } } - if (dol_strlen(trim(GETPOST("search_doc_ref")))) { - $sql .= " WHERE bk.doc_ref LIKE '%" . GETPOST("search_doc_ref") . "%'"; + if (dol_strlen(trim($search_doc_ref))) { + $sql .= " WHERE bk.doc_ref LIKE '%" . $search_doc_ref . "%'"; } - if (dol_strlen(trim(GETPOST("search_compte")))) { - $sql .= " WHERE bk.numero_compte LIKE '%" . GETPOST("search_compte") . "%'"; + if (dol_strlen(trim($search_account))) { + $sql .= " WHERE bk.numero_compte LIKE '%" . $search_account . "%'"; } - if (dol_strlen(trim(GETPOST("search_tiers")))) { - $sql .= " WHERE bk.code_tiers LIKE '%" . GETPOST("search_tiers") . "%'"; + if (dol_strlen(trim($search_thirdparty))) { + $sql .= " WHERE bk.code_tiers LIKE '%" . $search_thirdparty . "%'"; } - if (dol_strlen(trim(GETPOST("search_journal")))) { - $sql .= " WHERE bk.code_journal LIKE '%" . GETPOST("search_journal") . "%'"; + if (dol_strlen(trim($search_journal))) { + $sql .= " WHERE bk.code_journal LIKE '%" . $search_journal . "%'"; } $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit + 1, $offset); @@ -149,7 +163,7 @@ else { print '<input type="submit" class="button" style="float: right;" value="Export CSV" />'; print '</form>'; - print "<table class=\"noborder\" width=\"100%\">"; + print '<table class="noborder" width="100%">'; print '<tr class="liste_titre">'; print_liste_field_titre($langs->trans("Doctype"), $_SERVER['PHP_SELF'], "bk.doc_type", "", "", "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("Docdate"), $_SERVER['PHP_SELF'], "bk.doc_date", "", "", "", $sortfield, $sortorder); @@ -157,29 +171,31 @@ else { print_liste_field_titre($langs->trans("Numerocompte"), $_SERVER['PHP_SELF'], "bk.numero_compte", "", "", "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("Code_tiers"), $_SERVER['PHP_SELF'], "bk.code_tiers", "", "", "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("Labelcompte"), $_SERVER['PHP_SELF'], "bk_label_compte", "", "", "", $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "bk.debit", "", "", "", $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "bk.credit", "", "", "", $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Amount"), $_SERVER['PHP_SELF'], "bk.montant", "", "", "", $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Sens"), $_SERVER['PHP_SELF'], "bk.sens", "", "", "", $sortfield, $sortorder); + print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "bk.debit", "", "", 'align="center"', $sortfield, $sortorder); + print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "bk.credit", "", "", 'align="center"', $sortfield, $sortorder); + print_liste_field_titre($langs->trans("Amount"), $_SERVER['PHP_SELF'], "bk.montant", "", "", 'align="center"', $sortfield, $sortorder); + print_liste_field_titre($langs->trans("Sens"), $_SERVER['PHP_SELF'], "bk.sens", "", "", 'align="center"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "bk.code_journal", "", "", "", $sortfield, $sortorder); - print_liste_field_titre(" "); + print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder); print "</tr>\n"; print '<tr class="liste_titre">'; print '<form action="'.$_SERVER["PHP_SELF"].'" method="GET">'; - print '<td><input type="text" name="search_doc_type" value="' . $_GET["search_doc_type"] . '"></td>'; + print '<td><input type="text" name="search_doc_type" size="8" value="' . $search_doc_type . '"></td>'; print '<td> </td>'; - print '<td><input type="text" name="search_doc_ref" value="' . $_GET["search_doc_ref"] . '"></td>'; - print '<td><input type="text" name="search_compte" value="' . $_GET["search_compte"] . '"></td>'; - print '<td><input type="text" name="search_tiers" value="' . $_GET["search_tiers"] . '"></td>'; + print '<td><input type="text" name="search_doc_ref" size="8" value="' . $search_doc_ref . '"></td>'; + print '<td><input type="text" name="search_account" size="8" value="' . $search_account . '"></td>'; + print '<td><input type="text" name="search_thirdparty" size="8" value="' . $search_thirdparty . '"></td>'; print '<td> </td>'; print '<td> </td>'; print '<td> </td>'; print '<td> </td>'; print '<td> </td>'; - print '<td><input type="text" name="search_journal" size="3" value="' . $_GET["search_journal"] . '"></td>'; - print '<td align="right">'; - print '<input type="image" class="liste_titre" name="button_search" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">'; + print '<td><input type="text" name="search_journal" size="3" value="' . $search_journal . '"></td>'; + print '<td align="right" colspan="2" class="liste_titre">'; + print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; + print ' '; + print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; print '</td>'; print '</form>'; print '</tr>'; @@ -201,9 +217,9 @@ else { print '<td align="right">' . price($obj->debit) . '</td>'; print '<td align="right">' . price($obj->credit) . '</td>'; print '<td align="right">' . price($obj->montant) . '</td>'; - print '<td>' . $obj->sens . '</td>'; + print '<td align="center">' . $obj->sens . '</td>'; print '<td>' . $obj->code_journal . '</td>'; - print '<td><a href="./card.php?piece_num=' . $obj->piece_num . '">' . img_edit() . '</a></td>'; + print '<td align="center"><a href="./card.php?piece_num=' . $obj->piece_num . '">' . img_edit() . '</a></td>'; print "</tr>\n"; $i ++; } diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 91a0eb5df8b93b0d19bafb4c2a43b60dc087aa39..28d3d0c1f7958485ef13888bb5c2bdb58bf48c5a 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -40,14 +40,12 @@ $id = GETPOST('id'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) - accessforbidden(); /* * Actions */ -if ($action == 'ventil' && $user->rights->accounting->access) +if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) { if (! GETPOST('cancel', 'alpha')) { @@ -109,7 +107,7 @@ if (! empty($id)) { print '<input type="hidden" name="action" value="ventil">'; $linkback='<a href="'.DOL_URL_ROOT.'/accountancy/customer/lines.php">'.$langs->trans("Back").'</a>'; - print_fiche_titre($langs->trans('AccountingVentilationCustomer'),$linkback,'setup'); + print_fiche_titre($langs->trans('CustomersVentilation'),$linkback,'setup'); print '<table class="border" width="100%">'; diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 9ae070c25e02e1be3a94d1fc6dfa2245b064db32..cb40b7b361b0daceb5547c3a4487711783805f74 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -93,8 +93,8 @@ if ($action == 'validatehistory') { */ llxHeader('', $langs->trans("CustomersVentilation")); -$textprevyear = "<a href=\"index.php?year=" . ($year_current - 1) . "\">" . img_previous() . "</a>"; -$textnextyear = " <a href=\"index.php?year=" . ($year_current + 1) . "\">" . img_next() . "</a>"; +$textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>'; +$textnextyear = ' <a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>'; print_fiche_titre($langs->trans("CustomersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear); @@ -197,7 +197,7 @@ print "</table>\n"; print "<br>\n"; print '<table class="noborder" width="100%">'; -print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("TotalVente") . '</td>'; +print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>'; print '<td width="60" align="center">' . $langs->trans("JanuaryMin") . '</td>'; print '<td width="60" align="center">' . $langs->trans("FebruaryMin") . '</td>'; print '<td width="60" align="center">' . $langs->trans("MarchMin") . '</td>'; @@ -212,7 +212,7 @@ print '<td width="60" align="center">' . $langs->trans("NovemberMin") . '</td>'; print '<td width="60" align="center">' . $langs->trans("DecemberMin") . '</td>'; print '<td width="60" align="center"><b>' . $langs->trans("Total") . '</b></td></tr>'; -$sql = "SELECT '" . $langs->trans("Vide") . "' AS 'Total',"; +$sql = "SELECT '" . $langs->trans("TotalVente") . "' AS 'Total',"; $sql .= " ROUND(SUM(IF(MONTH(f.datef)=1,fd.total_ht,0)),2) AS 'Janvier',"; $sql .= " ROUND(SUM(IF(MONTH(f.datef)=2,fd.total_ht,0)),2) AS 'Fevrier',"; $sql .= " ROUND(SUM(IF(MONTH(f.datef)=3,fd.total_ht,0)),2) AS 'Mars',"; diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index dcd8fca4d41078a13b494b2d8b631c1973917464..1f9b054912174d9ba86bfe0422688079031b119f 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -68,8 +68,6 @@ $action = GETPOST('action'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) - accessforbidden(); /* * View diff --git a/htdocs/accountancy/journal/cashjournal.php b/htdocs/accountancy/journal/cashjournal.php index 8af84a9ed58a87ad3efc39d92b232cadf6cca54c..fb5a15a513c7b58d50e4c8fc1f78c4e686c3f5aa 100644 --- a/htdocs/accountancy/journal/cashjournal.php +++ b/htdocs/accountancy/journal/cashjournal.php @@ -62,8 +62,6 @@ $date_endyear = GETPOST('date_endyear'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) - accessforbidden(); $action = GETPOST('action'); diff --git a/htdocs/accountancy/journal/index.php b/htdocs/accountancy/journal/index.php index 272d76fa20f648c5a8d36fb7656c687efda7e7f3..36286ce265e0c8f35cbebd20f101e4d5481b0fde 100644 --- a/htdocs/accountancy/journal/index.php +++ b/htdocs/accountancy/journal/index.php @@ -36,8 +36,6 @@ $langs->load("accountancy"); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) - accessforbidden(); llxHeader('', 'Journaux', ''); diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 789aa1111af8aed2097c1963e95d5abf2b40284e..97d52124c0175cf78a476bb9bf41064707b115c6 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -55,8 +55,6 @@ $date_endyear = GETPOST('date_endyear'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) - accessforbidden(); $action = GETPOST('action'); diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index a7c0266998f131b4487da5d069b76070a27b3223..5bb1f989a92987c57f86542a494b4f629def9f46 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -56,8 +56,6 @@ $date_endyear = GETPOST('date_endyear'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) - accessforbidden(); $action = GETPOST('action'); diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index b0078839b55a1b8e767e5d7b455bac995e818be5..45c8de9b16557a0b3554f01b38d2f830df7845ac 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -46,10 +46,9 @@ $codeventil = GETPOST('codeventil'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->ventilation->dispatch) - accessforbidden(); -if ($action == 'ventil' && $user->rights->accounting->access) { +if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) +{ $sql = " UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det"; $sql .= " SET fk_code_ventilation = " . $codeventil; $sql .= " WHERE rowid = " . $id; @@ -103,7 +102,7 @@ if ($_GET["id"]) { print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="ventil">'; - print_fiche_titre($langs->trans("Ventilation")); + print_fiche_titre($langs->trans("SuppliersVentilation")); print '<table class="border" width="100%" cellspacing="0" cellpadding="4">'; diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 7d633c575f14137e83b608b3afc779b14306a0ff..edebcfd9d46674a6a42b66bbb8a8e283d8729bdc 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -92,10 +92,10 @@ if ($action == 'validatehistory') { llxHeader('', $langs->trans("SuppliersVentilation")); -$textprevyear = "<a href=\"index.php?year=" . ($year_current - 1) . "\">" . img_previous() . "</a>"; -$textnextyear = " <a href=\"index.php?year=" . ($year_current + 1) . "\">" . img_next() . "</a>"; +$textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>'; +$textnextyear = ' <a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>'; -print_fiche_titre($langs->trans("AccountingVentilationSupplier") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear); +print_fiche_titre($langs->trans("SuppliersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear); print '<b>' . $langs->trans("DescVentilSupplier") . '</b>'; print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?action=validatehistory">' . $langs->trans("ValidateHistory") . '</a></div>'; diff --git a/htdocs/adherents/admin/adherent_type_extrafields.php b/htdocs/adherents/admin/adherent_type_extrafields.php index b2f839e3c3cf220a61685bc0d22002a181285d18..627d96acf179f6334eb7e090114824962b9efb5c 100644 --- a/htdocs/adherents/admin/adherent_type_extrafields.php +++ b/htdocs/adherents/admin/adherent_type_extrafields.php @@ -7,7 +7,7 @@ * * 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 2 of the License, or + * 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, @@ -17,6 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. + * or see http://www.gnu.org/ */ /** diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index ca7706989e01383b2cfee8369825c259d335ce7e..102f45496c6f18200163014fc7e1b73677fff9e5 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -723,7 +723,7 @@ else { /* ************************************************************************** */ /* */ - /* Fiche creation */ + /* Creation card */ /* */ /* ************************************************************************** */ $object->canvas=$canvas; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index a057e7cba936fca59fc1be97815c0a6b01b63204..cdbfabf45768a92c952b92fdd592816a703f2339 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2009-2012 Regis Houssin <regis.houssin@capnetworks.com> + * Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * * 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 @@ -124,7 +125,7 @@ class Adherent extends CommonObject /** - * Fonction envoyant un email a l'adherent avec le texte fourni en parametre. + * Function sending an email has the adherent with the text supplied in parameter. * * @param string $text Content of message (not html entities encoded) * @param string $subject Subject of message @@ -247,9 +248,9 @@ class Adherent extends CommonObject /** - * Renvoie le libelle traduit de la nature d'un adherent (physique ou morale) + * Return translated label by the nature of a adherent (physical or moral) * - * @param string $morphy Nature physique ou morale de l'adherent + * @param string $morphy Nature of the adherent (physical or moral) * @return string Label */ function getmorphylib($morphy='') diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 43ccef1e9544422cb2f2a2c5b21406e38ddffa17..adb590ffcd2725e1a97bef908dd38731e097e0a1 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -165,6 +165,16 @@ else if ($action == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK') exit; } +if ($action == 'maj_pattern') +{ + dolibarr_set_const($db, "USER_PASSWORD_PATTERN", GETPOST("pattern"),'chaine',0,'',$conf->entity); + header("Location: security.php"); + exit; +} + + + + @@ -265,6 +275,113 @@ foreach ($arrayhandler as $key => $module) print '</table>'; print '</form>'; +//if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1) +// Patter for Password Perso +if ($conf->global->USER_PASSWORD_GENERATED == "Perso"){ +$var=!$var; + + $tabConf = explode(";",$conf->global->USER_PASSWORD_PATTERN); + /*$this->length2 = $tabConf[0]; + $this->NbMaj = $tabConf[1]; + $this->NbNum = $tabConf[2]; + $this->NbSpe = $tabConf[3]; + $this->NbRepeat = $tabConf[4]; + $this->WithoutAmbi = $tabConf[5]; + */ + print '<table class="noborder" width="100%">'; + print '<tr class="liste_titre">'; + print '<td colspan="3"> '.$langs->trans("PasswordPatternDesc").'</td>'; + print '</tr>'; + + $var=!$var; + print "<tr ".$bc[$var].">"; + print '<td>' . $langs->trans("MinLength")."</td>"; + print '<td colspan="2"><input type="number" value="'.$tabConf[0].'" id="minlenght" min="1"></td>'; + print '</tr>'; + + $var=!$var; + print "<tr ".$bc[$var].">"; + print '<td>' . $langs->trans("NbMajMin")."</td>"; + print '<td colspan="2"><input type="number" value="'.$tabConf[1].'" id="NbMajMin" min="0"></td>'; + print '</tr>'; + + $var=!$var; + print "<tr ".$bc[$var].">"; + print '<td>' . $langs->trans("NbNumMin")."</td>"; + print '<td colspan="2"><input type="number" value="'.$tabConf[2].'" id="NbNumMin" min="0"></td>'; + print '</tr>'; + + $var=!$var; + print "<tr ".$bc[$var].">"; + print '<td>' . $langs->trans("NbSpeMin")."</td>"; + print '<td colspan="2"><input type="number" value="'.$tabConf[3].'" id="NbSpeMin" min="0"></td>'; + print '</tr>'; + + $var=!$var; + print "<tr ".$bc[$var].">"; + print '<td>' . $langs->trans("NbIteConsecutive")."</td>"; + print '<td colspan="2"><input type="number" value="'.$tabConf[4].'" id="NbIteConsecutive" min="0"></td>'; + print '</tr>'; + + $var=!$var; + print "<tr ".$bc[$var].">"; + print '<td>' . $langs->trans("NoAmbiCaracAutoGeneration")."</td>"; + print '<td colspan="2"><input type="checkbox" id="NoAmbiCaracAutoGeneration" '.($tabConf[5] ? "checked" : "").' min="0"> <span id="textcheckbox">'.($tabConf[5] ? $langs->trans("Activated") : $langs->trans("Disabled")).'</span></td>'; + print '</tr>'; + + $var=!$var; + print "<tr ".$bc[$var].">"; + print '<td colspan="2"></td><td width="103" align="center"><a id="linkChangePattern">'.$langs->trans("Save").'</a></td>'; + print '</tr>'; + print '</table>'; + + print '<script type="text/javascript">'; + print ' function getStringArg(){'; + print ' var pattern = "";'; + print ' pattern += $("#minlenght").val() + ";";'; + print ' pattern += $("#NbMajMin").val() + ";";'; + print ' pattern += $("#NbNumMin").val() + ";";'; + print ' pattern += $("#NbSpeMin").val() + ";";'; + print ' pattern += $("#NbIteConsecutive").val() + ";";'; + print ' pattern += $("#NoAmbiCaracAutoGeneration")[0].checked ? "1" : "0";'; + print ' return pattern;'; + print ' }'; + + print ' function valuePossible(){'; + print ' var length = parseInt($("#minlenght").val());'; + print ' var length_mini = parseInt($("#NbMajMin").val()) + parseInt($("#NbNumMin").val()) + parseInt($("#NbSpeMin").val());'; + print ' return length >= length_mini;'; + print ' }'; + + print ' function generatelink(){'; + print ' return "security.php?action=maj_pattern&pattern="+getStringArg();'; + print ' }'; + + print ' function valuePatternChange(){'; + print ' var lang_save = "'.$langs->trans("Save").'";'; + print ' var lang_error = "'.$langs->trans("Error").'";'; + print ' var lang_Disabled = "'.$langs->trans("Disabled").'";'; + print ' var lang_Activated = "'.$langs->trans("Activated").'";'; + print ' $("#textcheckbox").html($("#NoAmbiCaracAutoGeneration")[0].checked ? unescape(lang_Activated) : unescape(lang_Disabled));'; + print ' if(valuePossible()){'; + print ' $("#linkChangePattern").attr("href",generatelink()).text(lang_save);'; + print ' }'; + print ' else{'; + print ' $("#linkChangePattern").attr("href", null).text(lang_error);'; + print ' }'; + print ' }'; + + print ' $("#minlenght").change(function(){valuePatternChange();});'; + print ' $("#NbMajMin").change(function(){valuePatternChange();});'; + print ' $("#NbNumMin").change(function(){valuePatternChange();});'; + print ' $("#NbSpeMin").change(function(){valuePatternChange();});'; + print ' $("#NbIteConsecutive").change(function(){valuePatternChange();});'; + print ' $("#NoAmbiCaracAutoGeneration").change(function(){valuePatternChange();});'; + + print '</script>'; +} + + // Cryptage mot de passe print '<br>'; $var=true; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 607f8e14c4ecba1713819933d382b650482d2c26..96db3133cf9edc1300deffa64e7c4b6a50d369de 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -251,11 +251,11 @@ if ($action == 'add') if (! empty($conf->phenix->enabled) && GETPOST('add_phenix') == 'on') $object->use_phenix=1; // Check parameters - if (empty($object->userownerid)) + if (empty($object->userownerid) && empty($_SESSION['assignedtouser'])) { $error++; $donotclearsession=1; $action = 'create'; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ActionAffectedTo")), 'errors'); + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ActionsOwnedBy")), 'errors'); } if ($object->type_code == 'AC_RDV' && ($datep == '' || ($datef == '' && empty($fulldayevent)))) { @@ -423,7 +423,7 @@ if ($action == 'update') { $error++; $donotclearsession=1; $action = 'edit'; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ActionAffectedTo")), 'errors'); + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ActionsOwnedBy")), 'errors'); } // Fill array 'array_options' with data from add form @@ -790,11 +790,11 @@ if ($id > 0) { $result1=$object->fetch($id); $result2=$object->fetch_thirdparty(); - $result2=$object->fetch_contact(); - $result3=$object->fetch_userassigned(); - $result4=$object->fetch_optionals($id,$extralabels); + $result3=$object->fetch_contact(); + $result4=$object->fetch_userassigned(); + $result5=$object->fetch_optionals($id,$extralabels); - if ($result1 < 0 || $result2 < 0 || $result3 < 0 || $result4 < 0) + if ($result1 < 0 || $result2 < 0 || $result3 < 0 || $result4 < 0 || $result5 < 0) { dol_print_error($db,$object->error); exit; diff --git a/htdocs/comm/action/contact.php b/htdocs/comm/action/contact.php deleted file mode 100644 index 334da53a2f4f6320e9686c8a0aaddf606ca8266d..0000000000000000000000000000000000000000 --- a/htdocs/comm/action/contact.php +++ /dev/null @@ -1,258 +0,0 @@ -<?php -/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> - * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> - * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> - * Copyright (C) 2012 Philippe Grand <philippe.grand@atoo-net.com> - * - * 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 <http://www.gnu.org/licenses/>. - */ - -/** - * \file htdocs/comm/action/contact.php - * \ingroup agenda - * \brief Page for multi-users event - */ - -require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; -require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; - -$langs->load("companies"); -$langs->load("commercial"); -$langs->load("other"); -$langs->load("bills"); - -$id = GETPOST('id','int'); -$action = GETPOST('action','alpha'); -$ref = GETPOST('ref'); -$confirm = GETPOST('confirm'); -$lineid = GETPOST('lineid','int'); - -// Security check -$socid = GETPOST('socid','int'); -if ($user->societe_id) $socid=$user->societe_id; -if ($user->societe_id > 0) -{ - unset($_GET["action"]); - $action=''; -} -$result = restrictedArea($user, 'agenda', $objectid, 'actioncomm&societe', 'myactions|allactions', 'fk_soc', 'id'); - - -$object = new ActionComm($db); - - -/* - * Actions - */ - -// Add new contact -if ($action == 'addcontact' && $user->rights->action->creer) -{ - $result = $object->fetch($id); - - if ($object->id > 0) - { - $contactid = (GETPOST('userid','int') ? GETPOST('userid','int') : GETPOST('contactid','int')); - $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]); - } - - if ($result >= 0) - { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } - else - { - if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') - { - $langs->load("errors"); - setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors'); - } - else - { - setEventMessage($object->error, 'errors'); - } - } -} - -// modification d'un contact. On enregistre le type -if ($action == 'updateline') -{ - if ($object->fetch($id)) - { - $contact = $object->detail_contact($_POST["line"]); - $type = $_POST["type"]; - $statut = $contact->statut; - - $result = $object->update_contact($_POST["line"], $statut, $type); - if ($result >= 0) - { - $db->commit(); - } else - { - dol_print_error($db, "result=$result"); - $db->rollback(); - } - } - else - { - setEventMessage($object->error, 'errors'); - } -} - -// Bascule du statut d'un contact -else if ($action == 'swapstatut') -{ - if ($object->id > 0) - { - $result=$object->swapContactStatus(GETPOST('ligne')); - } -} - -// Efface un contact -else if ($action == 'deletecontact') -{ - $result = $object->delete_contact($lineid); - - if ($result >= 0) - { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } - else - { - dol_print_error($db); - } -} - -/* - * View - */ - -$form = new Form($db); -$formcompany= new FormCompany($db); - -$contactstatic=new Contact($db); -$userstatic=new User($db); - -$help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda'; -llxHeader('',$langs->trans("Agenda"),$help_url); - - -if ($id > 0 || ! empty($ref)) -{ - if ($object->fetch($id,$ref) > 0) - { - - $head=actions_prepare_head($object); - dol_fiche_head($head, 'contact', $langs->trans("Action"),0,'action'); - - // Affichage fiche action en mode visu - print '<table class="border" width="100%">'; - - $linkback = '<a href="'.DOL_URL_ROOT.'/comm/action/index.php">'.$langs->trans("BackToList").'</a>'; - - // Ref - print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td colspan="3">'; - print $form->showrefnav($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', ''); - print '</td></tr>'; - - // Type - if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) - { - print '<tr><td>'.$langs->trans("Type").'</td><td colspan="3">'.$object->type.'</td></tr>'; - } - - // Title - print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$object->label.'</td></tr>'; - - // Full day event - print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($object->fulldayevent).'</td></tr>'; - - // Date start - print '<tr><td width="30%">'.$langs->trans("DateActionStart").'</td><td colspan="2">'; - if (! $object->fulldayevent) print dol_print_date($object->datep,'dayhour'); - else print dol_print_date($object->datep,'day'); - if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late")); - print '</td>'; - print '<td rowspan="4" align="center" valign="middle" width="180">'."\n"; - print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">'; - print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; - print '<input type="hidden" name="action" value="show_month">'; - print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">'; - print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">'; - print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">'; - //print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">'; - print img_picto($langs->trans("ViewCal"),'object_calendar').' <input type="submit" style="width: 120px" class="button" name="viewcal" value="'.$langs->trans("ViewCal").'">'; - print '</form>'."\n"; - print '<form name="listactionsfilterweek" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">'; - print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; - print '<input type="hidden" name="action" value="show_week">'; - print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">'; - print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">'; - print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">'; - //print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">'; - print img_picto($langs->trans("ViewCal"),'object_calendarweek').' <input type="submit" style="width: 120px" class="button" name="viewweek" value="'.$langs->trans("ViewWeek").'">'; - print '</form>'."\n"; - print '<form name="listactionsfilterday" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">'; - print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; - print '<input type="hidden" name="action" value="show_day">'; - print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">'; - print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">'; - print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">'; - //print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">'; - print img_picto($langs->trans("ViewCal"),'object_calendarday').' <input type="submit" style="width: 120px" class="button" name="viewday" value="'.$langs->trans("ViewDay").'">'; - print '</form>'."\n"; - print '</td>'; - print '</tr>'; - - // Date end - print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="2">'; - if (! $object->fulldayevent) print dol_print_date($object->datef,'dayhour'); - else print dol_print_date($object->datef,'day'); - if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late")); - print '</td></tr>'; - - // Location - print '<tr><td>'.$langs->trans("Location").'</td><td colspan="2">'.$object->location.'</td></tr>'; - - print '</table>'; - - dol_fiche_end(); - - print '<br>'; - - // Contacts lines (modules that overwrite templates must declare this into descriptor) - $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl')); - foreach($dirtpls as $reldir) - { - $res=@include dol_buildpath($reldir.'/contacts.tpl.php'); - if ($res) break; - } - - } - else - { - print "ErrorRecordNotFound"; - } -} - -llxFooter(); - -$db->close(); - diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 5e180f66abbc53a1b1df56ba6ca1df4be8bd7bea..9bb3af6dcbdced5412cb002a7240f6a93a1440d1 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -41,7 +41,7 @@ $langs->load("commercial"); $langs->load("other"); $langs->load("bills"); -$objectid = GETPOST('id', 'int'); +$id = GETPOST('id', 'int'); $action=GETPOST('action', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); @@ -53,13 +53,13 @@ if ($user->societe_id > 0) unset($_GET["action"]); $action=''; } -$result = restrictedArea($user, 'agenda', $objectid, 'actioncomm&societe', 'myactions|allactions', 'fk_soc', 'id'); +$result = restrictedArea($user, 'agenda', $id, 'actioncomm&societe', 'myactions|allactions', 'fk_soc', 'id'); $object = new ActionComm($db); -if ($objectid > 0) +if ($id > 0) { - $ret = $object->fetch($objectid); + $ret = $object->fetch($id); $object->fetch_thirdparty(); } @@ -96,11 +96,25 @@ llxHeader('',$langs->trans("Agenda"),$help_url); if ($object->id > 0) { + $result1=$object->fetch($id); + $result2=$object->fetch_thirdparty(); + $result3=$object->fetch_contact(); + $result4=$object->fetch_userassigned(); + $result5=$object->fetch_optionals($id,$extralabels); + + if ($result1 < 0 || $result2 < 0 || $result3 < 0 || $result4 < 0 || $result5 < 0) + { + dol_print_error($db,$object->error); + exit; + } + + if ($object->authorid > 0) { $tmpuser=new User($db); $res=$tmpuser->fetch($object->authorid); $object->author=$tmpuser; } + if ($object->usermodid > 0) { $tmpuser=new User($db); $res=$tmpuser->fetch($object->usermodid); $object->usermod=$tmpuser; } + $author=new User($db); $author->fetch($object->author->id); $object->author=$author; - $object->fetch_contact(); $head=actions_prepare_head($object); @@ -132,53 +146,15 @@ if ($object->id > 0) print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($object->fulldayevent).'</td></tr>'; // Date start - print '<tr><td width="30%">'.$langs->trans("DateActionStart").'</td><td colspan="2">'; + print '<tr><td width="30%">'.$langs->trans("DateActionStart").'</td><td colspan="3">'; if (! $object->fulldayevent) print dol_print_date($object->datep,'dayhour'); else print dol_print_date($object->datep,'day'); if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late")); print '</td>'; - print '<td rowspan="5" align="center" valign="middle" width="180">'."\n"; - print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">'; - print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; - print '<input type="hidden" name="action" value="show_month">'; - print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">'; - print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">'; - print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">'; - //print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">'; - print img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewcal" value="'.$langs->trans("ViewCal").'">'; - print '</form>'."\n"; - print '<form name="listactionsfilterweek" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">'; - print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; - print '<input type="hidden" name="action" value="show_week">'; - print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">'; - print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">'; - print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">'; - //print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">'; - print img_picto($langs->trans("ViewCal"),'object_calendarweek','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewweek" value="'.$langs->trans("ViewWeek").'">'; - print '</form>'."\n"; - print '<form name="listactionsfilterday" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">'; - print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; - print '<input type="hidden" name="action" value="show_day">'; - print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">'; - print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">'; - print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">'; - //print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">'; - print img_picto($langs->trans("ViewCal"),'object_calendarday','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewday" value="'.$langs->trans("ViewDay").'">'; - print '</form>'."\n"; - print '<form name="listactionsfilterperuser" action="'.DOL_URL_ROOT.'/comm/action/peruser.php" method="POST">'; - print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; - print '<input type="hidden" name="action" value="show_peruser">'; - print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">'; - print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">'; - print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">'; - //print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">'; - print img_picto($langs->trans("ViewCal"),'object_calendarperuser','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewperuser" value="'.$langs->trans("ViewPerUser").'">'; - print '</form>'."\n"; - print '</td>'; print '</tr>'; // Date end - print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="2">'; + print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="3">'; if (! $object->fulldayevent) print dol_print_date($object->datef,'dayhour'); else print dol_print_date($object->datef,'day'); if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late")); @@ -190,16 +166,38 @@ if ($object->id > 0) print '</td></tr>'; // Location - print '<tr><td>'.$langs->trans("Location").'</td><td colspan="2">'.$object->location.'</td></tr>'; + if (empty($conf->global->AGENDA_DISABLE_LOCATION)) + { + print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3">'.$object->location.'</td></tr>'; + } // Assigned to - print '<tr><td width="30%" class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td>'; - if ($object->userownerid > 0) + print '<tr><td width="30%" class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td colspan="3">'; + $listofuserid=array(); + if (empty($donotclearsession)) { - $tmpuser=new User($object->userownerid); - print $tmpuser->getNomUrl(1); + if ($object->userownerid > 0) $listofuserid[$object->userownerid]=array('id'=>$object->userownerid,'transparency'=>$object->transparency); // Owner first + if (! empty($object->userassigned)) // Now concat assigned users + { + // Restore array with key with same value than param 'id' + $tmplist1=$object->userassigned; $tmplist2=array(); + foreach($tmplist1 as $key => $val) + { + if ($val['id'] && $val['id'] != $object->userownerid) $listofuserid[$val['id']]=$val; + } + } + $_SESSION['assignedtouser']=dol_json_encode($listofuserid); } - print '</td></tr>'; + else + { + if (!empty($_SESSION['assignedtouser'])) + { + $listofuserid=dol_json_decode($_SESSION['assignedtouser'], true); + } + } + print $form->select_dolusers_forevent('view','assignedtouser',1); + if (in_array($user->id,array_keys($listofuserid))) print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody + print ' </td></tr>'; print '</table><br><br><table class="border" width="100%">'; @@ -252,8 +250,20 @@ if ($object->id > 0) print ($object->priority?$object->priority:''); print '</td></tr>'; + // Other attributes + $parameters=array('colspan'=>' colspan="3"', 'colspanvalue'=>'3', 'id'=>$object->id); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if (empty($reshook) && ! empty($extrafields->attribute_label)) + { + print $object->showOptionals($extrafields,'edit'); + } - print '</table><br><br><table class="border" width="100%">'; + + print '</table>'; + + print '<br><br>'; + + print '<table class="border" width="100%">'; // Construit liste des fichiers $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); @@ -266,7 +276,8 @@ if ($object->id > 0) print '<tr><td width="30%" nowrap>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>'; print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>'; - print '</table>'; + + print '</table>'; print '</div>'; @@ -274,6 +285,52 @@ if ($object->id > 0) $permission = $user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create; $param = '&id=' . $object->id; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; + + + if ($action != 'edit') + { + print "<br>"; + + // Link to agenda views + print '<div id="agendaviewbutton">'; + print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST" style="float: left; padding-right: 10px;">'; + print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; + print '<input type="hidden" name="action" value="show_month">'; + print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">'; + print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">'; + print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">'; + //print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">'; + print img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewcal" value="'.$langs->trans("ViewCal").'">'; + print '</form>'."\n"; + print '<form name="listactionsfilterweek" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST" style="float: left; padding-right: 10px;">'; + print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; + print '<input type="hidden" name="action" value="show_week">'; + print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">'; + print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">'; + print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">'; + //print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">'; + print img_picto($langs->trans("ViewCal"),'object_calendarweek','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewweek" value="'.$langs->trans("ViewWeek").'">'; + print '</form>'."\n"; + print '<form name="listactionsfilterday" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST" style="float: left; padding-right: 10px;">'; + print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; + print '<input type="hidden" name="action" value="show_day">'; + print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">'; + print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">'; + print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">'; + //print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">'; + print img_picto($langs->trans("ViewCal"),'object_calendarday','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewday" value="'.$langs->trans("ViewDay").'">'; + print '</form>'."\n"; + print '<form name="listactionsfilterperuser" action="'.DOL_URL_ROOT.'/comm/action/peruser.php" method="POST" style="float: left; padding-right: 10px;">'; + print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; + print '<input type="hidden" name="action" value="show_peruser">'; + print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">'; + print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">'; + print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">'; + //print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">'; + print img_picto($langs->trans("ViewCal"),'object_calendarperuser','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewperuser" value="'.$langs->trans("ViewPerUser").'">'; + print '</form>'."\n"; + print '</div>'; + } } else { diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index c534724671982b458562683b16d475163c575c70..4129b561ed1abfd82afac9d520c4d18f754fabd2 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -118,6 +118,23 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) print "<br>"; } +// Search contract +if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) +{ + $var=false; + print '<form method="post" action="'.DOL_URL_ROOT.'/fichinter/list.php">'; + print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; + print '<table class="noborder nohover" width="100%">'; + print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchAnIntervention").'</td></tr>'; + print '<tr '.$bc[$var].'>'; + print '<td class="nowrap"><label for="search_contract">'.$langs->trans("Ref").'</label>:</td><td><input type="text" class="flat" name="search_inter" id="search_inter" size="18"></td>'; + print '<td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>'; + print '<tr '.$bc[$var].'><td class="nowrap"><label for="sall">'.$langs->trans("Other").'</label>:</td><td><input type="text" class="flat" name="sall" id="sall" size="18"></td>'; + print '</tr>'; + print "</table></form>\n"; + print "<br>"; +} + /* * Draft proposals */ diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 189f1f9c041056e70515476f5d9b504a6b1d031b..3eeef6916eb21cb6adf2c5697d73d0691234759a 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -535,7 +535,7 @@ else if ($action == 'classifybilled' && $user->rights->propal->cloturer) { // Reopen proposal else if ($action == 'confirm_reopen' && $user->rights->propal->cloturer && ! GETPOST('cancel')) { // prevent browser refresh from reopening proposal several times - if ($object->statut == 2 || $object->statut == 3) { + if ($object->statut == 2 || $object->statut == 3 || $object->statut == 4) { $object->reopen($user, 1); } } @@ -553,146 +553,19 @@ else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST( } } -// Add file in email form -if (GETPOST('addfile')) { - require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; - - // Set tmp user directory TODO Use a dedicated directory for temp mails files - $vardir = $conf->user->dir_output . "/" . $user->id; - $upload_dir_tmp = $vardir . '/temp'; - - dol_add_file_process($upload_dir_tmp, 0, 0); - $action = 'presend'; -} - -// Remove file in email form -if (GETPOST('removedfile')) { - require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; - - // Set tmp user directory - $vardir = $conf->user->dir_output . "/" . $user->id; - $upload_dir_tmp = $vardir . '/temp'; - - // TODO Delete only files that was uploaded from email form - dol_remove_file_process($_POST['removedfile'], 0); - $action = 'presend'; -} /* * Send mail */ -if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! GETPOST('cancel')) { - $langs->load('mails'); - - if ($object->id > 0) { - if ($_POST['sendto']) { - // Le destinataire a ete fourni via le champ libre - $sendto = $_POST['sendto']; - $sendtoid = 0; - } elseif ($_POST['receiver'] != '-1') { - // Recipient was provided from combo list - if ($_POST['receiver'] == 'thirdparty') // Id of third party - { - $sendto = $object->thirdparty->email; - $sendtoid = 0; - } else // Id du contact - { - $sendto = $object->thirdparty->contact_get_property($_POST['receiver'], 'email'); - $sendtoid = $_POST['receiver']; - } - } - if (dol_strlen($sendto)) { - $langs->load("commercial"); +// Actions to send emails +$actiontypecode='AC_PROP'; +$trigger_name='PROPAL_SENTBYMAIL'; +$paramname='id'; +$mode='emailfromproposal'; +include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; - $from = $_POST['fromname'] . ' <' . $_POST['frommail'] . '>'; - $replyto = $_POST['replytoname'] . ' <' . $_POST['replytomail'] . '>'; - $message = $_POST['message']; - $sendtocc = $_POST['sendtocc']; - $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO); - $deliveryreceipt = $_POST['deliveryreceipt']; - if (dol_strlen($_POST['subject'])) - $subject = $_POST['subject']; - else - $subject = $langs->transnoentities('Propal') . ' ' . $object->ref; - $actiontypecode = 'AC_PROP'; - $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto; - if ($message) { - if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); - $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); - $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); - $actionmsg = dol_concatdesc($actionmsg, $message); - } - $actionmsg2 = $langs->transnoentities('Action' . $actiontypecode); - - // Create form object - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - - $attachedfiles = $formmail->get_attached_files(); - $filepath = $attachedfiles ['paths']; - $filename = $attachedfiles ['names']; - $mimetype = $attachedfiles ['mimes']; - - // Envoi de la propal - require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, - 1); - if ($mailfile->error) { - setEventMessage($mailfile->error, 'errors'); - } else { - $result = $mailfile->sendfile(); - if ($result) { - // Initialisation donnees - $object->sendtoid = $sendtoid; - $object->actiontypecode = $actiontypecode; - $object->actionmsg = $actionmsg; - $object->actionmsg2 = $actionmsg2; - $object->fk_element = $object->id; - $object->elementtype = $object->element; - - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface = new Interfaces($db); - $result = $interface->run_triggers('PROPAL_SENTBYMAIL', $object, $user, $langs, $conf); - if ($result < 0) { - $error++; - $object->errors = $interface->errors; - } - // Fin appel triggers - - if (! $error) { - // Redirect here - // This avoid sending mail twice if going out and then back to page - $mesg = $langs->trans('MailSuccessfulySent', $mailfile->getValidAddress($from, 2), $mailfile->getValidAddress($sendto, 2)); - setEventMessage($mesg); - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); - exit(); - } else { - dol_print_error($db); - } - } else { - $langs->load("other"); - if ($mailfile->error) { - $mesg .= $langs->trans('ErrorFailedToSendMail', $from, $sendto); - $mesg .= '<br>' . $mailfile->error; - } else { - $mesg .= 'No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS'; - } - setEventMessage($mesg, 'errors'); - } - } - } else { - $langs->load("other"); - setEventMessage($langs->trans('ErrorMailRecipientIsEmpty') . '!', 'errors'); - dol_syslog($langs->trans('ErrorMailRecipientIsEmpty')); - } - } else { - $langs->load("other"); - setEventMessage($langs->trans('ErrorFailedToReadEntity', $langs->trans("Proposal")), 'errors'); - dol_syslog($langs->trans('ErrorFailedToReadEntity', $langs->trans("Proposal"))); - } -} // Go back to draft if ($action == 'modif' && $user->rights->propal->creer) @@ -2201,7 +2074,7 @@ if ($action == 'create') } // ReOpen - if (($object->statut == 2 || $object->statut == 3) && $user->rights->propal->cloturer) { + if (($object->statut == 2 || $object->statut == 3 || $object->statut == 4) && $user->rights->propal->cloturer) { print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=reopen' . (empty($conf->global->MAIN_JUMP_TAG) ? '' : '#reopen') . '"'; print '>' . $langs->trans('ReOpen') . '</a></div>'; } @@ -2368,13 +2241,13 @@ if ($action == 'create') $formmail->withcancel = 1; // Tableau des substitutions - $formmail->substit ['__PROPREF__'] = $object->ref; - $formmail->substit ['__SIGNATURE__'] = $user->signature; - $formmail->substit ['__REFCLIENT__'] = $object->ref_client; - $formmail->substit ['__THIRPARTY_NAME__'] = $object->thirdparty->name; - $formmail->substit ['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:''); - $formmail->substit ['__PERSONALIZED__'] = ''; - $formmail->substit ['__CONTACTCIVNAME__'] = ''; + $formmail->substit['__PROPREF__'] = $object->ref; + $formmail->substit['__SIGNATURE__'] = $user->signature; + $formmail->substit['__REFCLIENT__'] = $object->ref_client; + $formmail->substit['__THIRPARTY_NAME__'] = $object->thirdparty->name; + $formmail->substit['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:''); + $formmail->substit['__PERSONALIZED__'] = ''; + $formmail->substit['__CONTACTCIVNAME__'] = ''; // Find the good contact adress $custcontact = ''; @@ -2391,15 +2264,15 @@ if ($action == 'create') } if (! empty($custcontact)) { - $formmail->substit ['__CONTACTCIVNAME__'] = $custcontact; + $formmail->substit['__CONTACTCIVNAME__'] = $custcontact; } } // Tableau des parametres complementaires - $formmail->param ['action'] = 'send'; - $formmail->param ['models'] = 'propal_send'; - $formmail->param ['id'] = $object->id; - $formmail->param ['returnurl'] = $_SERVER["PHP_SELF"] . '?id=' . $object->id; + $formmail->param['action'] = 'send'; + $formmail->param['models'] = 'propal_send'; + $formmail->param['id'] = $object->id; + $formmail->param['returnurl'] = $_SERVER["PHP_SELF"] . '?id=' . $object->id; // Init list of files if (GETPOST("mode") == 'init') { $formmail->clear_attached_files(); diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index c056e5aa1c550605f0c84d6be897360d4a317749..15d85afec07cfd29210b4a2301dabeebb7b70417 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1739,8 +1739,14 @@ class Propal extends CommonObject $resql=$this->db->query($sql); if ($resql) { + $modelpdf=$conf->global->PROPALE_ADDON_PDF_ODT_CLOSED?$conf->global->PROPALE_ADDON_PDF_ODT_CLOSED:$this->modelpdf; + $trigger_name='PROPAL_CLOSE_REFUSED'; + if ($statut == 2) { + $trigger_name='PROPAL_CLOSE_SIGNED'; + $modelpdf=$conf->global->PROPALE_ADDON_PDF_ODT_TOBILL?$conf->global->PROPALE_ADDON_PDF_ODT_TOBILL:$this->modelpdf; + // The connected company is classified as a client $soc=new Societe($this->db); $soc->id = $this->socid; @@ -1752,48 +1758,31 @@ class Propal extends CommonObject $this->db->rollback(); return -2; } - - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $this->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - //$ret=$object->fetch($id); // Reload to get new records - $this->generateDocument($conf->global->PROPALE_ADDON_PDF_ODT_TOBILL?$conf->global->PROPALE_ADDON_PDF_ODT_TOBILL:$this->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - // Call trigger - $result=$this->call_trigger('PROPAL_CLOSE_SIGNED',$user); - if ($result < 0) { $error++; } - // End call triggers } - else + if ($statut == 4) { + $trigger_name='PROPAL_CLASSIFY_BILLED'; + } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $this->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - //$ret=$object->fetch($id); // Reload to get new records - $this->generateDocument($conf->global->PROPALE_ADDON_PDF_ODT_CLOSED?$conf->global->PROPALE_ADDON_PDF_ODT_CLOSED:$this->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - // Call trigger - $result=$this->call_trigger('PROPAL_CLOSE_REFUSED',$user); - if ($result < 0) { $error++; } - // End call triggers + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $this->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + //$ret=$object->fetch($id); // Reload to get new records + $this->generateDocument($modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } + + // Call trigger + $result=$this->call_trigger($trigger_name,$user); + if ($result < 0) { $error++; } + // End call triggers + if ( ! $error ) { $this->db->commit(); diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 6522a592097946c2a8445cddabe905e2583c503d..2b8e478d37db81a816c8630fef9845d6ede6e447 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -322,8 +322,11 @@ if ($result) print '<td class="liste_titre" align="right">'; $formpropal->selectProposalStatus($viewstatut,1); print '</td>'; - print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; - print '</td>'; + print '<td class="liste_titre" align="right">'; + print '<input type="image" value="button_search" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; + print ' '; + print '<input type="image" value="button_removefilter" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; + print '</td>'; print "</tr>\n"; $var=true; diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index 94286ee4c53e8b3612434bbaf3525e53d808bf74..113618ffae893fae54a44b04fedbc0a149926f46 100644 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -48,7 +48,6 @@ $search_state = GETPOST("search_state"); $search_datec = GETPOST("search_datec"); $search_categ = GETPOST("search_categ",'int'); $search_status = GETPOST("search_status",'int'); -if ($search_status=='') $search_status=1; // always display activ customer first $catid = GETPOST("catid",'int'); $sortfield = GETPOST("sortfield",'alpha'); @@ -154,6 +153,21 @@ $sts = array(-1,0,1,2,3); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('prospectlist')); +// Do we click on purge search criteria ? +if (GETPOST("button_removefilter_x")) +{ + $socname=""; + $stcomm=""; + $search_nom=""; + $search_zipcode=""; + $search_town=""; + $search_state=""; + $search_datec=""; + $search_categ=""; + $search_status=""; +} + +if ($search_status=='') $search_status=1; // always display active customer first /* * Actions @@ -361,7 +375,7 @@ if ($resql) // Print these two select print $langs->trans("From").' <select class="flat" name="search_level_from">'.$options_from.'</select>'; print ' '; - print $langs->trans("To").' <select class="flat" name="search_level_to">'.$options_to.'</select>'; + print $langs->trans("to").' <select class="flat" name="search_level_to">'.$options_to.'</select>'; print '</td>'; @@ -378,9 +392,9 @@ if ($resql) print '</td>'; // Print the search button - print '<td class="liste_titre" align="right">'; - print '<input class="liste_titre" name="button_search" type="image" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; - print '</td>'; + print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; + print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; + print "</td></tr>\n"; $parameters=array(); $formconfirm=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 792da64a9232dde5bac3b49f37e33784df4ea64e..4bf1eceb6dc8c0e96cdf19c123a88c38ca876ce4 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1151,162 +1151,18 @@ else if ($action == 'update_extras') { $action = 'edit_extras'; } -/* - * Add file in email form - */ -if (GETPOST('addfile')) { - require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; - - // Set tmp user directory TODO Use a dedicated directory for temp mails files - $vardir = $conf->user->dir_output . "/" . $user->id; - $upload_dir_tmp = $vardir . '/temp'; - - dol_add_file_process($upload_dir_tmp, 0, 0); - $action = 'presend'; -} - -/* - * Remove file in email form - */ -if (GETPOST('removedfile')) { - require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; - - // Set tmp user directory - $vardir = $conf->user->dir_output . "/" . $user->id; - $upload_dir_tmp = $vardir . '/temp'; - - // TODO Delete only files that was uploaded from email form - dol_remove_file_process(GETPOST('removedfile'), 0); - $action = 'presend'; -} - /* * Send mail */ -if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! GETPOST('cancel')) { - $langs->load('mails'); - - if ($object->id > 0) { - // $ref = dol_sanitizeFileName($object->ref); - // $file = $conf->commande->dir_output . '/' . $ref . '/' . $ref . '.pdf'; - - // if (is_readable($file)) - // { - if (GETPOST('sendto')) { - // Le destinataire a ete fourni via le champ libre - $sendto = GETPOST('sendto'); - $sendtoid = 0; - } elseif (GETPOST('receiver') != '-1') { - // Recipient was provided from combo list - if (GETPOST('receiver') == 'thirdparty') // Id of third party - { - $sendto = $object->thirdparty->email; - $sendtoid = 0; - } else // Id du contact - { - $sendto = $object->thirdparty->contact_get_property(GETPOST('receiver'), 'email'); - $sendtoid = GETPOST('receiver'); - } - } - - if (dol_strlen($sendto)) { - $langs->load("commercial"); - - $from = GETPOST('fromname') . ' <' . GETPOST('frommail') . '>'; - $replyto = GETPOST('replytoname') . ' <' . GETPOST('replytomail') . '>'; - $message = GETPOST('message'); - $sendtocc = GETPOST('sendtocc'); - $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO); - $deliveryreceipt = GETPOST('deliveryreceipt'); - - if ($action == 'send') { - if (dol_strlen(GETPOST('subject'))) - $subject = GETPOST('subject'); - else - $subject = $langs->transnoentities('Order') . ' ' . $object->ref; - $actiontypecode = 'AC_COM'; - $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto; - if ($message) { - if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); - $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); - $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); - $actionmsg = dol_concatdesc($actionmsg, $message); - } - $actionmsg2 = $langs->transnoentities('Action' . $actiontypecode); - } - - // Create form object - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - $attachedfiles = $formmail->get_attached_files(); - $filepath = $attachedfiles ['paths']; - $filename = $attachedfiles ['names']; - $mimetype = $attachedfiles ['mimes']; +// Actions to send emails +$actiontypecode='AC_COM'; +$trigger_name='ORDER_SENTBYMAIL'; +$paramname='id'; +$mode='emailfromorder'; +include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; - // Send mail - require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, - 1); - if ($mailfile->error) { - setEventMessage($mailfile->error, 'errors'); - } else { - $result = $mailfile->sendfile(); - if ($result) { - //Must not contain quotes - $mesg = $langs->trans('MailSuccessfulySent', $mailfile->getValidAddress($from, 2), $mailfile->getValidAddress($sendto, 2)); - setEventMessage($mesg); - - $error = 0; - - // Initialisation donnees - $object->sendtoid = $sendtoid; - $object->actiontypecode = $actiontypecode; - $object->actionmsg = $actionmsg; - $object->actionmsg2 = $actionmsg2; - $object->fk_element = $object->id; - $object->elementtype = $object->element; - - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface = new Interfaces($db); - $result = $interface->run_triggers('ORDER_SENTBYMAIL', $object, $user, $langs, $conf); - if ($result < 0) { - $error ++; - $this->errors = $interface->errors; - } - // Fin appel triggers - - if ($error) { - dol_print_error($db); - } else { - // Redirect here - // This avoid sending mail twice if going out and then back to page - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); - exit(); - } - } else { - $langs->load("other"); - if ($mailfile->error) { - $mesg .= $langs->trans('ErrorFailedToSendMail', $from, $sendto); - $mesg .= '<br>' . $mailfile->error; - } else { - $mesg .= 'No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS'; - } - setEventMessage($mesg, 'errors'); - } - } - } else { - $langs->load("other"); - setEventMessage($langs->trans('ErrorMailRecipientIsEmpty') . '!', 'errors'); - dol_syslog($langs->trans('ErrorMailRecipientIsEmpty')); - } - } else { - $langs->load("other"); - setEventMessage($langs->trans('ErrorFailedToReadEntity', $langs->trans("Order")), 'errors'); - dol_syslog($langs->trans('ErrorFailedToReadEntity', $langs->trans("Order"))); - } -} if (! $error && ! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->commande->creer) { if ($action == 'addcontact') { diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php index 25b7d91a3ffa80a83629c29b0cb35f4d14f9228c..1e8196481e6ddc1b4e0a11e26c19b4335c09d322 100644 --- a/htdocs/compta/bank/search.php +++ b/htdocs/compta/bank/search.php @@ -35,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; $langs->load("banks"); $langs->load("categories"); $langs->load("companies"); +$langs->load("margins"); // Security check if ($user->societe_id) $socid=$user->societe_id; @@ -72,6 +73,15 @@ $limit = $conf->liste_limit; if (! $sortorder) $sortorder='DESC'; if (! $sortfield) $sortfield='b.dateo'; +if (GETPOST("button_removefilter")) +{ + $description=""; + $type=""; + $debit=""; + $credit=""; + $account=""; + $bid=""; +} /* * View @@ -198,7 +208,7 @@ if ($resql) print '<td class="liste_titre"> </td>'; print '<td class="liste_titre"> </td>'; print '<td class="liste_titre" align="center">'; - $form->select_types_paiements(empty($_REQUEST["type"])?'':$_REQUEST["type"], 'type', '', 2, 0, 1, 8); + $form->select_types_paiements(empty($type)?'':$type, 'type', '', 2, 0, 1, 8); print '</td>'; print '<td class="liste_titre"><input type="text" class="flat" name="req_nb" value="'.GETPOST("req_nb").'" size="2"></td>'; print '<td class="liste_titre">'; @@ -214,9 +224,9 @@ if ($resql) print '<td class="liste_titre" align="right">'; print '<input type="hidden" name="action" value="search">'; if (! empty($_REQUEST['bid'])) print '<input type="hidden" name="bid" value="'.$_REQUEST["bid"].'">'; - print '<input type="image" class="liste_titre" name="submit" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; - print '</td>'; - print '</tr>'; + print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; + print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; + print "</td></tr>\n"; // Loop on each record $total_debit=0; diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php index bb2c50b42bf704ef8661045a81828e6d69d33558..da0e3e21dcdc3a38fe9c76e0fa6c8a599493a35f 100644 --- a/htdocs/compta/deplacement/list.php +++ b/htdocs/compta/deplacement/list.php @@ -27,6 +27,8 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; $langs->load("companies"); $langs->load("users"); @@ -37,6 +39,10 @@ $socid = GETPOST('socid','int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'deplacement','',''); +$search_ref=GETPOST('search_ref','int'); +$search_name=GETPOST('search_name','alpha'); +$search_company=GETPOST('search_company','alpha'); +// $search_amount=GETPOST('search_amount','alpha'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -48,13 +54,24 @@ if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="d.dated"; $limit = $conf->liste_limit; -$search_ref=GETPOST('search_ref','alpha'); +$year=GETPOST("year"); +$month=GETPOST("month"); +if (GETPOST("button_removefilter")) +{ + $search_ref=""; + $search_name=""; + $search_company=""; + // $search_amount=""; + $year=""; + $month=""; +} /* * View */ +$formother = new FormOther($db); $tripandexpense_static=new Deplacement($db); $userstatic = new User($db); @@ -76,10 +93,31 @@ $sql.= " AND d.entity = ".$conf->entity; if (empty($user->rights->deplacement->readall) && empty($user->rights->deplacement->lire_tous)) $sql.=' AND d.fk_user IN ('.join(',',$childids).')'; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = ".$socid; -if (trim($search_ref) != '') + +if ($search_ref) $sql.=" AND d.rowid=".$search_ref; +if ($search_name) +{ + $sql .= natural_search('u.lastname', $search_name); +} +if ($search_company) +{ + $sql .= natural_search('s.nom', $search_company); +} +// if ($search_amount) $sql.=" AND d.km='".$db->escape(price2num(trim($search_amount)))."'"; +if ($month > 0) +{ + if ($year > 0 && empty($day)) + $sql.= " AND d.dated BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'"; + else if ($year > 0 && ! empty($day)) + $sql.= " AND d.dated BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'"; + else + $sql.= " AND date_format(d.dated, '%m') = '".$month."'"; +} +else if ($year > 0) { - $sql.= ' AND d.rowid LIKE \'%'.$db->escape(trim($search_ref)) . '%\''; + $sql.= " AND bc.date_bordereau BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; } + $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit + 1, $offset); @@ -97,7 +135,7 @@ if ($resql) print "<tr class=\"liste_titre\">"; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"d.rowid","","&socid=$socid",'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"d.type","","&socid=$socid",'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"d.dated","","&socid=$socid",'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"d.dated","","&socid=$socid",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"u.lastname","","&socid=$socid",'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","&socid=$socid",'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("FeesKilometersOrAmout"),$_SERVER["PHP_SELF"],"d.km","","&socid=$socid",'align="right"',$sortfield,$sortorder); @@ -107,24 +145,27 @@ if ($resql) // Filters lines print '<tr class="liste_titre">'; print '<td class="liste_titre">'; - print '<input class="flat" size="10" type="text" name="search_ref" value="'.$search_ref.'">'; + print '<input class="flat" size="4" type="text" name="search_ref" value="'.$search_ref.'">'; print '</td>'; print '<td class="liste_titre">'; - //print '<input class="flat" size="10" type="text" name="search_company" value="'.$search_company.'">'; + print ' '; print '</td>'; - print '<td class="liste_titre">'; - //print '<input class="flat" size="10" type="text" name="search_name" value="'.$search_name.'">'; + print '<td class="liste_titre" align="center">'; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.$day.'">'; + print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">'; + $formother->select_year($year?$year:-1,'year',1, 20, 5); print '</td>'; - print '<td class="liste_titre" align="left">'; - print ' '; + print '<td class="liste_titre">'; + print '<input class="flat" size="10" type="text" name="search_name" value="'.$search_name.'">'; print '</td>'; - print '<td class="liste_titre" align="right">'; - print ' '; + print '<td class="liste_titre">'; + print '<input class="flat" size="10" type="text" name="search_company" value="'.$search_company.'">'; print '</td>'; print '<td class="liste_titre" align="right">'; - print ' '; + // print '<input class="flat" size="10" type="text" name="search_amount" value="'.$search_amount.'">'; print '</td>'; print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; + print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; print "</td></tr>\n"; $var=true; @@ -142,9 +183,9 @@ if ($resql) // Type print '<td>'.$langs->trans($obj->type).'</td>'; // Date - print '<td>'.dol_print_date($db->jdate($obj->dd),'day').'</td>'; + print '<td align="center">'.dol_print_date($db->jdate($obj->dd),'day').'</td>'; // User - print '<td align="left">'; + print '<td>'; $userstatic->id = $obj->rowid; $userstatic->lastname = $obj->lastname; $userstatic->firstname = $obj->firstname; diff --git a/htdocs/compta/dons/list.php b/htdocs/compta/dons/list.php index badc71c96e2fd04680755152dcefe50f329348bd..174b5357bb218717dcee7a3134a615e507d8c64e 100644 --- a/htdocs/compta/dons/list.php +++ b/htdocs/compta/dons/list.php @@ -43,12 +43,20 @@ if (! $sortfield) $sortfield="d.datedon"; $limit = $conf->liste_limit; $statut=isset($_GET["statut"])?$_GET["statut"]:"-1"; -$search_ref=GETPOST('search_ref'); -$search_company=GETPOST('search_company'); -$search_name=GETPOST('search_name'); +$search_ref=GETPOST('search_ref','alpha'); +$search_company=GETPOST('search_company','alpha'); +$search_name=GETPOST('search_name','alpha'); +$search_amount = GETPOST('search_amount','alpha'); if (!$user->rights->don->lire) accessforbidden(); +if (GETPOST("button_removefilter")) +{ + $search_ref=""; + $search_company=""; + $search_name=""; + $search_amount=""; +} /* * View @@ -82,6 +90,8 @@ if (trim($search_name) != '') { $sql .= natural_search(array('d.lastname', 'd.firstname'), $search_name); } +if ($search_amount) $sql.=" AND d.amount='".$db->escape(price2num(trim($search_amount)))."'"; + $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit+1, $offset); @@ -141,11 +151,10 @@ if ($resql) print ' '; print '</td>'; } - print '<td class="liste_titre" align="right">'; - print ' '; - print '</td>'; + print '<td class="liste_titre" align="right"><input name="search_amount" class="flat" type="text" size="8" value="'.$search_amount.'"></td>'; print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; - print "</td></tr>\n"; + print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; + print "</td></tr>\n"; $var=True; while ($i < min($num,$limit)) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 2ba425f5a90cafacfdca02a6492d83638f80e513..9d003ae0aa7e7f9c88d05d9573b23d5b0e28dda9 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1550,178 +1550,24 @@ if (GETPOST('linkedOrder')) { $result = $object->add_object_linked('commande', GETPOST('linkedOrder')); } -/* - * Add file in email form - */ -if (GETPOST('addfile')) { - require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; - - // Set tmp user directory - $vardir = $conf->user->dir_output . "/" . $user->id; - $upload_dir_tmp = $vardir . '/temp'; - - dol_add_file_process($upload_dir_tmp, 0, 0); - $action = 'presend'; -} - -/* - * Remove file in email form - */ -if (! empty($_POST['removedfile'])) { - require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; - - // Set tmp user directory - $vardir = $conf->user->dir_output . "/" . $user->id; - $upload_dir_tmp = $vardir . '/temp'; - - // TODO Delete only files that was uploaded from email form - dol_remove_file_process($_POST['removedfile'], 0); - $action = 'presend'; -} /* * Send mail */ -if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_POST['cancel']) { - $langs->load('mails'); - - $actiontypecode = ''; - $subject = ''; - $actionmsg = ''; - $actionmsg2 = ''; - - $result = $object->fetch($id); - $result = $object->fetch_thirdparty(); - - if ($result > 0) { - // $ref = dol_sanitizeFileName($object->ref); - // $file = $conf->facture->dir_output . '/' . $ref . '/' . $ref . '.pdf'; - - // if (is_readable($file)) - // { - if ($_POST['sendto']) { - // Le destinataire a ete fourni via le champ libre - $sendto = $_POST['sendto']; - $sendtoid = 0; - } elseif ($_POST['receiver'] != '-1') { - // Recipient was provided from combo list - if ($_POST['receiver'] == 'thirdparty') // Id of third party - { - $sendto = $object->thirdparty->email; - $sendtoid = 0; - } else // Id du contact - { - $sendto = $object->thirdparty->contact_get_property($_POST['receiver'], 'email'); - $sendtoid = $_POST['receiver']; - } - } - - if (dol_strlen($sendto)) - { - $langs->load("commercial"); - - $from = $_POST['fromname'] . ' <' . $_POST['frommail'] . '>'; - $replyto = $_POST['replytoname'] . ' <' . $_POST['replytomail'] . '>'; - $message = $_POST['message']; - $sendtocc = $_POST['sendtocc']; - $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO); - $deliveryreceipt = $_POST['deliveryreceipt']; - if ($action == 'send' || $action == 'relance') - { - if (dol_strlen($_POST['subject'])) - $subject = $_POST['subject']; - else - $subject = $langs->transnoentities('Bill') . ' ' . $object->ref; - $actiontypecode = 'AC_FAC'; - $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto; - if ($message) { - if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); - $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); - $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); - $actionmsg = dol_concatdesc($actionmsg, $message); - } - // $actionmsg2=$langs->transnoentities('Action'.$actiontypecode); - } - - // Create form object - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - - $attachedfiles = $formmail->get_attached_files(); - $filepath = $attachedfiles['paths']; - $filename = $attachedfiles['names']; - $mimetype = $attachedfiles['mimes']; - - // Send mail - require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, - 1); - if ($mailfile->error) { - setEventMessage($mailfile->error, 'errors'); - } else { - $result = $mailfile->sendfile(); - if ($result) { - $error = 0; - - // Initialisation donnees - $object->sendtoid = $sendtoid; - $object->actiontypecode = $actiontypecode; - $object->actionmsg = $actionmsg; // Long text - $object->actionmsg2 = $actionmsg2; // Short text - $object->fk_element = $object->id; - $object->elementtype = $object->element; - - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface = new Interfaces($db); - $result = $interface->run_triggers('BILL_SENTBYMAIL', $object, $user, $langs, $conf); - if ($result < 0) { - $error++; - $object->errors = $interface->errors; - } - // Fin appel triggers - - if ($error) { - dol_print_error($db); - } else { - // Redirect here - // This avoid sending mail twice if going out and then back to page - $mesg = $langs->trans('MailSuccessfulySent', $mailfile->getValidAddress($from, 2), $mailfile->getValidAddress($sendto, 2)); - setEventMessage($mesg); - header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id); - exit(); - } - } else { - $langs->load("other"); +// Actions to send emails +if (empty($id)) $id=$facid; +$actiontypecode='AC_FAC'; +$trigger_name='BILL_SENTBYMAIL'; +$paramname='id'; +$mode='emailfrominvoice'; +include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; - if ($mailfile->error) { - $mesg .= $langs->trans('ErrorFailedToSendMail', $from, $sendto); - $mesg .= '<br>' . $mailfile->error; - } else { - $mesg .= 'No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS'; - } - - setEventMessage($mesg, 'errors'); - } - } - } else { - $langs->load("other"); - setEventMessage($langs->trans('ErrorMailRecipientIsEmpty') . '!', 'errors'); - dol_syslog($langs->trans('ErrorMailRecipientIsEmpty')); - } - } else { - $langs->load("other"); - setEventMessage($langs->trans('ErrorFailedToReadEntity', $langs->trans("Invoice")), 'errors'); - dol_syslog('Impossible de lire les donnees de la facture. Le fichier facture n\'a peut-etre pas ete genere.'); - } - - $action = 'presend'; -} /* * Generate document */ -else if ($action == 'builddoc') // En get ou en post +if ($action == 'builddoc') // En get ou en post { $object->fetch($id); $object->fetch_thirdparty(); diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 1699656acb13084cb4d7e06893e34c96ce824285..47a6ee8ba74c6b6d5fb025dda11440d450a684a7 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -38,6 +38,9 @@ $langs->load("bills"); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'banque', '',''); +$search_ref = GETPOST('search_ref','int'); +$search_account = GETPOST('search_account','int'); +$search_amount = GETPOST('search_amount','alpha'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -57,6 +60,16 @@ $formother = new FormOther($db); $checkdepositstatic=new RemiseCheque($db); $accountstatic=new Account($db); +// If click on purge search criteria ? +if (GETPOST("button_removefilter_x")) +{ + $search_ref=''; + $search_amount=''; + $search_account=''; + $year=''; + $month=''; +} + /* * View */ @@ -72,9 +85,9 @@ $sql.= " WHERE bc.fk_bank_account = ba.rowid"; $sql.= " AND bc.entity = ".$conf->entity; // Search criteria -if (GETPOST("search_ref")) $sql.=" AND bc.number=".GETPOST("search_ref",'int'); -if (GETPOST("search_account") > 0) $sql.=" AND bc.fk_bank_account=".GETPOST("search_account",'int'); -if (GETPOST("search_amount")) $sql.=" AND bc.amount=".price2num(GETPOST("search_amount")); +if ($search_ref) $sql.=" AND bc.number=".$search_ref; +if ($search_account > 0) $sql.=" AND bc.fk_bank_account=".$search_account; +if ($search_amount) $sql.=" AND bc.amount='".$db->escape(price2num(trim($search_amount)))."'"; if ($month > 0) { if ($year > 0 && empty($day)) @@ -103,7 +116,7 @@ if ($resql) print_barre_liste($langs->trans("MenuChequeDeposits"), $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num); - print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">'; + print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">'; print '<table class="liste" width="100%">'; print '<tr class="liste_titre">'; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"bc.number","",$params,"",$sortfield,$sortorder); @@ -117,7 +130,7 @@ if ($resql) // Lignes des champs de filtre print '<tr class="liste_titre">'; print '<td class="liste_titre" align="left">'; - print '<input class="fat" type="text" size="4" name="search_ref" value="'.GETPOST('search_ref').'">'; + print '<input class="flat" type="text" size="4" name="search_ref" value="'.$search_ref.'">'; print '</td>'; print '<td class="liste_titre" align="center">'; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.$day.'">'; @@ -125,16 +138,15 @@ if ($resql) $formother->select_year($year?$year:-1,'year',1, 20, 5); print '</td>'; print '<td>'; - $form->select_comptes($_REQUEST["search_account"],'search_account',0,'',1); + $form->select_comptes($search_account,'search_account',0,'',1); print '</td>'; print '<td class="liste_titre"> </td>'; print '<td class="liste_titre" align="right">'; - print '<input class="fat" type="text" size="6" name="search_amount" value="'.GETPOST('search_amount').'">'; + print '<input class="flat" type="text" size="6" name="search_amount" value="'.$search_amount.'">'; print '</td>'; - print '<td class="liste_titre" align="right">'; - print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; - print '</td>'; - print "</tr>\n"; + print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; + print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; + print "</td></tr>\n"; $var=true; while ($i < min($num,$limit)) diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index da1f2bd28331d1deef6fbe7f09ab09a7dc3e8b52..65615b9bbf36c7338724c369aebd067bbeef9d84 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -42,6 +42,11 @@ $paymentstatic=new Paiement($db); $accountstatic=new Account($db); $companystatic=new Societe($db); +$search_ref=GETPOST("search_ref","int"); +$search_account=GETPOST("search_account","int"); +$search_paymenttype=GETPOST("search_paymenttype"); +$search_amount=GETPOST("search_amount"); +$search_company=GETPOST("search_company"); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -53,8 +58,14 @@ $limit = $conf->liste_limit; if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="p.rowid"; - - +if (GETPOST("button_removefilter")) +{ + $search_ref=""; + $search_account=""; + $search_amount=""; + $search_paymenttype=""; + $search_company=""; +} /* * View @@ -110,11 +121,11 @@ else else $sql.= " AND f.fk_user_author = ".$userid; } // Search criteria - if (GETPOST("search_ref")) $sql .=" AND p.rowid=".GETPOST("search_ref",'int'); - if (GETPOST("search_account") > 0) $sql .=" AND b.fk_account=".GETPOST("search_account",'int'); - if (GETPOST("search_paymenttype") != "") $sql .=" AND c.code='".GETPOST("search_paymenttype")."'"; - if (GETPOST("search_amount")) $sql .=" AND p.amount=".price2num(GETPOST("search_amount")); - if (GETPOST("search_company")) $sql .= natural_search('s.nom', GETPOST('search_company')); + if ($search_ref) $sql .=" AND p.rowid=".$search_ref; + if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account; + if ($search_paymenttype != "") $sql .=" AND c.code='".$search_paymenttype."'"; + if ($search_amount) $sql .=" AND p.amount='".price2num($search_amount)."'"; + if ($search_company) $sql .= natural_search('s.nom', $search_company); } $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit+1, $offset); @@ -129,9 +140,9 @@ if ($resql) $paramlist=''; $paramlist.=(GETPOST("orphelins")?"&orphelins=1":""); - $paramlist.=($_REQUEST["search_ref"]?"&search_ref=".$_REQUEST["search_ref"]:""); - $paramlist.=($_REQUEST["search_company"]?"&search_company=".$_REQUEST["search_company"]:""); - $paramlist.=($_REQUEST["search_amount"]?"&search_amount=".$_REQUEST["search_amount"]:""); + $paramlist.=($search_ref?"&search_ref=".$search_ref:""); + $paramlist.=($search_company?"&search_company=".$search_company:""); + $paramlist.=($search_amount?"&search_amount=".$search_amount:""); print_barre_liste($langs->trans("ReceivedCustomersPayments"), $page, $_SERVER["PHP_SELF"],$paramlist,$sortfield,$sortorder,'',$num); @@ -149,26 +160,29 @@ if ($resql) { print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut","",$paramlist,'align="right"',$sortfield,$sortorder); } - print "</tr>\n"; + print '<td class="liste_titre"> </td>'; + print "</tr>\n"; // Lines for filters fields print '<tr class="liste_titre">'; print '<td align="left">'; - print '<input class="fat" type="text" size="4" name="search_ref" value="'.$_REQUEST["search_ref"].'">'; + print '<input class="flat" type="text" size="4" name="search_ref" value="'.$search_ref.'">'; print '</td>'; print '<td> </td>'; print '<td align="left">'; - print '<input class="fat" type="text" size="6" name="search_company" value="'.$_REQUEST["search_company"].'">'; + print '<input class="flat" type="text" size="6" name="search_company" value="'.$search_company.'">'; print '</td>'; print '<td>'; - $form->select_types_paiements($_REQUEST["search_paymenttype"],'search_paymenttype','',2,1,1); + $form->select_types_paiements($search_paymenttype,'search_paymenttype','',2,1,1); print '</td>'; print '<td>'; - $form->select_comptes($_REQUEST["search_account"],'search_account',0,'',1); + $form->select_comptes($search_account,'search_account',0,'',1); print '</td>'; print '<td align="right">'; - print '<input class="fat" type="text" size="4" name="search_amount" value="'.$_REQUEST["search_amount"].'">'; + print '<input class="flat" type="text" size="4" name="search_amount" value="'.$search_amount.'">'; + print '</td><td align="right">'; print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; + print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; print '</td>'; if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { @@ -223,7 +237,8 @@ if ($resql) if ($objp->statut == 0) print '</a>'; print '</td>'; } - + + print '<td> </td>'; print '</tr>'; $i++; diff --git a/htdocs/compta/prelevement/bon.php b/htdocs/compta/prelevement/bon.php deleted file mode 100644 index 20d60c3a55b48353e7dc4f409c5d7109faa0d3c8..0000000000000000000000000000000000000000 --- a/htdocs/compta/prelevement/bon.php +++ /dev/null @@ -1,103 +0,0 @@ -<?php -/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> - * Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net> - * Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es> - * - * 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 <http://www.gnu.org/licenses/>. - */ - -/** - * \file htdocs/compta/prelevement/bon.php - * \ingroup prelevement - * \brief Fiche apercu du bon de prelevement - */ - -require('../../main.inc.php'); -require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); -$langs->load("bills"); -$langs->load("categories"); - -// Security check -$socid=0; -$id = GETPOST('id','int'); -$ref = GETPOST('ref','alpha'); -if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'prelevement', $id); - - -llxHeader('','Bon de prelevement'); - -$form = new Form($db); - -if ($id > 0 || ! empty($ref)) -{ - $object = new BonPrelevement($db,""); - - if ($object->fetch($id) == 0) - { - $head = prelevement_prepare_head($object); - dol_fiche_head($head, 'preview', 'Prelevement : '. $object->ref); - - print '<table class="border" width="100%">'; - - print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$object->ref.'</td></tr>'; - print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($object->amount).'</td></tr>'; - print '<tr><td width="20%">'.$langs->trans("File").'</td><td>'; - - $relativepath = 'bon/'.$object->ref; - - print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&modulepart=prelevement&file='.urlencode($relativepath).'">'.$object->ref.'</a>'; - - print '</td></tr>'; - print '</table><br>'; - - $fileimage = $conf->prelevement->dir_output.'/receipts/'.$object->ref.'.ps.png.0'; - $fileps = $conf->prelevement->dir_output.'/receipts/'.$object->ref.'.ps'; - - // Conversion du PDF en image png si fichier png non existant - if (!file_exists($fileimage)) - { - if (class_exists("Imagick")) - { - $ret = dol_convert_file($file,'png',$fileimage); - if ($ret < 0) $error++; - } - else - { - $langs->load("errors"); - print '<font class="error">'.$langs->trans("ErrorNoImagickReadimage").'</font>'; - } - } - - if (file_exists($fileimage)) - { - print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=prelevement&file='.urlencode(basename($fileimage)).'">'; - - } - - dol_fiche_end(); - } - else - { - dol_print_error($db); - } -} - -llxFooter(); diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 87bab387344a4511706bee01bb5f516e016795cd..66a1c81e8e988d0a8753c56d57d6077bbdaa301b 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -821,7 +821,9 @@ class BonPrelevement extends CommonObject { $bac = new CompanyBankAccount($this->db); $bac->fetch(0,$soc->id); + if ($bac->verif() >= 1) + //if (true) { $factures_prev[$i] = $fac; /* second tableau necessaire pour BonPrelevement */ @@ -1226,26 +1228,24 @@ class BonPrelevement extends CommonObject * @return int 0 if OK, <0 if KO */ //TODO: Optimize code to read lines in a single function - function Generate() + function generate() { global $conf,$langs,$mysoc; $result = 0; - dol_syslog(get_class($this)."::Generate build file ".$this->filename); + dol_syslog(get_class($this)."::generate build file ".$this->filename); $this->file = fopen($this->filename,"w"); $found=0; // Build file for European countries - if (! $mysoc->isInEEC()) + if ($mysoc->isInEEC()) { $found++; /** - * SECTION CREATION FICHIER SEPA - * SECTION CREATION FICHIER SEPA * SECTION CREATION FICHIER SEPA */ // SEPA Initialisation @@ -1308,8 +1308,6 @@ class BonPrelevement extends CommonObject } /** - * SECTION CREATION FICHIER SEPA - * SECTION CREATION FICHIER SEPA * SECTION CREATION FICHIER SEPA */ // SEPA File Header @@ -1401,11 +1399,14 @@ class BonPrelevement extends CommonObject } } else - { + { $result = -2; } + $langs->load('withdrawals'); - fputs($this->file, $langs->trans('WithdrawalFileNotCapable')); + + // TODO Add here code to generate a generic file + fputs($this->file, $langs->trans('WithdrawalFileNotCapable', $mysoc->country_code)); } fclose($this->file); diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index 27ae87ca3b4319ee78c3fada6f1ebd3e6fad42a2..d0b467f294ba287b3b85c9bf75f1b3b8b49e7ce7 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -173,7 +173,8 @@ class RejetPrelevement } //Tag invoice as unpaid dol_syslog("RejetPrelevement::Create set_unpaid fac ".$fac->ref); - $fac->set_unpaid($fac->id, $user); + + $fac->set_unpaid($user); //TODO: Must be managed by notifications module // Send email to sender of the standing order request @@ -194,7 +195,7 @@ class RejetPrelevement } /** - * Envoi mail + * Send email to all users that has asked the withdraw request * * @param Facture $fac Invoice object * @return void diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index c99744f7430ac3a6a215039e62c77bd7ed4d5e1c..364e073676bd355c9012d4bcf26b9133e742d336 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->load("banks"); $langs->load("categories"); -$langs->load("widthdrawals"); +$langs->load("withdrawals"); $langs->load("companies"); // Security check diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index bf3e428cd0e5ad5478f0e530bd37461ff84375bf..d11fefbb6cb932deb84adb77c8a23da8ded89472 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -213,6 +213,7 @@ else dol_print_error($db); } -$db->close(); llxFooter(); + +$db->close(); diff --git a/htdocs/compta/prelevement/ligne.php b/htdocs/compta/prelevement/ligne.php index b3f9acb35709cffa2b8a0065197fa59e99d27a28..f16179796451881c88579c79218c387b2bab5c01 100644 --- a/htdocs/compta/prelevement/ligne.php +++ b/htdocs/compta/prelevement/ligne.php @@ -105,10 +105,13 @@ if ($action == 'confirm_rejet') } } + /* * View */ +$invoicestatic=new Facture($db); + llxHeader('',$langs->trans("StandingOrder")); $h = 0; @@ -134,9 +137,7 @@ if ($id) print '<a href="card.php?id='.$lipre->bon_rowid.'">'.$lipre->bon_ref.'</a></td></tr>'; print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>'; print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($lipre->amount).'</td></tr>'; - print '<tr><td width="20%">'.$langs->trans("Status").'</td><td>'; - - print $lipre->LibStatut($lipre->statut,1).'</td></tr>'; + print '<tr><td width="20%">'.$langs->trans("Status").'</td><td>'.$lipre->LibStatut($lipre->statut,1).'</td></tr>'; if ($lipre->statut == 3) { @@ -215,7 +216,7 @@ if ($id) print '</table><br>'; //Confirm Button - print '<center><input type="submit" class="valid" value='.$langs->trans("Confirm").'><center>'; + print '<center><input type="submit" class="button" value='.$langs->trans("Confirm").'><center>'; print '</form>'; } @@ -229,13 +230,20 @@ if ($id) if ($action == '') { - if ($bon->statut == 2 && $lipre->statut == 2 && $user->rights->prelevement->bons->credit) + if ($bon->statut == 2 && $lipre->statut == 2) { - print "<a class=\"butAction\" href=\"ligne.php?action=rejet&id=$lipre->id\">".$langs->trans("StandingOrderReject")."</a>"; + if ($user->rights->prelevement->bons->credit) + { + print "<a class=\"butAction\" href=\"ligne.php?action=rejet&id=$lipre->id\">".$langs->trans("StandingOrderReject")."</a>"; + } + else + { + print "<a class=\"butActionRefused\" href=\"#\" title=\"".$langs->trans("NotAllowed")."\">".$langs->trans("StandingOrderReject")."</a>"; + } } else { - print "<a class=\"butActionRefused\" href=\"#\">".$langs->trans("StandingOrderReject")."</a>"; + print "<a class=\"butActionRefused\" href=\"#\" title=\"".$langs->trans("NotPossibleForThisStatusOfWithdrawReceiptORLine")."\">".$langs->trans("StandingOrderReject")."</a>"; } } @@ -256,7 +264,7 @@ if ($id) * Liste des factures */ $sql = "SELECT pf.rowid"; - $sql.= " ,f.rowid as facid, f.facnumber as ref, f.total_ttc"; + $sql.= " ,f.rowid as facid, f.facnumber as ref, f.total_ttc, f.paye, f.fk_statut"; $sql.= " , s.rowid as socid, s.nom as name"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql.= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl"; @@ -287,7 +295,7 @@ if ($id) print"\n<!-- debut table -->\n"; print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; print '<tr class="liste_titre">'; - print '<td>'.$langs->trans("Invoice").'</td><td>'.$langs->trans("ThirdParty").'</td><td align="right">'.$langs->trans("Amount").'</td>'; + print '<td>'.$langs->trans("Invoice").'</td><td>'.$langs->trans("ThirdParty").'</td><td align="right">'.$langs->trans("Amount").'</td><td align="right">'.$langs->trans("Status").'</td>'; print '</tr>'; $var=True; @@ -312,6 +320,11 @@ if ($id) print '<td align="right">'.price($obj->total_ttc)."</td>\n"; + print '<td align="right">'; + $invoicestatic->fetch($obj->facid); + print $invoicestatic->getLibStatut(5); + print "</td>\n"; + print "</tr>\n"; $i++; diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index 10fb995c0236b9c9d5ac79f6f796ffd63813b6d4..0a68aa686aec4fb303e5a4cbdcca8e0ffa1410a7 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -42,10 +42,10 @@ $result = restrictedArea($user, 'prelevement','','','bons'); $page = GETPOST('page','int'); $sortorder = ((GETPOST('sortorder','alpha')=="")) ? "DESC" : GETPOST('sortorder','alpha'); $sortfield = ((GETPOST('sortfield','alpha')=="")) ? "p.datec" : GETPOST('sortfield','alpha'); -$search_line = GETPOST('search_ligne','alpha'); +$search_line = GETPOST('search_line','alpha'); $search_bon = GETPOST('search_bon','alpha'); $search_code = GETPOST('search_code','alpha'); -$search_societe = GETPOST('search_societe','alpha'); +$search_company = GETPOST('search_company','alpha'); $statut = GETPOST('statut','int'); $bon=new BonPrelevement($db,""); @@ -53,7 +53,14 @@ $ligne=new LignePrelevement($db,$user); $offset = $conf->liste_limit * $page ; - +if (GETPOST("button_removefilter")) +{ + $search_line=""; + $search_bon=""; + $search_code=""; + $search_company=""; + $statut=""; +} /* * View @@ -88,9 +95,9 @@ if ($search_code) { $sql.= " AND s.code_client LIKE '%".$db->escape($search_code)."%'"; } -if ($search_societe) +if ($search_company) { - $sql .= " AND s.nom LIKE '%".$db->escape($search_societe)."%'"; + $sql .= " AND s.nom LIKE '%".$db->escape($search_company)."%'"; } $sql.=$db->order($sortfield,$sortorder); $sql.=$db->plimit($conf->liste_limit+1, $offset); @@ -122,15 +129,17 @@ if ($result) print '<form action="list.php" method="GET">'; print '<tr class="liste_titre">'; - print '<td class="liste_titre"><input type="text" class="flat" name="search_ligne" value="'. dol_escape_htmltag($search_line).'" size="6"></td>'; + print '<td class="liste_titre"><input type="text" class="flat" name="search_line" value="'. dol_escape_htmltag($search_line).'" size="6"></td>'; print '<td class="liste_titre"><input type="text" class="flat" name="search_bon" value="'. dol_escape_htmltag($search_bon).'" size="8"></td>'; print '<td> </td>'; - print '<td class="liste_titre"><input type="text" class="flat" name="search_societe" value="'. dol_escape_htmltag($search_societe).'" size="12"></td>'; + print '<td class="liste_titre"><input type="text" class="flat" name="search_company" value="'. dol_escape_htmltag($search_company).'" size="12"></td>'; print '<td class="liste_titre" align="center"><input type="text" class="flat" name="search_code" value="'. dol_escape_htmltag($search_code).'" size="8"></td>'; print '<td class="liste_titre"> </td>'; print '<td class="liste_titre"> </td>'; - print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>'; - print '</tr>'; + print '<td class="liste_titre" align="right">'; + print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; + print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; + print '</td>'; print '</form>'; $var=True; diff --git a/htdocs/compta/salaries/index.php b/htdocs/compta/salaries/index.php index b2fc3e1b4a3aec617b738cab7739957932c4cb84..17c3efdbfaa0dc1080ede50fe6b3e2fe1dbb245f 100644 --- a/htdocs/compta/salaries/index.php +++ b/htdocs/compta/salaries/index.php @@ -33,6 +33,9 @@ $socid = GETPOST("socid","int"); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'salaries', '', '', ''); +$search_ref = GETPOST('search_ref','int'); +$search_label = GETPOST('search_label','alpha'); +$search_amount = GETPOST('search_amount','alpha'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -61,6 +64,14 @@ else $typeid=$_REQUEST['typeid']; } +if (GETPOST("button_removefilter")) +{ + $search_ref=""; + $search_label=""; + $search_amount=""; + $typeid=""; +} + /* * View */ @@ -78,8 +89,11 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON s.fk_typepayment = pst $sql.= " ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE u.rowid = s.fk_user"; $sql.= " AND s.entity = ".$conf->entity; -if (GETPOST("search_label")) $sql.=" AND s.label LIKE '%".$db->escape(GETPOST("search_label"))."%'"; -if (GETPOST("search_amount")) $sql.=" AND s.amount = ".price2num(GETPOST("search_amount")); + +// Search criteria +if ($search_ref) $sql.=" AND s.rowid=".$search_ref; +if ($search_label) $sql.=" AND s.label LIKE '%".$db->escape($search_label)."%'"; +if ($search_amount) $sql.=" AND s.amount='".$db->escape(price2num(trim($search_amount)))."'"; if ($filtre) { $filtre=str_replace(":","=",$filtre); $sql .= " AND ".$filtre; @@ -118,19 +132,23 @@ if ($result) print "</tr>\n"; print '<tr class="liste_titre">'; + // Ref + print '<td class="liste_titre" align="left">'; + print '<input class="flat" type="text" size="3" name="search_ref" value="'.$search_ref.'">'; + print '</td>'; print '<td class="liste_titre"> </td>'; - print '<td class="liste_titre"> </td>'; - print '<td class="liste_titre"><input type="text" class="flat" size="14" name="search_label" value="'.GETPOST("search_label").'"></td>'; + // Label + print '<td class="liste_titre"><input type="text" class="flat" size="14" name="search_label" value="'.$search_label.'"></td>'; print '<td class="liste_titre"> </td>'; // Type print '<td class="liste_titre" align="left">'; $form->select_types_paiements($typeid,'typeid','',0,0,1,16); print '</td>'; - print '<td class="liste_titre" align="right"><input name="search_amount" class="flat" type="text" size="8" value="'.GETPOST("search_amount").'"></td>'; - print '<td class="liste_titre" align="right">'; - print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; - print '</td>'; - print "</tr>\n"; + // Amount + print '<td class="liste_titre" align="right"><input name="search_amount" class="flat" type="text" size="8" value="'.$search_amount.'"></td>'; + print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; + print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; + print "</td></tr>\n"; while ($i < min($num,$limit)) { diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 022aaf14ff00d551850898aba649471fb3d61eef..db4bef2abe6ec76c8836cbc5100c4bfb445d383f 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -36,6 +36,9 @@ $socid = isset($_GET["socid"])?$_GET["socid"]:''; if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'tax', '', '', 'charges'); +$search_ref = GETPOST('search_ref','int'); +$search_label = GETPOST('search_label','alpha'); +$search_amount = GETPOST('search_amount','alpha'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -65,6 +68,15 @@ else $typeid=$_REQUEST['typeid']; } +if (GETPOST("button_removefilter")) +{ + $search_ref=""; + $search_label=""; + $search_amount=""; + $typeid=""; + $year=""; + $month=""; +} /* * View @@ -85,7 +97,11 @@ $sql.= " ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid"; $sql.= " WHERE cs.fk_type = c.id"; $sql.= " AND cs.entity = ".$conf->entity; -if (GETPOST("search_label")) $sql.=" AND cs.libelle LIKE '%".$db->escape(GETPOST("search_label"))."%'"; + +// Search criteria +if ($search_ref) $sql.=" AND cs.rowid=".$search_ref; +if ($search_label) $sql.=" AND cs.libelle LIKE '%".$db->escape($search_label)."%'"; +if ($search_amount) $sql.=" AND cs.amount='".$db->escape(price2num(trim($search_amount)))."'"; if ($year > 0) { $sql .= " AND ("; @@ -139,10 +155,8 @@ if ($resql) { print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">'; - - print "<table class=\"noborder\" width=\"100%\">"; - - print "<tr class=\"liste_titre\">"; + print '<table class="liste" width="100%">'; + print '<tr class="liste_titre">'; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"id","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"cs.libelle","",$param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder); @@ -153,20 +167,26 @@ if ($resql) print "</tr>\n"; print '<tr class="liste_titre">'; - print '<td class="liste_titre"> </td>'; - print '<td class="liste_titre"><input type="text" class="flat" size="8" name="search_label" value="'.GETPOST("search_label").'"></td>'; + // Ref + print '<td class="liste_titre" align="left">'; + print '<input class="flat" type="text" size="3" name="search_ref" value="'.$search_ref.'">'; + print '</td>'; + // Label + print '<td class="liste_titre"><input type="text" class="flat" size="8" name="search_label" value="'.$search_label.'"></td>'; // Type print '<td class="liste_titre" align="left">'; $formsocialcontrib->select_type_socialcontrib($typeid,'typeid',1,16,0); print '</td>'; // Period end date print '<td class="liste_titre"> </td>'; - print '<td class="liste_titre"> </td>'; - print '<td class="liste_titre"> </td>'; + // Amount print '<td class="liste_titre" align="right">'; - print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; + print '<input class="flat" type="text" size="6" name="search_amount" value="'.$search_amount.'">'; print '</td>'; - print "</tr>\n"; + print '<td class="liste_titre"> </td>'; + print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; + print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; + print "</td></tr>\n"; while ($i < min($num,$limit)) { diff --git a/htdocs/compta/tva/reglement.php b/htdocs/compta/tva/reglement.php index 9bb4337782efdca9ad3733ad7bff86781d83a43a..8babbd58f7d08eb7740975a4301015fb2a80c408 100644 --- a/htdocs/compta/tva/reglement.php +++ b/htdocs/compta/tva/reglement.php @@ -35,6 +35,9 @@ $socid = isset($_GET["socid"])?$_GET["socid"]:''; if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'tax', '', '', 'charges'); +$search_ref = GETPOST('search_ref','int'); +$search_label = GETPOST('search_label','alpha'); +$search_amount = GETPOST('search_amount','alpha'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -63,6 +66,14 @@ else $typeid=$_REQUEST['typeid']; } +if (GETPOST("button_removefilter")) +{ + $search_ref=""; + $search_label=""; + $search_amount=""; + $typeid=""; +} + /* * View */ @@ -76,8 +87,9 @@ $sql = "SELECT t.rowid, t.amount, t.label, t.datev as dm, t.fk_typepayment as ty $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON t.fk_typepayment = pst.id"; $sql.= " WHERE t.entity = ".$conf->entity; -if (GETPOST("search_label")) $sql.=" AND t.label LIKE '%".$db->escape(GETPOST("search_label"))."%'"; -if (GETPOST("search_amount")) $sql.=" AND t.amount = ".price2num(GETPOST("search_amount")); +if ($search_ref) $sql.=" AND t.rowid=".$search_ref; +if ($search_label) $sql.=" AND t.label LIKE '%".$db->escape($search_label)."%'"; +if ($search_amount) $sql.=" AND t.amount='".$db->escape(price2num(trim($search_amount)))."'"; if ($filtre) { $filtre=str_replace(":","=",$filtre); $sql .= " AND ".$filtre; @@ -106,27 +118,26 @@ if ($result) print '<table class="noborder" width="100%">'; print '<tr class="liste_titre">'; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"t.rowid","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"t.label","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"dm","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"t.amount","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre(""); + print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"t.rowid","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"t.label","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"dm","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"t.amount","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre(""); print "</tr>\n"; print '<tr class="liste_titre">'; - print '<td class="liste_titre"> </td>'; - print '<td class="liste_titre"><input type="text" class="flat" size="14" name="search_label" value="'.GETPOST("search_label").'"></td>'; + print '<td class="liste_titre"><input type="text" class="flat" size="4" name="search_ref" value="'.$search_ref.'"></td>'; + print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_label" value="'.$search_label.'"></td>'; print '<td class="liste_titre"> </td>'; // Type print '<td class="liste_titre" align="left">'; $form->select_types_paiements($typeid,'typeid','',0,0,1,16); print '</td>'; - print '<td class="liste_titre" align="right"><input name="search_amount" class="flat" type="text" size="8" value="'.GETPOST("search_amount").'"></td>'; - print '<td class="liste_titre" align="right">'; - print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; - print '</td>'; - print "</tr>\n"; + print '<td class="liste_titre" align="right"><input name="search_amount" class="flat" type="text" size="8" value="'.$search_amount.'"></td>'; + print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; + print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; + print "</td></tr>\n"; while ($i < min($num,$limit)) { diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index c65e9601e53b943e2b0595af804fadccbe9ce571..a311c87cffcf621c313fdabdfde7e0256962b0ad 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -357,7 +357,7 @@ if ($result) print '</td>'; print '<td class="liste_titre" align="right">'; print '<input type="image" value="button_search" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; - print ' '; + print ' '; print '<input type="image" value="button_removefilter" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; print '</td>'; print '</tr>'; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index dcc1b83e6d89ad750eb314f7e67490f21bf12d37..cf57e97933b70e81085bfc2bce513c94d65047f1 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -40,11 +40,11 @@ if ($page == -1) { $page = 0 ; } $limit = $conf->liste_limit; $offset = $limit * $page ; -$search_nom=GETPOST('search_nom'); +$search_name=GETPOST('search_name'); $search_contract=GETPOST('search_contract'); $search_ref_supplier=GETPOST('search_ref_supplier','alpha'); $sall=GETPOST('sall'); -$statut=GETPOST('statut')?GETPOST('statut'):1; +$search_status=GETPOST('search_status'); $socid=GETPOST('socid'); if (! $sortfield) $sortfield="c.rowid"; @@ -58,6 +58,17 @@ $result = restrictedArea($user, 'contrat', $id); $staticcontrat=new Contrat($db); $staticcontratligne=new ContratLigne($db); +if (GETPOST("button_removefilter")) +{ + $search_name=""; + $search_contract=""; + $search_ref_supplier=""; + $sall=""; + $search_status=""; +} + +if ($search_status == '') $search_status=1; + /* * View @@ -84,8 +95,8 @@ $sql.= " WHERE c.fk_soc = s.rowid "; $sql.= " AND c.entity = ".$conf->entity; if ($socid) $sql.= " AND s.rowid = ".$socid; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; -if ($search_nom) { - $sql .= natural_search('s.nom', $search_nom); +if ($search_name) { + $sql .= natural_search('s.nom', $search_name); } if ($search_contract) { $sql .= natural_search(array('c.rowid', 'c.ref'), $search_contract); @@ -106,13 +117,13 @@ if ($resql) $num = $db->num_rows($resql); $i = 0; - print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], '&search_contract='.$search_contract.'&search_nom='.$search_nom, $sortfield, $sortorder,'',$num); + print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], '&search_contract='.$search_contract.'&search_name='.$search_name, $sortfield, $sortorder,'',$num); print '<table class="liste" width="100%">'; print '<tr class="liste_titre">'; $param='&search_contract='.$search_contract; - $param.='&search_nom='.$search_nom; + $param.='&search_name='.$search_name; $param.='&search_ref_supplier='.$search_ref_supplier; print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "c.rowid","","$param",'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("RefCustomer"), $_SERVER["PHP_SELF"], "c.ref_supplier","","$param",'',$sortfield,$sortorder); @@ -136,13 +147,13 @@ if ($resql) print '<input type="text" class="flat" size="7" name="search_ref_supplier value="'.$search_ref_supplier.'">'; print '</td>'; print '<td class="liste_titre">'; - print '<input type="text" class="flat" size="24" name="search_nom" value="'.$search_nom.'">'; + print '<input type="text" class="flat" size="24" name="search_name" value="'.$search_name.'">'; print '</td>'; print '<td class="liste_titre"> </td>'; //print '<td class="liste_titre"> </td>'; - print '<td colspan="4" class="liste_titre" align="right"><input class="liste_titre" type="image" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; - print "</td>"; - print "</tr>\n"; + print '<td colspan="4" class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; + print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; + print "</td></tr>\n"; print '</form>'; $var=true; diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php index 77fc01554305ed000fd75eb0f55a9e28464abfdd..b0fb4ed5edb14da311dffffc85086f0f93d43187 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -44,7 +44,7 @@ if (! $sortfield) $sortfield="c.rowid"; if (! $sortorder) $sortorder="ASC"; $filter=GETPOST("filter"); -$search_nom=GETPOST("search_nom"); +$search_name=GETPOST("search_name"); $search_contract=GETPOST("search_contract"); $search_service=GETPOST("search_service"); $statut=GETPOST('statut')?GETPOST('statut'):1; @@ -69,6 +69,21 @@ $staticcontrat=new Contrat($db); $staticcontratligne=new ContratLigne($db); $companystatic=new Societe($db); +if (GETPOST("button_removefilter")) +{ + $search_name=""; + $search_contract=""; + $search_service=""; + $op1month=""; + $op1day=""; + $op1year=""; + $filter_op1=""; + $op2month=""; + $op2day=""; + $op2year=""; + $filter_op2=""; +} + /* * View */ @@ -101,7 +116,7 @@ if ($mode == "0") $sql.= " AND cd.statut = 0"; if ($mode == "4") $sql.= " AND cd.statut = 4"; if ($mode == "5") $sql.= " AND cd.statut = 5"; if ($filter == "expired") $sql.= " AND cd.date_fin_validite < '".$db->idate($now)."'"; -if ($search_nom) $sql.= " AND s.nom LIKE '%".$db->escape($search_nom)."%'"; +if ($search_name) $sql.= " AND s.nom LIKE '%".$db->escape($search_name)."%'"; if ($search_contract) $sql.= " AND c.rowid = '".$db->escape($search_contract)."'"; if ($search_service) $sql.= " AND (p.ref LIKE '%".$db->escape($search_service)."%' OR p.description LIKE '%".$db->escape($search_service)."%' OR cd.description LIKE '%".$db->escape($search_service)."%')"; if ($socid > 0) $sql.= " AND s.rowid = ".$socid; @@ -122,7 +137,7 @@ if ($resql) $param=''; if ($search_contract) $param.='&search_contract='.urlencode($search_contract); - if ($search_nom) $param.='&search_nom='.urlencode($search_nom); + if ($search_name) $param.='&search_name='.urlencode($search_name); if ($search_service) $param.='&search_service='.urlencode($search_service); if ($mode) $param.='&mode='.$mode; if ($filter) $param.='&filter='.$filter; @@ -168,7 +183,7 @@ if ($resql) print '</td>'; // Third party print '<td class="liste_titre">'; - print '<input type="text" class="flat" size="24" name="search_nom" value="'.dol_escape_htmltag($search_nom).'">'; + print '<input type="text" class="flat" size="24" name="search_name" value="'.dol_escape_htmltag($search_name).'">'; print '</td>'; print '<td class="liste_titre" align="center">'; $arrayofoperators=array('<'=>'<','>'=>'>'); @@ -184,9 +199,9 @@ if ($resql) $filter_date2=dol_mktime(0,0,0,$op2month,$op2day,$op2year); print $form->select_date($filter_date2,'op2',0,0,1); print '</td>'; - print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; - print "</td>"; - print "</tr>\n"; + print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; + print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; + print "</td></tr>\n"; print '</form>'; $contractstatic=new Contrat($db); diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 625376ace5847d7e38bf43ac8ae0081ed8dd10c9..51744775d9f6f6ceaad1791ea514a44d400cf5e6 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -87,10 +87,10 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO if ($result > 0) { - if ($_POST['sendto']) + if (trim($_POST['sendto'])) { // Recipient is provided into free text - $sendto = $_POST['sendto']; + $sendto = trim($_POST['sendto']); $sendtoid = 0; } elseif ($_POST['receiver'] != '-1') @@ -107,6 +107,22 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $sendtoid = $_POST['receiver']; } } + if (trim($_POST['sendtocc'])) + { + $sendtocc = trim($_POST['sendtocc']); + } + elseif ($_POST['receivercc'] != '-1') + { + // Recipient was provided from combo list + if ($_POST['receivercc'] == 'thirdparty') // Id of third party + { + $sendtocc = $thirdparty->email; + } + else // Id du contact + { + $sendtocc = $thirdparty->contact_get_property($_POST['receivercc'],'email'); + } + } if (dol_strlen($sendto)) { @@ -115,8 +131,8 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>'; $replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>'; $message = $_POST['message']; - $sendtocc = $_POST['sendtocc']; - $sendtobcc=''; + $sendtocc = $sendtocc; + $sendtobcc= GETPOST('sendtoccc'); if ($mode == 'emailfromproposal') $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO); if ($mode == 'emailfromorder') $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO); if ($mode == 'emailfrominvoice') $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO); @@ -172,7 +188,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); - $result=$interface->run_triggers('COMPANY_SENTBYMAIL',$object,$user,$langs,$conf); + $result=$interface->run_triggers($trigger_name,$object,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index 7d118932ba4705bd3b462fad4a381bbeaed7e33f..738582ad931d6335714e6eb4f07e4ae061707c0b 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -63,7 +63,7 @@ class box_actions extends ModeleBoxes if ($user->rights->agenda->myactions->read) { $sql = "SELECT a.id, a.label, a.datep as dp, a.percent as percentage,"; - $sql.= " ta.code,"; + $sql.= " ta.code, ta.libelle as type_label,"; $sql.= " s.nom as name, s.rowid as socid"; $sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm AS ta, "; $sql.= MAIN_DB_PREFIX."actioncomm AS a)"; @@ -96,7 +96,7 @@ class box_actions extends ModeleBoxes if ($objp->percentage >= 0 && $objp->percentage < 100 && $datelimite < ($now - $delay_warning)) $late=img_warning($langs->trans("Late")); //($langs->transnoentities("Action".$objp->code)!=("Action".$objp->code) ? $langs->transnoentities("Action".$objp->code) : $objp->label) - $label=$objp->label; + $label=empty($objp->label)?$objp->type_label:$objp->label; $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => ("action"), diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 23981b1a34324cd72a25e992032f370670c26eed..a9c39fa790f32766143ef1d876c90d16625f5d9a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -609,6 +609,8 @@ abstract class CommonObject if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty)) return 0; + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; + $thirdparty = new Societe($this->db); $result=$thirdparty->fetch(isset($this->socid)?$this->socid:(isset($this->fk_soc)?$this->fk_soc:$this->fk_thirdparty)); $this->client = $thirdparty; // deprecated @@ -2074,7 +2076,8 @@ abstract class CommonObject if (! $error) { $trigkey=''; - if ($this->element == 'fichinter' && $status == 2) $trigkey='FICHINTER_CLASSIFYBILLED'; + if ($this->element == 'fichinter' && $status == 2) $trigkey='FICHINTER_CLASSIFY_BILLED'; + if ($this->element == 'fichinter' && $status == 1) $trigkey='FICHINTER_CLASSIFY_UNBILLED'; if ($trigkey) { @@ -2566,7 +2569,7 @@ abstract class CommonObject $parameters = array('line'=>$line,'var'=>$var,'num'=>$num,'i'=>$i,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer,'selected'=>$selected, 'extrafieldsline'=>$extrafieldsline); $reshook=$hookmanager->executeHooks('printObjectLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks } - else + else { $parameters = array('line'=>$line,'var'=>$var,'num'=>$num,'i'=>$i,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer,'selected'=>$selected, 'extrafieldsline'=>$extrafieldsline); $reshook=$hookmanager->executeHooks('printObjectSubLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index db24d257aeefb7c4029f23fea1cd7c8112519f60..94898ec54529c910a2d76f1e043b8f4df704d126 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -157,7 +157,7 @@ class ExtraFields { $table=$elementtype.'_extrafields'; - if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname) && ! is_numeric($attrname)) + if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9_]*$/",$attrname) && ! is_numeric($attrname)) { if ($type=='boolean') { $typedb='int'; @@ -752,15 +752,17 @@ class ExtraFields if (strpos($InfoFieldList[4], 'extra')!==false) { $sql.= ' as main, '.MAIN_DB_PREFIX .$InfoFieldList[0].'_extrafields as extra'; - $sqlwhere.= ' AND extra.fk_object=main.'.$InfoFieldList[2]. ' AND '.$InfoFieldList[4]; + $sqlwhere.= ' WHERE extra.fk_object=main.'.$InfoFieldList[2]. ' AND '.$InfoFieldList[4]; } else { - $sqlwhere.= ' AND '.$InfoFieldList[4]; + $sqlwhere.= ' WHERE '.$InfoFieldList[4]; } + }else { + $sqlwhere.= ' WHERE 1'; } if (in_array($InfoFieldList[0],array('tablewithentity'))) $sqlwhere.= ' AND entity = '.$conf->entity; // Some tables may have field, some other not. For the moment we disable it. - $sql.=preg_replace('/^ AND /','',$sqlwhere); + //$sql.=preg_replace('/^ AND /','',$sqlwhere); //print $sql; dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG); @@ -988,7 +990,10 @@ class ExtraFields { foreach ($fields_label as $field_toshow) { - $translabel=$langs->trans($obj->$field_toshow); + $translabel=''; + if (!empty($obj->$field_toshow)) { + $translabel=$langs->trans($obj->$field_toshow); + } if ($translabel!=$field_toshow) { $value.=dol_trunc($translabel,18).' '; }else { @@ -998,7 +1003,10 @@ class ExtraFields } else { - $translabel=$langs->trans($obj->$InfoFieldList[1]); + $translabel=''; + if (!empty($obj->$InfoFieldList[1])) { + $translabel=$langs->trans($obj->$InfoFieldList[1]); + } if ($translabel!=$obj->$InfoFieldList[1]) { $value=dol_trunc($translabel,18); }else { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8e369151fd7030e2f8e19d570d96908b0e17ab75..03defa19129e0f1b79990723b0c20a29656d1ff7 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1835,11 +1835,12 @@ class Form * @param string $filterkey Filtre des produits * @param int $statut -1=Return all products, 0=Products not on sell, 1=Products on sell * @param int $outputmode 0=HTML select string, 1=Array + * @param int $limit Limit of line number * @return array Array of keys for json */ - function select_produits_fournisseurs_list($socid,$selected='',$htmlname='productid',$filtertype='',$filtre='',$filterkey='',$statut=-1,$outputmode=0) + function select_produits_fournisseurs_list($socid,$selected='',$htmlname='productid',$filtertype='',$filtre='',$filterkey='',$statut=-1,$outputmode=0,$limit=100) { - global $langs,$conf; + global $langs,$conf,$db; $out=''; $outarray=array(); @@ -1877,6 +1878,7 @@ class Form $sql.=')'; } $sql.= " ORDER BY pfp.ref_fourn DESC, pfp.quantity ASC"; + $sql.= $db->plimit($limit); // Build output string @@ -4032,9 +4034,10 @@ class Form * @param int $translate Translate and encode value * @param int $maxlen Length maximum for labels * @param int $disabled Html select box is disabled - * @param int $sort 'ASC' or 'DESC' =Sort on label, '' or 'NONE'=Do not sort + * @param int $sort 'ASC' or 'DESC' = Sort on label, '' or 'NONE' = Do not sort * @param string $morecss Add more class to css styles * @return string HTML select string. + * @see multiselectarray */ static function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='') { @@ -4092,54 +4095,65 @@ class Form * * @param string $htmlname Name of select * @param array $array Array with key+value - * @param array $selected Preselected keys + * @param array $selected Array with key+value preselected * @param int $key_in_label 1 pour afficher la key dans la valeur "[key] value" * @param int $value_as_key 1 to use value as key * @param string $option Valeur de l'option en fonction du type choisi * @param int $translate Translate and encode value + * @param int $width Force width of select box. May be used only when using jquery couch. * @return string HTML multiselect string + * @see selectarray */ - function multiselectarray($htmlname, $array, $selected=array(), $key_in_label=0, $value_as_key=0, $option='', $translate=0) + static function multiselectarray($htmlname, $array, $selected=array(), $key_in_label=0, $value_as_key=0, $option='', $translate=0, $width=0) { global $conf, $langs; - $out = '<select id="'.$htmlname.'" class="multiselect" multiple="multiple" name="'.$htmlname.'[]"'.$option.'>'."\n"; + // Add code for jquery to use multiselect + // Note: Plugin "multiselect" is no more provided by Dolibarr. You must include it and load it into your module to use it. + if ((! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && ($conf->global->MAIN_USE_JQUERY_MULTISELECT == 'multiselect')) + || (defined('REQUIRE_JQUERY_MULTISELECT') && constant('REQUIRE_JQUERY_MULTISELECT'))) + { + print '<!-- JS CODE FOR multiselect --> + <script type="text/javascript"> + $(document).ready(function () { + $.extend($.ui.multiselect.locale, { + addAll:\''.$langs->transnoentities("AddAll").'\', + removeAll:\''.$langs->transnoentities("RemoveAll").'\', + itemsCount:\''.$langs->transnoentities("ItemsCount").'\' + }); + $(function(){ + $("#'.$htmlname.'").multiselect({ + searchable: false, + width: '.($width?$width:300).', + height: 120 + }); + }); + }); + </script>'; + } + + // Add code for jquery to use multiple-select + // Note: Plugin "multiselect" is no more provided by Dolibarr. You must include it and load it into your module to use it. + if ((! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && ($conf->global->MAIN_USE_JQUERY_MULTISELECT == 'multiple-select')) + || (defined('REQUIRE_JQUERY_MULTISELECT') && constant('REQUIRE_JQUERY_MULTISELECT'))) + { + print '<!-- JS CODE FOR multiple-select --> + <script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/multiple-select/jquery.multiple.select.js"></script> + <script type="text/javascript"> + $(document).ready(function () { + $(\'#'.$htmlname.'\').multipleSelect(); + }); + </script>'; + } + + // Try also magic suggest + + $out = '<select id="'.$htmlname.'" class="multiselect" multiple="multiple" name="'.$htmlname.'[]"'.$option.($width?' style="width: '.$width.'px"':'').'>'."\n"; if (is_array($array) && ! empty($array)) { if ($value_as_key) $array=array_combine($array, $array); - if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && is_array($selected) && ! empty($selected)) - { - foreach ($selected as $selected_value) - { - foreach($array as $key => $value) - { - if ($selected_value == $key) - { - $value=$array[$selected_value]; - $out.= '<option value="'.$key.'" selected="selected">'; - $newval = ($translate ? $langs->trans(ucfirst($value)) : $value); - $newval = ($key_in_label ? $key.' - '.$newval : $newval); - $out.= dol_htmlentitiesbr($newval); - $out.= '</option>'."\n"; - unset($array[$key]); - } - } - } - - if (! empty($array)) - { - foreach ($array as $key => $value) - { - $out.= '<option value="'.$key.'">'; - $newval = ($translate ? $langs->trans(ucfirst($value)) : $value); - $newval = ($key_in_label ? $key.' - '.$newval : $newval); - $out.= dol_htmlentitiesbr($newval); - $out.= '</option>'."\n"; - } - } - } - else + if (! empty($array)) { foreach ($array as $key => $value) { @@ -4150,7 +4164,7 @@ class Form } $out.= '>'; - $newval = ($translate ? $langs->trans(ucfirst($value)) : $value); + $newval = ($translate ? $langs->trans($value) : $value); $newval = ($key_in_label ? $key.' - '.$newval : $newval); $out.= dol_htmlentitiesbr($newval); $out.= '</option>'."\n"; @@ -4166,18 +4180,18 @@ class Form /** * Return an html string with a select combo box to choose yes or no * - * @param string $htmlname Name of html select field - * @param string $value Pre-selected value - * @param int $option 0 return yes/no, 1 return 1/0 - * @param bool $disabled true or false - * @return mixed See option + * @param string $htmlname Name of html select field + * @param string $value Pre-selected value + * @param int $option 0 return yes/no, 1 return 1/0 + * @param bool $disabled true or false + * @param useempty $useempty 1=Add empty line + * @return mixed See option */ - function selectyesno($htmlname,$value='',$option=0,$disabled=false) + function selectyesno($htmlname,$value='',$option=0,$disabled=false,$useempty='') { global $langs; $yes="yes"; $no="no"; - if ($option) { $yes="1"; @@ -4187,15 +4201,17 @@ class Form $disabled = ($disabled ? ' disabled="disabled"' : ''); $resultyesno = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n"; + if ($useempty) $resultyesno .= '<option value="-1"'.(($value < 0)?' selected="selected"':'').'></option>'."\n"; if (("$value" == 'yes') || ($value == 1)) { $resultyesno .= '<option value="'.$yes.'" selected="selected">'.$langs->trans("Yes").'</option>'."\n"; $resultyesno .= '<option value="'.$no.'">'.$langs->trans("No").'</option>'."\n"; } else - { + { + $selected=($useempty?'':' selected="selected"'); $resultyesno .= '<option value="'.$yes.'">'.$langs->trans("Yes").'</option>'."\n"; - $resultyesno .= '<option value="'.$no.'" selected="selected">'.$langs->trans("No").'</option>'."\n"; + $resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans("No").'</option>'."\n"; } $resultyesno .= '</select>'."\n"; return $resultyesno; diff --git a/htdocs/core/class/html.formcron.class.php b/htdocs/core/class/html.formcron.class.php index bce8d9f041e7e1c9f06203cafaf2417fd83eba18..4de88a7bfc9feb4b1e9111713366cc6aafdedbb6 100644 --- a/htdocs/core/class/html.formcron.class.php +++ b/htdocs/core/class/html.formcron.class.php @@ -4,7 +4,7 @@ * * 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 2 of the License, or + * 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, @@ -14,6 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. + * or see http://www.gnu.org/ */ /** diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 26506360e668a8f739c21df649a518adb060d001..db88671f7ff3bdc665e9286fc37b94254d6739a4 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -1,6 +1,7 @@ <?php /* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> + * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * * 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 @@ -173,7 +174,7 @@ class Notify // Check notification per third party $sql = "SELECT s.nom, c.email, c.rowid as cid, c.lastname, c.firstname, c.default_lang,"; - $sql.= " a.rowid as adid, a.label, a.code, n.rowid"; + $sql.= " a.rowid as adid, a.label, a.code, n.rowid, n.type"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c,"; $sql.= " ".MAIN_DB_PREFIX."c_action_trigger as a,"; $sql.= " ".MAIN_DB_PREFIX."notify_def as n,"; @@ -292,8 +293,8 @@ class Notify if ($mailfile->sendfile()) { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_contact, objet_type, objet_id, email)"; - $sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$actiondefid.", ".$object->socid.", ".$obj->cid.", '".$object_type."', ".$object->id.", '".$this->db->escape($obj->email)."')"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_contact, type, objet_type, objet_id, email)"; + $sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$actiondefid.", ".$object->socid.", ".$obj->cid.", '".$obj->type."', '".$object_type."', ".$object->id.", '".$this->db->escape($obj->email)."')"; if (! $this->db->query($sql)) { dol_print_error($this->db); @@ -421,8 +422,8 @@ class Notify if ($mailfile->sendfile()) { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_contact, objet_type, objet_id, email)"; - $sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$actiondefid.", ".$object->socid.", null, '".$object_type."', ".$object->id.", '".$this->db->escape($conf->global->$param)."')"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_contact, type, objet_type, objet_id, email)"; + $sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$actiondefid.", ".$object->socid.", null, '".$obj->type."', '".$object_type."', ".$object->id.", '".$this->db->escape($conf->global->$param)."')"; if (! $this->db->query($sql)) { dol_print_error($this->db); diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 3d9a5e8299c20082e697a64dc81f1a8b45e4674a..44e962de3ea6249ff34b97623f290f2b5efc7265 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -206,7 +206,7 @@ function show_array_actions_to_do($max=5) include_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; $sql = "SELECT a.id, a.label, a.datep as dp, a.datep2 as dp2, a.fk_user_author, a.percent,"; - $sql.= " c.code, c.libelle,"; + $sql.= " c.code, c.libelle as type_label,"; $sql.= " s.nom as sname, s.rowid, s.client"; $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c LEFT JOIN "; $sql.= " ".MAIN_DB_PREFIX."actioncomm as a ON c.id = a.fk_action"; @@ -243,7 +243,7 @@ function show_array_actions_to_do($max=5) print '<tr '.$bc[$var].'>'; $staticaction->type_code=$obj->code; - $staticaction->libelle=$obj->label; + $staticaction->label=($obj->label?$obj->label:$obj->type_label); $staticaction->id=$obj->id; print '<td>'.$staticaction->getNomUrl(1,34).'</td>'; @@ -440,14 +440,6 @@ function actions_prepare_head($object) $head[$h][2] = 'card'; $h++; - if (! empty($conf->global->AGENDA_USE_SEVERAL_CONTACTS)) - { - $head[$h][0] = DOL_URL_ROOT.'/comm/action/contact.php?id='.$object->id; - $head[$h][1] = $langs->trans("Contacts"); - $head[$h][2] = 'contact'; - $h++; - } - // Attached files require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $upload_dir = $conf->agenda->dir_output . "/" . $object->id; diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 709911faaecfac599bad19d3427912be7efd8241..f21d7d2ff028f372e840301c8d4ac8d92f5c69d2 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -173,6 +173,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt } $("#search_'.$htmlname.'").trigger("change"); // To tell that input text field was modified } + ,delay: 500 }).data( "autocomplete" )._renderItem = function( ul, item ) { return $( "<li></li>" ) .data( "item.autocomplete", item ) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index a95bbec6b720fc6c66c3fbca6062324fad1b7ce4..4b9401498d7ff987bc1d01daf00c73687c9bc2c7 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -566,9 +566,10 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR') $nbFerie = 0; // Check to ensure we use correct parameters - if ((($timestampEnd - $timestampStart) % 86400) != 0) return 'ErrorDates must use same hour and be GMT dates'; + if ((($timestampEnd - $timestampStart) % 86400) != 0) return 'ErrorDates must use same hours and must be GMT dates'; - while ($timestampStart < $timestampEnd) // Loop end when equals + $i=0; + while ($timestampStart < $timestampEnd && ($i < 50000)) // Loop end when equals (Test on i is a security loop to avoid infinite loop) { $ferie=false; $countryfound=0; @@ -576,7 +577,6 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR') $jour = date("d", $timestampStart); $mois = date("m", $timestampStart); $annee = date("Y", $timestampStart); - if ($countrycode == 'FR') { $countryfound=1; @@ -722,8 +722,10 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR') if ($ferie) $nbFerie++; // Increase number of days (on go up into loop) - $jour++; - $timestampStart=dol_mktime(0,0,0,$mois,$jour,$annee,1); // Generate GMT date for next day + $timestampStart=dol_time_plus_duree($timestampStart, 1, 'd'); + //var_dump($jour.' '.$mois.' '.$annee.' '.$timestampStart); + + $i++; } return $nbFerie; @@ -764,13 +766,16 @@ function num_between_day($timestampStart, $timestampEnd, $lastday=0) * @param int $inhour 0: return number of days, 1: return number of hours * @param int $lastday We include last day, 0: no, 1:yes * @param int $halfday Tag to define half day when holiday start and end + * @param string $country_code Country code (company country code if not defined) * @return int Number of days or hours */ -function num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $halfday=0) +function num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $halfday=0, $country_code='') { - global $langs; + global $langs,$mysoc; + + if (empty($country_code)) $country_code=$mysoc->country_code; - dol_syslog('num_open_day timestampStart='.$timestampStart.' timestampEnd='.$timestampEnd.' bit='.$lastday); + dol_syslog('num_open_day timestampStart='.$timestampStart.' timestampEnd='.$timestampEnd.' bit='.$lastday.' country_code='.$country_code); // Check parameters if (! is_int($timestampStart) && ! is_float($timestampStart)) return 'ErrorBadParameter_num_open_day'; @@ -779,7 +784,9 @@ function num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $ha //print 'num_open_day timestampStart='.$timestampStart.' timestampEnd='.$timestampEnd.' bit='.$lastday; if ($timestampStart < $timestampEnd) { - $nbOpenDay = num_between_day($timestampStart, $timestampEnd, $lastday) - num_public_holiday($timestampStart, $timestampEnd, $lastday); + $numdays = num_between_day($timestampStart, $timestampEnd, $lastday); + $numholidays = num_public_holiday($timestampStart, $timestampEnd, $country_code); + $nbOpenDay = $numdays - $numholidays; $nbOpenDay.= " " . $langs->trans("Days"); if ($inhour == 1 && $nbOpenDay <= 3) $nbOpenDay = $nbOpenDay*24 . $langs->trans("HourShort"); return $nbOpenDay - (($inhour == 1 ? 12 : 0.5) * abs($halfday)); diff --git a/htdocs/core/lib/invoice2.lib.php b/htdocs/core/lib/invoice2.lib.php index ccc115b5b1d327066a9f7451e6d4e90770c7a17f..866cf004ca64a3840d0a4d696986d1b7953aa239 100644 --- a/htdocs/core/lib/invoice2.lib.php +++ b/htdocs/core/lib/invoice2.lib.php @@ -2,19 +2,20 @@ /* * Copyright (C) 2009-2013 Laurent Destailleur <eldy@users.sourceforge.net> * -* 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 2 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 <http://www.gnu.org/licenses/>. -*/ + * 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 <http://www.gnu.org/licenses/>. + * or see http://www.gnu.org/ + */ /** * \file htdocs/core/lib/invoice2.lib.php diff --git a/htdocs/core/lib/prelevement.lib.php b/htdocs/core/lib/prelevement.lib.php index 257f13558ee261f55b2ea5994e374144b5389fec..53f54d66f70f04d84d047509ae223ee657ff40c2 100644 --- a/htdocs/core/lib/prelevement.lib.php +++ b/htdocs/core/lib/prelevement.lib.php @@ -44,14 +44,6 @@ function prelevement_prepare_head($object) $head[$h][2] = 'prelevement'; $h++; - if (! empty($conf->global->MAIN_USE_PREVIEW_TABS)) - { - $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/bon.php?id='.$object->id; - $head[$h][1] = $langs->trans("Preview"); - $head[$h][2] = 'preview'; - $h++; - } - $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/lignes.php?id='.$object->id; $head[$h][1] = $langs->trans("Lines"); $head[$h][2] = 'lines'; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 1d6e12b135725fd07696e5324ac1327f75d824fd..71b6d29ea42c5ee271b5b063bfc406702832f6cc 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -952,7 +952,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->accounting->enabled)) { $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy", $langs->trans("Fiscalyear"),0,$user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear'); - $newmenu->add("/accountancy/admin/account.php?mainmenu=home", $langs->trans("Chartofaccounts"),0,$user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear'); + $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy", $langs->trans("Chartofaccounts"),0,$user->rights->accounting->chartofaccount, '', $mainmenu, 'chartofaccount'); } } diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php index 38996c7e6f0b3bba451e7c322c3ed34e306fe7d3..464a01120ecdef4b135d91c62f860dc384467f9d 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.pdf.php @@ -210,6 +210,7 @@ class CommActionRapport $sql.= " WHERE c.id=a.fk_action AND a.fk_user_author = u.rowid"; $sql.= " AND a.datep BETWEEN '".$this->db->idate(dol_get_first_day($this->year,$this->month,false))."'"; $sql.= " AND '".$this->db->idate(dol_get_last_day($this->year,$this->month,false))."'"; + $sql.= " AND a.entity = ".$conf->entity; $sql.= " ORDER BY a.datep DESC"; $eventstatic=new ActionComm($this->db); diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index 9a544b1ece044a1417f1b21edc16acde0726fc67..e074bfe82f12ed1ce640d6007431c358501abfbc 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -229,6 +229,14 @@ class modAccounting extends DolibarrModules $this->rights[$r][4] = 'fiscalyear'; $this->rights[$r][5] = ''; $r++; + + $this->rights[$r][0] = 50440; + $this->rights[$r][1] = 'Manage chart of accounts'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'chartofaccount'; + $this->rights[$r][5] = ''; + $r++; // Main menu entries $this->menus = array(); diff --git a/htdocs/core/modules/modSyncSupplierWebServices.class.php b/htdocs/core/modules/modSyncSupplierWebServices.class.php index 088989f9de4d897bf509ed91be14c544ed84a84f..c17892ee217e180286ef841e2ec88854199f4e0d 100755 --- a/htdocs/core/modules/modSyncSupplierWebServices.class.php +++ b/htdocs/core/modules/modSyncSupplierWebServices.class.php @@ -44,7 +44,7 @@ class modSyncSupplierWebServices extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Enable the client for external supplier web services"; - $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version + $this->version = 'experimental'; // 'experimental' or 'dolibarr' or version // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) diff --git a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php new file mode 100644 index 0000000000000000000000000000000000000000..7440a357ea8f669330120a2d48e691552140c1a6 --- /dev/null +++ b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php @@ -0,0 +1,219 @@ +<?php +/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net> + * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> + * + * 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 <http://www.gnu.org/licenses/>. + * or see http://www.gnu.org/ + */ + +/** + * \file htdocs/core/modules/security/generate/modGeneratePassPerso.class.php + * \ingroup core + * \brief File to manage no password generation. + */ + +require_once DOL_DOCUMENT_ROOT .'/core/modules/security/generate/modules_genpassword.php'; + + +/** + * \class modGeneratePassPerso + * \brief Class to generate a password according to personal rules + */ +class modGeneratePassPerso extends ModeleGenPassword +{ + var $id; + var $length; + var $length2; // didn't overright display + var $NbMaj; + var $NbNum; + var $NbSpe; + var $NbRepeat; + var $WithoutAmbi; + + var $db; + var $conf; + var $lang; + var $user; + + var $Maj; + var $Min; + var $Nb; + var $Spe; + var $Ambi; + var $All; + + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param Conf $conf Handler de conf + * @param Translate $langs Handler de langue + * @param User $user Handler du user connecte + */ + function __construct($db, $conf, $langs, $user) + { + $this->id = "Perso"; + $this->length = $langs->trans("SetupPerso"); + + $this->db=$db; + $this->conf=$conf; + $this->langs=$langs; + $this->user=$user; + + if(empty($conf->global->USER_PASSWORD_PATTERN)){ + // default value (8carac, 1maj, 1digit, 1spe, 3 repeat, no ambi at auto generation. + dolibarr_set_const($db, "USER_PASSWORD_PATTERN", '8;1;1;1;3;1','chaine',0,'',$conf->entity); + } + + $this->Maj = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + $this->Min = strtolower($this->Maj); + $this->Nb = "0123456789"; + $this->Spe = "!@#$%&*()_-+={}[]\\|:;'/"; + $this->Ambi = array("1","I","l","|","O","0"); + + $tabConf = explode(";",$conf->global->USER_PASSWORD_PATTERN); + $this->length2 = $tabConf[0]; + $this->NbMaj = $tabConf[1]; + $this->NbNum = $tabConf[2]; + $this->NbSpe = $tabConf[3]; + $this->NbRepeat = $tabConf[4]; + $this->WithoutAmbi = $tabConf[5]; + + if ($this->WithoutAmbi) + { + $this->Maj = str_replace($this->Ambi,"",$this->Maj); + $this->Min = str_replace($this->Ambi,"",$this->Min); + $this->Nb = str_replace($this->Ambi,"",$this->Nb); + $this->Spe = str_replace($this->Ambi,"",$this->Spe); + } + + $this->All = str_shuffle($this->Maj. $this->Min. $this->Nb. $this->Spe); + //$this->All = $this->Maj. $this->Min. $this->Nb. $this->Spe; + //$this->All = $this->Spe; + + } + + /** + * Return description of module + * + * @return string Description of text + */ + function getDescription() + { + global $langs; + return $langs->trans("PasswordGenerationPerso"); + } + + /** + * Return an example of password generated by this module + * + * @return string Example of password + */ + function getExample() + { + return $this->getNewGeneratedPassword(); + } + + /** + * Build new password + * + * @return string Return a new generated password + */ + function getNewGeneratedPassword() + { + $pass = ""; + for($i=0; $i<$this->NbMaj; $i++){ // Y + $pass .= $this->Maj[rand(0,strlen($this->Maj) - 1)]; + } + + for($i=0; $i<$this->NbNum; $i++){ // X + $pass .= $this->Nb[rand(0,strlen($this->Nb) - 1)]; + } + + for($i=0; $i<$this->NbSpe; $i++){ // @ + $pass .= $this->Spe[rand(0,strlen($this->Spe) - 1)]; + } + + for($i=strlen($pass);$i<$this->length2; $i++){ // y + $pass .= $this->All[rand(0,strlen($this->All) -1)]; + } + + $pass = str_shuffle($pass); + + if ($this->validatePassword($pass)) + { + return $pass; + } + + return $this->getNewGeneratedPassword(); + } + + /** + * Validate a password + * + * @param string $password Password to check + * @return int 0 if KO, >0 if OK + */ + function validatePassword($password) + { + $password_a = str_split($password); + $maj = str_split($this->Maj); + $num = str_split($this->Nb); + $spe = str_split($this->Spe); + + if(count(array_intersect($password_a, $maj)) < $this->NbMaj){ + return 0; + } + + if(count(array_intersect($password_a, $num)) < $this->NbNum){ + return 0; + } + + if(count(array_intersect($password_a, $spe)) < $this->NbSpe){ + return 0; + } + + if(!$this->consecutiveInterationSameCharacter($password)){ + return 0; + } + + return 1; + } + + /** + * consecutive iterations of the same character + * + * @param string $password Password to check + * @return int 0 if KO, >0 if OK + */ + function consecutiveInterationSameCharacter($password){ + $last = ""; + $count = 0; + $char = str_split($password); + foreach($char as $c){ + if($c != $last){ + $last = $c; + $count = 0; + }else{ + $count++; + } + + if($count >= $this->NbRepeat) { + return 0; + } + } + return 1; + } +} + diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index d4fe47c0faacc48a85dd9a9f14a0c5db2d02890c..346932ec61e05ec3b330648343a39ff0c8c4aa9b 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -145,6 +145,17 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalClosedSignedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("PropalClosedSignedInDolibarr",$object->ref); + $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; + + $object->sendtoid=0; + } + elseif ($action == 'PROPAL_CLASSIFY_BILLED') + { + $langs->load("propal"); + + $object->actiontypecode='AC_OTH_AUTO'; + if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalClassifiedBilledInDolibarr",$object->ref); + $object->actionmsg=$langs->transnoentities("PropalClassifiedBilledInDolibarr",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->sendtoid=0; @@ -222,7 +233,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg=$langs->transnoentities("InvoiceSentByEMail",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; } - + // Parameters $object->sendtoid defined by caller //$object->sendtoid=0; } @@ -253,7 +264,7 @@ class InterfaceActionsAuto extends DolibarrTriggers } elseif ($action == 'FICHINTER_CREATE') { - $langs->load("other"); + $langs->load("other"); $langs->load("interventions"); $object->actiontypecode='AC_OTH_AUTO'; @@ -281,7 +292,7 @@ class InterfaceActionsAuto extends DolibarrTriggers } elseif ($action == 'FICHINTER_MODIFY') { - $langs->load("other"); + $langs->load("other"); $langs->load("interventions"); $object->actiontypecode='AC_OTH_AUTO'; @@ -293,7 +304,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->fk_element=0; $object->elementtype=''; } - elseif ($action == 'FICHINTER_SENTBYMAIL') + elseif ($action == 'FICHINTER_SENTBYMAIL') { $langs->load("other"); $langs->load("interventions"); @@ -305,19 +316,31 @@ class InterfaceActionsAuto extends DolibarrTriggers // Parameters $object->sendtoid defined by caller //$object->sendtoid=0; } - elseif ($action == 'FICHINTER_CLASSIFYBILLED') + elseif ($action == 'FICHINTER_CLASSIFY_BILLED') + { + $langs->load("other"); + $langs->load("interventions"); + + $object->actiontypecode='AC_OTH_AUTO'; + if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionClassifiedBilledInDolibarr",$object->ref); + $object->actionmsg=$langs->transnoentities("InterventionClassifiedBilledInDolibarr",$object->ref); + $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; + + $object->sendtoid=0; + } + elseif ($action == 'FICHINTER_CLASSIFY_UNBILLED') { $langs->load("other"); $langs->load("interventions"); $object->actiontypecode='AC_OTH_AUTO'; - if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionClassifiedBilled",$object->ref); - $object->actionmsg=$langs->transnoentities("InterventionClassifiedBilled",$object->ref); + if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionClassifiedUnbilledInDolibarr",$object->ref); + $object->actionmsg=$langs->transnoentities("InterventionClassifiedUnbilledInDolibarr",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->sendtoid=0; } - elseif ($action == 'FICHINTER_DELETE') + elseif ($action == 'FICHINTER_DELETE') { $langs->load("other"); $langs->load("interventions"); diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 076ad9bc6891ebf895b75b3e1fcdb58503b8046a..524feec13df54984b281adc61c9a2d6156ff8077 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -56,11 +56,19 @@ if (! $sortfield) } $limit = $conf->liste_limit; -$search_ref=GETPOST('search_ref','alpha'); +$search_ref=GETPOST('search_ref')?GETPOST('search_ref','alpha'):GETPOST('search_inter','alpha'); $search_company=GETPOST('search_company','alpha'); $search_desc=GETPOST('search_desc','alpha'); $search_status=GETPOST('search_status'); +$sall=GETPOST('sall'); +if (GETPOST("button_removefilter")) +{ + $search_ref=""; + $search_company=""; + $search_desc=""; + $search_status=""; +} /* * View @@ -99,6 +107,11 @@ if (! $user->rights->societe->client->voir && empty($socid)) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = " . $socid; +if ($sall) { + $arraytosearch=array('f.ref', 'f.description', 's.nom'); + if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $arraytosearch=array('f.ref', 'f.description', 's.nom', 'fd.description'); + $sql .= natural_search($arraytosearch, $sall); +} $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit+1, $offset); //print $sql; @@ -125,6 +138,7 @@ if ($result) print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],"fd.duree","",$urlparam,'align="right"',$sortfield,$sortorder); } print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"f.fk_statut","",$urlparam,'align="right"',$sortfield,$sortorder); + print_liste_field_titre('',$_SERVER["PHP_SELF"], ''); print "</tr>\n"; print '<tr class="liste_titre">'; @@ -145,9 +159,10 @@ if ($result) print '<td class="liste_titre" align="right">'; $liststatus=$interventionstatic->statuts_short; print $form->selectarray('search_status', $liststatus, GETPOST('search_status'), 1, 0, 0, '', 1); - print '<input class="liste_titre" align="right" type="image" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; print '</td>'; - print "</tr>\n"; + print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; + print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; + print "</td></tr>\n"; $companystatic=new Societe($db); @@ -178,7 +193,8 @@ if ($result) print '<td align="right">'.convertSecondToTime($objp->duree).'</td>'; } print '<td align="right">'.$interventionstatic->LibStatut($objp->fk_statut,5).'</td>'; - + + print '<td> </td>'; print "</tr>\n"; $total += $objp->duree; @@ -188,10 +204,10 @@ if ($result) if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) { print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").'</td>'; - print '<td align="right" class="nowrap liste_total">'.convertSecondToTime($total).'</td><td> </td>'; + print '<td align="right" class="nowrap liste_total">'.convertSecondToTime($total).'</td><td> </td><td> </td>'; print '</tr>'; } - + print '</table>'; print "</form>\n"; $db->free($result); diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php index a80cb00f2d33d071dedeb3a12656afb79e8f6e34..3253a79fcd85abfdfa960d76706c2dc8fc3e38a8 100644 --- a/htdocs/fourn/facture/impayees.php +++ b/htdocs/fourn/facture/impayees.php @@ -47,36 +47,14 @@ if ($user->societe_id > 0) $socid = $user->societe_id; } - -/* - * View - */ - -$now=dol_now(); - -llxHeader('',$langs->trans("BillsSuppliersUnpaid")); - -$title=$langs->trans("BillsSuppliersUnpaid"); - -$facturestatic=new FactureFournisseur($db); -$companystatic=new Societe($db); - - -/*************************************************************************** -* * -* Mode Liste * -* * -***************************************************************************/ - $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $search_ref = GETPOST('search_ref','alpha'); $search_ref_supplier = GETPOST('search_ref_supplier','alpha'); -$search_societe = GETPOST('search_societe','alpha'); -$search_montant_ht = GETPOST('search_montant_ht','int'); -$search_montant_ttc = GETPOST('search_montant_ttc','int'); - +$search_company = GETPOST('search_company','alpha'); +$search_amount_no_tax = GETPOST('search_amount_no_tax','alpha'); +$search_amount_all_tax = GETPOST('search_amount_all_tax','alpha'); $page = GETPOST("page",'int'); if ($page == -1) { $page = 0; } @@ -86,6 +64,28 @@ $pagenext = $page + 1; if (! $sortfield) $sortfield="f.date_lim_reglement"; if (! $sortorder) $sortorder="ASC"; +if (GETPOST("button_removefilter")) +{ + $search_ref=""; + $search_ref_supplier=""; + $search_company=""; + $search_amount_no_tax=""; + $search_amount_all_tax=""; +} + +/* + * View + */ + +$now=dol_now(); + +llxHeader('',$langs->trans("BillsSuppliersUnpaid")); + +$title=$langs->trans("BillsSuppliersUnpaid"); + +$facturestatic=new FactureFournisseur($db); +$companystatic=new Societe($db); + if ($user->rights->fournisseur->facture->lire) { $sql = "SELECT s.rowid as socid, s.nom as name,"; @@ -124,19 +124,19 @@ if ($user->rights->fournisseur->facture->lire) $sql .= " AND f.ref_supplier LIKE '%".$search_ref_supplier."%'"; } - if ($search_societe) + if ($search_company) { - $sql .= " AND s.nom LIKE '%".$search_societe."%'"; + $sql .= " AND s.nom LIKE '%".$search_company."%'"; } - if ($search_montant_ht) + if ($search_amount_no_tax) { - $sql .= " AND f.total_ht = '".$search_montant_ht."'"; + $sql .= " AND f.total_ht = '".$search_amount_no_tax."'"; } - if ($search_montant_ttc) + if ($search_amount_all_tax) { - $sql .= " AND f.total_ttc = '".$search_montant_ttc."'"; + $sql .= " AND f.total_ttc = '".$search_amount_all_tax."'"; } if (dol_strlen(GETPOST('sf_re')) > 0) @@ -165,9 +165,9 @@ if ($user->rights->fournisseur->facture->lire) if ($search_ref) $param.='&search_ref='.urlencode($search_ref); if ($search_ref_supplier) $param.='&search_ref_supplier='.urlencode($search_ref_supplier); - if ($search_societe) $param.='&search_societe='.urlencode($search_societe); - if ($search_montant_ht) $param.='&search_montant_ht='.urlencode($search_montant_ht); - if ($search_montant_ttc) $param.='&search_montant_ttc='.urlencode($search_montant_ttc); + if ($search_company) $param.='&search_company='.urlencode($search_company); + if ($search_amount_no_tax) $param.='&search_amount_no_tax='.urlencode($search_amount_no_tax); + if ($search_amount_all_tax) $param.='&search_amount_all_tax='.urlencode($search_amount_all_tax); $param.=($option?"&option=".$option:""); if (! empty($late)) $param.='&late='.urlencode($late); @@ -209,15 +209,15 @@ if ($user->rights->fournisseur->facture->lire) print '<td class="liste_titre"> </td>'; print '<td class="liste_titre"> </td>'; print '<td class="liste_titre" align="left">'; - print '<input class="flat" type="text" size="6" name="search_societe" value="'.$search_societe.'">'; + print '<input class="flat" type="text" size="6" name="search_company" value="'.$search_company.'">'; print '</td><td class="liste_titre" align="right">'; - print '<input class="flat" type="text" size="8" name="search_montant_ht" value="'.$search_montant_ht.'">'; + print '<input class="flat" type="text" size="8" name="search_amount_no_tax" value="'.$search_amount_no_tax.'">'; print '</td><td class="liste_titre" align="right">'; - print '<input class="flat" type="text" size="8" name="search_montant_ttc" value="'.$search_montant_ttc.'">'; + print '<input class="flat" type="text" size="8" name="search_amount_all_tax" value="'.$search_amount_all_tax.'">'; print '</td><td class="liste_titre" colspan="2" align="right">'; print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; - print '</td>'; - print "</tr>\n"; + print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; + print "</td></tr>\n"; if ($num > 0) { diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 9439fc534bd352a7f719dfd81581d77e9bd629d9..616e9690e8af6475f89ac45776bc4807e932b190 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -64,9 +64,26 @@ $pagenext = $page + 1; if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="fac.datef,fac.rowid"; -$month = GETPOST('month','int'); -$year = GETPOST('year','int'); - +$search_ref = GETPOST("search_ref","int"); +$search_ref_supplier = GETPOST("search_ref_supplier","alpha"); +$search_label = GETPOST("search_label","alpha"); +$search_company = GETPOST("search_company","alpha"); +$search_amount_no_tax = GETPOST("search_amount_no_tax","alpha"); +$search_amount_all_tax = GETPOST("search_amount_all_tax","alpha"); +$month = GETPOST("month","int"); +$year = GETPOST("year","int"); + +if (GETPOST("button_removefilter")) +{ + $search_ref=""; + $search_ref_supplier=""; + $search_label=""; + $search_company=""; + $search_amount_no_tax=""; + $search_amount_all_tax=""; + $year=""; + $month=""; +} /* * Actions @@ -93,9 +110,6 @@ if ($mode == 'search') } } - - - /* * View */ @@ -132,14 +146,14 @@ if (GETPOST('filtre') && GETPOST('filtre') != -1) // GETPOST('filtre') may be a } } -if (GETPOST("search_ref")) +if ($search_ref) { - if (is_numeric(GETPOST("search_ref"))) $sql .= natural_search(array('fac.rowid', 'fac.ref'), GETPOST('search_ref'));// For backward compatibility - else $sql .= natural_search('fac.ref', GETPOST("search_ref")); + if (is_numeric($search_ref)) $sql .= natural_search(array('fac.rowid', 'fac.ref'), $search_ref);// For backward compatibility + else $sql .= natural_search('fac.ref', $search_ref); } -if (GETPOST("search_ref_supplier")) +if (search_ref_supplier) { - $sql .= natural_search('fac.ref_supplier', GETPOST('search_ref_supplier')); + $sql .= natural_search('fac.ref_supplier', $search_ref_supplier); } if ($month > 0) { @@ -152,24 +166,24 @@ else if ($year > 0) { $sql.= " AND fac.datef BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; } -if (GETPOST("search_libelle")) +if ($search_label) { - $sql .= natural_search('fac.libelle', GETPOST('search_libelle')); + $sql .= natural_search('fac.libelle', $search_label); } -if (GETPOST("search_societe")) +if ($search_company) { - $sql .= natural_search('s.nom', GETPOST('search_societe')); + $sql .= natural_search('s.nom', $search_company); } -if (GETPOST("search_montant_ht")) +if ($search_amount_no_tax) { - $sql .= " AND fac.total_ht = '".$db->escape(price2num(GETPOST("search_montant_ht")))."'"; + $sql .= " AND fac.total_ht = '".$db->escape(price2num($search_amount_no_tax))."'"; } -if (GETPOST("search_montant_ttc")) +if ($search_amount_all_tax) { - $sql .= " AND fac.total_ttc = '".$db->escape(price2num(GETPOST("search_montant_ttc")))."'"; + $sql .= " AND fac.total_ttc = '".$db->escape(price2num($search_amount_all_tax))."'"; } $nbtotalofrecords = 0; @@ -195,14 +209,14 @@ if ($resql) } $param='&socid='.$socid; - if ($month) $param.='&month='.urlencode($month); - if ($year) $param.='&year=' .urlencode($year); - if (GETPOST("search_ref")) $param.='&search_ref='.urlencode(GETPOST("search_ref")); - if (GETPOST("search_ref_supplier")) $param.='&search_ref_supplier'.urlencode(GETPOST("search_ref_supplier")); - if (GETPOST("search_libelle")) $param.='&search_libelle='.urlencode(GETPOST("search_libelle")); - if (GETPOST("search_societe")) $param.='&search_societe='.urlencode(GETPOST("search_societe")); - if (GETPOST("search_montant_ht")) $param.='&search_montant_ht='.urlencode(GETPOST("search_montant_ht")); - if (GETPOST("search_montant_ttc")) $param.='&search_montant_ttc='.urlencode(GETPOST("search_montant_ttc")); + if ($month) $param.='&month='.urlencode($month); + if ($year) $param.='&year=' .urlencode($year); + if ($search_ref) $param.='&search_ref='.urlencode($search_ref); + if ($search_ref_supplier) $param.='&search_ref_supplier'.urlencode($search_ref_supplier); + if ($search_label) $param.='&search_label='.urlencode($search_label); + if ($search_company) $param.='&search_company='.urlencode($search_company); + if ($search_amount_no_tax) $param.='&search_amount_no_tax='.urlencode($search_amount_no_tax); + if ($search_amount_all_tax) $param.='&search_amount_all_tax='.urlencode($search_amount_all_tax); if (GETPOST("filtre") && GETPOST('filtre') != -1) $param.='&filtre='.urlencode(GETPOST("filtre")); print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->name.":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); @@ -218,17 +232,18 @@ if ($resql) if (! empty($conf->global->PROJECT_SHOW_REF_INTO_LISTS)) print_liste_field_titre($langs->trans("Project"),$_SERVER["PHP_SELF"],"p.ref","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"fac.total_ht","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"fac.total_ttc","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye","",$param,'align="right"',$sortfield,$sortorder); + print '<td class="liste_titre"> </td>'; print "</tr>\n"; // Lignes des champs de filtre print '<tr class="liste_titre">'; print '<td class="liste_titre" align="left">'; - print '<input class="flat" size="6" type="text" name="search_ref" value="'.GETPOST("search_ref").'">'; + print '<input class="flat" size="6" type="text" name="search_ref" value="'.$search_ref.'">'; print '</td>'; print '<td class="liste_titre" align="left">'; - print '<input class="flat" size="6" type="text" name="search_ref_supplier" value="'.GETPOST("search_ref_supplier").'">'; + print '<input class="flat" size="6" type="text" name="search_ref_supplier" value="'.$search_ref_supplier.'">'; print '</td>'; print '<td class="liste_titre" colspan="1" align="center">'; print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">'; @@ -239,10 +254,10 @@ if ($resql) print '</td>'; print '<td class="liste_titre"> </td>'; print '<td class="liste_titre" align="left">'; - print '<input class="flat" size="16" type="text" name="search_libelle" value="'.GETPOST("search_libelle").'">'; + print '<input class="flat" size="16" type="text" name="search_label" value="'.$search_label.'">'; print '</td>'; print '<td class="liste_titre" align="left">'; - print '<input class="flat" type="text" size="8" name="search_societe" value="'.GETPOST("search_societe").'">'; + print '<input class="flat" type="text" size="8" name="search_company" value="'.$search_company.'">'; print '</td>'; if (! empty($conf->global->PROJECT_SHOW_REF_INTO_LISTS)) { @@ -250,13 +265,15 @@ if ($resql) print '</td>'; } print '<td class="liste_titre" align="right">'; - print '<input class="flat" type="text" size="8" name="search_montant_ht" value="'.GETPOST("search_montant_ht").'">'; + print '<input class="flat" type="text" size="8" name="search_amount_no_tax" value="'.$search_amount_no_tax.'">'; + print '</td><td class="liste_titre" align="right">'; + print '<input class="flat" type="text" size="8" name="search_amount_all_tax" value="'.$search_amount_all_tax.'">'; print '</td><td class="liste_titre" align="right">'; - print '<input class="flat" type="text" size="8" name="search_montant_ttc" value="'.GETPOST("search_montant_ttc").'">'; - print '</td><td class="liste_titre" align="center">'; $liststatus=array('paye:0'=>$langs->trans("Unpayed"), 'paye:1'=>$langs->trans("Payed")); print $form->selectarray('filtre', $liststatus, GETPOST('filtre'), 1); - print '<input type="image" class="liste_titre" align="right" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; + print '</td><td class="liste_titre" align="right">'; + print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; + print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; print '</td>'; print "</tr>\n"; @@ -312,6 +329,8 @@ if ($resql) //print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5,$objp->am); print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5); print '</td>'; + + print '<td align="center"> </td>'; print "</tr>\n"; $i++; @@ -325,6 +344,7 @@ if ($resql) print '<td class="liste_total" align="right">'.price($total).'</td>'; print '<td class="liste_total" align="right">'.price($total_ttc).'</td>'; print '<td class="liste_total" align="center"> </td>'; + print '<td class="liste_total" align="center"> </td>'; print "</tr>\n"; } } diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 831749b19043f89986bd3b3970c6674120959fca..f467e9235efee52472b9df6633ca4709123c13b0 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -458,6 +458,15 @@ if (empty($action)) $search_paymenttype=GETPOST('search_paymenttype'); $search_amount=GETPOST('search_amount'); $search_company=GETPOST('search_company'); + + if (GETPOST("button_removefilter")) + { + $search_ref=""; + $search_account=""; + $search_paymenttype=""; + $search_amount=""; + $search_company=""; + } $sql = 'SELECT p.rowid as pid, p.datep as dp, p.amount as pamount, p.num_paiement,'; $sql.= ' s.rowid as socid, s.nom as name,'; @@ -494,7 +503,7 @@ if (empty($action)) } if (! empty($search_amount)) { - $sql .= " AND p.amount=".price2num($search_amount); + $sql .= " AND p.amount='".price2num($search_amount)."'"; } if (! empty($search_company)) { @@ -515,7 +524,7 @@ if (empty($action)) $paramlist=''; $paramlist.=(! empty($search_ref)?"&search_ref=".$search_ref:""); $paramlist.=(! empty($search_company)?"&search_company=".$search_company:""); - $paramlist.=(! empty($search_amount)?"&search_amount=".$search_amount:""); + $paramlist.=(! empty($search_amount)?"&search_amount='".$search_amount:""); print_barre_liste($langs->trans('SupplierPayments'), $page, $_SERVER["PHP_SELF"],$paramlist,$sortfield,$sortorder,'',$num); @@ -529,16 +538,17 @@ if (empty($action)) print_liste_field_titre($langs->trans('Account'),$_SERVER["PHP_SELF"],'ba.label','',$paramlist,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Amount'),$_SERVER["PHP_SELF"],'f.amount','',$paramlist,'align="right"',$sortfield,$sortorder); //print_liste_field_titre($langs->trans('Invoice'),$_SERVER["PHP_SELF"],'ref_supplier','',$paramlist,'',$sortfield,$sortorder); - print "</tr>\n"; + print '<td class="liste_titre"> </td>'; + print "</tr>\n"; // Lines for filters fields print '<tr class="liste_titre">'; print '<td align="left">'; - print '<input class="fat" type="text" size="4" name="search_ref" value="'.$search_ref.'">'; + print '<input class="flat" type="text" size="4" name="search_ref" value="'.$search_ref.'">'; print '</td>'; print '<td> </td>'; print '<td align="left">'; - print '<input class="fat" type="text" size="6" name="search_company" value="'.$search_company.'">'; + print '<input class="flat" type="text" size="6" name="search_company" value="'.$search_company.'">'; print '</td>'; print '<td>'; $form->select_types_paiements($search_paymenttype,'search_paymenttype','',2,1,1); @@ -547,9 +557,11 @@ if (empty($action)) $form->select_comptes($search_account,'search_account',0,'',1); print '</td>'; print '<td align="right">'; - print '<input class="fat" type="text" size="4" name="search_amount" value="'.$search_amount.'">'; - print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" alt="'.$langs->trans("Search").'">'; - print '</td>'; + print '<input class="flat" type="text" size="4" name="search_amount" value="'.$search_amount.'">'; + print '</td><td align="right">'; + print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; + print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; + print '</td>'; print "</tr>\n"; while ($i < min($num,$limit)) @@ -584,7 +596,8 @@ if (empty($action)) print '<td class="nowrap">'; print $invoicesupplierstatic->getNomUrl(1); print '</td>';*/ - + + print '<td> </td>'; print '</tr>'; $i++; } diff --git a/htdocs/fourn/list.php b/htdocs/fourn/list.php index d3f7e55c19976e1723970ceb87cc2fb0b9144e8e..296415c1aee5acc621ed9a35f48686fb878b90ac 100644 --- a/htdocs/fourn/list.php +++ b/htdocs/fourn/list.php @@ -32,15 +32,15 @@ $langs->load("suppliers"); $langs->load("orders"); $langs->load("companies"); -$socname = GETPOST("socname"); -$search_nom = GETPOST("search_nom"); -$search_zipcode = GETPOST("search_zipcode"); -$search_town = GETPOST("search_town"); -$search_code_fournisseur = GETPOST("search_code_fournisseur"); -$search_compta_fournisseur = GETPOST("search_compta_fournisseur"); -$search_datec = GETPOST("search_datec"); -$search_categ = GETPOST('search_categ','int'); -$catid = GETPOST("catid",'int'); +$socname = GETPOST("socname"); +$search_name = GETPOST("search_name"); +$search_zipcode = GETPOST("search_zipcode"); +$search_town = GETPOST("search_town"); +$search_supplier_code = GETPOST("search_supplier_code"); +$search_supplier_accounting = GETPOST("search_supplier_accounting"); +$search_datec = GETPOST("search_datec"); +$search_categ = GETPOST('search_categ','int'); +$catid = GETPOST("catid",'int'); // Security check $socid = GETPOST('socid','int'); @@ -60,6 +60,19 @@ if (! $sortfield) $sortfield="nom"; // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('supplierlist')); +if (GETPOST("button_removefilter_x")) +{ + $socname=""; + $search_name=""; + $search_zipcode=""; + $search_town=""; + $search_supplier_code=""; + $search_supplier_accounting=""; + $search_datec=""; + $search_categ=""; + $catid=""; +} + /* * Actions */ @@ -95,15 +108,15 @@ if ($socname) { $sortfield = "s.nom"; $sortorder = "ASC"; } -if ($search_nom) { - $sql .= natural_search('s.nom', $search_nom); +if ($search_name) { + $sql .= natural_search('s.nom', $search_name); } if ($search_zipcode) $sql .= " AND s.zip LIKE '".$db->escape($search_zipcode)."%'"; if ($search_town) { $sql .= natural_search('s.town', $search_town); } -if ($search_code_fournisseur) $sql .= " AND s.code_fournisseur LIKE '%".$db->escape($search_code_fournisseur)."%'"; -if ($search_compta_fournisseur) $sql .= " AND s.code_compta_fournisseur LIKE '%".$db->escape($search_compta_fournisseur)."%'"; +if ($search_supplier_code) $sql .= " AND s.code_fournisseur LIKE '%".$db->escape($search_supplier_code)."%'"; +if ($search_supplier_accounting) $sql .= " AND s.code_compta_fournisseur LIKE '%".$db->escape($search_supplier_accounting)."%'"; if ($search_datec) $sql .= " AND s.datec LIKE '%".$db->escape($search_datec)."%'"; if ($catid > 0) $sql.= " AND cf.fk_categorie = ".$catid; if ($catid == -2) $sql.= " AND cf.fk_categorie IS NULL"; @@ -126,7 +139,7 @@ if ($resql) $num = $db->num_rows($resql); $i = 0; - $param = "&search_nom=".$search_nom."&search_code_fournisseur=".$search_code_fournisseur."&search_zipcode=".$search_zipcode."&search_town=".$search_town; + $param = "&search_name=".$search_name."&search_supplier_code=".$search_supplier_code."&search_zipcode=".$search_zipcode."&search_town=".$search_town; if ($search_categ != '') $param.='&search_categ='.$search_categ; print_barre_liste($langs->trans("ListOfSuppliers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords); @@ -166,26 +179,28 @@ if ($resql) print '<tr class="liste_titre">'; - print '<td class="liste_titre"><input type="text" class="flat" name="search_nom" value="'.$search_nom.'"></td>'; + print '<td class="liste_titre"><input type="text" size="10" class="flat" name="search_name" value="'.$search_name.'"></td>'; - print '<td class="liste_titre"><input type="text" class="flat" name="search_zipcode" value="'.$search_zipcode.'"></td>'; + print '<td class="liste_titre"><input type="text" size="10" class="flat" name="search_zipcode" value="'.$search_zipcode.'"></td>'; - print '<td class="liste_titre"><input type="text" class="flat" name="search_town" value="'.$search_town.'"></td>'; + print '<td class="liste_titre"><input type="text" size="10" class="flat" name="search_town" value="'.$search_town.'"></td>'; print '<td align="left" class="liste_titre">'; - print '<input class="flat" type="text" size="10" name="search_code_fournisseur" value="'.$search_code_fournisseur.'">'; + print '<input class="flat" type="text" size="10" name="search_supplier_code" value="'.$search_supplier_code.'">'; print '</td>'; print '<td align="left" class="liste_titre">'; - print '<input class="flat" type="text" size="10" name="search_compta_fournisseur" value="'.$search_compta_fournisseur.'">'; + print '<input class="flat" type="text" size="10" name="search_supplier_accounting" value="'.$search_supplier_accounting.'">'; print '</td>'; print '<td align="right" class="liste_titre">'; print '<input class="flat" type="text" size="10" name="search_datec" value="'.$search_datec.'">'; print '</td>'; - print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>'; - + print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; + print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; + print "</td></tr>\n"; + $parameters=array(); $formconfirm=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook diff --git a/htdocs/holiday/index.php b/htdocs/holiday/index.php index 04a96a7001df9b8c893d25c11bd21c7a731ae391..e988e6407111d667632e24bac8e12effb286d2be 100644 --- a/htdocs/holiday/index.php +++ b/htdocs/holiday/index.php @@ -64,6 +64,19 @@ $search_employe = GETPOST('search_employe'); $search_valideur = GETPOST('search_valideur'); $search_statut = GETPOST('select_statut'); +if (GETPOST("button_removefilter")) +{ + $search_ref=""; + $month_create=""; + $year_create=""; + $month_start=""; + $year_start=""; + $month_end=""; + $year_end=""; + $search_employe=""; + $search_valideur=""; + $search_statut=""; +} /* * Actions @@ -71,8 +84,6 @@ $search_statut = GETPOST('select_statut'); // None - - /* * View */ @@ -257,7 +268,7 @@ print_liste_field_titre($langs->trans("Employe"),$_SERVER["PHP_SELF"],"cp.fk_use print_liste_field_titre($langs->trans("ValidatorCP"),$_SERVER["PHP_SELF"],"cp.fk_validator","",'','',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateDebCP"),$_SERVER["PHP_SELF"],"cp.date_debut","",'','align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateFinCP"),$_SERVER["PHP_SELF"],"cp.date_fin","",'','align="center"',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],'','','','align="right"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],'','','','align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cp.statut","",'','align="center"',$sortfield,$sortorder); print '<td></td>'; print "</tr>\n"; @@ -323,7 +334,8 @@ print '</td>'; // ACTION print '<td align="right">'; -print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" alt="'.$langs->trans('Search').'">'; +print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; +print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; print '</td>'; print "</tr>\n"; diff --git a/htdocs/includes/jquery/plugins/multiple-select/LICENSE b/htdocs/includes/jquery/plugins/multiple-select/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..c3ebd2b52488fff10d65fb4ab4d93b1d95665bda --- /dev/null +++ b/htdocs/includes/jquery/plugins/multiple-select/LICENSE @@ -0,0 +1,21 @@ +(The MIT License) + +Copyright (c) 2012-2014 Zhixin Wen <wenzhixin2010@gmail.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/multiple-select/README.md b/htdocs/includes/jquery/plugins/multiple-select/README.md new file mode 100644 index 0000000000000000000000000000000000000000..81b82ba74c0feb6e16a7d12d1974946e6f7e3f7b --- /dev/null +++ b/htdocs/includes/jquery/plugins/multiple-select/README.md @@ -0,0 +1,96 @@ +# Multiple Select + +Multiple select is a jQuery plugin to select multiple elements with checkboxes :). + +To get started checkout examples and documentation at http://wenzhixin.net.cn/p/multiple-select + +## Contributors + +Multiple select is due to the excellent work of the following contributors: + +<table> +<tbody> +<tr><th align="left">文翼</th><td><a href="https://github.com/wenzhixin">GitHub/wenzhixin</a></td></tr> +<tr><th align="left">Gaurav Jassal</th><td><a href="https://github.com/creativeaura">GitHub/creativeaura</a></td><</tr> +<tr><th align="left">guli</th><td><a href="https://github.com/guli">GitHub/guli</a></td></tr> +<tr><th align="left">jwheadon</th><td><a href="https://github.com/jwheadon">GitHub/jwheadon</a></td></tr> +<tr><th align="left">yx</th><td><a href="https://github.com/qqfish">GitHub/qqfish</a></td></tr> +<tr><th align="left">Tobias Macey</th><td><a href="https://github.com/blarghmatey">GitHub/blarghmatey</a></td></tr> +<tr><th align="left">Jona Goldman</th><td><a href="https://github.com/jonagoldman">GitHub/jonagoldman</a></td></tr> +<tr><th align="left">Alex Jeffrey</th><td><a href="https://github.com/ajeffrey">GitHub/ajeffrey</a></td></tr> +</tbody> +</table> + +## Changelog + +### 1.1.0 + +* Fix #63: Add ```keepOpen``` option. +* Fix #62: Fix ```isOpen``` and ```filter``` options are both true bug. +* Fix #57: Fire onCheckAll event when literally select. +* Add data attributes for support. +* Fix #55: Add ```name``` option. + +### 1.0.9 + +* Fix #42: Add ```styler``` option to custom item style. +* Fix firefox click bug. +* Add ```allSelected```, ```minumimCountSelected``` and ```countSelected``` options. +* Fix #35: Add ```onFocus``` and ```onBlur``` events. +* Fix #25: Add ```focus``` and ```blur``` methods. +* Fix #31: Trigger the onCheckAll & onUncheckAll events when use filter to select all. + +### 1.0.8 + +* Update the license to The MIT License. +* Fix #47: Add ```No matches found``` message when there are no results found. +* Fix #43: Add ```position``` option. + +### 1.0.7 + +* Fix #44: The filters not working bugs. + +### 1.0.6 + +* Fix #21: Add ```single``` option. +* Add ```override``` option. +* Add ```container``` option. +* Fix #29: Update the optgroups select text. +* Fix #30: Image is not shown in Firefox 25.0.1. +* Fix #22: fix group filter problem. + +### 1.0.5 + +* Update the button text witdh. +* Add keyboard support. + +### 1.0.4 + +* Fix #12: Add ```width``` option. +* Fix #11: Add callback events. +* Add ```maxHeight``` option. + +### 1.0.3 + +* Fix #4: Add ```filter``` option. +* Support mobile devices. +* Fix #6: Add ```refresh``` method. + +### 1.0.2 + +* Fix #7: Add ```selected``` and ```disabled``` options. +* Fix #5: Add ```checkAll``` and ```uncheckAll``` methods. + +### 1.0.1 + +* Fix #3: Add optgroups support. +* Add ```placeholder``` option. +* Fix #2: use prop method instead of attr. + +### 1.0.0 + +* Initial release + +## LICENSE + +[The MIT License](https://github.com/wenzhixin/multiple-select/blob/master/LICENSE) \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/multiple-select/jquery.multiple.select.js b/htdocs/includes/jquery/plugins/multiple-select/jquery.multiple.select.js new file mode 100644 index 0000000000000000000000000000000000000000..32e6635bbaaab239991f7d0fd4caba89e673647e --- /dev/null +++ b/htdocs/includes/jquery/plugins/multiple-select/jquery.multiple.select.js @@ -0,0 +1,466 @@ +/** + * @author zhixin wen <wenzhixin2010@gmail.com> + * @version 1.1.0 + * + * http://wenzhixin.net.cn/p/multiple-select/ + */ + +(function($) { + + 'use strict'; + + function MultipleSelect($el, options) { + var that = this, + name = $el.attr('name') || options.name || '', + elWidth = $el.width(); + + this.$el = $el.hide(); + this.options = options; + + this.$parent = $('<div class="ms-parent"></div>'); + this.$choice = $('<button type="button" class="ms-choice"><span class="placeholder">' + + options.placeholder + '</span><div></div></button>'); + this.$drop = $('<div class="ms-drop ' + options.position + '"></div>'); + this.$el.after(this.$parent); + this.$parent.append(this.$choice); + this.$parent.append(this.$drop); + + if (this.$el.prop('disabled')) { + this.$choice.addClass('disabled'); + } + this.$choice.css('width', elWidth + 'px'); + this.$drop.css({ + width: (options.width || elWidth) + 'px' + }); + + if (!this.options.keepOpen) { + $('body').click(function(e) { + if ($(e.target)[0] === that.$choice[0] || + $(e.target).parents('.ms-choice')[0] === that.$choice[0]) { + return; + } + if (($(e.target)[0] === that.$drop[0] || + $(e.target).parents('.ms-drop')[0] !== that.$drop[0]) && + that.options.isOpen) { + that.close(); + } + }); + } + + this.selectAllName = 'name="selectAll' + name + '"'; + this.selectGroupName = 'name="selectGroup' + name + '"'; + this.selectItemName = 'name="selectItem' + name + '"'; + } + + MultipleSelect.prototype = { + constructor : MultipleSelect, + + init: function() { + var that = this, + html = []; + if (this.options.filter) { + html.push( + '<div class="ms-search">', + '<input type="text" autocomplete="off" autocorrect="off" autocapitilize="off" spellcheck="false">', + '</div>' + ); + } + html.push('<ul>'); + if (this.options.selectAll && !this.options.single) { + html.push( + '<li>', + '<label>', + '<input type="checkbox" ' + this.selectAllName + ' /> ', + '[' + this.options.selectAllText + ']', + '</label>', + '</li>' + ); + } + $.each(this.$el.children(), function(i, elm) { + html.push(that.optionToHtml(i, elm)); + }); + html.push('<li class="ms-no-results">No matches found</li>'); + html.push('</ul>'); + this.$drop.html(html.join('')); + this.$drop.find('ul').css('max-height', this.options.maxHeight + 'px'); + this.$drop.find('.multiple').css('width', this.options.multipleWidth + 'px'); + + this.$searchInput = this.$drop.find('.ms-search input'); + this.$selectAll = this.$drop.find('input[' + this.selectAllName + ']'); + this.$selectGroups = this.$drop.find('input[' + this.selectGroupName + ']'); + this.$selectItems = this.$drop.find('input[' + this.selectItemName + ']:enabled'); + this.$disableItems = this.$drop.find('input[' + this.selectItemName + ']:disabled'); + this.$noResults = this.$drop.find('.ms-no-results'); + this.events(); + this.update(); + + if (this.options.isOpen) { + this.open(); + } + }, + + optionToHtml: function(i, elm, group, groupDisabled) { + var that = this, + $elm = $(elm), + html = [], + multiple = this.options.multiple, + disabled, + type = this.options.single ? 'radio' : 'checkbox'; + + if ($elm.is('option')) { + var value = $elm.val(), + text = $elm.text(), + selected = $elm.prop('selected'), + style = this.options.styler(value) ? ' style="' + this.options.styler(value) + '"' : ''; + + disabled = groupDisabled || $elm.prop('disabled'); + html.push( + '<li' + (multiple ? ' class="multiple"' : '') + style + '>', + '<label' + (disabled ? ' class="disabled"' : '') + '>', + '<input type="' + type + '" ' + this.selectItemName + ' value="' + value + '"' + + (selected ? ' checked="checked"' : '') + + (disabled ? ' disabled="disabled"' : '') + + (group ? ' data-group="' + group + '"' : '') + + '/> ', + text, + '</label>', + '</li>' + ); + } else if (!group && $elm.is('optgroup')) { + var _group = 'group_' + i, + label = $elm.attr('label'); + + disabled = $elm.prop('disabled'); + html.push( + '<li class="group">', + '<label class="optgroup' + (disabled ? ' disabled' : '') + '" data-group="' + _group + '">', + '<input type="checkbox" ' + this.selectGroupName + + (disabled ? ' disabled="disabled"' : '') + ' /> ', + label, + '</label>', + '</li>'); + $.each($elm.children(), function(i, elm) { + html.push(that.optionToHtml(i, elm, _group, disabled)); + }); + } + return html.join(''); + }, + + events: function() { + var that = this; + this.$choice.off('click').on('click', function(e) { + e.preventDefault(); + that[that.options.isOpen ? 'close' : 'open'](); + }) + .off('focus').on('focus', this.options.onFocus) + .off('blur').on('blur', this.options.onBlur); + + this.$parent.off('keydown').on('keydown', function(e) { + switch (e.which) { + case 27: // esc key + that.close(); + that.$choice.focus(); + break; + } + }); + this.$searchInput.off('keyup').on('keyup', function() { + that.filter(); + }); + this.$selectAll.off('click').on('click', function() { + var checked = $(this).prop('checked'), + $items = that.$selectItems.filter(':visible'); + if ($items.length === that.$selectItems.length) { + that[checked ? 'checkAll' : 'uncheckAll'](); + } else { // when the filter option is true + that.$selectGroups.prop('checked', checked); + $items.prop('checked', checked); + that.options[checked ? 'onCheckAll' : 'onUncheckAll'](); + that.update(); + } + }); + this.$selectGroups.off('click').on('click', function() { + var group = $(this).parent().attr('data-group'), + $items = that.$selectItems.filter(':visible'), + $children = $items.filter('[data-group="' + group + '"]'), + checked = $children.length !== $children.filter(':checked').length; + $children.prop('checked', checked); + that.updateSelectAll(); + that.update(); + that.options.onOptgroupClick({ + label: $(this).parent().text(), + checked: checked, + children: $children.get() + }); + }); + this.$selectItems.off('click').on('click', function() { + that.updateSelectAll(); + that.update(); + that.updateOptGroupSelect(); + that.options.onClick({ + label: $(this).parent().text(), + value: $(this).val(), + checked: $(this).prop('checked') + }); + }); + }, + + open: function() { + if (this.$choice.hasClass('disabled')) { + return; + } + this.options.isOpen = true; + this.$choice.find('>div').addClass('open'); + this.$drop.show(); + if (this.options.container) { + var offset = this.$drop.offset(); + this.$drop.appendTo($(this.options.container)); + this.$drop.offset({ top: offset.top, left: offset.left }); + } + if (this.options.filter) { + this.$searchInput.val(''); + this.filter(); + } + this.options.onOpen(); + }, + + close: function() { + this.options.isOpen = false; + this.$choice.find('>div').removeClass('open'); + this.$drop.hide(); + if (this.options.container) { + this.$parent.append(this.$drop); + this.$drop.css({ + 'top': 'auto', + 'left': 'auto' + }) + } + this.options.onClose(); + }, + + update: function() { + var selects = this.getSelects('text'), + $span = this.$choice.find('>span'); + if (selects.length === this.$selectItems.length + this.$disableItems.length && this.options.allSelected) { + $span.removeClass('placeholder').html(this.options.allSelected); + } else if (selects.length > this.options.minumimCountSelected && this.options.countSelected) { + $span.removeClass('placeholder').html(this.options.countSelected + .replace('#', selects.length) + .replace('%', this.$selectItems.length + this.$disableItems.length)); + } else if (selects.length) { + $span.removeClass('placeholder').html(selects.join(', ')); + } else { + $span.addClass('placeholder').html(this.options.placeholder); + } + // set selects to select + this.$el.val(this.getSelects()); + }, + + updateSelectAll: function() { + var $items = this.$selectItems.filter(':visible'); + this.$selectAll.prop('checked', $items.length && + $items.length === $items.filter(':checked').length); + if (this.$selectAll.prop('checked')) { + this.options.onCheckAll(); + } + }, + + updateOptGroupSelect: function() { + var $items = this.$selectItems.filter(':visible'); + $.each(this.$selectGroups, function(i, val) { + var group = $(val).parent().attr('data-group'), + $children = $items.filter('[data-group="' + group + '"]'); + $(val).prop('checked', $children.length && + $children.length === $children.filter(':checked').length); + }); + }, + + //value or text, default: 'value' + getSelects: function(type) { + var that = this, + texts = [], + values = []; + this.$drop.find('input[' + this.selectItemName + ']:checked').each(function() { + texts.push($(this).parent().text()); + values.push($(this).val()); + }); + + if (type === 'text' && this.$selectGroups.length) { + texts = []; + this.$selectGroups.each(function() { + var html = [], + text = $.trim($(this).parent().text()), + group = $(this).parent().data('group'), + $children = that.$drop.find('[' + that.selectItemName + '][data-group="' + group + '"]'), + $selected = $children.filter(':checked'); + + if ($selected.length === 0) { + return; + } + + html.push('['); + html.push(text); + if ($children.length > $selected.length) { + var list = []; + $selected.each(function() { + list.push($(this).parent().text()); + }); + html.push(': ' + list.join(', ')); + } + html.push(']'); + texts.push(html.join('')); + }); + } + return type === 'text' ? texts : values; + }, + + setSelects: function(values) { + var that = this; + this.$selectItems.prop('checked', false); + $.each(values, function(i, value) { + that.$selectItems.filter('[value="' + value + '"]').prop('checked', true); + }); + this.$selectAll.prop('checked', this.$selectItems.length === + this.$selectItems.filter(':checked').length); + this.update(); + }, + + enable: function() { + this.$choice.removeClass('disabled'); + }, + + disable: function() { + this.$choice.addClass('disabled'); + }, + + checkAll: function() { + this.$selectItems.prop('checked', true); + this.$selectGroups.prop('checked', true); + this.$selectAll.prop('checked', true); + this.update(); + this.options.onCheckAll(); + }, + + uncheckAll: function() { + this.$selectItems.prop('checked', false); + this.$selectGroups.prop('checked', false); + this.$selectAll.prop('checked', false); + this.update(); + this.options.onUncheckAll(); + }, + + focus: function() { + this.$choice.focus(); + this.options.onFocus(); + }, + + blur: function() { + this.$choice.blur(); + this.options.onBlur(); + }, + + refresh: function() { + this.init(); + }, + + filter: function() { + var that = this, + text = $.trim(this.$searchInput.val()).toLowerCase(); + if (text.length === 0) { + this.$selectItems.parent().show(); + this.$disableItems.parent().show(); + this.$selectGroups.parent().show(); + } else { + this.$selectItems.each(function() { + var $parent = $(this).parent(); + $parent[$parent.text().toLowerCase().indexOf(text) < 0 ? 'hide' : 'show'](); + }); + this.$disableItems.parent().hide(); + this.$selectGroups.each(function() { + var $parent = $(this).parent(); + var group = $parent.attr('data-group'), + $items = that.$selectItems.filter(':visible'); + $parent[$items.filter('[data-group="' + group + '"]').length === 0 ? 'hide' : 'show'](); + }); + + //Check if no matches found + if (this.$selectItems.filter(':visible').length) { + this.$selectAll.parent().show(); + this.$noResults.hide(); + } else { + this.$selectAll.parent().hide(); + this.$noResults.show(); + } + } + this.updateOptGroupSelect(); + this.updateSelectAll(); + } + }; + + $.fn.multipleSelect = function() { + var option = arguments[0], + args = arguments, + + value, + allowedMethods = [ + 'getSelects', 'setSelects', + 'enable', 'disable', + 'checkAll', 'uncheckAll', + 'focus', 'blur', + 'refresh' + ]; + + this.each(function() { + var $this = $(this), + data = $this.data('multipleSelect'), + options = $.extend({}, $.fn.multipleSelect.defaults, + $this.data(), typeof option === 'object' && option); + + if (!data) { + data = new MultipleSelect($this, options); + $this.data('multipleSelect', data); + } + + if (typeof option === 'string') { + if ($.inArray(option, allowedMethods) < 0) { + throw "Unknown method: " + option; + } + value = data[option](args[1]); + } else { + data.init(); + } + }); + + return value ? value : this; + }; + + $.fn.multipleSelect.defaults = { + name: '', + isOpen: false, + placeholder: '', + selectAll: true, + selectAllText: 'Select all', + allSelected: 'All selected', + minumimCountSelected: 3, + countSelected: '# of % selected', + multiple: false, + multipleWidth: 80, + single: false, + filter: false, + width: undefined, + maxHeight: 250, + container: null, + position: 'bottom', + keepOpen: false, + + styler: function() {return false;}, + + onOpen: function() {return false;}, + onClose: function() {return false;}, + onCheckAll: function() {return false;}, + onUncheckAll: function() {return false;}, + onFocus: function() {return false;}, + onBlur: function() {return false;}, + onOptgroupClick: function() {return false;}, + onClick: function() {return false;} + }; +})(jQuery); diff --git a/htdocs/includes/jquery/plugins/multiple-select/multiple-select.css b/htdocs/includes/jquery/plugins/multiple-select/multiple-select.css new file mode 100644 index 0000000000000000000000000000000000000000..d824e0c7a2b0d9a796d4390c51eab945ed089d06 --- /dev/null +++ b/htdocs/includes/jquery/plugins/multiple-select/multiple-select.css @@ -0,0 +1,183 @@ +/** + * @author zhixin wen <wenzhixin2010@gmail.com> + */ + +.ms-parent { + display: inline-block; + position: relative; + vertical-align: middle; +} + +.ms-choice { + display: block; + height: 26px; + padding: 0; + overflow: hidden; + cursor: pointer; + border: 1px solid #aaa; + text-align: left; + white-space: nowrap; + line-height: 26px; + color: #444; + text-decoration: none; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + background-color: #fff; +} + +.ms-choice.disabled { + background-color: #f4f4f4; + background-image: none; + border: 1px solid #ddd; + cursor: default; +} + +.ms-choice > span { + position: absolute; + top: 0; + left: 0; + right: 20px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + display: block; + padding-left: 8px; +} + +.ms-choice > span.placeholder { + color: #999; +} + +.ms-choice > div { + position: absolute; + top: 0; + right: 0; + width: 20px; + height: 25px; + background: url('multiple-select.png') right top no-repeat; +} + +.ms-choice > div.open { + background: url('multiple-select.png') left top no-repeat; +} + +.ms-drop { + overflow: hidden; + display: none; + margin-top: -1px; + padding: 0; + position: absolute; + z-index: 1000; + background: #fff; + color: #000; + border: 1px solid #aaa; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +.ms-drop.bottom { + top: 100%; + -webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15); + -moz-box-shadow: 0 4px 5px rgba(0, 0, 0, .15); + box-shadow: 0 4px 5px rgba(0, 0, 0, .15); +} + +.ms-drop.top { + bottom: 100%; + -webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); + -moz-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); + box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); +} + +.ms-search { + display: inline-block; + margin: 0; + min-height: 26px; + padding: 4px; + position: relative; + white-space: nowrap; + width: 100%; + z-index: 10000; +} + +.ms-search input { + width: 100%; + height: auto !important; + min-height: 24px; + padding: 0 20px 0 5px; + margin: 0; + outline: 0; + font-family: sans-serif; + font-size: 1em; + border: 1px solid #aaa; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + background: #fff url('multiple-select.png') no-repeat 100% -22px; + background: url('multiple-select.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); + background: url('multiple-select.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); + background: url('multiple-select.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); + background: url('multiple-select.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); + background: url('multiple-select.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%); + background: url('multiple-select.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%, #eeeeee 99%); +} + +.ms-search, .ms-search input { + -webkit-box-sizing: border-box; + -khtml-box-sizing: border-box; + -moz-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; +} + +.ms-drop ul { + overflow: auto; + margin: 0; + padding: 5px 8px; +} + +.ms-drop ul > li { + list-style: none; + display: list-item; + background-image: none; + position: static; +} + +.ms-drop ul > li .disabled { + opacity: .35; + filter: Alpha(Opacity=35); +} + +.ms-drop ul > li.multiple { + display: block; + float: left; +} + +.ms-drop ul > li.group { + clear: both; +} + +.ms-drop ul > li.multiple label { + width: 100%; + display: block; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.ms-drop ul > li label.optgroup { + font-weight: bold; +} + +.ms-drop input[type="checkbox"] { + vertical-align: middle; +} + +.ms-drop .ms-no-results { + display: none; +} \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/multiple-select/multiple-select.jquery.json b/htdocs/includes/jquery/plugins/multiple-select/multiple-select.jquery.json new file mode 100644 index 0000000000000000000000000000000000000000..dd636fda7e0beddf36303b2f3c7d9c4c3b5ce4a0 --- /dev/null +++ b/htdocs/includes/jquery/plugins/multiple-select/multiple-select.jquery.json @@ -0,0 +1,28 @@ +{ + "name": "multiple-select", + "version": "1.1.0", + "title": "Multiple Select", + "description": "Multiple select is a jQuery plugin to select multiple elements with checkboxes :).", + "author": { + "name": "zhixin wen", + "email": "wenzhixin2010@gmail.com", + "url": "http://wenzhixin.net.cn/" + }, + "licenses": [ + { + "type": "MIT License", + "url": "http://opensource.org/licenses/MIT" + } + ], + "dependencies": { + "jquery": ">=1.7" + }, + "keywords": ["multiple.select", "select.list", "multiple.choose", "checkbox"], + "homepage": "http://wenzhixin.net.cn/p/multiple-select/", + "demo": "http://wenzhixin.net.cn/p/multiple-select/#examples", + "bugs": { + "url": "https://github.com/wenzhixin/multiple-select/issues" + }, + "docs": "http://wenzhixin.net.cn/p/multiple-select/#documentation", + "download": "https://github.com/wenzhixin/multiple-select/archive/master.zip" +} \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/multiple-select/multiple-select.png b/htdocs/includes/jquery/plugins/multiple-select/multiple-select.png new file mode 100644 index 0000000000000000000000000000000000000000..2a7ba608ea846d4873f84e00455ee2d1bbe4d13a Binary files /dev/null and b/htdocs/includes/jquery/plugins/multiple-select/multiple-select.png differ diff --git a/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt b/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt deleted file mode 100644 index 1076f8b4b2b4994d46d9037c1564fb8760cdf222..0000000000000000000000000000000000000000 --- a/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2009 Michael Aufreiter, http://www.quasipartikel.at - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/multiselect/css/ui.multiselect.css b/htdocs/includes/jquery/plugins/multiselect/css/ui.multiselect.css deleted file mode 100644 index 7d3a44801d24ded885996c6b267178641b1e48e7..0000000000000000000000000000000000000000 --- a/htdocs/includes/jquery/plugins/multiselect/css/ui.multiselect.css +++ /dev/null @@ -1,31 +0,0 @@ -/* Multiselect -----------------------------------*/ - -.ui-multiselect { border: solid 1px; font-size: 0.8em; } -.ui-multiselect ul { -moz-user-select: none; } -.ui-multiselect li { margin: 0; padding: 0; cursor: default; line-height: 20px; height: 20px; font-size: 11px; list-style: none; padding-right: 18px; overflow: hidden; } -.ui-multiselect li a { color: #999; text-decoration: none; padding: 0; display: block; float: left; cursor: pointer;} -.ui-multiselect li.ui-draggable-dragging { padding-left: 10px; } - -.ui-multiselect div.selected { position: relative; padding: 0; margin: 0; border: 0; float:left; } -.ui-multiselect ul.selected { position: relative; padding: 0; overflow: auto; overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; position: relative; width: 100%; } - -.ui-multiselect div.available { position: relative; padding: 0; margin: 0; border: 0; float:left; } -.ui-multiselect ul.available { position: relative; padding: 0; overflow: auto; overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; width: 100%; } -.ui-multiselect ul.available li { padding-left: 10px; } - -.ui-multiselect div.right-column { border-left: 1px solid; } - -.ui-multiselect .ui-state-default { border: none; margin-bottom: 1px; position: relative; padding-left: 20px;} -.ui-multiselect .ui-state-hover { border: none; } -.ui-multiselect .ui-widget-header {border: none; font-size: 11px; margin-bottom: 1px;} - -.ui-multiselect .add-all { float: right; padding: 7px;} -.ui-multiselect .remove-all { float: right; padding: 7px;} -.ui-multiselect .search { float: left; padding: 4px;} -.ui-multiselect .count { float: left; padding: 7px;} - -.ui-multiselect li span.ui-icon-arrowthick-2-n-s { position: absolute; left: 2px; } -.ui-multiselect li a.action { position: absolute; right: 2px; top: 2px; } - -.ui-multiselect input.search { height: 14px; padding: 1px; opacity: 0.5; margin: 4px; width: 100px; } \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/multiselect/js/ui.multiselect.js b/htdocs/includes/jquery/plugins/multiselect/js/ui.multiselect.js deleted file mode 100644 index eb4578fc78227d382d396f9d8b09cda1a64e60a4..0000000000000000000000000000000000000000 --- a/htdocs/includes/jquery/plugins/multiselect/js/ui.multiselect.js +++ /dev/null @@ -1,480 +0,0 @@ -/* - * jQuery UI Multiselect - * - * Authors: - * Michael Aufreiter (quasipartikel.at) - * Yanick Rochon (yanick.rochon[at]gmail[dot]com) - * - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://www.quasipartikel.at/multiselect/ - * - * - * Depends: - * ui.core.js - * ui.sortable.js - * - * Optional: - * localization (http://plugins.jquery.com/project/localisation) - * scrollTo (http://plugins.jquery.com/project/ScrollTo) - * - * Todo: - * Make batch actions faster - * Implement dynamic insertion through remote calls - */ - - -(function($) { - -$.widget("ui.multiselect", { - options: { - sortable: true, - dragToAdd: true, - searchable: true, - doubleClickable: true, - animated: 'fast', - show: 'slideDown', - hide: 'slideUp', - dividerLocation: 0.6, - selectedContainerOnLeft: true, - width: null, - height: null, - nodeComparator: function(node1,node2) { - var text1 = node1.text(), - text2 = node2.text(); - return text1 == text2 ? 0 : (text1 < text2 ? -1 : 1); - }, - includeRemoveAll: true, - includeAddAll: true, - pressEnterKeyToAddAll: false - }, - _create: function() { - this.element.hide(); - this.id = this.element.attr("id"); - this.container = $('<div class="ui-multiselect ui-helper-clearfix ui-widget"></div>').insertAfter(this.element); - this.count = 0; // number of currently selected options - this.selectedContainer = $('<div class="selected"></div>'); - if (this.options.selectedContainerOnLeft) { - this.selectedContainer.appendTo(this.container); - this.availableContainer = $('<div class="available"></div>').appendTo(this.container); - this.availableContainer.addClass('right-column'); - } - else - { - this.availableContainer = $('<div class="available"></div>').appendTo(this.container); - this.selectedContainer.appendTo(this.container); - this.selectedContainer.addClass('right-column'); - } - this.selectedActions = $('<div class="actions ui-widget-header ui-helper-clearfix"><span class="count">0 '+$.ui.multiselect.locale.itemsCount+'</span>'+(this.options.includeRemoveAll?'<a href="#" class="remove-all">'+$.ui.multiselect.locale.removeAll+'</a>':'<span class="remove-all"> </span>')+'</div>').appendTo(this.selectedContainer); - this.availableActions = $('<div class="actions ui-widget-header ui-helper-clearfix"><input type="text" class="search empty ui-widget-content ui-corner-all"/>'+(this.options.includeAddAll?'<a href="#" class="add-all">'+$.ui.multiselect.locale.addAll+'</a>':'<span class="add-all"> </span>')+'</div>').appendTo(this.availableContainer); - this.selectedList = $('<ul class="selected connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind('selectstart', function(){return false;}).appendTo(this.selectedContainer); - this.availableList = $('<ul class="available connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind('selectstart', function(){return false;}).appendTo(this.availableContainer); - - var that = this; - - var width = this.options.width; - if (!width) { - width = this.element.width(); - } - var height = this.options.height; - if (!height) { - height = this.element.height(); - } - - // set dimensions - this.container.width(width-2); - if (this.options.selectedContainerOnLeft) { - this.selectedContainer.width(Math.floor(width*this.options.dividerLocation)-1); - this.availableContainer.width(Math.floor(width*(1-this.options.dividerLocation))-2); - } - else - { - this.selectedContainer.width(Math.floor(width*this.options.dividerLocation)-2); - this.availableContainer.width(Math.floor(width*(1-this.options.dividerLocation))-1); - } - - // fix list height to match <option> depending on their individual header's heights - this.selectedList.height(Math.max(height-this.selectedActions.height(),1)); - this.availableList.height(Math.max(height-this.availableActions.height(),1)); - - if ( !this.options.animated ) { - this.options.show = 'show'; - this.options.hide = 'hide'; - } - - // init lists - this._populateLists(this.element.find('option')); - - // make selection sortable - if (this.options.sortable) { - this.selectedList.sortable({ - placeholder: 'ui-state-highlight', - axis: 'y', - update: function(event, ui) { - // apply the new sort order to the original selectbox - that.selectedList.find('li').each(function() { - if ($(this).data('optionLink')) - $(this).data('optionLink').remove().appendTo(that.element); - }); - }, - beforeStop: function (event, ui) { - // This lets us recognize which item was just added to - // the list in receive, per the workaround for not being - // able to reference the new element. - ui.item.addClass('dropped'); - }, - receive: function(event, ui) { - ui.item.data('optionLink').attr('selected', true); - // increment count - that.count += 1; - that._updateCount(); - // workaround, because there's no way to reference - // the new element, see http://dev.jqueryui.com/ticket/4303 - that.selectedList.children('.dropped').each(function() { - $(this).removeClass('dropped'); - $(this).data('optionLink', ui.item.data('optionLink')); - $(this).data('idx', ui.item.data('idx')); - that._applyItemState($(this), true); - }); - - // workaround according to http://dev.jqueryui.com/ticket/4088 - setTimeout(function() { ui.item.remove(); }, 1); - }, - stop: function (event, ui) { that.element.change(); } - }); - } - - // set up livesearch - if (this.options.searchable) { - this._registerSearchEvents(this.availableContainer.find('input.search')); - } else { - $('.search').hide(); - } - - // batch actions - this.container.find(".remove-all").click(function() { - that._populateLists(that.element.find('option').removeAttr('selected')); - that.element.trigger('change'); - return false; - }); - - this.container.find(".add-all").click(function() { - var options = that.element.find('option').not(":selected"); - if (that.availableList.children('li:hidden').length > 1) { - that.availableList.children('li').each(function(i) { - if ($(this).is(":visible")) $(options[i-1]).attr('selected', 'selected'); - }); - } else { - options.attr('selected', 'selected'); - } - that._populateLists(that.element.find('option')); - that.element.trigger('change'); - if (that.options.pressEnterKeyToAddAll) { - //clear input after add all - $('input.search').val(""); - } - - return false; - }); - }, - destroy: function() { - this.element.show(); - this.container.remove(); - - $.Widget.prototype.destroy.apply(this, arguments); - }, - addOption: function(option) { - // Append the option - option = $(option); - var select = this.element; - select.append(option); - - var item = this._getOptionNode(option).appendTo(option.attr('selected') ? this.selectedList : this.availableList).show(); - - if (option.attr('selected')) { - this.count += 1; - } - this._applyItemState(item, option.attr('selected')); - item.data('idx', this.count); - - // update count - this._updateCount(); - this._filter.apply(this.availableContainer.find('input.search'), [this.availableList]); - }, - // Redisplay the lists of selected/available options. - // Call this after you've selected/unselected some options programmatically. - // GRIPE This is O(n) where n is the length of the list - seems like - // there must be a smarter way of doing this, but I have not been able - // to come up with one. I see no way to detect programmatic setting of - // the option's selected property, and without that, it seems like we - // can't have a general-case listener that does its thing every time an - // option is selected. - refresh: function() { - // Redisplay our lists. - this._populateLists(this.element.find('option')); - }, - _populateLists: function(options) { - this.selectedList.children('.ui-element').remove(); - this.availableList.children('.ui-element').remove(); - this.count = 0; - - var that = this; - var groups = $(this.element).find("optgroup").map(function(i) { - return that._getOptionGroup($(this)); - }); - groups.appendTo(this.selectedList.add(this.availableList)); - - var items = $(options.map(function(i) { - var item = that._getOptionNode(this).appendTo(that._getOptionList(this)).show(); - - if (this.selected) that.count += 1; - that._applyItemState(item, this.selected); - item.data('idx', i); - return item[0]; - })); - - // update count - this._updateCount(); - that._filter.apply(this.availableContainer.find('input.search'), [that.availableList]); - }, - _getOptionList: function(option) { - var selected = option.selected; - option = $(option); - var $list = selected ? this.selectedList : this.availableList; - var $group = option.closest("optgroup"); - if ($group.length === 0) { - return $list; - } else { - var $groupList = $list.find("ul[title='" + $group.attr("label") + "']"); - if ($groupList.length === 0) { - $groupList = $("<ul class='ui-state-default ui-element available' title='" + $group.attr("label") + "'>" + $group.attr("label") + "</ul>").appendTo($list); - } - $groupList.show(); - return $groupList; - } - }, - _getOptionGroup : function(optgroup) { - var groupNode = $("<ul class='ui-state-default ui-element available' title='" + optgroup.attr("label") + "'>" + optgroup.attr("label") + "</ul>").hide(); - return groupNode[0]; - }, - _updateCount: function() { - this.selectedContainer.find('span.count').text(this.count+" "+$.ui.multiselect.locale.itemsCount); - }, - _getOptionNode: function(option) { - option = $(option); - var node = $('<li class="ui-state-default ui-element" title="'+option.text()+'"><span class="ui-icon"/>'+option.text()+'<a href="#" class="action"><span class="ui-corner-all ui-icon"/></a></li>').hide(); - node.data('optionLink', option); - return node; - }, - // clones an item with associated data - // didn't find a smarter away around this - _cloneWithData: function(clonee) { - var clone = clonee.clone(false,false); - clone.data('optionLink', clonee.data('optionLink')); - clone.data('idx', clonee.data('idx')); - return clone; - }, - _setSelected: function(item, selected) { - var temp = item.data('optionLink').attr('selected', selected); - var parent = temp.parent(); - temp.detach().appendTo(parent); - this.element.trigger('change'); - - if (selected) { - var selectedItem = this._cloneWithData(item); - item[this.options.hide](this.options.animated, function() { - if (item.siblings().length === 0) { - item.closest("ul[title]").hide(); - } - $(this).remove(); - }); - // get group to add it to... - var $list = this._getOptionList(selectedItem.data("optionLink")[0]); - selectedItem.appendTo($list).hide()[this.options.show](this.options.animated); - - this._applyItemState(selectedItem, true); - return selectedItem; - } else { - - // look for successor based on initial option index - var items = this.availableList.find('li'), comparator = this.options.nodeComparator; - var succ = null, i = item.data('idx'), direction = comparator(item, $(items[i])); - - // TODO: test needed for dynamic list populating - if ( direction ) { - while (i>=0 && i<items.length) { - direction > 0 ? i++ : i--; - if ( direction != comparator(item, $(items[i])) ) { - // going up, go back one item down, otherwise leave as is - succ = items[direction > 0 ? i : i+1]; - var group1 = item.closest("ul[title]"), - group2 = $(succ).closest("ul[title]"); - if (group1.length !== 0 && group2.length !== 0) { - if (group1.attr("title") !== group2.attr("title")) { - succ = null; - } - } - break; - } - } - } else { - succ = items[i]; - } - - var availableItem = this._cloneWithData(item); - var $list = this._getOptionList(availableItem.data("optionLink")[0]); - succ ? availableItem.insertBefore($(succ)) : availableItem.appendTo($list); - item[this.options.hide](this.options.animated, function() { - if (item.siblings().length === 0) { - item.closest("ul[title]").hide(); - } - $(this).remove(); - }); - availableItem.hide()[this.options.show](this.options.animated); - - this._applyItemState(availableItem, false); - return availableItem; - } - }, - _applyItemState: function(item, selected) { - if (selected) { - if (this.options.sortable) - item.children('span').addClass('ui-icon-arrowthick-2-n-s').removeClass('ui-helper-hidden').addClass('ui-icon'); - else - item.children('span').removeClass('ui-icon-arrowthick-2-n-s').addClass('ui-helper-hidden').removeClass('ui-icon'); - item.find('a.action span').addClass('ui-icon-minus').removeClass('ui-icon-plus'); - this._registerRemoveEvents(item.find('a.action')); - - } else { - item.children('span').removeClass('ui-icon-arrowthick-2-n-s').addClass('ui-helper-hidden').removeClass('ui-icon'); - item.find('a.action span').addClass('ui-icon-plus').removeClass('ui-icon-minus'); - this._registerAddEvents(item.find('a.action')); - } - - this._registerDoubleClickEvents(item); - this._registerHoverEvents(item); - }, - // taken from John Resig's liveUpdate script - _filter: function(list) { - var input = $(this); - var rows = list.find('li'), - cache = rows.map(function(){ - - return $(this).text().toLowerCase(); - }); - - var term = $.trim(input.val().toLowerCase()), scores = []; - - if (!term) { - rows.show(); - } else { - rows.hide(); - - cache.each(function(i) { - if (this.indexOf(term)>-1) { scores.push(i); } - }); - - $.each(scores, function() { - $(rows[this]).show(); - }); - } - }, - _registerDoubleClickEvents: function(elements) { - if (!this.options.doubleClickable) return; - elements.dblclick(function() { - elements.find('a.action').click(); - }); - }, - _registerHoverEvents: function(elements) { - elements.removeClass('ui-state-hover'); - elements.mouseover(function() { - $(this).addClass('ui-state-hover'); - }); - elements.mouseout(function() { - $(this).removeClass('ui-state-hover'); - }); - }, - _registerAddEvents: function(elements) { - var that = this; - elements.click(function() { - var item = that._setSelected($(this).parent(), true); - that.count += 1; - that._updateCount(); - - // Prevent extra clicks from triggering bogus add events, if a user - // tries clicking during the removal process. - $(this).unbind('click'); - - return false; - }); - - // make draggable - if (this.options.sortable && this.options.dragToAdd) { - elements.each(function() { - $(this).parent().draggable({ - connectToSortable: that.selectedList, - helper: function() { - var selectedItem = that._cloneWithData($(this)).width($(this).width() - 50); - selectedItem.width($(this).width()); - return selectedItem; - }, - appendTo: that.container, - containment: that.container, - revert: 'invalid' - }); - }); - } - }, - _registerRemoveEvents: function(elements) { - var that = this; - elements.click(function() { - that._setSelected($(this).parent(), false); - that.count -= 1; - that._updateCount(); - - // Prevent extra clicks from triggering bogus remove events, if a - // user tries clicking during the removal process. - $(this).unbind('click'); - - return false; - }); - }, - _registerSearchEvents: function(input) { - var that = this; - - input.focus(function() { - $(this).addClass('ui-state-active'); - }) - .blur(function() { - $(this).removeClass('ui-state-active'); - }) - .keypress(function(e) { - if (e.keyCode == 13) { - if (that.options.pressEnterKeyToAddAll) { - //on Enter, if a filter is present add all, then clear the input - var str = $('input.search').val(); - if (str !== undefined && str !== null && str !== "") { - $('a.add-all').click(); - $('input.search').val(""); - } - } - return false; - } - }) - .keyup(function() { - that._filter.apply(this, [that.availableList]); - }); - } -}); - -$.extend($.ui.multiselect, { - locale: { - addAll:'Add all', - removeAll:'Remove all', - itemsCount:'items selected' - } -}); - - -})(jQuery); diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index 225466ca453cbc03ee14244edbc3f505fad905fe..d4b79af8013028bfa20beaa625d58d1b41e6666b 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -610,6 +610,21 @@ IMG; closedir($handle); } } + + /** + * return the value present on odt in [valuename][/valuename] + * @param string $value name balise in the template + * @return string the value inside the balise + * + */ + public function getvalue($valuename) + { + $searchreg="/\\[".$valuename."\\](.*)\\[\\/".$valuename."\\]/"; + preg_match($searchreg, $this->contentXml, $matches); + $this->contentXml = preg_replace($searchreg, "", $this->contentXml); + return $matches[1]; + } + } ?> diff --git a/htdocs/install/mssql/functions/functions.sql b/htdocs/install/mssql/functions/functions.sql index 93766a224064a3dc68cab3dc0878f1477af69f1d..1c2c76996dc312cc2440a2329d46530adb815d7c 100644 Binary files a/htdocs/install/mssql/functions/functions.sql and b/htdocs/install/mssql/functions/functions.sql differ diff --git a/htdocs/install/mysql/data/llx_c_action_trigger.sql b/htdocs/install/mysql/data/llx_c_action_trigger.sql index 67363b98c72a7f3f83a911b94a606ae8f75274f9..29adb70c46e04631434f9ae6dc9d08f1a3ae29ac 100644 --- a/htdocs/install/mysql/data/llx_c_action_trigger.sql +++ b/htdocs/install/mysql/data/llx_c_action_trigger.sql @@ -60,11 +60,14 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_DELETE','Member deleted','Executed when a member is deleted','member',25); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',10); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_VALIDATE','Intervention validated','Executed when a intervention is validated','ficheinter',19); -insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_CLASSIFYBILLED','Intervention set billed','Executed when a intervention is set to billed (when option FICHINTER_DISABLE_DETAILS is set)','ficheinter',19); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_CLASSIFY_BILLED','Intervention set billed','Executed when a intervention is set to billed (when option FICHINTER_CLASSIFY_BILLED is set)','ficheinter',19); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_CLASSIFY_UNBILLED','Intervention set unbilled','Executed when a intervention is set to unbilled (when option FICHINTER_CLASSIFY_BILLED is set)','ficheinter',19); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_REOPEN','Intervention opened','Executed when a intervention is re-opened','ficheinter',19); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',19); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_CREATE','Project creation','Executed when a project is created','project',30); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_CLOSE_SIGNED','Customer proposal closed signed','Executed when a customer proposal is closed signed','propal',2); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_CLOSE_REFUSED','Customer proposal closed refused','Executed when a customer proposal is closed refused','propal',2); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_CLASSIFY_BILLED','Customer proposal set billed','Executed when a customer proposal is set to billed','propal',2); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_CREATE','Task created','Executed when a project task is created','project',35); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_MODIFY','Task modified','Executed when a project task is modified','project',36); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_DELETE','Task deleted','Executed when a project task is deleted','project',37); diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index 93aa4df80830b16d29fd2672182df35da8993451..5e1119ed4b4a0c9eb058521114a03c3c25dde5b6 100755 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -21,10 +21,14 @@ --insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_MODIFY','Intervention modified','Executed when a intervention is modified','ficheinter',19); --insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_DELETE','Intervention delete','Executed when a intervention is delete','ficheinter',19); -insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_CLASSIFYBILLED','Intervention set billed','Executed when a intervention is set to billed (when option FICHINTER_DISABLE_DETAILS is set)','ficheinter',19); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_CLASSIFY_BILLED','Intervention set billed','Executed when a intervention is set to billed (when option FICHINTER_CLASSIFY_BILLED is set)','ficheinter',19); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_CLASSIFY_UNBILLED','Intervention set unbilled','Executed when a intervention is set to unbilled (when option FICHINTER_CLASSIFY_BILLED is set)','ficheinter',19); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',19); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_REOPEN','Intervention opened','Executed when a intervention is re-opened','ficheinter',19); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_CLASSIFY_BILLED','Customer proposal set billed','Executed when a customer proposal is set to billed','propal',2); ALTER TABLE llx_notify ADD COLUMN fk_soc integer NULL after fk_action; +ALTER TABLE llx_notify ADD COLUMN type varchar(16) DEFAULT 'email' after fk_soc; ALTER TABLE llx_bank_account ADD COLUMN fk_user_author integer; @@ -46,8 +50,6 @@ ALTER TABLE llx_fichinter ADD COLUMN ref_ext varchar(255); -- Defined only to have specific list for countries that can't use generic list (like argentina that need type A or B) ALTER TABLE llx_c_typent ADD COLUMN fk_country integer NULL AFTER libelle; -INSERT INTO llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (29,'FICHINTER_CLASSIFY_BILLED','Classify intervention as billed','Executed when a intervention is classified as billed (when option FICHINTER_DISABLE_DETAILS is set)','ficheinter',19); - INSERT INTO llx_c_actioncomm (id, code, type, libelle, module, active, position) values (11,'AC_INT','system','Intervention on site',NULL, 1, 4); ALTER TABLE llx_user ADD COLUMN fk_user_creat integer AFTER tms; diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 57a8944034393ec2a8da21ed38154b59cfca2be8..4083ba2f7b90c56a3f1bebb741a6d21ce746c84d 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -187,3 +187,20 @@ UPDATE llx_projet_task_time set task_datehour = task_date where task_datehour IS -- update llx_facturedet set total_tva = total_ttc - total_ht where total_vat = 0; -- update llx_facture set total = round(total_ttc / 1.2, 5) where total_ht = total_ttc; -- update llx_facture set tva = total_ttc - total where tva = 0; + +-- To insert elements into a category +-- Search idcategory: select rowid from llx_categorie where type=0 and ref like '%xxx%' +-- Select all products to include: select * from llx_product where ref like '%xxx%' +-- If ok, insert: insert into llx_categorie_product(fk_categorie, fk_product) select idcategory, rowid from llx_product where ref like '%xxx%' +-- List of product with a category xxx: select distinct cp.fk_product from llx_categorie_product as cp, llx_categorie as c where cp.fk_categorie = c.rowid and c.label like 'xxx-%' order by fk_product; +-- List of product into 2 categories xxx: select cp.fk_product, count(cp.fk_product) as nb from llx_categorie_product as cp, llx_categorie as c where cp.fk_categorie = c.rowid and c.label like 'xxx-%' group by fk_product having nb > 1; +-- List of product with no category xxx yet: select rowid, ref from llx_product where rowid not in (select distinct cp.fk_product from llx_categorie_product as cp, llx_categorie as c where cp.fk_categorie = c.rowid and c.label like 'xxx-%' order by fk_product); + +-- Replace xxx with your IP Address +-- bind-address = xxx.xxx.xxx.xxx +-- CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypass'; +-- CREATE USER 'myuser'@'%' IDENTIFIED BY 'mypass'; +-- GRANT ALL ON *.* TO 'myuser'@'localhost'; +-- GRANT ALL ON *.* TO 'myuser'@'%'; +-- flush privileges; + diff --git a/htdocs/install/mysql/tables/llx_notify.sql b/htdocs/install/mysql/tables/llx_notify.sql index 21a7b833dec3e320b1af3be1c90867531fd6b690..1dcfe6af8e616b86f85780ca021e8e3e8ece05e5 100644 --- a/htdocs/install/mysql/tables/llx_notify.sql +++ b/htdocs/install/mysql/tables/llx_notify.sql @@ -1,6 +1,7 @@ -- =================================================================== -- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net> +-- Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> -- -- 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 @@ -26,6 +27,7 @@ create table llx_notify fk_soc integer NULL, fk_contact integer NULL, fk_user integer NULL, + type varchar(16) DEFAULT 'email', objet_type varchar(24) NOT NULL, objet_id integer NOT NULL, email varchar(255) diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql index 7822ed57a09f61af57c74d2c1a3d1888094e16b6..e28cf0622243205b071eb54a087dd58316bb71ae 100644 --- a/htdocs/install/mysql/tables/llx_societe.sql +++ b/htdocs/install/mysql/tables/llx_societe.sql @@ -3,6 +3,7 @@ -- Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com> -- Copyright (C) 2010 Juanjo Menent <dolibarr@2byte.es> +-- Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> -- -- 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 @@ -91,7 +92,7 @@ create table llx_societe default_lang varchar(6), -- default language logo varchar(255), canvas varchar(32), -- type of canvas if used (null by default) - import_key varchar(14) -- import key + import_key varchar(14), -- import key webservices_url varchar(255), -- supplier webservice url - webservices_key varchar(128), -- supplier webservice key + webservices_key varchar(128) -- supplier webservice key )ENGINE=innodb; diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index e1ca9d2a5c3066272fea0987ebc2760e43259ee6..45f5017671f3b0ecf51c880a9c6f4693643b8b9e 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -51,7 +51,6 @@ OrderApprovedInDolibarr=Order %s approved OrderRefusedInDolibarr=Order %s refused OrderBackToDraftInDolibarr=Order %s go back to draft status OrderCanceledInDolibarr=Order %s canceled -InterventionValidatedInDolibarr=Intervention %s validated ProposalSentByEMail=Commercial proposal %s sent by EMail OrderSentByEMail=Customer order %s sent by EMail InvoiceSentByEMail=Customer invoice %s sent by EMail @@ -59,8 +58,6 @@ SupplierOrderSentByEMail=Supplier order %s sent by EMail SupplierInvoiceSentByEMail=Supplier invoice %s sent by EMail ShippingSentByEMail=Shipping %s sent by EMail ShippingValidated= Shipping %s validated -InterventionSentByEMail=Intervention %s sent by EMail -InterventionClassifiedBilled=Intervention %s classified as Billed NewCompanyToDolibarr= Third party created DateActionPlannedStart= Planned start date DateActionPlannedEnd= Planned end date diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang index 7655616ffc5a8886c1deb0b75c03751d00c05bb9..c79da05364e615bb2b234ce4211a373fc94e9168 100644 --- a/htdocs/langs/en_US/interventions.lang +++ b/htdocs/langs/en_US/interventions.lang @@ -31,6 +31,14 @@ RelatedInterventions=Related interventions ShowIntervention=Show intervention SendInterventionRef=Submission of intervention %s SendInterventionByMail=Send intervention by Email +InterventionCreatedInDolibarr=Intervention %s created +InterventionValidatedInDolibarr=Intervention %s validated +InterventionModifiedInDolibarr=Intervention %s modified +InterventionClassifiedBilledInDolibarr=Intervention %s set as billed +InterventionClassifiedUnbilledInDolibarr=Intervention %s set as unbilled +InterventionSentByEMail=Intervention %s sent by EMail +InterventionDeletedInDolibarr=Intervention %s deleted +SearchAnIntervention=Search an intervention ##### Types de contacts ##### TypeContact_fichinter_internal_INTERREPFOLL=Representative following-up intervention TypeContact_fichinter_internal_INTERVENING=Intervening diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index a18522be5f8daf5003e5e12fee03c08c04dadd4a..cbc4deb40d7e0acc23283f63b64cd60a43fe5f59 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -367,6 +367,7 @@ ActionsOnCompany=Events about this third party ActionsOnMember=Events about this member NActions=%s events NActionsLate=%s late +RequestAlreadyDone=Request already recorded Filter=Filter RemoveFilter=Remove filter ChartGenerated=Chart generated diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 1e74b72f635c87a6b1905bbade5e207e40286aee..f5b39b3f704ea18fcdedfd0196860f7ca29bd38d 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -203,25 +203,26 @@ ForgetIfNothing=If you didn't request this change, just forget this email. Your ##### Calendar common ##### AddCalendarEntry=Add entry in calendar %s -NewCompanyToDolibarr=Company %s added into Dolibarr -ContractValidatedInDolibarr=Contract %s validated in Dolibarr -ContractCanceledInDolibarr=Contract %s canceled in Dolibarr -ContractClosedInDolibarr=Contract %s closed in Dolibarr -PropalClosedSignedInDolibarr=Proposal %s signed in Dolibarr -PropalClosedRefusedInDolibarr=Proposal %s refused in Dolibarr -PropalValidatedInDolibarr=Proposal %s validated in Dolibarr -InvoiceValidatedInDolibarr=Invoice %s validated in Dolibarr -InvoicePaidInDolibarr=Invoice %s changed to paid in Dolibarr -InvoiceCanceledInDolibarr=Invoice %s canceled in Dolibarr -PaymentDoneInDolibarr=Payment %s done in Dolibarr -CustomerPaymentDoneInDolibarr=Customer payment %s done in Dolibarr -SupplierPaymentDoneInDolibarr=Supplier payment %s done in Dolibarr -MemberValidatedInDolibarr=Member %s validated in Dolibarr -MemberResiliatedInDolibarr=Member %s resiliated in Dolibarr -MemberDeletedInDolibarr=Member %s deleted from Dolibarr -MemberSubscriptionAddedInDolibarr=Subscription for member %s added in Dolibarr -ShipmentValidatedInDolibarr=Shipment %s validated in Dolibarr -ShipmentDeletedInDolibarr=Shipment %s deleted from Dolibarr +NewCompanyToDolibarr=Company %s added +ContractValidatedInDolibarr=Contract %s validated +ContractCanceledInDolibarr=Contract %s canceled +ContractClosedInDolibarr=Contract %s closed +PropalClosedSignedInDolibarr=Proposal %s signed +PropalClosedRefusedInDolibarr=Proposal %s refused +PropalValidatedInDolibarr=Proposal %s validated +PropalClassifiedBilledInDolibarr=Proposal %s classified billed +InvoiceValidatedInDolibarr=Invoice %s validated +InvoicePaidInDolibarr=Invoice %s changed to paid +InvoiceCanceledInDolibarr=Invoice %s canceled +PaymentDoneInDolibarr=Payment %s done +CustomerPaymentDoneInDolibarr=Customer payment %s done +SupplierPaymentDoneInDolibarr=Supplier payment %s done +MemberValidatedInDolibarr=Member %s validated +MemberResiliatedInDolibarr=Member %s resiliated +MemberDeletedInDolibarr=Member %s deleted +MemberSubscriptionAddedInDolibarr=Subscription for member %s added +ShipmentValidatedInDolibarr=Shipment %s validated +ShipmentDeletedInDolibarr=Shipment %s deleted ##### Export ##### Export=Export ExportsArea=Exports area diff --git a/htdocs/langs/en_US/resource.lang b/htdocs/langs/en_US/resource.lang index fbc55081185016d1b96d2a297f26d28953c3b828..e0a767cc58adaede1dbc5c7ec0983fb83872006f 100755 --- a/htdocs/langs/en_US/resource.lang +++ b/htdocs/langs/en_US/resource.lang @@ -32,4 +32,6 @@ ResourceLinkedWithSuccess=Resource linked with success TitleResourceCard=Resource card ConfirmDeleteResource=Confirm to delete this resource RessourceSuccessfullyDeleted=Resource successfully deleted -DictionaryResourceType=Type of resources \ No newline at end of file +DictionaryResourceType=Type of resources + +SelectResource=Select resource diff --git a/htdocs/langs/en_US/withdrawals.lang b/htdocs/langs/en_US/withdrawals.lang index dccee9d0c8eb7068ff487dadf2cc403b796ff1b0..35cfa23d9e2d7ab038ffcfa49664af822e0ddad9 100644 --- a/htdocs/langs/en_US/withdrawals.lang +++ b/htdocs/langs/en_US/withdrawals.lang @@ -16,6 +16,7 @@ WithdrawedBills=Withdrawn invoices WithdrawalsLines=Withdrawal lines RequestStandingOrderToTreat=Request for standing orders to process RequestStandingOrderTreated=Request for standing orders processed +NotPossibleForThisStatusOfWithdrawReceiptORLine=Not yet possible. Withdraw status must be set to 'credited' before declaring reject on specific lines. CustomersStandingOrders=Customer standing orders CustomerStandingOrder=Customer standing order NbOfInvoiceToWithdraw=Nb. of invoice with withdraw request @@ -76,7 +77,7 @@ WithBankUsingRIB=For bank accounts using RIB WithBankUsingBANBIC=For bank accounts using IBAN/BIC/SWIFT BankToReceiveWithdraw=Bank account to receive withdraws CreditDate=Credit on -WithdrawalFileNotCapable=Unable to generate withdrawal receipt file for your country +WithdrawalFileNotCapable=Unable to generate withdrawal receipt file for your country %s (Your country is not supported) ShowWithdraw=Show Withdraw IfInvoiceNeedOnWithdrawPaymentWontBeClosed=However, if invoice has at least one withdrawal payment not yet processed, it won't be set as paid to allow prior withdrawal management. DoStandingOrdersBeforePayments=This tab allows you to request a standing order. Once it is complete, you can type the payment to close the invoice. diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 8dfcbfc080f23504e1cf5d5e3cc32ce896773129..7973d578e2459be1233167a879cf1f7a8ebee633 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -484,7 +484,7 @@ Module500Desc=Gestión de los gastos especiales como impuestos, gastos sociales, Module510Name=Salarios Module510Desc=Gestión de salarios y pagos Module600Name=Notificaciones -Module600Desc=Envío de notificaciones (por correo electrónico) sobre los eventos de trabajo Dolibarr +Module600Desc=Envío de notificaciones por e-mail en algunos eventos de negocio de Dolibarr a contactos de terceros (configurado en cada tercero) Module700Name=Donaciones Module700Desc=Gestión de donaciones Module1200Name=Mantis @@ -514,7 +514,7 @@ Module5000Name=Multi-empresa Module5000Desc=Permite gestionar varias empresas Module6000Name=Flujo de trabajo Module6000Desc=Gestión del flujo de trabajo -Module20000Name=Días libres +Module20000Name=Quitar gestión de vacaciones Module20000Desc=Gestión de los días libres de los empleados Module39000Name=Lotes de productos Module39000Desc=Gestión de lotes y fechas de caducidad y venta de los productos @@ -522,8 +522,8 @@ Module50000Name=PayBox Module50000Desc=Módulo para proporcionar un pago en línea con tarjeta de crédito mediante Paybox Module50100Name=TPV Module50100Desc=Terminal Punto de Venta para la venta en mostrador -Module50200Name= Paypal -Module50200Desc= Módulo para proporcionar un pago en línea con tarjeta de crédito mediante Paypal +Module50200Name=Paypal +Module50200Desc=Módulo para proporcionar un pago en línea con tarjeta de crédito mediante Paypal Module50400Name=Contabilidad (avanzada) Module50400Desc=Gestión contable (doble partida) Module54000Name=PrintIPP @@ -611,10 +611,11 @@ Permission162=Crear/modificar contratos de servicio Permission163=Activar los servicios de un contrato Permission164=Desactivar los servicios de un contrato Permission165=Eliminar contratos -Permission171=Leer los desplazamientos -Permission172=Crear/modificar los desplazamientos -Permission173=Eliminar desplazamientos -Permission178=Exportar desplazamientos +Permission171=Leer honorarios (propios y de sus subordinados) +Permission172=Crear/modificar honorarios +Permission173=Eliminar honorarios +Permission174=Leer todos los honorarios +Permission178=Exportar honorarios Permission180=Consultar proveedores Permission181=Consultar pedidos a proveedores Permission182=Crear/modificar pedidos a proveedores @@ -1074,7 +1075,7 @@ ModuleCompanyCodeAquarium=Devuelve un código contable compuesto de<br>%s seguid ModuleCompanyCodePanicum=Devuelve un código contable vacío. ModuleCompanyCodeDigitaria=Devuelve un código contable compuesto siguiendo el código de tercero. El código está formado por carácter ' C ' en primera posición seguido de los 5 primeros caracteres del código tercero. UseNotifications=Usar notificaciones -NotificationsDesc=La función de las notificaciones permite enviar automáticamente un correo electrónico para un determinado evento Dolibarr en las empresas configuradas para ello +NotificationsDesc=La función de las notificaciones permite enviar automáticamente un e-mail para algunos eventos de Dolibarr. Los destinatarios de las notificaciones pueden definirse:<br>* por contactos de terceros (clientes o proveedores), un tercero a la vez.<br>* o configurando un destinatario global en la configuración del módulo. ModelModules=Modelos de documentos DocumentModelOdt=Generación desde los documentos OpenDocument (Archivo .ODT OpenOffice, KOffice, TextEdit,...) WatermarkOnDraft=Marca de agua en los documentos borrador @@ -1146,6 +1147,7 @@ HideTreadedOrders=Ocultar del listado los pedidos tratados o cancelados ValidOrderAfterPropalClosed=Validar el pedido después del cierre del presupuesto, permite no pasar por el pedido provisional FreeLegalTextOnOrders=Texto libre en pedidos WatermarkOnDraftOrders=Marca de agua en pedidos borrador (en caso de estar vacío) +ShippableOrderIconInList=Añadir un icono en el listado de pedidos que indica si el pedido es enviable ##### Clicktodial ##### ClickToDialSetup=Configuración del módulo Click To Dial ClickToDialUrlDesc=URL de llamada haciendo click en el icono teléfono. <br>La URL completa de llamada será: URL?login=...&password=...&caller=...&called=telellamada @@ -1384,7 +1386,8 @@ MailingEMailError=E-Mail de respuesta (Errors-to) para las respuestas acerca de ##### Notification ##### NotificationSetup=Configuración del módulo notificaciones NotificationEMailFrom=E-Mail emisor (From) de los correos enviados a través de notificaciones -ListOfAvailableNotifications=Listado de notificaciones disponibles (depende de los módulos activados) +ListOfAvailableNotifications=Listado de eventos que se pueden configurar para notificar para cada tercero (entrar a la ficha del tercero para configurar) o configurando un e-mail fijo (El listado depende de los módulos activados) +FixedEmailTarget=Destinatario fijo ##### Sendings ##### SendingsSetup=Configuración del módulo Expediciones SendingsReceiptModel=Modelo de notas de entrega @@ -1437,7 +1440,7 @@ DetailEnabled=Condición de mostrar o no DetailRight=Condición de visualización completa o restringida DetailLangs=Archivo .lang para la traducción del título DetailUser=Interno / Externo / Todos -Target=Objetivo +Target=Destinatario DetailTarget=Comportamiento del enlace (_blank para abrir una nueva ventana) DetailLevel=Nivel (-1:menú superior, 0:principal, >0 menú y submenú) ModifMenu=Modificación del menú @@ -1535,6 +1538,7 @@ DeleteFiscalYear=Eliminar año fiscal ConfirmDeleteFiscalYear=¿Está seguro de querer eliminar este año fiscal? Opened=Abierto Closed=Cerrado +AlwaysEditable=Puede editarse siempre Format=Formatear TypePaymentDesc=0:Pago cliente,1:Pago proveedor,2:Tanto pago de cliente como de proveedor diff --git a/htdocs/langs/es_ES/agenda.lang b/htdocs/langs/es_ES/agenda.lang index 839bbbdceba44e32ab8831ccb59ffcec89f8c1d8..c357756f95ac823b73128b35afb5640aefdfb2ec 100644 --- a/htdocs/langs/es_ES/agenda.lang +++ b/htdocs/langs/es_ES/agenda.lang @@ -7,10 +7,10 @@ Agendas=Agendas Calendar=Calendario Calendars=Calendarios LocalAgenda=Calendario interno -ActionsOwnedBy=Evento asignado a +ActionsOwnedBy=Acontecimiento asignado a AffectedTo=Asignada a DoneBy=Realizado por -Event=Evento +Event=Acontecimiento Events=Eventos EventsNb=Número de eventos MyEvents=Mis eventos @@ -23,12 +23,12 @@ MenuToDoActions=Eventos incompletos MenuDoneActions=Eventos terminados MenuToDoMyActions=Mis eventos incompletos MenuDoneMyActions=Mis eventos terminados -ListOfEvents=Listado de eventos (calendario interno) +ListOfEvents=lista de acontecimientos (calendario interno) ActionsAskedBy=Eventos registrados por ActionsToDoBy=Eventos asignados a ActionsDoneBy=Eventos realizados por -ActionsForUser=Eventos del usuario -ActionsForUsersGroup=Eventos de todos los usuarios del grupo +ActionsForUser=Acontecimientos del usuario +ActionsForUsersGroup=Acontecimientos de todos los usuarios del grupo AllMyActions= Todos mis eventos/tareas AllActions= Todos los eventos/tareas ViewList=Vista listado @@ -72,7 +72,7 @@ AgendaUrlOptions1=Puede también añadir estos parámetros al filtro de salida: AgendaUrlOptions2=<b>login=%s</b> para restringir inserciones a acciones creadas , que afecten o realizadas por el usuario <b>%s</b>. AgendaUrlOptions3=<b>logina=%s</b> para restringir inserciones a acciones creadas por el usuario <b>%s</b>. AgendaUrlOptions4=<b>logint=%s</b> para restringir inserciones a acciones que afecten al usuario <b>%s</b>. -AgendaUrlOptions5=<b>logind=%s</b> para restringir inserciones a acciones realizadas por el usuario <b>%s</b>. +AgendaUrlOptionsProject=<b>project=PROJECT_ID</b> para restringir inserciones a acciones asociadas al proyecto <b>PROJECT_ID</b>. AgendaShowBirthdayEvents=Mostrar cumpleaños de los contactos AgendaHideBirthdayEvents=Ocultar cumpleaños de los contactos Busy=Ocupado @@ -89,5 +89,5 @@ ExtSiteUrlAgenda=Url de acceso al archivo .ical ExtSiteNoLabel=Sin descripción WorkingTimeRange=Rango temporal WorkingDaysRange=Rango diario -AddEvent=Añadir evento +AddEvent=Crear evento MyAvailability=Mi disponibilidad diff --git a/htdocs/langs/es_ES/bills.lang b/htdocs/langs/es_ES/bills.lang index f9d7f316b041261623068106e3c0ae47453606d4..e5f939a753f2b64ee6c2c6026daa622c46fa09de 100644 --- a/htdocs/langs/es_ES/bills.lang +++ b/htdocs/langs/es_ES/bills.lang @@ -28,8 +28,8 @@ InvoiceAvoir=Abono InvoiceAvoirAsk=Abono para corregir la factura InvoiceAvoirDesc=El <b>abono</b> es una factura negativa destinada a compensar un importe de factura que difiere del importe realmente pagado (por haber pagado de más o por devolución de productos, por ejemplo). invoiceAvoirWithLines=Crear abono con las líneas de la factura original -invoiceAvoirWithPaymentRestAmount=Crear abono con el importe pendiente de la factura origen -invoiceAvoirLineWithPaymentRestAmount=Abono del importe pendiente de la factura +invoiceAvoirWithPaymentRestAmount=Crear abono con el resto a cobrar de la factura origen +invoiceAvoirLineWithPaymentRestAmount=Abono del resto por cobrar ReplaceInvoice=Rectificar la factura %s ReplacementInvoice=Rectificación factura ReplacedByInvoice=Rectificada por la factura %s @@ -156,9 +156,9 @@ ConfirmCancelBill=¿Está seguro de querer anular la factura <b>%s</b> ? ConfirmCancelBillQuestion=¿Por qué razón quiere abandonar la factura? ConfirmClassifyPaidPartially=¿Está seguro de querer clasificar la factura <b>%s</b> como pagada? ConfirmClassifyPaidPartiallyQuestion=Esta factura no ha sido totalmente pagada. ¿Por qué quiere clasificarla como pagada? -ConfirmClassifyPaidPartiallyReasonAvoir=El resto a pagar <b>(%s %s)</b> se ha regularizado (ya que artículo se ha devuelto, olvidado entregar, descuento no definido...) mediante un abono -ConfirmClassifyPaidPartiallyReasonDiscountNoVat=El resto a pagar <b>(%s %s)</b> es un descuento acordado después de la factura. Acepto perder el IVA de este descuento -ConfirmClassifyPaidPartiallyReasonDiscountVat=El resto a pagar<b>(%s %s)</b> es un descuento +ConfirmClassifyPaidPartiallyReasonAvoir=El resto a pagar <b>(%s %s)</b> es un descuento otorgado por pronto pago. Regularizaré el IVA con un abono. +ConfirmClassifyPaidPartiallyReasonDiscountNoVat=El resto a pagar <b>(%s %s)</b> es un descuento otorgado por pronto pago. Acepto perder el IVA en este descuento. +ConfirmClassifyPaidPartiallyReasonDiscountVat=El resto a pagar <b>(%s %s)</b> es un descuento otorgado por pronto pago. Recuperaré el IVA sin usar un abono. ConfirmClassifyPaidPartiallyReasonBadCustomer=Cliente moroso ConfirmClassifyPaidPartiallyReasonProductReturned=Productos devueltos en parte ConfirmClassifyPaidPartiallyReasonOther=Por otra razón @@ -191,9 +191,9 @@ AlreadyPaid=Ya pagado AlreadyPaidBack=Ya reembolsado AlreadyPaidNoCreditNotesNoDeposits=Ya pagado (excluidos los abonos y anticipos) Abandoned=Abandonada -RemainderToPay=Queda por pagar -RemainderToTake=Queda por cobrar -RemainderToPayBack=Queda por reembolsar +RemainderToPay=Resta por pagar +RemainderToTake=Resta por cobrar +RemainderToPayBack=Resta por reembolsar Rest=Pendiente AmountExpected=Importe reclamado ExcessReceived=Recibido en exceso @@ -225,13 +225,13 @@ NonPercuRecuperable=No percibido recuperable SetConditions=Definir condiciones de pago SetMode=Definir modo de pago Billed=Facturado -RepeatableInvoice=Factura recurrente -RepeatableInvoices=Facturas recurrentes -Repeatable=Recurrente -Repeatables=Recurrentes -ChangeIntoRepeatableInvoice=Convertir en recurrente -CreateRepeatableInvoice=Crear factura recurrente -CreateFromRepeatableInvoice=Crear desde factura recurrente +RepeatableInvoice=Plantilla de factura +RepeatableInvoices=Plantilla de facturas +Repeatable=Plantilla +Repeatables=Plantillas +ChangeIntoRepeatableInvoice=Convertir en plantilla +CreateRepeatableInvoice=Crear plantilla de factura +CreateFromRepeatableInvoice=Crear desde plantilla de factura CustomersInvoicesAndInvoiceLines=Facturas a clientes y líneas de facturas CustomersInvoicesAndPayments=Facturas a clientes y pagos ExportDataset_invoice_1=Facturas a clientes y líneas de factura diff --git a/htdocs/langs/es_ES/boxes.lang b/htdocs/langs/es_ES/boxes.lang index 5038f1381139b5f9bbda4edd9aa02113aa134063..56353b2006e94bb62bdacfabe81ca0b021265b07 100644 --- a/htdocs/langs/es_ES/boxes.lang +++ b/htdocs/langs/es_ES/boxes.lang @@ -12,6 +12,7 @@ BoxLastProspects=Últimos clientes potenciales modificados BoxLastCustomers=Últimos clientes modificados BoxLastSuppliers=Últimos proveedores modificados BoxLastCustomerOrders=Últimos pedidos +BoxLastValidatedCustomerOrders=Últimos pedidos de clientes validados BoxLastBooks=Últimos books BoxLastActions=Últimos eventos BoxLastContracts=Últimos contratos @@ -27,26 +28,29 @@ BoxTitleNbOfCustomers=Número de clientes BoxTitleLastRssInfos=Las %s últimas infos de %s BoxTitleLastProducts=Los %s últimos productos/servicios registrados BoxTitleProductsAlertStock=Productos en alerta de stock -BoxTitleLastCustomerOrders=Los %s últimos pedidos de clientes modificados +BoxTitleLastCustomerOrders=Últimos %s pedidos de clientes +BoxTitleLastModifiedCustomerOrders=Últimos %s pedidos de clientes modificados BoxTitleLastSuppliers=Los %s últimos proveedores registrados BoxTitleLastCustomers=Los %s últimos clientes registrados BoxTitleLastModifiedSuppliers=Los %s últimos proveedores modificados BoxTitleLastModifiedCustomers=Los %s últimos clientes modificados -BoxTitleLastCustomersOrProspects=Los %s últimos clientes o clientes potenciales registrados -BoxTitleLastPropals=Los %s últimos presupuestos registrados +BoxTitleLastCustomersOrProspects=Últimos %s clientes o clientes potenciales +BoxTitleLastPropals=Últimos %s presupuestos +BoxTitleLastModifiedPropals=Últimos %s presupuestos modificados BoxTitleLastCustomerBills=Las %s últimas facturas a clientes modificadas +BoxTitleLastModifiedCustomerBills=Últimas %s facturas a clientes modificadas BoxTitleLastSupplierBills=Las %s últimas facturas de proveedores modificadas -BoxTitleLastProspects=Los %s últimos clientes potenciales registrados +BoxTitleLastModifiedSupplierBills=Últimas %s facturas de proveedores modificadas BoxTitleLastModifiedProspects=Los %s últimos clientes potenciales modificados BoxTitleLastProductsInContract=Los %s últimos productos/servicios contratados -BoxTitleLastModifiedMembers=Los %s últimos miembros modificados +BoxTitleLastModifiedMembers=Últimos %s miembros BoxTitleLastFicheInter=Las %s últimas intervenciones modificadas -BoxTitleOldestUnpaidCustomerBills=Las %s facturas más antiguas a clientes pendientes de cobro -BoxTitleOldestUnpaidSupplierBills=Las %s facturas más antiguas de proveedores pendientes de pago +BoxTitleOldestUnpaidCustomerBills=%s facturas a clientes más antiguras pendientes de cobro +BoxTitleOldestUnpaidSupplierBills=%s facturas de proveedores más antiguas pendientes de pago BoxTitleCurrentAccounts=Balances de cuentas abiertas BoxTitleSalesTurnover=Volumen de ventas realizado -BoxTitleTotalUnpaidCustomerBills=Pendiente de clientes -BoxTitleTotalUnpaidSuppliersBills=Pendiente a proveedores +BoxTitleTotalUnpaidCustomerBills=Facturas a clientes pendientes de cobro +BoxTitleTotalUnpaidSuppliersBills=Facturas de proveedores pendientes de pago BoxTitleLastModifiedContacts=Los %s últimos contactos/direcciones modificadas BoxMyLastBookmarks=Mis %s últimos marcadores BoxOldestExpiredServices=Servicios antiguos expirados @@ -76,7 +80,8 @@ NoContractedProducts=Sin productos/servicios contratados NoRecordedContracts=Sin contratos registrados NoRecordedInterventions=Sin intervenciones guardadas BoxLatestSupplierOrders=Últimos pedidos a proveedores -BoxTitleLatestSupplierOrders=Los %s últimos pedidos a proveedores +BoxTitleLatestSupplierOrders=Últimos %s pedidos a proveedores +BoxTitleLatestModifiedSupplierOrders=Últimos %s pedidos a proveedores modificados NoSupplierOrder=Sin pedidos a proveedores BoxCustomersInvoicesPerMonth=Facturas a clientes por mes BoxSuppliersInvoicesPerMonth=Facturas de proveedores por mes diff --git a/htdocs/langs/es_ES/companies.lang b/htdocs/langs/es_ES/companies.lang index 9fa3e27be1869cee8768bfa7adc44e29c9add45b..f86ea312ac31cf4607284d83f2e9ec4f79d9afcd 100644 --- a/htdocs/langs/es_ES/companies.lang +++ b/htdocs/langs/es_ES/companies.lang @@ -379,7 +379,7 @@ DeliveryAddressLabel=Etiqueta de envío DeleteDeliveryAddress=Eliminar una dirección de envío ConfirmDeleteDeliveryAddress=¿Está seguro de querer eliminar esta dirección de envío? NewDeliveryAddress=Nueva dirección de envío -AddDeliveryAddress=Añadir la dirección +AddDeliveryAddress=Crear dirección AddAddress=Crear dirección NoOtherDeliveryAddress=No hay direcciones alternativas definidas SupplierCategory=Categoría de proveedor diff --git a/htdocs/langs/es_ES/deliveries.lang b/htdocs/langs/es_ES/deliveries.lang index 4cfe6c9006562e875371212dc395c5aca0c108e0..6dbcd26544c8793d96cc6d187f6c074b98791e89 100644 --- a/htdocs/langs/es_ES/deliveries.lang +++ b/htdocs/langs/es_ES/deliveries.lang @@ -24,3 +24,5 @@ Deliverer=Destinatario : Sender=Origen Recipient=Destinatario ErrorStockIsNotEnough=No hay suficiente stock +Shippable=Enviable +NonShippable=No enviable diff --git a/htdocs/langs/es_ES/donations.lang b/htdocs/langs/es_ES/donations.lang index 31c89f7720939a236a9984c4d3ca8126d6c7d07a..064e6587789ea8289fbd9cd5656cadbf8400eb41 100644 --- a/htdocs/langs/es_ES/donations.lang +++ b/htdocs/langs/es_ES/donations.lang @@ -4,7 +4,7 @@ Donations=Donaciones DonationRef=Ref. donación Donor=Donante Donors=Donantes -AddDonation=Añadir donación +AddDonation=Crear una donación NewDonation=Nueva donación ShowDonation=Mostrar donación DonationPromise=Promesa de donación diff --git a/htdocs/langs/es_ES/errors.lang b/htdocs/langs/es_ES/errors.lang index bccee64bcfc8a6da2462bbc76f31ba3ae2c5d6c2..7ac24f97c463df97f96ad20f627638da3da426a7 100644 --- a/htdocs/langs/es_ES/errors.lang +++ b/htdocs/langs/es_ES/errors.lang @@ -37,7 +37,7 @@ ErrorSupplierCodeRequired=Código proveedor obligatorio ErrorSupplierCodeAlreadyUsed=Código de proveedor ya utilizado ErrorBadParameters=Parámetros incorrectos ErrorBadValueForParameter=Valor '%s' incorrecto para el parámetro '%s' -ErrorBadImageFormat=La imagen no tiene un formato reconocido +ErrorBadImageFormat=El archivo de imagen es de un formato no soportado (Su PHP no soporta las funciones de conversión de este formato de imagen) ErrorBadDateFormat=El valor '%s' tiene un formato de fecha no reconocido ErrorWrongDate=¡La fecha no es correcta! ErrorFailedToWriteInDir=Imposible escribir en el directorio %s @@ -114,6 +114,7 @@ ErrorLoginDoesNotExists=La cuenta de usuario de <b>%s</b> no se ha encontrado. ErrorLoginHasNoEmail=Este usuario no tiene e-mail. Imposible continuar. ErrorBadValueForCode=Valor incorrecto para el código. Vuelva a intentar con un nuevo valor... ErrorBothFieldCantBeNegative=Los campos %s y %s no pueden ser negativos +ErrorQtyForCustomerInvoiceCantBeNegative=Las cantidades en las líneas de facturas a clientes no pueden ser negativas ErrorWebServerUserHasNotPermission=La cuenta de ejecución del servidor web <b>%s</b> no dispone de los permisos para esto ErrorNoActivatedBarcode=No hay activado ningún tipo de código de barras ErrUnzipFails=No se ha podido descomprimir el archivo %s con ZipArchive diff --git a/htdocs/langs/es_ES/holiday.lang b/htdocs/langs/es_ES/holiday.lang index 60e8fc0327f99640686ddb67b96e96547383cecf..78cd612783e2579f1ecf57a4c38dcdcb26046a8f 100644 --- a/htdocs/langs/es_ES/holiday.lang +++ b/htdocs/langs/es_ES/holiday.lang @@ -53,7 +53,7 @@ CantUpdate=No puede actualizar esta petición de vacaciones. NoDateDebut=Debe indicar una fecha de inicio. NoDateFin=Debe indicar una fecha de fin. ErrorDureeCP=Su petición de vacaciones no contiene ningún día hábil. -TitleValidCP=Validar la petición de vacaciones +TitleValidCP=Aprobar la petición de vacaciones ConfirmValidCP=¿Está seguro de querer validar esta petición de vacaciones? DateValidCP=Fecha de validación TitleToValidCP=Enviar la petición de vacaciones @@ -61,7 +61,7 @@ ConfirmToValidCP=¿Está seguro de querer enviar la petición de vacaciones? TitleRefuseCP=Rechazar la petición de vacaciones ConfirmRefuseCP=¿Está seguro de querer rechazar la petición de vacaciones? NoMotifRefuseCP=Debe seleccionar un motivo para rechazar esta petición. -TitleCancelCP=Anular la petición de vacaciones +TitleCancelCP=Cancelar la petición de vacaciones ConfirmCancelCP=¿Está seguro de querer anular la petición de vacaciones? DetailRefusCP=Motivo del rechazo DateRefusCP=Fecha del rechazo @@ -88,7 +88,7 @@ ManualUpdate=Actualización manual HolidaysCancelation=Anulación vacaciones ## Configuration du Module ## -ConfCP=Configuración del módulo Vacaciones +ConfCP=Configuración del módulo de vacaciones DescOptionCP=Descripción de la opción ValueOptionCP=Valor GroupToValidateCP=Grupo con posibilidad de aprobar las vacaciones @@ -97,13 +97,13 @@ LastUpdateCP=Última actualización automática de vacaciones UpdateConfCPOK=Actualización efectuada correctamente. ErrorUpdateConfCP=Se ha producido un error durante la actualización, vuélvalo a intentar. AddCPforUsers=Añada los saldos de vacaciones de los usuarios <a href="../define_holiday.php" style="font-weight: normal; color: red; text-decoration: underline;">haciendo clic aquí</a>. -DelayForSubmitCP=Antelación mínima para solicitar vacaciones +DelayForSubmitCP=Fecha límite para realizar peticiones de vacaciones AlertapprobatortorDelayCP=Advertir al validador si la petición no corresponde a la fecha límite AlertValidatorDelayCP=Advertir al usuario validador si la petición no respeta el límite previsto AlertValidorSoldeCP=Advertir al usuario validador si el usuario pide vacaciones superiores a su saldo nbUserCP=Número de usuarios tomados en cuenta en el módulo vacaciones nbHolidayDeductedCP=Número de días retribuídos a deducir por día de vacaciones -nbHolidayEveryMonthCP=Número de días de vacaciones añadidos por mes +nbHolidayEveryMonthCP=Número de vacaciones añadidas por mes Module27130Name= Gestion de las vacaciones Module27130Desc= Gestión de días libres TitleOptionMainCP=Ajustes principales de vacaciones diff --git a/htdocs/langs/es_ES/interventions.lang b/htdocs/langs/es_ES/interventions.lang index 4f838816de27a902c09801bdbae4e306373f03e1..f973ac56e78e668c65b3287d2c69706caf04c344 100644 --- a/htdocs/langs/es_ES/interventions.lang +++ b/htdocs/langs/es_ES/interventions.lang @@ -30,6 +30,7 @@ StatusInterInvoiced=Facturado RelatedInterventions=Intervenciones adjuntas ShowIntervention=Mostrar intervención SendInterventionRef=Envío de la intervención %s +SendInterventionByMail=Enviar intervención por e-mail ##### Types de contacts ##### TypeContact_fichinter_internal_INTERREPFOLL=Responsable seguimiento de la intervención TypeContact_fichinter_internal_INTERVENING=Interventor diff --git a/htdocs/langs/es_ES/mails.lang b/htdocs/langs/es_ES/mails.lang index 9c2dd9f8d4e7225029466abe177eb0824531c4e7..531f4ce42d5457d941f7062d731abd00ec88d953 100644 --- a/htdocs/langs/es_ES/mails.lang +++ b/htdocs/langs/es_ES/mails.lang @@ -133,6 +133,6 @@ Notifications=Notificaciones NoNotificationsWillBeSent=Ninguna notificación por e-mail está prevista para este evento y empresa ANotificationsWillBeSent=1 notificación va a ser enviada por e-mail SomeNotificationsWillBeSent=%s notificaciones van a ser enviadas por e-mail -AddNewNotification=Activar una nueva solicitud de notificación -ListOfActiveNotifications=Lista de las solicitudes de notificaciones activas -ListOfNotificationsDone=Lista de notificaciones de e-mails enviadas +AddNewNotification=Activar un nuevo destinatario de notificaciones +ListOfActiveNotifications=Listado de todos los destinatarios de notificaciones +ListOfNotificationsDone=Listado de notificaciones enviadas diff --git a/htdocs/langs/es_ES/main.lang b/htdocs/langs/es_ES/main.lang index a9f20e07d72861e5cbeb30a17caff7abfbed09d0..862ed1a9495640f9432c7e119fd092ee4b3ecd91 100644 --- a/htdocs/langs/es_ES/main.lang +++ b/htdocs/langs/es_ES/main.lang @@ -58,12 +58,12 @@ ErrorCantLoadUserFromDolibarrDatabase=Imposible encontrar el usuario <b>%s</b> e ErrorNoVATRateDefinedForSellerCountry=Error, ningún tipo de IVA definido para el país '%s'. ErrorNoSocialContributionForSellerCountry=Error, ningún tipo de carga social definida para el país '%s'. ErrorFailedToSaveFile=Error, el registro del archivo falló. -ErrorOnlyPngJpgSupported=Error, solamente se soportan los formatos de imagen jpg y png. -ErrorImageFormatNotSupported=Su PHP no soporta las funciones de conversión de este formato de imagen. SetDate=Fijar fecha SelectDate=Seleccione una fecha SeeAlso=Ver también %s BackgroundColorByDefault=Color de fondo +FileNotUploaded=No se ha subido el archivo +FileUploaded=El archivo se ha subido correctamente FileWasNotUploaded=Un archivo ha sido seleccionado para adjuntarlo, pero aún no se ha subido. Haga clic en "Adjuntar este archivo" para ello. NbOfEntries=Nº de entradas GoToWikiHelpPage=Consultar la ayuda (puede requerir acceso a Internet) @@ -341,6 +341,7 @@ FullList=Listado completo Statistics=Estadísticas OtherStatistics=Otras estadísticas Status=Estado +Favorite=Favorito ShortInfo=Info. Ref=Ref. RefSupplier=Ref. proveedor diff --git a/htdocs/langs/es_ES/margins.lang b/htdocs/langs/es_ES/margins.lang index 23b8e9acd904d69297a325135896a64c325bf94c..f1c356ab87190bc01a9438145f5291ca20030255 100644 --- a/htdocs/langs/es_ES/margins.lang +++ b/htdocs/langs/es_ES/margins.lang @@ -38,4 +38,6 @@ BuyingCost=Costos UnitCharges=Carga unitaria Charges=Cargas AgentContactType=Tipo de contacto comisionado -AgentContactTypeDetails=Indica el tipo de contacto enlazado a las facturas que serán asociados a los agentes comerciales +AgentContactTypeDetails=Indique qué tipo de contacto (enlazado a las facturas) será el utilizado para el informe de márgenes de agentes comerciales +rateMustBeNumeric=El margen debe ser un valor numérico +markRateShouldBeLesserThan100=El margen tiene que ser menor que 100 diff --git a/htdocs/langs/es_ES/members.lang b/htdocs/langs/es_ES/members.lang index ebccec6be148158c5e6b5b92d682c800502be57a..dd1989dbb48bee73a63ec85636d6fa3fd3f086b7 100644 --- a/htdocs/langs/es_ES/members.lang +++ b/htdocs/langs/es_ES/members.lang @@ -85,7 +85,7 @@ SubscriptionLateShort=En retraso SubscriptionNotReceivedShort=No recibida ListOfSubscriptions=Listado de afiliaciones SendCardByMail=Enviar ficha por e-mail -AddMember=Añadir miembro +AddMember=Crear miembro NoTypeDefinedGoToSetup=Ningún tipo de miembro definido. Vaya a Configuración -> Tipos de miembros NewMemberType=Nuevo tipo de miembro WelcomeEMail=E-mail @@ -125,7 +125,7 @@ Date=Fecha DateAndTime=Fecha y hora PublicMemberCard=Ficha pública miembro MemberNotOrNoMoreExpectedToSubscribe=No sometida a cotización -AddSubscription=Añadir afiliación +AddSubscription=Crear afiliación ShowSubscription=Mostrar afiliación MemberModifiedInDolibarr=Miembro modificado en Dolibarr SendAnEMailToMember=Enviar e-mail de información al miembro (E-mail: <b>%s</b>) diff --git a/htdocs/langs/es_ES/other.lang b/htdocs/langs/es_ES/other.lang index 107c47e0cf8cf5a2fdf482bf8790a0dad3caadde..9de70d01f95edaaeeca195c4c2c216eeda637082 100644 --- a/htdocs/langs/es_ES/other.lang +++ b/htdocs/langs/es_ES/other.lang @@ -1,7 +1,6 @@ # Dolibarr language file - Source file is en_US - other SecurityCode=Código seguridad Calendar=Calendario -AddTrip=Crear honorario Tools=Utilidades ToolsDesc=Esta área está dedicada al reagrupamiento de diversas utilidades no disponibles en las otras entradas de menú.<br><br>La lista de estas utilidades es accesible mediante el menú de al lado. Birthday=Aniversario @@ -48,6 +47,7 @@ Notify_PROJECT_CREATE=Creación de proyecto Notify_TASK_CREATE=Tarea creada Notify_TASK_MODIFY=Tarea modificada Notify_TASK_DELETE=Tarea eliminada +SeeModuleSetup=Consulte la configuración del módulo NbOfAttachedFiles=Número archivos/documentos adjuntos TotalSizeOfAttachedFiles=Tamaño total de los archivos/documentos adjuntos MaxSize=Tamaño máximo diff --git a/htdocs/langs/es_ES/products.lang b/htdocs/langs/es_ES/products.lang index c07cb7c7485ca543b7fd0228fd5e770e6a8b0010..1a4726afcc20365219df6a21effa3f8ac244fb82 100644 --- a/htdocs/langs/es_ES/products.lang +++ b/htdocs/langs/es_ES/products.lang @@ -117,12 +117,12 @@ ServiceLimitedDuration=Si el servicio es de duración limitada : MultiPricesAbility=Varios niveles de precio por producto/servicio MultiPricesNumPrices=Nº de precios MultiPriceLevelsName=Categoría de precios -AssociatedProductsAbility=Activar productos compuestos -AssociatedProducts=Productos compuestos +AssociatedProductsAbility=Activar la funcionalidad de productos compuestos +AssociatedProducts=Producto compuesto AssociatedProductsNumber=Nº de productos que componen este producto ParentProductsNumber=Nº de productos que este producto compone -IfZeroItIsNotAVirtualProduct=Si 0, este producto no es un producto virtual -IfZeroItIsNotUsedByVirtualProduct=Si 0, este producto no está siendo utilizado por ningún producto virtual +IfZeroItIsNotAVirtualProduct=Si 0, este producto no es un producto compuesto +IfZeroItIsNotUsedByVirtualProduct=Si 0, este producto no puede ser usado por ningún producto compuesto EditAssociate=Componer Translation=Traducción KeywordFilter=Filtro por clave @@ -179,7 +179,7 @@ CloneProduct=Clonar producto/servicio ConfirmCloneProduct=¿Está seguro de querer clonar el producto o servicio <b>%s</b>? CloneContentProduct=Clonar solamente la información general del producto/servicio ClonePricesProduct=Clonar la información general y los precios -CloneCompositionProduct=Clonar producto/servicio virtual +CloneCompositionProduct=Clonar productos/servicios compuestos ProductIsUsed=Este producto es utilizado NewRefForClone=Ref. del nuevo producto/servicio CustomerPrices=Precios clientes diff --git a/htdocs/langs/es_ES/projects.lang b/htdocs/langs/es_ES/projects.lang index 6a1cf66ddd0be8d5db0baee06aefe183ff1af14e..da5a65ceb968ad98816bb3e8a6bf7360c55a72a8 100644 --- a/htdocs/langs/es_ES/projects.lang +++ b/htdocs/langs/es_ES/projects.lang @@ -45,7 +45,7 @@ TaskDateStart=Fecha inicio TaskDateEnd=Fecha finalización TaskDescription=Descripción tarea NewTask=Nueva tarea -AddTask=Añadir tarea +AddTask=Crear tarea AddDuration=Indicar duración Activity=Actividad Activities=Tareas/actividades diff --git a/htdocs/langs/es_ES/propal.lang b/htdocs/langs/es_ES/propal.lang index b90258f504997175a0a90e4ac9dff75c499f0fd5..2dc1897235906be2aab54d19d1ceabd518c730e1 100644 --- a/htdocs/langs/es_ES/propal.lang +++ b/htdocs/langs/es_ES/propal.lang @@ -55,8 +55,6 @@ NoOpenedPropals=Sin presupuestos abiertos NoOtherOpenedPropals=Ningún otro presupuesto abierto RefProposal=Ref. presupuesto SendPropalByMail=Enviar presupuesto por e-mail -FileNotUploaded=No se ha subido el archivo -FileUploaded=El archivo se ha subido correctamente AssociatedDocuments=Documentos asociados al presupuesto: ErrorCantOpenDir=Imposible abrir el directorio DatePropal=Fecha presupuesto @@ -83,7 +81,7 @@ ProposalsAndProposalsLines=Presupuestos a clientes y líneas de presupuestos ProposalLine=Línea de presupuesto AvailabilityPeriod=Tiempo de entrega SetAvailability=Definir el tiempo de entrega -AfterOrder=despues del pedido +AfterOrder=desde la firma ##### Availability ##### AvailabilityTypeAV_NOW=Inmediata AvailabilityTypeAV_1W=1 semana diff --git a/htdocs/langs/es_ES/suppliers.lang b/htdocs/langs/es_ES/suppliers.lang index 1998f61ac0cbbbfae982ef1e88a829347993b7b6..06079f228741c62188f13d4ef75c2b583f06239c 100644 --- a/htdocs/langs/es_ES/suppliers.lang +++ b/htdocs/langs/es_ES/suppliers.lang @@ -1,7 +1,7 @@ # Dolibarr language file - Source file is en_US - suppliers Suppliers=Proveedores Supplier=Proveedor -AddSupplier=Añadir proveedor +AddSupplier=Crear un proveedor SupplierRemoved=Proveedor eliminado SuppliersInvoice=Factura proveedor NewSupplier=Nuevo proveedor diff --git a/htdocs/langs/es_ES/users.lang b/htdocs/langs/es_ES/users.lang index 65b6d8ed0a07cff626b469ddd0efdaffc8dd4065..e27f8b111e5d4fc79f4d1506b551f7eb7f8f3ed1 100644 --- a/htdocs/langs/es_ES/users.lang +++ b/htdocs/langs/es_ES/users.lang @@ -120,3 +120,4 @@ UseTypeFieldToChange=Modificar el campo Tipo para cambiar OpenIDURL=Dirección OpenID LoginUsingOpenID=Usar OpenID para iniciar sesión WeeklyHours=Horas semanales +ColorUser=Color para el usuario diff --git a/htdocs/langs/es_ES/withdrawals.lang b/htdocs/langs/es_ES/withdrawals.lang index 6e12cbccf4771a2452039a73dc593d2ea699f50c..5c241d7655335a55796bdc6f865d9be8da910f22 100644 --- a/htdocs/langs/es_ES/withdrawals.lang +++ b/htdocs/langs/es_ES/withdrawals.lang @@ -14,8 +14,8 @@ WithdrawalReceiptShort=Orden LastWithdrawalReceipts=Las %s últimas órdenes de domiciliación WithdrawedBills=Facturas domiciliadas WithdrawalsLines=Lineas de domiciliación -RequestStandingOrderToTreat=Pedidos de domiciliaciones a tratar -RequestStandingOrderTreated=Pedidos de domiciliaciones procesados +RequestStandingOrderToTreat=Peticiones de domiciliaciones a procesar +RequestStandingOrderTreated=Peticiones de domiciliaciones procesadas CustomersStandingOrders=Domiciliaciones de clientes CustomerStandingOrder=Domiciliación cliente NbOfInvoiceToWithdraw=Nº de facturas pendientes de domiciliación diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 28edf08867b26e9b87db49af02dbdc4c613c33f7..bae681d69818c3a724d3695626a5b6660e0f6309 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -327,6 +327,12 @@ ModuleDisabled=Module désactivé ModuleDisabledSoNoEvent=Module désactivé donc événement jamais créé ConfirmPurge=Êtes-vous sûr de vouloir réaliser cette purge ?<br>Ceci effacera définitivement tous vos fichiers (espace GED, pièces jointes, etc...). MinLength=Longueur minimale +NbMajMin=Nombre de majuscule minimum +NbNumMin=Nombre de chiffre minimum +NbSpeMin=Nombre de caractère speciaux minimum +NbIteConsecutive=Nombre maximum d'iterations consecutive du même caractère +NoAmbiCaracAutoGeneration=Ne pas utiliser les caractère ambigus pour la generation automatique ("1","I","l","|","0","O") +SetupPerso=Configuration personalisable LanguageFilesCachedIntoShmopSharedMemory=Fichiers .lang en mémoire partagée ExamplesWithCurrentSetup=Exemples avec le paramétrage actif courant ListOfDirectories=Liste des répertoires des modèles OpenDocument @@ -1057,6 +1063,8 @@ EmptyNumRefModelDesc=Code libre sans vérification. Peut être modifié à tout ##### Module password generation PasswordGenerationStandard=Renvoie un mot de passe généré selon l'algorithme interne de Dolibarr : 8 caractères, chiffres et caractères en minuscules mélangés. PasswordGenerationNone=Ne propose pas de mots de passe générés. Le mot de passe est à saisir manuellement. +PasswordGenerationPerso=Renvoie un mot de passe généré selon votre configuration. +PasswordPatternDesc=Pattern utilisé pour la génération de password personalisé ##### Users setup ##### UserGroupSetup=Configuration module utilisateurs et groupes GeneratePassword=Proposer un mot de passe généré diff --git a/htdocs/langs/fr_FR/resource.lang b/htdocs/langs/fr_FR/resource.lang index e4c8a6ade874b620dc2be4451e005ceb2e89ce0a..5059d628092327031428e7562579572337c067a6 100755 --- a/htdocs/langs/fr_FR/resource.lang +++ b/htdocs/langs/fr_FR/resource.lang @@ -32,4 +32,6 @@ ResourceLinkedWithSuccess=Ressource liée avec succès TitleResourceCard=Fiche ressource ConfirmDeleteResource=Confirmer la suppression de cette ressource? RessourceSuccessfullyDeleted=Ressource effacée avec succès -DictionaryResourceType=Type de ressources \ No newline at end of file +DictionaryResourceType=Type de ressources + +SelectResource=Sélectionner la ressource diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index fa6b503caa7a69a3d1e76c11e5f01e032030cbb0..6698866869e3c156d8f8bd10c54e62d99a637b2c 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1015,10 +1015,14 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs //print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/extras/ColVis/css/ColVisAlt.css'.($ext?'?'.$ext:'').'" />'."\n"; print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/extras/TableTools/css/TableTools.css'.($ext?'?'.$ext:'').'" />'."\n"; } - if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || (defined('REQUIRE_JQUERY_MULTISELECT') && constant('REQUIRE_JQUERY_MULTISELECT'))) // jQuery multiselect + if ((! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && $conf->global->MAIN_USE_JQUERY_MULTISELECT == 'multiselect') || (defined('REQUIRE_JQUERY_MULTISELECT') && constant('REQUIRE_JQUERY_MULTISELECT') == 'multiselect')) // jQuery multiselect { print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/multiselect/css/ui.multiselect.css'.($ext?'?'.$ext:'').'" />'."\n"; } + if ((! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && $conf->global->MAIN_USE_JQUERY_MULTISELECT == 'multiple-select') || (defined('REQUIRE_JQUERY_MULTISELECT') && constant('REQUIRE_JQUERY_MULTISELECT') == 'multiple-select')) // jQuery multiple-select + { + print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/multiple-select/multiple-select.css'.($ext?'?'.$ext:'').'" />'."\n"; + } // jQuery Timepicker if (! empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER')) { @@ -1178,11 +1182,6 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/extras/ColVis/js/ColVis.min.js'.($ext?'?'.$ext:'').'"></script>'."\n"; print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/datatables/extras/TableTools/js/TableTools.min.js'.($ext?'?'.$ext:'').'"></script>'."\n"; } - // jQuery Multiselect - if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || (defined('REQUIRE_JQUERY_MULTISELECT') && constant('REQUIRE_JQUERY_MULTISELECT'))) - { - print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/multiselect/js/ui.multiselect.js'.($ext?'?'.$ext:'').'"></script>'."\n"; - } // jQuery Timepicker if (! empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER')) { diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 7730abb77cc79830ca6cb79159f5bf963f48b80b..e3e6373962b0122c1e8f4049e5c65a2ab9c2a49c 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -770,7 +770,7 @@ class Task extends CommonObject if ($this->db->query($sql) ) { $tasktime_id = $this->db->last_insert_id(MAIN_DB_PREFIX."projet_task_time"); - $ret = $tasktme_id; + $ret = $tasktime_id; if (! $notrigger) { @@ -801,10 +801,7 @@ class Task extends CommonObject $this->db->rollback(); $ret = -2; } - } - - if ($ret >= 0) - { + $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task_time"; $sql.= " SET thm = (SELECT thm FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".$this->timespent_fk_user.")"; $sql.= " WHERE rowid = ".$tasktime_id; diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index 241d440cc0f64b4a0955c890bde7f8216ae0231c..ca01963e30bb3a3a9b53ed279b06475d934a9153 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -1,19 +1,20 @@ <?php /* Copyright (C) - 2013 Jean-François FERRY <jfefe@aternatik.fr> -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 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 <http://www.gnu.org/licenses/>. -*/ + * + * 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 <http://www.gnu.org/licenses/>. + * or see http://www.gnu.org/ + */ /** * \file place/class/html.place.class.php diff --git a/htdocs/resource/class/resource.class.php b/htdocs/resource/class/resource.class.php index e947b4e7ed9d63e58a73bdc848fc7c4a8db6329e..19768f569e39f56309be20bbff766b07cea82cfb 100644 --- a/htdocs/resource/class/resource.class.php +++ b/htdocs/resource/class/resource.class.php @@ -23,8 +23,8 @@ */ // Put here all includes required by your class file -require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); - +require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php"; /** * DAO Resource object @@ -329,7 +329,7 @@ class Resource extends CommonObject function delete($rowid, $notrigger=0) { global $user,$langs,$conf; - + $error=0; if (! $notrigger) @@ -339,10 +339,10 @@ class Resource extends CommonObject if ($result < 0) return -1; // End call triggers } - + $sql = "DELETE FROM ".MAIN_DB_PREFIX."resource"; $sql.= " WHERE rowid =".$rowid; - + dol_syslog(get_class($this)."::delete", LOG_DEBUG); if ($this->db->query($sql)) { @@ -364,7 +364,7 @@ class Resource extends CommonObject return -1; } } - + /** * Load resource objects into $this->lines * @@ -500,9 +500,9 @@ class Resource extends CommonObject $line->fk_user_create = $obj->fk_user_create; if($obj->resource_id && $obj->resource_type) - $line->objresource = $this->fetchObjectByElement($obj->resource_id,$obj->resource_type); + $line->objresource = fetchObjectByElement($obj->resource_id,$obj->resource_type); if($obj->element_id && $obj->element_type) - $line->objelement = $this->fetchObjectByElement($obj->element_id,$obj->element_type); + $line->objelement = fetchObjectByElement($obj->element_id,$obj->element_type); $this->lines[$i] = $line; $i++; @@ -584,7 +584,7 @@ class Resource extends CommonObject $line->mandatory = $obj->mandatory; $line->fk_user_create = $obj->fk_user_create; - $this->lines[$i] = $this->fetchObjectByElement($obj->resource_id,$obj->resource_type); + $this->lines[$i] = fetchObjectByElement($obj->resource_id,$obj->resource_type); $i++; } @@ -732,7 +732,7 @@ class Resource extends CommonObject { // Call trigger $result=$this->call_trigger('RESOURCE_MODIFY',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers } } @@ -802,7 +802,7 @@ class Resource extends CommonObject $i=0; foreach($resources as $nb => $resource) { - $this->lines[$i] = $this->fetchObjectByElement($resource['resource_id'],$resource['resource_type']); + $this->lines[$i] = fetchObjectByElement($resource['resource_id'],$resource['resource_type']); $i++; } return $i; diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index 542a2066e93220b2cabe7add1bd73f09bc7b5b9b..1845669dcfc8406ab11cae0a00e3eb395c20b674 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -1,7 +1,7 @@ <?php /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net> - * Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es> + * Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es> * * 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 @@ -376,7 +376,7 @@ if ($result > 0) print '</tr>'; // List - $sql = "SELECT n.rowid, n.daten, n.email, n.objet_type, n.objet_id as object_id, n.type,"; + $sql = "SELECT n.rowid, n.daten, n.email, n.objet_type as object_type, n.objet_id as object_id, n.type,"; $sql.= " c.rowid as id, c.lastname, c.firstname, c.email as contactemail,"; $sql.= " a.code, a.label"; $sql.= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,"; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 54effb54b208d565390674f155cc26d39e72ffda..0a5a9303d902e34398228b3c35a91c8f517034ae 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -520,6 +520,7 @@ if (empty($reshook)) // Actions to send emails $id=$socid; $actiontypecode='AC_OTH_AUTO'; + $trigger_name='COMPANY_SENTBYMAIL'; $paramname='socid'; $mode='emailfromthirdparty'; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; @@ -781,7 +782,7 @@ else print '<div class="hideonsmartphone float">'; print $langs->trans("ThirdPartyType").': '; print '</div>'; - print '<input type="radio" id="1radiocompany" class="flat" name="private" value="0"'.($private?'':' checked="checked"').'>'; + print '<input type="radio" id="radiocompany" class="flat" name="private" value="0"'.($private?'':' checked="checked"').'>'; print '<label for="radiocompany">'; print ' '; print $langs->trans("Company/Fundation"); diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index b8467076f4000f12a64b07858285105e26e7c779..0f5644dc4061170aba822c41d7bd0a5678a0e573 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -830,7 +830,7 @@ foreach($mainmenuusedarray as $val) .bodylogin { - background: #fbfbfb; + background: #f0f0f0; /* -moz-box-shadow: inset 0 0 10px #000000; -webkit-box-shadow: inset 0 0 10px #000000; box-shadow: inset 0 0 10px #000000; */ @@ -861,22 +861,27 @@ form#login { padding-bottom:12px; max-width: 540px; - border: 1px solid #C0C0C0; - background-color: #E0E0E0; - - -moz-box-shadow: 3px 2px 20px #CCC; + background-color: #FFFFFF; + + -moz-box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15); + -webkit-box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15); + box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15); + /*-moz-box-shadow: 3px 2px 20px #CCC; -webkit-box-shadow: 3px 2px 20px #CCC; - box-shadow: 3px 2px 20px #CCC; + box-shadow: 3px 2px 20px #CCC;*/ border-radius: 8px; - border:solid 1px rgba(128,128,128,.4); + border:solid 1px rgba(80,80,80,.4); + border-top:solid 1px f8f8f8; + /* background-color: #f8f8f8; background-image: -o-linear-gradient(top, rgba(250,250,250,.6) 0%, rgba(192,192,192,.3) 100%); background-image: -moz-linear-gradient(top, rgba(250,250,250,.6) 0%, rgba(192,192,192,.3) 100%); background-image: -webkit-linear-gradient(top, rgba(250,250,250,.6) 0%, rgba(192,192,192,.3) 100%); background-image: -ms-linear-gradient(top, rgba(250,250,250,.6) 0%, rgba(192,192,192,.3) 100%); background-image: linear-gradient(top, rgba(250,250,250,.6) 0%, rgba(192,192,192,.3) 100%); + */ } div#login_left, div#login_right { display: inline-block; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 4760f73f85540adb360dd8b94f41d7ac75d3ab10..9c2290cc6292d9b568a8e2ff073ee6be8c4a6ae7 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -36,7 +36,8 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -if (! empty($conf->agenda->enabled))require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +//if (! empty($conf->agenda->enabled))require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php'; if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; if (! empty($conf->multicompany->enabled)) dol_include_once('/multicompany/class/actions_multicompany.class.php'); diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index 2d104eb96a1f01d78aeb61e1233f5fd3fb8b9586..696723f7247196a0e946c638b3f786836f83d6af 100644 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -460,7 +460,7 @@ function createThirdParty($authentication,$thirdparty) $result=$newobject->create($fuser); if ($newobject->particulier && $result > 0) { $newobject->firstname = $thirdparty['firstname']; - $newobject->name_bis = $thirdparty['ref']; + $newobject->name_bis = $thirdparty['lastname']; $result = $newobject->create_individual($fuser); } if ($result <= 0)