diff --git a/dev/initdata/import-products.php b/dev/initdata/import-products.php index 942e6f8f5d7..0f4856aefb2 100755 --- a/dev/initdata/import-products.php +++ b/dev/initdata/import-products.php @@ -21,7 +21,7 @@ /** * \file dev/initdata/import-product.php - * \brief Script example to insert products from a csv file. + * \brief Script example to insert products from a csv file. * To purge data, you can have a look at purge-data.php */ @@ -118,22 +118,22 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) { $i++; $errorrecord=0; - + if ($startlinenb && $i < $startlinenb) continue; if ($endlinenb && $i > $endlinenb) continue; - + $nboflines++; - + $produit = new Product($db); $produit->type = 0; $produit->status = 1; $produit->ref = trim($fields[0]); - + print "Process line nb ".$i.", ref ".$produit->ref; $produit->label = trim($fields[2]); $produit->description = trim($fields[4]."\n".($fields[5] ? $fields[5].' x '.$fields[6].' x '.$fields[7] : '')); $produit->volume = price2num($fields[8]); - $produit->volume_unit = 0; + $produit->volume_unit = 0; $produit->weight = price2num($fields[9]); $produit->weight_units = 0; // -3 = g @@ -142,9 +142,9 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) $produit->status = 1; $produit->status_buy = 1; - + $produit->finished = 1; - + $produit->price_min = null; $produit->price_min_ttc = null; $produit->price = price2num($fields[11]); @@ -152,25 +152,25 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) $produit->price_base_type = 'TTC'; $produit->tva_tx = price2num($fields[13]); $produit->tva_npr = 0; - + $produit->cost_price = price2num($fields[16]); - + // Extrafields $produit->array_options['options_ecotaxdeee']=price2num($fields[17]); - + $ret=$produit->create($user); if ($ret < 0) { print " - Error in create result code = ".$ret." - ".$produit->errorsToString(); $errorrecord++; } - else + else { print " - Creation OK with ref ".$produit->ref." - id = ".$ret; } dol_syslog("Add prices"); - + // If we use price level, insert price for each level if (! $errorrecord && 1) { @@ -181,14 +181,14 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in updatePrice result code = ".$ret1." ".$ret2." - ".$produit->errorsToString(); $errorrecord++; } - else + else { print " - updatePrice OK"; } } - + dol_syslog("Add multilangs"); - + // Add alternative languages if (! $errorrecord && 1) { @@ -201,15 +201,15 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in setMultiLangs result code = ".$ret." - ".$produit->errorsToString(); $errorrecord++; } - else + else { print " - setMultiLangs OK"; } } - + print "\n"; - - if ($errorrecord) + + if ($errorrecord) { fwrite($fhandleerr, 'Error on record nb '.$i." - ".$produit->errorsToString()."\n"); $error++; // $errorrecord will be reset diff --git a/dev/initdata/import-users.php b/dev/initdata/import-users.php index 72a006bbe29..c94f74341f6 100755 --- a/dev/initdata/import-users.php +++ b/dev/initdata/import-users.php @@ -21,7 +21,7 @@ /** * \file dev/initdata/import-thirdparties.php - * \brief Script example to insert thirdparties from a csv file. + * \brief Script example to insert thirdparties from a csv file. * To purge data, you can have a look at purge-data.php */ @@ -118,15 +118,15 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) { $i++; $errorrecord=0; - + if ($startlinenb && $i < $startlinenb) continue; if ($endlinenb && $i > $endlinenb) continue; - + $nboflines++; - + $object = new User($db); $object->statut = 1; - + $tmp=explode(' ',$fields[3],2); $object->firstname = trim($tmp[0]); $object->lastname = trim($tmp[1]); @@ -134,23 +134,23 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) else $object->login=strtolower($object->firstname); $object->login=preg_replace('/ /','',$object->login); $object->password = 'init'; - + print "Process line nb ".$i.", login ".$object->login; - + $ret=$object->create($user); if ($ret < 0) { print " - Error in create result code = ".$ret." - ".$object->errorsToString(); $errorrecord++; } - else + else { print " - Creation OK with login ".$object->login." - id = ".$ret; } print "\n"; - - if ($errorrecord) + + if ($errorrecord) { fwrite($fhandleerr, 'Error on record nb '.$i." - ".$object->errorsToString()."\n"); $error++; // $errorrecord will be reset diff --git a/dev/initdemo/updatedemo.php b/dev/initdemo/updatedemo.php index ef37e25c04f..53717314d5f 100755 --- a/dev/initdemo/updatedemo.php +++ b/dev/initdemo/updatedemo.php @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * or see http://www.gnu.org/ - * + * * Get a distant dump file and load it into a mysql database */ @@ -74,7 +74,7 @@ $tables=array( $year=2010; $currentyear=$tmp['year']; -while ($year <= $currentyear) +while ($year <= $currentyear) { //$year=2021; $delta=($currentyear - $year); @@ -84,7 +84,7 @@ while ($year <= $currentyear) { foreach($tables as $tablekey => $tableval) { - print "\nCorrect ".$tablekey." for year ".$year." and move them to current year ".$currentyear." "; + print "\nCorrect ".$tablekey." for year ".$year." and move them to current year ".$currentyear." "; $sql="select rowid from ".MAIN_DB_PREFIX.$tablekey." where ".$tableval[0]." between '".$year."-01-01' and '".$year."-12-31' and ".$tableval[0]." < DATE_ADD(NOW(), INTERVAL -1 YEAR)"; //$sql="select rowid from ".MAIN_DB_PREFIX.$tablekey." where ".$tableval[0]." between '".$year."-01-01' and '".$year."-12-31' and ".$tableval[0]." > NOW()"; $resql = $db->query($sql); @@ -110,14 +110,14 @@ while ($year <= $currentyear) //print $sql2."\n"; $resql2 = $db->query($sql2); if (! $resql2) dol_print_error($db); - } + } $i++; } } else dol_print_error($db); } } - + $year++; } diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index b63ffac6efd..e0b451b1290 100644 --- a/htdocs/comm/mailing/advtargetemailing.php +++ b/htdocs/comm/mailing/advtargetemailing.php @@ -84,11 +84,11 @@ if (empty($template_id)) { $result = $advTarget->fetch($template_id); } -if ($result < 0) +if ($result < 0) { setEventMessages($advTarget->error, $advTarget->errors, 'errors'); -} -else +} +else { if (! empty($advTarget->id)) { $array_query = json_decode($advTarget->filtervalue, true); @@ -225,7 +225,7 @@ if ($action == 'add') { } else { $advTarget->contact_lines = array (); } - + if ((count($advTarget->thirdparty_lines) > 0) || (count($advTarget->contact_lines) > 0)) { // Add targets into database $obj = new mailing_advthirdparties($db); @@ -359,7 +359,7 @@ if ($action == 'savefilter' || $action == 'createfilter') { setEventMessages($advTarget->error, $advTarget->errors, 'errors'); } } elseif ($action == 'savefilter') { - + $result = $advTarget->update($user); if ($result < 0) { setEventMessages($advTarget->error, $advTarget->errors, 'errors'); @@ -465,9 +465,9 @@ if ($object->fetch($id) >= 0) { // Show email selectors if ($object->statut == 0 && $user->rights->mailing->creer) { - + include DOL_DOCUMENT_ROOT . '/core/tpl/advtarget.tpl.php'; - + } } diff --git a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php index cd49ca863e6..724e0bcce15 100644 --- a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php @@ -57,7 +57,7 @@ foreach($linkedObjectBlock as $key => $objectlink) global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) { $url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$objectlink->id; - print ' '; + print ' '; } ?> diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 2499176b58b..c09aaad16e8 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -45,7 +45,7 @@ * Cut ticket partially * Open cash drawer * Activate buzzer - * + * * Code which can be placed everywhere * Print QR Code * Print date AAAA-MM-DD @@ -94,7 +94,7 @@ require_once DOL_DOCUMENT_ROOT .'/includes/mike42/escpos-php/Escpos.php'; - + /** * Class to manage Receipt Printers */ @@ -300,16 +300,16 @@ class dolReceiptPrinter extends Escpos function selectTypePrinter($selected='', $htmlname='printertypeid') { global $langs; - + $options = array( 1 => $langs->trans('CONNECTOR_DUMMY'), 2 => $langs->trans('CONNECTOR_FILE_PRINT'), 3 => $langs->trans('CONNECTOR_NETWORK_PRINT'), 4 => $langs->trans('CONNECTOR_WINDOWS_PRINT') ); - + $this->resprint = Form::selectarray($htmlname, $options, $selected); - + return 0; } @@ -324,7 +324,7 @@ class dolReceiptPrinter extends Escpos function selectProfilePrinter($selected='', $htmlname='printerprofileid') { global $langs; - + $options = array( 0 => $langs->trans('PROFILE_DEFAULT'), 1 => $langs->trans('PROFILE_SIMPLE'), @@ -332,7 +332,7 @@ class dolReceiptPrinter extends Escpos 3 => $langs->trans('PROFILE_P822D'), 4 => $langs->trans('PROFILE_STAR') ); - + $this->profileresprint = Form::selectarray($htmlname, $options, $selected); return 0; } @@ -520,11 +520,11 @@ class dolReceiptPrinter extends Escpos $ret = $this->InitPrinter($printerid); if ($ret>0) { setEventMessages($this->error, $this->errors, 'errors'); - } - else + } + else { $nboflines = count($vals); - for ($line=0; $line < $nboflines; $line++) + for ($line=0; $line < $nboflines; $line++) { switch ($vals[$line]['tag']) { case 'DOL_ALIGN_CENTER': diff --git a/htdocs/core/triggers/dolibarrtriggers.class.php b/htdocs/core/triggers/dolibarrtriggers.class.php index 61a89b083f8..a93cb041c5b 100644 --- a/htdocs/core/triggers/dolibarrtriggers.class.php +++ b/htdocs/core/triggers/dolibarrtriggers.class.php @@ -84,7 +84,7 @@ abstract class DolibarrTriggers $this->db = $db; - if (empty($this->name)) + if (empty($this->name)) { $this->name = preg_replace('/^Interface/i', '', get_class($this)); } diff --git a/htdocs/don/tpl/linkedobjectblock.tpl.php b/htdocs/don/tpl/linkedobjectblock.tpl.php index d7ad6587845..f8d51bb6e35 100644 --- a/htdocs/don/tpl/linkedobjectblock.tpl.php +++ b/htdocs/don/tpl/linkedobjectblock.tpl.php @@ -36,7 +36,7 @@ $total=0; $ilink=0; foreach($linkedObjectBlock as $key => $objectlink) { $ilink++; - + $trclass='oddeven'; if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> @@ -66,7 +66,7 @@ if (count($linkedObjectBlock) > 1) - diff --git a/htdocs/variants/generator.php b/htdocs/variants/generator.php index 4daa2d8f45a..468b04ac392 100644 --- a/htdocs/variants/generator.php +++ b/htdocs/variants/generator.php @@ -103,7 +103,7 @@ if ($_POST) { $res = 1; - foreach (cartesianArray($adapted_values) as $currcomb) + foreach (cartesianArray($adapted_values) as $currcomb) { $res = $combination->createProductCombination($product, $currcomb, $sanitized_values, $price_var_percent); if ($res < 0) { @@ -146,17 +146,17 @@ if (! empty($id) || ! empty($ref)) { { $showbarcode=empty($conf->barcode->enabled)?0:1; if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) $showbarcode=0; - + $head=product_prepare_head($object); $titre=$langs->trans("CardProduct".$object->type); $picto=($object->type== Product::TYPE_SERVICE?'service':'product'); dol_fiche_head($head, 'combinations', $titre, 0, $picto); - + $linkback = ''.$langs->trans("BackToList").''; $object->next_prev_filter=" fk_product_type = ".$object->type; - + dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', '', '', '', 0, '', '', 1); - + dol_fiche_end(); } @@ -375,4 +375,4 @@ if (! empty($id) || ! empty($ref)) {