Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2014-11-06 13:47:38 +01:00
commit 633e34da52
125 changed files with 2442 additions and 2118 deletions

View File

@ -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

View File

@ -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.

View File

@ -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">&nbsp;</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 '&nbsp;';
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>&nbsp;';
print '</a>';
print '&nbsp;';
print '<a href="./card.php?action=delete&id=' . $obj->rowid . '">';
print img_delete();
print '</a>';

View File

@ -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);

View File

@ -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>&nbsp;';
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>&nbsp;';
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"));
}
}

View File

@ -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("&nbsp;");
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>&nbsp;</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>&nbsp;</td>';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</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 '&nbsp;';
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 ++;
}

View File

@ -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%">';

View File

@ -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',";

View File

@ -68,8 +68,6 @@ $action = GETPOST('action');
// Security check
if ($user->societe_id > 0)
accessforbidden();
if (! $user->rights->accounting->access)
accessforbidden();
/*
* View

View File

@ -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');

View File

@ -36,8 +36,6 @@ $langs->load("accountancy");
// Security check
if ($user->societe_id > 0)
accessforbidden();
if (! $user->rights->accounting->access)
accessforbidden();
llxHeader('', 'Journaux', '');

View File

@ -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');

View File

@ -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');

View File

@ -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">';

View File

@ -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>';

View File

@ -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/
*/
/**

View File

@ -723,7 +723,7 @@ else
{
/* ************************************************************************** */
/* */
/* Fiche creation */
/* Creation card */
/* */
/* ************************************************************************** */
$object->canvas=$canvas;

View File

@ -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='')

View File

@ -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;

View File

@ -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;

View File

@ -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();

View File

@ -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
{

View File

@ -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
*/

View File

@ -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'];
}
}
// Actions to send emails
$actiontypecode='AC_PROP';
$trigger_name='PROPAL_SENTBYMAIL';
$paramname='id';
$mode='emailfromproposal';
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
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_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 . '&amp;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();

View File

@ -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)
{
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
$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($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();

View File

@ -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 '&nbsp;';
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;

View File

@ -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

View File

@ -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';
// Actions to send emails
$actiontypecode='AC_COM';
$trigger_name='ORDER_SENTBYMAIL';
$paramname='id';
$mode='emailfromorder';
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
// 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'];
// 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') {

View File

@ -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">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</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;

View File

@ -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.= ' AND d.rowid LIKE \'%'.$db->escape(trim($search_ref)) . '%\'';
$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 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 '&nbsp;';
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.'">';
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">';
//print '<input class="flat" size="10" type="text" name="search_name" value="'.$search_name.'">';
print '<input class="flat" size="10" type="text" name="search_name" value="'.$search_name.'">';
print '</td>';
print '<td class="liste_titre" align="left">';
print '&nbsp;';
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 '&nbsp;';
print '</td>';
print '<td class="liste_titre" align="right">';
print '&nbsp;';
// 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;

View File

@ -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 '&nbsp;';
print '</td>';
}
print '<td class="liste_titre" align="right">';
print '&nbsp;';
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))

View File

@ -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 = '';
// 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';
$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");
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();

View File

@ -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">&nbsp;</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))

View File

@ -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">&nbsp;</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>&nbsp;</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>&nbsp;</td>';
print '</tr>';
$i++;

View File

@ -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&amp;modulepart=prelevement&amp;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();

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -213,6 +213,7 @@ else
dol_print_error($db);
}
$db->close();
llxFooter();
$db->close();

View File

@ -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&amp;id=$lipre->id\">".$langs->trans("StandingOrderReject")."</a>";
if ($user->rights->prelevement->bons->credit)
{
print "<a class=\"butAction\" href=\"ligne.php?action=rejet&amp;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++;

View File

@ -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>&nbsp;</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">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</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;

View File

@ -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">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</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">&nbsp;</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))
{

View File

@ -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">&nbsp;</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">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</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">&nbsp;</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))
{

View File

@ -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">&nbsp;</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">&nbsp;</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))
{

View File

@ -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 '&nbsp; ';
print '&nbsp;';
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>';

View File

@ -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='&amp;search_contract='.$search_contract;
$param.='&amp;search_nom='.$search_nom;
$param.='&amp;search_name='.$search_name;
$param.='&amp;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">&nbsp;</td>';
//print '<td class="liste_titre">&nbsp;</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;

View File

@ -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.='&amp;search_contract='.urlencode($search_contract);
if ($search_nom) $param.='&amp;search_nom='.urlencode($search_nom);
if ($search_name) $param.='&amp;search_name='.urlencode($search_name);
if ($search_service) $param.='&amp;search_service='.urlencode($search_service);
if ($mode) $param.='&amp;mode='.$mode;
if ($filter) $param.='&amp;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);

View File

@ -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;
}

