Merge remote-tracking branch 'Upstream/develop' into develop-a7

This commit is contained in:
aspangaro 2015-12-22 07:11:10 +01:00
commit ec7cffd6a4
135 changed files with 587 additions and 426 deletions

View File

@ -269,12 +269,16 @@ script:
cd htdocs/install cd htdocs/install
php upgrade.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360.log php upgrade.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360.log
php upgrade2.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360-2.log php upgrade2.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360-2.log
php step5.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360-3.log
php upgrade.php 3.6.0 3.7.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade360370.log php upgrade.php 3.6.0 3.7.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade360370.log
php upgrade2.php 3.6.0 3.7.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade360370-2.log php upgrade2.php 3.6.0 3.7.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade360370-2.log
php step5.php 3.6.0 3.7.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade360370-3.log
php upgrade.php 3.7.0 3.8.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade370380.log php upgrade.php 3.7.0 3.8.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade370380.log
php upgrade2.php 3.7.0 3.8.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade370380-2.log php upgrade2.php 3.7.0 3.8.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade370380-2.log
php step5.php 3.7.0 3.8.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade370380-3.log
php upgrade.php 3.8.0 3.9.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade380390.log php upgrade.php 3.8.0 3.9.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade380390.log
php upgrade2.php 3.8.0 3.9.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade380390-2.log php upgrade2.php 3.8.0 3.9.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade380390-2.log
php step5.php 3.8.0 3.9.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade380390-3.log
cd - cd -
set +e set +e
echo echo

View File

@ -76,7 +76,7 @@ Feel free to express technical details, use cases or anything relevant to the cu
This section can span multiple lines. This section can span multiple lines.
Try to keep lines under 72 characters. Try to keep lines under 120 characters.
#### Samples #### Samples
<pre> <pre>

View File

@ -148,6 +148,8 @@ NEW: Add restler framework. First step to build REST API into Dolibarr.
WARNING: WARNING:
Dolibarr 3.9 is not yet fully compatible with PHP 7.
Following changes may create regression for some external modules, but were necessary to make Following changes may create regression for some external modules, but were necessary to make
Dolibarr better: Dolibarr better:
- Deprecated Product::setPriceExpression. Use Product::update instead - Deprecated Product::setPriceExpression. Use Product::update instead

View File

@ -62,6 +62,13 @@ In htdocs/includes/tcpdf/tcpdf.php
* Renamed getmypid into dol_getmypid(). * Renamed getmypid into dol_getmypid().
To avoid to have QRcode changed because generated with a random mask, replace
define('QR_FIND_FROM_RANDOM', 2);
with
define('QR_FIND_FROM_RANDOM', false);
TCPDI: TCPDI:
------ ------
Add fpdf_tpl.php 1.2 Add fpdf_tpl.php 1.2

View File

@ -49,7 +49,7 @@ if (!$user->admin)
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'sortorder'); $sortorder = GETPOST("sortorder", 'sortorder');
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$page = GETPOST("page", 'int'); $page = GETPOST("page", 'int');
if ($page == - 1) { if ($page == - 1) {
$page = 0; $page = 0;

View File

@ -72,10 +72,8 @@ $pagenext = $page + 1;
// bug in page limit if ACCOUNTING_LIMIT_LIST_VENTILATION < $conf->liste_limit there is no pagination displayed ! // bug in page limit if ACCOUNTING_LIMIT_LIST_VENTILATION < $conf->liste_limit there is no pagination displayed !
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) && $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION >= $conf->liste_limit) { if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) && $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION >= $conf->liste_limit) {
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION; $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
// } else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
// $limit = $conf->liste_limit;
} else { } else {
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
} }
$offset = $limit * $page; $offset = $limit * $page;

View File

@ -44,7 +44,7 @@ $search_doc_ref = GETPOST("search_doc_ref");
$search_account = GETPOST("search_account"); $search_account = GETPOST("search_account");
$search_thirdparty = GETPOST("search_thirdparty"); $search_thirdparty = GETPOST("search_thirdparty");
$search_journal = GETPOST("search_journal"); $search_journal = GETPOST("search_journal");
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
if ($sortorder == "") if ($sortorder == "")
$sortorder = "ASC"; $sortorder = "ASC";

View File

@ -36,7 +36,7 @@ $langs->load("accountancy");
$page = GETPOST("page"); $page = GETPOST("page");
$sortorder = GETPOST("sortorder"); $sortorder = GETPOST("sortorder");
$sortfield = GETPOST("sortfield"); $sortfield = GETPOST("sortfield");
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
// Filter // Filter
$year = GETPOST("year", 'int'); $year = GETPOST("year", 'int');

View File

@ -61,9 +61,9 @@ $pagenext = $page + 1;
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) { if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION; $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) { } else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
} else { } else {
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
} }
$offset = $limit * $page; $offset = $limit * $page;

View File

@ -65,9 +65,9 @@ if ($page < 0)
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) { if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION; $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) { } else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
} else { } else {
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
} }
$offset = $limit * $page; $offset = $limit * $page;
@ -169,9 +169,9 @@ if ($action == 'ventil' && !empty($btn_ventil)) {
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) { if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION; $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) { } else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
} else { } else {
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
} }
$offset = $limit * $page; $offset = $limit * $page;

View File

@ -66,11 +66,11 @@ if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION))
} }
else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0)
{ {
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
} }
else else
{ {
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
} }
if (! $sortfield) $sortfield="f.datef, f.ref, l.rowid"; if (! $sortfield) $sortfield="f.datef, f.ref, l.rowid";

View File

@ -66,9 +66,9 @@ if ($page < 0)
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) { if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION; $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) { } else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
} else { } else {
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
} }
$offset = $limit * $page; $offset = $limit * $page;
@ -174,9 +174,9 @@ if ($action == 'ventil' && !empty($btn_ventil)) {
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) { if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION; $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) { } else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
} else { } else {
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
} }
$offset = $limit * $page; $offset = $limit * $page;

View File

@ -119,7 +119,7 @@ else
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td align="center">'.$langs->trans("Nature").'</td>'; print '<td align="center">'.$langs->trans("Nature").'</td>';
print '<td align="center">'.$langs->trans("NbOfMembers").'</td>'; print '<td align="right">'.$langs->trans("NbOfMembers").'</td>';
print '<td align="center">'.$langs->trans("LastMemberDate").'</td>'; print '<td align="center">'.$langs->trans("LastMemberDate").'</td>';
print '</tr>'; print '</tr>';
@ -135,7 +135,7 @@ foreach ($data as $val)
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td align="center">'.$memberstatic->getmorphylib($val['label']).'</td>'; print '<td align="center">'.$memberstatic->getmorphylib($val['label']).'</td>';
print '<td align="right">'.$val['nb'].'</td>'; print '<td align="right">'.$val['nb'].'</td>';
print '<td align="right">'.dol_print_date($val['lastdate'],'dayhour').'</td>'; print '<td align="center">'.dol_print_date($val['lastdate'],'dayhour').'</td>';
print '</tr>'; print '</tr>';
$oldyear=$year; $oldyear=$year;
} }

View File

@ -170,9 +170,9 @@ $data = $stats->getAllByYear();
print '<table class="noborder">'; print '<table class="noborder">';
print '<tr class="liste_titre" height="24">'; print '<tr class="liste_titre" height="24">';
print '<td align="center">'.$langs->trans("Year").'</td>'; print '<td align="center">'.$langs->trans("Year").'</td>';
print '<td align="center">'.$langs->trans("NbOfSubscriptions").'</td>'; print '<td align="right">'.$langs->trans("NbOfSubscriptions").'</td>';
print '<td align="center">'.$langs->trans("AmountTotal").'</td>'; print '<td align="right">'.$langs->trans("AmountTotal").'</td>';
print '<td align="center">'.$langs->trans("AmountAverage").'</td>'; print '<td align="right">'.$langs->trans("AmountAverage").'</td>';
print '</tr>'; print '</tr>';
$oldyear=0; $oldyear=0;

View File

@ -37,7 +37,7 @@ $page = GETPOST('page','int');
if (! $sortorder) $sortorder="DESC"; if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="date"; if (! $sortfield) $sortfield="date";
if ($page < 0) { $page = 0; } if ($page < 0) { $page = 0; }
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$offset = $limit * $page; $offset = $limit * $page;
if (! $user->admin) if (! $user->admin)

View File

@ -39,7 +39,7 @@ $page = GETPOST("page",'int');
if (! $sortorder) $sortorder="DESC"; if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="date"; if (! $sortfield) $sortfield="date";
if ($page < 0) { $page = 0; } if ($page < 0) { $page = 0; }
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$offset = $limit * $page; $offset = $limit * $page;
if (! $user->admin) accessforbidden(); if (! $user->admin) accessforbidden();

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Brice Davoleau <brice.davoleau@gmail.com> * Copyright (C) 2005 Brice Davoleau <brice.davoleau@gmail.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com> * Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>

View File

