diff --git a/.travis.yml b/.travis.yml
index 69f43183cfc..57781d47e44 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -53,12 +53,14 @@ before_script:
- sh -c "if [ '$PHPV' = '5.3' ]; then echo 'zend_extension_ts = xdebug.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
- sh -c "if [ '$PHPV' = '5.4' ]; then echo 'zend_extension_ts = xdebug.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
- cat ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
+ - echo Mysql version
+ - mysql --version
- echo Init database
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS myapp_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE myapp_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'DROP DATABASE IF EXISTS myapp_test;'; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE IF NOT EXISTS myapp_test;'; fi"
- - sh -c "if [ '$DB' = 'mysql' ]; then mysql -D myapp_test < $(pwd)/dev/initdata/mysqldump_dolibarr_3.4.0.sql; fi"
+ - sh -c "if [ '$DB' = 'mysql' ]; then mysql -D myapp_test < $(pwd)/dev/initdata/mysqldump_dolibarr_3.5.0.sql; fi"
- echo Create config file htdocs/conf/conf.php
- echo ' htdocs/conf/conf.php
- sh -c "if [ '$DB' = 'pgsql' ]; then echo '$'dolibarr_main_db_type=\'pgsql\'';' >> htdocs/conf/conf.php; fi"
@@ -88,12 +90,12 @@ before_script:
script:
- cd htdocs/install
- date
- - php upgrade.php 3.4.0 3.5.0 > upgrade.log
- - php upgrade2.php 3.4.0 3.5.0 > upgrade2.log
+# - php upgrade.php 3.4.0 3.5.0 > upgrade.log
+# - php upgrade2.php 3.4.0 3.5.0 > upgrade2.log
- php upgrade.php 3.5.0 3.6.0 >> upgrade.log
- php upgrade2.php 3.5.0 3.6.0 >> upgrade2.log
- - php upgrade.php 3.6.0 3.7.0 >> upgrade360370.log
- - cat upgrade360370.log
+ - php upgrade.php 3.6.0 3.7.0 >> upgrade.log
+# - cat upgrade360370.log
- php upgrade2.php 3.6.0 3.7.0 >> upgrade2.log
# - cat upgrade2.log
- cd ../..
diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl
index 2a4af64f5fe..370c04591a9 100755
--- a/build/makepack-dolibarr.pl
+++ b/build/makepack-dolibarr.pl
@@ -446,6 +446,7 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
+ $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/eldy/*.new`;
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php
index 9bb3af6dcbd..82d88089684 100644
--- a/htdocs/comm/action/document.php
+++ b/htdocs/comm/action/document.php
@@ -277,20 +277,14 @@ if ($object->id > 0)
print '
'.$langs->trans("NbOfAttachedFiles").' '.count($filearray).' ';
print ''.$langs->trans("TotalSizeOfAttachedFiles").' '.$totalsize.' '.$langs->trans("bytes").' ';
- print '';
+ print '';
- print '';
+ dol_fiche_end();
- $modulepart = 'actions';
- $permission = $user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create;
- $param = '&id=' . $object->id;
- include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
if ($action != 'edit')
{
- print " ";
-
// Link to agenda views
print '';
print ''."\n";
print '
';
+
+ print '
';
+ print " ";
}
+
+
+ $modulepart = 'actions';
+ $permission = $user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create;
+ $param = '&id=' . $object->id;
+ include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
}
else
{
print $langs->trans("ErrorUnknown");
}
-$db->close();
llxFooter();
+
+$db->close();
diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php
index c330540cb03..53243d0c165 100644
--- a/htdocs/comm/action/listactions.php
+++ b/htdocs/comm/action/listactions.php
@@ -99,6 +99,13 @@ if (! $user->rights->agenda->allactions->read || $filter=='mine') // If no permi
$filterd=$user->id;
}
+// Purge search criteria
+if (GETPOST("button_removefilter"))
+{
+ $datestart='';
+ $dateend='';
+}
+
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('agendalist'));
@@ -278,8 +285,7 @@ if ($resql)
//print ' ';
print ' ';
print ' ';
- //print ' ';
- //print ' ';
+ print ' ';
print ' ';
print "\n";
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 2b8e478d37d..96d633bd834 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -323,10 +323,9 @@ if ($result)
$formpropal->selectProposalStatus($viewstatut,1);
print '';
print '';
- print ' ';
- print ' ';
- print ' ';
- print ' ';
+ print ' ';
+ print ' ';
+ print '';
print "\n";
$var=true;
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 84f8e455d11..ea17d895b95 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -43,9 +43,9 @@ $orderyear=GETPOST("orderyear","int");
$ordermonth=GETPOST("ordermonth","int");
$deliveryyear=GETPOST("deliveryyear","int");
$deliverymonth=GETPOST("deliverymonth","int");
-$sref=GETPOST('sref','alpha');
-$sref_client=GETPOST('sref_client','alpha');
-$snom=GETPOST('snom','alpha');
+$search_ref=GETPOST('search_ref','alpha');
+$search_ref_customer=GETPOST('search_ref_customer','alpha');
+$search_company=GETPOST('search_company','alpha');
$sall=GETPOST('sall');
$socid=GETPOST('socid','int');
$search_user=GETPOST('search_user','int');
@@ -69,6 +69,20 @@ $limit = $conf->liste_limit;
$viewstatut=GETPOST('viewstatut');
+// Purge search criteria
+if (GETPOST("button_removefilter"))
+{
+ $search_categ='';
+ $search_user='';
+ $search_sale='';
+ $search_ref='';
+ $search_ref_customer='';
+ $search_company='';
+ $orderyear='';
+ $ordermonth='';
+ $deliverymonth='';
+ $deliveryyear='';
+}
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('orderlist'));
@@ -81,24 +95,6 @@ $parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hook
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
-// Do we click on purge search criteria ?
-if (GETPOST("button_removefilter_x"))
-{
- $search_categ='';
- $search_user='';
- $search_sale='';
- $search_ref='';
- $search_refcustomer='';
- $search_societe='';
- $search_montant_ht='';
- $orderyear='';
- $ordermonth='';
- $deliverymonth='';
- $deliveryyear='';
-}
-
-
-
/*
* View
*/
@@ -128,8 +124,8 @@ $sql.= ' WHERE c.fk_soc = s.rowid';
$sql.= ' AND c.entity = '.$conf->entity;
if ($socid) $sql.= ' AND s.rowid = '.$socid;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
-if ($sref) {
- $sql .= natural_search('c.ref', $sref);
+if ($search_ref) {
+ $sql .= natural_search('c.ref', $search_ref);
}
if ($sall)
{
@@ -188,13 +184,13 @@ else if ($deliveryyear > 0)
{
$sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_get_first_day($deliveryyear,1,false))."' AND '".$db->idate(dol_get_last_day($deliveryyear,12,false))."'";
}
-if (!empty($snom))
+if (!empty($search_company))
{
- $sql .= natural_search('s.nom', $snom);
+ $sql .= natural_search('s.nom', $search_company);
}
-if (!empty($sref_client))
+if (!empty($search_ref_customer))
{
- $sql.= ' AND c.ref_client LIKE \'%'.$db->escape($sref_client).'%\'';
+ $sql.= ' AND c.ref_client LIKE \'%'.$db->escape($search_ref_customer).'%\'';
}
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
if ($search_user > 0)
@@ -246,15 +242,15 @@ if ($resql)
$title.=' - '.$langs->trans('StatusOrderValidated').', '.(empty($conf->expedition->enabled)?'':$langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill');
$param='&socid='.$socid.'&viewstatut='.$viewstatut;
- if ($ordermonth) $param.='&ordermonth='.$ordermonth;
- if ($orderyear) $param.='&orderyear='.$orderyear;
- if ($deliverymonth) $param.='&deliverymonth='.$deliverymonth;
- if ($deliveryyear) $param.='&deliveryyear='.$deliveryyear;
- if ($sref) $param.='&sref='.$sref;
- if ($snom) $param.='&snom='.$snom;
- if ($sref_client) $param.='&sref_client='.$sref_client;
- if ($search_user > 0) $param.='&search_user='.$search_user;
- if ($search_sale > 0) $param.='&search_sale='.$search_sale;
+ if ($ordermonth) $param.='&ordermonth='.$ordermonth;
+ if ($orderyear) $param.='&orderyear='.$orderyear;
+ if ($deliverymonth) $param.='&deliverymonth='.$deliverymonth;
+ if ($deliveryyear) $param.='&deliveryyear='.$deliveryyear;
+ if ($search_ref) $param.='&search_ref='.$search_ref;
+ if ($search_company) $param.='&search_company='.$search_company;
+ if ($search_ref_customer) $param.='&search_ref_customer='.$search_ref_customer;
+ if ($search_user > 0) $param.='&search_user='.$search_user;
+ if ($search_sale > 0) $param.='&search_sale='.$search_sale;
$num = $db->num_rows($resql);
print_barre_liste($title, $page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
@@ -294,33 +290,35 @@ if ($resql)
print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'c.ref','',$param,'width="25%"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('RefCustomerOrder'),$_SERVER["PHP_SELF"],'c.ref_client','',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Company'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans('OrderDate'),$_SERVER["PHP_SELF"],'c.date_commande','',$param, 'align="right"',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans('DeliveryDate'),$_SERVER["PHP_SELF"],'c.date_livraison','',$param, 'align="right"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans('OrderDate'),$_SERVER["PHP_SELF"],'c.date_commande','',$param, 'align="center"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans('DeliveryDate'),$_SERVER["PHP_SELF"],'c.date_livraison','',$param, 'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('AmountHT'),$_SERVER["PHP_SELF"],'c.total_ht','',$param, 'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Status'),$_SERVER["PHP_SELF"],'c.fk_statut','',$param,'align="right"',$sortfield,$sortorder);
print '';
+
print '';
print '';
- print ' ';
+ print ' ';
print ' ';
print '';
- print ' ';
+ print ' ';
print ' ';
print '';
- print ' ';
+ print ' ';
print ' ';
- print '';
+ print ' ';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ' ';
print ' ';
$formother->select_year($orderyear?$orderyear:-1,'orderyear',1, 20, 5);
- print ' ';
+ print ' ';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ' ';
print ' ';
$formother->select_year($deliveryyear?$deliveryyear:-1,'deliveryyear',1, 20, 5);
- print ' ';
- print ' ';
- print ' ';
- print ' ';
+ print '';
+ print ' ';
+ print ' ';
+ print ' ';
+ print " \n";
$var=true;
$total=0;
@@ -443,12 +441,12 @@ if ($resql)
print '';
// Order date
- print '';
+ print ' ';
print dol_print_date($db->jdate($objp->date_commande), 'day');
print ' ';
// Delivery date
- print '';
+ print ' ';
print dol_print_date($db->jdate($objp->date_livraison), 'day');
print ' ';
diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php
index da0e3e21dcd..42a6713c1ce 100644
--- a/htdocs/compta/deplacement/list.php
+++ b/htdocs/compta/deplacement/list.php
@@ -115,7 +115,7 @@ if ($month > 0)
}
else if ($year > 0)
{
- $sql.= " AND bc.date_bordereau BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
+ $sql.= " AND d.dated BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
}
$sql.= $db->order($sortfield,$sortorder);
diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php
index 1fecc0e1c28..b586241c11e 100644
--- a/htdocs/compta/resultat/index.php
+++ b/htdocs/compta/resultat/index.php
@@ -560,7 +560,7 @@ print ' ';
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
- print '';
+ print ' ';
print '';
print $annee;
if ($conf->global->SOCIETE_FISCAL_MONTH_START > 1) print '-'.($annee+1);
@@ -571,7 +571,7 @@ print ''.$langs->trans("Month").
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
print ' '.$langs->trans("Outcome").' ';
- print ''.$langs->trans("Income").' ';
+ print ''.$langs->trans("Income").' ';
}
print ' ';
@@ -601,7 +601,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
}
print " ";
- print ' ';
+ print ' ';
//if (isset($encaiss_ttc[$case]) && $encaiss_ttc[$case] != 0)
if (isset($encaiss_ttc[$case]))
{
@@ -623,7 +623,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
$nbcols+=2;
print ' '.(isset($totsorties[$annee])?price(price2num($totsorties[$annee],'MT')):' ').' ';
- print ''.(isset($totentrees[$annee])?price(price2num($totentrees[$annee],'MT')):' ').' ';
+ print ''.(isset($totentrees[$annee])?price(price2num($totentrees[$annee],'MT')):' ').' ';
}
print " \n";
@@ -637,7 +637,7 @@ $var=!$var;
print ''.$langs->trans("Profit").' ';
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
- print ' ';
+ print ' ';
if (isset($totentrees[$annee]) || isset($totsorties[$annee]))
{
$in=(isset($totentrees[$annee])?price2num($totentrees[$annee], 'MT'):0);
diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php
index 69fdeff849c..b3fb130e185 100644
--- a/htdocs/compta/stats/index.php
+++ b/htdocs/compta/stats/index.php
@@ -184,7 +184,7 @@ print ' ';
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
if ($modecompta == 'CREANCES-DETTES') print '';
- else print ' ';
+ else print ' ';
print '';
print $annee;
if ($conf->global->SOCIETE_FISCAL_MONTH_START > 1) print '-'.($annee+1);
@@ -198,7 +198,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
if ($modecompta == 'CREANCES-DETTES') print ' '.$langs->trans("AmountHT").' ';
print ''.$langs->trans("AmountTTC").' ';
- print ''.$langs->trans("Delta").' ';
+ print ''.$langs->trans("Delta").' ';
if ($annee != $year_end) print ' ';
}
print ' ';
@@ -244,7 +244,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
}
print "";
}
-
+
// Valeur CA du mois
print '';
if ($cum[$case])
@@ -266,29 +266,29 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
{
$percent=(round(($cum[$case]-$cum[$caseprev])/$cum[$caseprev],4)*100);
//print "X $cum[$case] - $cum[$caseprev] - $cum[$caseprev] - $percent X";
- print ' '.($percent>=0?"+$percent":"$percent").'% ';
+ print ''.($percent>=0?"+$percent":"$percent").'% ';
}
if ($cum[$caseprev] && ! $cum[$case])
{
- print '-100% ';
+ print '-100% ';
}
if (! $cum[$caseprev] && $cum[$case])
{
//print '+Inf% ';
- print '- ';
+ print '- ';
}
if (isset($cum[$caseprev]) && ! $cum[$caseprev] && ! $cum[$case])
{
- print '+0% ';
+ print '+0% ';
}
if (! isset($cum[$caseprev]) && ! $cum[$case])
{
- print '- ';
+ print '- ';
}
}
else
{
- print '';
+ print ' ';
if ($minyearmonth <= $case && $case <= $maxyearmonth) { print '-'; }
else { print ' '; }
print ' ';
@@ -382,7 +382,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
print ' ';
}
}
-
+
// Montant total
if ($total[$annee] || ($annee >= $minyear && $annee <= max($nowyear,$maxyear)))
{
@@ -398,24 +398,24 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
if ($total[$annee-1] && $total[$annee]) {
$percent=(round(($total[$annee]-$total[$annee-1])/$total[$annee-1],4)*100);
- print ''.($percent>=0?"+$percent":"$percent").'% ';
+ print ''.($percent>=0?"+$percent":"$percent").'% ';
}
if ($total[$annee-1] && ! $total[$annee])
{
- print '-100% ';
+ print '-100% ';
}
if (! $total[$annee-1] && $total[$annee])
{
- print '+Inf% ';
+ print '+Inf% ';
}
if (! $total[$annee-1] && ! $total[$annee])
{
- print '+0% ';
+ print '+0% ';
}
}
else
{
- print '';
+ print ' ';
if ($total[$annee] || ($minyear <= $annee && $annee <= max($nowyear,$maxyear))) { print '-'; }
else { print ' '; }
print ' ';
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index a311c87cffc..2e28328085a 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -357,7 +357,6 @@ if ($result)
print '';
print '';
print ' ';
- print ' ';
print ' ';
print ' ';
print '';
diff --git a/htdocs/core/antispamimage.php b/htdocs/core/antispamimage.php
index c3bc217e100..a16844dd715 100644
--- a/htdocs/core/antispamimage.php
+++ b/htdocs/core/antispamimage.php
@@ -51,8 +51,6 @@ for($i = 0; $i < $length; $i++)
$sessionkey='dol_antispam_value';
$_SESSION[$sessionkey]=$string;
-header("Content-type: image/png");
-
$img = imagecreate(80,32);
if (empty($img))
{
@@ -60,6 +58,8 @@ if (empty($img))
exit;
}
+header("Content-type: image/png");
+
$background_color = imagecolorallocate($img, 250, 250, 250);
$ecriture_color = imagecolorallocate($img, 0, 0, 0);
imagestring($img, 4, 24, 8, $string, $ecriture_color);
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index a9c39fa790f..e85d3dbed71 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -1825,7 +1825,7 @@ abstract class CommonObject
if (empty($sourceid) && empty($targetid))
{
- dol_print_error('','Bad usage of function. No parameter defined and no id defined');
+ dol_syslog('Bad usage of function. No source nor target id defined (nor as parameter nor as object id)', LOG_ERROR);
return -1;
}
@@ -2525,14 +2525,14 @@ abstract class CommonObject
if (! empty($conf->margin->enabled) && empty($user->societe_id))
{
if ($conf->global->MARGIN_TYPE == "1")
- print ''.$langs->trans('BuyingPrice').' ';
+ print ''.$langs->trans('BuyingPrice').' ';
else
- print ''.$langs->trans('CostPrice').' ';
+ print ''.$langs->trans('CostPrice').' ';
if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous)
- print ''.$langs->trans('MarginRate').' ';
+ print ''.$langs->trans('MarginRate').' ';
if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous)
- print ''.$langs->trans('MarkRate').' ';
+ print ''.$langs->trans('MarkRate').' ';
}
// Total HT
@@ -3012,11 +3012,16 @@ abstract class CommonObject
$marginInfo = $this->getMarginInfos($force_price);
- if (! empty($conf->global->MARGININFO_HIDE_SHOW))
- {
- print " ";
- if ($conf->global->MARGININFO_HIDE_SHOW == 2) print ''; // hide by default
- }
+ print $langs->trans('ShowMarginInfos').' : ';
+ $hidemargininfos = $_COOKIE['DOLUSER_MARGININFO_HIDE_SHOW'];
+ print ''.img_picto($langs->trans("Disabled"),'switch_off').' ';
+ print ''.img_picto($langs->trans("Enabled"),'switch_on').' ';
+
+ print '';
+ if (!empty($hidemargininfos)) print '';
print '';
print '';
diff --git a/htdocs/core/js/lib_head.js b/htdocs/core/js/lib_head.js
index 40b1473698e..962e4c39f47 100644
--- a/htdocs/core/js/lib_head.js
+++ b/htdocs/core/js/lib_head.js
@@ -631,7 +631,7 @@ function hideMessage(fieldId,message) {
/*
- * TODO Used by admin page only ?
+ * Used by button to set on/off
*/
function setConstant(url, code, input, entity, strict) {
$.get( url, {
@@ -689,7 +689,7 @@ function setConstant(url, code, input, entity, strict) {
}
/*
- * TODO Used by admin page only ?
+ * Used by button to set on/off
*/
function delConstant(url, code, input, entity, strict) {
$.get( url, {
@@ -743,7 +743,7 @@ function delConstant(url, code, input, entity, strict) {
}
/*
- * TODO Used by admin page only ?
+ * Used by button to set on/off
*/
function confirmConstantAction(action, url, code, input, box, entity, yesButton, noButton, strict) {
var boxConfirm = box;
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index a94a77f1454..09c38435c0a 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -44,14 +44,31 @@ include_once DOL_DOCUMENT_ROOT .'/core/lib/json.lib.php';
* @param string $class Class name
* @param string $member Name of property
* @return mixed Return value of static property
- * @deprecated PHP 5.3 is now the minimum requirement, this is no longer necessary
*/
function getStaticMember($class, $member)
{
- if (isset($class::$member)) {
- return $class::$member;
- }
+ // This part is deprecated. Uncomment if for php 5.2.*, and comment next isset class::member
+ /*if (version_compare(phpversion(), '5.3.0', '<'))
+ {
+ if (is_object($class)) $class = get_class($class);
+ $classObj = new ReflectionClass($class);
+ $result = null;
+ $found=0;
+ foreach($classObj->getStaticProperties() as $prop => $value)
+ {
+ if ($prop == $member)
+ {
+ $result = $value;
+ $found++;
+ break;
+ }
+ }
+
+ if ($found) return $result;
+ }*/
+
+ if (isset($class::$member)) return $class::$member;
dol_print_error('','Try to get a static member "'.$member.'" in class "'.$class.'" that does not exists or is not static.');
return null;
}
@@ -2862,7 +2879,7 @@ function price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerou
$listofcurrenciesbefore=array('USD');
if (in_array($currency_code,$listofcurrenciesbefore)) $cursymbolbefore.=$outlangs->getCurrencySymbol($currency_code);
- else
+ else
{
$tmpcur=$outlangs->getCurrencySymbol($currency_code);
$cursymbolafter.=($tmpcur == $currency_code ? ' '.$tmpcur : $tmpcur);
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index 984bc809a75..87c88ac028c 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -770,15 +770,18 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if (! empty($conf->facture->enabled)) $newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=-3", $langs->trans("MenuOrdersToBill2"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
// if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire);
}
-
+
// Supplier Orders
if (! empty($conf->fournisseur->enabled))
{
- $langs->load("supplier");
- $newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
- // if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire);
+ if (! empty($conf->global->SUPPLIER_MENU_ORDER_RECEIVED_INTO_INVOICE))
+ {
+ $langs->load("supplier");
+ $newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
+ // if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire);
+ }
}
-
+
// Donations
if (! empty($conf->don->enabled))
diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php
index bdced511867..56cca5af04f 100644
--- a/htdocs/core/tpl/admin_extrafields_add.tpl.php
+++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php
@@ -87,8 +87,8 @@
-
-
+
+
textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"),1,0)?>
textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"),1,0)?>
diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php
index dcf1af56ed1..493634c84a5 100644
--- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php
+++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php
@@ -98,8 +98,8 @@ if(($type == 'select') || ($type == 'sellist') || ($type == 'checkbox') ||(($typ
-
-
+
+
textwithpicto('', $langs->trans("ExtrafieldParamHelp".$type),1,0)?>
diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php
index ee2a8695f3a..ad2fa068757 100644
--- a/htdocs/core/tpl/extrafields_view.tpl.php
+++ b/htdocs/core/tpl/extrafields_view.tpl.php
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
- *
+ *
* Need to have following variables defined:
* $object (invoice, order, ...)
* $conf
@@ -49,21 +49,30 @@ if (empty($reshook) && ! empty($extrafields->attribute_label))
print 'attribute_required [$key])) print ' class="fieldrequired"';
print '>' . $label . ' ';
-
+
//TODO Improve element and rights detection
- if (($object->statut == 0 || $extrafields->attribute_alwayseditable[$key]) && ($object->element=='order_supplier'?$user->rights->fournisseur>commande:($object->element=='invoice_supplier'?$user->rights->fournisseur>facture:$user->rights->{$object->element}->creer)) && ($action != 'edit_extras' || GETPOST('attribute') != $key))
+ //var_dump($user->rights);
+ $permok=false;
+ $keyforperm=$object->element;
+ if ($object->element == 'fichinter') $keyforperm='ficheinter';
+ if (isset($user->rights->$keyforperm)) $permok=$user->rights->$keyforperm->creer||$user->rights->$keyforperm->create||$user->rights->$keyforperm->write;
+ if ($object->element=='order_supplier') $permok=$user->rights->fournisseur->commande->creer;
+ if ($object->element=='invoice_supplier') $permok=$user->rights->fournisseur->facture->creer;
+
+ if (($object->statut == 0 || $extrafields->attribute_alwayseditable[$key])
+ && $permok && ($action != 'edit_extras' || GETPOST('attribute') != $key))
print '' . img_edit().' ';
-
+
print '
';
print '';
-
+
// Convert date into timestamp format
if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) {
$value = isset($_POST ["options_" . $key]) ? dol_mktime($_POST ["options_" . $key . "hour"], $_POST ["options_" . $key . "min"], 0, $_POST ["options_" . $key . "month"], $_POST ["options_" . $key . "day"], $_POST ["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]);
}
-
+
//TODO Improve element and rights detection
- if ($action == 'edit_extras' && ($object->element=='order_supplier'?$user->rights->fournisseur>commande:($object->element=='invoice_supplier'?$user->rights->fournisseur>facture:$user->rights->{$object->element}->creer)) && GETPOST('attribute') == $key)
+ if ($action == 'edit_extras' && $permok && GETPOST('attribute') == $key)
{
print ' \n";
@@ -107,6 +108,7 @@ foreach($extrafields->attribute_type as $key => $value)
print ''.$extrafields->attribute_size[$key]." \n";
print ''.yn($extrafields->attribute_unique[$key])." \n";
print ''.yn($extrafields->attribute_required[$key])." \n";
+ print ''.yn($extrafields->attribute_alwayseditable[$key])." \n"; // TODO This must be generalised into all page to admin extrafield. Mutualize code here is easy and will save a lot of code
print ''.img_edit().' ';
print " ".img_delete()." \n";
print "";
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 0d6bebada72..db4212308de 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -146,7 +146,7 @@ class FactureFournisseur extends CommonInvoice
*/
function create($user)
{
- global $langs,$conf;
+ global $langs,$conf,$hookmanager;
$error=0;
$now=dol_now();
diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php
index 58abe457831..ab0fd08d3f0 100644
--- a/htdocs/fourn/commande/list.php
+++ b/htdocs/fourn/commande/list.php
@@ -39,12 +39,11 @@ $langs->load("sendings");
$search_ref=GETPOST('search_ref');
$search_refsupp=GETPOST('search_refsupp');
-$search_nom=GETPOST('search_nom');
+$search_company=GETPOST('search_company');
$search_user=GETPOST('search_user');
$search_ttc=GETPOST('search_ttc');
$sall=GETPOST('search_all');
$search_status=GETPOST('search_status','int');
-if ($search_status == '') $search_status=-1;
$page = GETPOST('page','int');
$socid = GETPOST('socid','int');
@@ -58,6 +57,18 @@ $orderid = GETPOST('orderid');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'fournisseur', $orderid, '', 'commande');
+// Purge search criteria
+if (GETPOST("button_removefilter"))
+{
+ $search_ref='';
+ $search_refsupp='';
+ $search_company='';
+ $search_user='';
+ $search_ttc='';
+ $search_status='';
+}
+
+if ($search_status == '') $search_status=-1;
/*
* View
@@ -102,9 +113,9 @@ if ($search_ref)
{
$sql .= natural_search('cf.ref', $search_ref);
}
-if ($search_nom)
+if ($search_company)
{
- $sql .= natural_search('s.nom', $search_nom);
+ $sql .= natural_search('s.nom', $search_company);
}
if ($search_user)
{
@@ -154,13 +165,14 @@ if ($resql)
$i = 0;
$param="";
- if ($search_ref) $param.="&search_ref=".$search_ref;
- if ($search_nom) $param.="&search_nom=".$search_nom;
- if ($search_user) $param.="&search_user=".$search_user;
- if ($search_ttc) $param.="&search_ttc=".$search_ttc;
- if ($search_refsupp) $param.="&search_refsupp=".$search_refsupp;
- if ($socid) $param.="&socid=".$socid;
- if ($search_status >= 0) $param.="&search_status=".$search_status;
+ if ($search_ref) $param.="&search_ref=".$search_ref;
+ if ($search_company) $param.="&search_company=".$search_company;
+ if ($search_user) $param.="&search_user=".$search_user;
+ if ($search_ttc) $param.="&search_ttc=".$search_ttc;
+ if ($search_refsupp) $param.="&search_refsupp=".$search_refsupp;
+ if ($socid) $param.="&socid=".$socid;
+ if ($search_status >= 0) $param.="&search_status=".$search_status;
+
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords);
print '