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
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 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 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 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 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 -
set +e
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.
Try to keep lines under 72 characters.
Try to keep lines under 120 characters.
#### Samples
<pre>

View File

@ -148,6 +148,8 @@ NEW: Add restler framework. First step to build REST API into Dolibarr.
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
Dolibarr better:
- Deprecated Product::setPriceExpression. Use Product::update instead

View File

@ -62,6 +62,13 @@ In htdocs/includes/tcpdf/tcpdf.php
* 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:
------
Add fpdf_tpl.php 1.2

View File

@ -49,7 +49,7 @@ if (!$user->admin)
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'sortorder');
$limit = $conf->liste_limit;
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$page = GETPOST("page", 'int');
if ($page == - 1) {
$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 !
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) && $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION >= $conf->liste_limit) {
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
// } else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
// $limit = $conf->liste_limit;
} else {
$limit = $conf->liste_limit;
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
}
$offset = $limit * $page;

View File

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

View File

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

View File

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

View File

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

View File

@ -119,7 +119,7 @@ else
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
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 '</tr>';
@ -135,7 +135,7 @@ foreach ($data as $val)
print '<tr '.$bc[$var].'>';
print '<td align="center">'.$memberstatic->getmorphylib($val['label']).'</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>';
$oldyear=$year;
}

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Brice Davoleau <brice.davoleau@gmail.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) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>

View File