@ -36,6 +36,7 @@ $ref=GETPOST('ref');
$type=GETPOST('type'); $type=GETPOST('type');
$action=GETPOST('action'); $action=GETPOST('action');
$confirm=GETPOST('confirm'); $confirm=GETPOST('confirm');
$cancel=GETPOST('cancel');
$socid=GETPOST('socid','int'); $socid=GETPOST('socid','int');
$label=GETPOST('label'); $label=GETPOST('label');
@ -54,6 +55,10 @@ if ($id == "")
$result = restrictedArea($user, 'categorie', $id, '&category'); $result = restrictedArea($user, 'categorie', $id, '&category');
$object = new Categorie($db); $object = new Categorie($db);
if ($id > 0)
{
$result=$object->fetch($id);
}
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element); $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
@ -61,52 +66,56 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('categorycard')); $hookmanager->initHooks(array('categorycard'));
/* /*
* Actions * Actions
*/ */
if ($cancel)
{
header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type);
exit;
}
// Action mise a jour d'une categorie // Action mise a jour d'une categorie
if ($action == 'update' && $user->rights->categorie->creer) if ($action == 'update' && $user->rights->categorie->creer)
{ {
$categorie = new Categorie($db); $object->label = $label;
$result=$categorie->fetch($id); $object->description = dol_htmlcleanlastbr($description);
$object->color = $color;
$categorie->label = $label; $object->socid = ($socid ? $socid : 'null');
$categorie->description = dol_htmlcleanlastbr($description); $object->visible = $visible;
$categorie->color = $color;
$categorie->socid = ($socid ? $socid : 'null');
$categorie->visible = $visible;
if ($parent != "-1") if ($parent != "-1")
$categorie->fk_parent = $parent; $object->fk_parent = $parent;
else else
$categorie->fk_parent = ""; $object->fk_parent = "";
if (empty($categorie->label)) if (empty($object->label))
{ {
$error++; $error++;
$action = 'edit'; $action = 'edit';
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
} }
if (! $error && empty($categorie->error)) if (! $error && empty($object->error))
{ {
$ret = $extrafields->setOptionalsFromPost($extralabels,$categorie); $ret = $extrafields->setOptionalsFromPost($extralabels,$object);
if ($ret < 0) $error++; if ($ret < 0) $error++;
if (! $error && $categorie->update($user) > 0) if (! $error && $object->update($user) > 0)
{ {
header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$categorie->id.'&type='.$type); header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type);
exit; exit;
} }
else else
{ {
setEventMessages($categorie->error, $categorie->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
else else
{ {
setEventMessages($categorie->error, $categorie->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
@ -176,7 +185,7 @@ print '</table>';
dol_fiche_end(); dol_fiche_end();
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>'; print '<div class="center"><input type="submit" class="button" name"submit" value="'.$langs->trans("Modify").'"> &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
print '</form>'; print '</form>';

View File

@ -146,6 +146,7 @@ foreach($fulltree as $key => $val)
{ {
$categstatic->id=$val['id']; $categstatic->id=$val['id'];
$categstatic->ref=$val['label']; $categstatic->ref=$val['label'];
$categstatic->color=$val['color'];
$categstatic->type=$type; $categstatic->type=$type;
$li=$categstatic->getNomUrl(1,'',60); $li=$categstatic->getNomUrl(1,'',60);
$desc=dol_htmlcleanlastbr($val['description']); $desc=dol_htmlcleanlastbr($val['description']);
@ -153,8 +154,8 @@ foreach($fulltree as $key => $val)
$data[] = array( $data[] = array(
'rowid'=>$val['rowid'], 'rowid'=>$val['rowid'],
'fk_menu'=>$val['fk_parent'], 'fk_menu'=>$val['fk_parent'],
'entry'=>'<table class="nobordernopadding centpercent"><tr><td>'.$li. 'entry'=>'<table class="nobordernopadding centpercent"><tr><td><span class="noborderoncategories" '.($categstatic->color?' style="background: #'.$categstatic->color.';"':' style="background: #aaa"').'>'.$li.'</span></td>'.
'</td><td width="50%">'.dolGetFirstLineOfText($desc).'</td>'. '<td width="50%">'.dolGetFirstLineOfText($desc).'</td>'.
'<td align="right" width="20px;"><a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.'">'.img_view().'</a></td>'. '<td align="right" width="20px;"><a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.'">'.img_view().'</a></td>'.
'</tr></table>' '</tr></table>'
); );

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org> /* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com> * Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
@ -294,6 +294,7 @@ else
print "</table>\n"; print "</table>\n";
} }
// List of products or services (type is type of category) // List of products or services (type is type of category)
if ($object->type == Categorie::TYPE_PRODUCT) if ($object->type == Categorie::TYPE_PRODUCT)
{ {
@ -339,7 +340,7 @@ if ($object->type == Categorie::TYPE_PRODUCT)
$var=!$var; $var=!$var;
print "\t<tr ".$bc[$var].">\n"; print "\t<tr ".$bc[$var].">\n";
print '<td class="nowrap" valign="top">'; print '<td class="nowrap" valign="top">';
print $prod->getNomUrl(1,'category'); print $prod->getNomUrl(1);
print "</td>\n"; print "</td>\n";
print '<td valign="top">'.$prod->label."</td>\n"; print '<td valign="top">'.$prod->label."</td>\n";
// Link to delete from category // Link to delete from category
@ -390,7 +391,7 @@ if ($object->type == Categorie::TYPE_SUPPLIER)
print "\t<tr ".$bc[$var].">\n"; print "\t<tr ".$bc[$var].">\n";
print '<td class="nowrap" valign="top">'; print '<td class="nowrap" valign="top">';
print $soc->getNomUrl(1,'category_supplier'); print $soc->getNomUrl(1);
print "</td>\n"; print "</td>\n";
// Link to delete from category // Link to delete from category
print '<td align="right">'; print '<td align="right">';
@ -444,7 +445,7 @@ if($object->type == Categorie::TYPE_CUSTOMER)
$var=!$var; $var=!$var;
print "\t<tr ".$bc[$var].">\n"; print "\t<tr ".$bc[$var].">\n";
print '<td class="nowrap" valign="top">'; print '<td class="nowrap" valign="top">';
print $soc->getNomUrl(1,'category'); print $soc->getNomUrl(1);
print "</td>\n"; print "</td>\n";
// Link to delete from category // Link to delete from category
print '<td align="right">'; print '<td align="right">';
@ -497,7 +498,7 @@ if ($object->type == Categorie::TYPE_MEMBER)
print "\t<tr ".$bc[$var].">\n"; print "\t<tr ".$bc[$var].">\n";
print '<td class="nowrap" valign="top">'; print '<td class="nowrap" valign="top">';
$member->ref=$member->login; $member->ref=$member->login;
print $member->getNomUrl(1,0,'category'); print $member->getNomUrl(1,0);
print "</td>\n"; print "</td>\n";
print '<td valign="top">'.$member->lastname."</td>\n"; print '<td valign="top">'.$member->lastname."</td>\n";
print '<td valign="top">'.$member->firstname."</td>\n"; print '<td valign="top">'.$member->firstname."</td>\n";
@ -526,7 +527,7 @@ if ($object->type == Categorie::TYPE_MEMBER)
} }
} }
//Categorie contact // Categorie contact
if($object->type == Categorie::TYPE_CONTACT) if($object->type == Categorie::TYPE_CONTACT)
{ {
$contacts = $object->getObjectsInCateg("contact"); $contacts = $object->getObjectsInCateg("contact");

View File

@ -1081,8 +1081,10 @@ if ($id > 0)
print '</table>'; print '</table>';
print '<br><br>'; print '<br><br>';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Thirdparty - Contact // Thirdparty - Contact

View File

@ -58,7 +58,7 @@ $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page","int"); $page = GETPOST("page","int");
if ($page == -1) { $page = 0; } if ($page == -1) { $page = 0; }
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$offset = $limit * $page; $offset = $limit * $page;
if (! $sortorder) $sortorder="ASC"; if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="a.datec"; if (! $sortfield) $sortfield="a.datec";

View File

@ -74,7 +74,7 @@ $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');
if ($page == -1) { $page = 0 ; } if ($page == -1) { $page = 0 ; }
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$offset = $limit * $page ; $offset = $limit * $page ;
if (! $sortorder) if (! $sortorder)
{ {

View File

@ -55,7 +55,7 @@ $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page","int"); $page = GETPOST("page","int");
if ($page == -1) { $page = 0; } if ($page == -1) { $page = 0; }
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$offset = $limit * $page; $offset = $limit * $page;
if (! $sortorder) $sortorder="ASC"; if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="a.datec"; if (! $sortfield) $sortfield="a.datec";

View File

@ -41,7 +41,7 @@ $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');
if ($page == -1) { $page = 0 ; } if ($page == -1) { $page = 0 ; }
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$offset = $limit * $page ; $offset = $limit * $page ;
if (! $sortorder) $sortorder="DESC"; if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="a.datep"; if (! $sortfield) $sortfield="a.datep";

View File

@ -34,7 +34,7 @@ $page=GETPOST('page', 'int');
if (! $sortorder) $sortorder="ASC"; if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="p.name"; if (! $sortfield) $sortfield="p.name";
if ($page < 0) { $page = 0; } if ($page < 0) { $page = 0; }
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$offset = $limit * $page ; $offset = $limit * $page ;
$type=GETPOST('type', 'alpha'); $type=GETPOST('type', 'alpha');

View File

@ -32,7 +32,7 @@ $result=restrictedArea($user,'mailing');
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');
if ($page == -1) { $page = 0; } if ($page == -1) { $page = 0; }
$offset = $limit * $page; $offset = $limit * $page;

View File

@ -154,7 +154,7 @@ $pagenext = $page + 1;
if (! $sortfield) $sortfield='p.datep'; if (! $sortfield) $sortfield='p.datep';
if (! $sortorder) $sortorder='DESC'; if (! $sortorder) $sortorder='DESC';
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$sql = 'SELECT'; $sql = 'SELECT';

View File

@ -62,6 +62,7 @@ $formpropal=new FormPropal($db);
$langs->load('propal'); $langs->load('propal');
$langs->load('other'); $langs->load('other');
$langs->load("companies");
llxHeader('', $langs->trans("ProposalsStatistics")); llxHeader('', $langs->trans("ProposalsStatistics"));

View File

@ -67,7 +67,7 @@ $result = restrictedArea($user, 'commande', $id,'');
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
if ($page == -1) { $page = 0; } if ($page == -1) { $page = 0; }
$offset = $limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;

View File

@ -70,7 +70,7 @@ if ($page == -1) { $page = 0; }
$offset = $conf->liste_limit * $page; $offset = $conf->liste_limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
if (! $sortorder) $sortorder='DESC'; if (! $sortorder) $sortorder='DESC';
if (! $sortfield) $sortfield='b.dateo'; if (! $sortfield) $sortfield='b.dateo';

View File

@ -49,7 +49,7 @@ $sortorder = isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"];
$page = $_GET["page"]; $page = $_GET["page"];
if ($page < 0) $page = 0; if ($page < 0) $page = 0;
//$limit = $conf->liste_limit; //$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
//$offset = $limit * $page ; //$offset = $limit * $page ;
if (! $sortfield) $sortfield="cs.date_ech"; if (! $sortfield) $sortfield="cs.date_ech";

View File

@ -45,7 +45,7 @@ $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (! $sortorder) $sortorder="DESC"; if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="d.dated"; if (! $sortfield) $sortfield="d.dated";
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
/* /*

View File

@ -46,7 +46,7 @@ $search_company=GETPOST('search_company','alpha');
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
if ($page == -1) { $page = 0; } if ($page == -1) { $page = 0; }
$offset = $limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;

View File

@ -28,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacementstats.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacementstats.class.php';
$langs->load("trips"); $langs->load("trips");
$langs->load("companies");
$WIDTH=DolGraph::getDefaultGraphSizeForStats('width'); $WIDTH=DolGraph::getDefaultGraphSizeForStats('width');
$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height'); $HEIGHT=DolGraph::getDefaultGraphSizeForStats('height');

View File

@ -2094,7 +2094,7 @@ class Facture extends CommonInvoice
if (empty($txlocaltax2)) $txlocaltax2=0; if (empty($txlocaltax2)) $txlocaltax2=0;
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0; if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
if (empty($fk_prev_id)) $fk_prev_id = 'null'; if (empty($fk_prev_id)) $fk_prev_id = 'null';
if (is_null($situation_percent) || $situation_percent > 100) $situation_percent = 100; if (! isset($situation_percent) || $situation_percent > 100 || (string) $situation_percent == '') $situation_percent = 100;
$remise_percent=price2num($remise_percent); $remise_percent=price2num($remise_percent);
$qty=price2num($qty); $qty=price2num($qty);
@ -2282,7 +2282,7 @@ class Facture extends CommonInvoice
if (empty($qty)) $qty=0; if (empty($qty)) $qty=0;
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0; if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
if (empty($special_code) || $special_code == 3) $special_code=0; if (empty($special_code) || $special_code == 3) $special_code=0;
if ($situation_percent > 100 || is_null($situation_percent) || $situation_percent == "") $situation_percent = 100; if (! isset($situation_percent) || $situation_percent > 100 || (string) $situation_percent == '') $situation_percent = 100;
$remise_percent = price2num($remise_percent); $remise_percent = price2num($remise_percent);
$qty = price2num($qty); $qty = price2num($qty);
@ -3881,7 +3881,8 @@ class FactureLigne extends CommonInvoiceLine
if (empty($this->special_code)) $this->special_code=0; if (empty($this->special_code)) $this->special_code=0;
if (empty($this->fk_parent_line)) $this->fk_parent_line=0; if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
if (empty($this->fk_prev_id)) $this->fk_prev_id = 'null'; if (empty($this->fk_prev_id)) $this->fk_prev_id = 'null';
if (empty($this->situation_percent)) $this->situation_percent = 0; if (! isset($this->situation_percent) || $this->situation_percent > 100 || (string) $this->situation_percent == '') $this->situation_percent = 100;
if (empty($this->pa_ht)) $this->pa_ht=0; if (empty($this->pa_ht)) $this->pa_ht=0;
// if buy price not defined, define buyprice as configured in margin admin // if buy price not defined, define buyprice as configured in margin admin
@ -4076,7 +4077,7 @@ class FactureLigne extends CommonInvoiceLine
if (empty($this->special_code)) $this->special_code=0; if (empty($this->special_code)) $this->special_code=0;
if (empty($this->product_type)) $this->product_type=0; if (empty($this->product_type)) $this->product_type=0;
if (empty($this->fk_parent_line)) $this->fk_parent_line=0; if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
if (is_null($this->situation_percent)) $this->situation_percent=100; if (! isset($this->situation_percent) || $this->situation_percent > 100 || (string) $this->situation_percent == '') $this->situation_percent = 100;
if (empty($this->pa_ht)) $this->pa_ht=0; if (empty($this->pa_ht)) $this->pa_ht=0;
// Check parameters // Check parameters

View File

@ -48,7 +48,7 @@ if ($page == -1)
{ {
$page = 0 ; $page = 0 ;
} }
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$offset = $limit * $page ; $offset = $limit * $page ;
if ($sortorder == "") if ($sortorder == "")

View File

@ -77,7 +77,7 @@ if ($option == 'late') $filter = 'paye:0';
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');
if ($page == -1) { if ($page == -1) {
$page = 0; $page = 0;
@ -743,7 +743,7 @@ if ($resql)
print_liste_field_titre($langs->trans('Date'),$_SERVER['PHP_SELF'],'f.datef','',$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Date'),$_SERVER['PHP_SELF'],'f.datef','',$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateDue"),$_SERVER['PHP_SELF'],"f.date_lim_reglement",'',$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateDue"),$_SERVER['PHP_SELF'],"f.date_lim_reglement",'',$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('ThirdParty'),$_SERVER['PHP_SELF'],'s.nom','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('ThirdParty'),$_SERVER['PHP_SELF'],'s.nom','',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PaymentModeShort"),$_SERVER["PHP_SELF"],"f.fk_reglement_mode","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("PaymentModeShort"),$_SERVER["PHP_SELF"],"f.fk_mode_reglement","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans('AmountHT'),$_SERVER['PHP_SELF'],'f.total','',$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('AmountHT'),$_SERVER['PHP_SELF'],'f.total','',$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Taxes'),$_SERVER['PHP_SELF'],'f.tva','',$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Taxes'),$_SERVER['PHP_SELF'],'f.tva','',$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('AmountTTC'),$_SERVER['PHP_SELF'],'f.total_ttc','',$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('AmountTTC'),$_SERVER['PHP_SELF'],'f.total_ttc','',$param,'align="right"',$sortfield,$sortorder);
@ -866,7 +866,7 @@ if ($resql)
// Payment mode // Payment mode
print '<td>'; print '<td>';
$form->form_modes_reglement($_SERVER['PHP_SELF'], $objp->fk_mode_reglement, 'none'); $form->form_modes_reglement($_SERVER['PHP_SELF'], $objp->fk_mode_reglement, 'none', '', -1);
print '</td>'; print '</td>';
print '<td align="right">'.price($objp->total_ht,0,$langs).'</td>'; print '<td align="right">'.price($objp->total_ht,0,$langs).'</td>';

View File

@ -545,7 +545,7 @@ $pagenext = $page + 1;
if (! $sortfield) $sortfield="f.date_lim_reglement"; if (! $sortfield) $sortfield="f.date_lim_reglement";
if (! $sortorder) $sortorder="ASC"; if (! $sortorder) $sortorder="ASC";
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$sql = "SELECT s.nom as name, s.rowid as socid, s.email"; $sql = "SELECT s.nom as name, s.rowid as socid, s.email";
$sql.= ", f.rowid as facid, f.facnumber, f.ref_client, f.increment, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp"; $sql.= ", f.rowid as facid, f.facnumber, f.ref_client, f.increment, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp";
@ -605,7 +605,7 @@ if ($search_user > 0)
$sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='facture' AND tc.source='internal' AND ec.element_id = f.rowid AND ec.fk_socpeople = ".$search_user; $sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='facture' AND tc.source='internal' AND ec.element_id = f.rowid AND ec.fk_socpeople = ".$search_user;
} }
$sql.= " GROUP BY s.nom, s.rowid, s.email, f.rowid, f.facnumber, f.ref_client, f.increment, f.total, f.tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp,"; $sql.= " GROUP BY s.nom, s.rowid, s.email, f.rowid, f.facnumber, f.ref_client, f.increment, f.total, f.tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp,";
$sql.= " f.datef, f.date_lim_reglement, f.paye, f.fk_statut, f.type, fk_mode_reglement"; $sql.= " f.datef, f.date_lim_reglement, f.paye, f.fk_statut, f.type, f.fk_mode_reglement";
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user "; if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user ";
$sql.= " ORDER BY "; $sql.= " ORDER BY ";
$listfield=explode(',',$sortfield); $listfield=explode(',',$sortfield);
@ -807,7 +807,7 @@ if ($resql)
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"f.datef","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"f.datef","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"f.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"f.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PaymentMode"),$_SERVER["PHP_SELF"],"f.fk_reglement_mode","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("PaymentMode"),$_SERVER["PHP_SELF"],"f.fk_mode_reglement","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Taxes"),$_SERVER["PHP_SELF"],"f.tva","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Taxes"),$_SERVER["PHP_SELF"],"f.tva","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
@ -941,7 +941,7 @@ if ($resql)
// Payment mode // Payment mode
print '<td>'; print '<td>';
$form->form_modes_reglement($_SERVER['PHP_SELF'], $objp->fk_mode_reglement, 'none'); $form->form_modes_reglement($_SERVER['PHP_SELF'], $objp->fk_mode_reglement, 'none', '', -1);
print '</td>'; print '</td>';

View File

@ -673,7 +673,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
if (! GETPOST('action')) if (! GETPOST('action'))
{ {
if ($page == -1) $page = 0 ; if ($page == -1) $page = 0 ;
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$offset = $limit * $page ; $offset = $limit * $page ;
if (! $sortorder) $sortorder='DESC'; if (! $sortorder) $sortorder='DESC';

View File

@ -53,7 +53,7 @@ $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (! $sortorder) $sortorder="DESC"; if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="p.rowid"; if (! $sortfield) $sortfield="p.rowid";
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$sql = "SELECT p.rowid, p.datep as dp, p.amount, p.statut"; $sql = "SELECT p.rowid, p.datep as dp, p.amount, p.statut";
$sql.=", c.libelle as paiement_type, p.num_paiement"; $sql.=", c.libelle as paiement_type, p.num_paiement";

View File

@ -54,7 +54,7 @@ $page=GETPOST('page', 'int');
if (! $sortorder) $sortorder="ASC"; if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="b.dateo,b.rowid"; if (! $sortfield) $sortfield="b.dateo,b.rowid";
if ($page < 0) { $page = 0 ; } if ($page < 0) { $page = 0 ; }
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$offset = $limit * $page ; $offset = $limit * $page ;
$dir=$conf->banque->dir_output.'/bordereau/'; $dir=$conf->banque->dir_output.'/bordereau/';

View File

@ -43,7 +43,7 @@ $search_account = GETPOST('search_account','int');
$search_amount = GETPOST('search_amount','alpha'); $search_amount = GETPOST('search_amount','alpha');
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');
if ($page == -1) { $page = 0; } if ($page == -1) { $page = 0; }
$offset = $limit * $page; $offset = $limit * $page;

View File

@ -29,8 +29,8 @@
require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
/** \class Paiement /**
* \brief Classe permettant la gestion des paiements des factures clients * Class to manage payments of customer invoices
*/ */
class Paiement extends CommonObject class Paiement extends CommonObject
{ {
@ -78,7 +78,7 @@ class Paiement extends CommonObject
* @param int $id Id of payment to get * @param int $id Id of payment to get
* @param string $ref Ref of payment to get (currently ref = id but this may change in future) * @param string $ref Ref of payment to get (currently ref = id but this may change in future)
* @param int $fk_bank Id of bank line associated to payment * @param int $fk_bank Id of bank line associated to payment
* @return int <0 if KO, 0 if not found, >0 if OK * @return int <0 if KO, 0 if not found, >0 if OK
*/ */
function fetch($id, $ref='', $fk_bank='') function fetch($id, $ref='', $fk_bank='')
{ {
@ -96,14 +96,12 @@ class Paiement extends CommonObject
else if ($fk_bank) else if ($fk_bank)
$sql.= ' AND p.fk_bank = '.$fk_bank; $sql.= ' AND p.fk_bank = '.$fk_bank;
dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql = $this->db->query($sql);
$result = $this->db->query($sql); if ($resql)
if ($result)
{ {
if ($this->db->num_rows($result)) if ($this->db->num_rows($resql))
{ {
$obj = $this->db->fetch_object($result); $obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->ref = $obj->ref; $this->ref = $obj->ref;
$this->date = $this->db->jdate($obj->dp); $this->date = $this->db->jdate($obj->dp);
@ -120,12 +118,12 @@ class Paiement extends CommonObject
$this->fk_account = $obj->fk_account; $this->fk_account = $obj->fk_account;
$this->bank_line = $obj->fk_bank; $this->bank_line = $obj->fk_bank;
$this->db->free($result); $this->db->free($resql);
return 1; return 1;
} }
else else
{ {
$this->db->free($result); $this->db->free($resql);
return 0; return 0;
} }
} }

View File

@ -57,7 +57,7 @@ $search_amount=GETPOST("search_amount");
$search_company=GETPOST("search_company"); $search_company=GETPOST("search_company");
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');
if ($page == -1) { $page = 0; } if ($page == -1) { $page = 0; }
$offset = $limit * $page; $offset = $limit * $page;

View File

@ -46,7 +46,7 @@ if ($page == -1) { $page = 0; }
$offset = $conf->liste_limit * $page; $offset = $conf->liste_limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
if (! $sortfield) $sortfield="s.datep"; if (! $sortfield) $sortfield="s.datep";
if (! $sortorder) $sortorder="DESC"; if (! $sortorder) $sortorder="DESC";
$optioncss = GETPOST('optioncss','alpha'); $optioncss = GETPOST('optioncss','alpha');

View File

@ -46,7 +46,7 @@ if ($page == -1) { $page = 0; }
$offset = $conf->liste_limit * $page; $offset = $conf->liste_limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
if (! $sortfield) $sortfield="cs.date_ech"; if (! $sortfield) $sortfield="cs.date_ech";
if (! $sortorder) $sortorder="DESC"; if (! $sortorder) $sortorder="DESC";

View File

@ -49,7 +49,7 @@ if ($page == -1) { $page = 0; }
$offset = $conf->liste_limit * $page; $offset = $conf->liste_limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
if (! $sortfield) $sortfield="t.datev"; if (! $sortfield) $sortfield="t.datev";
if (! $sortorder) $sortorder="DESC"; if (! $sortorder) $sortorder="DESC";

View File

@ -45,7 +45,7 @@ llxHeader('','Ventilation');
*/ */
$page = $_GET["page"]; $page = $_GET["page"];
if ($page < 0) $page = 0; if ($page < 0) $page = 0;
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$offset = $limit * $page ; $offset = $limit * $page ;
$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ttc as price, l.rowid, l.fk_code_ventilation "; $sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ttc as price, l.rowid, l.fk_code_ventilation ";

View File

@ -47,7 +47,7 @@ llxHeader('','Ventilation');
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');
if ($page == -1) { $page = 0; } if ($page == -1) { $page = 0; }
$offset = $limit * $page; $offset = $limit * $page;

View File

@ -288,17 +288,16 @@ if (empty($reshook))
// Photo save // Photo save
$dir = $conf->societe->dir_output."/contact/".$object->id."/photos"; $dir = $conf->societe->dir_output."/contact/".$object->id."/photos";
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']); $file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
if (GETPOST('deletephoto') && $object->photo)
{
$fileimg=$dir.'/'.$object->photo;
$dirthumbs=$dir.'/thumbs';
dol_delete_file($fileimg);
dol_delete_dir_recursive($dirthumbs);
$object->photo = '';
}
if ($file_OK) if ($file_OK)
{ {
if (GETPOST('deletephoto'))
{
$fileimg=$dir.'/'.$object->photo;
$dirthumbs=$dir.'/thumbs';
dol_delete_file($fileimg);
dol_delete_dir_recursive($dirthumbs);
$object->photo = '';
}
if (image_format_supported($_FILES['photo']['name']) > 0) if (image_format_supported($_FILES['photo']['name']) > 0)
{ {
dol_mkdir($dir); dol_mkdir($dir);
@ -980,7 +979,7 @@ else
print "<br>\n"; print "<br>\n";
} }
print '<table class="nobordernopadding">'; print '<table class="nobordernopadding">';
if ($object->photo) print '<tr><td><input type="checkbox" class="flat" name="deletephoto" id="photodelete"> '.$langs->trans("Delete").'<br><br></td></tr>'; if ($object->photo) print '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> '.$langs->trans("Delete").'<br><br></td></tr>';
//print '<tr><td>'.$langs->trans("PhotoFile").'</td></tr>'; //print '<tr><td>'.$langs->trans("PhotoFile").'</td></tr>';
print '<tr><td><input type="file" class="flat" name="photo" id="photoinput"></td></tr>'; print '<tr><td><input type="file" class="flat" name="photo" id="photoinput"></td></tr>';
print '</table>'; print '</table>';

View File

@ -76,7 +76,7 @@ $begin=GETPOST('begin');
if (! $sortorder) $sortorder="ASC"; if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="p.lastname"; if (! $sortfield) $sortfield="p.lastname";
if ($page < 0) { $page = 0; } if ($page < 0) { $page = 0; }
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$offset = $limit * $page; $offset = $limit * $page;
$langs->load("companies"); $langs->load("companies");

View File

@ -40,7 +40,7 @@ $sortfield=GETPOST('sortfield','alpha');
$sortorder=GETPOST('sortorder','alpha'); $sortorder=GETPOST('sortorder','alpha');
$page=GETPOST('page','int'); $page=GETPOST('page','int');
if ($page == -1) { $page = 0 ; } if ($page == -1) { $page = 0 ; }
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$offset = $limit * $page ; $offset = $limit * $page ;
$search_name=GETPOST('search_name'); $search_name=GETPOST('search_name');

View File

@ -38,7 +38,7 @@ $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');
if ($page == -1) { $page = 0 ; } if ($page == -1) { $page = 0 ; }
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$offset = $limit * $page ; $offset = $limit * $page ;
if (! $sortfield) $sortfield="c.rowid"; if (! $sortfield) $sortfield="c.rowid";

View File

@ -1718,13 +1718,13 @@ class Form
foreach ($scrit as $crit) foreach ($scrit as $crit)
{ {
if ($i > 0) $sql.=" AND "; if ($i > 0) $sql.=" AND ";
$sql.="(p.ref LIKE '".$prefix.$crit."%' OR p.label LIKE '".$prefix.$crit."%'"; $sql.="(p.ref LIKE '".$db->escape($prefix.$crit)."%' OR p.label LIKE '".$db->escape($prefix.$crit)."%'";
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.=" OR pl.label LIKE '".$prefix.$crit."%'"; if (! empty($conf->global->MAIN_MULTILANGS)) $sql.=" OR pl.label LIKE '".$db->escape($prefix.$crit)."%'";
$sql.=")"; $sql.=")";
$i++; $i++;
} }
if (count($scrit) > 1) $sql.=")"; if (count($scrit) > 1) $sql.=")";
if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '".$prefix.$filterkey."%'"; if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '".$db->escape($prefix.$filterkey)."%'";
$sql.=')'; $sql.=')';
} }
$sql.= $db->order("p.ref"); $sql.= $db->order("p.ref");
@ -2087,7 +2087,7 @@ class Form
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pfp.fk_soc = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pfp.fk_soc = s.rowid";
$sql.= " WHERE p.entity IN (".getEntity('product', 1).")"; $sql.= " WHERE p.entity IN (".getEntity('product', 1).")";
$sql.= " AND p.tobuy = 1"; $sql.= " AND p.tobuy = 1";
if (strval($filtertype) != '') $sql.=" AND p.fk_product_type=".$filtertype; if (strval($filtertype) != '') $sql.=" AND p.fk_product_type=".$this->db->escape($filtertype);
if (! empty($filtre)) $sql.=" ".$filtre; if (! empty($filtre)) $sql.=" ".$filtre;
// Add criteria on ref/label // Add criteria on ref/label
if ($filterkey != '') if ($filterkey != '')
@ -2101,11 +2101,11 @@ class Form
foreach ($scrit as $crit) foreach ($scrit as $crit)
{ {
if ($i > 0) $sql.=" AND "; if ($i > 0) $sql.=" AND ";
$sql.="(pfp.ref_fourn LIKE '".$prefix.$crit."%' OR p.ref LIKE '".$prefix.$crit."%' OR p.label LIKE '".$prefix.$crit."%')"; $sql.="(pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%' OR p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%')";
$i++; $i++;
} }
if (count($scrit) > 1) $sql.=")"; if (count($scrit) > 1) $sql.=")";
if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '".$prefix.$filterkey."%'"; if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
$sql.=')'; $sql.=')';
} }
$sql.= " ORDER BY pfp.ref_fourn DESC, pfp.quantity ASC"; $sql.= " ORDER BY pfp.ref_fourn DESC, pfp.quantity ASC";
@ -2619,7 +2619,7 @@ class Form
/** /**
* Charge dans cache la liste des types de paiements possibles * Charge dans cache la liste des types de paiements possibles
* *
* @return int Nb of lines loaded, <0 if KO * @return int Nb of lines loaded, <0 if KO
*/ */
function load_cache_types_paiements() function load_cache_types_paiements()
{ {
@ -2632,9 +2632,9 @@ class Form
$this->cache_types_paiements = array(); $this->cache_types_paiements = array();
$sql = "SELECT id, code, libelle as label, type"; $sql = "SELECT id, code, libelle as label, type, active";
$sql.= " FROM ".MAIN_DB_PREFIX."c_paiement"; $sql.= " FROM ".MAIN_DB_PREFIX."c_paiement";
$sql.= " WHERE active > 0"; //if ($active >= 0) $sql.= " WHERE active = ".$active;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
@ -2651,6 +2651,7 @@ class Form
$this->cache_types_paiements[$obj->id]['code'] =$obj->code; $this->cache_types_paiements[$obj->id]['code'] =$obj->code;
$this->cache_types_paiements[$obj->id]['label']=$label; $this->cache_types_paiements[$obj->id]['label']=$label;
$this->cache_types_paiements[$obj->id]['type'] =$obj->type; $this->cache_types_paiements[$obj->id]['type'] =$obj->type;
$this->cache_types_paiements[$obj->id]['active'] =$obj->active;
$i++; $i++;
} }
@ -2708,14 +2709,15 @@ class Form
* *
* @param string $selected Id du mode de paiement pre-selectionne * @param string $selected Id du mode de paiement pre-selectionne
* @param string $htmlname Nom de la zone select * @param string $htmlname Nom de la zone select
* @param string $filtertype To filter on field type in llx_c_paiement (array('code'=>xx,'label'=>zz)) * @param string $filtertype To filter on field type in llx_c_paiement ('CRDT' or 'DBIT' or array('code'=>xx,'label'=>zz))
* @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code * @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code
* @param int $empty 1=peut etre vide, 0 sinon * @param int $empty 1=peut etre vide, 0 sinon
* @param int $noadmininfo 0=Add admin info, 1=Disable admin info * @param int $noadmininfo 0=Add admin info, 1=Disable admin info
* @param int $maxlength Max length of label * @param int $maxlength Max length of label
* @param int $active Active or not, -1 = all
* @return void * @return void
*/ */
function select_types_paiements($selected='', $htmlname='paiementtype', $filtertype='', $format=0, $empty=0, $noadmininfo=0, $maxlength=0) function select_types_paiements($selected='', $htmlname='paiementtype', $filtertype='', $format=0, $empty=0, $noadmininfo=0, $maxlength=0, $active=1)
{ {
global $langs,$user; global $langs,$user;
@ -2732,6 +2734,9 @@ class Form
if ($empty) print '<option value="">&nbsp;</option>'; if ($empty) print '<option value="">&nbsp;</option>';
foreach($this->cache_types_paiements as $id => $arraytypes) foreach($this->cache_types_paiements as $id => $arraytypes)
{ {
// If not good status
if ($active >= 0 && $arraytypes['active'] != $active) continue;
// On passe si on a demande de filtrer sur des modes de paiments particuliers // On passe si on a demande de filtrer sur des modes de paiments particuliers
if (count($filterarray) && ! in_array($arraytypes['type'],$filterarray)) continue; if (count($filterarray) && ! in_array($arraytypes['type'],$filterarray)) continue;
@ -3685,9 +3690,10 @@ class Form
* @param int $selected Id mode pre-selectionne * @param int $selected Id mode pre-selectionne
* @param string $htmlname Name of select html field * @param string $htmlname Name of select html field
* @param string $filtertype To filter on field type in llx_c_paiement (array('code'=>xx,'label'=>zz)) * @param string $filtertype To filter on field type in llx_c_paiement (array('code'=>xx,'label'=>zz))
* @param int $active Active or not, -1 = all
* @return void * @return void
*/ */
function form_modes_reglement($page, $selected='', $htmlname='mode_reglement_id', $filtertype='') function form_modes_reglement($page, $selected='', $htmlname='mode_reglement_id', $filtertype='', $active=1)
{ {
global $langs; global $langs;
if ($htmlname != "none") if ($htmlname != "none")
@ -3697,7 +3703,7 @@ class Form
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">'; print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
print '<tr><td>'; print '<tr><td>';
$this->select_types_paiements($selected,$htmlname,$filtertype); $this->select_types_paiements($selected,$htmlname,$filtertype,0,0,0,0,$active);
print '</td>'; print '</td>';
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>'; print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
print '</tr></table></form>'; print '</tr></table></form>';
@ -3707,7 +3713,6 @@ class Form
if ($selected) if ($selected)
{ {
$this->load_cache_types_paiements(); $this->load_cache_types_paiements();
print $this->cache_types_paiements[$selected]['label']; print $this->cache_types_paiements[$selected]['label'];
} else { } else {
print "&nbsp;"; print "&nbsp;";
@ -4909,7 +4914,7 @@ class Form
$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text
foreach($ways as $way) foreach($ways as $way)
{ {
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color?' style="background: #'.$c->color.';"':'').'>'.img_object('','category').' '.$way.'</li>'; $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color?' style="background: #'.$c->color.';"':' style="background: #aaa"').'>'.img_object('','category').' '.$way.'</li>';
} }
} }
return '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; return '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
@ -5323,7 +5328,7 @@ class Form
{ {
$ret.='</ul></div>'; $ret.='</ul></div>';
} }
$ret.='<div class="statusref">'.$morehtmlright.'</div>'; if ($morehtmlright) $ret.='<div class="statusref">'.$morehtmlright.'</div>';
$ret.='</div>'; $ret.='</div>';
return $ret; return $ret;
@ -5381,19 +5386,15 @@ class Form
$id = (! empty($object->id) ? $object->id : $object->rowid); $id = (! empty($object->id) ? $object->id : $object->rowid);
$ret='';$dir='';$file='';$originalfile='';$altfile='';$email=''; $ret='';$dir='';$file='';$originalfile='';$altfile='';$email='';
if ($modulepart=='societe') if ($modulepart=='societe')
{ {
$dir=$conf->societe->multidir_output[$entity]; $dir=$conf->societe->multidir_output[$entity];
$smallfile=$object->logo;
$smallfile=preg_replace('/(\.png|\.gif|\.jpg|\.jpeg|\.bmp)/i','_small\\1',$smallfile);
if (! empty($object->logo)) if (! empty($object->logo))
{ {
// TODO Introduce get_exdir if ((string) $imagesize == 'mini') $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
if ((string) $imagesize == 'mini') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_mini'); else if ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.getImageFileNameForSize($object->logo, '_small');
else if ((string) $imagesize == 'small') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_small'); else $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.$object->logo;
else $file=$id.'/logos/thumbs/'.$smallfile; $originalfile=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.$object->logo;
$originalfile=$id.'/logos/thumbs/'.$smallfile;
} }
} }
else if ($modulepart=='contact') else if ($modulepart=='contact')
@ -5401,11 +5402,10 @@ class Form
$dir=$conf->societe->multidir_output[$entity].'/contact'; $dir=$conf->societe->multidir_output[$entity].'/contact';
if (! empty($object->photo)) if (! empty($object->photo))
{ {
// TODO Introduce get_exdir if ((string) $imagesize == 'mini') $file=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.getImageFileNameForSize($object->photo, '_mini');
if ((string) $imagesize == 'mini') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_mini'); else if ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.getImageFileNameForSize($object->photo, '_small');
else if ((string) $imagesize == 'small') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_small'); else $file=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.$object->photo;
else $file=$id.'/photos/'.$object->photo; $originalfile=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.$object->photo;
$originalfile=$id.'/photos/'.$object->photo;
} }
} }
else if ($modulepart=='userphoto') else if ($modulepart=='userphoto')

View File

@ -55,6 +55,8 @@ class FormOrder
*/ */
function selectSupplierOrderStatus($selected='', $short=0, $hmlname='order_status') function selectSupplierOrderStatus($selected='', $short=0, $hmlname='order_status')
{ {
$tmpsupplierorder=new CommandeFournisseur($db);
print '<select class="flat" name="'.$hmlname.'">'; print '<select class="flat" name="'.$hmlname.'">';
print '<option value="-1">&nbsp;</option>'; print '<option value="-1">&nbsp;</option>';
$statustohow=array('0'=>'0','1'=>'1','2'=>'2','3'=>'3','4'=>'4','5'=>'5','6'=>'6,7','9'=>'9'); // 7 is same label than 6. 8 does not exists (billed is another field) $statustohow=array('0'=>'0','1'=>'1','2'=>'2','3'=>'3','4'=>'4','5'=>'5','6'=>'6,7','9'=>'9'); // 7 is same label than 6. 8 does not exists (billed is another field)
@ -62,7 +64,8 @@ class FormOrder
foreach($statustohow as $key => $value) foreach($statustohow as $key => $value)
{ {
print '<option value="'.$value.'"'.(($selected == $key || $selected == $value)?' selected':'').'>'; print '<option value="'.$value.'"'.(($selected == $key || $selected == $value)?' selected':'').'>';
print CommandeFournisseur::LibStatut($key,$short); $tmpsupplierorder->statut=$key;
print $tmpsupplierorder->getLibStatut($short);
print '</option>'; print '</option>';
} }
print '</select>'; print '</select>';

View File

@ -598,7 +598,7 @@ class FormOther
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$color = colorArrayToHex(colorStringToArray($color,array()),''); $color = colorArrayToHex(colorStringToArray($color,array()),'');
if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 40px; background-color: #'.$color.'" value="'.$color.'">'; if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
else print $textifnotdefined; else print $textifnotdefined;
} }

View File

@ -908,7 +908,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
} }
else else
{ {
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos).'</div>'; if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos).'</div>';
} }
if ($showbarcode) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showbarcode($object).'</div>'; if ($showbarcode) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showbarcode($object).'</div>';
if ($object->element == 'societe' && ! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { if ($object->element == 'societe' && ! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
@ -3961,9 +3961,12 @@ function get_exdir($num,$level,$alpha,$withoutslash,$object,$modulepart)
else else
{ {
// TODO // TODO
// We will introduce here a common way of forging path for document storage // We will enhance here a common way of forging path for document storage
// Here, object->id, object->ref and object->modulepart are required. // Here, object->id, object->ref and object->modulepart are required.
if (in_array($modulepart, array('thirdparty','contact')))
{
$path=$object->ref?$object->ref:$object->id;
}
} }
if (empty($withoutslash) && ! empty($path)) $path.='/'; if (empty($withoutslash) && ! empty($path)) $path.='/';

View File

@ -1008,17 +1008,16 @@ function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$w,$h,$al
{ {
foreach($linkedobjects as $linkedobject) foreach($linkedobjects as $linkedobject)
{ {
$reftoshow = $linkedobject["ref_title"].' : '.$linkedobject["ref_value"];
if (! empty($linkedobject["date_value"]))
{
$reftoshow .= ' / '.$linkedobject["date_value"];
}
$posy+=3; $posy+=3;
$pdf->SetXY($posx,$posy); $pdf->SetXY($posx,$posy);
$pdf->SetFont('','', $default_font_size - 2); $pdf->SetFont('','', $default_font_size - 2);
$pdf->MultiCell($w, $h, $linkedobject["ref_title"].' : '.$linkedobject["ref_value"], '', $align); $pdf->MultiCell($w, $h, $reftoshow, '', $align);
if (! empty($linkedobject["date_title"]) && ! empty($linkedobject["date_value"]))
{
$posy+=3;
$pdf->SetXY($posx,$posy);
$pdf->MultiCell($w, $h, $linkedobject["date_title"].' : '.$linkedobject["date_value"], '', $align);
}
} }
} }
@ -1826,10 +1825,11 @@ function pdf_getTotalQty($object,$type,$outputlangs)
/** /**
* Return linked objects * Return linked objects
* FIXME This function returns only one link per link type instead of all links. If we fix this, we must also fix function pdf_writeLinkedObjects
* *
* @param object $object Object * @param object $object Object
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @return array Linked objects * @return array Linked objects
*/ */
function pdf_getLinkedObjects($object,$outputlangs) function pdf_getLinkedObjects($object,$outputlangs)
{ {

View File

@ -98,6 +98,7 @@ function tree_showpad(&$fulltree,$key,$silent=0)
/** /**
* Recursive function to output menu tree. <ul id="iddivjstree"><li>...</li></ul> * Recursive function to output menu tree. <ul id="iddivjstree"><li>...</li></ul>
* It is also used for the tree of categories.
* Note: To have this function working, check you have loaded the js and css for treeview. * Note: To have this function working, check you have loaded the js and css for treeview.
* $arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', * $arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js',
* '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'); * '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
@ -132,7 +133,7 @@ function tree_recur($tab, $pere, $rang, $iddivjstree='iddivjstree')
print '<ul id="'.$iddivjstree.'">'; print '<ul id="'.$iddivjstree.'">';
} }
if ($rang > 10) return; // Protection contre boucle infinie if ($rang > 50) return; // Protect against infinite loop. Max 50 depth
//ballayage du tableau //ballayage du tableau
$sizeoftab=count($tab); $sizeoftab=count($tab);

View File

@ -410,7 +410,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
else else
{ {
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''); $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),'');
if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 40px; background-color: #'.$color.'" value="'.$color.'">'; if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
else print ''; else print '';
} }
if ($edit) print '<br>('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; if ($edit) print '<br>('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
@ -430,7 +430,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
else else
{ {
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKBODY,array()),''); $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKBODY,array()),'');
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 40px; background-color: #'.$color.'" value="'.$color.'">'; if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
else print $langs->trans("Default"); else print $langs->trans("Default");
} }
print ' &nbsp; ('.$langs->trans("Default").': <strong>ffffff</strong>, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; print ' &nbsp; ('.$langs->trans("Default").': <strong>ffffff</strong>, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
@ -455,7 +455,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
else else
{ {
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''); $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),'');
if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 40px; background-color: #'.$color.'" value="'.$color.'">'; if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
else print ''; else print '';
} }
if ($edit) print '<br>('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; if ($edit) print '<br>('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
@ -474,7 +474,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
else else
{ {
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''); $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),'');
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 40px; background-color: #'.$color.'" value="'.$color.'">'; if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
else print $langs->trans("Default"); else print $langs->trans("Default");
} }
print ' &nbsp; ('.$langs->trans("Default").': <strong>7882aa</strong>, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; print ' &nbsp; ('.$langs->trans("Default").': <strong>7882aa</strong>, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
@ -567,7 +567,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_HOVER,array()),''); else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_HOVER,array()),'');
if ($color) if ($color)
{ {
if ($color != 'edf4fb') print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 40px; background-color: #'.$color.'" value="'.$color.'">'; if ($color != 'edf4fb') print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
else print $langs->trans("Default"); else print $langs->trans("Default");
} }
else print $langs->trans("None"); else print $langs->trans("None");
@ -595,7 +595,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
else else
{ {
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''); $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),'');
if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 40px; background-color: #'.$color.'" value="'.$color.'">'; if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
else print ''; else print '';
} }
if ($edit) print '<br>('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; if ($edit) print '<br>('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
@ -614,7 +614,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
else else
{ {
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTLINK,array()),''); $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTLINK,array()),'');
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 40px; background-color: #'.$color.'" value="'.$color.'">'; if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
else print $langs->trans("Default"); else print $langs->trans("Default");
} }
print ' &nbsp; ('.$langs->trans("Default").': <strong>000078</strong>, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; print ' &nbsp; ('.$langs->trans("Default").': <strong>000078</strong>, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';

View File

@ -142,7 +142,7 @@ class modSupplierProposal extends DolibarrModules
$this->menu[$r]=array( $this->menu[$r]=array(
'fk_menu'=>'fk_mainmenu=commercial', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'fk_menu'=>'fk_mainmenu=commercial', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type'=>'left', // This is a Left menu entry 'type'=>'left', // This is a Left menu entry
'titre'=>'supplier_proposalMENU_LEFT_TITLE', 'titre'=>'SupplierProposalShort',
'leftmenu'=>'supplier_proposalsubmenu', 'leftmenu'=>'supplier_proposalsubmenu',
'url'=>'/supplier_proposal/index.php', 'url'=>'/supplier_proposal/index.php',
'langs'=>'supplier_proposal', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'supplier_proposal', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
@ -156,7 +156,7 @@ class modSupplierProposal extends DolibarrModules
$this->menu[$r]=array( $this->menu[$r]=array(
'fk_menu'=>'fk_mainmenu=commercial,fk_leftmenu=supplier_proposalsubmenu', 'fk_menu'=>'fk_mainmenu=commercial,fk_leftmenu=supplier_proposalsubmenu',
'type'=>'left', 'type'=>'left',
'titre'=>'supplier_proposalMENU_LEFT_TITLE_NEW', 'titre'=>'SupplierProposalNew',
'url'=>'/supplier_proposal/card.php?action=create', 'url'=>'/supplier_proposal/card.php?action=create',
'langs'=>'supplier_proposal', 'langs'=>'supplier_proposal',
'enabled'=>'$conf->supplier_proposal->enabled', 'enabled'=>'$conf->supplier_proposal->enabled',
@ -169,7 +169,7 @@ class modSupplierProposal extends DolibarrModules
$this->menu[$r]=array( $this->menu[$r]=array(
'fk_menu'=>'fk_mainmenu=commercial,fk_leftmenu=supplier_proposalsubmenu', 'fk_menu'=>'fk_mainmenu=commercial,fk_leftmenu=supplier_proposalsubmenu',
'type'=>'left', 'type'=>'left',
'titre'=>'supplier_proposalMENU_LEFT_TITLE_LIST', 'titre'=>'List',
'url'=>'/supplier_proposal/list.php', 'url'=>'/supplier_proposal/list.php',
'langs'=>'supplier_proposal', 'langs'=>'supplier_proposal',
'enabled'=>'$conf->supplier_proposal->enabled', 'enabled'=>'$conf->supplier_proposal->enabled',

View File

@ -28,7 +28,7 @@ if (GETPOST('dol_use_jmobile')) $conf->dol_use_jmobile=1;
// If we force to use jmobile, then we reenable javascript // If we force to use jmobile, then we reenable javascript
if (! empty($conf->dol_use_jmobile)) $conf->use_javascript_ajax=1; if (! empty($conf->dol_use_jmobile)) $conf->use_javascript_ajax=1;
print top_htmlhead('',$langs->trans('Login').' '.$title); print top_htmlhead('',$langs->trans('SendNewPassword'));
?> ?>
<!-- BEGIN PHP TEMPLATE PASSWORDFORGOTTEN.TPL.PHP --> <!-- BEGIN PHP TEMPLATE PASSWORDFORGOTTEN.TPL.PHP -->
@ -48,7 +48,7 @@ $(document).ready(function () {
<div class="login_vertical_align"> <div class="login_vertical_align">
<form id="login" name="login" method="post" action="<?php echo $php_self; ?>"> <form id="login" name="login" method="POST" action="<?php echo $php_self; ?>">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>"> <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">
<input type="hidden" name="action" value="buildnewpassword"> <input type="hidden" name="action" value="buildnewpassword">
@ -77,7 +77,7 @@ $(document).ready(function () {
<tr> <tr>
<td valign="bottom" class="nowrap center"> <td valign="bottom" class="nowrap center">
<span class="span-icon-user"> <span class="span-icon-user">
<input type="text" placeholder="<?php echo $langs->trans("Login"); ?>" <?php echo $disabled; ?> id="username" name="username" class="flat input-icon-user" size="20" value="<?php echo dol_escape_htmltag($login); ?>" tabindex="1" /> <input type="text" placeholder="<?php echo $langs->trans("Login"); ?>" <?php echo $disabled; ?> id="username" name="username" class="flat input-icon-user" size="20" value="<?php echo dol_escape_htmltag($username); ?>" tabindex="1" />
</span> </span>
</td> </td>
</tr> </tr>

View File

@ -34,7 +34,7 @@ $langs->load("donations");
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
if ($page == -1) { $page = 0; } if ($page == -1) { $page = 0; }
$offset = $limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;

View File

@ -49,6 +49,7 @@ $endyear=$year;
$langs->load("sendings"); $langs->load("sendings");
$langs->load("other"); $langs->load("other");
$langs->load("companies");
/* /*

View File

@ -43,7 +43,7 @@ $optioncss = GETPOST('optioncss','alpha');
$sortfield = GETPOST('sortfield','alpha'); $sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha'); $sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int'); $page = GETPOST('page','int');
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
if ($page == -1) { $page = 0; } if ($page == -1) { $page = 0; }
$offset = $limit * $page; $offset = $limit * $page;

View File

@ -48,6 +48,7 @@ $endyear=$year;
$langs->load("sendings"); $langs->load("sendings");
$langs->load("other"); $langs->load("other");
$langs->load("companies");
/* /*

View File

@ -48,7 +48,7 @@ $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (! $sortorder) $sortorder="DESC"; if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="d.date_create"; if (! $sortfield) $sortfield="d.date_create";
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
/* /*

View File

@ -93,7 +93,7 @@ $sortfield = GETPOST("sortfield");
$page = GETPOST("page"); $page = GETPOST("page");
if (!$sortorder) $sortorder="DESC"; if (!$sortorder) $sortorder="DESC";
if (!$sortfield) $sortfield="d.date_debut"; if (!$sortfield) $sortfield="d.date_debut";
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
if ($page == -1) { if ($page == -1) {
$page = 0 ; $page = 0 ;
@ -211,7 +211,6 @@ if ($resql)
if ($sall) if ($sall)
{ {
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall));
} }
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';

View File

@ -28,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereportstats.class.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereportstats.class.php';
$langs->load("trips"); $langs->load("trips");
$langs->load("companies");
$WIDTH=DolGraph::getDefaultGraphSizeForStats('width'); $WIDTH=DolGraph::getDefaultGraphSizeForStats('width');
$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height'); $HEIGHT=DolGraph::getDefaultGraphSizeForStats('height');

View File

@ -44,7 +44,7 @@ $result = restrictedArea($user, 'ficheinter', $fichinterid,'fichinter');
$sortfield = GETPOST('sortfield','alpha'); $sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha'); $sortorder = GETPOST('sortorder','alpha');
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$page = GETPOST('page','int'); $page = GETPOST('page','int');
if ($page == -1) { $page = 0; } if ($page == -1) { $page = 0; }
$offset = $limit * $page; $offset = $limit * $page;
@ -152,7 +152,7 @@ if ($result)
if ($sall) if ($sall)
{ {
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall)); print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
} }
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';

View File

@ -498,7 +498,7 @@ class CommandeFournisseur extends CommonOrder
*/ */
function getLibStatut($mode=0) function getLibStatut($mode=0)
{ {
return $this->LibStatut($this->statut,$mode); return $this->LibStatut($this->statut,$mode,$this->billed);
} }
/** /**
@ -506,16 +506,17 @@ class CommandeFournisseur extends CommonOrder
* *
* @param int $statut Id statut * @param int $statut Id statut
* @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto * @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto
* @param int $billed 1=Billed
* @return string Label of status * @return string Label of status
*/ */
function LibStatut($statut,$mode=0) function LibStatut($statut,$mode=0,$billed=0)
{ {
global $langs; global $langs;
$langs->load('orders'); $langs->load('orders');
$billedtext=''; $billedtext='';
//if ($statut==5 && $this->billed == 1) $statut = 8; //if ($statut==5 && $this->billed == 1) $statut = 8;
if ($this->billed == 1) $billedtext=$langs->trans("Billed"); if ($billed == 1) $billedtext=$langs->trans("Billed");
// List of language codes for status // List of language codes for status
$statutshort[0] = 'StatusOrderDraftShort'; $statutshort[0] = 'StatusOrderDraftShort';

View File

@ -65,18 +65,28 @@ class PaiementFourn extends Paiement
/** /**
* Load payment object * Load payment object
* *
* @param int $id Id if payment to get * @param int $id Id if payment to get
* @return int <0 if ko, >0 if ok * @param string $ref Ref of payment to get (currently ref = id but this may change in future)
* @param int $fk_bank Id of bank line associated to payment
* @return int <0 if KO, -2 if not found, >0 if OK
*/ */
function fetch($id) function fetch($id, $ref='', $fk_bank='')
{ {
$error=0;
$sql = 'SELECT p.rowid, p.datep as dp, p.amount, p.statut, p.fk_bank,'; $sql = 'SELECT p.rowid, p.datep as dp, p.amount, p.statut, p.fk_bank,';
$sql.= ' c.code as paiement_code, c.libelle as paiement_type,'; $sql.= ' c.code as paiement_code, c.libelle as paiement_type,';
$sql.= ' p.num_paiement, p.note, b.fk_account'; $sql.= ' p.num_paiement, p.note, b.fk_account';
$sql.= ' FROM '.MAIN_DB_PREFIX.'c_paiement as c, '.MAIN_DB_PREFIX.'paiementfourn as p'; $sql.= ' FROM '.MAIN_DB_PREFIX.'c_paiement as c, '.MAIN_DB_PREFIX.'paiementfourn as p';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid '; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid ';
$sql.= ' WHERE p.fk_paiement = c.id'; $sql.= ' WHERE p.fk_paiement = c.id';
$sql.= ' AND p.rowid = '.$id; if ($id > 0)
$sql.= ' AND p.rowid = '.$id;
else if ($ref)
$sql.= ' AND p.rowid = '.$ref;
else if ($fk_bank)
$sql.= ' AND p.fk_bank = '.$fk_bank;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
@ -99,7 +109,7 @@ class PaiementFourn extends Paiement
} }
else else
{ {
$error = -2; $error = -2; // TODO Use 0 instead
} }
$this->db->free($resql); $this->db->free($resql);
} }

View File

@ -50,7 +50,7 @@ $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (! $sortorder) $sortorder="ASC"; if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="p.name"; if (! $sortfield) $sortfield="p.name";
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
/* /*

View File

@ -61,7 +61,7 @@ $sortorder = GETPOST("sortorder",'alpha');
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
if ($page == -1) { $page = 0 ; } if ($page == -1) { $page = 0 ; }
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$offset = $limit * $page ; $offset = $limit * $page ;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;

View File

@ -53,7 +53,7 @@ if ($page == -1) { $page = 0; }
$offset = $conf->liste_limit * $page; $offset = $conf->liste_limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
if (! $sortorder) $sortorder="DESC"; if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="p.rowid"; if (! $sortfield) $sortfield="p.rowid";
$optioncss = GETPOST('optioncss','alpha'); $optioncss = GETPOST('optioncss','alpha');
@ -454,7 +454,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
if (empty($action)) if (empty($action))
{ {
if ($page == -1) $page = 0 ; if ($page == -1) $page = 0 ;
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$offset = $limit * $page ; $offset = $limit * $page ;
if (! $sortorder) $sortorder='DESC'; if (! $sortorder) $sortorder='DESC';

View File

@ -49,7 +49,7 @@ if ($page < 0) {
$page = 0 ; $page = 0 ;
} }
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$offset = $limit * $page ; $offset = $limit * $page ;
if (! $sortfield) $sortfield = 'p.ref'; if (! $sortfield) $sortfield = 'p.ref';

View File

@ -61,7 +61,7 @@ if ($page == -1) {
$offset = $conf->liste_limit * $page; $offset = $conf->liste_limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$form = new Form($db); $form = new Form($db);
$establishmenttmp=new Establishment($db); $establishmenttmp=new Establishment($db);

View File

@ -236,7 +236,7 @@ if (!defined('QRCODEDEFS')) {
/** /**
* if false, checks all masks available, otherwise value tells count of masks need to be checked, mask id are got randomly * if false, checks all masks available, otherwise value tells count of masks need to be checked, mask id are got randomly
*/ */
define('QR_FIND_FROM_RANDOM', 2); define('QR_FIND_FROM_RANDOM', false);
/** /**
* when QR_FIND_BEST_MASK === false * when QR_FIND_BEST_MASK === false
@ -730,7 +730,7 @@ class QRcode {
$this->eccLength = $this->rsEccLength($spec); $this->eccLength = $this->rsEccLength($spec);
$this->ecccode = array_fill(0, $this->eccLength, 0); $this->ecccode = array_fill(0, $this->eccLength, 0);
$this->blocks = $this->rsBlockNum($spec); $this->blocks = $this->rsBlockNum($spec);
$ret = $this->init($spec); $ret = $this->init($spec);
if ($ret < 0) { if ($ret < 0) {
return NULL; return NULL;
} }

View File

@ -312,3 +312,4 @@ IncludingProductWithTag=Including product/service with tag
DefaultPriceRealPriceMayDependOnCustomer=Default price, real price may depend on customer DefaultPriceRealPriceMayDependOnCustomer=Default price, real price may depend on customer
WarningSelectOneDocument=Please select at least one document WarningSelectOneDocument=Please select at least one document
DefaultUnitToShow=Units DefaultUnitToShow=Units
NbOfQtyInProposals=Qty in proposals

View File

@ -1,9 +1,8 @@
# Dolibarr language file - Source file is en_US - supplier_proposal # Dolibarr language file - Source file is en_US - supplier_proposal
SupplierProposal=Supplier commercial proposals SupplierProposal=Supplier commercial proposals
supplier_proposalDESC=Manage price requests to suppliers supplier_proposalDESC=Manage price requests to suppliers
supplier_proposalMENU_LEFT_TITLE=Supplier proposals SupplierProposalShort=Supplier proposals
supplier_proposalMENU_LEFT_TITLE_NEW=New request SupplierProposalNew=New request
supplier_proposalMENU_LEFT_TITLE_LIST=List
CommRequest=Price request CommRequest=Price request
CommRequests=Price requests CommRequests=Price requests
SearchRequest=Find a request SearchRequest=Find a request

View File

@ -23,7 +23,7 @@ MenuToDoActions=Eventos incompletos
MenuDoneActions=Eventos terminados MenuDoneActions=Eventos terminados
MenuToDoMyActions=Mis eventos incompletos MenuToDoMyActions=Mis eventos incompletos
MenuDoneMyActions=Mis eventos terminados MenuDoneMyActions=Mis eventos terminados
ListOfEvents=lista de acontecimientos (calendario interno) ListOfEvents=Lista de acontecimientos (calendario interno)
ActionsAskedBy=Eventos registrados por ActionsAskedBy=Eventos registrados por
ActionsToDoBy=Eventos asignados a ActionsToDoBy=Eventos asignados a
ActionsDoneBy=Eventos realizados por ActionsDoneBy=Eventos realizados por
@ -90,8 +90,8 @@ ExtSiteUrlAgenda=Url de acceso al archivo .ical
ExtSiteNoLabel=Sin descripción ExtSiteNoLabel=Sin descripción
WorkingTimeRange=Rango temporal WorkingTimeRange=Rango temporal
WorkingDaysRange=Rango diario WorkingDaysRange=Rango diario
VisibleTimeRange=Visible time range VisibleTimeRange=Rango de tiempo visible
VisibleDaysRange=Visible days range VisibleDaysRange=Rango de días visibles
AddEvent=Crear evento AddEvent=Crear evento
MyAvailability=Mi disponibilidad MyAvailability=Mi disponibilidad
ActionType=Tipo de evento ActionType=Tipo de evento

View File

@ -10,5 +10,5 @@ FailedToConnectToFTPServerWithCredentials=No se pudo conectar con el login/contr
FTPFailedToRemoveFile=No se pudo eliminar el archivo <b>%s</b>. FTPFailedToRemoveFile=No se pudo eliminar el archivo <b>%s</b>.
FTPFailedToRemoveDir=No se pudo eliminar el directorio <b>%s</b> (Compruebe los permisos y que el directorio está vacío). FTPFailedToRemoveDir=No se pudo eliminar el directorio <b>%s</b> (Compruebe los permisos y que el directorio está vacío).
FTPPassiveMode=Modo pasivo FTPPassiveMode=Modo pasivo
ChooseAFTPEntryIntoMenu=Choose a FTP entry into menu... ChooseAFTPEntryIntoMenu=Elija una entrada de FTP en el menú ...
FailedToGetFile=Failed to get files %s FailedToGetFile=No se pudieron obtener los archivos %s

View File

@ -1,7 +1,7 @@
Module210009Name=Incoterm Module62000Name=Incoterm
Module210009Desc=Add features to manage Incoterm Module62000Desc=Añade funciones para gestionar Incoterm
IncotermLabel=Incoterms IncotermLabel=Incoterms
IncotermSetupTitle1=Feature IncotermSetupTitle1=Función
IncotermSetupTitle2=Status IncotermSetupTitle2=Estado
IncotermSetup=Setup of module Incoterm IncotermSetup=Configuración del módulo Incoterm
IncotermFunctionDesc=Activate Incoterm feature (Thirdparty, Proposal, Customer Order, Customer Invoice, Shipment, Supplier order) IncotermFunctionDesc=Activa funcionalidades Incoterm (Tercero, Presupuesto, Pedido, Factura a cliente, Envío, Pedido a proveedor)

View File

@ -35,7 +35,7 @@ Language_es_PR=Español (Puerto Rico)
Language_et_EE=Estonio Language_et_EE=Estonio
Language_eu_ES=Vasco Language_eu_ES=Vasco
Language_fa_IR=Persa Language_fa_IR=Persa
Language_fi_FI=Finnish Language_fi_FI=Finés
Language_fr_BE=Francés (Bélgica) Language_fr_BE=Francés (Bélgica)
Language_fr_CA=Francés (Canadá) Language_fr_CA=Francés (Canadá)
Language_fr_CH=Francés (Suiza) Language_fr_CH=Francés (Suiza)

View File

@ -6,4 +6,4 @@ ErrorFileNotLinked=El archivo no ha podido ser vinculado
LinkRemoved=El vínculo %s ha sido eliminado LinkRemoved=El vínculo %s ha sido eliminado
ErrorFailedToDeleteLink= Error al eliminar el vínculo '<b>%s</b>' ErrorFailedToDeleteLink= Error al eliminar el vínculo '<b>%s</b>'
ErrorFailedToUpdateLink= Error al actualizar el vínculo '<b>%s</b>' ErrorFailedToUpdateLink= Error al actualizar el vínculo '<b>%s</b>'
URLToLink=URL to link URLToLink=URL a enlazar

View File

@ -19,4 +19,4 @@ printQty=Cant.: %d
AddDispatchBatchLine=Añada una línea para despacho por caducidad AddDispatchBatchLine=Añada una línea para despacho por caducidad
BatchDefaultNumber=Indefinido BatchDefaultNumber=Indefinido
WhenProductBatchModuleOnOptionAreForced=Si el módulo de Lotes/Series está activado, el incremento/decremento de stock es forzado a lo último escogido y no puede editarse. Otras opciones pueden definirse si se necesita WhenProductBatchModuleOnOptionAreForced=Si el módulo de Lotes/Series está activado, el incremento/decremento de stock es forzado a lo último escogido y no puede editarse. Otras opciones pueden definirse si se necesita
ProductDoesNotUseBatchSerial=Este producto no usa numeración por lotes/series ProductDoesNotUseBatchSerial=Este producto no usa lotes/series

View File

@ -3,6 +3,7 @@ Suppliers=Proveedores
AddSupplier=Crear un proveedor AddSupplier=Crear un proveedor
SupplierRemoved=Proveedor eliminado SupplierRemoved=Proveedor eliminado
SuppliersInvoice=Factura proveedor SuppliersInvoice=Factura proveedor
ShowSupplierInvoice=Ver factura de proveedor
NewSupplier=Nuevo proveedor NewSupplier=Nuevo proveedor
History=Histórico History=Histórico
ListOfSuppliers=Listado de proveedores ListOfSuppliers=Listado de proveedores

View File

@ -3,9 +3,9 @@ WorkflowSetup=Configuración del módulo Flujo de trabajo
WorkflowDesc=Este módulo está diseñado para modificar el comportamiento de acciones automáticas en la aplicación. Por defecto, el flujo de trabajo está abierto (se pueden hacer cosas en el orden que se desee). Puede activar las acciones automáticas que le interesen. WorkflowDesc=Este módulo está diseñado para modificar el comportamiento de acciones automáticas en la aplicación. Por defecto, el flujo de trabajo está abierto (se pueden hacer cosas en el orden que se desee). Puede activar las acciones automáticas que le interesen.
ThereIsNoWorkflowToModify=No hay disponibles modificaciones de flujo de trabajo de los módulos activados. ThereIsNoWorkflowToModify=No hay disponibles modificaciones de flujo de trabajo de los módulos activados.
descWORKFLOW_PROPAL_AUTOCREATE_ORDER=Crear un pedido de cliente automáticamente a la firma de un presupuesto descWORKFLOW_PROPAL_AUTOCREATE_ORDER=Crear un pedido de cliente automáticamente a la firma de un presupuesto
descWORKFLOW_PROPAL_AUTOCREATE_INVOICEAutomatically Crear una factura a cliente automáticamente a la firma de un presupuesto descWORKFLOW_PROPAL_AUTOCREATE_INVOICE=Crear una factura a cliente automáticamente a la firma de un presupuesto
descWORKFLOW_CONTRACT_AUTOCREATE_INVOICEAutomatically Crear una factura a cliente automáticamente a la validación de un contrato descWORKFLOW_CONTRACT_AUTOCREATE_INVOICE=Crear una factura a cliente automáticamente al validar un contrato
descWORKFLOW_ORDER_AUTOCREATE_INVOICEAutomatically Crear una factura a cliente automáticamente al cierre de un pedido de cliente descWORKFLOW_ORDER_AUTOCREATE_INVOICE=Crear una factura a cliente automáticamente después de cerrar una orden
descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Clasificar como facturado el presupuesto cuando el pedido de cliente relacionado se clasifique como pagado descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Clasificar como facturado el presupuesto cuando el pedido de cliente relacionado se clasifique como pagado
descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Clasificar como facturados los pedidos cuando la factura relacionada se clasifique como pagada descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Clasificar como facturados los pedidos cuando la factura relacionada se clasifique como pagada
descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER=Clasificar como facturados los pedidos de cliente relacionados cuando la factura sea validada descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER=Clasificar como facturados los pedidos de cliente relacionados cuando la factura sea validada

View File

@ -1,5 +1,3 @@
# Dolibarr language file - Source file is en_US - incoterm # Dolibarr language file - Source file is en_US - incoterm
IncotermSetupTitle1=Función
IncotermSetupTitle2=Estado
IncotermSetup=Configuración del módulo de Incoterm IncotermSetup=Configuración del módulo de Incoterm
IncotermFunctionDesc=Activar función Incoterm (thirdparty, Propuesta, pedido del cliente, la factura del cliente, envío, orden Proveedor) IncotermFunctionDesc=Activar función Incoterm (thirdparty, Propuesta, pedido del cliente, la factura del cliente, envío, orden Proveedor)

View File

@ -24,7 +24,6 @@ TripSalarie=Informações do usuário
TripNDF=Informações relatório de despesas TripNDF=Informações relatório de despesas
PDFStandardExpenseReports=Template padrão para gerar um documento PDF para relatório de despesa PDFStandardExpenseReports=Template padrão para gerar um documento PDF para relatório de despesa
ExpenseReportLine=Linha de relatório de despesas ExpenseReportLine=Linha de relatório de despesas
TF_TRANSPORTATION=Transporte
TF_TRAIN=Trem TF_TRAIN=Trem
TF_BUS=Onibus TF_BUS=Onibus
TF_PEAGE=Pedágio TF_PEAGE=Pedágio

View File

@ -4,7 +4,7 @@ DIRECTION=ltr
# msungstdlight or cid0ct are for traditional Chinese (traditional does not render with Ubuntu pdf reader) # msungstdlight or cid0ct are for traditional Chinese (traditional does not render with Ubuntu pdf reader)
# stsongstdlight or cid0cs are for simplified Chinese # stsongstdlight or cid0cs are for simplified Chinese
# To read Chinese pdf with Linux: sudo apt-get install poppler-data # To read Chinese pdf with Linux: sudo apt-get install poppler-data
FONTFORPDF=helvetica FONTFORPDF=DejaVuSans
FONTSIZEFORPDF=10 FONTSIZEFORPDF=10
SeparatorDecimal=. SeparatorDecimal=.
SeparatorThousand=, SeparatorThousand=,

View File

@ -45,7 +45,7 @@ $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (! $sortfield) $sortfield="l.rowid"; if (! $sortfield) $sortfield="l.rowid";
if (! $sortorder) $sortorder="DESC"; if (! $sortorder) $sortorder="DESC";
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$search_ref=GETPOST('search_ref','int'); $search_ref=GETPOST('search_ref','int');
$search_label=GETPOST('search_label','alpha'); $search_label=GETPOST('search_label','alpha');

View File

@ -38,7 +38,7 @@ $status=GETPOST('status');
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');
if ($page == -1) { $page = 0; } if ($page == -1) { $page = 0; }
$offset = $limit * $page; $offset = $limit * $page;

View File

@ -169,7 +169,8 @@ if (! empty($action) && $action == 'fetch' && ! empty($id))
$match = preg_grep('/(' . $htmlname . '[0-9]+)/', array_keys($_GET)); $match = preg_grep('/(' . $htmlname . '[0-9]+)/', array_keys($_GET));
sort($match); sort($match);
$idprod = (! empty($match [0]) ? $match [0] : '');
$idprod = (! empty($match[0]) ? $match[0] : '');
if (! GETPOST($htmlname) && ! GETPOST($idprod)) if (! GETPOST($htmlname) && ! GETPOST($idprod))
return; return;

View File

@ -1315,7 +1315,7 @@ else
$picto=($object->type== Product::TYPE_SERVICE?'service':'product'); $picto=($object->type== Product::TYPE_SERVICE?'service':'product');
dol_fiche_head($head, 'card', $titre, 0, $picto); dol_fiche_head($head, 'card', $titre, 0, $picto);
dol_banner_tab($object, 'id', '', ($user->societe_id?0:1), 'ref'); dol_banner_tab($object, 'ref', '', ($user->societe_id?0:1), 'ref');
print '<div class="fichecenter">'; print '<div class="fichecenter">';

View File

@ -3119,7 +3119,7 @@ class Product extends CommonObject
global $conf, $langs; global $conf, $langs;
$langs->load('products'); $langs->load('products');
if (!empty($conf->productbatch->enabled)) $langs->load("productbatch"); if (! empty($conf->productbatch->enabled)) $langs->load("productbatch");
if ($type == 2) if ($type == 2)
{ {

View File

@ -110,9 +110,12 @@ $h++;
dol_fiche_head($head,'popularityprop',$langs->trans("Statistics")); dol_fiche_head($head,'popularityprop',$langs->trans("Statistics"));
// Array of liens to show
$infoprod=array();
$sql = "SELECT p.rowid, p.label, p.ref, p.fk_product_type as type, count(*) as c"; // Add lines for proposals
$sql = "SELECT p.rowid, p.label, p.ref, p.fk_product_type as type, SUM(pd.qty) as c";
$sql.= " FROM ".MAIN_DB_PREFIX."propaldet as pd"; $sql.= " FROM ".MAIN_DB_PREFIX."propaldet as pd";
$sql.= ", ".MAIN_DB_PREFIX."product as p"; $sql.= ", ".MAIN_DB_PREFIX."product as p";
$sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')'; $sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')';
@ -120,7 +123,7 @@ $sql.= " AND p.rowid = pd.fk_product";
if ($type !== '') { if ($type !== '') {
$sql.= " AND fk_product_type = ".$type; $sql.= " AND fk_product_type = ".$type;
} }
$sql.= " GROUP BY (p.rowid)"; $sql.= " GROUP BY p.rowid, p.label, p.ref, p.fk_product_type";
$result=$db->query($sql); $result=$db->query($sql);
if ($result) if ($result)
@ -131,68 +134,82 @@ if ($result)
$sql.= $db->order($sortfield,$sortorder); $sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit+1, $offset); $sql.= $db->plimit($limit+1, $offset);
$result=$db->query($sql); $resql=$db->query($sql);
if ($result) if ($resql)
{ {
$num = $db->num_rows($result); $num = $db->num_rows($resql);
$i = 0; $i = 0;
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $totalnboflines, ''); $var=True;
while ($i < $num)
{
$objp = $db->fetch_object($resql);
print '<table class="noborder" width="100%">'; $infoprod[$objp->rowid]=array('type'=>$objp->type, 'ref'=>$objp->ref, 'label'=>$objp->label);
$infoprod[$objp->rowid]['nblineproposal']=$objp->c;
print "<tr class=\"liste_titre\">"; $i++;
print_liste_field_titre($langs->trans('Ref'), $_SERVER["PHP_SELF"], 'p.ref', '', $param, '', $sortfield, $sortorder); }
print_liste_field_titre($langs->trans('Type'), $_SERVER["PHP_SELF"], 'p.fk_product_type', '', $param, '', $sortfield, $sortorder); $db->free($resql);
print_liste_field_titre($langs->trans('Label'), $_SERVER["PHP_SELF"], 'p.label', '', $param, '', $sortfield, $sortorder); }
print_liste_field_titre($langs->trans('NbOfProposals'), $_SERVER["PHP_SELF"], 'c', '', $param, 'align="right"', $sortfield, $sortorder); else
print "</tr>\n"; {
dol_print_error($db);
}
//var_dump($infoprod);
$var=True; print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $totalnboflines, '');
while ($i < $num)
print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">";
print_liste_field_titre($langs->trans('Ref'), $_SERVER["PHP_SELF"], 'p.ref', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre($langs->trans('Type'), $_SERVER["PHP_SELF"], 'p.fk_product_type', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre($langs->trans('Label'), $_SERVER["PHP_SELF"], 'p.label', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre($langs->trans('NbOfQtyInProposals'), $_SERVER["PHP_SELF"], 'c', '', $param, 'align="right"', $sortfield, $sortorder);
print "</tr>\n";
$var=True;
foreach($infoprod as $prodid => $vals)
{
// Multilangs
if (! empty($conf->global->MAIN_MULTILANGS)) // si l'option est active
{ {
$objp = $db->fetch_object($result); $sql = "SELECT label";
$sql.= " FROM ".MAIN_DB_PREFIX."product_lang";
$sql.= " WHERE fk_product=".$prodid;
$sql.= " AND lang='". $langs->getDefaultLang() ."'";
$sql.= " LIMIT 1";
// Multilangs $resultp = $db->query($sql);
if (! empty($conf->global->MAIN_MULTILANGS)) // si l'option est active if ($resultp)
{ {
$sql = "SELECT label"; $objtp = $db->fetch_object($resultp);
$sql.= " FROM ".MAIN_DB_PREFIX."product_lang"; if (! empty($objtp->label)) $vals['label'] = $objtp->label;
$sql.= " WHERE fk_product=".$objp->rowid;
$sql.= " AND lang='". $langs->getDefaultLang() ."'";
$sql.= " LIMIT 1";
$resultp = $db->query($sql);
if ($resultp)
{
$objtp = $db->fetch_object($resultp);
if (! empty($objtp->label)) $objp->label = $objtp->label;
}
} }
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td><a href="'.DOL_URL_ROOT.'/product/stats/card.php?id='.$objp->rowid.'">';
if ($objp->type==1) print img_object($langs->trans("ShowService"),"service");
else print img_object($langs->trans("ShowProduct"),"product");
print " ";
print $objp->ref.'</a></td>';
print '<td>';
if ($objp->type==1) print $langs->trans("Service");
else print $langs->trans("Product");
print '</td>';
print '<td>'.$objp->label.'</td>';
print '<td align="right">'.$objp->c.'</td>';
print "</tr>\n";
$i++;
} }
$db->free(); $var=!$var;
print "<tr ".$bc[$var].">";
print "</table>"; print '<td><a href="'.DOL_URL_ROOT.'/product/stats/card.php?id='.$prodid.'">';
if ($vals['type'] == 1) print img_object($langs->trans("ShowService"),"service");
else print img_object($langs->trans("ShowProduct"),"product");
print " ";
print $vals['ref'].'</a></td>';
print '<td>';
if ($vals['type'] == 1) print $langs->trans("Service");
else print $langs->trans("Product");
print '</td>';
print '<td>'.$vals['label'].'</td>';
print '<td align="right">'.$vals['nblineproposal'].'</td>';
print "</tr>\n";
$i++;
} }
print "</table>";
dol_fiche_end(); dol_fiche_end();

View File

@ -53,6 +53,8 @@ $action = GETPOST('action', 'alpha');
$cancel = GETPOST('cancel', 'alpha'); $cancel = GETPOST('cancel', 'alpha');
$eid = GETPOST('eid', 'int'); $eid = GETPOST('eid', 'int');
$search_soc = GETPOST('search_soc');
// Security check // Security check
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : '')); $fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
$fieldtype = (! empty($ref) ? 'ref' : 'rowid'); $fieldtype = (! empty($ref) ? 'ref' : 'rowid');
@ -84,6 +86,11 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
if (empty($reshook)) if (empty($reshook))
{ {
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
{
$search_soc = '';
}
if (($action == 'update_vat') && !$cancel && ($user->rights->produit->creer || $user->rights->service->creer)) if (($action == 'update_vat') && !$cancel && ($user->rights->produit->creer || $user->rights->service->creer))
{ {
$object->tva_tx = GETPOST('tva_tx'); $object->tva_tx = GETPOST('tva_tx');
@ -1164,7 +1171,6 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
// Build filter to diplay only concerned lines // Build filter to diplay only concerned lines
$filter = array('t.fk_product' => $object->id); $filter = array('t.fk_product' => $object->id);
$search_soc = GETPOST('search_soc');
if (! empty($search_soc)) { if (! empty($search_soc)) {
$filter['soc.nom'] = $search_soc; $filter['soc.nom'] = $search_soc;
} }
@ -1447,7 +1453,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';
if (count($prodcustprice->lines) > 0) if (count($prodcustprice->lines) > 0 || $search_soc)
{ {
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td><input type="text" class="flat" name="search_soc" value="' . $search_soc . '" size="20"></td>'; print '<td><input type="text" class="flat" name="search_soc" value="' . $search_soc . '" size="20"></td>';
@ -1455,9 +1461,14 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
// Print the search button // Print the search button
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre" align="right">';
print '<input class="liste_titre" name="button_search" type="image" 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 '<input class="liste_titre" name="button_search" type="image" 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 ' ';
print '<input class="liste_titre" name="button_removefilter" type="image" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/searchclear.png" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
}
if (count($prodcustprice->lines) > 0)
{
$var = False; $var = False;
foreach ($prodcustprice->lines as $line) foreach ($prodcustprice->lines as $line)

View File

@ -55,7 +55,7 @@ $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');
if (! $sortfield) $sortfield="p.ref"; if (! $sortfield) $sortfield="p.ref";
if (! $sortorder) $sortorder="ASC"; if (! $sortorder) $sortorder="ASC";
$limit = $conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$offset = $limit * $page ; $offset = $limit * $page ;
// Load sale and categ filters // Load sale and categ filters

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