View File

@ -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"),

View File

@ -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

View File

@ -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 {

View File

@ -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;

View File

@ -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/
*/
/**

View File

@ -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);

View File

@ -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;

View File

@ -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 )

View File

@ -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;
dol_syslog('num_open_day timestampStart='.$timestampStart.' timestampEnd='.$timestampEnd.' bit='.$lastday);
if (empty($country_code)) $country_code=$mysoc->country_code;
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));

View File

@ -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

View File

@ -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';

View File

@ -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');
}
}

View File

@ -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);

View File

@ -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();

View File

@ -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)

View File

@ -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;
}
}

View File

@ -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("InterventionClassifiedBilled",$object->ref);
$object->actionmsg=$langs->transnoentities("InterventionClassifiedBilled",$object->ref);
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_DELETE')
elseif ($action == 'FICHINTER_CLASSIFY_UNBILLED')
{
$langs->load("other");
$langs->load("interventions");
$object->actiontypecode='AC_OTH_AUTO';
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')
{
$langs->load("other");
$langs->load("interventions");

View File

@ -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>&nbsp;</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>&nbsp;</td>';
print '<td align="right" class="nowrap liste_total">'.convertSecondToTime($total).'</td><td>&nbsp;</td><td>&nbsp;</td>';
print '</tr>';
}
print '</table>';
print "</form>\n";
$db->free($result);

View File

@ -47,6 +47,31 @@ if ($user->societe_id > 0)
$socid = $user->societe_id;
}
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$search_ref = GETPOST('search_ref','alpha');
$search_ref_supplier = GETPOST('search_ref_supplier','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');
$page = GETPOST("page",'int');
if ($page == -1) { $page = 0; }
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$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
@ -61,31 +86,6 @@ $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');
$page = GETPOST("page",'int');
if ($page == -1) { $page = 0; }
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortfield) $sortfield="f.date_lim_reglement";
if (! $sortorder) $sortorder="ASC";
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.='&amp;search_ref='.urlencode($search_ref);
if ($search_ref_supplier) $param.='&amp;search_ref_supplier='.urlencode($search_ref_supplier);
if ($search_societe) $param.='&amp;search_societe='.urlencode($search_societe);
if ($search_montant_ht) $param.='&amp;search_montant_ht='.urlencode($search_montant_ht);
if ($search_montant_ttc) $param.='&amp;search_montant_ttc='.urlencode($search_montant_ttc);
if ($search_company) $param.='&amp;search_company='.urlencode($search_company);
if ($search_amount_no_tax) $param.='&amp;search_amount_no_tax='.urlencode($search_amount_no_tax);
if ($search_amount_all_tax) $param.='&amp;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">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</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)
{

View File

@ -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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</td>';
print '<td class="liste_total" align="center">&nbsp;</td>';
print "</tr>\n";
}
}

View File

@ -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">&nbsp;</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>&nbsp;</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>&nbsp;</td>';
print '</tr>';
$i++;
}

View File

@ -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 = "&amp;search_nom=".$search_nom."&amp;search_code_fournisseur=".$search_code_fournisseur."&amp;search_zipcode=".$search_zipcode."&amp;search_town=".$search_town;
$param = "&amp;search_name=".$search_name."&amp;search_supplier_code=".$search_supplier_code."&amp;search_zipcode=".$search_zipcode."&amp;search_town=".$search_town;
if ($search_categ != '') $param.='&amp;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

View File

@ -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";

View File

@ -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.

View File

@ -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)

View File

@ -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);

View File

@ -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;
}

View File

@ -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"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -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.

View File

@ -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; }

View File

@ -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">&nbsp;</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">&nbsp;</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);

View File

@ -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];
}
}
?>

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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)

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
DictionaryResourceType=Type of resources
SelectResource=Select resource

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -24,3 +24,5 @@ Deliverer=Destinatario :
Sender=Origen
Recipient=Destinatario
ErrorStockIsNotEnough=No hay suficiente stock
Shippable=Enviable
NonShippable=No enviable

View File

@ -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

Some files were not shown because too many files have changed in this diff Show More