@ -36,6 +36,7 @@ $ref=GETPOST('ref');
$type=GETPOST('type');
$action=GETPOST('action');
$confirm=GETPOST('confirm');
$cancel=GETPOST('cancel');
$socid=GETPOST('socid','int');
$label=GETPOST('label');
@ -54,6 +55,10 @@ if ($id == "")
$result = restrictedArea($user, 'categorie', $id, '&category');
$object = new Categorie($db);
if ($id > 0)
{
$result=$object->fetch($id);
}
$extrafields = new ExtraFields($db);
$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
$hookmanager->initHooks(array('categorycard'));
/*
* Actions
*/
if ($cancel)
{
header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type);
exit;
}
// Action mise a jour d'une categorie
if ($action == 'update' && $user->rights->categorie->creer)
{
$categorie = new Categorie($db);
$result=$categorie->fetch($id);
$categorie->label = $label;
$categorie->description = dol_htmlcleanlastbr($description);
$categorie->color = $color;
$categorie->socid = ($socid ? $socid : 'null');
$categorie->visible = $visible;
$object->label = $label;
$object->description = dol_htmlcleanlastbr($description);
$object->color = $color;
$object->socid = ($socid ? $socid : 'null');
$object->visible = $visible;
if ($parent != "-1")
$categorie->fk_parent = $parent;
$object->fk_parent = $parent;
else
$categorie->fk_parent = "";
$object->fk_parent = "";
if (empty($categorie->label))
if (empty($object->label))
{
$error++;
$action = 'edit';
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 (! $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;
}
else
{
setEventMessages($categorie->error, $categorie->errors, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
else
{
setEventMessages($categorie->error, $categorie->errors, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@ -176,7 +185,7 @@ print '</table>';
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>';

View File

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

View File

@ -1,6 +1,6 @@
<?php
/* 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) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
@ -294,6 +294,7 @@ else
print "</table>\n";
}
// List of products or services (type is type of category)
if ($object->type == Categorie::TYPE_PRODUCT)
{
@ -339,7 +340,7 @@ if ($object->type == Categorie::TYPE_PRODUCT)
$var=!$var;
print "\t<tr ".$bc[$var].">\n";
print '<td class="nowrap" valign="top">';
print $prod->getNomUrl(1,'category');
print $prod->getNomUrl(1);
print "</td>\n";
print '<td valign="top">'.$prod->label."</td>\n";
// Link to delete from category
@ -390,7 +391,7 @@ if ($object->type == Categorie::TYPE_SUPPLIER)
print "\t<tr ".$bc[$var].">\n";
print '<td class="nowrap" valign="top">';
print $soc->getNomUrl(1,'category_supplier');
print $soc->getNomUrl(1);
print "</td>\n";
// Link to delete from category
print '<td align="right">';
@ -444,7 +445,7 @@ if($object->type == Categorie::TYPE_CUSTOMER)
$var=!$var;
print "\t<tr ".$bc[$var].">\n";
print '<td class="nowrap" valign="top">';
print $soc->getNomUrl(1,'category');
print $soc->getNomUrl(1);
print "</td>\n";
// Link to delete from category
print '<td align="right">';
@ -497,7 +498,7 @@ if ($object->type == Categorie::TYPE_MEMBER)
print "\t<tr ".$bc[$var].">\n";
print '<td class="nowrap" valign="top">';
$member->ref=$member->login;
print $member->getNomUrl(1,0,'category');
print $member->getNomUrl(1,0);
print "</td>\n";
print '<td valign="top">'.$member->lastname."</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)
{
$contacts = $object->getObjectsInCateg("contact");

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -45,7 +45,7 @@ $pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortorder) $sortorder="DESC";
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');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
$limit = $conf->liste_limit;
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
if ($page == -1) { $page = 0; }
$offset = $limit * $page;
$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';
$langs->load("trips");
$langs->load("companies");
$WIDTH=DolGraph::getDefaultGraphSizeForStats('width');
$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height');

View File

@ -2094,8 +2094,8 @@ class Facture extends CommonInvoice
if (empty($txlocaltax2)) $txlocaltax2=0;
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
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);
$qty=price2num($qty);
$pu_ht=price2num($pu_ht);
@ -2282,7 +2282,7 @@ class Facture extends CommonInvoice
if (empty($qty)) $qty=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 ($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);
$qty = price2num($qty);
@ -3881,7 +3881,8 @@ class FactureLigne extends CommonInvoiceLine
if (empty($this->special_code)) $this->special_code=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->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 buy price not defined, define buyprice as configured in margin admin
@ -4076,9 +4077,9 @@ class FactureLigne extends CommonInvoiceLine
if (empty($this->special_code)) $this->special_code=0;
if (empty($this->product_type)) $this->product_type=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;
// Check parameters
if ($this->product_type < 0) return -1;

View File

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

View File

@ -77,7 +77,7 @@ if ($option == 'late') $filter = 'paye:0';
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$limit = $conf->liste_limit;
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$page = GETPOST("page",'int');
if ($page == -1) {
$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("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("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('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);
@ -866,7 +866,7 @@ if ($resql)
// Payment mode
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 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 (! $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.= ", 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.= " 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 ";
$sql.= " ORDER BY ";
$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("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("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("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);
@ -941,7 +941,7 @@ if ($resql)
// Payment mode
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>';

View File

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

View File

@ -53,7 +53,7 @@ $pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortorder) $sortorder="DESC";
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.=", c.libelle as paiement_type, p.num_paiement";

View File

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

View File

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

View File

@ -29,8 +29,8 @@
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
{
@ -78,7 +78,7 @@ class Paiement extends CommonObject
* @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 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='')
{
@ -96,14 +96,12 @@ class Paiement extends CommonObject
else if ($fk_bank)
$sql.= ' AND p.fk_bank = '.$fk_bank;
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
$resql = $this->db->query($sql);
if ($resql)
{
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->ref = $obj->ref;
$this->date = $this->db->jdate($obj->dp);
@ -120,12 +118,12 @@ class Paiement extends CommonObject
$this->fk_account = $obj->fk_account;
$this->bank_line = $obj->fk_bank;
$this->db->free($result);
$this->db->free($resql);
return 1;
}
else
{
$this->db->free($result);
$this->db->free($resql);
return 0;
}
}

View File

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

View File

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

View File

@ -46,7 +46,7 @@ if ($page == -1) { $page = 0; }
$offset = $conf->liste_limit * $page;
$pageprev = $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 (! $sortorder) $sortorder="DESC";

View File

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

View File

@ -45,7 +45,7 @@ llxHeader('','Ventilation');
*/
$page = $_GET["page"];
if ($page < 0) $page = 0;
$limit = $conf->liste_limit;
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$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 ";

View File

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

View File

@ -288,17 +288,16 @@ if (empty($reshook))
// Photo save
$dir = $conf->societe->dir_output."/contact/".$object->id."/photos";
$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 (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)
{
dol_mkdir($dir);
@ -980,7 +979,7 @@ else
print "<br>\n";
}
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><input type="file" class="flat" name="photo" id="photoinput"></td></tr>';
print '</table>';

View File

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

View File

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

View File

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

View File

@ -1718,13 +1718,13 @@ class Form
foreach ($scrit as $crit)
{
if ($i > 0) $sql.=" AND ";
$sql.="(p.ref LIKE '".$prefix.$crit."%' OR p.label LIKE '".$prefix.$crit."%'";
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.=" OR pl.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 '".$db->escape($prefix.$crit)."%'";
$sql.=")";
$i++;
}
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.= $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.= " WHERE p.entity IN (".getEntity('product', 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;
// Add criteria on ref/label
if ($filterkey != '')
@ -2101,11 +2101,11 @@ class Form
foreach ($scrit as $crit)
{
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++;
}
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.= " 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
*
* @return int Nb of lines loaded, <0 if KO
* @return int Nb of lines loaded, <0 if KO
*/
function load_cache_types_paiements()
{
@ -2632,9 +2632,9 @@ class Form
$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.= " WHERE active > 0";
//if ($active >= 0) $sql.= " WHERE active = ".$active;
$resql = $this->db->query($sql);
if ($resql)
@ -2651,6 +2651,7 @@ class Form
$this->cache_types_paiements[$obj->id]['code'] =$obj->code;
$this->cache_types_paiements[$obj->id]['label']=$label;
$this->cache_types_paiements[$obj->id]['type'] =$obj->type;
$this->cache_types_paiements[$obj->id]['active'] =$obj->active;
$i++;
}
@ -2708,14 +2709,15 @@ class Form
*
* @param string $selected Id du mode de paiement pre-selectionne
* @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 $empty 1=peut etre vide, 0 sinon
* @param int $noadmininfo 0=Add admin info, 1=Disable admin info
* @param int $maxlength Max length of label
* @param int $active Active or not, -1 = all
* @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;
@ -2732,6 +2734,9 @@ class Form
if ($empty) print '<option value="">&nbsp;</option>';
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
if (count($filterarray) && ! in_array($arraytypes['type'],$filterarray)) continue;
@ -3685,9 +3690,10 @@ class Form
* @param int $selected Id mode pre-selectionne
* @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 int $active Active or not, -1 = all
* @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;
if ($htmlname != "none")
@ -3697,7 +3703,7 @@ class Form
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
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 align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
print '</tr></table></form>';
@ -3707,7 +3713,6 @@ class Form
if ($selected)
{
$this->load_cache_types_paiements();
print $this->cache_types_paiements[$selected]['label'];
} else {
print "&nbsp;";
@ -4909,7 +4914,7 @@ class Form
$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text
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>';
@ -5323,7 +5328,7 @@ class Form
{
$ret.='</ul></div>';
}
$ret.='<div class="statusref">'.$morehtmlright.'</div>';
if ($morehtmlright) $ret.='<div class="statusref">'.$morehtmlright.'</div>';
$ret.='</div>';
return $ret;
@ -5381,19 +5386,15 @@ class Form
$id = (! empty($object->id) ? $object->id : $object->rowid);
$ret='';$dir='';$file='';$originalfile='';$altfile='';$email='';
if ($modulepart=='societe')
{
$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))
{
// TODO Introduce get_exdir
if ((string) $imagesize == 'mini') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_mini');
else if ((string) $imagesize == 'small') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_small');
else $file=$id.'/logos/thumbs/'.$smallfile;
$originalfile=$id.'/logos/thumbs/'.$smallfile;
if ((string) $imagesize == 'mini') $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
else if ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.getImageFileNameForSize($object->logo, '_small');
else $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.$object->logo;
$originalfile=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.$object->logo;
}
}
else if ($modulepart=='contact')
@ -5401,11 +5402,10 @@ class Form
$dir=$conf->societe->multidir_output[$entity].'/contact';
if (! empty($object->photo))
{
// TODO Introduce get_exdir
if ((string) $imagesize == 'mini') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_mini');
else if ((string) $imagesize == 'small') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_small');
else $file=$id.'/photos/'.$object->photo;
$originalfile=$id.'/photos/'.$object->photo;
if ((string) $imagesize == 'mini') $file=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.getImageFileNameForSize($object->photo, '_mini');
else if ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.getImageFileNameForSize($object->photo, '_small');
else $file=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.$object->photo;
$originalfile=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.$object->photo;
}
}
else if ($modulepart=='userphoto')

View File

@ -55,6 +55,8 @@ class FormOrder
*/
function selectSupplierOrderStatus($selected='', $short=0, $hmlname='order_status')
{
$tmpsupplierorder=new CommandeFournisseur($db);
print '<select class="flat" name="'.$hmlname.'">';
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)
@ -62,7 +64,8 @@ class FormOrder
foreach($statustohow as $key => $value)
{
print '<option value="'.$value.'"'.(($selected == $key || $selected == $value)?' selected':'').'>';
print CommandeFournisseur::LibStatut($key,$short);
$tmpsupplierorder->statut=$key;
print $tmpsupplierorder->getLibStatut($short);
print '</option>';
}
print '</select>';

View File

@ -598,7 +598,7 @@ class FormOther
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$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;
}

View File

@ -908,7 +908,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
}
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 ($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
{
// 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.
if (in_array($modulepart, array('thirdparty','contact')))
{
$path=$object->ref?$object->ref:$object->id;
}
}
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)
{
$reftoshow = $linkedobject["ref_title"].' : '.$linkedobject["ref_value"];
if (! empty($linkedobject["date_value"]))
{
$reftoshow .= ' / '.$linkedobject["date_value"];
}
$posy+=3;
$pdf->SetXY($posx,$posy);
$pdf->SetFont('','', $default_font_size - 2);
$pdf->MultiCell($w, $h, $linkedobject["ref_title"].' : '.$linkedobject["ref_value"], '', $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);
}
$pdf->MultiCell($w, $h, $reftoshow, '', $align);
}
}
@ -1826,10 +1825,11 @@ function pdf_getTotalQty($object,$type,$outputlangs)
/**
* 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 Translate $outputlangs Object lang for output
* @return array Linked objects
* @return array Linked objects
*/
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>
* 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.
* $arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.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.'">';
}
if ($rang > 10) return; // Protection contre boucle infinie
if ($rang > 50) return; // Protect against infinite loop. Max 50 depth
//ballayage du tableau
$sizeoftab=count($tab);

