';
}
@@ -512,8 +514,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
If not used by a module, I still need to understand in which case user may need this now we can set rule on product page.
if ($conf->global->PRODUIT_SOUSPRODUITS)
{
-
-
print '
-
- element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines
- {
- $coldisplay++;
- ?>
-
-
-
- info_bits & 2) != 2) {
- // I comment this because it shows info even when not required
- // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated
- // must also not be output for most entities (proposal, intervention, ...)
- //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." ";
- print '';
- }
- ?>
-
-
fk_product > 0) {
+ $tmpproduct = new Product($object->db);
+ $tmpproduct->fetch($line->fk_product);
+ print $tmpproduct->getNomUrl(1);
+}
+
+if (is_object($hookmanager))
+{
+ $fk_parent_line = (GETPOST('fk_parent_line') ? GETPOST('fk_parent_line') : $line->fk_parent_line);
+ $parameters=array('line'=>$line,'fk_parent_line'=>$fk_parent_line,'var'=>$var,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer);
+ $reshook=$hookmanager->executeHooks('formEditProductOptions', $parameters, $this, $action);
+}
+
+print '';
+
+/*if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines
+{
+ $coldisplay++;
+?>
+
+';
+if (($line->info_bits & 2) != 2) {
+ // I comment this because it shows info even when not required
+ // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated
+ // must also not be output for most entities (proposal, intervention, ...)
+ //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." ";
+ print '';
+}
+print '';
+
+if ($conf->global->PRODUCT_USE_UNITS)
+{
+ $coldisplay++;
+ print '
';
+$coldisplay++;
+echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price
+print '
';
-
- $disabledproject=1;$disabledtask=1;
- //print "x".$lines[$i]->fk_project;
- //var_dump($lines[$i]);
- //var_dump($projectsrole[$lines[$i]->fk_project]);
- // If at least one role for project
- if ($lines[$i]->public || ! empty($projectsrole[$lines[$i]->fk_project]) || $user->rights->projet->all->creer)
- {
- $disabledproject=0;
- $disabledtask=0;
- }
- // If $restricteditformytask is on and I have no role on task, i disable edit
- if ($restricteditformytask && empty($tasksrole[$lines[$i]->id]))
- {
- $disabledtask=1;
- }
-
- // Hour
- print '
';
+
+ $disabledproject=1;$disabledtask=1;
+ //print "x".$lines[$i]->fk_project;
+ //var_dump($lines[$i]);
+ //var_dump($projectsrole[$lines[$i]->fk_project]);
+ // If at least one role for project
+ if ($lines[$i]->public || ! empty($projectsrole[$lines[$i]->fk_project]) || $user->rights->projet->all->creer)
+ {
+ $disabledproject=0;
+ $disabledtask=0;
+ }
+ // If $restricteditformytask is on and I have no role on task, i disable edit
+ if ($restricteditformytask && empty($tasksrole[$lines[$i]->id]))
+ {
+ $disabledtask=1;
+ }
+
+ // Hour
+ print '
\n";
+ }
//}
//else
//{
diff --git a/htdocs/core/lib/reception.lib.php b/htdocs/core/lib/reception.lib.php
index af27cea4292..15ca4de37e0 100644
--- a/htdocs/core/lib/reception.lib.php
+++ b/htdocs/core/lib/reception.lib.php
@@ -105,18 +105,18 @@ function reception_admin_prepare_head()
if (! empty($conf->global->MAIN_SUBMODULE_RECEPTION))
{
- $head[$h][0] = DOL_URL_ROOT.'/admin/reception_extrafields.php';
- $head[$h][1] = $langs->trans("ExtraFields");
- $head[$h][2] = 'attributes_reception';
- $h++;
+ $head[$h][0] = DOL_URL_ROOT.'/admin/reception_extrafields.php';
+ $head[$h][1] = $langs->trans("ExtraFields");
+ $head[$h][2] = 'attributes_reception';
+ $h++;
}
if (! empty($conf->global->MAIN_SUBMODULE_RECEPTION))
{
- $head[$h][0] = DOL_URL_ROOT.'/admin/commande_fournisseur_dispatch_extrafields.php';
- $head[$h][1] = $langs->trans("ExtraFieldsLines");
- $head[$h][2] = 'attributeslines_reception';
- $h++;
+ $head[$h][0] = DOL_URL_ROOT.'/admin/commande_fournisseur_dispatch_extrafields.php';
+ $head[$h][1] = $langs->trans("ExtraFieldsLines");
+ $head[$h][2] = 'attributeslines_reception';
+ $h++;
}
diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php
index a4ddb68dbd3..b45eaa4b7a9 100644
--- a/htdocs/core/lib/xcal.lib.php
+++ b/htdocs/core/lib/xcal.lib.php
@@ -180,7 +180,7 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile)
if (! empty($location)) fwrite($calfileh, "LOCATION:".$encoding.$location."\n");
if ($fulldayevent) fwrite($calfileh, "X-FUNAMBOL-ALLDAY:1\n");
-
+
// see https://docs.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxcical/0f262da6-c5fd-459e-9f18-145eba86b5d2
if ($fulldayevent) fwrite($calfileh, "X-MICROSOFT-CDO-ALLDAYEVENT:TRUE\n");
@@ -320,7 +320,7 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt
fwrite($fichier, $form);
$form=''."\n".
-// 'fr'."\n".
+ // 'fr'."\n".
'Dolibarr'."\n".
''.$date.''."\n".
'Dolibarr'."\n";
diff --git a/htdocs/core/triggers/interface_20_all_Logevents.class.php b/htdocs/core/triggers/interface_20_all_Logevents.class.php
index 6be5e3904ab..93d1b37c690 100644
--- a/htdocs/core/triggers/interface_20_all_Logevents.class.php
+++ b/htdocs/core/triggers/interface_20_all_Logevents.class.php
@@ -177,13 +177,13 @@ class InterfaceLogevents extends DolibarrTriggers
}
// If not found
-/*
+ /*
else
{
dol_syslog("Trigger '".$this->name."' for action '$action' was ran by ".__FILE__." but no handler found for this action.");
return 0;
}
-*/
+ */
// Add more information into desc from the context property
if (! empty($desc) && ! empty($object->context['audit'])) $desc.=' - '.$object->context['audit'];
diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
index 5676bb82cfb..e72da40d6b0 100644
--- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
+++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
@@ -251,7 +251,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
}
elseif ($action == 'BILL_UNVALIDATE')
{
- // Load translation files required by the page
+ // Load translation files required by the page
$langs->loadLangs(array("agenda","other","bills"));
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceBackToDraftInDolibarr", $object->ref);
@@ -808,9 +808,9 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->actionmsg=$langs->transnoentities("TICKET_ASSIGNEDInDolibarr", $object->ref);
if ($object->oldcopy->fk_user_assign > 0)
{
- $tmpuser=new User($this->db);
- $tmpuser->fetch($object->oldcopy->fk_user_assign);
- $object->actionmsg.="\n".$langs->transnoentities("OldUser").': '.$tmpuser->getFullName($langs);
+ $tmpuser=new User($this->db);
+ $tmpuser->fetch($object->oldcopy->fk_user_assign);
+ $object->actionmsg.="\n".$langs->transnoentities("OldUser").': '.$tmpuser->getFullName($langs);
}
else
{
diff --git a/htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php b/htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php
index 301d565c2ba..b9dbd340d88 100644
--- a/htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php
+++ b/htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php
@@ -181,7 +181,7 @@ class InterfaceZapierTriggers extends DolibarrTriggers
case 'CONTACT_MODIFY':
case 'CONTACT_DELETE':
case 'CONTACT_ENABLEDISABLE':
-
+ break;
// Products
// case 'PRODUCT_CREATE':
// case 'PRODUCT_MODIFY':
@@ -221,7 +221,7 @@ class InterfaceZapierTriggers extends DolibarrTriggers
case 'LINEORDER_INSERT':
case 'LINEORDER_UPDATE':
case 'LINEORDER_DELETE':
-
+ break;
// Supplier orders
// case 'ORDER_SUPPLIER_CREATE':
// case 'ORDER_SUPPLIER_CLONE':
diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php
index 4ac7fb6e716..970d4841fbf 100644
--- a/htdocs/modulebuilder/index.php
+++ b/htdocs/modulebuilder/index.php
@@ -660,20 +660,20 @@ if ($dirins && $action == 'initobject' && $module && $objectname)
{
// Copy some files
$filetogenerate = array(
- 'myobject_card.php'=>strtolower($objectname).'_card.php',
- 'myobject_note.php'=>strtolower($objectname).'_note.php',
- 'myobject_document.php'=>strtolower($objectname).'_document.php',
- 'myobject_agenda.php'=>strtolower($objectname).'_agenda.php',
- 'myobject_list.php'=>strtolower($objectname).'_list.php',
- 'lib/mymodule_myobject.lib.php'=>'lib/'.strtolower($module).'_'.strtolower($objectname).'.lib.php',
- //'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.strtolower($objectname).'Test.php',
- 'sql/llx_mymodule_myobject.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql',
- 'sql/llx_mymodule_myobject_extrafields.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.sql',
- 'sql/llx_mymodule_myobject.key.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.key.sql',
- //'scripts/mymodule.php'=>'scripts/'.strtolower($objectname).'.php',
- 'img/object_myobject.png'=>'img/object_'.strtolower($objectname).'.png',
- 'class/myobject.class.php'=>'class/'.strtolower($objectname).'.class.php',
- //'class/api_mymodule.class.php'=>'class/api_'.strtolower($module).'.class.php'
+ 'myobject_card.php'=>strtolower($objectname).'_card.php',
+ 'myobject_note.php'=>strtolower($objectname).'_note.php',
+ 'myobject_document.php'=>strtolower($objectname).'_document.php',
+ 'myobject_agenda.php'=>strtolower($objectname).'_agenda.php',
+ 'myobject_list.php'=>strtolower($objectname).'_list.php',
+ 'lib/mymodule_myobject.lib.php'=>'lib/'.strtolower($module).'_'.strtolower($objectname).'.lib.php',
+ //'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.strtolower($objectname).'Test.php',
+ 'sql/llx_mymodule_myobject.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql',
+ 'sql/llx_mymodule_myobject_extrafields.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.sql',
+ 'sql/llx_mymodule_myobject.key.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.key.sql',
+ //'scripts/mymodule.php'=>'scripts/'.strtolower($objectname).'.php',
+ 'img/object_myobject.png'=>'img/object_'.strtolower($objectname).'.png',
+ 'class/myobject.class.php'=>'class/'.strtolower($objectname).'.class.php',
+ //'class/api_mymodule.class.php'=>'class/api_'.strtolower($module).'.class.php',
);
foreach($filetogenerate as $srcfile => $destfile)
@@ -696,68 +696,81 @@ if ($dirins && $action == 'initobject' && $module && $objectname)
//if (! $error) // If there is error copying 1 file, we still have to make the replacement
//{
- // Scan for object class files
- $listofobject = dol_dir_list($destdir.'/class', 'files', 0, '\.class\.php$');
+ // Scan for object class files
+ $listofobject = dol_dir_list($destdir.'/class', 'files', 0, '\.class\.php$');
- $firstobjectname='';
- foreach($listofobject as $fileobj)
+ $firstobjectname='';
+ foreach($listofobject as $fileobj)
+ {
+ if (preg_match('/^api_/', $fileobj['name'])) continue;
+ if (preg_match('/^actions_/', $fileobj['name'])) continue;
+
+ $tmpcontent=file_get_contents($fileobj['fullname']);
+ $reg=array();
+ if (preg_match('/class\s+([^\s]*)\s+extends\s+CommonObject/ims', $tmpcontent, $reg))
{
- if (preg_match('/^api_/', $fileobj['name'])) continue;
- if (preg_match('/^actions_/', $fileobj['name'])) continue;
-
- $tmpcontent=file_get_contents($fileobj['fullname']);
- $reg=array();
- if (preg_match('/class\s+([^\s]*)\s+extends\s+CommonObject/ims', $tmpcontent, $reg))
- {
- $objectnameloop = $reg[1];
- if (empty($firstobjectname)) $firstobjectname = $objectnameloop;
- }
-
- // Regenerate left menu entry in descriptor for $objectname
- $stringtoadd="
-\t\t\$this->menu[\$r++]=array(
- 'fk_menu'=>'fk_mainmenu=mymodule', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
- 'type'=>'left', // This is a Left menu entry
- 'titre'=>'List MyObject',
- 'mainmenu'=>'mymodule',
- 'leftmenu'=>'mymodule_myobject',
- 'url'=>'/mymodule/myobject_list.php',
- 'langs'=>'mymodule@mymodule', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
- 'position'=>1100+\$r,
- 'enabled'=>'\$conf->mymodule->enabled', // Define condition to show or hide menu entry. Use '\$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '\$leftmenu==\'system\'' to show if leftmenu system is selected.
- 'perms'=>'1', // Use 'perms'=>'\$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
- 'target'=>'',
- 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
-\t\t\$this->menu[\$r++]=array(
- 'fk_menu'=>'fk_mainmenu=mymodule,fk_leftmenu=mymodule_myobject', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
- 'type'=>'left', // This is a Left menu entry
- 'titre'=>'New MyObject',
- 'mainmenu'=>'mymodule',
- 'leftmenu'=>'mymodule_myobject',
- 'url'=>'/mymodule/myobject_card.php?action=create',
- 'langs'=>'mymodule@mymodule', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
- 'position'=>1100+\$r,
- 'enabled'=>'\$conf->mymodule->enabled', // Define condition to show or hide menu entry. Use '\$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '\$leftmenu==\'system\'' to show if leftmenu system is selected.
- 'perms'=>'1', // Use 'perms'=>'\$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
- 'target'=>'',
- 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
- ";
- $stringtoadd = preg_replace('/MyObject/', $objectnameloop, $stringtoadd);
- $stringtoadd = preg_replace('/mymodule/', strtolower($module), $stringtoadd);
- $stringtoadd = preg_replace('/myobject/', strtolower($objectnameloop), $stringtoadd);
-
- $moduledescriptorfile=$destdir.'/core/modules/mod'.$module.'.class.php';
-
- // TODO Allow a replace with regex using dolReplaceInFile with param arryreplacementisregex to 1
- // TODO Avoid duplicate addition
-
- dolReplaceInFile($moduledescriptorfile, array('END MODULEBUILDER LEFTMENU MYOBJECT */' => '*/'."\n".$stringtoadd."\n\t\t/* END MODULEBUILDER LEFTMENU MYOBJECT */"));
-
- // Add module descriptor to list of files to replace "MyObject' string with real name of object.
- $filetogenerate[]='core/modules/mod'.$module.'.class.php';
-
- // TODO
+ $objectnameloop = $reg[1];
+ if (empty($firstobjectname)) $firstobjectname = $objectnameloop;
}
+
+ // Regenerate left menu entry in descriptor for $objectname
+ $stringtoadd = "
+ \$this->menu[\$r++]=array(
+ // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
+ 'fk_menu'=>'fk_mainmenu=mymodule',
+ // This is a Left menu entry
+ 'type'=>'left',
+ 'titre'=>'List MyObject',
+ 'mainmenu'=>'mymodule',
+ 'leftmenu'=>'mymodule_myobject',
+ 'url'=>'/mymodule/myobject_list.php',
+ // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
+ 'langs'=>'mymodule@mymodule',
+ 'position'=>1100+\$r,
+ // Define condition to show or hide menu entry. Use '\$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '\$leftmenu==\'system\'' to show if leftmenu system is selected.
+ 'enabled'=>'\$conf->mymodule->enabled',
+ // Use 'perms'=>'\$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
+ 'perms'=>'1',
+ 'target'=>'',
+ // 0=Menu for internal users, 1=external users, 2=both
+ 'user'=>2,
+ );
+ \$this->menu[\$r++]=array(
+ // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
+ 'fk_menu'=>'fk_mainmenu=mymodule,fk_leftmenu=mymodule_myobject',
+ // This is a Left menu entry
+ 'type'=>'left',
+ 'titre'=>'New MyObject',
+ 'mainmenu'=>'mymodule',
+ 'leftmenu'=>'mymodule_myobject',
+ 'url'=>'/mymodule/myobject_card.php?action=create',
+ // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
+ 'langs'=>'mymodule@mymodule',
+ 'position'=>1100+\$r,
+ // Define condition to show or hide menu entry. Use '\$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '\$leftmenu==\'system\'' to show if leftmenu system is selected.
+ 'enabled'=>'\$conf->mymodule->enabled',
+ // Use 'perms'=>'\$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
+ 'perms'=>'1',
+ 'target'=>'',
+ // 0=Menu for internal users, 1=external users, 2=both
+ 'user'=>2
+ );\n";
+ $stringtoadd = preg_replace('/MyObject/', $objectnameloop, $stringtoadd);
+ $stringtoadd = preg_replace('/mymodule/', strtolower($module), $stringtoadd);
+ $stringtoadd = preg_replace('/myobject/', strtolower($objectnameloop), $stringtoadd);
+
+ $moduledescriptorfile=$destdir.'/core/modules/mod'.$module.'.class.php';
+
+ // TODO Allow a replace with regex using dolReplaceInFile with param arryreplacementisregex to 1
+ // TODO Avoid duplicate addition
+
+ dolReplaceInFile($moduledescriptorfile, array('END MODULEBUILDER LEFTMENU MYOBJECT */' => '*/'."\n".$stringtoadd."\n\t\t/* END MODULEBUILDER LEFTMENU MYOBJECT */"));
+
+ // Add module descriptor to list of files to replace "MyObject' string with real name of object.
+ $filetogenerate[]='core/modules/mod'.$module.'.class.php';
+
+ // TODO
+ }
//}
}
@@ -888,11 +901,12 @@ if ($dirins && $action == 'addproperty' && !empty($module) && ! empty($tabobj))
if (! $error)
{
$addfieldentry = array(
- 'name'=>GETPOST('propname', 'aZ09'),'label'=>GETPOST('proplabel', 'alpha'),'type'=>GETPOST('proptype', 'alpha'),
- 'arrayofkeyval'=>GETPOST('proparrayofkeyval', 'none'), // Example json string '{"0":"Draft","1":"Active","-1":"Cancel"}'
- 'visible'=>GETPOST('propvisible', 'int'),'enabled'=>GETPOST('propenabled', 'int'),
- 'position'=>GETPOST('propposition', 'int'),'notnull'=>GETPOST('propnotnull', 'int'),'index'=>GETPOST('propindex', 'int'),'searchall'=>GETPOST('propsearchall', 'int'),
- 'isameasure'=>GETPOST('propisameasure', 'int'), 'comment'=>GETPOST('propcomment', 'alpha'),'help'=>GETPOST('prophelp', 'alpha'));
+ 'name'=>GETPOST('propname', 'aZ09'),'label'=>GETPOST('proplabel', 'alpha'),'type'=>GETPOST('proptype', 'alpha'),
+ 'arrayofkeyval'=>GETPOST('proparrayofkeyval', 'none'), // Example json string '{"0":"Draft","1":"Active","-1":"Cancel"}'
+ 'visible'=>GETPOST('propvisible', 'int'),'enabled'=>GETPOST('propenabled', 'int'),
+ 'position'=>GETPOST('propposition', 'int'),'notnull'=>GETPOST('propnotnull', 'int'),'index'=>GETPOST('propindex', 'int'),'searchall'=>GETPOST('propsearchall', 'int'),
+ 'isameasure'=>GETPOST('propisameasure', 'int'), 'comment'=>GETPOST('propcomment', 'alpha'),'help'=>GETPOST('prophelp', 'alpha')
+ );
if (! empty($addfieldentry['arrayofkeyval']) && ! is_array($addfieldentry['arrayofkeyval']))
{
diff --git a/htdocs/modulebuilder/template/test/phpunit/MyModuleFunctionalTest.php b/htdocs/modulebuilder/template/test/phpunit/MyModuleFunctionalTest.php
index b4057cf178e..d7077d750b5 100644
--- a/htdocs/modulebuilder/template/test/phpunit/MyModuleFunctionalTest.php
+++ b/htdocs/modulebuilder/template/test/phpunit/MyModuleFunctionalTest.php
@@ -69,14 +69,14 @@ class MyModuleFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
),
// Geckodriver does not keep the session at the moment?!
// XPath selectors also don't seem to work
-// array(
-// 'browser' => 'Mozilla Firefox on Linux',
-// 'browserName' => 'firefox',
-// 'sessionStrategy' => 'shared',
-// 'desiredCapabilities' => array(
-// 'marionette' => true
-// )
-// )
+ //array(
+ // 'browser' => 'Mozilla Firefox on Linux',
+ // 'browserName' => 'firefox',
+ // 'sessionStrategy' => 'shared',
+ // 'desiredCapabilities' => array(
+ // 'marionette' => true,
+ // ),
+ //)
);
/**
@@ -224,7 +224,7 @@ class MyModuleFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
{
$this->url('/custom/mymodule/admin/about.php');
$this->authenticate();
-return $this->assertEquals(
+ return $this->assertEquals(
'Dolibarr Module Template (aka My Module)',
$this->byTag('h1')->text(),
"Readme title"
@@ -254,7 +254,7 @@ return $this->assertEquals(
{
$this->url('/admin/triggers.php');
$this->authenticate();
-return $this->assertContains(
+ return $this->assertContains(
'interface_99_modMyModule_MyModuleTriggers.class.php',
$this->byTag('body')->text(),
"Trigger declared"
@@ -271,7 +271,7 @@ return $this->assertContains(
{
$this->url('/admin/triggers.php');
$this->authenticate();
-return $this->assertContains(
+ return $this->assertContains(
'tick.png',
$this->byXPath('//td[text()="interface_99_modMyModule_MyTrigger.class.php"]/following::img')->attribute('src'),
"Trigger enabled"
diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php
index 48c633126ce..786ed7220b5 100644
--- a/htdocs/opensurvey/class/opensurveysondage.class.php
+++ b/htdocs/opensurvey/class/opensurveysondage.class.php
@@ -267,7 +267,7 @@ class Opensurveysondage extends CommonObject
$this->db->free($resql);
}
else
- {
+ {
$this->error="Error ".$this->db->lasterror();
$ret=-1;
}
diff --git a/htdocs/product/admin/price_rules.php b/htdocs/product/admin/price_rules.php
index 299f78c1a7d..885af18d63d 100644
--- a/htdocs/product/admin/price_rules.php
+++ b/htdocs/product/admin/price_rules.php
@@ -168,10 +168,10 @@ $genPriceOptions = function ($level) use ($price_options) {
echo $langs->trans('SellingPrice').' '.$i;
// Label of price
$keyforlabel='PRODUIT_MULTIPRICES_LABEL'.$i;
- if (! empty($conf->global->$keyforlabel)) {
- print ' - '.$langs->trans($conf->global->$keyforlabel);
- }
- ?>
+ if (! empty($conf->global->$keyforlabel)) {
+ print ' - '.$langs->trans($conf->global->$keyforlabel);
+ }
+ ?>
';
$html .= $langs->trans("NoDraftProposals");
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index d7ab4e99c78..c55e888e405 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -1603,85 +1603,85 @@ class Product extends CommonObject
$price_base_type = $this->price_base_type;
// If price per segment
- if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($thirdparty_buyer->price_level))
+ if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($thirdparty_buyer->price_level))
{
- $pu_ht = $this->multiprices[$thirdparty_buyer->price_level];
- $pu_ttc = $this->multiprices_ttc[$thirdparty_buyer->price_level];
- $price_min = $this->multiprices_min[$thirdparty_buyer->price_level];
- $price_base_type = $this->multiprices_base_type[$thirdparty_buyer->price_level];
- if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility
- {
- if (isset($this->multiprices_tva_tx[$thirdparty_buyer->price_level])) $tva_tx=$this->multiprices_tva_tx[$thirdparty_buyer->price_level];
- if (isset($this->multiprices_recuperableonly[$thirdparty_buyer->price_level])) $tva_npr=$this->multiprices_recuperableonly[$thirdparty_buyer->price_level];
- if (empty($tva_tx)) $tva_npr=0;
- }
- }
+ $pu_ht = $this->multiprices[$thirdparty_buyer->price_level];
+ $pu_ttc = $this->multiprices_ttc[$thirdparty_buyer->price_level];
+ $price_min = $this->multiprices_min[$thirdparty_buyer->price_level];
+ $price_base_type = $this->multiprices_base_type[$thirdparty_buyer->price_level];
+ if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility
+ {
+ if (isset($this->multiprices_tva_tx[$thirdparty_buyer->price_level])) $tva_tx=$this->multiprices_tva_tx[$thirdparty_buyer->price_level];
+ if (isset($this->multiprices_recuperableonly[$thirdparty_buyer->price_level])) $tva_npr=$this->multiprices_recuperableonly[$thirdparty_buyer->price_level];
+ if (empty($tva_tx)) $tva_npr=0;
+ }
+ }
// If price per customer
- elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
+ elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
{
- require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
+ require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
- $prodcustprice = new Productcustomerprice($db);
+ $prodcustprice = new Productcustomerprice($db);
- $filter = array('t.fk_product' => $this->id,'t.fk_soc' => $thirdparty_buyer->id);
+ $filter = array('t.fk_product' => $this->id,'t.fk_soc' => $thirdparty_buyer->id);
- $result = $prodcustprice->fetch_all('', '', 0, 0, $filter);
- if ($result) {
- if (count($prodcustprice->lines) > 0) {
- $pu_ht = price($prodcustprice->lines[0]->price);
- $pu_ttc = price($prodcustprice->lines[0]->price_ttc);
- $price_base_type = $prodcustprice->lines[0]->price_base_type;
- $tva_tx = $prodcustprice->lines[0]->tva_tx;
- if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
- $tva_npr = $prodcustprice->lines[0]->recuperableonly;
- if (empty($tva_tx)) $tva_npr=0;
- }
- }
+ $result = $prodcustprice->fetch_all('', '', 0, 0, $filter);
+ if ($result) {
+ if (count($prodcustprice->lines) > 0) {
+ $pu_ht = price($prodcustprice->lines[0]->price);
+ $pu_ttc = price($prodcustprice->lines[0]->price_ttc);
+ $price_base_type = $prodcustprice->lines[0]->price_base_type;
+ $tva_tx = $prodcustprice->lines[0]->tva_tx;
+ if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
+ $tva_npr = $prodcustprice->lines[0]->recuperableonly;
+ if (empty($tva_tx)) $tva_npr=0;
}
+ }
+ }
// If price per quantity
- elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY))
+ elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY))
{
- if ($this->prices_by_qty[0]) // yes, this product has some prices per quantity
+ if ($this->prices_by_qty[0]) // yes, this product has some prices per quantity
+ {
+ // Search price into product_price_by_qty from $this->id
+ foreach($this->prices_by_qty_list[0] as $priceforthequantityarray)
+ {
+ if ($priceforthequantityarray['rowid'] != $pqp) continue;
+ // We found the price
+ if ($priceforthequantityarray['price_base_type'] == 'HT')
{
- // Search price into product_price_by_qty from $this->id
- foreach($this->prices_by_qty_list[0] as $priceforthequantityarray)
- {
- if ($priceforthequantityarray['rowid'] != $pqp) continue;
- // We found the price
- if ($priceforthequantityarray['price_base_type'] == 'HT')
- {
- $pu_ht = $priceforthequantityarray['unitprice'];
- }
- else
- {
- $pu_ttc = $priceforthequantityarray['unitprice'];
- }
- break;
- }
+ $pu_ht = $priceforthequantityarray['unitprice'];
}
+ else
+ {
+ $pu_ttc = $priceforthequantityarray['unitprice'];
+ }
+ break;
}
+ }
+ }
// If price per quantity and customer
- elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))
+ elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))
{
- if ($this->prices_by_qty[$thirdparty_buyer->price_level]) // yes, this product has some prices per quantity
+ if ($this->prices_by_qty[$thirdparty_buyer->price_level]) // yes, this product has some prices per quantity
+ {
+ // Search price into product_price_by_qty from $this->id
+ foreach($this->prices_by_qty_list[$thirdparty_buyer->price_level] as $priceforthequantityarray)
+ {
+ if ($priceforthequantityarray['rowid'] != $pqp) continue;
+ // We found the price
+ if ($priceforthequantityarray['price_base_type'] == 'HT')
{
- // Search price into product_price_by_qty from $this->id
- foreach($this->prices_by_qty_list[$thirdparty_buyer->price_level] as $priceforthequantityarray)
- {
- if ($priceforthequantityarray['rowid'] != $pqp) continue;
- // We found the price
- if ($priceforthequantityarray['price_base_type'] == 'HT')
- {
- $pu_ht = $priceforthequantityarray['unitprice'];
- }
- else
- {
- $pu_ttc = $priceforthequantityarray['unitprice'];
- }
- break;
- }
+ $pu_ht = $priceforthequantityarray['unitprice'];
}
+ else
+ {
+ $pu_ttc = $priceforthequantityarray['unitprice'];
+ }
+ break;
}
+ }
+ }
return array('pu_ht'=>$pu_ht, 'pu_ttc'=>$pu_ttc, 'price_min'=>$price_min, 'price_base_type'=>$price_base_type, 'tva_tx'=>$tva_tx, 'tva_npr'=>$tva_npr);
}
@@ -4293,14 +4293,14 @@ class Product extends CommonObject
{
switch ($type)
{
- case 0:
+ case 0:
return $this->LibStatut($this->status, $mode, $type);
- case 1:
+ case 1:
return $this->LibStatut($this->status_buy, $mode, $type);
- case 2:
+ case 2:
return $this->LibStatut($this->status_batch, $mode, $type);
- default:
- //Simulate previous behavior but should return an error string
+ default:
+ //Simulate previous behavior but should return an error string
return $this->LibStatut($this->status_buy, $mode, $type);
}
}
diff --git a/htdocs/product/inventory/ajax/ajax.inventory.php b/htdocs/product/inventory/ajax/ajax.inventory.php
index f94a383f666..ced76050e31 100644
--- a/htdocs/product/inventory/ajax/ajax.inventory.php
+++ b/htdocs/product/inventory/ajax/ajax.inventory.php
@@ -6,45 +6,45 @@ require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php';
$get = GETPOST('get', 'alpha');
$put = GETPOST('put', 'alpha');
- switch ($put)
- {
- case 'qty':
- if (empty($user->rights->stock->creer)) { echo -1; exit; }
+switch ($put)
+{
+ case 'qty':
+ if (empty($user->rights->stock->creer)) { echo -1; exit; }
- $fk_det_inventory = GETPOST('fk_det_inventory');
+ $fk_det_inventory = GETPOST('fk_det_inventory');
- $det = new InventoryLine($db);
- if( $det->fetch($fk_det_inventory))
- {
- $det->qty_view+=GETPOST('qty');
- $res = $det->update($user);
+ $det = new InventoryLine($db);
+ if( $det->fetch($fk_det_inventory))
+ {
+ $det->qty_view+=GETPOST('qty');
+ $res = $det->update($user);
- echo $det->qty_view;
- }
- else
- {
- echo -2;
- }
+ echo $det->qty_view;
+ }
+ else
+ {
+ echo -2;
+ }
- break;
+ break;
- case 'pmp':
- if (empty($user->rights->stock->creer) || empty($user->rights->stock->changePMP)) { echo -1; exit; }
+ case 'pmp':
+ if (empty($user->rights->stock->creer) || empty($user->rights->stock->changePMP)) { echo -1; exit; }
- $fk_det_inventory = GETPOST('fk_det_inventory');
+ $fk_det_inventory = GETPOST('fk_det_inventory');
- $det = new InventoryLine($db);
- if( $det->fetch($fk_det_inventory))
- {
- $det->new_pmp=price2num(GETPOST('pmp'));
- $det->update($user);
+ $det = new InventoryLine($db);
+ if( $det->fetch($fk_det_inventory))
+ {
+ $det->new_pmp=price2num(GETPOST('pmp'));
+ $det->update($user);
- echo $det->new_pmp;
- }
- else
- {
- echo -2;
- }
+ echo $det->new_pmp;
+ }
+ else
+ {
+ echo -2;
+ }
- break;
- }
+ break;
+}
diff --git a/htdocs/product/price.php b/htdocs/product/price.php
index 139fd681ee0..e8e332d95b5 100644
--- a/htdocs/product/price.php
+++ b/htdocs/product/price.php
@@ -475,10 +475,10 @@ if (empty($reshook))
{
$priceid = GETPOST('priceid', 'int');
if (!empty($rowid)) {
- $sql = "DELETE FROM " . MAIN_DB_PREFIX . "product_price_by_qty";
- $sql .= " WHERE fk_product_price = " . $priceid;
+ $sql = "DELETE FROM " . MAIN_DB_PREFIX . "product_price_by_qty";
+ $sql .= " WHERE fk_product_price = " . $priceid;
- $result = $db->query($sql);
+ $result = $db->query($sql);
} else {
setEventMessages(('delete_price_by_qty'.$langs->transnoentities(MissingIds)), null, 'errors');
}
@@ -755,17 +755,17 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUI
if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility
{
- // TVA
- print '
' . $langs->trans("DefaultTaxRate") . '
';
+ // TVA
+ print '
' . $langs->trans("DefaultTaxRate") . '
';
- $positiverates='';
- if (price2num($object->multiprices_tva_tx[$soc->price_level])) $positiverates.=($positiverates?'/':'').price2num($object->multiprices_tva_tx[$soc->price_level]);
- if (price2num($object->multiprices_localtax1_type[$soc->price_level])) $positiverates.=($positiverates?'/':'').price2num($object->multiprices_localtax1_tx[$soc->price_level]);
- if (price2num($object->multiprices_localtax2_type[$soc->price_level])) $positiverates.=($positiverates?'/':'').price2num($object->multiprices_localtax2_tx[$soc->price_level]);
- if (empty($positiverates)) $positiverates='0';
- echo vatrate($positiverates.($object->default_vat_code?' ('.$object->default_vat_code.')':''), '%', $object->tva_npr);
- //print vatrate($object->multiprices_tva_tx[$soc->price_level], true);
- print '
';
+ $positiverates='';
+ if (price2num($object->multiprices_tva_tx[$soc->price_level])) $positiverates.=($positiverates?'/':'').price2num($object->multiprices_tva_tx[$soc->price_level]);
+ if (price2num($object->multiprices_localtax1_type[$soc->price_level])) $positiverates.=($positiverates?'/':'').price2num($object->multiprices_localtax1_tx[$soc->price_level]);
+ if (price2num($object->multiprices_localtax2_type[$soc->price_level])) $positiverates.=($positiverates?'/':'').price2num($object->multiprices_localtax2_tx[$soc->price_level]);
+ if (empty($positiverates)) $positiverates='0';
+ echo vatrate($positiverates.($object->default_vat_code?' ('.$object->default_vat_code.')':''), '%', $object->tva_npr);
+ //print vatrate($object->multiprices_tva_tx[$soc->price_level], true);
+ print '';
}
else
{
@@ -791,10 +791,10 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUI
{
if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility
{
- // We show only vat for level 1
- print '
';
// Serial / Eat-by date
- if (! empty($conf->productbatch->enabled) &&
+if (! empty($conf->productbatch->enabled) &&
(($object->element == 'product' && $object->hasbatch())
|| ($object->element == 'stock'))
)
- {
- print '
';
- print '
element == 'stock'?'': ' class="fieldrequired"').'>'.$langs->trans("batch_number").'
';
- if ($pdluoid > 0)
- {
- // If form was opened for a specific pdluoid, field is disabled
- print '';
- print '';
- }
- else
- {
- print '';
- }
- print '
';
- print '
';
+{
+ print '
';
+ print '
element == 'stock'?'': ' class="fieldrequired"').'>'.$langs->trans("batch_number").'
';
+ if ($pdluoid > 0)
+ {
+ // If form was opened for a specific pdluoid, field is disabled
+ print '';
+ print '';
+ }
+ else
+ {
+ print '';
+ }
+ print '
';
+ print '
';
- print '
';
- print '
'.$langs->trans("EatByDate").'
';
- print $form->selectDate(($d_eatby?$d_eatby:$pdluo->eatby), 'eatby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
- print '
';
- print '
'.$langs->trans("SellByDate").'
';
- print $form->selectDate(($d_sellby?$d_sellby:$pdluo->sellby), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
- print '
';
- print '
';
- }
+ print '
';
+ print '
'.$langs->trans("EatByDate").'
';
+ print $form->selectDate(($d_eatby?$d_eatby:$pdluo->eatby), 'eatby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
+ print '
';
+ print '
'.$langs->trans("SellByDate").'
';
+ print $form->selectDate(($d_sellby?$d_sellby:$pdluo->sellby), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
+ print '
';
+ print '
';
+}
// Label
$valformovementlabel=(GETPOST("label")?GETPOST("label"):$langs->trans("MovementTransferStock", $productref));
diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php
index f5db207a42e..e51b2e4b404 100644
--- a/htdocs/projet/activity/perweek.php
+++ b/htdocs/projet/activity/perweek.php
@@ -813,23 +813,23 @@ if (count($tasksarray) > 0)
print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).'';
print '';
- for ($idw = 0; $idw < 7; $idw++)
+ for ($idw = 0; $idw < 7; $idw++)
{
- $cssweekend='';
- if (($idw + 1) < $numstartworkingday || ($idw + 1) > $numendworkingday) // This is a day is not inside the setup of working days, so we use a week-end css.
- {
- $cssweekend='weekend';
- }
+ $cssweekend='';
+ if (($idw + 1) < $numstartworkingday || ($idw + 1) > $numendworkingday) // This is a day is not inside the setup of working days, so we use a week-end css.
+ {
+ $cssweekend='weekend';
+ }
- $tmpday=dol_time_plus_duree($firstdaytoshow, $idw, 'd');
+ $tmpday=dol_time_plus_duree($firstdaytoshow, $idw, 'd');
- $cssonholiday='';
- if (! $isavailable[$tmpday]['morning'] && ! $isavailable[$tmpday]['afternoon']) $cssonholiday.='onholidayallday ';
- elseif (! $isavailable[$tmpday]['morning']) $cssonholiday.='onholidaymorning ';
- elseif (! $isavailable[$tmpday]['afternoon']) $cssonholiday.='onholidayafternoon ';
+ $cssonholiday='';
+ if (! $isavailable[$tmpday]['morning'] && ! $isavailable[$tmpday]['afternoon']) $cssonholiday.='onholidayallday ';
+ elseif (! $isavailable[$tmpday]['morning']) $cssonholiday.='onholidaymorning ';
+ elseif (! $isavailable[$tmpday]['afternoon']) $cssonholiday.='onholidayafternoon ';
- print '
';
- }
+ print '
';
+ }
print '
';
}
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index da2d41512e1..a873b53dbc0 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -401,7 +401,7 @@ class Project extends CommonObject
$result = 1;
}
else
- {
+ {
$this->db->rollback();
$result = -1;
}
@@ -1222,7 +1222,7 @@ class Project extends CommonObject
// No filter. Use this if user has permission to see all project
}
- $sql.= $filter;
+ $sql.= $filter;
//print $sql;
$resql = $this->db->query($sql);
@@ -1722,23 +1722,23 @@ class Project extends CommonObject
$num = $this->db->num_rows($resql);
$i = 0;
// Loop on each record found, so each couple (project id, task id)
- while ($i < $num)
+ while ($i < $num)
{
- $obj=$this->db->fetch_object($resql);
- $day=$this->db->jdate($obj->task_date); // task_date is date without hours
- if (empty($daylareadyfound[$day]))
- {
- $this->weekWorkLoad[$day] = $obj->task_duration;
- $this->weekWorkLoadPerTask[$day][$obj->fk_task] = $obj->task_duration;
- }
- else
- {
- $this->weekWorkLoad[$day] += $obj->task_duration;
- $this->weekWorkLoadPerTask[$day][$obj->fk_task] += $obj->task_duration;
- }
- $daylareadyfound[$day]=1;
- $i++;
- }
+ $obj=$this->db->fetch_object($resql);
+ $day=$this->db->jdate($obj->task_date); // task_date is date without hours
+ if (empty($daylareadyfound[$day]))
+ {
+ $this->weekWorkLoad[$day] = $obj->task_duration;
+ $this->weekWorkLoadPerTask[$day][$obj->fk_task] = $obj->task_duration;
+ }
+ else
+ {
+ $this->weekWorkLoad[$day] += $obj->task_duration;
+ $this->weekWorkLoadPerTask[$day][$obj->fk_task] += $obj->task_duration;
+ }
+ $daylareadyfound[$day]=1;
+ $i++;
+ }
$this->db->free($resql);
return 1;
}
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index e35b4b4bdad..1bd044bc985 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -852,15 +852,15 @@ class Task extends CommonObject
$sql.=" t.rowid, t.ref, t.label, t.description, t.fk_task_parent, t.duration_effective, t.progress, t.fk_statut,";
$sql.=" t.dateo, t.datee, t.planned_workload, t.rang,";
$sql.=" s.rowid, s.nom, s.email,";
- $sql.=" p.fk_opp_status, p.opp_amount, p.opp_percent, p.budget_amount";
- if (!empty($extrafields->attributes['projet']['label']))
- {
- foreach ($extrafields->attributes['projet']['label'] as $key => $val) $sql.=($extrafields->attributes['projet']['type'][$key] != 'separate' ? ",efp.".$key : '');
- }
- if (!empty($extrafields->attributes['projet_task']['label']))
- {
- foreach ($extrafields->attributes['projet_task']['label'] as $key => $val) $sql.=($extrafields->attributes['projet_task']['type'][$key] != 'separate' ? ",efpt.".$key : '');
- }
+ $sql.=" p.fk_opp_status, p.opp_amount, p.opp_percent, p.budget_amount";
+ if (!empty($extrafields->attributes['projet']['label']))
+ {
+ foreach ($extrafields->attributes['projet']['label'] as $key => $val) $sql.=($extrafields->attributes['projet']['type'][$key] != 'separate' ? ",efp.".$key : '');
+ }
+ if (!empty($extrafields->attributes['projet_task']['label']))
+ {
+ foreach ($extrafields->attributes['projet_task']['label'] as $key => $val) $sql.=($extrafields->attributes['projet_task']['type'][$key] != 'separate' ? ",efpt.".$key : '');
+ }
}
$sql.= " ORDER BY p.ref, t.rang, t.dateo";
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index 3a2886229a0..44b803571ba 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -863,8 +863,8 @@ foreach ($listofreferent as $key => $value)
if (canApplySubtotalOn($tablename))
{
- // Sort
- $elementarray = sortElementsByClientName($elementarray);
+ // Sort
+ $elementarray = sortElementsByClientName($elementarray);
}
$num=count($elementarray);
@@ -1077,9 +1077,9 @@ foreach ($listofreferent as $key => $value)
if ($othermessage) print $othermessage;
if (isset($total_ht_by_line))
{
- if (! $qualifiedfortotal) print '';
- print price($total_ht_by_line);
- if (! $qualifiedfortotal) print '';
+ if (! $qualifiedfortotal) print '';
+ print price($total_ht_by_line);
+ if (! $qualifiedfortotal) print '';
}
if ($warning) print ' '.img_warning($warning);
print '';
@@ -1124,9 +1124,9 @@ foreach ($listofreferent as $key => $value)
if ($othermessage) print $othermessage;
if (isset($total_ttc_by_line))
{
- if (! $qualifiedfortotal) print '';
- print price($total_ttc_by_line);
- if (! $qualifiedfortotal) print '';
+ if (! $qualifiedfortotal) print '';
+ print price($total_ttc_by_line);
+ if (! $qualifiedfortotal) print '';
}
if ($warning) print ' '.img_warning($warning);
print '';
diff --git a/htdocs/projet/graph_opportunities.inc.php b/htdocs/projet/graph_opportunities.inc.php
index 5c5cd398354..7d75544ef93 100644
--- a/htdocs/projet/graph_opportunities.inc.php
+++ b/htdocs/projet/graph_opportunities.inc.php
@@ -35,11 +35,11 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
$valsamount[$obj->opp_status]=$obj->opp_amount;
$totalnb+=$obj->nb;
if ($obj->opp_status) $totaloppnb+=$obj->nb;
- if (! in_array($obj->code, array('WON', 'LOST')))
+ if (! in_array($obj->code, array('WON', 'LOST')))
{
- $totalamount+=$obj->opp_amount;
- $ponderated_opp_amount+=$obj->ponderated_opp_amount;
- }
+ $totalamount+=$obj->opp_amount;
+ $ponderated_opp_amount+=$obj->ponderated_opp_amount;
+ }
}
$total+=$row[0];
}
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index 9a5514ff1cc..8524e940f36 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -143,10 +143,10 @@ $arrayfields=array(
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
- foreach($extrafields->attribute_label as $key => $val)
- {
+ foreach($extrafields->attribute_label as $key => $val)
+ {
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>(abs($extrafields->attribute_list[$key])!=3 && $extrafields->attribute_perms[$key]));
- }
+ }
}
diff --git a/htdocs/projet/stats/index.php b/htdocs/projet/stats/index.php
index 9353f968116..f8480f8f322 100644
--- a/htdocs/projet/stats/index.php
+++ b/htdocs/projet/stats/index.php
@@ -108,7 +108,7 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
unset($data1);
if ($nocolor)
-$px->SetDataColor(array (
+ $px->SetDataColor(array (
array (
220,
220,
@@ -130,9 +130,9 @@ $px->SetDataColor(array (
));
$px->SetTitle($langs->trans('OpportunitiesStatusForProjects'));
$result=$px->draw($filenamenb, $fileurlnb);
- if ($result<0) {
- setEventMessages($px->error, null, 'errors');
- }
+ if ($result<0) {
+ setEventMessages($px->error, null, 'errors');
+ }
} else {
setEventMessages(null, $mesgs, 'errors');
}
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index 3d4077790c7..2abfea6e64e 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -645,7 +645,7 @@ elseif ($id > 0 || ! empty($ref))
print ' ';
-// Link to create task
+ // Link to create task
$linktocreatetaskParam = array();
$linktocreatetaskUserRight = false;
if ($user->rights->projet->all->creer || $user->rights->projet->creer) {
@@ -787,8 +787,8 @@ elseif ($id > 0 || ! empty($ref))
print_liste_field_titre("TaskProgressSummary", $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center ');
if ($object->usage_bill_time)
{
- print_liste_field_titre("TimeToBill", $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'right ');
- print_liste_field_titre("TimeBilled", $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'right ');
+ print_liste_field_titre("TimeToBill", $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'right ');
+ print_liste_field_titre("TimeBilled", $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'right ');
}
if (! empty($conf->global->PROJECT_SHOW_CONTACTS_IN_LIST)) print_liste_field_titre("TaskRessourceLinks", $_SERVER["PHP_SELF"], '', '', '', $sortfield, $sortorder);
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', 'width="80"', $sortfield, $sortorder, 'center maxwidthsearch ');
diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php
index 2448088c6b1..b09d8345177 100644
--- a/htdocs/projet/tasks/contact.php
+++ b/htdocs/projet/tasks/contact.php
@@ -356,7 +356,7 @@ if ($id > 0 || ! empty($ref))
/*
* Lines of contacts
*/
-/*
+ /*
// Contacts lines (modules that overwrite templates must declare this into descriptor)
$dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl'));
foreach($dirtpls as $reldir)
@@ -364,7 +364,7 @@ if ($id > 0 || ! empty($ref))
$res=@include dol_buildpath($reldir.'/contacts.tpl.php');
if ($res) break;
}
-*/
+ */
/*
* Add a new contact line
diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php
index d9730946377..78431f983a4 100644
--- a/htdocs/projet/tasks/task.php
+++ b/htdocs/projet/tasks/task.php
@@ -616,7 +616,7 @@ if ($id > 0 || ! empty($ref))
{
if (! $object->hasChildren() && ! $object->hasTimeSpent())
{
- print ''.$langs->trans('Delete').'';
+ print ''.$langs->trans('Delete').'';
}
else
{
diff --git a/test/phpunit/BankAccountTest.php b/test/phpunit/BankAccountTest.php
index 48e2a8ddb65..416a17f0c0f 100644
--- a/test/phpunit/BankAccountTest.php
+++ b/test/phpunit/BankAccountTest.php
@@ -169,7 +169,7 @@ class BankAccountTest extends PHPUnit\Framework\TestCase
return $localobject;
}
- /**
+ /**
* testBankAccountOther
*
* @param Object $localobject Object contract
diff --git a/test/phpunit/BonPrelevementTest.php b/test/phpunit/BonPrelevementTest.php
index eb830e1f827..135c77dfa2d 100644
--- a/test/phpunit/BonPrelevementTest.php
+++ b/test/phpunit/BonPrelevementTest.php
@@ -173,7 +173,7 @@ class BonPrelevementTest extends PHPUnit\Framework\TestCase
* @depends testBonPrelevementOther
* The depends says test is run only if previous is ok
*/
-/* public function testBonPrelevementDelete($id)
+ /* public function testBonPrelevementDelete($id)
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
@@ -189,5 +189,5 @@ class BonPrelevementTest extends PHPUnit\Framework\TestCase
$this->assertLessThan($result, 0);
return $result;
}
-*/
+ */
}
diff --git a/test/phpunit/ContratTest.php b/test/phpunit/ContratTest.php
index b64d3242edb..7c302105aa2 100644
--- a/test/phpunit/ContratTest.php
+++ b/test/phpunit/ContratTest.php
@@ -166,7 +166,7 @@ class ContratTest extends PHPUnit\Framework\TestCase
return $localobject;
}
- /**
+ /**
* testContratOther
*
* @param Object $localobject Object contract
diff --git a/test/phpunit/ExportTest.php b/test/phpunit/ExportTest.php
index 66ef42a9e15..7f440bf067d 100644
--- a/test/phpunit/ExportTest.php
+++ b/test/phpunit/ExportTest.php
@@ -265,7 +265,7 @@ class ExportTest extends PHPUnit\Framework\TestCase
public function testExportPersonalizedWithFilter()
{
global $conf,$user,$langs,$db;
-/*
+ /*
$sql = "SELECT f.ref as f_ref, f.total as f_total, f.tva as f_tva FROM ".MAIN_DB_PREFIX."facture f";
$objexport=new Export($db);
@@ -303,7 +303,7 @@ class ExportTest extends PHPUnit\Framework\TestCase
$result=$objexport->build_file($user, $model, $datatoexport, $array_selected, $array_filtervalue, $sql);
$expectedresult=1;
$this->assertEquals($expectedresult,$result);
-*/
+ */
return true;
}
diff --git a/test/phpunit/FactureFournisseurTest.php b/test/phpunit/FactureFournisseurTest.php
index f346909e8b8..b277ba5c1b3 100644
--- a/test/phpunit/FactureFournisseurTest.php
+++ b/test/phpunit/FactureFournisseurTest.php
@@ -214,7 +214,7 @@ class FactureFournisseurTest extends PHPUnit\Framework\TestCase
return $localobject;
}
- /**
+ /**
* testFactureFournisseurOther
*
* @param Object $localobject Supplier invoice
diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php
index 34dd42b63f6..4e361895fcc 100644
--- a/test/phpunit/FactureTest.php
+++ b/test/phpunit/FactureTest.php
@@ -241,7 +241,7 @@ class FactureTest extends PHPUnit\Framework\TestCase
return $localobject;
}
- /**
+ /**
* testFactureOther
*
* @param Object $localobject Invoice
diff --git a/test/phpunit/FichinterTest.php b/test/phpunit/FichinterTest.php
index 60be4024e69..ba9408441a1 100644
--- a/test/phpunit/FichinterTest.php
+++ b/test/phpunit/FichinterTest.php
@@ -190,7 +190,7 @@ class FichinterTest extends PHPUnit\Framework\TestCase
return $localobject;
}
- /**
+ /**
* testFichinterValid
*
* @param Object $localobject Object intervention
diff --git a/test/phpunit/FilesLibTest.php b/test/phpunit/FilesLibTest.php
index d73d99f7078..776e783a6b0 100644
--- a/test/phpunit/FilesLibTest.php
+++ b/test/phpunit/FilesLibTest.php
@@ -150,11 +150,11 @@ class FilesLibTest extends PHPUnit\Framework\TestCase
}
- /**
- * testDolCountNbOfLine
- *
- * @return int
- */
+ /**
+ * testDolCountNbOfLine
+ *
+ * @return int
+ */
public function testDolCountNbOfLine()
{
global $conf,$user,$langs,$db;
@@ -171,11 +171,11 @@ class FilesLibTest extends PHPUnit\Framework\TestCase
return $result;
}
- /**
- * testDolIsFileDir
- *
- * @return int
- */
+ /**
+ * testDolIsFileDir
+ *
+ * @return int
+ */
public function testDolIsFileDir()
{
global $conf,$user,$langs,$db;
diff --git a/test/phpunit/ImagesLibTest.php b/test/phpunit/ImagesLibTest.php
index a7fcaba25ce..71474ba1847 100644
--- a/test/phpunit/ImagesLibTest.php
+++ b/test/phpunit/ImagesLibTest.php
@@ -118,11 +118,11 @@ class ImagesLibTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
- /**
- * testDolCountNbOfLine
- *
- * @return int
- */
+ /**
+ * testDolCountNbOfLine
+ *
+ * @return int
+ */
public function testgetImageSize()
{
$file=dirname(__FILE__).'/img250x50.jpg';
diff --git a/test/phpunit/PropalTest.php b/test/phpunit/PropalTest.php
index 955024baa91..709c5bbcfb7 100644
--- a/test/phpunit/PropalTest.php
+++ b/test/phpunit/PropalTest.php
@@ -239,7 +239,7 @@ class PropalTest extends PHPUnit\Framework\TestCase
return $localobject;
}
- /**
+ /**
* testPropalOther
*
* @param Propal $localobject Proposal
diff --git a/test/phpunit/RestAPIUserTest.php b/test/phpunit/RestAPIUserTest.php
index b9658818d48..ea3970e5a4b 100644
--- a/test/phpunit/RestAPIUserTest.php
+++ b/test/phpunit/RestAPIUserTest.php
@@ -149,30 +149,30 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase
*/
public function testRestGetUser()
{
- global $conf,$user,$langs,$db;
+ global $conf,$user,$langs,$db;
- $url = $this->api_url.'/users/123456789?api_key='.$this->api_key;
- //$addheaders=array('Content-Type: application/json');
+ $url = $this->api_url.'/users/123456789?api_key='.$this->api_key;
+ //$addheaders=array('Content-Type: application/json');
- print __METHOD__." Request GET url=".$url."\n";
- $result=getURLContent($url, 'GET', '', 1, array());
- //print __METHOD__." Result for unexisting user: ".var_export($result, true)."\n";
- print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
- $this->assertEquals($result['curl_error_no'], '');
- $object=json_decode($result['content'], true);
- $this->assertNotNull($object, "Parsing of json result must no be null");
- $this->assertEquals(404, $object['error']['code']);
+ print __METHOD__." Request GET url=".$url."\n";
+ $result=getURLContent($url, 'GET', '', 1, array());
+ //print __METHOD__." Result for unexisting user: ".var_export($result, true)."\n";
+ print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
+ $this->assertEquals($result['curl_error_no'], '');
+ $object=json_decode($result['content'], true);
+ $this->assertNotNull($object, "Parsing of json result must no be null");
+ $this->assertEquals(404, $object['error']['code']);
- $url = $this->api_url.'/users/1?api_key='.$this->api_key;
+ $url = $this->api_url.'/users/1?api_key='.$this->api_key;
- print __METHOD__." Request GET url=".$url."\n";
- $result=getURLContent($url, 'GET', '', 1, array());
- //print __METHOD__." Result for existing user user: ".var_export($result, true)."\n";
- print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
- $this->assertEquals($result['curl_error_no'], '');
- $object=json_decode($result['content'], true);
- $this->assertNotNull($object, "Parsing of json result must no be null");
- $this->assertEquals(1, $object['statut']);
+ print __METHOD__." Request GET url=".$url."\n";
+ $result=getURLContent($url, 'GET', '', 1, array());
+ //print __METHOD__." Result for existing user user: ".var_export($result, true)."\n";
+ print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
+ $this->assertEquals($result['curl_error_no'], '');
+ $object=json_decode($result['content'], true);
+ $this->assertNotNull($object, "Parsing of json result must no be null");
+ $this->assertEquals(1, $object['statut']);
}
/**
@@ -183,52 +183,52 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase
public function testRestCreateUser()
{
- // attemp to create without mandatory fields :
- $url = $this->api_url.'/users?api_key='.$this->api_key;
- $addheaders=array('Content-Type: application/json');
+ // attemp to create without mandatory fields :
+ $url = $this->api_url.'/users?api_key='.$this->api_key;
+ $addheaders=array('Content-Type: application/json');
- $bodyobj = array(
- "lastname"=>"testRestUser",
- "password"=>"testRestPassword",
- "email"=>"test@restuser.com"
- );
- $body = json_encode($bodyobj);
+ $bodyobj = array(
+ "lastname"=>"testRestUser",
+ "password"=>"testRestPassword",
+ "email"=>"test@restuser.com"
+ );
+ $body = json_encode($bodyobj);
- print __METHOD__." Request POST url=".$url."\n";
- $result=getURLContent($url, 'POST', $body, 1, $addheaders);
- //print __METHOD__." Result for creating incomplete user".var_export($result, true)."\n";
- print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
- $this->assertEquals($result['curl_error_no'], '');
- $object=json_decode($result['content'], true);
- $this->assertNotNull($object, "Parsing of json result must no be null");
- $this->assertEquals(500, $object['error']['code'], $object['error']['code'].' '.$object['error']['message']);
+ print __METHOD__." Request POST url=".$url."\n";
+ $result=getURLContent($url, 'POST', $body, 1, $addheaders);
+ //print __METHOD__." Result for creating incomplete user".var_export($result, true)."\n";
+ print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
+ $this->assertEquals($result['curl_error_no'], '');
+ $object=json_decode($result['content'], true);
+ $this->assertNotNull($object, "Parsing of json result must no be null");
+ $this->assertEquals(500, $object['error']['code'], $object['error']['code'].' '.$object['error']['message']);
- // create regular user
- unset($result);
- $bodyobj = array(
- "login"=>"testRestLogin".mt_rand(),
- "lastname"=>"testRestUser",
- "password"=>"testRestPassword",
- "email"=>"test@restuser.com"
- );
- $body = json_encode($bodyobj);
- print __METHOD__." Request POST url=".$url."\n";
- $result=getURLContent($url, 'POST', $body, 1, $addheaders);
- print __METHOD__." Result code for creating user ".var_export($result, true)."\n";
- print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
- $this->assertEquals($result['curl_error_no'], '');
- $resid=json_decode($result['content'], true);
- $this->assertNotNull($resid, "Parsing of json result must no be null");
- $this->assertGreaterThan(0, $resid, $object['error']['code'].' '.$object['error']['message']);
+ // create regular user
+ unset($result);
+ $bodyobj = array(
+ "login"=>"testRestLogin".mt_rand(),
+ "lastname"=>"testRestUser",
+ "password"=>"testRestPassword",
+ "email"=>"test@restuser.com"
+ );
+ $body = json_encode($bodyobj);
+ print __METHOD__." Request POST url=".$url."\n";
+ $result=getURLContent($url, 'POST', $body, 1, $addheaders);
+ print __METHOD__." Result code for creating user ".var_export($result, true)."\n";
+ print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
+ $this->assertEquals($result['curl_error_no'], '');
+ $resid=json_decode($result['content'], true);
+ $this->assertNotNull($resid, "Parsing of json result must no be null");
+ $this->assertGreaterThan(0, $resid, $object['error']['code'].' '.$object['error']['message']);
- // attempt to create duplicated user
- print __METHOD__." Request POST url=".$url."\n";
- $result=getURLContent($url, 'POST', $body, 1, $addheaders);
- //print __METHOD__." Result for creating duplicate user".var_export($result, true)."\n";
- print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
- $this->assertEquals($result['curl_error_no'], '');
- $object=json_decode($result['content'], true);
- $this->assertNotNull($object, "Parsing of json result must no be null");
- $this->assertEquals(500, $object['error']['code'], $object['error']['code'].' '.$object['error']['message']);
+ // attempt to create duplicated user
+ print __METHOD__." Request POST url=".$url."\n";
+ $result=getURLContent($url, 'POST', $body, 1, $addheaders);
+ //print __METHOD__." Result for creating duplicate user".var_export($result, true)."\n";
+ print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
+ $this->assertEquals($result['curl_error_no'], '');
+ $object=json_decode($result['content'], true);
+ $this->assertNotNull($object, "Parsing of json result must no be null");
+ $this->assertEquals(500, $object['error']['code'], $object['error']['code'].' '.$object['error']['message']);
}
}
diff --git a/test/phpunit/SupplierProposalTest.php b/test/phpunit/SupplierProposalTest.php
index aa91e8d533b..42d7e5842a6 100644
--- a/test/phpunit/SupplierProposalTest.php
+++ b/test/phpunit/SupplierProposalTest.php
@@ -231,7 +231,7 @@ class SupplierProposalTest extends PHPUnit\Framework\TestCase
return $localobject;
}
- /**
+ /**
* testSupplierProposalOther
*
* @param SupplierProposal $localobject Proposal
diff --git a/test/phpunit/functional/TakePosFunctionalTest.php b/test/phpunit/functional/TakePosFunctionalTest.php
index e33a050cecf..597a893c67b 100644
--- a/test/phpunit/functional/TakePosFunctionalTest.php
+++ b/test/phpunit/functional/TakePosFunctionalTest.php
@@ -67,14 +67,14 @@ class TakePosFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
),
// Geckodriver does not keep the session at the moment?!
// XPath selectors also don't seem to work
-// array(
-// 'browser' => 'Mozilla Firefox on Linux',
-// 'browserName' => 'firefox',
-// 'sessionStrategy' => 'shared',
-// 'desiredCapabilities' => array(
-// 'marionette' => true
-// )
-// )
+ //array(
+ // 'browser' => 'Mozilla Firefox on Linux',
+ // 'browserName' => 'firefox',
+ // 'sessionStrategy' => 'shared',
+ // 'desiredCapabilities' => array(
+ // 'marionette' => true
+ // )
+ //)
);
/**