Merge remote-tracking branch 'upstream/develop' into develop

This commit is contained in:
Juanjo Menent 2017-01-16 13:37:01 +01:00
commit e232c1c408
117 changed files with 407 additions and 262 deletions

View File

@ -51,6 +51,7 @@ env:
matrix:
fast_finish: true
allow_failures:
- php: 7.1
- php: nightly
# FIXME
#- env: DB=postgresql

View File

@ -151,6 +151,9 @@ Dolibarr better:
no more required, were also removed. Use this new one if you were using one of them.
- The trigger that activate or close a contract line is run on a contract line, not on contract.
Dolibarr 5.0 was frozen before PHP 7.1 was released. Unit tests are successful on PHP 7.1 but we don't have enough
feedback to confirm all application is compatible. Current officiel supported PHP versions are PHP 5.3 to 7.0.
***** ChangeLog for 4.0.3 to 4.0.2 *****
FIX: #5853 $conf->global->$calc==0 || $conf->global->$calc==1

View File

@ -247,7 +247,7 @@ $sql.=$db->order($sortfield,$sortorder);
//$sql.= $db->plimit($conf->liste_limit+1, $offset);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -172,7 +172,7 @@ if (strlen(trim($search_pcgsubtype))) {
$sql .= $db->order($sortfield, $sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$resql = $db->query($sql);

View File

@ -90,7 +90,7 @@ $sql .= " WHERE f.entity = " . $conf->entity;
$sql.=$db->order($sortfield,$sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -248,7 +248,7 @@ if (strlen(trim($search_desc))) {
}
$sql .= $db->order($sortfield, $sortorder);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -143,7 +143,7 @@ else {
// List
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$nbtotalofrecords = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter);
if ($nbtotalofrecords < 0) {

View File

@ -293,7 +293,7 @@ llxHeader('', $title_page);
// List
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter);
if ($nbtotalofrecords < 0) {

View File

@ -162,7 +162,7 @@ llxHeader('', $title_page);
// List
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$nbtotalofrecords = $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter);
if ($nbtotalofrecords < 0) {

View File

@ -158,7 +158,7 @@ if (! empty($search_code_journal)) {
* Mode List
*/
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0);
if ($nbtotalofrecords < 0) {

View File

@ -200,7 +200,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't sha
$sql .= $db->order($sortfield, $sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -220,7 +220,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't sha
$sql .= $db->order($sortfield, $sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -178,7 +178,7 @@ $sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don'
$sql .= $db->order($sortfield, $sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -208,7 +208,7 @@ $sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don'
$sql .= $db->order($sortfield, $sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -182,7 +182,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't
$sql .= $db->order($sortfield, $sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -217,7 +217,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't
$sql .= $db->order($sortfield, $sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -250,7 +250,7 @@ $sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
// Count total nb of records with no order and no limits
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$resql = $db->query($sql);

View File

@ -110,7 +110,7 @@ if ($search_account > 0) $sql.= " AND b.fk_account = ".$search_account;
if ($search_amount) $sql.= natural_search('c.subscription', $search_amount, 1);
$sql.= $db->order($sortfield,$sortorder);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -407,7 +407,7 @@ if ($rowid > 0)
$sql.=" AND datefin < '".$db->idate($now)."'";
}
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$resql = $db->query($sql);

View File

@ -203,7 +203,7 @@ foreach ($modulesdir as $dir)
}
ksort($arrayofnatures);
}
// Define array $categ with categ with at least one qualified module
if ($modulequalified > 0)
{
@ -319,7 +319,7 @@ if ($mode != 'marketplace')
$moreforfilter.= $langs->trans('Keyword') . ': <input type="text" name="search_keyword" value="'.dol_escape_htmltag($search_keyword).'">';
$moreforfilter.= '</div>';
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.= $langs->trans('Origin') . ': '.$form->selectarray('search_nature', $arrayofnatures, $search_nature, 1);
$moreforfilter.= $langs->trans('Origin') . ': '.$form->selectarray('search_nature', $arrayofnatures, dol_escape_htmltag($search_nature), 1);
$moreforfilter.= '</div>';
if (! empty($conf->global->MAIN_FEATURES_LEVEL))
{
@ -398,7 +398,7 @@ if ($mode != 'marketplace')
if ($search_keyword)
{
$qualified=0;
if (preg_match('/'.preg_quote($search_keyword).'/i', $modulename)
if (preg_match('/'.preg_quote($search_keyword).'/i', $modulename)
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesc)
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesclong)
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduleauthor)
@ -417,7 +417,7 @@ if ($mode != 'marketplace')
{
//print $reg[1].'-'.dol_escape_htmltag($objMod->getPublisher());
$publisher=dol_escape_htmltag($objMod->getPublisher());
if ($reg[1] && $reg[1] != $publisher) continue;
if ($reg[1] && dol_escape_htmltag($reg[1]) != $publisher) continue;
if (! $reg[1] && ! empty($publisher)) continue;
}
if ($search_nature == 'core' && $objMod->isCoreOrExternalModule() == 'external') continue;
@ -496,11 +496,12 @@ if ($mode != 'marketplace')
// Help
print '<td align="center" valign="top" class="nowrap" style="width: 82px;">';
$text='';
if ($objMod->getDescLong()) $text.='<div class="titre">'.$objMod->getDesc().'</div><br>'.$objMod->getDescLong().'<br>';
else $text.='<div class="titre">'.$objMod->getDesc().'</div><br>';
$textexternal='';
$imginfo="info";
$imginfo="info";
if ($objMod->isCoreOrExternalModule() == 'external')
{
$imginfo="info_black";
@ -647,6 +648,7 @@ if ($mode != 'marketplace')
$text.='<br><strong>'.$langs->trans("AddOtherPagesOrServices").':</strong> ';
$text.=$langs->trans("DetectionNotPossible");
print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20');
print '</td>';

View File

@ -174,6 +174,15 @@ if ($search_user) { $usefilter++; $sql.=natural_search("u.login", $search_user,
if ($search_desc) { $usefilter++; $sql.=natural_search("e.description", $search_desc, 0); }
if ($search_ua) { $usefilter++; $sql.=natural_search("e.user_agent", $search_ua, 0); }
$sql.= $db->order($sortfield,$sortorder);
// Count total nb of records
$nbtotalofrecords = '';
/*if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
}*/
$sql.= $db->plimit($conf->liste_limit+1, $offset);
//print $sql;
$result = $db->query($sql);
@ -195,7 +204,7 @@ if ($result)
$center='<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=purge">'.$langs->trans("Purge").'</a>';
}
print_barre_liste($langs->trans("ListOfSecurityEvents").' ('.$num.')', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, 0, 'setup');
print_barre_liste($langs->trans("ListOfSecurityEvents"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $nbtotalofrecords, 'setup');
if ($action == 'purge')
{

View File

@ -214,6 +214,7 @@ p.titre {
.blocksellfinished {
min-width: 215px;
margin-top: 8px;
}
.titre1 {
font-weight: bold;

View File

@ -209,7 +209,7 @@ class Categories extends DolibarrApi
$sql.= ' AND s.rowid = sub.fk_categorie';
$sql.= ' AND sub.'.$subcol_name.' = '.$item;
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -124,7 +124,7 @@ class CategoryApi extends DolibarrApi
$sql.= ' WHERE s.entity IN ('.getEntity('category', 1).')';
$sql.= ' AND s.type='.array_search($type,CategoryApi::$TYPES);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
@ -205,7 +205,7 @@ class CategoryApi extends DolibarrApi
$sql.= ' AND s.rowid = sub.fk_categorie';
$sql.= ' AND sub.'.$subcol_name.' = '.$item;
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -245,7 +245,7 @@ if ($datestart > 0) $sql.= " AND a.datep BETWEEN '".$db->idate($datestart)."' AN
if ($dateend > 0) $sql.= " AND a.datep2 BETWEEN '".$db->idate($dateend)."' AND '".$db->idate($dateend+3600*24-1)."'";
$sql.= $db->order($sortfield,$sortorder);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -85,7 +85,7 @@ $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')';
$sql.= " GROUP BY year, month, df";
$sql.= " ORDER BY year DESC, month DESC, df DESC";
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -758,7 +758,7 @@ else
// MAILING_NO_USING_PHPMAIL may be defined or not.
// MAILING_LIMIT_SENDBYWEB is always defined to something != 0 (-1=forbidden).
// MAILING_LIMIT_SENDBYCLI may be defined ot not (-1=forbidden, 0=no limit).
// MAILING_LIMIT_SENDBYCLI may be defined ot not (-1=forbidden, 0 or undefined=no limit).
if (! empty($conf->global->MAILING_NO_USING_PHPMAIL) && $sendingmode == 'mail')
{
// EMailing feature may be a spam problem, so when you host several users/instance, having this option may force each user to use their own SMTP agent.
@ -772,8 +772,8 @@ else
}
else if ($conf->global->MAILING_LIMIT_SENDBYWEB == '-1')
{
if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_PHPMAIL, null, 'warnings');
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL, null, 'warnings');
if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_PHPMAIL), null, 'warnings');
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL), null, 'warnings');
// The feature is forbidden from GUI, we show just message to use from command line.
setEventMessages($langs->trans("MailingNeedCommand"), null, 'warnings');
@ -786,8 +786,8 @@ else
}
else
{
if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_PHPMAIL, null, 'warnings');
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL, null, 'warnings');
if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_PHPMAIL), null, 'warnings');
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL), null, 'warnings');
$text='';
if ($conf->global->MAILING_LIMIT_SENDBYCLI >= 0)

View File

@ -412,7 +412,7 @@ if ($object->fetch($id) >= 0)
$sql .= $db->order($sortfield,$sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -333,7 +333,7 @@ $sql.= $db->order($sortfield,$sortorder);
$sql.=', p.ref DESC';
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -139,7 +139,7 @@ class CommandeApi extends DolibarrApi
$sql .= " AND sc.fk_user = ".$search_sale;
}
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -97,7 +97,7 @@ $sql.= " GROUP BY s.nom";
$sql.= $db->order($sortfield,$sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -560,7 +560,7 @@ $sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -502,7 +502,7 @@ $sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
$nbtotalofpages = 0;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{

View File

@ -662,7 +662,7 @@ class Account extends CommonObject
*
* @param User $user Object user making action
* @param int $notrigger 1=Disable triggers
* @return int <0 si ko, >0 si ok
* @return int <0 if KO, >0 if OK
*/
function update(User $user = null, $notrigger = 0)
{

View File

@ -175,7 +175,7 @@ $sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -138,7 +138,7 @@ class InvoiceApi extends DolibarrApi
$sql .= " AND sc.fk_user = ".$search_sale;
}
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -1575,7 +1575,7 @@ else
$sql.= " AND f.date_when BETWEEN '".$db->idate(dol_get_first_day($year_date_when,1,false))."' AND '".$db->idate(dol_get_last_day($year_date_when,12,false))."'";
}
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -402,7 +402,7 @@ $listfield=explode(',',$sortfield);
foreach ($listfield as $key => $value) $sql.= $listfield[$key].' '.$sortorder.',';
$sql.= ' f.rowid DESC ';
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -396,7 +396,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
var form = $("#payment_form");
json["invoice_type"] = $("#invoice_type").val();
json["amountPayment"] = $("#amountpayment").attr("value");
json["amountPayment"] = $("#amountpayment").attr("value");
json["amounts"] = _elemToJson(form.find("input.amount"));
json["remains"] = _elemToJson(form.find("input.remain"));

View File

@ -112,7 +112,7 @@ else if ($year > 0)
}
$sql.= $db->order($sortfield,$sortorder);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -186,7 +186,7 @@ else
}
$sql.= $db->order($sortfield,$sortorder);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -365,7 +365,7 @@ else
}
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -288,7 +288,7 @@ if ($result)
$totalnboflines = $db->num_rows($result);
}
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -236,7 +236,7 @@ if (! empty($filter_op2) && $filter_op2 != -1 && $filter_date2 != '') $sql.= " A
if (! empty($filter_opcloture) && $filter_opcloture != -1 && $filter_datecloture != '') $sql.= " AND cd.date_cloture ".$filter_opcloture." '".$db->idate($filter_datecloture)."'";
$sql .= $db->order($sortfield,$sortorder);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -371,7 +371,9 @@ class CMailFile
{
// Use Swift Mailer library
// ------------------------------------------
$host = dol_getprefix('email');
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/swift_required.php';
// Create the message
$this->message = Swift_Message::newInstance();
@ -379,7 +381,7 @@ class CMailFile
// Adding a trackid header to a message
$headers = $this->message->getHeaders();
$headers->addTextHeader('X-Dolibarr-TRACKID', $trackid);
$headerID = time() . '.swiftmailer-dolibarr-' . $trackid . '@' . $conf->global->MAIN_MAIL_SMTP_SERVER;
$headerID = time() . '.swiftmailer-dolibarr-' . $trackid . '@' . $host;
$msgid = $headers->get('Message-ID');
$msgid->setId($headerID);
$headers->addIdHeader('References', $headerID);

View File

@ -3020,9 +3020,16 @@ abstract class CommonObject
foreach ($this->lines as $line)
{
$totalOrdered+=$line->qty_asked; // defined for shipment only
$totalToShip+=$line->qty_shipped; // defined for shipment only
if (isset($line->qty_asked))
{
if (empty($totalOrdered)) $totalOrdered=0; // Avoid warning because $totalOrdered is ''
$totalOrdered+=$line->qty_asked; // defined for shipment only
}
if (isset($line->qty_shipped))
{
if (empty($totalToShip)) $totalToShip=0; // Avoid warning because $totalToShip is ''
$totalToShip+=$line->qty_shipped; // defined for shipment only
}
// Define qty, weight, volume, weight_units, volume_units
if ($this->element == 'shipping') $qty=$line->qty_shipped; // for shipments
@ -3037,8 +3044,11 @@ abstract class CommonObject
if (! empty($weight_units)) $weightUnit = $weight_units;
if (! empty($volume_units)) $volumeUnit = $volume_units;
if (empty($totalWeight)) $totalWeight=0; // Avoid warning because $totalWeight is ''
if (empty($totalVolume)) $totalVolume=0; // Avoid warning because $totalVolume is ''
//var_dump($line->volume_units);
if ($weight_units < 50) // >50 means a standard unit (power of 10 of official unit) > 50 means an exotic unit (like inch)
if ($weight_units < 50) // >50 means a standard unit (power of 10 of official unit), > 50 means an exotic unit (like inch)
{
$trueWeightUnit=pow(10, $weightUnit);
$totalWeight += $weight * $qty * $trueWeightUnit;
@ -3047,7 +3057,7 @@ abstract class CommonObject
{
$totalWeight += $weight * $qty; // This may be wrong if we mix different units
}
if ($volume_units < 50) // >50 means a standard unit (power of 10 of official unit) > 50 means an exotic unit (like inch)
if ($volume_units < 50) // >50 means a standard unit (power of 10 of official unit), > 50 means an exotic unit (like inch)
{
//print $line->volume."x".$line->volume_units."x".($line->volume_units < 50)."x".$volumeUnit;
$trueVolumeUnit=pow(10, $volumeUnit);

View File

@ -76,7 +76,7 @@ class FormFile
global $conf,$langs, $hookmanager;
$hookmanager->initHooks(array('formfile'));
if (! empty($conf->browser->layout) && $conf->browser->layout != 'classic') $useajax=0;
if ((! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) && $useajax) || ($useajax==2))
@ -275,7 +275,7 @@ class FormFile
if (0 !== $iconPDF) {
dol_syslog(__METHOD__ . ": passing iconPDF parameter is deprecated", LOG_WARNING);
}
global $langs, $conf, $user, $hookmanager;
global $form, $bc;
@ -287,7 +287,7 @@ class FormFile
if (! empty($iconPDF)) {
return $this->getDocumentsLink($modulepart, $modulesubdir, $filedir);
}
$printer=0;
if (in_array($modulepart,array('facture','supplier_proposal','propal','proposal','order','commande','expedition', 'commande_fournisseur', 'expensereport'))) // The direct print feature is implemented only for such elements
{
@ -559,7 +559,7 @@ class FormFile
$addcolumforpicto=($delallowed || $printer || $morepicto);
$out.= '<th align="center" colspan="'.(3+($addcolumforpicto?'2':'1')).'" class="formdoc liste_titre maxwidthonsmartphone">';
// Model
if (! empty($modellist))
{
@ -1116,10 +1116,11 @@ class FormFile
$minifile=getImageFileNameForSize($file['name'], '_mini'); // For new thumbs using same ext (in lower case howerver) than original
if (! dol_is_file($file['path'].'/'.$minifile)) $minifile=getImageFileNameForSize($file['name'], '_mini', '.png'); // For backward compatibility of old thumbs that were created with filename in lower case and with .png extension
//print $file['path'].'/'.$minifile.'<br>';
$urlforhref=getAdvancedPreviewUrl($modulepart, $relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']));
if (empty($urlforhref)) $urlforhref=DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']));
if (empty($urlforhref)) $urlforhref=DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity)?$object->entity:$conf->entity).'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']));
print '<a href="'.$urlforhref.'" class="aphoto" target="_blank">';
print '<img border="0" height="'.$maxheightmini.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&file='.urlencode($relativepath.$minifile).'" title="">';
print '<img border="0" height="'.$maxheightmini.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity)?$object->entity:$conf->entity).'&file='.urlencode($relativepath.$minifile).'" title="">';
print '</a>';
}
else print '&nbsp;';

