diff --git a/htdocs/datapolicy/class/actions_datapolicy.class.php b/htdocs/datapolicy/class/actions_datapolicy.class.php
index 960a1013bdf..22e23b1c05e 100644
--- a/htdocs/datapolicy/class/actions_datapolicy.class.php
+++ b/htdocs/datapolicy/class/actions_datapolicy.class.php
@@ -136,7 +136,7 @@ class ActionsDatapolicy extends CommonHookActions
require_once DOL_DOCUMENT_ROOT.'/datapolicy/class/datapolicy.class.php';
DataPolicy::sendMailDataPolicyContact($object);
} elseif ($parameters['currentcontext'] == 'membercard' && $action == 'send_datapolicy') {
- $object->fetch(GETPOST('id'));
+ $object->fetch(GETPOST('id'));
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/datapolicy/class/datapolicy.class.php';
DataPolicy::sendMailDataPolicyAdherent($object);
diff --git a/htdocs/datapolicy/class/datapolicy.class.php b/htdocs/datapolicy/class/datapolicy.class.php
index 8f02b9bb42a..21753e0598f 100644
--- a/htdocs/datapolicy/class/datapolicy.class.php
+++ b/htdocs/datapolicy/class/datapolicy.class.php
@@ -212,9 +212,9 @@ class DataPolicy
if ($sendtocc) {
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc').": ".$sendtocc);
}
- $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic').": ".$subject);
- $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody').":");
- $actionmsg = dol_concatdesc($actionmsg, $message);
+ $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic').": ".$subject);
+ $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody').":");
+ $actionmsg = dol_concatdesc($actionmsg, $message);
}
@@ -286,7 +286,7 @@ class DataPolicy
$actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto;
if ($message) {
if ($sendtocc) {
- $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc').": ".$sendtocc);
+ $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc').": ".$sendtocc);
}
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic').": ".$subject);
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody').":");
diff --git a/htdocs/dav/dav.class.php b/htdocs/dav/dav.class.php
index a0375210271..fce00dc4135 100644
--- a/htdocs/dav/dav.class.php
+++ b/htdocs/dav/dav.class.php
@@ -27,7 +27,6 @@
*/
class CdavLib
{
-
private $db;
private $user;
diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php
index 2cb362df8a3..01250cecacd 100644
--- a/htdocs/delivery/card.php
+++ b/htdocs/delivery/card.php
@@ -510,7 +510,8 @@ if ($action == 'create') {
*/
$num_prod = count($object->lines);
- $i = 0; $total = 0;
+ $i = 0;
+ $total = 0;
print '
';
@@ -600,10 +601,10 @@ if ($action == 'create') {
// Display lines extrafields
//if (!empty($extrafields)) {
- $colspan = 2;
- $mode = ($object->statut == 0) ? 'edit' : 'view';
+ $colspan = 2;
+ $mode = ($object->statut == 0) ? 'edit' : 'view';
- $object->lines[$i]->fetch_optionals();
+ $object->lines[$i]->fetch_optionals();
if ($action == 'create_delivery') {
$srcLine = new ExpeditionLigne($db);
@@ -614,10 +615,10 @@ if ($action == 'create') {
$object->lines[$i]->array_options = array_merge($object->lines[$i]->array_options, $srcLine->array_options);
} else {
- $srcLine = new DeliveryLine($db);
- $extrafields->fetch_name_optionals_label($srcLine->table_element);
+ $srcLine = new DeliveryLine($db);
+ $extrafields->fetch_name_optionals_label($srcLine->table_element);
}
- print $object->lines[$i]->showOptionals($extrafields, $mode, array('style' => 'class="oddeven"', 'colspan' => $colspan), '');
+ print $object->lines[$i]->showOptionals($extrafields, $mode, array('style' => 'class="oddeven"', 'colspan' => $colspan), '');
//}
}
diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php
index 40253a97b6b..8ae8af24eef 100644
--- a/htdocs/delivery/class/delivery.class.php
+++ b/htdocs/delivery/class/delivery.class.php
@@ -481,13 +481,15 @@ class Delivery extends CommonObject
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'expedition/receipt/".$this->db->escape($this->ref)."' and entity = ".((int) $conf->entity);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->error = $this->db->lasterror();
+ $error++;
+ $this->error = $this->db->lasterror();
}
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'expedition/receipt/".$this->db->escape($this->newref)."'";
$sql .= " WHERE filepath = 'expedition/receipt/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->error = $this->db->lasterror();
+ $error++;
+ $this->error = $this->db->lasterror();
}
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
@@ -810,7 +812,7 @@ class Delivery extends CommonObject
//}
$linkstart = '';
$linkend = ' ';
diff --git a/htdocs/don/card.php b/htdocs/don/card.php
index eaa8a1c3969..1499e29b7fa 100644
--- a/htdocs/don/card.php
+++ b/htdocs/don/card.php
@@ -47,7 +47,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$langs->loadLangs(array('bills', 'companies', 'donations', 'users'));
-$id = GETPOST('rowid') ?GETPOST('rowid', 'int') : GETPOST('id', 'int');
+$id = GETPOST('rowid') ? GETPOST('rowid', 'int') : GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'alpha');
@@ -492,7 +492,7 @@ if ($action == 'create') {
// Country
print ''.$langs->trans('Country').' ';
- print img_picto('', 'globe-americas', 'class="paddingrightonly"').$form->select_country(GETPOST('country_id') != '' ?GETPOST('country_id') : $object->country_id);
+ print img_picto('', 'globe-americas', 'class="paddingrightonly"').$form->select_country(GETPOST('country_id') != '' ? GETPOST('country_id') : $object->country_id);
if ($user->admin) {
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}
@@ -567,11 +567,13 @@ if ($action == 'create') {
if (!empty($id) && $action == 'edit') {
$result = $object->fetch($id);
if ($result < 0) {
- dol_print_error($db, $object->error); exit;
+ dol_print_error($db, $object->error);
+ exit;
}
$result = $object->fetch_optionals();
if ($result < 0) {
- dol_print_error($db); exit;
+ dol_print_error($db);
+ exit;
}
$hselected = 'card';
@@ -704,11 +706,13 @@ if (!empty($id) && $action != 'edit') {
$result = $object->fetch($id);
if ($result < 0) {
- dol_print_error($db, $object->error); exit;
+ dol_print_error($db, $object->error);
+ exit;
}
$result = $object->fetch_optionals();
if ($result < 0) {
- dol_print_error($db); exit;
+ dol_print_error($db);
+ exit;
}
$hselected = 'card';
@@ -827,7 +831,9 @@ if (!empty($id) && $action != 'edit') {
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
- $i = 0; $total = 0; $totalpaid = 0;
+ $i = 0;
+ $total = 0;
+ $totalpaid = 0;
print '';
print '';
print ''.$langs->trans("RefPayment").' ';
diff --git a/htdocs/don/class/api_donations.class.php b/htdocs/don/class/api_donations.class.php
index 8dc5bf4add6..b4f89e9c7cc 100644
--- a/htdocs/don/class/api_donations.class.php
+++ b/htdocs/don/class/api_donations.class.php
@@ -28,7 +28,6 @@ require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
*/
class Donations extends DolibarrApi
{
-
/**
* @var array $FIELDS Mandatory fields, checked when create and update object
*/
diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php
index 3f15e5fde74..7751feb2ed4 100644
--- a/htdocs/don/class/don.class.php
+++ b/htdocs/don/class/don.class.php
@@ -174,7 +174,7 @@ class Don extends CommonObject
*/
public function __construct($db)
{
- $this->db = $db;
+ $this->db = $db;
}
@@ -1050,7 +1050,9 @@ class Don extends CommonObject
}
// Search template files
- $file = ''; $classname = ''; $filefound = 0;
+ $file = '';
+ $classname = '';
+ $filefound = 0;
$dirmodels = array('/');
if (is_array($conf->modules_parts['models'])) {
$dirmodels = array_merge($dirmodels, $conf->modules_parts['models']);
@@ -1147,7 +1149,7 @@ class Don extends CommonObject
}
}
- /**
+ /**
* Return clicable link of object (with eventually picto)
*
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php
index aeadc6122b0..f697ec63b65 100644
--- a/htdocs/don/class/paymentdonation.class.php
+++ b/htdocs/don/class/paymentdonation.class.php
@@ -412,7 +412,8 @@ class PaymentDonation extends CommonObject
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
}
@@ -686,7 +687,7 @@ class PaymentDonation extends CommonObject
$result .= ' ';
}
if ($withpicto != 2) {
- $result .= $link.($maxlen ?dol_trunc($this->ref, $maxlen) : $this->ref).$linkend;
+ $result .= $link.($maxlen ? dol_trunc($this->ref, $maxlen) : $this->ref).$linkend;
}
}
diff --git a/htdocs/don/document.php b/htdocs/don/document.php
index ad90d372b3d..fd40fea0594 100644
--- a/htdocs/don/document.php
+++ b/htdocs/don/document.php
@@ -123,7 +123,7 @@ if ($object->id) {
// Build file list
- $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
+ $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC), 1);
$totalsize = 0;
foreach ($filearray as $key => $file) {
$totalsize += $file['size'];
diff --git a/htdocs/don/index.php b/htdocs/don/index.php
index 178f7a60b9d..f09d6437dae 100644
--- a/htdocs/don/index.php
+++ b/htdocs/don/index.php
@@ -176,7 +176,7 @@ foreach ($listofstatus as $status) {
print ''.$donstatic->LibStatut($status, 4).' ';
print ''.(!empty($nb[$status]) ? $nb[$status] : ' ').' ';
print ''.(!empty($nb[$status]) ? price($somme[$status], 'MT') : ' ').' ';
- print ''.(!empty($nb[$status]) ?price(price2num($somme[$status] / $nb[$status], 'MT')) : ' ').' ';
+ print ''.(!empty($nb[$status]) ? price(price2num($somme[$status] / $nb[$status], 'MT')) : ' ').' ';
$totalnb += (!empty($nb[$status]) ? $nb[$status] : 0);
$total += (!empty($somme[$status]) ? $somme[$status] : 0);
print " ";
@@ -186,7 +186,7 @@ print '';
print ''.$langs->trans("Total").' ';
print ''.$totalnb.' ';
print ''.price($total, 'MT').' ';
-print ''.($totalnb ?price(price2num($total / $totalnb, 'MT')) : ' ').' ';
+print ''.($totalnb ? price(price2num($total / $totalnb, 'MT')) : ' ').' ';
print ' ';
print "
";
@@ -230,7 +230,7 @@ if ($resql) {
print ' ';
print $obj->societe;
- print ($obj->societe && ($obj->lastname || $obj->firstname) ? ' / ' : '');
+ print($obj->societe && ($obj->lastname || $obj->firstname) ? ' / ' : '');
print dolGetFirstLastname($obj->lastname, $obj->firstname);
print ' ';
diff --git a/htdocs/don/list.php b/htdocs/don/list.php
index 6ff32f9d49b..876df4ee74f 100644
--- a/htdocs/don/list.php
+++ b/htdocs/don/list.php
@@ -37,9 +37,9 @@ $langs->loadLangs(array('companies', 'donations'));
$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ...
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
-$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'sclist';
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'sclist';
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
@@ -59,7 +59,7 @@ if (!$sortfield) {
}
$search_status = (GETPOST("search_status", 'intcomma') != '') ? GETPOST("search_status", 'intcomma') : "-4";
-$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
+$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$search_ref = GETPOST('search_ref', 'alpha');
$search_company = GETPOST('search_company', 'alpha');
$search_thirdparty = GETPOST('search_thirdparty', 'alpha');
diff --git a/htdocs/don/note.php b/htdocs/don/note.php
index 9442961ca4a..0859eaa7852 100644
--- a/htdocs/don/note.php
+++ b/htdocs/don/note.php
@@ -38,7 +38,7 @@ if (isModEnabled('project')) {
// Load translation files required by the page
$langs->loadLangs(array('companies', 'bills', 'donations'));
-$id = (GETPOST('id', 'int') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
+$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0);
diff --git a/htdocs/don/payment/payment.php b/htdocs/don/payment/payment.php
index b9b4b1313a9..42ce62b38b9 100644
--- a/htdocs/don/payment/payment.php
+++ b/htdocs/don/payment/payment.php
@@ -264,7 +264,7 @@ if ($action == 'create') {
print " \n";
/*$total+=$objp->total;
$total_ttc+=$objp->total_ttc;
- $totalrecu+=$objp->am;*/ //Useless code ?
+ $totalrecu+=$objp->am;*/ //Useless code ?
$i++;
}
/*if ($i > 1)
@@ -277,7 +277,7 @@ if ($action == 'create') {
print "".price($total_ttc - $totalrecu)." ";
print ' ';
print "\n";
- }*/ //Useless code ?
+ }*/ //Useless code ?
print "
";
diff --git a/htdocs/don/stats/index.php b/htdocs/don/stats/index.php
index 9bf84dd88c1..6f5da67de41 100644
--- a/htdocs/don/stats/index.php
+++ b/htdocs/don/stats/index.php
@@ -42,7 +42,7 @@ if ($user->socid > 0) {
}
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
-$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
+$year = GETPOST('year') > 0 ? GETPOST('year') : $nowyear;
$startyear = $year - (!getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS') ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
$endyear = $year;
@@ -81,7 +81,8 @@ $px1 = new DolGraph();
$mesg = $px1->isGraphKo();
if (!$mesg) {
$px1->SetData($data);
- $i = $startyear; $legend = array();
+ $i = $startyear;
+ $legend = array();
while ($i <= $endyear) {
$legend[] = $i;
$i++;
diff --git a/htdocs/don/tpl/linkedobjectblock.tpl.php b/htdocs/don/tpl/linkedobjectblock.tpl.php
index 5d564d43f7a..881e367ab7d 100644
--- a/htdocs/don/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/don/tpl/linkedobjectblock.tpl.php
@@ -53,7 +53,7 @@ print '';
if (count($linkedObjectBlock) > 1) {
?>
-
+
trans("Total"); ?>
diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php
index 451057b5740..5c78435a847 100644
--- a/htdocs/ecm/class/ecmdirectory.class.php
+++ b/htdocs/ecm/class/ecmdirectory.class.php
@@ -207,7 +207,8 @@ class EcmDirectory extends CommonObject
$dir = $conf->ecm->dir_output.'/'.$this->getRelativePath();
$result = dol_mkdir($dir);
if ($result < 0) {
- $error++; $this->error = "ErrorFailedToCreateDir";
+ $error++;
+ $this->error = "ErrorFailedToCreateDir";
}
// Call trigger
@@ -501,7 +502,7 @@ class EcmDirectory extends CommonObject
$result .= img_object(($notooltip ? '' : $label), $this->picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
}
if ($withpicto != 2) {
- $result .= ($max ?dol_trunc($newref, $max, 'middle') : $newref);
+ $result .= ($max ? dol_trunc($newref, $max, 'middle') : $newref);
}
$result .= $linkend;
diff --git a/htdocs/ecm/dir_add_card.php b/htdocs/ecm/dir_add_card.php
index 0c1dcd1257c..156fe3f37db 100644
--- a/htdocs/ecm/dir_add_card.php
+++ b/htdocs/ecm/dir_add_card.php
@@ -23,7 +23,9 @@
* \brief Main page for ECM section area
*/
-if (! defined('DISABLE_JS_GRAHP')) define('DISABLE_JS_GRAPH', 1);
+if (! defined('DISABLE_JS_GRAHP')) {
+ define('DISABLE_JS_GRAPH', 1);
+}
// Load Dolibarr environment
require '../main.inc.php';
@@ -61,8 +63,7 @@ if (empty($urlsection)) {
if ($module == 'ecm') {
$upload_dir = $conf->ecm->dir_output.'/'.$urlsection;
-} else // For example $module == 'medias'
-{
+} else { // For example $module == 'medias'
$upload_dir = $conf->medias->multidir_output[$conf->entity];
}
diff --git a/htdocs/ecm/dir_card.php b/htdocs/ecm/dir_card.php
index 29054e3e1e8..b45dc44c185 100644
--- a/htdocs/ecm/dir_card.php
+++ b/htdocs/ecm/dir_card.php
@@ -83,8 +83,7 @@ if ($module == 'ecm') {
$relativepath = $section;
$upload_dir = $conf->ecm->dir_output.'/'.$relativepath;
}
-} else // For example $module == 'medias'
-{
+} else { // For example $module == 'medias'
$relativepath = $section;
$upload_dir = $conf->medias->multidir_output[$conf->entity].'/'.$relativepath;
}
@@ -126,8 +125,7 @@ if (GETPOST("sendit") && getDolGlobalString('MAIN_UPLOAD_DOC') && $permissiontou
} elseif (preg_match('/ErrorFileIsInfectedWithAVirus/', $resupload)) {
// Files infected by a virus
setEventMessages($langs->trans("ErrorFileIsInfectedWithAVirus"), null, 'errors');
- } else // Known error
- {
+ } else { // Known error
setEventMessages($langs->trans($resupload), null, 'errors');
}
}
@@ -294,8 +292,8 @@ if ($module == 'ecm' && $ecmdir->id > 0) {
llxHeader();
// Built the file List
-$filearrayall = dol_dir_list($upload_dir, "all", 0, '', '', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
-$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
+$filearrayall = dol_dir_list($upload_dir, "all", 0, '', '', $sortfield, (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC), 1);
+$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC), 1);
$totalsize = 0;
foreach ($filearray as $key => $file) {
$totalsize += $file['size'];
diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php
index 18718b5c903..9810b4db600 100644
--- a/htdocs/ecm/index.php
+++ b/htdocs/ecm/index.php
@@ -38,7 +38,7 @@ $langs->loadLangs(array('ecm', 'companies', 'other', 'users', 'orders', 'propal'
// Get parameters
$socid = GETPOST('socid', 'int');
$action = GETPOST('action', 'aZ09');
-$section = GETPOST('section', 'int') ?GETPOST('section', 'int') : GETPOST('section_id', 'int');
+$section = GETPOST('section', 'int') ? GETPOST('section', 'int') : GETPOST('section_id', 'int');
if (!$section) {
$section = 0;
}
diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php
index e8db29ff01f..f30b38f83f7 100644
--- a/htdocs/ecm/index_auto.php
+++ b/htdocs/ecm/index_auto.php
@@ -37,7 +37,7 @@ $langs->loadLangs(array("ecm", "companies", "other", "users", "orders", "propal"
// Get parameters
$socid = GETPOST('socid', 'int');
$action = GETPOST('action', 'aZ09');
-$section = GETPOST('section', 'int') ?GETPOST('section', 'int') : GETPOST('section_id', 'int');
+$section = GETPOST('section', 'int') ? GETPOST('section', 'int') : GETPOST('section_id', 'int');
$module = GETPOST('module', 'alpha');
if (!$section) {
$section = 0;
@@ -312,72 +312,94 @@ $sectionauto = array();
if (!getDolGlobalString('ECM_AUTO_TREE_HIDEN')) {
if (isModEnabled("product") || isModEnabled("service")) {
$langs->load("products");
- $rowspan++; $sectionauto[] = array('position'=>10, 'level'=>1, 'module'=>'product', 'test'=>(isModEnabled("product") || isModEnabled("service")), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts"));
+ $rowspan++;
+ $sectionauto[] = array('position'=>10, 'level'=>1, 'module'=>'product', 'test'=>(isModEnabled("product") || isModEnabled("service")), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts"));
}
if (isModEnabled("societe")) {
- $rowspan++; $sectionauto[] = array('position'=>20, 'level'=>1, 'module'=>'company', 'test'=>isModEnabled('societe'), 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ThirdParties")));
+ $rowspan++;
+ $sectionauto[] = array('position'=>20, 'level'=>1, 'module'=>'company', 'test'=>isModEnabled('societe'), 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ThirdParties")));
}
if (isModEnabled("propal")) {
- $rowspan++; $sectionauto[] = array('position'=>30, 'level'=>1, 'module'=>'propal', 'test'=>isModEnabled('propal'), 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals")));
+ $rowspan++;
+ $sectionauto[] = array('position'=>30, 'level'=>1, 'module'=>'propal', 'test'=>isModEnabled('propal'), 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals")));
}
if (isModEnabled('contrat')) {
- $rowspan++; $sectionauto[] = array('position'=>40, 'level'=>1, 'module'=>'contract', 'test'=>isModEnabled('contrat'), 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts")));
+ $rowspan++;
+ $sectionauto[] = array('position'=>40, 'level'=>1, 'module'=>'contract', 'test'=>isModEnabled('contrat'), 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts")));
}
if (isModEnabled('commande')) {
- $rowspan++; $sectionauto[] = array('position'=>50, 'level'=>1, 'module'=>'order', 'test'=>isModEnabled('commande'), 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders")));
+ $rowspan++;
+ $sectionauto[] = array('position'=>50, 'level'=>1, 'module'=>'order', 'test'=>isModEnabled('commande'), 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders")));
}
if (isModEnabled('facture')) {
- $rowspan++; $sectionauto[] = array('position'=>60, 'level'=>1, 'module'=>'invoice', 'test'=>isModEnabled('facture'), 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices")));
+ $rowspan++;
+ $sectionauto[] = array('position'=>60, 'level'=>1, 'module'=>'invoice', 'test'=>isModEnabled('facture'), 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices")));
}
if (isModEnabled('supplier_proposal')) {
$langs->load("supplier_proposal");
- $rowspan++; $sectionauto[] = array('position'=>70, 'level'=>1, 'module'=>'supplier_proposal', 'test'=>isModEnabled('supplier_proposal'), 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals")));
+ $rowspan++;
+ $sectionauto[] = array('position'=>70, 'level'=>1, 'module'=>'supplier_proposal', 'test'=>isModEnabled('supplier_proposal'), 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals")));
}
if (isModEnabled("supplier_order")) {
- $rowspan++; $sectionauto[] = array('position'=>80, 'level'=>1, 'module'=>'order_supplier', 'test'=>isModEnabled("supplier_order"), 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("PurchaseOrders")));
+ $rowspan++;
+ $sectionauto[] = array('position'=>80, 'level'=>1, 'module'=>'order_supplier', 'test'=>isModEnabled("supplier_order"), 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("PurchaseOrders")));
}
if (isModEnabled("supplier_invoice")) {
- $rowspan++; $sectionauto[] = array('position'=>90, 'level'=>1, 'module'=>'invoice_supplier', 'test'=>isModEnabled("supplier_invoice"), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices")));
+ $rowspan++;
+ $sectionauto[] = array('position'=>90, 'level'=>1, 'module'=>'invoice_supplier', 'test'=>isModEnabled("supplier_invoice"), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices")));
}
if (isModEnabled('tax')) {
$langs->load("compta");
- $rowspan++; $sectionauto[] = array('position'=>100, 'level'=>1, 'module'=>'tax', 'test'=>isModEnabled('tax'), 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions")));
- $rowspan++; $sectionauto[] = array('position'=>110, 'level'=>1, 'module'=>'tax-vat', 'test'=>isModEnabled('tax'), 'label'=>$langs->trans("VAT"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("VAT")));
+ $rowspan++;
+ $sectionauto[] = array('position'=>100, 'level'=>1, 'module'=>'tax', 'test'=>isModEnabled('tax'), 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions")));
+ $rowspan++;
+ $sectionauto[] = array('position'=>110, 'level'=>1, 'module'=>'tax-vat', 'test'=>isModEnabled('tax'), 'label'=>$langs->trans("VAT"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("VAT")));
}
if (isModEnabled('salaries')) {
$langs->load("compta");
- $rowspan++; $sectionauto[] = array('position'=>120, 'level'=>1, 'module'=>'salaries', 'test'=>isModEnabled('salaries'), 'label'=>$langs->trans("Salaries"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Salaries")));
+ $rowspan++;
+ $sectionauto[] = array('position'=>120, 'level'=>1, 'module'=>'salaries', 'test'=>isModEnabled('salaries'), 'label'=>$langs->trans("Salaries"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Salaries")));
}
if (isModEnabled('project')) {
- $rowspan++; $sectionauto[] = array('position'=>130, 'level'=>1, 'module'=>'project', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects")));
- $rowspan++; $sectionauto[] = array('position'=>140, 'level'=>1, 'module'=>'project_task', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Tasks"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Tasks")));
+ $rowspan++;
+ $sectionauto[] = array('position'=>130, 'level'=>1, 'module'=>'project', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects")));
+ $rowspan++;
+ $sectionauto[] = array('position'=>140, 'level'=>1, 'module'=>'project_task', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Tasks"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Tasks")));
}
if (isModEnabled('ficheinter')) {
$langs->load("interventions");
- $rowspan++; $sectionauto[] = array('position'=>150, 'level'=>1, 'module'=>'fichinter', 'test'=>isModEnabled('ficheinter'), 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions")));
+ $rowspan++;
+ $sectionauto[] = array('position'=>150, 'level'=>1, 'module'=>'fichinter', 'test'=>isModEnabled('ficheinter'), 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions")));
}
if (isModEnabled('expensereport')) {
$langs->load("trips");
- $rowspan++; $sectionauto[] = array('position'=>160, 'level'=>1, 'module'=>'expensereport', 'test'=>isModEnabled('expensereport'), 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports")));
+ $rowspan++;
+ $sectionauto[] = array('position'=>160, 'level'=>1, 'module'=>'expensereport', 'test'=>isModEnabled('expensereport'), 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports")));
}
if (isModEnabled('holiday')) {
$langs->load("holiday");
- $rowspan++; $sectionauto[] = array('position'=>170, 'level'=>1, 'module'=>'holiday', 'test'=>isModEnabled('holiday'), 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays")));
+ $rowspan++;
+ $sectionauto[] = array('position'=>170, 'level'=>1, 'module'=>'holiday', 'test'=>isModEnabled('holiday'), 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays")));
}
if (isModEnabled("banque")) {
$langs->load("banks");
- $rowspan++; $sectionauto[] = array('position'=>180, 'level'=>1, 'module'=>'banque', 'test'=>isModEnabled('banque'), 'label'=>$langs->trans("BankAccount"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount")));
- $rowspan++; $sectionauto[] = array('position'=>190, 'level'=>1, 'module'=>'chequereceipt', 'test'=>isModEnabled('banque'), 'label'=>$langs->trans("CheckReceipt"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("CheckReceipt")));
+ $rowspan++;
+ $sectionauto[] = array('position'=>180, 'level'=>1, 'module'=>'banque', 'test'=>isModEnabled('banque'), 'label'=>$langs->trans("BankAccount"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount")));
+ $rowspan++;
+ $sectionauto[] = array('position'=>190, 'level'=>1, 'module'=>'chequereceipt', 'test'=>isModEnabled('banque'), 'label'=>$langs->trans("CheckReceipt"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("CheckReceipt")));
}
if (isModEnabled('mrp')) {
$langs->load("mrp");
- $rowspan++; $sectionauto[] = array('position'=>200, 'level'=>1, 'module'=>'mrp-mo', 'test'=>isModEnabled('mrp'), 'label'=>$langs->trans("MOs"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ManufacturingOrders")));
+ $rowspan++;
+ $sectionauto[] = array('position'=>200, 'level'=>1, 'module'=>'mrp-mo', 'test'=>isModEnabled('mrp'), 'label'=>$langs->trans("MOs"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ManufacturingOrders")));
}
if (isModEnabled('recruitment')) {
$langs->load("recruitment");
- $rowspan++; $sectionauto[] = array('position'=>210, 'level'=>1, 'module'=>'recruitment-recruitmentcandidature', 'test'=>isModEnabled('recruitment'), 'label'=>$langs->trans("Candidatures"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("JobApplications")));
+ $rowspan++;
+ $sectionauto[] = array('position'=>210, 'level'=>1, 'module'=>'recruitment-recruitmentcandidature', 'test'=>isModEnabled('recruitment'), 'label'=>$langs->trans("Candidatures"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("JobApplications")));
}
- $rowspan++; $sectionauto[] = array('position'=>220, 'level'=>1, 'module'=>'user', 'test'=>1, 'label'=>$langs->trans("Users"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Users")));
+ $rowspan++;
+ $sectionauto[] = array('position'=>220, 'level'=>1, 'module'=>'user', 'test'=>1, 'label'=>$langs->trans("Users"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Users")));
$parameters = array();
$reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters);
diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php
index f841a95b52c..889d205cf74 100644
--- a/htdocs/ecm/search.php
+++ b/htdocs/ecm/search.php
@@ -115,55 +115,81 @@ $userstatic = new User($db);
$rowspan = 0;
$sectionauto = array();
if (isModEnabled("product") || isModEnabled("service")) {
- $langs->load("products"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'product', 'test'=>(isModEnabled("product") || isModEnabled("service")), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts"));
+ $langs->load("products");
+ $rowspan++;
+ $sectionauto[] = array('level'=>1, 'module'=>'product', 'test'=>(isModEnabled("product") || isModEnabled("service")), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts"));
}
if (isModEnabled("societe")) {
- $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'company', 'test'=>isModEnabled('societe'), 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ThirdParties")));
+ $rowspan++;
+ $sectionauto[] = array('level'=>1, 'module'=>'company', 'test'=>isModEnabled('societe'), 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ThirdParties")));
}
if (isModEnabled("propal")) {
- $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'propal', 'test'=>isModEnabled('propal'), 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals")));
+ $rowspan++;
+ $sectionauto[] = array('level'=>1, 'module'=>'propal', 'test'=>isModEnabled('propal'), 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals")));
}
if (isModEnabled('contrat')) {
- $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'contract', 'test'=>isModEnabled('contrat'), 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts")));
+ $rowspan++;
+ $sectionauto[] = array('level'=>1, 'module'=>'contract', 'test'=>isModEnabled('contrat'), 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts")));
}
if (isModEnabled('commande')) {
- $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order', 'test'=>isModEnabled('commande'), 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders")));
+ $rowspan++;
+ $sectionauto[] = array('level'=>1, 'module'=>'order', 'test'=>isModEnabled('commande'), 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders")));
}
if (isModEnabled('facture')) {
- $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice', 'test'=>isModEnabled('facture'), 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices")));
+ $rowspan++;
+ $sectionauto[] = array('level'=>1, 'module'=>'invoice', 'test'=>isModEnabled('facture'), 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices")));
}
if (isModEnabled('supplier_proposal')) {
- $langs->load("supplier_proposal"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'supplier_proposal', 'test'=>isModEnabled('supplier_proposal'), 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals")));
+ $langs->load("supplier_proposal");
+ $rowspan++;
+ $sectionauto[] = array('level'=>1, 'module'=>'supplier_proposal', 'test'=>isModEnabled('supplier_proposal'), 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals")));
}
if (isModEnabled("supplier_order")) {
- $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order_supplier', 'test'=>isModEnabled("supplier_order"), 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("PurchaseOrders")));
+ $rowspan++;
+ $sectionauto[] = array('level'=>1, 'module'=>'order_supplier', 'test'=>isModEnabled("supplier_order"), 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("PurchaseOrders")));
}
if (isModEnabled("supplier_invoice")) {
- $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>isModEnabled("supplier_invoice"), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices")));
+ $rowspan++;
+ $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>isModEnabled("supplier_invoice"), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices")));
}
if (isModEnabled('tax')) {
- $langs->load("compta"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>isModEnabled('tax'), 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions")));
+ $langs->load("compta");
+ $rowspan++;
+ $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>isModEnabled('tax'), 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions")));
}
if (isModEnabled('project')) {
- $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'project', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects")));
+ $rowspan++;
+ $sectionauto[] = array('level'=>1, 'module'=>'project', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects")));
}
if (isModEnabled('ficheinter')) {
- $langs->load("interventions"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>isModEnabled('ficheinter'), 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions")));
+ $langs->load("interventions");
+ $rowspan++;
+ $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>isModEnabled('ficheinter'), 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions")));
}
if (isModEnabled('expensereport')) {
- $langs->load("trips"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'expensereport', 'test'=>isModEnabled('expensereport'), 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports")));
+ $langs->load("trips");
+ $rowspan++;
+ $sectionauto[] = array('level'=>1, 'module'=>'expensereport', 'test'=>isModEnabled('expensereport'), 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports")));
}
if (isModEnabled('holiday')) {
- $langs->load("holiday"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'holiday', 'test'=>isModEnabled('holiday'), 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays")));
+ $langs->load("holiday");
+ $rowspan++;
+ $sectionauto[] = array('level'=>1, 'module'=>'holiday', 'test'=>isModEnabled('holiday'), 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays")));
}
if (isModEnabled("banque")) {
- $langs->load("banks"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'banque', 'test'=>isModEnabled('banque'), 'label'=>$langs->trans("BankAccount"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount")));
+ $langs->load("banks");
+ $rowspan++;
+ $sectionauto[] = array('level'=>1, 'module'=>'banque', 'test'=>isModEnabled('banque'), 'label'=>$langs->trans("BankAccount"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount")));
}
if (isModEnabled('mrp')) {
- $langs->load("mrp"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'mrp-mo', 'test'=>isModEnabled('mrp'), 'label'=>$langs->trans("MOs"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ManufacturingOrders")));
+ $langs->load("mrp");
+ $rowspan++;
+ $sectionauto[] = array('level'=>1, 'module'=>'mrp-mo', 'test'=>isModEnabled('mrp'), 'label'=>$langs->trans("MOs"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ManufacturingOrders")));
}
if (isModEnabled('recruitment')) {
- $langs->load("recruitment"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'recruitment-recruitmentcandidature', 'test'=>isModEnabled('recruitment'), 'label'=>$langs->trans("Candidatures"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("JobApplications")));
+ $langs->load("recruitment");
+ $rowspan++;
+ $sectionauto[] = array('level'=>1, 'module'=>'recruitment-recruitmentcandidature', 'test'=>isModEnabled('recruitment'), 'label'=>$langs->trans("Candidatures"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("JobApplications")));
}
@@ -234,7 +260,7 @@ print '';
// Right area
$relativepath = $ecmdir->getRelativePath();
$upload_dir = $conf->ecm->dir_output.'/'.$relativepath;
-$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
+$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC), 1);
$formfile = new FormFile($db);
$param = '§ion='.urlencode($section);
diff --git a/htdocs/ecm/tpl/enablefiletreeajax.tpl.php b/htdocs/ecm/tpl/enablefiletreeajax.tpl.php
index a7e601bf053..200cf59c3f1 100644
--- a/htdocs/ecm/tpl/enablefiletreeajax.tpl.php
+++ b/htdocs/ecm/tpl/enablefiletreeajax.tpl.php
@@ -102,7 +102,7 @@ function loadandshowpreview(filedirname,section)
$('#ecmfileview').empty();
- var url = '?action=preview&module=§ion='+section+'&file='+urlencode(filedirname);
+ var url = '?action=preview&module=§ion='+section+'&file='+urlencode(filedirname);
$.get(url, function(data) {
//alert('Load of url '+url+' was performed : '+data);
pos=data.indexOf("TYPE=directory",0);
diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php
index 151aa4be275..7af77ad64b3 100644
--- a/htdocs/emailcollector/class/emailcollector.class.php
+++ b/htdocs/emailcollector/class/emailcollector.class.php
@@ -52,7 +52,6 @@ use Webklex\PHPIMAP\Exceptions\GetMessagesFailedException;
use OAuth\Common\Storage\DoliStorage;
use OAuth\Common\Consumer\Credentials;
-
/**
* Class for EmailCollector
*/
@@ -968,7 +967,7 @@ class EmailCollector extends CommonObject
//var_dump($tmpproperty.' - '.$regexstring.' - '.$regexoptions.' - '.$sourcestring);
if (preg_match('/'.$regexstring.'/'.$regexoptions, $sourcestring, $regforval)) {
// Overwrite param $tmpproperty
- $valueextracted = isset($regforval[count($regforval) - 1]) ?trim($regforval[count($regforval) - 1]) : null;
+ $valueextracted = isset($regforval[count($regforval) - 1]) ? trim($regforval[count($regforval) - 1]) : null;
if (strtolower($sourcefield) == 'header') { // extract from HEADER
if (preg_match('/^options_/', $tmpproperty)) {
$object->array_options[preg_replace('/^options_/', '', $tmpproperty)] = $this->decodeSMTPSubject($valueextracted);
@@ -1158,7 +1157,7 @@ class EmailCollector extends CommonObject
$keyforsupportedoauth2array = 'OAUTH_'.$keyforsupportedoauth2array.'_NAME';
$OAUTH_SERVICENAME = 'Unknown';
- if ( array_key_exists($keyforsupportedoauth2array, $supportedoauth2array)
+ if (array_key_exists($keyforsupportedoauth2array, $supportedoauth2array)
&& array_key_exists('name', $supportedoauth2array[$keyforsupportedoauth2array])
&& !empty($supportedoauth2array[$keyforsupportedoauth2array]['name'])) {
$OAUTH_SERVICENAME = $supportedoauth2array[$keyforsupportedoauth2array]['name'].(!empty($keyforprovider) ? '-'.$keyforprovider : '');
@@ -1186,7 +1185,7 @@ class EmailCollector extends CommonObject
getDolGlobalString('OAUTH_'.$this->oauth_service.'_ID'),
getDolGlobalString('OAUTH_'.$this->oauth_service.'_SECRET'),
getDolGlobalString('OAUTH_'.$this->oauth_service.'_URLAUTHORIZE')
- );
+ );
$serviceFactory = new \OAuth\ServiceFactory();
$oauthname = explode('-', $OAUTH_SERVICENAME);
// ex service is Google-Emails we need only the first part Google
@@ -1370,27 +1369,34 @@ class EmailCollector extends CommonObject
// Rules to filter after the search imap
if ($rule['type'] == 'withtrackingidinmsgid') {
- $searchfilterdoltrackid++; $searchhead .= '/Message-ID.*@'.preg_quote($host, '/').'/';
+ $searchfilterdoltrackid++;
+ $searchhead .= '/Message-ID.*@'.preg_quote($host, '/').'/';
}
if ($rule['type'] == 'withouttrackingidinmsgid') {
- $searchfilterdoltrackid++; $searchhead .= '/Message-ID.*@'.preg_quote($host, '/').'/';
+ $searchfilterdoltrackid++;
+ $searchhead .= '/Message-ID.*@'.preg_quote($host, '/').'/';
}
if ($rule['type'] == 'withtrackingid') {
- $searchfilterdoltrackid++; $searchhead .= '/References.*@'.preg_quote($host, '/').'/';
+ $searchfilterdoltrackid++;
+ $searchhead .= '/References.*@'.preg_quote($host, '/').'/';
}
if ($rule['type'] == 'withouttrackingid') {
- $searchfilternodoltrackid++; $searchhead .= '! /References.*@'.preg_quote($host, '/').'/';
+ $searchfilternodoltrackid++;
+ $searchhead .= '! /References.*@'.preg_quote($host, '/').'/';
}
if ($rule['type'] == 'isanswer') {
- $searchfilterisanswer++; $searchhead .= '/References.*@.*/';
+ $searchfilterisanswer++;
+ $searchhead .= '/References.*@.*/';
}
if ($rule['type'] == 'isnotanswer') {
- $searchfilterisnotanswer++; $searchhead .= '! /References.*@.*/';
+ $searchfilterisnotanswer++;
+ $searchhead .= '! /References.*@.*/';
}
if ($rule['type'] == 'replyto') {
- $searchfilterreplyto++; $searchhead .= '/Reply-To.*'.preg_quote($rule['rulevalue'], '/').'/';
+ $searchfilterreplyto++;
+ $searchhead .= '/Reply-To.*'.preg_quote($rule['rulevalue'], '/').'/';
}
}
@@ -1502,27 +1508,34 @@ class EmailCollector extends CommonObject
// Rules to filter after the search imap
if ($rule['type'] == 'withtrackingidinmsgid') {
- $searchfilterdoltrackid++; $searchhead .= '/Message-ID.*@'.preg_quote($host, '/').'/';
+ $searchfilterdoltrackid++;
+ $searchhead .= '/Message-ID.*@'.preg_quote($host, '/').'/';
}
if ($rule['type'] == 'withouttrackingidinmsgid') {
- $searchfilterdoltrackid++; $searchhead .= '/Message-ID.*@'.preg_quote($host, '/').'/';
+ $searchfilterdoltrackid++;
+ $searchhead .= '/Message-ID.*@'.preg_quote($host, '/').'/';
}
if ($rule['type'] == 'withtrackingid') {
- $searchfilterdoltrackid++; $searchhead .= '/References.*@'.preg_quote($host, '/').'/';
+ $searchfilterdoltrackid++;
+ $searchhead .= '/References.*@'.preg_quote($host, '/').'/';
}
if ($rule['type'] == 'withouttrackingid') {
- $searchfilternodoltrackid++; $searchhead .= '! /References.*@'.preg_quote($host, '/').'/';
+ $searchfilternodoltrackid++;
+ $searchhead .= '! /References.*@'.preg_quote($host, '/').'/';
}
if ($rule['type'] == 'isanswer') {
- $searchfilterisanswer++; $searchhead .= '/References.*@.*/';
+ $searchfilterisanswer++;
+ $searchhead .= '/References.*@.*/';
}
if ($rule['type'] == 'isnotanswer') {
- $searchfilterisnotanswer++; $searchhead .= '! /References.*@.*/';
+ $searchfilterisnotanswer++;
+ $searchhead .= '! /References.*@.*/';
}
if ($rule['type'] == 'replyto') {
- $searchfilterreplyto++; $searchhead .= '/Reply-To.*'.preg_quote($rule['rulevalue'], '/').'/';
+ $searchfilterreplyto++;
+ $searchhead .= '/Reply-To.*'.preg_quote($rule['rulevalue'], '/').'/';
}
}
@@ -1921,11 +1934,15 @@ class EmailCollector extends CommonObject
$replyto = $replytostring;
$replytotext = '';
}
- $fk_element_id = 0; $fk_element_type = '';
+ $fk_element_id = 0;
+ $fk_element_type = '';
$this->db->begin();
- $contactid = 0; $thirdpartyid = 0; $projectid = 0; $ticketid = 0;
+ $contactid = 0;
+ $thirdpartyid = 0;
+ $projectid = 0;
+ $ticketid = 0;
// Analyze TrackId in field References. For example:
// References: <1542377954.SMTPs-dolibarr-thi649@8f6014fde11ec6cdec9a822234fc557e>
@@ -2400,7 +2417,7 @@ class EmailCollector extends CommonObject
$thirdpartystatic->name_alias = $namealiastouseforthirdparty;
}
} else {
- $thirdpartystatic->name_alias = (empty($replytostring) ? (empty($fromtext) ? '': $fromtext) : $replytostring);
+ $thirdpartystatic->name_alias = (empty($replytostring) ? (empty($fromtext) ? '' : $fromtext) : $replytostring);
}
$thirdpartystatic->email = (empty($emailtouseforthirdparty) ? (empty($replyto) ? (empty($from) ? '' : $from) : $replyto) : $emailtouseforthirdparty);
@@ -2446,7 +2463,9 @@ class EmailCollector extends CommonObject
if ($errorforthisaction) {
$errorforactions++;
} else {
- if (!empty($contact_static->email) && $contact_static->email != $from) $from = $contact_static->email;
+ if (!empty($contact_static->email) && $contact_static->email != $from) {
+ $from = $contact_static->email;
+ }
$result = $contactstatic->fetch(0, null, '', $from);
if ($result < 0) {
@@ -2870,7 +2889,10 @@ class EmailCollector extends CommonObject
$modele = !getDolGlobalString('PROJECT_ADDON') ? 'mod_project_simple' : $conf->global->PROJECT_ADDON;
// Search template files
- $file = ''; $classname = ''; $filefound = 0; $reldir = '';
+ $file = '';
+ $classname = '';
+ $filefound = 0;
+ $reldir = '';
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$file = dol_buildpath($reldir."core/modules/project/".$modele.'.php', 0);
@@ -2894,7 +2916,7 @@ class EmailCollector extends CommonObject
}
$result = dol_include_once($reldir."core/modules/project/".$modele.'.php');
- $modModuleToUseForNextValue = new $classname;
+ $modModuleToUseForNextValue = new $classname();
$defaultref = $modModuleToUseForNextValue->getNextValue(($thirdpartystatic->id > 0 ? $thirdpartystatic : null), $projecttocreate);
}
$projecttocreate->ref = $defaultref;
@@ -3009,7 +3031,10 @@ class EmailCollector extends CommonObject
$modele = !getDolGlobalString('TICKET_ADDON') ? 'mod_ticket_simple' : $conf->global->TICKET_ADDON;
// Search template files
- $file = ''; $classname = ''; $filefound = 0; $reldir = '';
+ $file = '';
+ $classname = '';
+ $filefound = 0;
+ $reldir = '';
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$file = dol_buildpath($reldir."core/modules/ticket/".$modele.'.php', 0);
@@ -3033,7 +3058,7 @@ class EmailCollector extends CommonObject
}
$result = dol_include_once($reldir."core/modules/ticket/".$modele.'.php');
- $modModuleToUseForNextValue = new $classname;
+ $modModuleToUseForNextValue = new $classname();
$defaultref = $modModuleToUseForNextValue->getNextValue(($thirdpartystatic->id > 0 ? $thirdpartystatic : null), $tickettocreate);
}
$tickettocreate->ref = $defaultref;
@@ -3449,7 +3474,9 @@ class EmailCollector extends CommonObject
$attachments[$filename] = $data; // this is a problem if two files have same name
if (strlen($destdir)) {
- if (substr($destdir, -1) != '/') $destdir .= '/';
+ if (substr($destdir, -1) != '/') {
+ $destdir .= '/';
+ }
// Get file name (with extension)
$file_name_complete = $params['filename'];
diff --git a/htdocs/emailcollector/class/emailcollectoraction.class.php b/htdocs/emailcollector/class/emailcollectoraction.class.php
index de88676acc3..997907b3c60 100644
--- a/htdocs/emailcollector/class/emailcollectoraction.class.php
+++ b/htdocs/emailcollector/class/emailcollectoraction.class.php
@@ -313,11 +313,11 @@ class EmailCollectorAction extends CommonObject
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
/*
- $hookmanager->initHooks(array('emailcollectoractiondao'));
- $parameters=array('id'=>$this->id);
- $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
- if ($reshook > 0) $linkclose = $hookmanager->resPrint;
- */
+ $hookmanager->initHooks(array('emailcollectoractiondao'));
+ $parameters=array('id'=>$this->id);
+ $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
+ if ($reshook > 0) $linkclose = $hookmanager->resPrint;
+ */
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
}
diff --git a/htdocs/emailcollector/class/emailcollectorfilter.class.php b/htdocs/emailcollector/class/emailcollectorfilter.class.php
index 52ff4e65512..87e239f2ed3 100644
--- a/htdocs/emailcollector/class/emailcollectorfilter.class.php
+++ b/htdocs/emailcollector/class/emailcollectorfilter.class.php
@@ -327,11 +327,11 @@ class EmailCollectorFilter extends CommonObject
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
/*
- $hookmanager->initHooks(array('emailcollectorfilterdao'));
- $parameters=array('id'=>$this->id);
- $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
- if ($reshook > 0) $linkclose = $hookmanager->resPrint;
- */
+ $hookmanager->initHooks(array('emailcollectorfilterdao'));
+ $parameters=array('id'=>$this->id);
+ $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
+ if ($reshook > 0) $linkclose = $hookmanager->resPrint;
+ */
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
}
diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php
index 9f68764f77c..33fb6b00657 100644
--- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php
+++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php
@@ -606,13 +606,15 @@ class ConferenceOrBoothAttendee extends CommonObject
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'conferenceorboothattendee/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->error = $this->db->lasterror();
+ $error++;
+ $this->error = $this->db->lasterror();
}
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'conferenceorboothattendee/".$this->db->escape($this->newref)."'";
$sql .= " WHERE filepath = 'conferenceorboothattendee/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->error = $this->db->lasterror();
+ $error++;
+ $this->error = $this->db->lasterror();
}
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php
index 0909d00b8dd..47172b01203 100644
--- a/htdocs/eventorganization/conferenceorbooth_card.php
+++ b/htdocs/eventorganization/conferenceorbooth_card.php
@@ -216,7 +216,7 @@ if (!empty($withproject)) {
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('project', 'all', 'lire')) {
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
- $projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
+ $projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? join(',', array_keys($objectsListId)) : '0').")";
}
dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
@@ -280,10 +280,10 @@ if (!empty($withproject)) {
// Date start - end project
print ' '.$langs->trans("Dates").' ('.$langs->trans("Project").') ';
$start = dol_print_date($projectstatic->date_start, 'day');
- print ($start ? $start : '?');
+ print($start ? $start : '?');
$end = dol_print_date($projectstatic->date_end, 'day');
print ' - ';
- print ($end ? $end : '?');
+ print($end ? $end : '?');
if ($object->hasDelay()) {
print img_warning("Late");
}
@@ -292,10 +292,10 @@ if (!empty($withproject)) {
// Date start - end of event
print ' '.$langs->trans("Dates").' ('.$langs->trans("Event").') ';
$start = dol_print_date($projectstatic->date_start_event, 'day');
- print ($start ? $start : '?');
+ print($start ? $start : '?');
$end = dol_print_date($projectstatic->date_end_event, 'day');
print ' - ';
- print ($end ? $end : '?');
+ print($end ? $end : '?');
if ($object->hasDelay()) {
print img_warning("Late");
}
diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php
index 99630173888..b02996ebff8 100644
--- a/htdocs/eventorganization/conferenceorbooth_contact.php
+++ b/htdocs/eventorganization/conferenceorbooth_contact.php
@@ -112,7 +112,7 @@ if ($action == 'addcontact' && $permission) { // Add a new contact
$result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09'));
if ($result >= 0) {
- header("Location: ".$_SERVER['PHP_SELF']."?id=".((int) $object->id).(!empty($withproject)?'&withproject=1':''));
+ header("Location: ".$_SERVER['PHP_SELF']."?id=".((int) $object->id).(!empty($withproject) ? '&withproject=1' : ''));
exit;
} else {
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
@@ -130,7 +130,7 @@ if ($action == 'addcontact' && $permission) { // Add a new contact
$result = $object->delete_contact($lineid);
if ($result >= 0) {
- header("Location: ".$_SERVER['PHP_SELF']."?id=".((int) $object->id).(!empty($withproject)?'&withproject=1':''));
+ header("Location: ".$_SERVER['PHP_SELF']."?id=".((int) $object->id).(!empty($withproject) ? '&withproject=1' : ''));
exit;
} else {
dol_print_error($db);
@@ -194,7 +194,7 @@ if (!empty($withproject)) {
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('project', 'all', 'lire')) {
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
- $projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
+ $projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? join(',', array_keys($objectsListId)) : '0').")";
}
dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
@@ -249,10 +249,10 @@ if (!empty($withproject)) {
// Date start - end
print ' '.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").' ';
$start = dol_print_date($projectstatic->date_start, 'day');
- print ($start ? $start : '?');
+ print($start ? $start : '?');
$end = dol_print_date($projectstatic->date_end, 'day');
print ' - ';
- print ($end ? $end : '?');
+ print($end ? $end : '?');
if ($projectstatic->hasDelay()) {
print img_warning("Late");
}
diff --git a/htdocs/eventorganization/conferenceorbooth_document.php b/htdocs/eventorganization/conferenceorbooth_document.php
index 5773c490ce5..b341e6a2134 100644
--- a/htdocs/eventorganization/conferenceorbooth_document.php
+++ b/htdocs/eventorganization/conferenceorbooth_document.php
@@ -167,7 +167,7 @@ if (!empty($withproject)) {
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('project', 'all', 'lire')) {
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
- $projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
+ $projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? join(',', array_keys($objectsListId)) : '0').")";
}
dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
@@ -222,10 +222,10 @@ if (!empty($withproject)) {
// Date start - end
print ' '.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").' ';
$start = dol_print_date($projectstatic->date_start, 'day');
- print ($start ? $start : '?');
+ print($start ? $start : '?');
$end = dol_print_date($projectstatic->date_end, 'day');
print ' - ';
- print ($end ? $end : '?');
+ print($end ? $end : '?');
if ($projectstatic->hasDelay()) {
print img_warning("Late");
}
@@ -362,7 +362,7 @@ if ($object->id) {
// Build file list
- $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
+ $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC), 1);
$totalsize = 0;
foreach ($filearray as $key => $file) {
$totalsize += $file['size'];
diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php
index bc6f23b087e..041956abf72 100644
--- a/htdocs/eventorganization/conferenceorbooth_list.php
+++ b/htdocs/eventorganization/conferenceorbooth_list.php
@@ -148,7 +148,9 @@ if ($user->socid > 0) { // Protection if external user
accessforbidden();
}
$result = restrictedArea($user, 'eventorganization');
-if (!$permissiontoread) accessforbidden();
+if (!$permissiontoread) {
+ accessforbidden();
+}
/*
@@ -226,7 +228,8 @@ if (empty($reshook)) {
if ($permissiontoadd && (($action == 'setstatus' && $confirm == "yes") || $massaction == 'setstatus')) {
$db->begin();
- $error = 0;$nbok = 0;
+ $error = 0;
+ $nbok = 0;
$objecttmp = new $objectclass($db);
foreach ($toselect as $key => $idselect) {
$result = $objecttmp->fetch($idselect);
@@ -393,10 +396,10 @@ if ($projectid > 0) {
// Date start - end project
print ' '.$langs->trans("Dates").' ('.$langs->trans("Project").') ';
$start = dol_print_date($project->date_start, 'day');
- print ($start ? $start : '?');
+ print($start ? $start : '?');
$end = dol_print_date($project->date_end, 'day');
print ' - ';
- print ($end ? $end : '?');
+ print($end ? $end : '?');
if ($object->hasDelay()) {
print img_warning("Late");
}
@@ -405,10 +408,10 @@ if ($projectid > 0) {
// Date start - end of event
print ' '.$langs->trans("Dates").' ('.$langs->trans("Event").') ';
$start = dol_print_date($project->date_start_event, 'day');
- print ($start ? $start : '?');
+ print($start ? $start : '?');
$end = dol_print_date($project->date_end_event, 'day');
print ' - ';
- print ($end ? $end : '?');
+ print($end ? $end : '?');
if ($object->hasDelay()) {
print img_warning("Late");
}
@@ -724,7 +727,7 @@ if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'pr
}
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
-print ' \n";
}
@@ -1330,7 +1334,7 @@ if ($action == 'create') {
// Show warehouse combo list
$ent = "entl".$indiceAsked;
$idl = "idl".$indiceAsked;
- $tmpentrepot_id = is_numeric(GETPOST($ent, 'int')) ?GETPOST($ent, 'int') : $warehouse_id;
+ $tmpentrepot_id = is_numeric(GETPOST($ent, 'int')) ? GETPOST($ent, 'int') : $warehouse_id;
if ($line->fk_product > 0) {
print '';
@@ -1352,7 +1356,9 @@ if ($action == 'create') {
}
print '';
}
- if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) print ' '; //StockEntrydate
+ if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) {
+ print ' ';
+ } //StockEntrydate
print "\n";
// Show subproducts of product
@@ -1370,7 +1376,9 @@ if ($action == 'create') {
".$value['fullpath']."
(".$value['nb'].") ".$value['nb_total']."
".$value['stock']." ".$img." ";
- if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) print ' '; //StockEntrydate
+ if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) {
+ print ' ';
+ } //StockEntrydate
print "";
}
}
@@ -1378,7 +1386,9 @@ if ($action == 'create') {
} else {
// Product need lot
print ' ';
- if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) print ' '; //StockEntrydate
+ if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) {
+ print ' ';
+ } //StockEntrydate
print ''; // end line and start a new one for lot/serial
print '';
@@ -1445,7 +1455,9 @@ if ($action == 'create') {
print '';
print img_warning().' '.$langs->trans("NoProductToShipFoundIntoStock", $staticwarehouse->label);
print ' ';
- if (getDolGlobalInt('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) print ' '; //StockEntrydate
+ if (getDolGlobalInt('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) {
+ print ' ';
+ } //StockEntrydate
print '';
}
}
@@ -1454,7 +1466,9 @@ if ($action == 'create') {
if (empty($conf->productbatch->enabled) || !$product->hasbatch()) {
print '';
print ' ';
- if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) print ' ';//StockEntrydate
+ if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) {
+ print ' ';
+ }//StockEntrydate
print ''."\n"; // end line and start a new one for each warehouse
print ' ';
@@ -1494,7 +1508,9 @@ if ($action == 'create') {
$deliverableQty = min($quantityToBeDelivered, $stock);
}
- if ($deliverableQty < 0) $deliverableQty = 0;
+ if ($deliverableQty < 0) {
+ $deliverableQty = 0;
+ }
$tooltip = '';
if (!empty($alreadyQtySetted[$line->fk_product][intval($warehouse_id)])) {
@@ -1539,7 +1555,9 @@ if ($action == 'create') {
$quantityToBeDelivered = 0;
}
$subj++;
- if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) print ' ';//StockEntrydate
+ if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) {
+ print ' ';
+ }//StockEntrydate
print "\n";
}
}
@@ -1559,7 +1577,9 @@ if ($action == 'create') {
".$value['fullpath']."
(".$value['nb'].") ".$value['nb_total']."
".$value['stock']." ".$img." ";
- if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) print ' ';//StockEntrydate
+ if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) {
+ print ' ';
+ }//StockEntrydate
print "";
}
}
@@ -1567,7 +1587,9 @@ if ($action == 'create') {
} else {
print '';
print ' ';
- if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) print ' ';//StockEntrydate
+ if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) {
+ print ' ';
+ }//StockEntrydate
print ''; // end line and start a new one for lot/serial
$subj = 0;
@@ -1609,7 +1631,9 @@ if ($action == 'create') {
$deliverableQty = min($quantityToBeDelivered, $batchStock);
}
- if ($deliverableQty < 0) $deliverableQty = 0;
+ if ($deliverableQty < 0) {
+ $deliverableQty = 0;
+ }
$inputName = 'qtyl'.$indiceAsked.'_'.$subj;
if (GETPOSTISSET($inputName)) {
@@ -1625,7 +1649,7 @@ if ($action == 'create') {
}
$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = $deliverableQty + $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)];
- print '';
+ print ' ';
print ' ';
print ' ';
@@ -1703,7 +1727,9 @@ if ($action == 'create') {
print '('.$langs->trans("Service").') ';
}
print '';
- if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) print ' ';//StockEntrydate
+ if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) {
+ print ' ';
+ }//StockEntrydate
print ' ';
}
}
@@ -2390,7 +2416,7 @@ if ($action == 'create') {
// only show lot numbers from src warehouse when shipping from multiple warehouses
$line->fetch($detail_batch->fk_expeditiondet);
}
- $entrepot_id = !empty($detail_batch->entrepot_id)?$detail_batch->entrepot_id:$lines[$i]->entrepot_id;
+ $entrepot_id = !empty($detail_batch->entrepot_id) ? $detail_batch->entrepot_id : $lines[$i]->entrepot_id;
print ''.$formproduct->selectLotStock($detail_batch->fk_origin_stock, 'batchl'.$detail_batch->fk_expeditiondet.'_'.$detail_batch->fk_origin_stock, '', 1, 0, $lines[$i]->fk_product, $entrepot_id).' ';
print '';
}
@@ -2614,7 +2640,7 @@ if ($action == 'create') {
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
- // modified by hook
+ // modified by hook
if (empty($reshook)) {
if ($object->statut == Expedition::STATUS_DRAFT && $num_prod > 0) {
if ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('expedition', 'creer'))
diff --git a/htdocs/expedition/class/api_shipments.class.php b/htdocs/expedition/class/api_shipments.class.php
index b7510c7d805..2abe63165c7 100644
--- a/htdocs/expedition/class/api_shipments.class.php
+++ b/htdocs/expedition/class/api_shipments.class.php
@@ -28,7 +28,6 @@
*/
class Shipments extends DolibarrApi
{
-
/**
* @var array $FIELDS Mandatory fields, checked when create and update object
*/
@@ -554,7 +553,7 @@ class Shipments extends DolibarrApi
// * @throws RestException 404
// * @throws RestException 405
// */
- /*
+ /*
public function setinvoiced($id)
{
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index 3ad356d02e5..ba8c7b9290e 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -803,13 +803,15 @@ class Expedition extends CommonObject
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'expedition/sending/".$this->db->escape($this->ref)."' and entity = ".((int) $conf->entity);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->error = $this->db->lasterror();
+ $error++;
+ $this->error = $this->db->lasterror();
}
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'expedition/sending/".$this->db->escape($this->newref)."'";
$sql .= " WHERE filepath = 'expedition/sending/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->error = $this->db->lasterror();
+ $error++;
+ $this->error = $this->db->lasterror();
}
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
@@ -1150,7 +1152,8 @@ class Expedition extends CommonObject
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
if (!$error && !$notrigger) {
@@ -1277,7 +1280,8 @@ class Expedition extends CommonObject
}
}
} else {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
}
@@ -1285,7 +1289,8 @@ class Expedition extends CommonObject
if (!$error && isModEnabled('productbatch')) {
$shipmentlinebatch = new ExpeditionLineBatch($this->db);
if ($shipmentlinebatch->deleteFromShipment($this->id) < 0) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
}
@@ -1434,7 +1439,8 @@ class Expedition extends CommonObject
// get lot/serial
$lotArray = $shipmentlinebatch->fetchAll($obj->expeditiondet_id);
if (!is_array($lotArray)) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
if (empty($lotArray)) {
// no lot/serial
@@ -1463,7 +1469,8 @@ class Expedition extends CommonObject
}
}
} else {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
}
@@ -1471,7 +1478,8 @@ class Expedition extends CommonObject
if (!$error) {
$shipmentlinebatch = new ExpeditionLineBatch($this->db);
if ($shipmentlinebatch->deleteFromShipment($this->id) < 0) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
}
@@ -1877,7 +1885,7 @@ class Expedition extends CommonObject
$label = $langs->trans("Shipment");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.'"';
}
diff --git a/htdocs/expedition/class/expeditionlinebatch.class.php b/htdocs/expedition/class/expeditionlinebatch.class.php
index fbf6564616f..658de632577 100644
--- a/htdocs/expedition/class/expeditionlinebatch.class.php
+++ b/htdocs/expedition/class/expeditionlinebatch.class.php
@@ -112,7 +112,9 @@ class ExpeditionLineBatch extends CommonObject
global $user;
$error = 0;
- if (!is_object($f_user)) $f_user = $user;
+ if (!is_object($f_user)) {
+ $f_user = $user;
+ }
$id_line_expdet = (int) $id_line_expdet;
@@ -137,7 +139,8 @@ class ExpeditionLineBatch extends CommonObject
dol_syslog(__METHOD__, LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
if (!$error) {
diff --git a/htdocs/expedition/dispatch.php b/htdocs/expedition/dispatch.php
index 76c94ffe9d2..8ba6e6d7768 100644
--- a/htdocs/expedition/dispatch.php
+++ b/htdocs/expedition/dispatch.php
@@ -689,7 +689,7 @@ if ($object->id > 0 || !empty($object->ref)) {
if (!$objp->fk_product > 0) {
$nbfreeproduct++;
} else {
- $alreadydispatched = isset($products_dispatched[$objp->rowid])?$products_dispatched[$objp->rowid]:0;
+ $alreadydispatched = isset($products_dispatched[$objp->rowid]) ? $products_dispatched[$objp->rowid] : 0;
$remaintodispatch = price2num($objp->qty, 5); // Calculation of dispatched
if ($remaintodispatch < 0 && !getDolGlobalString('SUPPLIER_ORDER_ALLOW_NEGATIVE_QTY_FOR_SUPPLIER_ORDER_RETURN')) {
$remaintodispatch = 0;
@@ -906,9 +906,9 @@ if ($object->id > 0 || !empty($object->ref)) {
// Warehouse
print '';
if (count($listwarehouses) > 1) {
- print $formproduct->selectWarehouses(GETPOST("entrepot".$suffix) ?GETPOST("entrepot".$suffix) : $objd->fk_entrepot, "entrepot".$suffix, '', 1, 0, $objp->fk_product, '', 1, 0, null, 'csswarehouse'.$suffix);
+ print $formproduct->selectWarehouses(GETPOST("entrepot".$suffix) ? GETPOST("entrepot".$suffix) : $objd->fk_entrepot, "entrepot".$suffix, '', 1, 0, $objp->fk_product, '', 1, 0, null, 'csswarehouse'.$suffix);
} elseif (count($listwarehouses) == 1) {
- print $formproduct->selectWarehouses(GETPOST("entrepot".$suffix) ?GETPOST("entrepot".$suffix) : $objd->fk_entrepot, "entrepot".$suffix, '', 0, 0, $objp->fk_product, '', 1, 0, null, 'csswarehouse'.$suffix);
+ print $formproduct->selectWarehouses(GETPOST("entrepot".$suffix) ? GETPOST("entrepot".$suffix) : $objd->fk_entrepot, "entrepot".$suffix, '', 0, 0, $objp->fk_product, '', 1, 0, null, 'csswarehouse'.$suffix);
} else {
$langs->load("errors");
print $langs->trans("ErrorNoWarehouseDefined");
@@ -1056,9 +1056,9 @@ if ($object->id > 0 || !empty($object->ref)) {
// Warehouse
print ' ';
if (count($listwarehouses) > 1) {
- print $formproduct->selectWarehouses(GETPOST("entrepot".$suffix) ?GETPOST("entrepot".$suffix) : ($objp->fk_default_warehouse ? $objp->fk_default_warehouse : ''), "entrepot".$suffix, '', 1, 0, $objp->fk_product, '', 1, 0, null, 'csswarehouse'.$suffix);
+ print $formproduct->selectWarehouses(GETPOST("entrepot".$suffix) ? GETPOST("entrepot".$suffix) : ($objp->fk_default_warehouse ? $objp->fk_default_warehouse : ''), "entrepot".$suffix, '', 1, 0, $objp->fk_product, '', 1, 0, null, 'csswarehouse'.$suffix);
} elseif (count($listwarehouses) == 1) {
- print $formproduct->selectWarehouses(GETPOST("entrepot".$suffix) ?GETPOST("entrepot".$suffix) : ($objp->fk_default_warehouse ? $objp->fk_default_warehouse : ''), "entrepot".$suffix, '', 0, 0, $objp->fk_product, '', 1, 0, null, 'csswarehouse'.$suffix);
+ print $formproduct->selectWarehouses(GETPOST("entrepot".$suffix) ? GETPOST("entrepot".$suffix) : ($objp->fk_default_warehouse ? $objp->fk_default_warehouse : ''), "entrepot".$suffix, '', 0, 0, $objp->fk_product, '', 1, 0, null, 'csswarehouse'.$suffix);
} else {
$langs->load("errors");
print $langs->trans("ErrorNoWarehouseDefined");
diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php
index c0725bd5fe1..f8aef745d16 100644
--- a/htdocs/expedition/document.php
+++ b/htdocs/expedition/document.php
@@ -124,7 +124,7 @@ if ($id > 0 || !empty($ref)) {
// Build file list
- $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
+ $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC), 1);
$totalsize = 0;
foreach ($filearray as $key => $file) {
$totalsize += $file['size'];
diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php
index 6cbfa70d6fa..60d63b1505c 100644
--- a/htdocs/expedition/list.php
+++ b/htdocs/expedition/list.php
@@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("sendings", "deliveries", 'companies', 'bills', 'products'));
-$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'shipmentlist'; // To manage different context of search
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'shipmentlist'; // To manage different context of search
$socid = GETPOST('socid', 'int');
@@ -72,7 +72,7 @@ $search_datedelivery_start = dol_mktime(0, 0, 0, GETPOST('search_datedelivery_st
$search_datedelivery_end = dol_mktime(23, 59, 59, GETPOST('search_datedelivery_endmonth', 'int'), GETPOST('search_datedelivery_endday', 'int'), GETPOST('search_datedelivery_endyear', 'int'));
$search_datereceipt_start = dol_mktime(0, 0, 0, GETPOST('search_datereceipt_startmonth', 'int'), GETPOST('search_datereceipt_startday', 'int'), GETPOST('search_datereceipt_startyear', 'int'));
$search_datereceipt_end = dol_mktime(23, 59, 59, GETPOST('search_datereceipt_endmonth', 'int'), GETPOST('search_datereceipt_endday', 'int'), GETPOST('search_datereceipt_endyear', 'int'));
-$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
+$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$search_user = GETPOST('search_user', 'int');
$search_sale = GETPOST('search_sale', 'int');
$search_categ_cus = GETPOST("search_categ_cus", 'int');
@@ -80,7 +80,7 @@ $search_product_category = GETPOST('search_product_category', 'int');
$optioncss = GETPOST('optioncss', 'alpha');
$mode = GETPOST('mode', 'alpha');
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
@@ -537,7 +537,7 @@ if ($search_zip) {
if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) {
$param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty);
}
-if ($search_datedelivery_start) {
+if ($search_datedelivery_start) {
$param .= '&search_datedelivery_startday='.urlencode(dol_print_date($search_datedelivery_start, '%d')).'&search_datedelivery_startmonth='.urlencode(dol_print_date($search_datedelivery_start, '%m')).'&search_datedelivery_startyear='.urlencode(dol_print_date($search_datedelivery_start, '%Y'));
}
if ($search_datedelivery_end) {
@@ -1059,7 +1059,9 @@ while ($i < $imaxinloop) {
// Get code using getLabelFromKey
$code=$langs->getLabelFromKey($db, $shipment->shipping_method_id, 'c_shipment_mode', 'rowid', 'code');
print ' ';
- if ($shipment->shipping_method_id > 0) print $langs->trans("SendingMethod".strtoupper($code));
+ if ($shipment->shipping_method_id > 0) {
+ print $langs->trans("SendingMethod".strtoupper($code));
+ }
print ' ';
if (!$i) {
$totalarray['nbfield']++;
diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php
index 15de055b8fe..78fbcc8685b 100644
--- a/htdocs/expedition/note.php
+++ b/htdocs/expedition/note.php
@@ -36,7 +36,7 @@ if (isModEnabled('project')) {
// Load translation files required by the page
$langs->loadLangs(array('sendings', 'companies', 'bills', 'deliveries', 'orders', 'stocks', 'other', 'propal'));
-$id = (GETPOST('id', 'int') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
+$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php
index 17f94305c0a..ee52952bbc3 100644
--- a/htdocs/expedition/shipment.php
+++ b/htdocs/expedition/shipment.php
@@ -760,7 +760,7 @@ if ($id > 0 || !empty($ref)) {
// Nb of sending products for this line of order
$qtyAlreadyShipped = (!empty($object->expeditions[$objp->rowid]) ? $object->expeditions[$objp->rowid] : 0);
print $qtyAlreadyShipped;
- print ($objp->unit_order ? ' '.$objp->unit_order : '').'';
+ print($objp->unit_order ? ' '.$objp->unit_order : '').'';
// Qty remains to ship
print '';
@@ -771,7 +771,7 @@ if ($id > 0 || !empty($ref)) {
} else {
print '0 ('.$langs->trans("Service").') ';
}
- print ($objp->unit_order ? ' '.$objp->unit_order : '').' ';
+ print($objp->unit_order ? ' '.$objp->unit_order : '').'';
if ($objp->fk_product > 0) {
$product = new Product($db);
diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php
index 46923713b75..81352fc6362 100644
--- a/htdocs/expedition/stats/index.php
+++ b/htdocs/expedition/stats/index.php
@@ -41,7 +41,7 @@ if ($user->socid > 0) {
}
$nowyear = dol_print_date(dol_now(), "%Y");
-$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
+$year = GETPOST('year') > 0 ? GETPOST('year') : $nowyear;
$startyear = $year - (!getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS') ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
$endyear = $year;
@@ -87,7 +87,8 @@ $mesg = $px1->isGraphKo();
$fileurlnb = '';
if (!$mesg) {
$px1->SetData($data);
- $i = $startyear; $legend = array();
+ $i = $startyear;
+ $legend = array();
while ($i <= $endyear) {
$legend[] = $i;
$i++;
diff --git a/htdocs/expedition/tpl/linkedobjectblock.tpl.php b/htdocs/expedition/tpl/linkedobjectblock.tpl.php
index 156f1f79195..6b025f8dda7 100644
--- a/htdocs/expedition/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/expedition/tpl/linkedobjectblock.tpl.php
@@ -42,8 +42,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
$trclass = 'oddeven';
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) {
$trclass .= ' liste_sub_total';
- }
- ?>
+ } ?>
trans("Shipment"); ?>
getNomUrl(1); ?>
@@ -61,14 +60,13 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
if ($object->element != 'commande') {
?>
id.'&token='.newToken().'&action=dellink&dellinkid='.$key; ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
+ } ?>
1) {
?>
-
+
trans("Total"); ?>
diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php
index 590aa9163db..6394000d007 100644
--- a/htdocs/expensereport/card.php
+++ b/htdocs/expensereport/card.php
@@ -66,13 +66,13 @@ $vatrate = GETPOST('vatrate', 'alpha');
$ref = GETPOST("ref", 'alpha');
$comments = GETPOST('comments', 'restricthtml');
$fk_c_type_fees = GETPOST('fk_c_type_fees', 'int');
-$socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('socid_id', 'int');
+$socid = GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('socid_id', 'int');
$childids = $user->getAllChildIds(1);
if (getDolGlobalString('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH')) {
if (empty($date_start)) {
- $date_start = dol_mktime(0, 0, 0, (int) dol_print_date(dol_now(), '%m'), 1, (int) dol_print_date(dol_now(), '%Y'));
+ $date_start = dol_mktime(0, 0, 0, (int) dol_print_date(dol_now(), '%m'), 1, (int) dol_print_date(dol_now(), '%Y'));
}
if (empty($date_end)) {
@@ -422,7 +422,9 @@ if (empty($reshook)) {
$emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM;
if ($emailTo && $emailFrom) {
- $filename = array(); $filedir = array(); $mimetype = array();
+ $filename = array();
+ $filedir = array();
+ $mimetype = array();
// SUBJECT
$societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
@@ -529,7 +531,9 @@ if (empty($reshook)) {
$emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM;
if ($emailFrom && $emailTo) {
- $filename = array(); $filedir = array(); $mimetype = array();
+ $filename = array();
+ $filedir = array();
+ $mimetype = array();
// SUBJECT
$societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
@@ -645,7 +649,9 @@ if (empty($reshook)) {
$emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM;
if ($emailFrom && $emailTo) {
- $filename = array(); $filedir = array(); $mimetype = array();
+ $filename = array();
+ $filedir = array();
+ $mimetype = array();
// SUBJECT
$societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
@@ -753,7 +759,9 @@ if (empty($reshook)) {
$emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM;
if ($emailFrom && $emailTo) {
- $filename = array(); $filedir = array(); $mimetype = array();
+ $filename = array();
+ $filedir = array();
+ $mimetype = array();
// SUBJECT
$societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
@@ -867,7 +875,9 @@ if (empty($reshook)) {
$emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM;
if ($emailFrom && $emailTo) {
- $filename = array(); $filedir = array(); $mimetype = array();
+ $filename = array();
+ $filedir = array();
+ $mimetype = array();
// SUBJECT
$societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
@@ -1047,7 +1057,9 @@ if (empty($reshook)) {
$emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM;
if ($emailFrom && $emailTo) {
- $filename = array(); $filedir = array(); $mimetype = array();
+ $filename = array();
+ $filedir = array();
+ $mimetype = array();
// SUBJECT
$societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
@@ -1527,17 +1539,17 @@ if ($action == 'create') {
if (!in_array($object->fk_user_author, $user->getAllChildIds(1))) {
if (!$user->hasRight('expensereport', 'readall') && !$user->hasRight('expensereport', 'lire_tous')
&& (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || !$user->hasRight('expensereport', 'writeall_advance'))) {
- print load_fiche_titre($langs->trans('TripCard'), '', 'trip');
+ print load_fiche_titre($langs->trans('TripCard'), '', 'trip');
- print '';
- print $langs->trans('NotUserRightToView');
- print '
';
+ print '';
+ print $langs->trans('NotUserRightToView');
+ print '
';
- // End of page
- llxFooter();
- $db->close();
+ // End of page
+ llxFooter();
+ $db->close();
- exit;
+ exit;
}
}
@@ -1941,7 +1953,8 @@ if ($action == 'create') {
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
- $i = 0; $totalpaid = 0;
+ $i = 0;
+ $totalpaid = 0;
while ($i < $num) {
$objp = $db->fetch_object($resql);
@@ -2037,7 +2050,8 @@ if ($action == 'create') {
print '';
if (!empty($object->lines)) {
- $i = 0; $total = 0;
+ $i = 0;
+ $total = 0;
print ''.$langs->trans("Date").' ';
$datepaid = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST("reday", 'int'), GETPOST("reyear", 'int'));
- $datepayment = ($datepaid == '' ? (!getDolGlobalString('MAIN_AUTOFILL_DATE') ?-1 : '') : $datepaid);
+ $datepayment = ($datepaid == '' ? (!getDolGlobalString('MAIN_AUTOFILL_DATE') ? -1 : '') : $datepaid);
print $form->selectDate($datepayment, '', '', '', 0, "add_payment", 1, 1);
print " ";
print ' ';
diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php
index 49fbfd41140..17a3bd5b311 100644
--- a/htdocs/expensereport/stats/index.php
+++ b/htdocs/expensereport/stats/index.php
@@ -95,7 +95,8 @@ $px1 = new DolGraph();
$mesg = $px1->isGraphKo();
if (!$mesg) {
$px1->SetData($data);
- $i = $startyear; $legend = array();
+ $i = $startyear;
+ $legend = array();
while ($i <= $endyear) {
$legend[] = $i;
$i++;
@@ -125,7 +126,8 @@ $px2 = new DolGraph();
$mesg = $px2->isGraphKo();
if (!$mesg) {
$px2->SetData($data);
- $i = $startyear; $legend = array();
+ $i = $startyear;
+ $legend = array();
while ($i <= $endyear) {
$legend[] = $i;
$i++;
@@ -169,7 +171,8 @@ $px3 = new DolGraph();
$mesg = $px3->isGraphKo();
if (!$mesg) {
$px3->SetData($data);
- $i = $startyear; $legend = array();
+ $i = $startyear;
+ $legend = array();
while ($i <= $endyear) {
$legend[] = $i;
$i++;
diff --git a/htdocs/expensereport/tpl/expensereport_addfile.tpl.php b/htdocs/expensereport/tpl/expensereport_addfile.tpl.php
index 98dc10e3894..6aea588a506 100644
--- a/htdocs/expensereport/tpl/expensereport_addfile.tpl.php
+++ b/htdocs/expensereport/tpl/expensereport_addfile.tpl.php
@@ -1,4 +1,5 @@
'."\n";
print '';
diff --git a/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php b/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php
index c1de14df018..689d95801d4 100644
--- a/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php
+++ b/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php
@@ -1,4 +1,5 @@
'."\n";
@@ -22,8 +23,9 @@ if (!getDolGlobalString('EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES')) {
// Select image section
print '';
//print ''.$langs->trans("AttachTheNewLineToTheDocument").' ';
- $modulepart = 'expensereport'; $maxheightmini = 48;
- $relativepath = (!empty($object->ref) ?dol_sanitizeFileName($object->ref) : '').'/';
+ $modulepart = 'expensereport';
+ $maxheightmini = 48;
+ $relativepath = (!empty($object->ref) ? dol_sanitizeFileName($object->ref) : '').'/';
$filei = 0;
// Loop on each attached file
foreach ($arrayoffiles as $file) {
diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php
index ca471aec96c..2a741b7a18f 100644
--- a/htdocs/exports/class/export.class.php
+++ b/htdocs/exports/class/export.class.php
@@ -223,7 +223,7 @@ class Export
$this->array_export_sql_order[$i] = (!empty($module->export_sql_order[$r]) ? $module->export_sql_order[$r] : null);
//$this->array_export_sql[$i]=$module->export_sql[$r];
- dol_syslog(get_class($this)."::load_arrays loaded for module ".$modulename." with index ".$i.", dataset=".$module->export_code[$r].", nb of fields=".(!empty($module->export_fields_code[$r]) ?count($module->export_fields_code[$r]) : ''));
+ dol_syslog(get_class($this)."::load_arrays loaded for module ".$modulename." with index ".$i.", dataset=".$module->export_code[$r].", nb of fields=".(!empty($module->export_fields_code[$r]) ? count($module->export_fields_code[$r]) : ''));
$i++;
// }
}
@@ -890,7 +890,8 @@ class Export
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
// Commit or rollback
@@ -938,7 +939,7 @@ class Export
// recover export name / recuperation du nom de l'export
$string = $langs->trans($this->array_export_label[$keyModel]);
- print ($string != $this->array_export_label[$keyModel] ? $string : $this->array_export_label[$keyModel]);
+ print($string != $this->array_export_label[$keyModel] ? $string : $this->array_export_label[$keyModel]);
print ' ';
//print ''.$obj->type.$keyModel.' ';
print ''.str_replace(',', ' , ', $obj->field).' ';
diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php
index e72635dcffa..ca400b0057a 100644
--- a/htdocs/exports/export.php
+++ b/htdocs/exports/export.php
@@ -135,7 +135,7 @@ $array_filtervalue = isset($_SESSION["export_filtered_fields"]) ? $_SESSION["exp
$datatoexport = GETPOST("datatoexport", "aZ09");
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
-$step = GETPOST("step", "int") ?GETPOST("step", "int") : 1;
+$step = GETPOST("step", "int") ? GETPOST("step", "int") : 1;
$export_name = GETPOST("export_name", "alphanohtml");
$hexa = GETPOST("hexa", "alpha");
$exportmodelid = GETPOST("exportmodelid", "int");
diff --git a/htdocs/externalsite/admin/index.php b/htdocs/externalsite/admin/index.php
index 37a61ff47ca..a51a1b9dafa 100644
--- a/htdocs/externalsite/admin/index.php
+++ b/htdocs/externalsite/admin/index.php
@@ -102,7 +102,7 @@ print " ";
print '';
print ''.$langs->trans("Label")." ";
-print " global->EXTERNALSITE_LABEL))."\" size=\"12\"> ";
+print " global->EXTERNALSITE_LABEL))."\" size=\"12\"> ";
print "".$langs->trans("ExampleMyMenuEntry")." ";
print " ";
@@ -115,7 +115,7 @@ $exturl = GETPOST('EXTERNALSITE_URL', 'restricthtml');
$exturl = dol_string_onlythesehtmltags($exturl, 1, 1, 0, 1, array(), 1);
$exturl = dol_string_onlythesehtmlattributes($exturl);
-print (GETPOSTISSET('EXTERNALSITE_URL') ? $exturl : (!getDolGlobalString('EXTERNALSITE_URL') ? '' : $conf->global->EXTERNALSITE_URL));
+print(GETPOSTISSET('EXTERNALSITE_URL') ? $exturl : (!getDolGlobalString('EXTERNALSITE_URL') ? '' : $conf->global->EXTERNALSITE_URL));
print '';
print "http://localhost/myurl/";
print " https://wikipedia.org/";
diff --git a/htdocs/fichinter/agenda.php b/htdocs/fichinter/agenda.php
index 0b1ecaa9592..75f64f56c5e 100644
--- a/htdocs/fichinter/agenda.php
+++ b/htdocs/fichinter/agenda.php
@@ -239,7 +239,7 @@ if ($object->id > 0) {
$cachekey = 'count_events_fichinter_'.$object->id;
$nbEvent = dol_getcache($cachekey);
- print_barre_liste($langs->trans("ActionsOnFicheInter").(is_numeric($nbEvent) ? '('.$nbEvent.') ': ''), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1);
+ print_barre_liste($langs->trans("ActionsOnFicheInter").(is_numeric($nbEvent) ? '('.$nbEvent.') ' : ''), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1);
//print_barre_liste($langs->trans("ActionsOnPropal"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1);
// List of all actions
diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php
index 00034a6e7fa..14ee149c8e4 100644
--- a/htdocs/fichinter/card-rec.php
+++ b/htdocs/fichinter/card-rec.php
@@ -51,7 +51,7 @@ if (isModEnabled('contrat')) {
$langs->loadLangs(array("interventions", "admin", "compta", "bills"));
// Security check
-$id = (GETPOST('fichinterid', 'int') ?GETPOST('fichinterid', 'int') : GETPOST('id', 'int'));
+$id = (GETPOST('fichinterid', 'int') ? GETPOST('fichinterid', 'int') : GETPOST('id', 'int'));
$ref = GETPOST('ref', 'alpha');
$date_next_execution = GETPOST('date_next_execution', 'alpha');
$action = GETPOST('action', 'aZ09');
@@ -147,7 +147,7 @@ if ($action == 'add') {
$reday = GETPOST('reday');
$rehour = GETPOST('rehour');
$remin = GETPOST('remin');
- $nb_gen_max = (GETPOST('nb_gen_max', 'int') ?GETPOST('nb_gen_max', 'int') : 0);
+ $nb_gen_max = (GETPOST('nb_gen_max', 'int') ? GETPOST('nb_gen_max', 'int') : 0);
if (GETPOST('frequency')) {
if (empty($reyear) || empty($remonth) || empty($reday)) {
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->trans("Date")), null, 'errors');
@@ -343,7 +343,7 @@ if ($action == 'create') {
if (isModEnabled('project')) {
$formproject = new FormProjets($db);
print " ".$langs->trans("Project")." ";
- $projectid = GETPOST('projectid') ?GETPOST('projectid') : $object->fk_project;
+ $projectid = GETPOST('projectid') ? GETPOST('projectid') : $object->fk_project;
$numprojet = $formproject->select_projects($object->thirdparty->id, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, '');
print ' transnoentitiesnoconv('toolTipFrequency'));
print " ";
print ' ';
- print $form->selectarray('unit_frequency', array('d'=>$langs->trans('Day'), 'm'=>$langs->trans('Month'), 'y'=>$langs->trans('Year')), (GETPOST('unit_frequency') ?GETPOST('unit_frequency') : 'm'));
+ print $form->selectarray('unit_frequency', array('d'=>$langs->trans('Day'), 'm'=>$langs->trans('Month'), 'y'=>$langs->trans('Year')), (GETPOST('unit_frequency') ? GETPOST('unit_frequency') : 'm'));
print " ";
// First date of execution for cron
diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php
index 040396f59f7..f004f25b290 100644
--- a/htdocs/fichinter/card.php
+++ b/htdocs/fichinter/card.php
@@ -68,7 +68,7 @@ $backtopage = GETPOST('backtopage', 'alpha');
$mesg = GETPOST('msg', 'alpha');
$origin = GETPOST('origin', 'alpha');
-$originid = (GETPOST('originid', 'int') ?GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility
+$originid = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility
$note_public = GETPOST('note_public', 'restricthtml');
$note_private = GETPOST('note_private', 'restricthtml');
$lineid = GETPOST('line_id', 'int');
@@ -280,7 +280,8 @@ if (empty($reshook)) {
$element = $subelement = 'commande';
}
if ($element == 'propal') {
- $element = 'comm/propal'; $subelement = 'propal';
+ $element = 'comm/propal';
+ $subelement = 'propal';
}
if ($element == 'contract') {
$element = $subelement = 'contrat';
@@ -858,7 +859,8 @@ if ($action == 'create') {
$element = $subelement = 'commande';
}
if ($element == 'propal') {
- $element = 'comm/propal'; $subelement = 'propal';
+ $element = 'comm/propal';
+ $subelement = 'propal';
}
if ($element == 'contract') {
$element = $subelement = 'contrat';
@@ -1407,10 +1409,10 @@ if ($action == 'create') {
print '';
// Date
- print ''.(!getDolGlobalString('FICHINTER_DATE_WITHOUT_HOUR') ?dol_print_date($db->jdate($objp->date_intervention), 'dayhour') : dol_print_date($db->jdate($objp->date_intervention), 'day')).' ';
+ print ''.(!getDolGlobalString('FICHINTER_DATE_WITHOUT_HOUR') ? dol_print_date($db->jdate($objp->date_intervention), 'dayhour') : dol_print_date($db->jdate($objp->date_intervention), 'day')).' ';
// Duration
- print ''.(!getDolGlobalString('FICHINTER_WITHOUT_DURATION') ?convertSecondToTime($objp->duree) : '').' ';
+ print ''.(!getDolGlobalString('FICHINTER_WITHOUT_DURATION') ? convertSecondToTime($objp->duree) : '').' ';
print "\n";
@@ -1622,7 +1624,7 @@ if ($action == 'create') {
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
- // modified by hook
+ // modified by hook
if (empty($reshook)) {
if ($user->socid == 0) {
if ($action != 'editdescription' && ($action != 'presend')) {
diff --git a/htdocs/fichinter/class/api_interventions.class.php b/htdocs/fichinter/class/api_interventions.class.php
index c2fca55e16b..98bc0dc9117 100644
--- a/htdocs/fichinter/class/api_interventions.class.php
+++ b/htdocs/fichinter/class/api_interventions.class.php
@@ -34,7 +34,6 @@ require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
*/
class Interventions extends DolibarrApi
{
-
/**
* @var array $FIELDS Mandatory fields, checked when create and update object
*/
diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php
index 9c1e2ec4ab7..0c9b1add075 100644
--- a/htdocs/fichinter/class/fichinter.class.php
+++ b/htdocs/fichinter/class/fichinter.class.php
@@ -428,7 +428,9 @@ class Fichinter extends CommonObject
// Call trigger
$result = $this->call_trigger('FICHINTER_MODIFY', $user);
if ($result < 0) {
- $error++; $this->db->rollback(); return -1;
+ $error++;
+ $this->db->rollback();
+ return -1;
}
// End call triggers
}
@@ -632,13 +634,15 @@ class Fichinter extends CommonObject
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'ficheinter/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->error = $this->db->lasterror();
+ $error++;
+ $this->error = $this->db->lasterror();
}
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'ficheinter/".$this->db->escape($this->newref)."'";
$sql .= " WHERE filepath = 'ficheinter/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->error = $this->db->lasterror();
+ $error++;
+ $this->error = $this->db->lasterror();
}
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
@@ -911,7 +915,7 @@ class Fichinter extends CommonObject
$label = $langs->trans("ShowIntervention");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
@@ -1063,7 +1067,9 @@ class Fichinter extends CommonObject
// Call trigger
$result = $this->call_trigger('FICHINTER_DELETE', $user);
if ($result < 0) {
- $error++; $this->db->rollback(); return -1;
+ $error++;
+ $this->db->rollback();
+ return -1;
}
// End call triggers
}
@@ -1928,7 +1934,9 @@ class FichinterLigne extends CommonObjectLine
// Call trigger
$result = $this->call_trigger('LINEFICHINTER_DELETE', $user);
if ($result < 0) {
- $error++; $this->db->rollback(); return -1;
+ $error++;
+ $this->db->rollback();
+ return -1;
}
// End call triggers
}
diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php
index 51e97cb7bfe..98f2e077395 100644
--- a/htdocs/fichinter/document.php
+++ b/htdocs/fichinter/document.php
@@ -106,7 +106,7 @@ if ($object->id) {
// Build file list
- $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
+ $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC), 1);
$totalsize = 0;
foreach ($filearray as $key => $file) {
$totalsize += $file['size'];
diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php
index 313c5eb43cb..2fe1067d8af 100644
--- a/htdocs/fichinter/index.php
+++ b/htdocs/fichinter/index.php
@@ -115,7 +115,9 @@ if ($resql) {
print '';
print ''.$langs->trans("Statistics").' - '.$langs->trans("Interventions").' '."\n";
$listofstatus = array(Fichinter::STATUS_DRAFT, Fichinter::STATUS_VALIDATED);
- if (getDolGlobalString('FICHINTER_CLASSIFY_BILLED')) $listofstatus[] = Fichinter::STATUS_BILLED;
+ if (getDolGlobalString('FICHINTER_CLASSIFY_BILLED')) {
+ $listofstatus[] = Fichinter::STATUS_BILLED;
+ }
foreach ($listofstatus as $status) {
$dataseries[] = array($fichinterstatic->LibStatut($status, 1), (isset($vals[$status]) ? (int) $vals[$status] : 0));
diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php
index 4feef8d2ea6..ee1dbec70d7 100644
--- a/htdocs/fichinter/list.php
+++ b/htdocs/fichinter/list.php
@@ -56,24 +56,24 @@ $massaction = GETPOST('massaction', 'alpha');
$show_files = GETPOST('show_files', 'int');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array');
-$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'interventionlist';
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'interventionlist';
$mode = GETPOST('mode', 'alpha');
-$search_ref = GETPOST('search_ref') ?GETPOST('search_ref', 'alpha') : GETPOST('search_inter', 'alpha');
+$search_ref = GETPOST('search_ref') ? GETPOST('search_ref', 'alpha') : GETPOST('search_inter', 'alpha');
$search_ref_client = GETPOST('search_ref_client', 'alpha');
$search_company = GETPOST('search_company', 'alpha');
$search_desc = GETPOST('search_desc', 'alpha');
$search_projet_ref = GETPOST('search_projet_ref', 'alpha');
$search_contrat_ref = GETPOST('search_contrat_ref', 'alpha');
$search_status = GETPOST('search_status', 'alpha');
-$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
+$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$optioncss = GETPOST('optioncss', 'alpha');
$socid = GETPOST('socid', 'int');
$diroutputmassaction = $conf->ficheinter->dir_output.'/temp/massgeneration/'.$user->id;
// Load variable for pagination
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
diff --git a/htdocs/fichinter/stats/index.php b/htdocs/fichinter/stats/index.php
index 21a82d46e79..f834d32694f 100644
--- a/htdocs/fichinter/stats/index.php
+++ b/htdocs/fichinter/stats/index.php
@@ -92,7 +92,8 @@ $px1 = new DolGraph();
$mesg = $px1->isGraphKo();
if (!$mesg) {
$px1->SetData($data);
- $i = $startyear; $legend = array();
+ $i = $startyear;
+ $legend = array();
while ($i <= $endyear) {
$legend[] = $i;
$i++;
@@ -127,7 +128,8 @@ $px2 = new DolGraph();
$mesg = $px2->isGraphKo();
if (!$mesg) {
$px2->SetData($data);
- $i = $startyear; $legend = array();
+ $i = $startyear;
+ $legend = array();
while ($i <= $endyear) {
$legend[] = $i;
$i++;
@@ -161,7 +163,8 @@ $px3 = new DolGraph();
$mesg = $px3->isGraphKo();
if (!$mesg) {
$px3->SetData($data);
- $i = $startyear; $legend = array();
+ $i = $startyear;
+ $legend = array();
while ($i <= $endyear) {
$legend[] = $i;
$i++;
@@ -288,7 +291,7 @@ foreach ($data as $val) {
print '';
print ' 0 ? '&socid='.$socid : '').($userid > 0 ? '&userid='.$userid : '').'">'.$year.' ';
print ''.$val['nb'].' ';
- print ''.(isset($val['nb_diff']) ? round($val['nb_diff']): "0").'% ';
+ print ''.(isset($val['nb_diff']) ? round($val['nb_diff']) : "0").'% ';
print ''.price(price2num($val['total'], 'MT'), 1).' ';
print ''.(isset($val['total_diff']) ? round($val['total_diff']) : "0").'% ';
print ''.price(price2num($val['avg'], 'MT'), 1).' ';
diff --git a/htdocs/fichinter/tpl/linkedobjectblock.tpl.php b/htdocs/fichinter/tpl/linkedobjectblock.tpl.php
index 8da01bb4f8f..8d5d8e85c17 100644
--- a/htdocs/fichinter/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/fichinter/tpl/linkedobjectblock.tpl.php
@@ -41,8 +41,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
$trclass = 'oddeven';
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) {
$trclass .= ' liste_sub_total';
- }
- ?>
+ } ?>
trans("Intervention"); ?>
getNomUrl(1); ?>
diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php
index fbf0ead05e8..4c14225d68d 100644
--- a/htdocs/fourn/card.php
+++ b/htdocs/fourn/card.php
@@ -852,7 +852,7 @@ if ($object->id > 0) {
print '';
print ''.$facturestatic->getNomUrl(1).' ';
print $obj->ref_supplier ? ' - '.$obj->ref_supplier : '';
- print ($obj->label ? ' - ' : '').dol_trunc($obj->label, 14);
+ print($obj->label ? ' - ' : '').dol_trunc($obj->label, 14);
print ' ';
print ''.dol_print_date($facturestatic->date, 'day').' ';
print ''.price($facturestatic->total_ttc).' ';
@@ -895,7 +895,7 @@ if ($object->id > 0) {
if ($object->status == 1) {
print dolGetButtonAction('', $langs->trans('AddSupplierProposal'), 'default', DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&socid='.$object->id, '');
} else {
- print dolGetButtonAction($langs->trans('ThirdPartyIsClosed'), $langs->trans('AddSupplierProposal'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
+ print dolGetButtonAction($langs->trans('ThirdPartyIsClosed'), $langs->trans('AddSupplierProposal'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
}
}
@@ -904,7 +904,7 @@ if ($object->id > 0) {
if ($object->status == 1) {
print dolGetButtonAction('', $langs->trans('AddSupplierOrderShort'), 'default', DOL_URL_ROOT.'/fourn/commande/card.php?action=create&token='.newToken().'&socid='.$object->id, '');
} else {
- print dolGetButtonAction($langs->trans('ThirdPartyIsClosed'), $langs->trans('AddSupplierOrderShort'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
+ print dolGetButtonAction($langs->trans('ThirdPartyIsClosed'), $langs->trans('AddSupplierOrderShort'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
}
}
@@ -914,10 +914,10 @@ if ($object->id > 0) {
// Company is open
print dolGetButtonAction('', $langs->trans('CreateInvoiceForThisSupplier'), 'default', DOL_URL_ROOT.'/fourn/commande/list.php?socid='.$object->id.'&search_billed=0&autoselectall=1', '');
} else {
- print dolGetButtonAction('', $langs->trans('CreateInvoiceForThisCustomer'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
+ print dolGetButtonAction('', $langs->trans('CreateInvoiceForThisCustomer'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
}
} else {
- print dolGetButtonAction($langs->trans("NoOrdersToInvoice").' ('.$langs->trans("WithReceptionFinished").')', $langs->trans('CreateInvoiceForThisCustomer'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
+ print dolGetButtonAction($langs->trans("NoOrdersToInvoice").' ('.$langs->trans("WithReceptionFinished").')', $langs->trans('CreateInvoiceForThisCustomer'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
}
}
@@ -926,7 +926,7 @@ if ($object->id > 0) {
if ($object->status == 1) {
print dolGetButtonAction('', $langs->trans('AddBill'), 'default', DOL_URL_ROOT.'/fourn/facture/card.php?action=create&socid='.$object->id, '');
} else {
- print dolGetButtonAction($langs->trans('ThirdPartyIsClosed'), $langs->trans('AddBill'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
+ print dolGetButtonAction($langs->trans('ThirdPartyIsClosed'), $langs->trans('AddBill'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
}
}
@@ -935,7 +935,7 @@ if ($object->id > 0) {
if ($user->hasRight("agenda", "myactions", "create")) {
print dolGetButtonAction('', $langs->trans('AddAction'), 'default', DOL_URL_ROOT.'/comm/action/card.php?action=create&socid='.$object->id, '');
} else {
- print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('AddAction'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
+ print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('AddAction'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
}
}
}
diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php
index 34748782386..36adfccc488 100644
--- a/htdocs/fourn/class/api_supplier_orders.class.php
+++ b/htdocs/fourn/class/api_supplier_orders.class.php
@@ -623,27 +623,27 @@ class SupplierOrders extends DolibarrApi
);
}
- /**
+ /**
* Receives the order, dispatches products.
- *
+ *
* Example:
* {
* "closeopenorder": 1,
* "comment": "",
- * "lines": [{
- * "id": 14,
- * "fk_product": 112,
- * "qty": 18,
- * "warehouse": 1,
- * "price": 114,
- * "comment": "",
- * "eatby": 0,
- * "sellby": 0,
- * "batch": 0,
- * "notrigger": 0
- * }]
+ * "lines": [{
+ * "id": 14,
+ * "fk_product": 112,
+ * "qty": 18,
+ * "warehouse": 1,
+ * "price": 114,
+ * "comment": "",
+ * "eatby": 0,
+ * "sellby": 0,
+ * "batch": 0,
+ * "notrigger": 0
+ * }]
* }
- *
+ *
* @param int $id Order ID
* @param integer $closeopenorder Close order if everything is received {@required false}
* @param string $comment Comment {@required false}
@@ -673,17 +673,19 @@ class SupplierOrders extends DolibarrApi
foreach ($lines as $line) {
$lineObj =(object) $line;
- $result=$this->order->dispatchProduct(DolibarrApiAccess::$user,
- $lineObj->fk_product,
- $lineObj->qty,
- $lineObj->warehouse,
- $lineObj->price,
- $lineObj->comment,
- $lineObj->eatby,
- $lineObj->sellby,
- $lineObj->batch,
- $lineObj->id,
- $lineObj->notrigger);
+ $result=$this->order->dispatchProduct(
+ DolibarrApiAccess::$user,
+ $lineObj->fk_product,
+ $lineObj->qty,
+ $lineObj->warehouse,
+ $lineObj->price,
+ $lineObj->comment,
+ $lineObj->eatby,
+ $lineObj->sellby,
+ $lineObj->batch,
+ $lineObj->id,
+ $lineObj->notrigger
+ );
if ($result < 0) {
throw new RestException(500, 'Error dispatch order line '.$line->id.': '.$this->order->error);
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index d3467458bb0..e38c2062f70 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -662,29 +662,29 @@ class CommandeFournisseur extends CommonOrder
$result = 0;
if ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && ($user->hasRight("fournisseur", "commande", "creer") || $user->hasRight("supplier_order", "creer")))
|| (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight("fournisseur", "supplier_order_advance", "validate"))) {
- $this->db->begin();
+ $this->db->begin();
- // Definition of supplier order numbering model name
- $soc = new Societe($this->db);
- $soc->fetch($this->fourn_id);
+ // Definition of supplier order numbering model name
+ $soc = new Societe($this->db);
+ $soc->fetch($this->fourn_id);
- // Check if object has a temporary ref
+ // Check if object has a temporary ref
if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) { // empty should not happened, but when it occurs, the test save life
$num = $this->getNextNumRef($soc);
} else {
$num = $this->ref;
}
- $this->newref = dol_sanitizeFileName($num);
+ $this->newref = dol_sanitizeFileName($num);
- $sql = 'UPDATE '.$this->db->prefix()."commande_fournisseur";
- $sql .= " SET ref='".$this->db->escape($num)."',";
- $sql .= " fk_statut = ".((int) self::STATUS_VALIDATED).",";
- $sql .= " date_valid='".$this->db->idate(dol_now())."',";
- $sql .= " fk_user_valid = ".((int) $user->id);
- $sql .= " WHERE rowid = ".((int) $this->id);
- $sql .= " AND fk_statut = ".((int) self::STATUS_DRAFT);
+ $sql = 'UPDATE '.$this->db->prefix()."commande_fournisseur";
+ $sql .= " SET ref='".$this->db->escape($num)."',";
+ $sql .= " fk_statut = ".((int) self::STATUS_VALIDATED).",";
+ $sql .= " date_valid='".$this->db->idate(dol_now())."',";
+ $sql .= " fk_user_valid = ".((int) $user->id);
+ $sql .= " WHERE rowid = ".((int) $this->id);
+ $sql .= " AND fk_statut = ".((int) self::STATUS_DRAFT);
- $resql = $this->db->query($sql);
+ $resql = $this->db->query($sql);
if (!$resql) {
dol_print_error($this->db);
$error++;
@@ -709,13 +709,15 @@ class CommandeFournisseur extends CommonOrder
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'fournisseur/commande/".$this->db->escape($this->ref)."' and entity = ".((int) $conf->entity);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->error = $this->db->lasterror();
+ $error++;
+ $this->error = $this->db->lasterror();
}
$sql = 'UPDATE '.$this->db->prefix()."ecm_files set filepath = 'fournisseur/commande/".$this->db->escape($this->newref)."'";
$sql .= " WHERE filepath = 'fournisseur/commande/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->error = $this->db->lasterror();
+ $error++;
+ $this->error = $this->db->lasterror();
}
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
@@ -957,7 +959,7 @@ class CommandeFournisseur extends CommonOrder
$label = $langs->trans("ShowOrder");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.'"';
}
@@ -1143,8 +1145,7 @@ class CommandeFournisseur extends CommonOrder
$comment = ' (first level)';
}
}
- } else // request a second level approval
- {
+ } else { // request a second level approval
$sql .= " date_approve2='".$this->db->idate($now)."',";
$sql .= " fk_user_approve2 = ".((int) $user->id);
if (empty($this->user_approve_id)) {
@@ -1216,8 +1217,7 @@ class CommandeFournisseur extends CommonOrder
if (empty($secondlevel)) { // standard or first level approval
$this->date_approve = $now;
$this->user_approve_id = $user->id;
- } else // request a second level approval
- {
+ } else { // request a second level approval
$this->date_approve2 = $now;
$this->user_approve_id2 = $user->id;
}
@@ -1487,7 +1487,7 @@ class CommandeFournisseur extends CommonOrder
$sql .= ", '".$this->db->escape($this->location_incoterms)."'";
$sql .= ", ".(int) $this->fk_multicurrency;
$sql .= ", '".$this->db->escape($this->multicurrency_code)."'";
- $sql .= ", ".(double) $this->multicurrency_tx;
+ $sql .= ", ".(float) $this->multicurrency_tx;
$sql .= ")";
dol_syslog(get_class($this)."::create", LOG_DEBUG);
@@ -1528,7 +1528,7 @@ class CommandeFournisseur extends CommonOrder
$line->array_options,
$line->fk_unit,
$line->special_code
- );
+ );
if ($result < 0) {
dol_syslog(get_class($this)."::create ".$this->error, LOG_WARNING); // do not use dol_print_error here as it may be a functionnal error
$this->db->rollback();
@@ -1561,8 +1561,7 @@ class CommandeFournisseur extends CommonOrder
$error++;
}
}
- } else // Old behaviour, if linked_object has only one link per type, so is something like array('contract'=>id1))
- {
+ } else { // Old behaviour, if linked_object has only one link per type, so is something like array('contract'=>id1))
$origin_id = $tmp_origin_id;
$ret = $this->add_object_linked($origin, $origin_id);
if (!$ret) {
@@ -3433,7 +3432,8 @@ class CommandeFournisseur extends CommonOrder
$ret = $supplierorderdispatch->fetchAll('', '', 0, 0, $filter);
if ($ret < 0) {
- $this->error = $supplierorderdispatch->error; $this->errors = $supplierorderdispatch->errors;
+ $this->error = $supplierorderdispatch->error;
+ $this->errors = $supplierorderdispatch->errors;
return $ret;
} else {
if (is_array($supplierorderdispatch->lines) && count($supplierorderdispatch->lines) > 0) {
diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php
index 1c1c2c501a5..1143dbac139 100644
--- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php
@@ -227,7 +227,8 @@ class CommandeFournisseurDispatch extends CommonObjectLine
dol_syslog(__METHOD__, LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
if (!$error) {
@@ -405,7 +406,8 @@ class CommandeFournisseurDispatch extends CommonObjectLine
dol_syslog(__METHOD__);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
if (!$error) {
@@ -484,7 +486,8 @@ class CommandeFournisseurDispatch extends CommonObjectLine
dol_syslog(__METHOD__);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
}
@@ -722,7 +725,7 @@ class CommandeFournisseurDispatch extends CommonObjectLine
$line->batch = $obj->batch;
$line->eatby = $this->db->jdate($obj->eatby);
$line->sellby = $this->db->jdate($obj->sellby);
- $line->fetch_optionals();
+ $line->fetch_optionals();
$this->lines[$line->id] = $line;
}
diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php
index e84a70845f2..ac232bd2eb1 100644
--- a/htdocs/fourn/class/fournisseur.facture-rec.class.php
+++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php
@@ -429,8 +429,7 @@ class FactureFournisseurRec extends CommonInvoice
$error++;
}
}
- } else // Old behaviour, if linked_object has only one link per type, so is something like array('contract'=>id1))
- {
+ } else { // Old behaviour, if linked_object has only one link per type, so is something like array('contract'=>id1))
$origin_id = $tmp_origin_id;
$ret = $this->add_object_linked($origin, $origin_id);
if (!$ret) {
@@ -492,7 +491,9 @@ class FactureFournisseurRec extends CommonInvoice
$sql .= " titre = '" . (!empty($this->title) ? $this->db->escape($this->title) : "")."'," ;
$sql .= " ref_supplier = '". (!empty($this->ref_supplier) ? $this->db->escape($this->ref_supplier) : "")."',";
$sql .= " entity = ". (!empty($this->entity) ? ((int) $this->entity) : 1) . ',';
- if ($this->fk_soc > 0) $sql .= " fk_soc = ". (int) $this->fk_soc. ',';
+ if ($this->fk_soc > 0) {
+ $sql .= " fk_soc = ". (int) $this->fk_soc. ',';
+ }
$sql .= " suspended = ". (!empty($this->suspended) ? ((int) $this->suspended) : 0) . ',';
$sql .= " libelle = ". (!empty($this->libelle) ? "'".$this->db->escape($this->libelle)."'" : 'NULL') . ",";
$sql .= " vat_src_code = ". (!empty($this->vat_src_code) ? "'".$this->db->escape($this->vat_src_code)."'" : 'NULL') . ',';
@@ -1719,8 +1720,7 @@ class FactureFournisseurRec extends CommonInvoice
$line->total_ttc = 59.8;
$line->total_tva = 9.8;
$line->remise_percent = 50;
- } else // (product line)
- {
+ } else { // (product line)
$prodid = mt_rand(1, $num_prods);
$line->fk_product = $prodids[$prodid];
$line->total_ht = 100;
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 3b519001927..49aafcf9378 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -580,7 +580,7 @@ class FactureFournisseur extends CommonInvoice
$sql .= ", '".$this->db->escape($this->location_incoterms)."'";
$sql .= ", ".(int) $this->fk_multicurrency;
$sql .= ", '".$this->db->escape($this->multicurrency_code)."'";
- $sql .= ", ".(double) $this->multicurrency_tx;
+ $sql .= ", ".(float) $this->multicurrency_tx;
$sql .= ", ".($this->fk_facture_source ? ((int) $this->fk_facture_source) : "null");
$sql .= ", ".(isset($this->fk_fac_rec_source) ? $this->fk_fac_rec_source : "NULL");
$sql .= ")";
@@ -615,8 +615,7 @@ class FactureFournisseur extends CommonInvoice
$error++;
}
}
- } else // Old behaviour, if linked_object has only one link per type, so is something like array('contract'=>id1))
- {
+ } else { // Old behaviour, if linked_object has only one link per type, so is something like array('contract'=>id1))
$origin_id = $tmp_origin_id;
$ret = $this->add_object_linked($origin, $origin_id);
if (!$ret) {
@@ -1201,8 +1200,11 @@ class FactureFournisseur extends CommonInvoice
$this->fk_facture_source = trim($this->fk_facture_source);
}
if (isset($this->fk_project)) {
- if (empty($this->fk_project)) $this->fk_project = null;
- else $this->fk_project = intval($this->fk_project);
+ if (empty($this->fk_project)) {
+ $this->fk_project = null;
+ } else {
+ $this->fk_project = intval($this->fk_project);
+ }
}
if (isset($this->cond_reglement_id)) {
$this->cond_reglement_id = trim($this->cond_reglement_id);
@@ -1786,7 +1788,9 @@ class FactureFournisseur extends CommonInvoice
$array_to_check = array('IDPROF1', 'IDPROF2', 'IDPROF3', 'IDPROF4', 'IDPROF5', 'IDPROF6', 'EMAIL', 'ACCOUNTANCY_CODE_SUPPLIER');
foreach ($array_to_check as $key) {
$keymin = strtolower($key);
- if ($keymin == 'accountancy_code_supplier') $keymin = 'code_compta_fournisseur';
+ if ($keymin == 'accountancy_code_supplier') {
+ $keymin = 'code_compta_fournisseur';
+ }
if (!property_exists($this->thirdparty, $keymin)) {
continue;
}
@@ -1899,13 +1903,15 @@ class FactureFournisseur extends CommonInvoice
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'fournisseur/facture/".get_exdir($this->id, 2, 0, 0, $this, 'invoice_supplier').$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->error = $this->db->lasterror();
+ $error++;
+ $this->error = $this->db->lasterror();
}
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'fournisseur/facture/".get_exdir($this->id, 2, 0, 0, $this, 'invoice_supplier').$this->db->escape($this->newref)."'";
$sql .= " WHERE filepath = 'fournisseur/facture/".get_exdir($this->id, 2, 0, 0, $this, 'invoice_supplier').$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->error = $this->db->lasterror();
+ $error++;
+ $this->error = $this->db->lasterror();
}
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
@@ -2440,11 +2446,11 @@ class FactureFournisseur extends CommonInvoice
$line->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0];
$line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2];
- $line->total_ht = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_ht) : $total_ht);
- $line->total_tva = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_tva) : $total_tva);
+ $line->total_ht = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($total_ht) : $total_ht);
+ $line->total_tva = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($total_tva) : $total_tva);
$line->total_localtax1 = $total_localtax1;
$line->total_localtax2 = $total_localtax2;
- $line->total_ttc = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_ttc) : $total_ttc);
+ $line->total_ttc = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($total_ttc) : $total_ttc);
$line->fk_product = $idproduct;
$line->product_type = $product_type;
@@ -2891,7 +2897,7 @@ class FactureFournisseur extends CommonInvoice
$label = $langs->trans("ShowSupplierInvoice");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.'"';
}
@@ -2904,7 +2910,7 @@ class FactureFournisseur extends CommonInvoice
$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'"'), 0, 0, $notooltip ? 0 : 1);
}
if ($withpicto != 2) {
- $result .= ($max ?dol_trunc($ref, $max) : $ref);
+ $result .= ($max ? dol_trunc($ref, $max) : $ref);
}
$result .= $linkend;
@@ -2931,14 +2937,14 @@ class FactureFournisseur extends CommonInvoice
return $result;
}
- /**
- * Return next reference of supplier invoice not already used (or last reference)
- * according to numbering module defined into constant INVOICE_SUPPLIER_ADDON_NUMBER
- *
- * @param Societe $soc Thirdparty object
- * @param string $mode 'next' for next value or 'last' for last value
- * @return string free ref or last ref
- */
+ /**
+ * Return next reference of supplier invoice not already used (or last reference)
+ * according to numbering module defined into constant INVOICE_SUPPLIER_ADDON_NUMBER
+ *
+ * @param Societe $soc Thirdparty object
+ * @param string $mode 'next' for next value or 'last' for last value
+ * @return string free ref or last ref
+ */
public function getNextNumRef($soc, $mode = 'next')
{
global $db, $langs, $conf;
@@ -3829,8 +3835,11 @@ class SupplierInvoiceLine extends CommonObjectLine
$sql .= ", pu_ttc = ".price2num($this->pu_ttc);
$sql .= ", qty = ".price2num($this->qty);
$sql .= ", remise_percent = ".price2num($this->remise_percent);
- if ($this->fk_remise_except > 0) $sql .= ", fk_remise_except=".((int) $this->fk_remise_except);
- else $sql .= ", fk_remise_except=null";
+ if ($this->fk_remise_except > 0) {
+ $sql .= ", fk_remise_except=".((int) $this->fk_remise_except);
+ } else {
+ $sql .= ", fk_remise_except=null";
+ }
$sql .= ", vat_src_code = '".$this->db->escape(empty($this->vat_src_code) ? '' : $this->vat_src_code)."'";
$sql .= ", tva_tx = ".price2num($this->tva_tx);
$sql .= ", localtax1_tx = ".price2num($this->localtax1_tx);
@@ -4021,7 +4030,7 @@ class SupplierInvoiceLine extends CommonObjectLine
$sql .= " ".price2num($this->remise_percent).",";
$sql .= ' '.(!empty($this->fk_remise_except) ? ((int) $this->fk_remise_except) : "null").',';
$sql .= " ".price2num($this->subprice).",";
- $sql .= " ".(!empty($this->qty) ?price2num($this->total_ttc / $this->qty) : price2num($this->total_ttc)).",";
+ $sql .= " ".(!empty($this->qty) ? price2num($this->total_ttc / $this->qty) : price2num($this->total_ttc)).",";
$sql .= " ".(!empty($this->date_start) ? "'".$this->db->idate($this->date_start)."'" : "null").",";
$sql .= " ".(!empty($this->date_end) ? "'".$this->db->idate($this->date_end)."'" : "null").",";
$sql .= ' '.(!empty($this->fk_code_ventilation) ? $this->fk_code_ventilation : 0).',';
diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php
index a46ee5ea8c5..7c5fc258fa7 100644
--- a/htdocs/fourn/class/fournisseur.product.class.php
+++ b/htdocs/fourn/class/fournisseur.product.class.php
@@ -555,7 +555,7 @@ class ProductFournisseur extends Product
if ($result < 0) {
$error++;
}
- // End call triggers
+ // End call triggers
if (empty($error)) {
$this->db->commit();
@@ -998,7 +998,7 @@ class ProductFournisseur extends Product
$out .= ''.$langs->trans("Supplier").' ';
$out .= ''.$langs->trans("SupplierRef").' ';
foreach ($productFournList as $productFourn) {
- $out .= ''.($showunitprice ?price($productFourn->fourn_unitprice * (1 - $productFourn->fourn_remise_percent / 100) - $productFourn->fourn_remise) : '').' ';
+ $out .= ''.($showunitprice ? price($productFourn->fourn_unitprice * (1 - $productFourn->fourn_remise_percent / 100) - $productFourn->fourn_remise) : '').' ';
$out .= ''.($showunitprice ? $productFourn->fourn_qty : '').' ';
$out .= ''.$productFourn->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).' ';
$out .= ''.$productFourn->fourn_ref.' ';
diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php
index 49f877d0bf3..83cba47fddb 100644
--- a/htdocs/fourn/class/paiementfourn.class.php
+++ b/htdocs/fourn/class/paiementfourn.class.php
@@ -269,7 +269,7 @@ class PaiementFourn extends Paiement
if (is_numeric($amount) && $amount <> 0) {
$amount = price2num($amount);
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'paiementfourn_facturefourn (fk_facturefourn, fk_paiementfourn, amount, multicurrency_amount, multicurrency_code, multicurrency_tx)';
- $sql .= " VALUES (".((int) $facid).", ".((int) $this->id).", ".((float) $amount).', '.((float) $this->multicurrency_amounts[$key]).', '.($currencyofpayment ? "'".$this->db->escape($currencyofpayment)."'" : 'NULL').', '.(!empty($currencytxofpayment) ? (double) $currencytxofpayment : 1).')';
+ $sql .= " VALUES (".((int) $facid).", ".((int) $this->id).", ".((float) $amount).', '.((float) $this->multicurrency_amounts[$key]).', '.($currencyofpayment ? "'".$this->db->escape($currencyofpayment)."'" : 'NULL').', '.(!empty($currencytxofpayment) ? (float) $currencytxofpayment : 1).')';
$resql = $this->db->query($sql);
if ($resql) {
$invoice = new FactureFournisseur($this->db);
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index 1294a8c1275..0d2d65416da 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -180,7 +180,7 @@ if ($reshook < 0) {
}
if (empty($reshook)) {
- $backurlforlist = DOL_URL_ROOT.'/fourn/commande/list.php'.($socid > 0 ? '?socid='.((int) $socid) : '');
+ $backurlforlist = DOL_URL_ROOT.'/fourn/commande/list.php'.($socid > 0 ? '?socid='.((int) $socid) : '');
if (empty($backtopage) || ($cancel && empty($id))) {
if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
@@ -682,8 +682,9 @@ if (empty($reshook)) {
$newlang = '';
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
- if (GETPOST('lang_id', 'aZ09'))
+ if (GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
+ }
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
@@ -1262,7 +1263,8 @@ if (empty($reshook)) {
$element = $subelement = $origin;
$classname = ucfirst($subelement);
if ($origin == 'propal' || $origin == 'proposal') {
- $element = 'comm/propal'; $subelement = 'propal';
+ $element = 'comm/propal';
+ $subelement = 'propal';
$classname = 'Propal';
}
if ($origin == 'order' || $origin == 'commande') {
@@ -1595,7 +1597,8 @@ if ($action == 'create') {
if ($origin == 'propal' || $origin == 'proposal') {
$classname = 'Propal';
- $element = 'comm/propal'; $subelement = 'propal';
+ $element = 'comm/propal';
+ $subelement = 'propal';
}
if ($origin == 'order' || $origin == 'commande') {
$classname = 'Commande';
@@ -1634,7 +1637,7 @@ if ($action == 'create') {
$demand_reason_id = (!empty($objectsrc->demand_reason_id) ? $objectsrc->demand_reason_id : (!empty($soc->demand_reason_id) ? $soc->demand_reason_id : 0));
//$remise_percent = (!empty($objectsrc->remise_percent) ? $objectsrc->remise_percent : (!empty($soc->remise_supplier_percent) ? $soc->remise_supplier_percent : 0));
//$remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0));
- $dateinvoice = !getDolGlobalString('MAIN_AUTOFILL_DATE') ?-1 : '';
+ $dateinvoice = !getDolGlobalString('MAIN_AUTOFILL_DATE') ? -1 : '';
$datedelivery = (!empty($objectsrc->delivery_date) ? $objectsrc->delivery_date : '');
@@ -2030,7 +2033,7 @@ if ($action == 'create') {
// Confirmation to delete line
if ($action == 'ask_deleteline') {
- $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
+ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
}
$parameters = array('formConfirm' => $formconfirm, 'lineid'=>$lineid);
@@ -2441,7 +2444,9 @@ if ($action == 'create') {
// Add free products/services form
global $forceall, $senderissupplier, $dateSelector, $inputalsopricewithtax;
- $forceall = 1; $dateSelector = 0; $inputalsopricewithtax = 1;
+ $forceall = 1;
+ $dateSelector = 0;
+ $inputalsopricewithtax = 1;
$senderissupplier = 2; // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum.
if (getDolGlobalString('SUPPLIER_ORDER_WITH_PREDEFINED_PRICES_ONLY')) {
$senderissupplier = 1;
@@ -2461,9 +2466,12 @@ if ($action == 'create') {
$parameters = array();
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
- if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
- if (empty($reshook))
+ if ($reshook < 0) {
+ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
+ }
+ if (empty($reshook)) {
$object->formAddObjectLine(1, $societe, $mysoc);
+ }
}
}
print '
';
@@ -2715,7 +2723,7 @@ if ($action == 'create') {
$action = 'presend';
}
- if ($action != 'createorder' && $action != 'presend' ) {
+ if ($action != 'createorder' && $action != 'presend') {
print '';
// Generated documents
diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php
index 051671a75d4..88e919881f6 100644
--- a/htdocs/fourn/commande/dispatch.php
+++ b/htdocs/fourn/commande/dispatch.php
@@ -793,7 +793,7 @@ if ($id > 0 || !empty($ref)) {
if (!$objp->fk_product > 0) {
$nbfreeproduct++;
} else {
- $alreadydispatched = isset($products_dispatched[$objp->rowid])?$products_dispatched[$objp->rowid]:0;
+ $alreadydispatched = isset($products_dispatched[$objp->rowid]) ? $products_dispatched[$objp->rowid] : 0;
$remaintodispatch = price2num($objp->qty - ((float) $alreadydispatched), 5); // Calculation of dispatched
if ($remaintodispatch < 0 && !getDolGlobalString('SUPPLIER_ORDER_ALLOW_NEGATIVE_QTY_FOR_SUPPLIER_ORDER_RETURN')) {
$remaintodispatch = 0;
@@ -1020,9 +1020,9 @@ if ($id > 0 || !empty($ref)) {
// Warehouse
print '
';
if (count($listwarehouses) > 1) {
- print $formproduct->selectWarehouses(GETPOST("entrepot".$suffix) ?GETPOST("entrepot".$suffix) : ($objp->fk_default_warehouse ? $objp->fk_default_warehouse : ''), "entrepot".$suffix, '', 1, 0, $objp->fk_product, '', 1, 0, null, 'csswarehouse'.$suffix);
+ print $formproduct->selectWarehouses(GETPOST("entrepot".$suffix) ? GETPOST("entrepot".$suffix) : ($objp->fk_default_warehouse ? $objp->fk_default_warehouse : ''), "entrepot".$suffix, '', 1, 0, $objp->fk_product, '', 1, 0, null, 'csswarehouse'.$suffix);
} elseif (count($listwarehouses) == 1) {
- print $formproduct->selectWarehouses(GETPOST("entrepot".$suffix) ?GETPOST("entrepot".$suffix) : ($objp->fk_default_warehouse ? $objp->fk_default_warehouse : ''), "entrepot".$suffix, '', 0, 0, $objp->fk_product, '', 1, 0, null, 'csswarehouse'.$suffix);
+ print $formproduct->selectWarehouses(GETPOST("entrepot".$suffix) ? GETPOST("entrepot".$suffix) : ($objp->fk_default_warehouse ? $objp->fk_default_warehouse : ''), "entrepot".$suffix, '', 0, 0, $objp->fk_product, '', 1, 0, null, 'csswarehouse'.$suffix);
} else {
$langs->load("errors");
print $langs->trans("ErrorNoWarehouseDefined");
@@ -1297,9 +1297,9 @@ if ($id > 0 || !empty($ref)) {
print ' ';
if ($action == 'editline' && $lineid == $objp->dispatchlineid) {
if (count($listwarehouses) > 1) {
- print $formproduct->selectWarehouses(GETPOST("fk_entrepot") ?GETPOST("fk_entrepot") : ($objp->warehouse_id ? $objp->warehouse_id : ''), "fk_entrepot", '', 1, 0, $objp->fk_product, '', 1, 1, null, 'csswarehouse');
+ print $formproduct->selectWarehouses(GETPOST("fk_entrepot") ? GETPOST("fk_entrepot") : ($objp->warehouse_id ? $objp->warehouse_id : ''), "fk_entrepot", '', 1, 0, $objp->fk_product, '', 1, 1, null, 'csswarehouse');
} elseif (count($listwarehouses) == 1) {
- print $formproduct->selectWarehouses(GETPOST("fk_entrepot") ?GETPOST("fk_entrepot") : ($objp->warehouse_id ? $objp->warehouse_id : ''), "fk_entrepot", '', 0, 0, $objp->fk_product, '', 1, 1, null, 'csswarehouse');
+ print $formproduct->selectWarehouses(GETPOST("fk_entrepot") ? GETPOST("fk_entrepot") : ($objp->warehouse_id ? $objp->warehouse_id : ''), "fk_entrepot", '', 0, 0, $objp->fk_product, '', 1, 1, null, 'csswarehouse');
} else {
$langs->load("errors");
print $langs->trans("ErrorNoWarehouseDefined");
diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php
index 0fe81c8cd91..abf7f8e9009 100644
--- a/htdocs/fourn/commande/document.php
+++ b/htdocs/fourn/commande/document.php
@@ -115,7 +115,7 @@ if ($object->id > 0) {
// Build file list
- $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
+ $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC), 1);
$totalsize = 0;
foreach ($filearray as $key => $file) {
$totalsize += $file['size'];
diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php
index 911ab227fe9..5ed3c6838cb 100644
--- a/htdocs/fourn/commande/info.php
+++ b/htdocs/fourn/commande/info.php
@@ -43,7 +43,7 @@ $id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOST("page", 'int');
@@ -66,7 +66,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (!getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECTS') ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECTS));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (!getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECTS') ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECTS));
}
$search_rowid = GETPOST('search_rowid');
$search_agenda_label = GETPOST('search_agenda_label');
diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php
index ec681e28f07..652d73c1992 100644
--- a/htdocs/fourn/commande/list.php
+++ b/htdocs/fourn/commande/list.php
@@ -55,7 +55,7 @@ $massaction = GETPOST('massaction', 'alpha');
$show_files = GETPOST('show_files', 'int');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array');
-$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'supplierorderlist';
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'supplierorderlist';
$mode = GETPOST('mode', 'alpha');
// Search Criteria
@@ -95,7 +95,7 @@ $search_date_approve_endyear = GETPOST('search_date_approve_endyear', 'int');
$search_date_approve_start = dol_mktime(0, 0, 0, $search_date_approve_startmonth, $search_date_approve_startday, $search_date_approve_startyear); // Use tzserver
$search_date_approve_end = dol_mktime(23, 59, 59, $search_date_approve_endmonth, $search_date_approve_endday, $search_date_approve_endyear);
-$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
+$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$search_product_category = GETPOST('search_product_category', 'int');
$search_ref = GETPOST('search_ref', 'alpha');
@@ -136,7 +136,7 @@ if (GETPOSTISARRAY('search_status')) {
$diroutputmassaction = $conf->fournisseur->commande->dir_output.'/temp/massgeneration/'.$user->id;
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
@@ -239,7 +239,8 @@ $permissiontoapprove = ($user->hasRight("fournisseur", "commande", "approuver")
*/
if (GETPOST('cancel', 'alpha')) {
- $action = 'list'; $massaction = '';
+ $action = 'list';
+ $massaction = '';
}
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createsupplierbills') {
$massaction = '';
@@ -357,8 +358,11 @@ if (empty($reshook)) {
}
}
- if (!$error) $db->commit();
- else $db->rollback();
+ if (!$error) {
+ $db->commit();
+ } else {
+ $db->rollback();
+ }
}
}
diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php
index b787126280e..cacddcd4865 100644
--- a/htdocs/fourn/commande/note.php
+++ b/htdocs/fourn/commande/note.php
@@ -38,7 +38,7 @@ if (isModEnabled('project')) {
$langs->loadLangs(array("suppliers", "orders", "companies", "stocks"));
// Get Parameters
-$id = GETPOST('facid', 'int') ?GETPOST('facid', 'int') : GETPOST('id', 'int');
+$id = GETPOST('facid', 'int') ? GETPOST('facid', 'int') : GETPOST('id', 'int');
$ref = GETPOST('ref');
$action = GETPOST('action', 'aZ09');
diff --git a/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php
index 547c9246ea5..8bb4b3442bb 100644
--- a/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php
@@ -42,8 +42,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
$trclass = 'oddeven';
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) {
$trclass .= ' liste_sub_total';
- }
- ?>
+ } ?>
trans("SupplierOrder"); ?>
getNomUrl(1); ?>
@@ -61,7 +60,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
}
if (count($linkedObjectBlock) > 1) {
?>
-
+
trans("Total"); ?>
diff --git a/htdocs/fourn/contact.php b/htdocs/fourn/contact.php
index 74adf684a65..b1baeabee38 100644
--- a/htdocs/fourn/contact.php
+++ b/htdocs/fourn/contact.php
@@ -57,7 +57,7 @@ if (!$sortorder) {
if (!$sortfield) {
$sortfield = "p.name";
}
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
/*
diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php
index 95012881e4b..d508a32abc5 100644
--- a/htdocs/fourn/facture/card-rec.php
+++ b/htdocs/fourn/facture/card-rec.php
@@ -907,8 +907,12 @@ if ($action == 'create') {
print dol_get_fiche_head(null, '', '', 0);
$rowspan = 4;
- if (isModEnabled('project')) $rowspan++;
- if ($object->fk_account > 0) $rowspan++;
+ if (isModEnabled('project')) {
+ $rowspan++;
+ }
+ if ($object->fk_account > 0) {
+ $rowspan++;
+ }
print '';
@@ -944,8 +948,8 @@ if ($action == 'create') {
$substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%Y') . ')';
$substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'y'), '%Y') . ')';
// Only on template invoices
- $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen") . (isset($object->date_when)?' (' . $langs->trans("Example") . ': ' .dol_print_date($object->date_when, 'dayhour') . ')':'');
- $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen") . (isset($object->date_when)?' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency), 'dayhour') . ')':'');
+ $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen") . (isset($object->date_when) ? ' (' . $langs->trans("Example") . ': ' .dol_print_date($object->date_when, 'dayhour') . ')' : '');
+ $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen") . (isset($object->date_when) ? ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency), 'dayhour') . ')' : '');
$substitutionarray['__INVOICE_COUNTER_CURRENT__'] = $langs->trans("Count");
$substitutionarray['__INVOICE_COUNTER_MAX__'] = $langs->trans("MaxPeriodNumber");
@@ -1589,9 +1593,12 @@ if ($action == 'create') {
$parameters = array();
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
- if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
- if (empty($reshook))
+ if ($reshook < 0) {
+ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
+ }
+ if (empty($reshook)) {
global $senderissupplier;
+ }
$senderissupplier = 2;
$object->formAddObjectLine(0, $object->thirdparty, $mysoc); // No date selector for template invoice
}
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index 54c0e4afe75..1f338317902 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -1082,13 +1082,15 @@ if (empty($reshook)) {
$element = $subelement = 'commande';
}
if ($element == 'propal') {
- $element = 'comm/propal'; $subelement = 'propal';
+ $element = 'comm/propal';
+ $subelement = 'propal';
}
if ($element == 'contract') {
$element = $subelement = 'contrat';
}
if ($element == 'order_supplier') {
- $element = 'fourn'; $subelement = 'fournisseur.commande';
+ $element = 'fourn';
+ $subelement = 'fournisseur.commande';
}
if ($element == 'project') {
$element = 'projet';
@@ -2075,13 +2077,15 @@ if ($action == 'create') {
$element = $subelement = 'commande';
}
if ($element == 'propal') {
- $element = 'comm/propal'; $subelement = 'propal';
+ $element = 'comm/propal';
+ $subelement = 'propal';
}
if ($element == 'contract') {
$element = $subelement = 'contrat';
}
if ($element == 'order_supplier') {
- $element = 'fourn'; $subelement = 'fournisseur.commande';
+ $element = 'fourn';
+ $subelement = 'fournisseur.commande';
}
require_once DOL_DOCUMENT_ROOT.'/'.$element.'/class/'.$subelement.'.class.php';
@@ -2175,7 +2179,7 @@ if ($action == 'create') {
$datetmp = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
$dateinvoice = ($datetmp == '' ? (!getDolGlobalString('MAIN_AUTOFILL_DATE') ? -1 : '') : $datetmp);
$datetmp = dol_mktime(12, 0, 0, GETPOST('echmonth', 'int'), GETPOST('echday', 'int'), GETPOST('echyear', 'int'));
- $datedue = ($datetmp == '' ?-1 : $datetmp);
+ $datedue = ($datetmp == '' ? -1 : $datetmp);
// Replicate extrafields
$objectsrc->fetch_optionals();
@@ -2189,7 +2193,7 @@ if ($action == 'create') {
$datetmp = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
$dateinvoice = ($datetmp == '' ? (getDolGlobalInt('MAIN_AUTOFILL_DATE') ? '' : -1) : $datetmp);
$datetmp = dol_mktime(12, 0, 0, GETPOST('echmonth', 'int'), GETPOST('echday', 'int'), GETPOST('echyear', 'int'));
- $datedue = ($datetmp == '' ?-1 : $datetmp);
+ $datedue = ($datetmp == '' ? -1 : $datetmp);
if (isModEnabled("multicurrency") && !empty($soc->multicurrency_code)) {
$currency_code = $soc->multicurrency_code;
@@ -2377,7 +2381,7 @@ if ($action == 'create') {
// Standard invoice
print '';
@@ -2699,7 +2703,7 @@ if ($action == 'create') {
print ''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).' ';
print '';
print img_picto('', 'currency', 'class="pictofixedwidth"');
- print $form->selectMultiCurrency((GETPOSTISSET('multicurrency_code') ?GETPOST('multicurrency_code', 'alpha') : $currency_code), 'multicurrency_code');
+ print $form->selectMultiCurrency((GETPOSTISSET('multicurrency_code') ? GETPOST('multicurrency_code', 'alpha') : $currency_code), 'multicurrency_code');
print ' ';
}
@@ -2746,7 +2750,7 @@ if ($action == 'create') {
// Public note
print ''.$langs->trans('NotePublic').' ';
print '';
- $doleditor = new DolEditor('note_public', (GETPOSTISSET('note_public') ?GETPOST('note_public', 'restricthtml') : $note_public), '', 80, 'dolibarr_notes', 'In', 0, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PUBLIC') ? 0 : 1, ROWS_3, '90%');
+ $doleditor = new DolEditor('note_public', (GETPOSTISSET('note_public') ? GETPOST('note_public', 'restricthtml') : $note_public), '', 80, 'dolibarr_notes', 'In', 0, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PUBLIC') ? 0 : 1, ROWS_3, '90%');
print $doleditor->Create(1);
print ' ';
// print ' ';
@@ -2755,7 +2759,7 @@ if ($action == 'create') {
// Private note
print ''.$langs->trans('NotePrivate').' ';
print '';
- $doleditor = new DolEditor('note_private', (GETPOSTISSET('note_private') ?GETPOST('note_private', 'restricthtml') : $note_private), '', 80, 'dolibarr_notes', 'In', 0, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PRIVATE') ? 0 : 1, ROWS_3, '90%');
+ $doleditor = new DolEditor('note_private', (GETPOSTISSET('note_private') ? GETPOST('note_private', 'restricthtml') : $note_private), '', 80, 'dolibarr_notes', 'In', 0, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PRIVATE') ? 0 : 1, ROWS_3, '90%');
print $doleditor->Create(1);
print ' ';
// print ' ';
@@ -2992,7 +2996,7 @@ if ($action == 'create') {
$value = ' ';
} else {
$label = $object->type == FactureFournisseur::TYPE_CREDIT_NOTE ? $langs->trans("SelectWarehouseForStockDecrease") : $langs->trans("SelectWarehouseForStockIncrease");
- $value = $formproduct->selectWarehouses(GETPOST('idwarehouse') ?GETPOST('idwarehouse') : 'ifone', 'idwarehouse', '', 1);
+ $value = $formproduct->selectWarehouses(GETPOST('idwarehouse') ? GETPOST('idwarehouse') : 'ifone', 'idwarehouse', '', 1);
}
$formquestion = array(
array('type' => 'other', 'name' => 'idwarehouse', 'label' => $label, 'value' => $value)
@@ -3024,7 +3028,7 @@ if ($action == 'create') {
$value = ' ';
} else {
$label = $object->type == FactureFournisseur::TYPE_CREDIT_NOTE ? $langs->trans("SelectWarehouseForStockIncrease") : $langs->trans("SelectWarehouseForStockDecrease");
- $value = $formproduct->selectWarehouses(GETPOST('idwarehouse') ?GETPOST('idwarehouse') : 'ifone', 'idwarehouse', '', 1);
+ $value = $formproduct->selectWarehouses(GETPOST('idwarehouse') ? GETPOST('idwarehouse') : 'ifone', 'idwarehouse', '', 1);
}
$formquestion = array(
array('type' => 'other', 'name' => 'idwarehouse', 'label' => $label, 'value' => $value)
@@ -3120,7 +3124,7 @@ if ($action == 'create') {
$selectwarehouse .= ' ';
} else {
$label = $object->type == FactureFournisseur::TYPE_CREDIT_NOTE ? $langs->trans("SelectWarehouseForStockIncrease") : $langs->trans("SelectWarehouseForStockDecrease");
- $selectwarehouse .= $formproduct->selectWarehouses(GETPOST('idwarehouse') ?GETPOST('idwarehouse') : 'ifone', 'idwarehouse', '', 1);
+ $selectwarehouse .= $formproduct->selectWarehouses(GETPOST('idwarehouse') ? GETPOST('idwarehouse') : 'ifone', 'idwarehouse', '', 1);
}
$selectwarehouse .= '';
@@ -3585,12 +3589,14 @@ if ($action == 'create') {
$sign = - 1;
}
- $nbrows = 9; $nbcols = 3;
+ $nbrows = 9;
+ $nbcols = 3;
if (isModEnabled('project')) {
$nbrows++;
}
if (isModEnabled("banque")) {
- $nbrows++; $nbcols++;
+ $nbrows++;
+ $nbcols++;
}
if (isModEnabled('incoterm')) {
$nbrows++;
@@ -3931,7 +3937,9 @@ if ($action == 'create') {
print '';
global $forceall, $senderissupplier, $dateSelector, $inputalsopricewithtax;
- $forceall = 1; $dateSelector = 0; $inputalsopricewithtax = 1;
+ $forceall = 1;
+ $dateSelector = 0;
+ $inputalsopricewithtax = 1;
$senderissupplier = 2; // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum.
//if (!empty($conf->global->SUPPLIER_INVOICE_WITH_NOPRICEDEFINED)) $senderissupplier=2;
if (getDolGlobalString('SUPPLIER_INVOICE_WITH_PREDEFINED_PRICES_ONLY')) {
@@ -3952,9 +3960,12 @@ if ($action == 'create') {
$parameters = array();
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
- if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
- if (empty($reshook))
+ if ($reshook < 0) {
+ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
+ }
+ if (empty($reshook)) {
$object->formAddObjectLine(1, $societe, $mysoc);
+ }
}
}
@@ -3975,7 +3986,7 @@ if ($action == 'create') {
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
- // modified by hook
+ // modified by hook
if (empty($reshook)) {
// Modify a validated invoice with no payments
if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $action != 'confirm_edit' && $object->getSommePaiement() == 0 && $usercancreate) {
@@ -4066,10 +4077,10 @@ if ($action == 'create') {
// Classify paid
if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && (
- ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE && $object->type != FactureFournisseur::TYPE_DEPOSIT && ($resteapayer <= 0 || (getDolGlobalString('SUPPLIER_INVOICE_CAN_SET_PAID_EVEN_IF_PARTIALLY_PAID') && $object->total_ttc == $resteapayer))) ||
+ ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE && $object->type != FactureFournisseur::TYPE_DEPOSIT && ($resteapayer <= 0 || (getDolGlobalString('SUPPLIER_INVOICE_CAN_SET_PAID_EVEN_IF_PARTIALLY_PAID') && $object->total_ttc == $resteapayer))) ||
($object->type == FactureFournisseur::TYPE_CREDIT_NOTE && $resteapayer >= 0) ||
($object->type == FactureFournisseur::TYPE_DEPOSIT && $object->total_ttc > 0 && ($resteapayer == 0 || (getDolGlobalString('SUPPLIER_INVOICE_CAN_SET_PAID_EVEN_IF_PARTIALLY_PAID') && $object->total_ttc == $resteapayer)))
- )
+ )
) {
print 'id.'&action=paid">'.$langs->trans('ClassifyPaid').' ';
}
diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php
index 5e617bc8c91..aa3ebb90761 100644
--- a/htdocs/fourn/facture/document.php
+++ b/htdocs/fourn/facture/document.php
@@ -42,7 +42,7 @@ if (isModEnabled('project')) {
$langs->loadLangs(array('bills', 'other', 'companies'));
-$id = GETPOST('facid', 'int') ?GETPOST('facid', 'int') : GETPOST('id', 'int');
+$id = GETPOST('facid', 'int') ? GETPOST('facid', 'int') : GETPOST('id', 'int');
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
$ref = GETPOST('ref', 'alpha');
@@ -147,7 +147,7 @@ if ($object->id > 0) {
print '
';
// Build file list
- $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
+ $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC), 1);
$totalsize = 0;
foreach ($filearray as $key => $file) {
$totalsize += $file['size'];
diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php
index bea43cd0f9d..284c18cbb81 100644
--- a/htdocs/fourn/facture/info.php
+++ b/htdocs/fourn/facture/info.php
@@ -37,7 +37,7 @@ if (isModEnabled('project')) {
$langs->loadLangs(array("companies", "bills"));
-$id = GETPOST("facid", 'int') ?GETPOST("facid", 'int') : GETPOST("id", 'int');
+$id = GETPOST("facid", 'int') ? GETPOST("facid", 'int') : GETPOST("id", 'int');
$ref = GETPOST("ref", 'alpha');
// Security check
diff --git a/htdocs/fourn/facture/list-rec.php b/htdocs/fourn/facture/list-rec.php
index c48d9b02c93..701cf35814d 100644
--- a/htdocs/fourn/facture/list-rec.php
+++ b/htdocs/fourn/facture/list-rec.php
@@ -50,13 +50,13 @@ $show_files = GETPOST('show_files', 'int');
$confirm = GETPOST('confirm', 'alpha');
$cancel = GETPOST('cancel', 'alpha');
$toselect = GETPOST('toselect', 'array');
-$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'supplierinvoicestemplatelist'; // To manage different context of search
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'supplierinvoicestemplatelist'; // To manage different context of search
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
$socid = GETPOST('socid', 'int');
-$id = (GETPOST('facid', 'int') ?GETPOST('facid', 'int') : GETPOST('id', 'int'));
+$id = (GETPOST('facid', 'int') ? GETPOST('facid', 'int') : GETPOST('id', 'int'));
$lineid = GETPOST('lineid', 'int');
$ref = GETPOST('ref', 'alpha');
if ($user->socid) {
@@ -96,7 +96,7 @@ $search_unit_frequency = GETPOST('search_unit_frequency', 'alpha');
$search_nb_gen_done = GETPOST('search_nb_gen_done', 'aplha');
$search_status = GETPOST('search_status', 'int');
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
@@ -237,7 +237,7 @@ if (empty($reshook)) {
}
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
|| GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
- $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
+ $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
}
// Mass actions
@@ -933,7 +933,7 @@ while ($i < $imaxinloop) {
}
if (!empty($arrayfields['f.frequency']['checked'])) {
print '';
- print ($objp->frequency > 0 ? $objp->frequency : '');
+ print($objp->frequency > 0 ? $objp->frequency : '');
print ' ';
if (!$i) {
$totalarray['nbfield']++;
@@ -946,7 +946,7 @@ while ($i < $imaxinloop) {
} else {
$dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year"));
}
- print ($objp->frequency > 0 ? $dur[$objp->unit_frequency] : '');
+ print($objp->frequency > 0 ? $dur[$objp->unit_frequency] : '');
print '';
if (!$i) {
$totalarray['nbfield']++;
@@ -954,7 +954,7 @@ while ($i < $imaxinloop) {
}
if (!empty($arrayfields['f.nb_gen_done']['checked'])) {
print '';
- print ($objp->frequency > 0 ? $objp->nb_gen_done.($objp->nb_gen_max > 0 ? ' / '.$objp->nb_gen_max : '') : ''.$langs->trans('NA').' ');
+ print($objp->frequency > 0 ? $objp->nb_gen_done.($objp->nb_gen_max > 0 ? ' / '.$objp->nb_gen_max : '') : ''.$langs->trans('NA').' ');
print ' ';
if (!$i) {
$totalarray['nbfield']++;
@@ -963,7 +963,7 @@ while ($i < $imaxinloop) {
// Date last generation
if (!empty($arrayfields['f.date_last_gen']['checked'])) {
print '';
- print ($objp->frequency > 0 ? dol_print_date($db->jdate($objp->date_last_gen), 'day') : ''.$langs->trans('NA').' ');
+ print($objp->frequency > 0 ? dol_print_date($db->jdate($objp->date_last_gen), 'day') : ''.$langs->trans('NA').' ');
print ' ';
if (!$i) {
$totalarray['nbfield']++;
@@ -973,7 +973,7 @@ while ($i < $imaxinloop) {
if (!empty($arrayfields['f.date_when']['checked'])) {
print '';
print '';
- print ($objp->frequency ? ($supplierinvoicerectmp->isMaxNbGenReached() ? '
' : '').dol_print_date($db->jdate($objp->date_when), 'day').($supplierinvoicerectmp->isMaxNbGenReached() ? ' ' : '') : '
'.$langs->trans('NA').' ');
+ print($objp->frequency ? ($supplierinvoicerectmp->isMaxNbGenReached() ? '
' : '').dol_print_date($db->jdate($objp->date_when), 'day').($supplierinvoicerectmp->isMaxNbGenReached() ? ' ' : '') : '
'.$langs->trans('NA').' ');
if (!$supplierinvoicerectmp->isMaxNbGenReached()) {
if (!$objp->suspended && $objp->frequency > 0 && $db->jdate($objp->date_when) && $db->jdate($objp->date_when) < $now) {
print img_warning($langs->trans("Late"));
diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php
index 6c47343a2ee..dda72e38976 100644
--- a/htdocs/fourn/facture/list.php
+++ b/htdocs/fourn/facture/list.php
@@ -57,14 +57,14 @@ $show_files = GETPOST('show_files', 'int');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array');
$optioncss = GETPOST('optioncss', 'alpha');
-$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'supplierinvoicelist';
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'supplierinvoicelist';
$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
-$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
+$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$search_label = GETPOST("search_label", "alpha");
$search_amount_no_tax = GETPOST("search_amount_no_tax", "alpha");
$search_amount_all_tax = GETPOST("search_amount_all_tax", "alpha");
-$search_ref = GETPOST('sf_ref') ?GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha');
+$search_ref = GETPOST('sf_ref') ? GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha');
$search_refsupplier = GETPOST('search_refsupplier', 'alpha');
$search_type = GETPOST('search_type', 'int');
$search_subtype = GETPOST('search_subtype', 'int');
@@ -114,7 +114,7 @@ if ($option == 'late') {
$filter = GETPOST('filtre', 'alpha');
// Load variable for pagination
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
@@ -1850,7 +1850,7 @@ while ($i < $imaxinloop) {
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
$nbLinks = Link::count($db, $facturestatic->element, $facturestatic->id);
$nbTotal = $nbFiles + $nbLinks;
- echo '
'.(empty($nbTotal)? '':$nbTotal).' ';
+ echo '
'.(empty($nbTotal) ? '' : $nbTotal).' ';
if (!$i) {
$totalarray['nbfield']++;
}
@@ -1871,7 +1871,7 @@ while ($i < $imaxinloop) {
}
if (!empty($arrayfields['dynamount_payed']['checked'])) {
- print '
'.(!empty($totalpay) ?price($totalpay, 0, $langs) : '').' '; // TODO Use a denormalized field
+ print '
'.(!empty($totalpay) ? price($totalpay, 0, $langs) : '').' '; // TODO Use a denormalized field
if (!$i) {
$totalarray['nbfield']++;
$totalarray['pos'][$totalarray['nbfield']] = 'totalam';
@@ -1880,7 +1880,7 @@ while ($i < $imaxinloop) {
}
if (!empty($arrayfields['rtp']['checked'])) {
- print '
'.(!empty($remaintopay) ?price($remaintopay, 0, $langs) : ' ').' '; // TODO Use a denormalized field
+ print '
'.(!empty($remaintopay) ? price($remaintopay, 0, $langs) : ' ').' '; // TODO Use a denormalized field
if (!$i) {
$totalarray['nbfield']++;
$totalarray['pos'][$totalarray['nbfield']] = 'rtp';
@@ -1927,7 +1927,7 @@ while ($i < $imaxinloop) {
}
}
if (!empty($arrayfields['multicurrency_dynamount_payed']['checked'])) {
- print '
'.(!empty($multicurrency_totalpay) ?price($multicurrency_totalpay, 0, $langs) : '').' '; // TODO Use a denormalized field
+ print '
'.(!empty($multicurrency_totalpay) ? price($multicurrency_totalpay, 0, $langs) : '').' '; // TODO Use a denormalized field
if (!$i) {
$totalarray['nbfield']++;
}
@@ -1936,7 +1936,7 @@ while ($i < $imaxinloop) {
// Pending amount
if (!empty($arrayfields['multicurrency_rtp']['checked'])) {
print '
';
- print (!empty($multicurrency_remaintopay) ? price($multicurrency_remaintopay, 0, $langs) : '');
+ print(!empty($multicurrency_remaintopay) ? price($multicurrency_remaintopay, 0, $langs) : '');
print ' '; // TODO Use a denormalized field
if (!$i) {
$totalarray['nbfield']++;
diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php
index 00544b0acc9..d275fe0a94e 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -67,7 +67,7 @@ $search_amount = GETPOST('search_amount', 'alpha'); // alpha because we must be
$search_company = GETPOST('search_company', 'alpha');
$search_payment_num = GETPOST('search_payment_num', 'alpha');
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
@@ -386,7 +386,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$result = $object->fetch($facid);
$datefacture = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
- $dateinvoice = ($datefacture == '' ? (!getDolGlobalString('MAIN_AUTOFILL_DATE') ?-1 : '') : $datefacture);
+ $dateinvoice = ($datefacture == '' ? (!getDolGlobalString('MAIN_AUTOFILL_DATE') ? -1 : '') : $datefacture);
$sql = 'SELECT s.nom as name, s.rowid as socid,';
$sql .= ' f.rowid, f.ref, f.ref_supplier, f.total_ttc as total, f.fk_mode_reglement, f.fk_account';
@@ -532,7 +532,8 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$parameters = array('facid'=>$facid, 'ref'=>$ref, 'objcanvas'=>$objcanvas);
$reshook = $hookmanager->executeHooks('paymentsupplierinvoices', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
- $error = $hookmanager->error; $errors = $hookmanager->errors;
+ $error = $hookmanager->error;
+ $errors = $hookmanager->errors;
if (empty($reshook)) {
/*
* All unpaid supplier invoices
@@ -700,8 +701,8 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
if (!empty($conf->use_javascript_ajax)) {
print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $multicurrency_remaintopay)."'");
}
- print '
';
- print '
';
+ print '
';
+ print '
';
} else {
print '
';
print '
';
@@ -757,8 +758,8 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
if (!empty($conf->use_javascript_ajax)) {
print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $remaintopay)."'");
}
- print '
';
- print '
'; // class is requied to be used by javascript callForResult();
+ print '
';
+ print '
'; // class is requied to be used by javascript callForResult();
} else {
print '
';
print '
'; // class is requied to be used by javascript callForResult();
diff --git a/htdocs/fourn/facture/rapport.php b/htdocs/fourn/facture/rapport.php
index 106dc22a5f2..60cf47d3d80 100644
--- a/htdocs/fourn/facture/rapport.php
+++ b/htdocs/fourn/facture/rapport.php
@@ -101,8 +101,8 @@ print load_fiche_titre($titre, '', 'supplier_invoice');
print '
';
-
- ?>
+ print '
'; ?>
">
-
+
';
- print ' ';
- ?>
+ print ' '; ?>
diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php
index 371338d1fde..1f0b87462d0 100644
--- a/htdocs/ftp/index.php
+++ b/htdocs/ftp/index.php
@@ -605,8 +605,8 @@ if (!function_exists('ftp_connect')) {
if (!$ok) {
- print $mesg.' '."\n";
- setEventMessages($mesg, null, 'errors');
+ print $mesg.' '."\n";
+ setEventMessages($mesg, null, 'errors');
}