View File

@ -410,7 +410,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
else
{
$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 '';
}
if ($edit) print '<br>('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
@ -430,7 +430,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
else
{
$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");
}
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
{
$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 '';
}
if ($edit) print '<br>('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
@ -474,7 +474,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
else
{
$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");
}
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()),'');
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("None");
@ -595,7 +595,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
else
{
$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 '';
}
if ($edit) print '<br>('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
@ -614,7 +614,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
else
{
$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");
}
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(
'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
'titre'=>'supplier_proposalMENU_LEFT_TITLE',
'titre'=>'SupplierProposalShort',
'leftmenu'=>'supplier_proposalsubmenu',
'url'=>'/supplier_proposal/index.php',
'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(
'fk_menu'=>'fk_mainmenu=commercial,fk_leftmenu=supplier_proposalsubmenu',
'type'=>'left',
'titre'=>'supplier_proposalMENU_LEFT_TITLE_NEW',
'titre'=>'SupplierProposalNew',
'url'=>'/supplier_proposal/card.php?action=create',
'langs'=>'supplier_proposal',
'enabled'=>'$conf->supplier_proposal->enabled',
@ -169,7 +169,7 @@ class modSupplierProposal extends DolibarrModules
$this->menu[$r]=array(
'fk_menu'=>'fk_mainmenu=commercial,fk_leftmenu=supplier_proposalsubmenu',
'type'=>'left',
'titre'=>'supplier_proposalMENU_LEFT_TITLE_LIST',
'titre'=>'List',
'url'=>'/supplier_proposal/list.php',
'langs'=>'supplier_proposal',
'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 (! 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 -->
@ -48,7 +48,7 @@ $(document).ready(function () {
<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="action" value="buildnewpassword">
@ -77,7 +77,7 @@ $(document).ready(function () {
<tr>
<td valign="bottom" class="nowrap center">
<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>
</td>
</tr>

View File

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

View File

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

View File

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

View File

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

View File

@ -48,7 +48,7 @@ $pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortorder) $sortorder="DESC";
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");
if (!$sortorder) $sortorder="DESC";
if (!$sortfield) $sortfield="d.date_debut";
$limit = $conf->liste_limit;
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
if ($page == -1) {
$page = 0 ;
@ -211,7 +211,6 @@ if ($resql)
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall));
}
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';
$langs->load("trips");
$langs->load("companies");
$WIDTH=DolGraph::getDefaultGraphSizeForStats('width');
$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height');

View File

@ -44,7 +44,7 @@ $result = restrictedArea($user, 'ficheinter', $fichinterid,'fichinter');
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$limit = $conf->liste_limit;
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$page = GETPOST('page','int');
if ($page == -1) { $page = 0; }
$offset = $limit * $page;
@ -152,7 +152,7 @@ if ($result)
if ($sall)
{
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%">';

View File

@ -498,7 +498,7 @@ class CommandeFournisseur extends CommonOrder
*/
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 $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
*/
function LibStatut($statut,$mode=0)
function LibStatut($statut,$mode=0,$billed=0)
{
global $langs;
$langs->load('orders');
$billedtext='';
//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
$statutshort[0] = 'StatusOrderDraftShort';

View File

@ -65,18 +65,28 @@ class PaiementFourn extends Paiement
/**
* Load payment object
*
* @param int $id Id if payment to get
* @return int <0 if ko, >0 if ok
* @param int $id Id if payment to get
* @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.= ' c.code as paiement_code, c.libelle as paiement_type,';
$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.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid ';
$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);
if ($resql)
{
@ -99,7 +109,7 @@ class PaiementFourn extends Paiement
}
else
{
$error = -2;
$error = -2; // TODO Use 0 instead
}
$this->db->free($resql);
}

View File

@ -50,7 +50,7 @@ $pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortorder) $sortorder="ASC";
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');
if ($page == -1) { $page = 0 ; }
$limit = $conf->liste_limit;
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$offset = $limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;

View File

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

View File

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

View File

@ -61,7 +61,7 @@ if ($page == -1) {
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
$limit = $conf->liste_limit;
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$form = new Form($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
*/
define('QR_FIND_FROM_RANDOM', 2);
define('QR_FIND_FROM_RANDOM', false);
/**
* when QR_FIND_BEST_MASK === false
@ -730,7 +730,7 @@ class QRcode {
$this->eccLength = $this->rsEccLength($spec);
$this->ecccode = array_fill(0, $this->eccLength, 0);
$this->blocks = $this->rsBlockNum($spec);
$ret = $this->init($spec);
$ret = $this->init($spec);
if ($ret < 0) {
return NULL;
}

View File

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

View File

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

View File

@ -23,7 +23,7 @@ MenuToDoActions=Eventos incompletos
MenuDoneActions=Eventos terminados
MenuToDoMyActions=Mis eventos incompletos
MenuDoneMyActions=Mis eventos terminados
ListOfEvents=lista de acontecimientos (calendario interno)
ListOfEvents=Lista de acontecimientos (calendario interno)
ActionsAskedBy=Eventos registrados por
ActionsToDoBy=Eventos asignados a
ActionsDoneBy=Eventos realizados por
@ -90,8 +90,8 @@ ExtSiteUrlAgenda=Url de acceso al archivo .ical
ExtSiteNoLabel=Sin descripción
WorkingTimeRange=Rango temporal
WorkingDaysRange=Rango diario
VisibleTimeRange=Visible time range
VisibleDaysRange=Visible days range
VisibleTimeRange=Rango de tiempo visible
VisibleDaysRange=Rango de días visibles
AddEvent=Crear evento
MyAvailability=Mi disponibilidad
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>.
FTPFailedToRemoveDir=No se pudo eliminar el directorio <b>%s</b> (Compruebe los permisos y que el directorio está vacío).
FTPPassiveMode=Modo pasivo
ChooseAFTPEntryIntoMenu=Choose a FTP entry into menu...
FailedToGetFile=Failed to get files %s
ChooseAFTPEntryIntoMenu=Elija una entrada de FTP en el menú ...
FailedToGetFile=No se pudieron obtener los archivos %s

View File

@ -1,7 +1,7 @@
Module210009Name=Incoterm
Module210009Desc=Add features to manage Incoterm
Module62000Name=Incoterm
Module62000Desc=Añade funciones para gestionar Incoterm
IncotermLabel=Incoterms
IncotermSetupTitle1=Feature
IncotermSetupTitle2=Status
IncotermSetup=Setup of module Incoterm
IncotermFunctionDesc=Activate Incoterm feature (Thirdparty, Proposal, Customer Order, Customer Invoice, Shipment, Supplier order)
IncotermSetupTitle1=Función
IncotermSetupTitle2=Estado
IncotermSetup=Configuración del módulo Incoterm
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_eu_ES=Vasco
Language_fa_IR=Persa
Language_fi_FI=Finnish
Language_fi_FI=Finés
Language_fr_BE=Francés (Bélgica)
Language_fr_CA=Francés (Canadá)
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
ErrorFailedToDeleteLink= Error al eliminar 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
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
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
SupplierRemoved=Proveedor eliminado
SuppliersInvoice=Factura proveedor
ShowSupplierInvoice=Ver factura de proveedor
NewSupplier=Nuevo proveedor
History=Histórico
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.
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_INVOICEAutomatically 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_ORDER_AUTOCREATE_INVOICEAutomatically Crear una factura a cliente automáticamente al cierre de un pedido de cliente
descWORKFLOW_PROPAL_AUTOCREATE_INVOICE=Crear una factura a cliente automáticamente a la firma de un presupuesto
descWORKFLOW_CONTRACT_AUTOCREATE_INVOICE=Crear una factura a cliente automáticamente al validar un contrato
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_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

View File

@ -1,5 +1,3 @@
# Dolibarr language file - Source file is en_US - incoterm
IncotermSetupTitle1=Función
IncotermSetupTitle2=Estado
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)

View File

@ -24,7 +24,6 @@ TripSalarie=Informações do usuário
TripNDF=Informações relatório de despesas
PDFStandardExpenseReports=Template padrão para gerar um documento PDF para relatório de despesa
ExpenseReportLine=Linha de relatório de despesas
TF_TRANSPORTATION=Transporte
TF_TRAIN=Trem
TF_BUS=Onibus
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)
# stsongstdlight or cid0cs are for simplified Chinese
# To read Chinese pdf with Linux: sudo apt-get install poppler-data
FONTFORPDF=helvetica
FONTFORPDF=DejaVuSans
FONTSIZEFORPDF=10
SeparatorDecimal=.
SeparatorThousand=,

View File

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

View File

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

View File

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

View File

@ -1315,7 +1315,7 @@ else
$picto=($object->type== Product::TYPE_SERVICE?'service':'product');
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">';

View File

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

View File

@ -110,9 +110,12 @@ $h++;
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.= ", ".MAIN_DB_PREFIX."product as p";
$sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')';
@ -120,7 +123,7 @@ $sql.= " AND p.rowid = pd.fk_product";
if ($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);
if ($result)
@ -131,68 +134,82 @@ if ($result)
$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit+1, $offset);
$result=$db->query($sql);
if ($result)
$resql=$db->query($sql);
if ($resql)
{
$num = $db->num_rows($result);
$i = 0;
$num = $db->num_rows($resql);
$i = 0;
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $totalnboflines, '');
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('NbOfProposals'), $_SERVER["PHP_SELF"], 'c', '', $param, 'align="right"', $sortfield, $sortorder);
print "</tr>\n";
$var=True;
while ($i < $num)
{
$objp = $db->fetch_object($resql);
$infoprod[$objp->rowid]=array('type'=>$objp->type, 'ref'=>$objp->ref, 'label'=>$objp->label);
$infoprod[$objp->rowid]['nblineproposal']=$objp->c;
$i++;
}
$db->free($resql);
}
else
{
dol_print_error($db);
}
//var_dump($infoprod);
$var=True;
while ($i < $num)
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $totalnboflines, '');
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
if (! empty($conf->global->MAIN_MULTILANGS)) // si l'option est active
$resultp = $db->query($sql);
if ($resultp)
{
$sql = "SELECT label";
$sql.= " FROM ".MAIN_DB_PREFIX."product_lang";
$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;
}
$objtp = $db->fetch_object($resultp);
if (! empty($objtp->label)) $vals['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();
print "</table>";
$var=!$var;
print "<tr ".$bc[$var].">";
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();

View File

@ -53,6 +53,8 @@ $action = GETPOST('action', 'alpha');
$cancel = GETPOST('cancel', 'alpha');
$eid = GETPOST('eid', 'int');
$search_soc = GETPOST('search_soc');
// Security check
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
@ -84,6 +86,11 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
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))
{
$object->tva_tx = GETPOST('tva_tx');
@ -1164,7 +1171,6 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
// Build filter to diplay only concerned lines
$filter = array('t.fk_product' => $object->id);
$search_soc = GETPOST('search_soc');
if (! empty($search_soc)) {
$filter['soc.nom'] = $search_soc;
}
@ -1447,7 +1453,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
print '<td>&nbsp;</td>';
print '</tr>';
if (count($prodcustprice->lines) > 0)
if (count($prodcustprice->lines) > 0 || $search_soc)
{
print '<tr class="liste_titre">';
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 '<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 ' ';
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 '</tr>';
}
if (count($prodcustprice->lines) > 0)
{
$var = False;
foreach ($prodcustprice->lines as $line)

View File

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

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