View File

@ -1217,7 +1217,7 @@ class SMTPs
$host=preg_replace('@tcp://@i','',$host); // Remove prefix
$host=preg_replace('@ssl://@i','',$host); // Remove prefix
$host=dol_getprefix('email').'-'.$host;
$host=dol_getprefix('email');
//NOTE: Message-ID should probably contain the username of the user who sent the msg
$_header .= 'Subject: ' . $this->getSubject() . "\r\n";

View File

@ -197,9 +197,10 @@ function checkBanForAccount($account)
$rib = strtr($rib, "abcdefghijklmnopqrstuvwxyz", "12345678912345678923456789");
// Separation du rib en 3 groupes de 7 + 1 groupe de 2.
// Multiplication de chaque groupe par les coef du tableau
var_dump($rib);
for ($i = 0, $s = 0; $i < 3; $i++) {
$code = substr($rib, 7 * $i, 7);
$s += (0 + $code) * $coef[$i];
$s += (0 + (int) $code) * $coef[$i];
}
// Soustraction du modulo 97 de $s a 97 pour obtenir la cle
$cle_rib = 97 - ($s % 97);

View File

@ -110,21 +110,24 @@ function dol_print_cron_urls()
print '<br>';
// Add note
$linuxlike=1;
if (preg_match('/^win/i',PHP_OS)) $linuxlike=0;
if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0;
print $langs->trans("Note").': ';
if ($linuxlike)
if (empty($conf->global->CRON_DISABLE_TUTORIAL_CRON))
{
print $langs->trans("CronExplainHowToRunUnix");
print '<br>';
print '<textarea class="quatrevingtpercent">*/5 * * * * pathtoscript/scripts/cron/cron_run_jobs.php '.(empty($conf->global->CRON_KEY)?'securitykey':''.$conf->global->CRON_KEY.'').' '.$logintouse.' &gt; '.DOL_DATA_ROOT.'/cron_run_jobs.php.log</textarea><br>';
$linuxlike=1;
if (preg_match('/^win/i',PHP_OS)) $linuxlike=0;
if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0;
print $langs->trans("Note").': ';
if ($linuxlike)
{
print $langs->trans("CronExplainHowToRunUnix");
print '<br>';
print '<textarea class="quatrevingtpercent">*/5 * * * * pathtoscript/scripts/cron/cron_run_jobs.php '.(empty($conf->global->CRON_KEY)?'securitykey':''.$conf->global->CRON_KEY.'').' '.$logintouse.' &gt; '.DOL_DATA_ROOT.'/cron_run_jobs.php.log</textarea><br>';
}
else
{
print $langs->trans("CronExplainHowToRunWin");
}
}
else
{
print $langs->trans("CronExplainHowToRunWin");
}
return 0;
}

