fix travis (mosty for dev no conerne by my changes)

This commit is contained in:
florian HENRY 2019-02-13 09:21:14 +01:00
parent d88475c61a
commit 5c059c897d
12 changed files with 98 additions and 87 deletions

View File

@ -87,7 +87,7 @@ if ($user->societe_id > 0)
$filesarray=array();
$result=false;
if(($action=="searchfiles"||$action=="dl" ) && $date_start && $date_stop){
if(($action=="searchfiles" || $action=="dl" ) && $date_start && $date_stop) {
$wheretail=" '".$db->idate($date_start)."' AND '".$db->idate($date_stop)."'";
$sql="SELECT rowid as id, ref as ref,paye as paid, total_ttc, fk_soc, datef as date, 'Invoice' as item FROM ".MAIN_DB_PREFIX."facture";
$sql.=" WHERE datef between ".$wheretail;

View File

@ -488,7 +488,7 @@ if ($sql_select)
$description=(! empty($conf->global->PRODUIT_DESC_IN_FORM)?'':dol_htmlentitiesbr($objp->description));
}
if (($objp->info_bits & 2) == 2) {
if (($objp->info_bits & 2) == 2) {
print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'">';
$txt='';
print img_object($langs->trans("ShowReduc"), 'reduc').' ';

View File

@ -164,9 +164,11 @@ class CMeasuringUnits // extends CommonObject
* Load object in memory from database
*
* @param int $id Id object
* @param string $unit_type unit type
* @param string $code Code
* @param string $label Label
* @return int <0 if KO, >0 if OK
* @param string $short_label Short Label
* @return int <0 if KO, >0 if OK
*/
function fetch($id, $unit_type='', $code = '', $short_label = '')
{

View File

@ -488,10 +488,10 @@ abstract class CommonDocGenerator
if (empty($resarray[$array_key.'_total_vat_'.$vatformated])) $resarray[$array_key.'_total_vat_'.$vatformated]=0;
$resarray[$array_key.'_total_vat_'.$vatformated]+=$line->total_tva;
$resarray[$array_key.'_total_vat_locale_'.$vatformated]=price($resarray[$array_key.'_total_vat_'.$vatformated]);
$totalUp += $line->subprice * $line->qty;
}
// @GS: Calculate total up and total discount percentage
// Note that this added fields correspond to nothing in Dolibarr (Dolibarr manage discount on lines not globally)
$resarray['object_total_up'] = $totalUp;
@ -501,7 +501,7 @@ abstract class CommonDocGenerator
$resarray['object_total_discount_locale'] = price($resarray['object_total_discount'], 0, $outputlangs);
}
}
// Retrieve extrafields
if (is_array($object->array_options) && count($object->array_options))
{
@ -514,7 +514,7 @@ abstract class CommonDocGenerator
$resarray = $this->fill_substitutionarray_with_extrafields($object, $resarray, $extrafields, $array_key, $outputlangs);
}
return $resarray;
}
@ -585,7 +585,7 @@ abstract class CommonDocGenerator
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey, true);
$line->fetch_optionals();
$resarray = $this->fill_substitutionarray_with_extrafields($line, $resarray, $extrafields, $array_key=$array_key, $outputlangs);
$resarray = $this->fill_substitutionarray_with_extrafields($line, $resarray, $extrafields, $array_key, $outputlangs);
// Load product data optional fields to the line -> enables to use "line_options_{extrafield}"
if (isset($line->fk_product) && $line->fk_product > 0)

View File

@ -160,7 +160,7 @@ class CUnits // extends CommonObject
*
* @param int $id Id object
* @param string $code Code
* @param string $label Label
* @param string $short_label Label
* @return int <0 if KO, >0 if OK
*/
function fetch($id, $code = '', $short_label = '')

View File

