diff --git a/.travis.yml b/.travis.yml
index d5583ef6ff2..e487822ad24 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -295,7 +295,8 @@ script:
set -e
# Exclusions are defined in the ruleset.xml file
#phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 .
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi
+ #if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi
+ phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .
set +e
echo
@@ -347,7 +348,7 @@ script:
mysql -e 'DROP DATABASE IF EXISTS travis;'
mysql -e 'CREATE DATABASE IF NOT EXISTS travis;'
mysql -e 'GRANT ALL PRIVILEGES ON travis.* TO travis@127.0.0.1;'
- mysql -e 'FLUSH PRIVILEGES;'
+ mysql -e 'FLUSH PRIVILEGES;'
mysql -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
fi
if [ "$DB" = 'postgresql' ]; then
@@ -362,7 +363,7 @@ script:
#echo 'ALTER TABLE "llx_accounting_account" DROP CONSTRAINT "idx_16390_primary"' | psql travis
fi
echo
-
+
- |
echo "Upgrading Dolibarr"
# Ensure we catch errors. Set this to +e if you want to go to the end to see log files.
diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml
index 32c44ce91e4..82582d2d18c 100644
--- a/dev/setup/codesniffer/ruleset.xml
+++ b/dev/setup/codesniffer/ruleset.xml
@@ -186,7 +186,7 @@
-
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 6fdd1e36feb..3854c51e29d 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -44,8 +44,9 @@ require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/order.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
-if (! empty($conf->propal->enabled))
+if (! empty($conf->propal->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
+}
if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
@@ -757,8 +758,8 @@ if (empty($reshook))
$price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level];
if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility
{
- if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level];
- if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level];
+ if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level];
+ if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level];
}
}
// If price per customer
diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php
index fb044b1fafa..2559510dea8 100644
--- a/htdocs/commande/class/api_orders.class.php
+++ b/htdocs/commande/class/api_orders.class.php
@@ -437,7 +437,7 @@ class Orders extends DolibarrApi
return $this->commande;
}
- /**
+ /**
* Delete a contact type of given order
*
* @param int $id Id of order to update
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 6fe2104556b..4cc922a8cbf 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -1995,9 +1995,9 @@ class Commande extends CommonOrder
// multilangs
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($objp->fk_product) && ! empty($loadalsotranslation)) {
- $line = new Product($this->db);
- $line->fetch($objp->fk_product);
- $line->getMultiLangs();
+ $line = new Product($this->db);
+ $line->fetch($objp->fk_product);
+ $line->getMultiLangs();
}
$this->lines[$i] = $line;
diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php
index 82d24ad3646..57e37f9f903 100644
--- a/htdocs/commande/contact.php
+++ b/htdocs/commande/contact.php
@@ -164,20 +164,21 @@ if ($id > 0 || ! empty($ref))
$morehtmlref.='
'.$langs->trans('Project') . ' ';
if ($user->rights->commande->creer)
{
- if ($action != 'classify')
+ if ($action != 'classify') {
//$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
- $morehtmlref.=' : ';
- if ($action == 'classify') {
- //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
- $morehtmlref.='
';
- } else {
- $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
- }
+ $morehtmlref.=' : ';
+ }
+ if ($action == 'classify') {
+ //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
+ $morehtmlref.='';
+ } else {
+ $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
+ }
} else {
if (! empty($object->fk_project)) {
$proj = new Project($db);
diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php
index 515e14095bd..fa825086c4a 100644
--- a/htdocs/commande/document.php
+++ b/htdocs/commande/document.php
@@ -127,20 +127,21 @@ if ($id > 0 || ! empty($ref))
$morehtmlref.='
'.$langs->trans('Project') . ' ';
if ($user->rights->commande->creer)
{
- if ($action != 'classify')
+ if ($action != 'classify') {
//$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
- $morehtmlref.=' : ';
- if ($action == 'classify') {
- //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
- $morehtmlref.='';
- } else {
- $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
- }
+ $morehtmlref.=' : ';
+ }
+ if ($action == 'classify') {
+ //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
+ $morehtmlref.='';
+ } else {
+ $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
+ }
} else {
if (! empty($object->fk_project)) {
$proj = new Project($db);
diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php
index f42a9fc5b60..7d8e319c5ae 100644
--- a/htdocs/commande/info.php
+++ b/htdocs/commande/info.php
@@ -84,20 +84,21 @@ if (! empty($conf->projet->enabled))
$morehtmlref.='
'.$langs->trans('Project') . ' ';
if ($user->rights->commande->creer)
{
- if ($action != 'classify')
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ if ($action != 'classify') {
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref.=' : ';
- if ($action == 'classify') {
- //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
- $morehtmlref.='';
- } else {
- $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
- }
+ }
+ if ($action == 'classify') {
+ //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
+ $morehtmlref.='';
+ } else {
+ $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
+ }
} else {
if (! empty($object->fk_project)) {
$proj = new Project($db);
diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php
index 0931067f155..2cb69bd698b 100644
--- a/htdocs/commande/note.php
+++ b/htdocs/commande/note.php
@@ -97,20 +97,21 @@ if ($id > 0 || ! empty($ref))
$morehtmlref.='
'.$langs->trans('Project') . ' ';
if ($user->rights->commande->creer)
{
- if ($action != 'classify')
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
- $morehtmlref.=' : ';
- if ($action == 'classify') {
- //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
- $morehtmlref.='';
- } else {
- $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
- }
+ if ($action != 'classify') {
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ $morehtmlref.=' : ';
+ }
+ if ($action == 'classify') {
+ //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
+ $morehtmlref.='';
+ } else {
+ $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
+ }
} else {
if (! empty($object->fk_project)) {
$proj = new Project($db);
diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php
index 86f98f4f0e9..459940dcc64 100644
--- a/htdocs/commande/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php
@@ -18,17 +18,12 @@
*/
// Protection to avoid direct call of template
-if (empty($conf) || ! is_object($conf))
-{
+if (empty($conf) || ! is_object($conf)) {
print "Error, template page can't be called as URL";
exit;
}
-?>
-
-
-
-\n";
global $user;
global $noMoreLinkedObjectBlockAfter;
@@ -41,54 +36,48 @@ $langs->load("orders");
$linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1);
-$total=0; $ilink=0;
+$total=0;
+$ilink=0;
foreach($linkedObjectBlock as $key => $objectlink)
{
$ilink++;
$trclass='oddeven';
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
-?>
-
- | trans("CustomerOrder"); ?>
- global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) print '
- |
- getNomUrl(1); ?> |
- ref_client; ?> |
- date, 'day'); ?> |
- rights->commande->lire) {
- $total = $total + $objectlink->total_ht;
- echo price($objectlink->total_ht);
- } ?> |
- getLibStatut(3); ?> |
-
- element != 'shipping') {
- ?>
- id.'&action=dellink&dellinkid='.$key; ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
-
- |
-
-';
+ echo ''.$langs->trans("CustomerOrder");
+ if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) {
+ print ' ';
+ echo ' | '.$objectlink->getNomUrl(1).' | ';
+ echo ''.$objectlink->ref_client.' | ';
+ echo ''.dol_print_date($objectlink->date, 'day').' | ';
+ echo '';
+ if ($user->rights->commande->lire) {
+ $total = $total + $objectlink->total_ht;
+ echo price($objectlink->total_ht);
+ }
+ echo ' | ';
+ echo ''.$objectlink->getLibStatut(3).' | ';
+ echo '';
+ // For now, shipments must stay linked to order, so link is not deletable
+ if($object->element != 'shipping') {
+ echo 'id.'&action=dellink&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'';
+ }
+ echo ' | ';
+ echo "\n";
}
-if (count($linkedObjectBlock) > 1)
-{
- ?>
-
- | trans("Total"); ?> |
- |
- |
- |
- |
- |
- |
-
- 1) {
+ echo '';
+ echo '| '.$langs->trans("Total").' | ';
+ echo ' | ';
+ echo ' | ';
+ echo ' | ';
+ echo ''.price($total).' | ';
+ echo ' | ';
+ echo ' | ';
+ echo "
\n";
}
-?>
-
+echo "\n";