View File

@ -175,7 +175,7 @@ function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengt
$sTime='';
$sDay=0;
$sWeek='';
$sWeek=0;
if ($iSecond >= $lengthOfDay)
{
@ -218,7 +218,7 @@ function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengt
}
if ($format == 'allhourmin')
{
return sprintf("%02d",($sWeek*$lengthOfWeek*24 + $sDay*24 + (int) floor($iSecond/3600))).':'.sprintf("%02d",((int) floor(($iSecond % 3600)/60)));
return sprintf("%02d",($sWeek*$lengthOfWeek*24 + $sDay*24 + (int) floor($iSecond/3600))).':'.sprintf("%02d",((int) floor(($iSecond % 3600)/60)));
}
if ($format == 'allhour')
{

View File

@ -3184,7 +3184,7 @@ function load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png',
* @param string $sortorder Order to sort ('' by default)
* @param string $center String in the middle ('' by default). We often find here string $massaction comming from $form->selectMassAction()
* @param int $num Number of records found by select with limit+1
* @param int $totalnboflines Total number of records/lines for all pages (if known). Use a negative value to not show number.
* @param int|string $totalnboflines Total number of records/lines for all pages (if known). Use a negative value of number to not show number. Use '' if unknown.
* @param string $picto Icon to use before title (should be a 32x32 transparent png file)
* @param int $pictoisfullpath 1=Icon name is a full absolute url of image
* @param string $morehtml More html to show
@ -3193,7 +3193,7 @@ function load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png',
* @param int $hideselectlimit Force to hide select limit
* @return void
*/
function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=-1, $picto='title_generic.png', $pictoisfullpath=0, $morehtml='', $morecss='', $limit=-1, $hideselectlimit=0)
function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines='', $picto='title_generic.png', $pictoisfullpath=0, $morehtml='', $morecss='', $limit=-1, $hideselectlimit=0)
{
global $conf,$langs;
@ -3223,7 +3223,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
print '<td class="nobordernopadding valignmiddle">';
if ($picto && $titre) print img_picto('', $picto, 'class="hideonsmartphone valignmiddle" id="pictotitle"', $pictoisfullpath);
print '<div class="titre inline-block">'.$titre;
if (!empty($titre) && $savtotalnboflines >= 0) print ' ('.$totalnboflines.')';
if (!empty($titre) && $savtotalnboflines >= 0 && (string) $savtotalnboflines != '') print ' ('.$totalnboflines.')';
print '</div></td>';
// Center

View File

@ -1056,13 +1056,13 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
{
$numFinal = preg_replace('/\{yyyy\}/i',date("Y",$date)+$yearoffset, $numFinal);
$numFinal = preg_replace('/\{yy\}/i', date("y",$date)+$yearoffset, $numFinal);
$numFinal = preg_replace('/\{y\}/i', substr(date("y",$date),2,1)+$yearoffset, $numFinal);
$numFinal = preg_replace('/\{y\}/i', substr(date("y",$date),1,1)+$yearoffset, $numFinal);
}
else // we want yyyy to be current year
{
$numFinal = preg_replace('/\{yyyy\}/i',date("Y",$date), $numFinal);
$numFinal = preg_replace('/\{yy\}/i', date("y",$date), $numFinal);
$numFinal = preg_replace('/\{y\}/i', substr(date("y",$date),2,1), $numFinal);
$numFinal = preg_replace('/\{y\}/i', substr(date("y",$date),1,1), $numFinal);
}
$numFinal = preg_replace('/\{mm\}/i', date("m",$date), $numFinal);
$numFinal = preg_replace('/\{dd\}/i', date("d",$date), $numFinal);

View File

@ -80,6 +80,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
$result=array();
// Clean parameters
if (empty($info_bits)) $info_bits=0;
if (empty($txtva)) $txtva=0;
if (empty($seller) || ! is_object($seller))
{

View File

@ -483,7 +483,7 @@ class pdf_einstein extends ModelePDFCommandes
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]='';
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=0;
$this->tva[$vatrate] += $tvaligne;
// Add line

View File

@ -585,7 +585,7 @@ class pdf_crabe extends ModelePDFFactures
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]='';
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=0;
$this->tva[$vatrate] += $tvaligne;
if ($posYAfterImage > $posYAfterDescription) $nexY=$posYAfterImage;