@ -461,7 +461,6 @@ function show_stats_for_company($product, $socid)
return $nblines++;
}
/**
* Return translation label of a unit key
*
@ -476,6 +475,7 @@ function measuring_units_string($unit, $measuring_style = '')
require_once DOL_DOCUMENT_ROOT.'/core/class/cmeasuringunits.class.php';
$measuringUnits= new CMeasuringUnits($db);
$result=$measuringUnits->fetchAll('','', 0, 0, array('t.code'=> $unit,'t.unit_type'=>$measuring_style,'t.active'=>1));
if ($result<0) {
return -1;
} else {

View File

@ -207,18 +207,18 @@ if ($result)
print "<table class=\"noborder\" width=\"100%\">";
print '<tr class="liste_titre">';
if ($agentid > 0)
print_liste_field_titre("Customer", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
else
print_liste_field_titre("SalesRepresentative", $_SERVER["PHP_SELF"], "u.lastname", "", $param, '', $sortfield, $sortorder);
if ($agentid > 0)
print_liste_field_titre("Customer", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
else
print_liste_field_titre("SalesRepresentative", $_SERVER["PHP_SELF"], "u.lastname", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("SellingPrice",$_SERVER["PHP_SELF"], "selling_price", "", $param, 'align="right"', $sortfield, $sortorder);
print_liste_field_titre($labelcostprice,$_SERVER["PHP_SELF"], "buying_price", "", $param,' align="right"', $sortfield, $sortorder);
print_liste_field_titre("Margin",$_SERVER["PHP_SELF"], "marge", "", $param, 'align="right"', $sortfield, $sortorder);
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
print_liste_field_titre("MarginRate",$_SERVER["PHP_SELF"], "", "", $param, 'align="right"', $sortfield, $sortorder);
if (! empty($conf->global->DISPLAY_MARK_RATES))
print_liste_field_titre("MarkRate",$_SERVER["PHP_SELF"], "", "", $param, 'align="right"', $sortfield, $sortorder);
print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", $param, 'align="right"', $sortfield, $sortorder);
print_liste_field_titre($labelcostprice, $_SERVER["PHP_SELF"], "buying_price", "", $param, ' align="right"', $sortfield, $sortorder);
print_liste_field_titre("Margin", $_SERVER["PHP_SELF"], "marge", "", $param, 'align="right"', $sortfield, $sortorder);
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
print_liste_field_titre("MarginRate", $_SERVER["PHP_SELF"], "", "", $param, 'align="right"', $sortfield, $sortorder);
if (! empty($conf->global->DISPLAY_MARK_RATES))
print_liste_field_titre("MarkRate", $_SERVER["PHP_SELF"], "", "", $param, 'align="right"', $sortfield, $sortorder);
print "</tr>\n";
$rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT);

View File

@ -47,17 +47,17 @@ $langs->loadLangs(array('products', 'stocks', 'orders'));
if (! empty($conf->productbatch->enabled)) $langs->load("productbatch");
// Security check
$result=restrictedArea($user,'stock');
$result = restrictedArea($user, 'stock');
$id=GETPOST('id','int');
$ref = GETPOST('ref','alpha');
$msid=GETPOST('msid','int');
$product_id=GETPOST("product_id");
$action=GETPOST('action','aZ09');
$cancel=GETPOST('cancel','alpha');
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'movementlist';
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$msid = GETPOST('msid', 'int');
$product_id = GETPOST("product_id");
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'alpha');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'movementlist';
$idproduct = GETPOST('idproduct','int');
$idproduct = GETPOST('idproduct', 'int');
$year = GETPOST("year");
$month = GETPOST("month");
$search_ref = GETPOST('search_ref', 'alpha');
@ -69,16 +69,20 @@ $search_inventorycode = trim(GETPOST("search_inventorycode"));
$search_user = trim(GETPOST("search_user"));
$search_batch = trim(GETPOST("search_batch"));
$search_qty = trim(GETPOST("search_qty"));
$search_type_mouvement=GETPOST('search_type_mouvement','int');
$search_type_mouvement = GETPOST('search_type_mouvement', 'int');
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$page = GETPOST("page",'int');
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$page = GETPOST("page", 'int');
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
if (empty($page) || $page == - 1) {
$page = 0;
} // If $page is not defined, or '' or -1
$offset = $limit * $page;
if (! $sortfield) $sortfield="m.datem";
if (! $sortorder) $sortorder="DESC";
if (! $sortfield)
$sortfield = "m.datem";
if (! $sortorder)
$sortorder = "DESC";
$pdluoid=GETPOST('pdluoid','int');
@ -118,12 +122,12 @@ $arrayfields=array(
* Actions
*/
$usercanread = (($user->rights->stock->mouvement->lire));
$usercancreate = (($user->rights->stock->mouvement->creer));
$usercandelete = (($user->rights->stock->mouvement->supprimer));
$usercanread = $user->rights->stock->mouvement->lire;
$usercancreate = $user->rights->stock->mouvement->creer;
$usercandelete = $user->rights->stock->mouvement->supprimer;
if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; }
if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
$parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
@ -187,17 +191,17 @@ if ($action == "correct_stock")
{
$batch=GETPOST('batch_number');
//$eatby=GETPOST('eatby');
//$sellby=GETPOST('sellby');
$eatby=dol_mktime(0, 0, 0, GETPOST('eatbymonth'), GETPOST('eatbyday'), GETPOST('eatbyyear'));
$sellby=dol_mktime(0, 0, 0, GETPOST('sellbymonth'), GETPOST('sellbyday'), GETPOST('sellbyyear'));
// $eatby=GETPOST('eatby');
// $sellby=GETPOST('sellby');
$eatby = dol_mktime(0, 0, 0, GETPOST('eatbymonth'), GETPOST('eatbyday'), GETPOST('eatbyyear'));
$sellby = dol_mktime(0, 0, 0, GETPOST('sellbymonth'), GETPOST('sellbyday'), GETPOST('sellbyyear'));
$result=$product->correct_stock_batch(
$user,
$id,
GETPOST("nbpiece",'int'),
GETPOST("nbpiece", 'int'),
GETPOST("mouvement"),
GETPOST("label",'san_alpha'),
GETPOST("label", 'san_alpha'),
GETPOST('unitprice'),
$eatby,$sellby,$batch,
GETPOST('inventorycode'),
@ -210,9 +214,9 @@ if ($action == "correct_stock")
$result=$product->correct_stock(
$user,
$id,
GETPOST("nbpiece",'int'),
GETPOST("nbpiece", 'int'),
GETPOST("mouvement"),
GETPOST("label",'san_alpha'),
GETPOST("label", 'san_alpha'),
GETPOST('unitprice'),
GETPOST('inventorycode'),
$origin_element,
@ -242,7 +246,7 @@ if ($action == "transfert_stock" && ! $cancel)
$product = new Product($db);
if (! empty($product_id)) $result=$product->fetch($product_id);
if (! (GETPOST("id_entrepot_destination",'int') > 0))
if (! (GETPOST("id_entrepot_destination", 'int') > 0))
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
$error++;
@ -260,7 +264,7 @@ if ($action == "transfert_stock" && ! $cancel)
$error++;
$action='transfert';
}
if ($id == GETPOST("id_entrepot_destination",'int'))
if ($id == GETPOST("id_entrepot_destination", 'int'))
{
setEventMessages($langs->trans("ErrorSrcAndTargetWarehouseMustDiffers"), null, 'errors');
$error++;
@ -330,9 +334,9 @@ if ($action == "transfert_stock" && ! $cancel)
$result1=$product->correct_stock_batch(
$user,
$srcwarehouseid,
GETPOST("nbpiece",'int'),
GETPOST("nbpiece", 'int'),
1,
GETPOST("label",'san_alpha'),
GETPOST("label", 'san_alpha'),
$pricesrc,
$eatby,$sellby,$batch,
GETPOST('inventorycode')
@ -340,10 +344,10 @@ if ($action == "transfert_stock" && ! $cancel)
// Add stock
$result2=$product->correct_stock_batch(
$user,
GETPOST("id_entrepot_destination",'int'),
GETPOST("nbpiece",'int'),
GETPOST("id_entrepot_destination", 'int'),
GETPOST("nbpiece", 'int'),
0,
GETPOST("label",'san_alpha'),
GETPOST("label", 'san_alpha'),
$pricedest,
$eatby,$sellby,$batch,
GETPOST('inventorycode')
@ -447,7 +451,7 @@ $sql.= " u.login, u.photo, u.lastname, u.firstname";
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
// Add fields from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e,";
$sql.= " ".MAIN_DB_PREFIX."product as p,";
@ -464,13 +468,13 @@ if ($id > 0) $sql.= " AND e.rowid ='".$id."'";
if ($month > 0)
{
if ($year > 0)
$sql.= " AND m.datem BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'";
$sql.= " AND m.datem BETWEEN '".$db->idate(dol_get_first_day($year, $month, false))."' AND '".$db->idate(dol_get_last_day($year, $month, false))."'";
else
$sql.= " AND date_format(m.datem, '%m') = '$month'";
}
elseif ($year > 0)
{
$sql.= " AND m.datem BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
$sql.= " AND m.datem BETWEEN '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'";
}
if ($idproduct > 0) $sql.= " AND p.rowid = '".$idproduct."'";
if (! empty($search_ref)) $sql.= natural_search('m.rowid', $search_ref, 1);
@ -487,9 +491,9 @@ if ($search_type_mouvement != '' && $search_type_mouvement != '-1') $sql.= natur
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
$reshook=$hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->order($sortfield, $sortorder);
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
@ -568,7 +572,7 @@ if ($resql)
$morehtmlref.='</div>';
$shownav = 1;
if ($user->societe_id && ! in_array('stock', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
if ($user->societe_id && ! in_array('stock', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref', 'ref', $morehtmlref);
@ -609,7 +613,7 @@ if ($resql)
// Value
print '<tr><td class="titlefield">'.$langs->trans("EstimatedStockValueShort").'</td><td>';
print price((empty($calcproducts['value'])?'0':price2num($calcproducts['value'],'MT')), 0, $langs, 0, -1, -1, $conf->currency);
print price((empty($calcproducts['value'])?'0':price2num($calcproducts['value'], 'MT')), 0, $langs, 0, -1, -1, $conf->currency);
print "</td></tr>";
// Last movement
@ -743,7 +747,7 @@ if ($resql)
$moreforfilter='';
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
$reshook=$hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
else $moreforfilter = $hookmanager->resPrint;
@ -883,7 +887,7 @@ if ($resql)
// Fields from hook
$parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
$reshook=$hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
if (! empty($arrayfields['m.datec']['checked']))
@ -925,12 +929,14 @@ if ($resql)
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
$parameters=array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (! empty($arrayfields['m.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['m.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'],$_SERVER["PHP_SELF"],"p.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
if (! empty($arrayfields['m.datec']['checked']))
print_liste_field_titre($arrayfields['p.datec']['label'], $_SERVER["PHP_SELF"], "p.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
if (! empty($arrayfields['m.tms']['checked']))
print_liste_field_titre($arrayfields['p.tms']['label'], $_SERVER["PHP_SELF"], "p.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
print "</tr>\n";
@ -978,13 +984,13 @@ if ($resql)
if (! empty($arrayfields['m.datem']['checked']))
{
// Date
print '<td>'.dol_print_date($db->jdate($objp->datem),'dayhour').'</td>';
print '<td>'.dol_print_date($db->jdate($objp->datem), 'dayhour').'</td>';
}
if (! empty($arrayfields['p.ref']['checked']))
{
// Product ref
print '<td class="nowraponall">';
print $productstatic->getNomUrl(1,'stock',16);
print $productstatic->getNomUrl(1, 'stock', 16);
print "</td>\n";
}
if (! empty($arrayfields['p.label']['checked']))
@ -1007,11 +1013,11 @@ if ($resql)
}
if (! empty($arrayfields['pl.eatby']['checked']))
{
print '<td align="center">'. dol_print_date($objp->eatby,'day') .'</td>';
print '<td align="center">'. dol_print_date($objp->eatby, 'day') .'</td>';
}
if (! empty($arrayfields['pl.sellby']['checked']))
{
print '<td align="center">'. dol_print_date($objp->sellby,'day') .'</td>';
print '<td align="center">'. dol_print_date($objp->sellby, 'day') .'</td>';
}
// Warehouse
if (! empty($arrayfields['e.ref']['checked']))
@ -1114,20 +1120,20 @@ if ($resql)
$productidselected=$key;
$productlabelselected=$val;
}
$datebefore=dol_get_first_day($year?$year:strftime("%Y",time()), $month?$month:1, true);
$dateafter=dol_get_last_day($year?$year:strftime("%Y",time()), $month?$month:12, true);
$datebefore=dol_get_first_day($year?$year:strftime("%Y", time()), $month?$month:1, true);
$dateafter=dol_get_last_day($year?$year:strftime("%Y", time()), $month?$month:12, true);
$balancebefore=$movement->calculateBalanceForProductBefore($productidselected, $datebefore);
$balanceafter=$movement->calculateBalanceForProductBefore($productidselected, $dateafter);
//print '<tr class="total"><td class="liste_total">';
print $langs->trans("NbOfProductBeforePeriod", $productlabelselected, dol_print_date($datebefore,'day','gmt'));
print $langs->trans("NbOfProductBeforePeriod", $productlabelselected, dol_print_date($datebefore, 'day', 'gmt'));
//print '</td>';
//print '<td class="liste_total" colspan="6" align="right">';
print ': '.$balancebefore;
print "<br>\n";
//print '</td></tr>';
//print '<tr class="total"><td class="liste_total">';
print $langs->trans("NbOfProductAfterPeriod", $productlabelselected, dol_print_date($dateafter,'day','gmt'));
print $langs->trans("NbOfProductAfterPeriod", $productlabelselected, dol_print_date($dateafter, 'day', 'gmt'));
//print '</td>';
//print '<td class="liste_total" colspan="6" align="right">';
print ': '.$balanceafter;
@ -1169,7 +1175,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete' && $id>0)
$genallowed=$user->rights->stock->lire;
$delallowed=$user->rights->stock->creer;
print $formfile->showdocuments($modulepart,$objectref,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang, '', $object);
print $formfile->showdocuments($modulepart, $objectref, $filedir, $urlsource, $genallowed, $delallowed, '', 0, 0, 0, 28, 0, '', 0, '', $object->default_lang, '', $object);
$somethingshown=$formfile->numoffiles;
print '</div><div class="fichehalfright"><div class="ficheaddleft">';

View File

@ -1045,7 +1045,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
$contactsofproject=$projectstatic->getListContactId('internal');
if (count($contactsofproject)>0)
{
if (in_array($user->id, $userid=$contactsofproject)) $userid = $user->id;
if (in_array($user->id, $contactsofproject)) $userid = $user->id;
else $userid=$contactsofproject[0];
if ($projectstatic->public) $contactsofproject = array();
print $form->select_dolusers((GETPOST('userid')?GETPOST('userid'):$userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'maxwidth200');

View File

@ -85,7 +85,7 @@ class FormResource
$resourcestat = new Dolresource($this->db);
$resources_used = $resourcestat->fetch_all('ASC', 't.rowid', $limit, $offset, $filter='');
$resources_used = $resourcestat->fetch_all('ASC', 't.rowid', $limit, $offset, '');
if ($outputmode != 2)
{

View File

@ -209,6 +209,7 @@ function getCategory($authentication, $id)
{
$fuser->getrights();
$nbmax = 10;
if ($fuser->rights->categorie->lire)
{
$categorie=new Categorie($db);
@ -228,7 +229,7 @@ function getCategory($authentication, $id)
//'visible'=>$categorie->visible,
'type' => $categorie->type,
'dir' => $pdir,
'photos' => $categorie->liste_photos($dir, $nbmax=10)
'photos' => $categorie->liste_photos($dir, $nbmax)
);
$cats = $categorie->get_filles();
@ -248,7 +249,7 @@ function getCategory($authentication, $id)
//'visible'=>$fille->visible,
'type'=>$fille->type,
'dir' => $pdir,
'photos' => $fille->liste_photos($dir, $nbmax=10)
'photos' => $fille->liste_photos($dir, $nbmax)
);
}
}

View File

@ -364,6 +364,7 @@ function getProductOrService($authentication, $id = '', $ref = '', $ref_ext = ''
$fuser->getrights();
$nbmax = 10;
if ($fuser->rights->produit->lire || $fuser->rights->service->lire)
{
$product=new Product($db);
@ -417,7 +418,7 @@ function getProductOrService($authentication, $id = '', $ref = '', $ref_ext = ''
'pmp' => $product->pmp,
'import_key' => $product->import_key,
'dir' => $pdir,
'images' => $product->liste_photos($dir, $nbmax=10)
'images' => $product->liste_photos($dir, $nbmax)
);
//Retreive all extrafield for thirdsparty
@ -1029,6 +1030,7 @@ function getProductsForCategory($authentication, $id, $lang = '')
$fuser->getrights();
$nbmax = 10;
if ($fuser->rights->produit->lire)
{
$categorie=new Categorie($db);
@ -1086,7 +1088,7 @@ function getProductsForCategory($authentication, $id, $lang = '')
'pmp' => $obj->pmp,
'import_key' => $obj->import_key,
'dir' => $pdir,
'images' => $obj->liste_photos($dir, $nbmax=10)
'images' => $obj->liste_photos($dir, $nbmax)
);
//Retreive all extrafield for thirdsparty