View File

@ -371,7 +371,7 @@ class modFournisseur extends DolibarrModules
// End add extra fields line
$this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s';
if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,';
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture_fourn as f';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as project on (f.fk_projet = project.rowid)';
@ -381,7 +381,7 @@ class modFournisseur extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)';
$this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture_fourn';
$this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('supplier_invoice',1).')';
if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id;
if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id;
$r++;
$this->export_code[$r]=$this->rights_class.'_'.$r;
@ -435,7 +435,7 @@ class modFournisseur extends DolibarrModules
// End add extra fields object
$this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s';
if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,';
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture_fourn as f';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as project on (f.fk_projet = project.rowid)';
@ -444,7 +444,7 @@ class modFournisseur extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn as p ON pf.fk_paiementfourn = p.rowid';
$this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('supplier_invoice',1).')';
if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id;
if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id;
// Order
$r++;
@ -541,7 +541,7 @@ class modFournisseur extends DolibarrModules
// End add extra fields line
$this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s';
if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,';
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'commande_fournisseur as f';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as project on (f.fk_projet = project.rowid)';
@ -553,7 +553,7 @@ class modFournisseur extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)';
$this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_commande';
$this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('supplier_order',1).')';
if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id;
if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id;
}

View File

@ -151,7 +151,7 @@ class modProduct extends DolibarrModules
$this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]="Products"; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("produit","export"));
$this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.url'=>"PublicUrl",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.length'=>"Length",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.customcode'=>'CustomCode','p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",'p.tobuy'=>"OnBuy",'p.datec'=>'DateCreation','p.tms'=>'DateModification');
$this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.url'=>"PublicUrl",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.length'=>"Length",'p.width'=>"Width",'p.height'=>"Height",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.customcode'=>'CustomCode','p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",'p.tobuy'=>"OnBuy",'p.datec'=>'DateCreation','p.tms'=>'DateModification');
if ($mysoc->useNPR()) $this->export_fields_array[$r]['p.recuperableonly']='NPR';
if (! empty($conf->stock->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.stock'=>'Stock','p.seuil_stock_alerte'=>'StockLimit','p.desiredstock'=>'DesiredStock','p.pmp'=>'PMPValue'));
if (! empty($conf->barcode->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.barcode'=>'BarCode'));
@ -159,13 +159,13 @@ class modProduct extends DolibarrModules
if (! empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.cost_price'=>'CostPrice'));
if (! empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('group_concat(cat.label)'=>'Categories'));
if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel','l.description'=>'TranslatedDescription','l.note'=>'TranslatedNote'));
$this->export_TypeFields_array[$r]=array('p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",'p.note'=>"Text",'p.length'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric",'p.weight'=>"Numeric",'p.customcode'=>'Text','p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.datec'=>'Date','p.tms'=>'Date');
$this->export_TypeFields_array[$r]=array('p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",'p.note'=>"Text",'p.length'=>"Numeric",'p.width'=>"Numeric",'p.height'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric",'p.weight'=>"Numeric",'p.customcode'=>'Text','p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.datec'=>'Date','p.tms'=>'Date');
if (! empty($conf->stock->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('p.stock'=>'Numeric','p.seuil_stock_alerte'=>'Numeric','p.desiredstock'=>'Numeric','p.pmp'=>'Numeric','p.cost_price'=>'Numeric'));
if (! empty($conf->barcode->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('p.barcode'=>'Text'));
if (! empty($conf->fournisseur->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('s.nom'=>'Text','pf.ref_fourn'=>'Text','pf.unitprice'=>'Numeric'));
if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('l.lang'=>'Text', 'l.label'=>'Text','l.description'=>'Text','l.note'=>'Text'));
if (! empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array("group_concat(cat.label)"=>'Text'));
$this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",'p.label'=>"product",'p.description'=>"product",'p.url'=>"product",'p.accountancy_code_sell'=>'product','p.accountancy_code_sell'=>'product','p.note'=>"product",'p.length'=>"product",'p.surface'=>"product",'p.volume'=>"product",'p.weight'=>"product",'p.customcode'=>'product','p.price_base_type'=>"product",'p.price'=>"product",'p.price_ttc'=>"product",'p.tva_tx'=>"product",'p.tosell'=>"product",'p.tobuy'=>"product",'p.datec'=>"product",'p.tms'=>"product");
$this->export_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
if (! empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array("group_concat(cat.label)"=>'category'));
if (! empty($conf->stock->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('p.stock'=>'product','p.pmp'=>'product'));
if (! empty($conf->barcode->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('p.barcode'=>'product'));

View File

@ -281,9 +281,9 @@ class modSociete extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as payterm ON s.cond_reglement = payterm.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as paymode ON s.mode_reglement = paymode.id';
$this->export_sql_end[$r] .=' WHERE s.entity IN ('.getEntity('societe', 1).')';
if(!$user->rights->societe->client->voir) {
if (is_object($user) && empty($user->rights->societe->client->voir)) {
$this->export_sql_end[$r] .=' AND (sc.fk_user = '.$user->id.' ';
if ($conf->global->SOCIETE_EXPORT_SUBORDINATES_CHILDS) {
if (! empty($conf->global->SOCIETE_EXPORT_SUBORDINATES_CHILDS)) {
$subordinatesids = $user->getAllChildIds();
$this->export_sql_end[$r] .=count($subronidatesids)>0 ? ' OR (sc.fk_user IN ('.implode(',',$subronidatesids).')' : '';
}
@ -313,14 +313,14 @@ class modSociete extends DolibarrModules
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'socpeople as c';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON c.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_extrafields as extrasoc ON s.rowid = extrasoc.fk_object';
if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON c.fk_departement = d.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON c.fk_pays = co.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra ON extra.fk_object = c.rowid';
$this->export_sql_end[$r] .=' WHERE c.entity IN ('.getEntity("societe", 1).')';
if(!$user->rights->societe->client->voir) {
if (is_object($user) && empty($user->rights->societe->client->voir)) {
$this->export_sql_end[$r] .=' AND (sc.fk_user = '.$user->id.' ';
if ($conf->global->SOCIETE_EXPORT_SUBORDINATES_CHILDS) {
if (! empty($conf->global->SOCIETE_EXPORT_SUBORDINATES_CHILDS)) {
$subordinatesids = $user->getAllChildIds();
$this->export_sql_end[$r] .=count($subronidatesids)>0 ? ' OR (sc.fk_user IN ('.implode(',',$subronidatesids).')' : '';
}

View File

@ -223,7 +223,7 @@ class pdf_baleine extends ModelePDFProjects
$progress=$object->lines[$i]->progress.'%';
$datestart=dol_print_date($object->lines[$i]->date_start,'day');
$dateend=dol_print_date($object->lines[$i]->date_end,'day');
$planned_workload=convertSecondToTime($object->lines[$i]->planned_workload,'allhourmin');
$planned_workload=convertSecondToTime((int) $object->lines[$i]->planned_workload,'allhourmin');
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page

View File

@ -582,7 +582,7 @@ class pdf_azur extends ModelePDFPropales
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]='';
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=0;
$this->tva[$vatrate] += $tvaligne;
if ($posYAfterImage > $posYAfterDescription) $nexY=$posYAfterImage;

View File

@ -170,7 +170,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
{
$object->fetch_thirdparty();
$deja_regle = "";
$deja_regle = 0;
$amount_credit_notes_included = 0;
$amount_deposits_included = 0;
//$amount_credit_notes_included = $object->getSumCreditNotesUsed();
@ -466,7 +466,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]='';
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=0;
$this->tva[$vatrate] += $tvaligne;

View File

@ -489,7 +489,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]='';
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=0;
$this->tva[$vatrate] += $tvaligne;
if ($posYAfterImage > $posYAfterDescription) $nexY=$posYAfterImage;

View File

@ -225,7 +225,7 @@ $sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -113,7 +113,7 @@ if (trim($search_name) != '')
if ($search_amount) $sql.= natural_search(array('d.amount'), price2num(trim($search_amount)), 1);
$sql.= $db->order($sortfield,$sortorder);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -238,7 +238,7 @@ $parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -266,7 +266,7 @@ $sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -371,7 +371,7 @@ $sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -6,7 +6,7 @@
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015-2007 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Abbes Bahfir <bafbes@gmail.com>
* Copyright (C) 2015-2016 Ferran Marcet <fmarcet@2byte.es>
*
@ -372,7 +372,7 @@ $sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
@ -434,6 +434,7 @@ if ($resql)
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
print '<input type="hidden" name="socid" value="'.$socid.'">';
print_barre_liste($langs->trans("BillsSuppliers").($socid?" - $soc->name":""), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
@ -797,7 +798,7 @@ if ($resql)
$thirdparty->name=$obj->name;
$thirdparty->client=$obj->client;
$thirdparty->code_client=$obj->code_client;
print $thirdparty->getNomUrl(1,'customer');
print $thirdparty->getNomUrl(1,'supplier');
print '</td>';
if (! $i) $totalarray['nbfield']++;
}

View File

@ -639,7 +639,7 @@ if (empty($action))
if (!$user->rights->societe->client->voir) $sql .= ", sc.fk_soc, sc.fk_user";
$sql.= $db->order($sortfield,$sortorder);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -120,7 +120,7 @@ if ($fourn_id > 0)
$sql .= " AND ppf.fk_soc = ".$fourn_id;
}
// Count total nb of records without orderby and limit
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -127,7 +127,8 @@ class Holiday extends CommonObject
// Check parameters
if (empty($this->fk_user) || ! is_numeric($this->fk_user) || $this->fk_user < 0) { $this->error="ErrorBadParameter"; return -1; }
if (empty($this->fk_validator) || ! is_numeric($this->fk_validator) || $this->fk_validator < 0) { $this->error="ErrorBadParameter"; return -1; }
if (empty($this->fk_type) || ! is_numeric($this->fk_type) || $this->fk_type < 0) { $this->error="ErrorBadParameter"; return -1; }
// Insert request
$sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday(";
$sql.= "fk_user,";
@ -150,7 +151,7 @@ class Holiday extends CommonObject
$sql.= " ".$this->halfday.",";
$sql.= " '1',";
$sql.= " '".$this->fk_validator."',";
$sql.= " '".$this->fk_type."',";
$sql.= " ".$this->fk_type.",";
$sql.= " ".$user->id.",";
$sql.= " ".$conf->entity;
$sql.= ")";
@ -281,7 +282,7 @@ class Holiday extends CommonObject
$sql = "SELECT";
$sql.= " cp.rowid,";
$sql.= " cp.fk_user,";
$sql.= " cp.date_create,";
$sql.= " cp.description,";
@ -868,7 +869,7 @@ class Holiday extends CommonObject
{
$sql = "SELECT value";
$sql.= " FROM ".MAIN_DB_PREFIX."holiday_config";
$sql.= " WHERE name = '".$name."'";
$sql.= " WHERE name = '".$this->db->escape($name)."'";
dol_syslog(get_class($this).'::getConfCP name='.$name.' createifnotfound='.$createifnotfound, LOG_DEBUG);
$result = $this->db->query($sql);
@ -882,7 +883,7 @@ class Holiday extends CommonObject
if ($createifnotfound)
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday_config(name, value)";
$sql.= " VALUES('".$name."', '".$createifnotfound."')";
$sql.= " VALUES('".$this->db->escape($name)."', '".$this->db->escape($createifnotfound)."')";
$result = $this->db->query($sql);
if ($result)
{
@ -947,7 +948,7 @@ class Holiday extends CommonObject
$nbUser = count($users);
$sql = "UPDATE ".MAIN_DB_PREFIX."holiday_config SET";
$sql.= " value = '".$newdateforlastupdate."'";
$sql.= " value = '".$this->db->escape($newdateforlastupdate)."'";
$sql.= " WHERE name = 'lastUpdate'";
$result = $this->db->query($sql);
@ -1634,6 +1635,7 @@ class Holiday extends CommonObject
$this->date_fin=dol_now()+(24*3600);
$this->fk_validator=1;
$this->halfday=0;
$this->fk_type=1;
}
}

View File

@ -586,7 +586,7 @@ Permission34=Delete products
Permission36=See/manage hidden products
Permission38=Export products
Permission41=Read projects and tasks (shared project and projects i'm contact for). Can also enter time consumed on assigned tasks (timesheet)
Permission42=Create/modify projects (shared project and projects i'm contact for)
Permission42=Create/modify projects (shared project and projects i'm contact for). Can also create tasks and assign users to project and tasks
Permission44=Delete projects (shared project and projects i'm contact for)
Permission45=Export projects
Permission61=Read interventions
@ -689,7 +689,7 @@ PermissionAdvanced253=Create/modify internal/external users and permissions
Permission254=Create/modify external users only
Permission255=Modify other users password
Permission256=Delete or disable other users
Permission262=Extend access to all third parties (not only those linked to user). Not effective for external users (always limited to themselves).
Permission262=Extend access to all third parties (not only third parties that user is a sale representative). Not effective for external users (always limited to themselves for proposals, orders, invoices, contracts, etc). Not effective for projects (only rules on project permissions, visibility and assignement matters).
Permission271=Read CA
Permission272=Read invoices
Permission273=Issue invoices

View File

@ -179,6 +179,7 @@ ErrorModuleNotFound=File of module was not found.
ErrorFieldAccountNotDefinedForBankLine=Value for Accounting account not defined for source bank line %s
ErrorBankStatementNameMustFollowRegex=Error, bank statement name must follow the following syntax rule %s
ErrorPhpMailDelivery=Check that you don't use a too high number of recipients and that your email content is not similar to a Spam. Ask also your administrator to check firewall and server logs files for a more complete information.
ErrorUserNotAssignedToTask=User must be assigned to task to be able to enter time consumed.
# Warnings
WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user.

View File

@ -41,6 +41,7 @@ InterventionDeletedInDolibarr=Intervention %s deleted
InterventionsArea=Interventions area
DraftFichinter=Draft interventions
LastModifiedInterventions=Latest %s modified interventions
FichinterToProcess=Interventions to process
##### Types de contacts #####
TypeContact_fichinter_external_CUSTOMER=Following-up customer contact
# Modele numérotation

View File

@ -139,4 +139,5 @@ OptionMULTIPRICESIsOn=Option "several prices per segment" is on. It means a prod
ProductStockWarehouseCreated=Stock limit for alert and desired optimal stock correctly created
ProductStockWarehouseUpdated=Stock limit for alert and desired optimal stock correctly updated
ProductStockWarehouseDeleted=Stock limit for alert and desired optimal stock correctly deleted
AddNewProductStockWarehouse=Set new limit for alert and desired optimal stock
AddNewProductStockWarehouse=Set new limit for alert and desired optimal stock
AddStockLocationLine=Decrease quantity then click to add another warehouse for this product

View File

@ -86,7 +86,7 @@ if ($filtre) {
$sql.= " GROUP BY l.rowid, l.label, l.capital, l.datestart, l.dateend";
$sql.= $db->order($sortfield,$sortorder);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -1935,11 +1935,11 @@ if (! function_exists("llxFooter"))
var scrollBottom = $(window).scrollTop() + $(window).height();
//console.log(scrollBottom);
diffoutsidebottom = (posbottom - scrollBottom);
console.log("diffoutsidebottom (positive = outside) = "+diffoutsidebottom);
console.log("heigthofcontent="+heigthofcontent+", diffoutsidebottom (posbottom="+posbottom+" - scrollBottom="+scrollBottom+") = "+diffoutsidebottom);
if (diffoutsidebottom > 0)
{
pix = "-"+diffoutsidebottom+"px";
console.log(pix);
pix = "-"+(diffoutsidebottom+8)+"px";
console.log("We reposition top by "+pix);
$(this).parent().parent().find(\'dd\').css("top", pix);
}
// $(".dropdown dd ul").slideToggle(\'fast\');

View File

@ -157,7 +157,7 @@ if (! empty($enddate))
$sql .= " AND d.buy_price_ht IS NOT NULL";
$sql .= $db->order($sortfield, $sortorder);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
dol_syslog(__FILE__, LOG_DEBUG);

View File

@ -124,7 +124,7 @@ $sql.= " u.login, u.firstname, u.lastname";
$sql.= " FROM ".MAIN_DB_PREFIX."opensurvey_sondage as p";
$sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."user u ON u.rowid = p.fk_user_creat";
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -283,7 +283,9 @@ if (empty($reshook))
$object->weight_units = GETPOST('weight_units');
$object->length = GETPOST('size');
$object->length_units = GETPOST('size_units');
$object->surface = GETPOST('surface');
$object->width = GETPOST('sizewidth');
$object->height = GETPOST('sizeheight');
$object->surface = GETPOST('surface');
$object->surface_units = GETPOST('surface_units');
$object->volume = GETPOST('volume');
$object->volume_units = GETPOST('volume_units');
@ -380,6 +382,9 @@ if (empty($reshook))
$object->weight_units = GETPOST('weight_units');
$object->length = GETPOST('size');
$object->length_units = GETPOST('size_units');
$object->width = GETPOST('sizewidth');
$object->height = GETPOST('sizeheight');
$object->surface = GETPOST('surface');
$object->surface_units = GETPOST('surface_units');
$object->volume = GETPOST('volume');
@ -1010,10 +1015,12 @@ else
print $formproduct->select_measuring_units("weight_units","weight");
print '</td></tr>';
// Length
if (empty($conf->global->PRODUCT_DISABLE_LENGTH))
if (empty($conf->global->PRODUCT_DISABLE_SIZE))
{
print '<tr><td>'.$langs->trans("Length").'</td><td colspan="3">';
print '<input name="size" size="4" value="'.GETPOST('size').'">';
print '<tr><td>'.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").'</td><td colspan="3">';
print '<input name="size" size="4" value="'.GETPOST('size').'"> x ';
print '<input name="sizewidth" size="4" value="'.GETPOST('sizewidth').'"> x ';
print '<input name="sizeheight" size="4" value="'.GETPOST('sizeheight').'">';
print $formproduct->select_measuring_units("size_units","size");
print '</td></tr>';
}
@ -1324,13 +1331,15 @@ else
print '<input name="weight" size="5" value="'.$object->weight.'"> ';
print $formproduct->select_measuring_units("weight_units", "weight", $object->weight_units);
print '</td></tr>';
if (empty($conf->global->PRODUCT_DISABLE_LENGTH))
if (empty($conf->global->PRODUCT_DISABLE_SIZE))
{
// Length
print '<tr><td>'.$langs->trans("Length").'</td><td colspan="3">';
print '<input name="size" size="5" value="'.$object->length.'"> ';
print $formproduct->select_measuring_units("size_units", "size", $object->length_units);
print '</td></tr>';
// Length
print '<tr><td>'.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").'</td><td colspan="3">';
print '<input name="size" size="5" value="'.$object->length.'">x';
print '<input name="sizewidth" size="5" value="'.$object->width.'">x';
print '<input name="sizeheight" size="5" value="'.$object->height.'"> ';
print $formproduct->select_measuring_units("size_units", "size", $object->length_units);
print '</td></tr>';
}
if (empty($conf->global->PRODUCT_DISABLE_SURFACE))
{
@ -1340,11 +1349,14 @@ else
print $formproduct->select_measuring_units("surface_units", "surface", $object->surface_units);
print '</td></tr>';
}
// Volume
print '<tr><td>'.$langs->trans("Volume").'</td><td colspan="3">';
print '<input name="volume" size="5" value="'.$object->volume.'"> ';
print $formproduct->select_measuring_units("volume_units", "volume", $object->volume_units);
print '</td></tr>';
if (empty($conf->global->PRODUCT_DISABLE_VOLUME))
{
// Volume
print '<tr><td>'.$langs->trans("Volume").'</td><td colspan="3">';
print '<input name="volume" size="5" value="'.$object->volume.'"> ';
print $formproduct->select_measuring_units("volume_units", "volume", $object->volume_units);
print '</td></tr>';
}
}
// Units
if($conf->global->PRODUCT_USE_UNITS)
@ -1635,13 +1647,16 @@ else
print '&nbsp;';
}
print "</td></tr>\n";
if (empty($conf->global->PRODUCT_DISABLE_LENGTH))
if (empty($conf->global->PRODUCT_DISABLE_SIZE))
{
// Length
print '<tr><td>'.$langs->trans("Length").'</td><td colspan="2">';
if ($object->length != '')
print '<tr><td>'.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").'</td><td colspan="2">';
if ($object->length != '' || $object->width != '' || $object->height != '')
{
print $object->length." ".measuring_units_string($object->length_units,"size");
print $object->length;
if ($object->width) print " x ".$object->width;
if ($object->height) print " x ".$object->height;
print ' '.measuring_units_string($object->length_units,"size");
}
else
{
@ -1663,17 +1678,20 @@ else
}
print "</td></tr>\n";
}
// Volume
print '<tr><td>'.$langs->trans("Volume").'</td><td colspan="2">';
if ($object->volume != '')
if (empty($conf->global->PRODUCT_DISABLE_VOLUME))
{
print $object->volume." ".measuring_units_string($object->volume_units,"volume");
// Volume
print '<tr><td>'.$langs->trans("Volume").'</td><td colspan="2">';
if ($object->volume != '')
{
print $object->volume." ".measuring_units_string($object->volume_units,"volume");
}
else
{
print '&nbsp;';
}
print "</td></tr>\n";
}
else
{
print '&nbsp;';
}
print "</td></tr>\n";
}
// Unit

View File

@ -126,7 +126,7 @@ class ProductApi extends DolibarrApi
// Show product on buy
if ($to_buy) $sql.= " AND p.to_buy = ".$db->escape($to_buy);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
@ -212,7 +212,7 @@ class ProductApi extends DolibarrApi
// Show product on buy
if ($to_buy) $sql.= " AND p.to_buy = ".$db->escape($to_buy);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -636,6 +636,25 @@ class Product extends CommonObject
$this->weight_units = trim($this->weight_units);
$this->length = price2num($this->length);
$this->length_units = trim($this->length_units);
$this->width = price2num($this->width);
$this->width_units = trim($this->width_units);
$this->height = price2num($this->height);
$this->height_units = trim($this->height_units);
// set unit not defined
if ($this->length_units) $this->width_units = $this->length_units; // Not used yet
if ($this->length_units) $this->height_units = $this->length_units; // Not used yet
// Automated compute surface and volume if not filled
if (empty($this->surface) && !empty($this->length) && !empty($this->width) && $this->length_units == $this->width_units)
{
$this->surface = $this->length * $this->width;
$this->surface_units = $this->length_units + $this->width_units;
}
if (empty($this->volume) && !empty($this->surface_units) && !empty($this->height) && $this->length_units == $this->height_units)
{
$this->volume = $this->surface * $this->height;
$this->volume_units = $this->surface_units + $this->height_units;
}
$this->surface = price2num($this->surface);
$this->surface_units = trim($this->surface_units);
$this->volume = price2num($this->volume);
@ -750,6 +769,10 @@ class Product extends CommonObject
$sql.= ", weight_units = " . ($this->weight_units!='' ? "'".$this->weight_units."'": 'null');
$sql.= ", length = " . ($this->length!='' ? "'".$this->length."'" : 'null');
$sql.= ", length_units = " . ($this->length_units!='' ? "'".$this->length_units."'" : 'null');
$sql.= ", width= " . ($this->width!='' ? "'".$this->width."'" : 'null');
$sql.= ", width_units = " . ($this->width_units!='' ? "'".$this->width_units."'" : 'null');
$sql.= ", height = " . ($this->height!='' ? "'".$this->height."'" : 'null');
$sql.= ", height_units = " . ($this->height_units!='' ? "'".$this->height_units."'" : 'null');
$sql.= ", surface = " . ($this->surface!='' ? "'".$this->surface."'" : 'null');
$sql.= ", surface_units = " . ($this->surface_units!='' ? "'".$this->surface_units."'" : 'null');
$sql.= ", volume = " . ($this->volume!='' ? "'".$this->volume."'" : 'null');
@ -1673,8 +1696,9 @@ class Product extends CommonObject
$sql = "SELECT rowid, ref, ref_ext, label, description, url, note as note_private, customcode, fk_country, price, price_ttc,";
$sql.= " price_min, price_min_ttc, price_base_type, cost_price, default_vat_code, tva_tx, recuperableonly as tva_npr, localtax1_tx, localtax2_tx, localtax1_type, localtax2_type, tosell,";
$sql.= " tobuy, fk_product_type, duration, seuil_stock_alerte, canvas,";
$sql.= " weight, weight_units, length, length_units, surface, surface_units, volume, volume_units, barcode, fk_barcode_type, finished,";
$sql.= " tobuy, fk_product_type, duration, seuil_stock_alerte, canvas, weight, weight_units,";
$sql.= " length, length_units, width, width_units, height, height_units,";
$sql.= " surface, surface_units, volume, volume_units, barcode, fk_barcode_type, finished,";
$sql.= " accountancy_code_buy, accountancy_code_sell, stock, pmp,";
$sql.= " datec, tms, import_key, entity, desiredstock, tobatch, fk_unit,";
$sql.= " fk_price_expression, price_autogen";
@ -1736,6 +1760,11 @@ class Product extends CommonObject
$this->weight_units = $obj->weight_units;
$this->length = $obj->length;
$this->length_units = $obj->length_units;
$this->width = $obj->width;
$this->width_units = $obj->width_units;
$this->height = $obj->height;
$this->height_units = $obj->height_units;
$this->surface = $obj->surface;
$this->surface_units = $obj->surface_units;
$this->volume = $obj->volume;

View File

@ -304,7 +304,7 @@ else
$sql.=$hookmanager->resPrint;
//if (GETPOST("toolowstock")) $sql.= " HAVING SUM(s.reel) < p.seuil_stock_alerte"; // Not used yet
$sql.= $db->order($sortfield,$sortorder);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -1668,7 +1668,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
$filter = array('t.fk_product' => $object->id,'t.fk_soc' => GETPOST('socid', 'int'));
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$nbtotalofrecords = $prodcustprice->fetch_all_log($sortorder, $sortfield, $conf->liste_limit, $offset, $filter);
}
@ -1748,7 +1748,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
// List of all prices by customers
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$nbtotalofrecords = $prodcustprice->fetch_all($sortorder, $sortfield, 0, 0, $filter);
}

View File

@ -45,6 +45,7 @@ $ref = GETPOST('ref');
$mode = (GETPOST('mode') ? GETPOST('mode') : 'byunit');
$error = 0;
$mesg = '';
$graphfiles=array();
$socid='';
if (! empty($user->societe_id)) $socid=$user->societe_id;
@ -58,7 +59,7 @@ $result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','',
/*
* View
*/
$form = new Form($db);
if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all')
@ -69,7 +70,7 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all')
llxHeader("",$langs->trans("ProductStatistics"));
$type = GETPOST('type');
$helpurl='';
if ($type == '0')
{
@ -89,13 +90,13 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all')
//$title=$langs->trans("StatisticsOfProductsOrServices");
$title=$langs->trans("Statistics");
}
print load_fiche_titre($title, $mesg,'title_products.png');
}
else
{
$result = $object->fetch($id,$ref);
$title = $langs->trans('ProductServiceCard');
$helpurl = '';
$shortlabel = dol_trunc($object->label,16);
@ -112,8 +113,8 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all')
llxHeader('', $title, $helpurl);
}
if ($result && (! empty($id) || ! empty($ref)))
{
$head=product_prepare_head($object);
@ -125,19 +126,19 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all')
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', '', '', '', 0, '', '', 1);
dol_fiche_end();
dol_fiche_end();
}
if (GETPOST('id') == 'all')
{
$h=0;
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/product/stats/card.php?id=all';
$head[$h][1] = $langs->trans("Chart");
$head[$h][2] = 'chart';
$h++;
$title = $langs->trans("ListProductServiceByPopularity");
if ((string) $type == '1') {
$title = $langs->trans("ListServiceByPopularity");
@ -145,49 +146,49 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all')
if ((string) $type == '0') {
$title = $langs->trans("ListProductByPopularity");
}
$head[$h][0] = DOL_URL_ROOT.'/product/popuprop.php'.($type != ''?'?type='.$type:'');
$head[$h][1] = $title;
$head[$h][2] = 'popularityprop';
$h++;
dol_fiche_head($head,'chart',$langs->trans("Statistics"));
dol_fiche_head($head,'chart',$langs->trans("Statistics"));
}
if ($result || GETPOST('id') == 'all')
{
if (GETPOST('id') == 'all')
{
// Choice of type of product
if (! empty($conf->dol_use_jmobile)) print "\n".'<div class="fichecenter"><div class="nowrap">'."\n";
if ((string) $type != '0') print '<a href="'.$_SERVER["PHP_SELF"].'?id='.(GETPOST('id')?GETPOST('id'):$object->id).'&type=0'.($mode?'&mode='.$mode:'').'">';
else print img_picto('','tick').' ';
print $langs->trans("Products");
if ((string) $type != '0') print '</a>';
if (! empty($conf->dol_use_jmobile)) print '</div>'."\n".'<div class="nowrap">'."\n";
else print ' &nbsp; / &nbsp; ';
if ((string) $type != '1') print '<a href="'.$_SERVER["PHP_SELF"].'?id='.(GETPOST('id')?GETPOST('id'):$object->id).'&type=1'.($mode?'&mode='.$mode:'').'">';
else print img_picto('','tick').' ';
print $langs->trans("Services");
if ((string) $type != '1') print '</a>';
if (! empty($conf->dol_use_jmobile)) print '</div>'."\n".'<div class="nowrap">'."\n";
else print ' &nbsp; / &nbsp; ';
if ((string) $type == '0' || (string) $type == '1') print '<a href="'.$_SERVER["PHP_SELF"].'?id='.(GETPOST('id')?GETPOST('id'):$object->id).($mode?'&mode='.$mode:'').'">';
else print img_picto('','tick').' ';
print $langs->trans("ProductsAndServices");
if ((string) $type == '0' || (string) $type == '1') print '</a>';
if (! empty($conf->dol_use_jmobile)) print '</div></div>';
else print '<br>';
print '<br>';
}
// Choice of stats mode (byunit or bynumber)
if (! empty($conf->dol_use_jmobile)) print "\n".'<div class="fichecenter"><div class="nowrap">'."\n";
@ -223,25 +224,25 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all')
}
}
}
if($conf->propal->enabled) {
$graphfiles['propal']=array('modulepart'=>'productstats_proposals',
'file' => $object->id.'/propal12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png',
'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsProposals"):$langs->transnoentitiesnoconv("NumberOfProposals")));
}
if($conf->supplier_proposal->enabled) {
$graphfiles['proposalssuppliers']=array('modulepart'=>'productstats_proposalssuppliers',
'file' => $object->id.'/proposalssuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png',
'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsSupplierProposals"):$langs->transnoentitiesnoconv("NumberOfSupplierProposals")));
}
if($conf->order->enabled) {
$graphfiles['orders']=array('modulepart'=>'productstats_orders',
'file' => $object->id.'/orders12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png',
'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsCustomerOrders"):$langs->transnoentitiesnoconv("NumberOfCustomerOrders")));
}
if($conf->fournisseur->enabled) {
$graphfiles['orderssuppliers']=array('modulepart'=>'productstats_orderssuppliers',
'file' => $object->id.'/orderssuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png',
@ -252,7 +253,7 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all')
$graphfiles['invoices']=array('modulepart'=>'productstats_invoices',
'file' => $object->id.'/invoices12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png',
'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsCustomerInvoices"):$langs->transnoentitiesnoconv("NumberOfCustomerInvoices")));
$graphfiles['invoicessuppliers']=array('modulepart'=>'productstats_invoicessuppliers',
'file' => $object->id.'/invoicessuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png',
'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsSupplierInvoices"):$langs->transnoentitiesnoconv("NumberOfSupplierInvoices")));
@ -283,10 +284,10 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all')
if ($key == 'proposalssuppliers') $graph_data = $object->get_nb_propalsupplier($socid,$mode,((string) $type != '' ? $type : -1));
if ($key == 'invoicessuppliers') $graph_data = $object->get_nb_achat($socid,$mode,((string) $type != '' ? $type : -1));
if ($key == 'orderssuppliers') $graph_data = $object->get_nb_ordersupplier($socid,$mode,((string) $type != '' ? $type : -1));
// TODO Save cachefile $graphfiles[$key]['file']
}
if (is_array($graph_data))
{
$px->SetData($graph_data);
@ -387,7 +388,7 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all')
print '<div class="clear"><div class="fichecenter"><br></div></div>'."\n";
}
}
if (GETPOST('id') == 'all')
{
dol_fiche_end();

View File

@ -374,7 +374,8 @@ else
{
$limit = $conf->global->PRODUIT_LIMIT_SIZE;
}
print $form->select_produits($id_product, 'productid', $filtertype, $limit, 0, 1, 2, '', 0, array(), 0, '1', 0, 'minwidth300imp maxwidth400', 1);
print $form->select_produits($id_product, 'productid', $filtertype, $limit, 0, -1, 2, '', 0, array(), 0, '1', 0, 'minwidth300imp maxwidth400', 1);
print '</td>';
// Batch number
if ($conf->productbatch->enabled)

View File

@ -456,7 +456,7 @@ $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // No
$sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -259,7 +259,7 @@ $sql.=$db->order($sortfield,$sortorder);
//$sql.= $db->plimit($conf->liste_limit+1, $offset);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -69,7 +69,7 @@ if ($id > 0 || ! empty($ref))
// Security check
$socid=GETPOST('socid');
if ($user->societe_id > 0) $socid=$user->societe_id;
//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result = restrictedArea($user, 'projet', $object->id,'projet&project');
// fetch optionals attributes and labels
@ -704,7 +704,7 @@ elseif ($object->id > 0)
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
$filteronlist='';
if (! empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) $filteronlist=$conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST;
$text=$form->select_thirdparty_list($object->thirdparty->id, 'socid', $filteronlist, 'SelectThirdParty', 1, 0, array(), '', 0, 0, 'minwidth300');
$text=$form->select_thirdparty_list($object->thirdparty->id, 'socid', $filteronlist, 'None', 1, 0, array(), '', 0, 0, 'minwidth300');
if (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) && empty($conf->dol_use_jmobile))
{
$texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty");

View File

@ -46,7 +46,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu
// Security check
$socid=0;
if ($user->societe_id > 0) $socid=$user->societe_id;
//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result = restrictedArea($user, 'projet', $id,'projet&project');

View File

@ -42,7 +42,7 @@ $mine = (GETPOST('mode','alpha') == 'mine' ? 1 : 0);
// Security check
$socid=0;
if ($user->societe_id > 0) $socid=$user->societe_id;
//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result=restrictedArea($user,'projet',$id,'projet&project');
$object = new Project($db);

View File

@ -95,7 +95,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu
// Security check
$socid=$object->socid;
if ($user->societe_id > 0) $socid=$user->societe_id;
//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result = restrictedArea($user, 'projet', $projectid, 'projet&project');

View File

@ -43,7 +43,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu
// Security check
$socid=0;
if ($user->societe_id > 0) $socid=$user->societe_id;
//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result = restrictedArea($user, 'projet', $id,'projet&project');
$langs->load("users");

View File

@ -37,7 +37,7 @@ $mine = GETPOST('mode')=='mine' ? 1 : 0;
// Security check
$socid=0;
if ($user->societe_id > 0) $socid=$user->societe_id;
//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
if (!$user->rights->projet->lire) accessforbidden();
$sortfield = GETPOST("sortfield",'alpha');

View File

@ -58,9 +58,11 @@ else
}
$search_agenda_label=GETPOST('search_agenda_label');
// Security check
$id = GETPOST("id",'int');
$socid=0;
if ($user->societe_id) $socid=$user->societe_id;
//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result=restrictedArea($user,'projet',$id,'');
if (!$user->rights->projet->lire) accessforbidden();

View File

@ -40,7 +40,7 @@ $title = $langs->trans("Projects");
// Security check
$socid = (is_numeric($_GET["socid"]) ? $_GET["socid"] : 0 );
if ($user->societe_id > 0) $socid=$user->societe_id;
//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
if ($socid > 0)
{
$soc = new Societe($db);
@ -235,7 +235,9 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls on p.fk_opp_status = c
// We'll need this table joined to the select in order to filter by categ
if (! empty($search_categ)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_project as cs ON p.rowid = cs.fk_project"; // We'll need this table joined to the select in order to filter by categ
// We'll need this table joined to the select in order to filter by sale
if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid";
// For external user, no check is done on company permission because readability is managed by public status of project and assignement.
//if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid";
if ($search_sale > 0) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid";
if ($search_user > 0)
{
$sql.=", ".MAIN_DB_PREFIX."element_contact as ecp";
@ -292,7 +294,8 @@ if ($search_opp_status)
}
if ($search_public!='') $sql .= " AND p.public = ".$db->escape($search_public);
if ($search_sale > 0) $sql.= " AND sc.fk_user = " .$search_sale;
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))";
// For external user, no check is done on company permission because readability is managed by public status of project and assignement.
//if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))";
if ($search_user > 0) $sql.= " AND ecp.fk_c_type_contact IN (".join(',',array_keys($listofprojectcontacttype)).") AND ecp.element_id = p.rowid AND ecp.fk_socpeople = ".$search_user;
if ($search_opp_amount != '') $sql .= natural_search('p.opp_amount', $search_opp_amount, 1);
if ($search_budget_amount != '') $sql .= natural_search('p.budget_amount', $search_budget_amount, 1);
@ -315,7 +318,7 @@ $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // No
$sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -41,7 +41,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu
// Security check
$socid=0;
if ($user->societe_id > 0) $socid=$user->societe_id;
//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result = restrictedArea($user, 'projet', $id,'projet&project');
$permissionnote=$user->rights->projet->creer; // Used by the include of actions_setnotes.inc.php

View File

@ -61,7 +61,7 @@ $extralabels_task=$extrafields_task->fetch_name_optionals_label($taskstatic->tab
// Security check
$socid=0;
if ($user->societe_id > 0) $socid = $user->societe_id;
//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result = restrictedArea($user, 'projet', $id,'projet&project');
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
@ -455,7 +455,8 @@ else if ($id > 0 || ! empty($ref))
// Get list of tasks in tasksarray and taskarrayfiltered
// We need all tasks (even not limited to a user because a task to user can have a parent that is not affected to him).
$tasksarray=$taskstatic->getTasksArray(0, 0, $object->id, $socid, 0);
$filteronthirdpartyid = $socid;
$tasksarray=$taskstatic->getTasksArray(0, 0, $object->id, $filteronthirdpartyid, 0);
// We load also tasks limited to a particular user
$tasksrole=($mode=='mine' ? $taskstatic->getUserRolesForProjectsOrTasks(0,$user,$object->id,0) : '');
//var_dump($tasksarray);

View File

@ -42,7 +42,7 @@ $project_ref=GETPOST('project_ref','alpha');
// Security check
$socid=0;
if ($user->societe_id > 0) $socid = $user->societe_id;
//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
//$result = restrictedArea($user, 'projet', $id, 'projet_task');
if (! $user->rights->projet->lire) accessforbidden();

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