diff --git a/dev/examples/code/create_invoice.php b/dev/examples/code/create_invoice.php index 1b212e0a5d7..0b2c4e54697 100755 --- a/dev/examples/code/create_invoice.php +++ b/dev/examples/code/create_invoice.php @@ -87,14 +87,12 @@ if ($idobject > 0) // Change status to validated $result=$obj->validate($user); if ($result > 0) print "OK Object created with id ".$idobject."\n"; - else - { + else { $error++; dol_print_error($db, $obj->error); } } -else -{ +else { $error++; dol_print_error($db, $obj->error); } @@ -107,8 +105,7 @@ if (! $error) $db->commit(); print '--- end ok'."\n"; } -else -{ +else { print '--- end error code='.$error."\n"; $db->rollback(); } diff --git a/dev/examples/code/create_order.php b/dev/examples/code/create_order.php index 703254ad5e9..d46913f3fcf 100755 --- a/dev/examples/code/create_order.php +++ b/dev/examples/code/create_order.php @@ -85,14 +85,12 @@ if ($idobject > 0) // Change status to validated $result=$com->valid($user); if ($result > 0) print "OK Object created with id ".$idobject."\n"; - else - { + else { $error++; dol_print_error($db, $com->error); } } -else -{ +else { $error++; dol_print_error($db, $com->error); } @@ -105,8 +103,7 @@ if (! $error) $db->commit(); print '--- end ok'."\n"; } -else -{ +else { print '--- end error code='.$error."\n"; $db->rollback(); } diff --git a/dev/examples/code/create_product.php b/dev/examples/code/create_product.php index 234658388df..fb09c5f6e43 100755 --- a/dev/examples/code/create_product.php +++ b/dev/examples/code/create_product.php @@ -83,8 +83,7 @@ if ($idobject > 0) { print "OK Object created with id ".$idobject."\n"; } -else -{ +else { $error++; dol_print_error($db, $myproduct->error); } @@ -96,8 +95,7 @@ if (! $error) $db->commit(); print '--- end ok'."\n"; } -else -{ +else { print '--- end error code='.$error."\n"; $db->rollback(); } diff --git a/dev/examples/code/create_user.php b/dev/examples/code/create_user.php index 96d369085d2..79fe30b73bf 100755 --- a/dev/examples/code/create_user.php +++ b/dev/examples/code/create_user.php @@ -74,8 +74,7 @@ if ($idobject > 0) // Change status to validated $result=$obj->setStatut(1); if ($result > 0) print "OK Object created with id ".$idobject."\n"; - else - { + else { $error++; dol_print_error($db, $obj->error); } @@ -84,8 +83,7 @@ elseif ($obj->error == 'ErrorLoginAlreadyExists') { print "User with login ".$obj->login." already exists\n"; } -else -{ +else { $error++; dol_print_error($db, $obj->error); } @@ -98,8 +96,7 @@ if (! $error) $db->commit(); print '--- end ok'."\n"; } -else -{ +else { print '--- end error code='.$error."\n"; $db->rollback(); } diff --git a/dev/initdata/dbf/importdb-products.php b/dev/initdata/dbf/importdb-products.php index 845064f0688..2c06c07e103 100644 --- a/dev/initdata/dbf/importdb-products.php +++ b/dev/initdata/dbf/importdb-products.php @@ -227,8 +227,7 @@ while ($fields = $db->fetch_array($resql)) { $error++; // $errorrecord will be reset } $j++; -} else - die("error : $sql"); +} else die("error : $sql"); diff --git a/dev/initdata/dbf/importdb-thirdparties.php b/dev/initdata/dbf/importdb-thirdparties.php index 8f0eb0635f0..a6b2697eed8 100644 --- a/dev/initdata/dbf/importdb-thirdparties.php +++ b/dev/initdata/dbf/importdb-thirdparties.php @@ -179,8 +179,7 @@ while ($fields = $db->fetch_array($resql)) { $object->town = trim($fields['FVILLE']); if ($fields['FPAYS']) $object->country_id = dol_getIdFromCode($db, trim(ucwords(strtolower($fields['FPAYS']))), 'c_country', 'label', 'rowid'); - else - $object->country_id = 1; + else $object->country_id = 1; $object->phone = trim($fields['FTEL']) ? trim($fields['FTEL']) : trim($fields['FCONTACT']); $object->phone = substr($object->phone, 0, 20); $object->fax = trim($fields['FFAX']) ? trim($fields['FFAX']) : trim($fields['FCONTACT']); @@ -299,8 +298,7 @@ while ($fields = $db->fetch_array($resql)) { $contact->town = trim($fields['LVILLE']); if ($fields['FPAYS']) $contact->country_id = dol_getIdFromCode($db, trim(ucwords(strtolower($fields['LPAYS']))), 'c_country', 'label', 'rowid'); - else - $contact->country_id = 1; + else $contact->country_id = 1; $contact->email = $fields['LMAIL']; $contact->phone = trim($fields['LTEL']) ? trim($fields['LTEL']) : trim($fields['LCONTACT']); $contact->fax = trim($fields['LFAX']) ? trim($fields['LFAX']) : trim($fields['LCONTACT']); @@ -340,8 +338,7 @@ while ($fields = $db->fetch_array($resql)) { $error++; // $errorrecord will be reset } $j++; -} else - die("error : $sql"); +} else die("error : $sql"); $db->commit(); diff --git a/dev/initdata/dbf/includes/dbase.class.php b/dev/initdata/dbf/includes/dbase.class.php index 0c2f6820a96..e70f18087c4 100644 --- a/dev/initdata/dbf/includes/dbase.class.php +++ b/dev/initdata/dbf/includes/dbase.class.php @@ -207,8 +207,7 @@ class DBase $value = true; elseif ($value == 'f' || $value == 'n') $value = false; - else - $value = null; + else $value = null; } $record[$i] = $value; } @@ -295,8 +294,7 @@ class DBase $i = unpack("S$n", $data); if ($n == 1) return (int) $i[1]; - else - return array_merge($i); + else return array_merge($i); } private static function putInt16($fd, $value) @@ -310,8 +308,7 @@ class DBase $i = unpack("L$n", $data); if ($n == 1) return (int) $i[1]; - else - return array_merge($i); + else return array_merge($i); } private static function putInt32($fd, $value) diff --git a/dev/initdata/generate-invoice.php b/dev/initdata/generate-invoice.php index 3fe058e8d3e..d4522ef047e 100755 --- a/dev/initdata/generate-invoice.php +++ b/dev/initdata/generate-invoice.php @@ -180,13 +180,11 @@ while ($i < GEN_NUMBER_FACTURE && $result >= 0) { print " OK with ref ".$object->ref."\n";; } - else - { + else { dol_print_error($db, $object->error); } } - else - { + else { dol_print_error($db, $object->error); } } diff --git a/dev/initdata/generate-order.php b/dev/initdata/generate-order.php index 1dc56aa5582..f63d50a1967 100755 --- a/dev/initdata/generate-order.php +++ b/dev/initdata/generate-order.php @@ -207,15 +207,13 @@ for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++) $db->commit(); print " OK with ref ".$object->ref."\n"; } - else - { + else { print " KO\n"; $db->rollback(); dol_print_error($db, $object->error); } } - else - { + else { print " KO\n"; $db->rollback(); dol_print_error($db, $object->error); diff --git a/dev/initdata/generate-proposal.php b/dev/initdata/generate-proposal.php index 4c5d70aadc4..60ba418b43b 100755 --- a/dev/initdata/generate-proposal.php +++ b/dev/initdata/generate-proposal.php @@ -211,15 +211,13 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0) $db->commit(); print " OK with ref ".$object->ref."\n"; } - else - { + else { print " KO\n"; $db->rollback(); dol_print_error($db, $object->error); } } - else - { + else { dol_print_error($db, $object->error); } } diff --git a/dev/initdata/generate-thirdparty.php b/dev/initdata/generate-thirdparty.php index 05ac6416aa3..f7bde473038 100755 --- a/dev/initdata/generate-thirdparty.php +++ b/dev/initdata/generate-thirdparty.php @@ -137,8 +137,7 @@ for ($s = 0 ; $s < GEN_NUMBER_SOCIETE ; $s++) print "Company ".$s." created nom=".$soc->name."\n"; } - else - { + else { print "Error: ".$soc->error."\n"; } } diff --git a/dev/initdata/import-products.php b/dev/initdata/import-products.php index 4288c5bf3b1..78f3a0789f8 100755 --- a/dev/initdata/import-products.php +++ b/dev/initdata/import-products.php @@ -164,8 +164,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in create result code = ".$ret." - ".$produit->errorsToString(); $errorrecord++; } - else - { + else { print " - Creation OK with ref ".$produit->ref." - id = ".$ret; } @@ -181,8 +180,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in updatePrice result code = ".$ret1." ".$ret2." - ".$produit->errorsToString(); $errorrecord++; } - else - { + else { print " - updatePrice OK"; } } @@ -201,8 +199,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in setMultiLangs result code = ".$ret." - ".$produit->errorsToString(); $errorrecord++; } - else - { + else { print " - setMultiLangs OK"; } } @@ -228,8 +225,7 @@ if ($mode != 'confirmforced' && ($error || $mode != 'confirm')) print "Rollback any changes.\n"; $db->rollback(); } -else -{ +else { print "Commit all changes.\n"; $db->commit(); } diff --git a/dev/initdata/import-thirdparties.php b/dev/initdata/import-thirdparties.php index ef1dfcc99ab..87fef83de0f 100755 --- a/dev/initdata/import-thirdparties.php +++ b/dev/initdata/import-thirdparties.php @@ -182,8 +182,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in create result code = ".$ret." - ".$object->errorsToString(); $errorrecord++; } - else - { + else { print " - Creation OK with name ".$object->name." - id = ".$ret; } } @@ -213,8 +212,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in create link with sale representative result code = ".$result." - ".$object->errorsToString(); $errorrecord++; } - else - { + else { print " - create link sale representative OK"; } } @@ -244,8 +242,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in create contact result code = ".$ret1." ".$ret2." - ".$object->errorsToString(); $errorrecord++; } - else - { + else { print " - create contact OK"; } } @@ -278,8 +275,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in create contact result code = ".$ret1." ".$ret2." - ".$object->errorsToString(); $errorrecord++; } - else - { + else { print " - create contact OK"; } } @@ -306,8 +302,7 @@ if ($mode != 'confirmforced' && ($error || $mode != 'confirm')) print "Rollback any changes.\n"; $db->rollback(); } -else -{ +else { print "Commit all changes.\n"; $db->commit(); } diff --git a/dev/initdata/import-users.php b/dev/initdata/import-users.php index 4247415288c..25fa6a69e2d 100755 --- a/dev/initdata/import-users.php +++ b/dev/initdata/import-users.php @@ -143,8 +143,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in create result code = ".$ret." - ".$object->errorsToString(); $errorrecord++; } - else - { + else { print " - Creation OK with login ".$object->login." - id = ".$ret; } @@ -169,8 +168,7 @@ if ($mode != 'confirmforced' && ($error || $mode != 'confirm')) print "Rollback any changes.\n"; $db->rollback(); } -else -{ +else { print "Commit all changes.\n"; $db->commit(); } diff --git a/dev/initdata/purge-data.php b/dev/initdata/purge-data.php index b1aadd56ed8..f9d8420b1e1 100755 --- a/dev/initdata/purge-data.php +++ b/dev/initdata/purge-data.php @@ -198,7 +198,7 @@ if (empty($option)) if ($option != 'all') { $listofoptions=explode(',', $option); - foreach($listofoptions as $cursoroption) + foreach ($listofoptions as $cursoroption) { if (! in_array($cursoroption, array_keys($sqls))) { print "Usage: $script_file (test|confirm) (all|option) (all|YYYY-MM-DD) [dbtype dbhost dbuser dbpassword dbname dbport]\n"; @@ -264,7 +264,7 @@ function processfamily($family, $date) global $db, $sqls; $error=0; - foreach($sqls[$family] as $sql) + foreach ($sqls[$family] as $sql) { if (preg_match('/^@/', $sql)) { @@ -302,10 +302,10 @@ function processfamily($family, $date) $db->begin(); $listofoptions=explode(',', $option); -foreach($listofoptions as $cursoroption) +foreach ($listofoptions as $cursoroption) { $oldfamily=''; - foreach($sqls as $family => $familysql) + foreach ($sqls as $family => $familysql) { if ($cursoroption && $cursoroption != 'all' && $cursoroption != $family) continue; @@ -326,8 +326,7 @@ if ($error || $mode != 'confirm') print "\nRollback any changes.\n"; $db->rollback(); } -else -{ +else { print "Commit all changes.\n"; $db->commit(); } diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index 978a3059ace..a6873f2894a 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -142,8 +142,7 @@ class Export { $bool = $user->rights->{$perm[0]}->{$perm[1]}->{$perm[2]}; } - else - { + else { $bool = $user->rights->{$perm[0]}->{$perm[1]}; } if ($perm[0] == 'user' && $user->admin) $bool = true; @@ -295,8 +294,7 @@ class Export case 'Text': if (!(strpos($ValueField, '%') === false)) $szFilterQuery .= " ".$NameField." LIKE '".$ValueField."'"; - else - $szFilterQuery .= " ".$NameField." = '".$ValueField."'"; + else $szFilterQuery .= " ".$NameField." = '".$ValueField."'"; break; case 'Date': if (strpos($ValueField, "+") > 0) @@ -306,12 +304,10 @@ class Export $szFilterQuery = "(".$this->conditionDate($NameField, trim($ValueArray[0]), ">="); $szFilterQuery .= " AND ".$this->conditionDate($NameField, trim($ValueArray[1]), "<=").")"; } - else - { + else { if (is_numeric(substr($ValueField, 0, 1))) $szFilterQuery = $this->conditionDate($NameField, trim($ValueField), "="); - else - $szFilterQuery = $this->conditionDate($NameField, trim(substr($ValueField, 1)), substr($ValueField, 0, 1)); + else $szFilterQuery = $this->conditionDate($NameField, trim(substr($ValueField, 1)), substr($ValueField, 0, 1)); } break; case 'Duree': @@ -325,12 +321,10 @@ class Export $szFilterQuery = "(".$NameField.">=".$ValueArray[0]; $szFilterQuery .= " AND ".$NameField."<=".$ValueArray[1].")"; } - else - { + else { if (is_numeric(substr($ValueField, 0, 1))) $szFilterQuery = " ".$NameField."=".$ValueField; - else - $szFilterQuery = " ".$NameField.substr($ValueField, 0, 1).substr($ValueField, 1); + else $szFilterQuery = " ".$NameField.substr($ValueField, 0, 1).substr($ValueField, 1); } break; case 'Boolean': @@ -343,8 +337,7 @@ class Export else { if (!(strpos($ValueField, '%') === false)) $szFilterQuery = " ".$NameField." LIKE '".$ValueField."'"; - else - $szFilterQuery = " ".$NameField." = '".$ValueField."'"; + else $szFilterQuery = " ".$NameField." = '".$ValueField."'"; } break; default: @@ -367,7 +360,7 @@ class Export // TODO date_format is forbidden, not performant and not portable. Use instead BETWEEN if (strlen($Value) == 4) $Condition = " date_format(".$Field.",'%Y') ".$Sens." '".$Value."'"; elseif (strlen($Value) == 6) $Condition = " date_format(".$Field.",'%Y%m') ".$Sens." '".$Value."'"; - else $Condition = " date_format(".$Field.",'%Y%m%d') ".$Sens." ".$Value; + else $Condition = " date_format(".$Field.",'%Y%m%d') ".$Sens." ".$Value; return $Condition; } @@ -428,8 +421,7 @@ class Export if (!empty($InfoFieldList[3])) $keyList = $InfoFieldList[3]; - else - $keyList = 'rowid'; + else $keyList = 'rowid'; $sql = 'SELECT '.$keyList.' as rowid, '.$InfoFieldList[2].' as label'.(empty($InfoFieldList[3]) ? '' : ', '.$InfoFieldList[3].' as code'); if ($InfoFieldList[1] == 'c_stcomm') $sql = 'SELECT id as id, '.$keyList.' as rowid, '.$InfoFieldList[2].' as label'.(empty($InfoFieldList[3]) ? '' : ', '.$InfoFieldList[3].' as code'); if ($InfoFieldList[1] == 'c_country') $sql = 'SELECT '.$keyList.' as rowid, '.$InfoFieldList[2].' as label, code as code'; @@ -474,8 +466,7 @@ class Export { $szFilterField .= ''; } - else - { + else { $szFilterField .= ''; } $i++; @@ -564,8 +555,7 @@ class Export $objmodel = new $classname($this->db); if (!empty($sqlquery)) $sql = $sqlquery; - else - { + else { // Define value for indice from $datatoexport $foundindice = 0; foreach ($this->array_export_code as $key => $dataset) @@ -595,8 +585,7 @@ class Export //$this->array_export_label[$indice] if ($conf->global->EXPORT_PREFIX_SPEC) $filename = $conf->global->EXPORT_PREFIX_SPEC."_".$datatoexport; - else - $filename = "export_".$datatoexport; + else $filename = "export_".$datatoexport; $filename .= '.'.$objmodel->getDriverExtension(); $dirname = $conf->export->dir_temp.'/'.$user->id; @@ -665,8 +654,7 @@ class Export } $obj->$alias = $remaintopay; } - else - { + else { // TODO FIXME Export of compute field does not work. $obj containt $obj->alias_field and formulat will contains $obj->field $computestring = $this->array_export_special[$indice][$key]; $tmp = dol_eval($computestring, 1, 0); @@ -689,15 +677,13 @@ class Export return 1; } - else - { + else { $this->error = $objmodel->error; dol_syslog("Export::build_file Error: ".$this->error, LOG_ERR); return -1; } } - else - { + else { $this->error = $this->db->error()." - sql=".$sql; return -1; } @@ -740,8 +726,7 @@ class Export $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->lasterror(); $this->errno = $this->db->lasterrno(); $this->db->rollback(); @@ -777,14 +762,12 @@ class Export return 1; } - else - { + else { $this->error = "ModelNotFound"; return -2; } } - else - { + else { dol_print_error($this->db); return -3; } @@ -823,8 +806,7 @@ class Export $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 6543747d1f7..b6b0e7b7fa5 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -174,8 +174,7 @@ if ($action == 'selectfield') // Selection of field at step 2 $_SESSION["export_selected_fields"] = $array_selected; } } - else - { + else { $warnings = array(); $array_selected[$field] = count($array_selected) + 1; // We tag the key $field as "selected" @@ -223,8 +222,7 @@ if ($action == 'unselectfield') $array_selected = array(); $_SESSION["export_selected_fields"] = $array_selected; } - else - { + else { unset($array_selected[$_GET["field"]]); // Renumber fields of array_selected (from 1 to nb_elements) asort($array_selected); @@ -288,8 +286,7 @@ if ($action == 'builddoc') setEventMessages($objexport->error, $objexport->errors, 'errors'); $sqlusedforexport = $objexport->sqlusedforexport; } - else - { + else { setEventMessages($langs->trans("FileSuccessfullyBuilt"), null, 'mesgs'); $sqlusedforexport = $objexport->sqlusedforexport; } @@ -351,17 +348,14 @@ if ($action == 'add_export_model') { setEventMessages($langs->trans("ExportModelSaved", $objexport->model_name), null, 'mesgs'); } - else - { + else { $langs->load("errors"); if ($objexport->errno == 'DB_ERROR_RECORD_ALREADY_EXISTS') setEventMessages($langs->trans("ErrorExportDuplicateProfil"), null, 'errors'); - else - setEventMessages($objexport->error, $objexport->errors, 'errors'); + else setEventMessages($objexport->error, $objexport->errors, 'errors'); } } - else - { + else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("ExportModelName")), null, 'errors'); } } @@ -473,15 +467,13 @@ if ($step == 1 || !$datatoexport) { print ''.img_picto($langs->trans("NewExport"), 'filenew').''; } - else - { + else { print $langs->trans("NotEnoughPermissions"); } print ''; } } - else - { + else { print ''.$langs->trans("NoExportableData").''; } print ''; @@ -615,8 +607,7 @@ if ($step == 2 && $datatoexport) { $htmltext .= ''.$langs->trans("ComputedField")." -> ".$langs->trans("Method")." : ".$objexport->array_export_special[0][$code]."
"; } - else - { + else { $htmltext .= ''.$langs->trans("Table")." -> ".$langs->trans("Field").": ".$tablename." -> ".preg_replace('/^.*\./', '', $code)."
"; } if (!empty($objexport->array_export_examplevalues[0][$code])) @@ -643,8 +634,7 @@ if ($step == 2 && $datatoexport) //print ' ('.$code.')'; print ''; } - else - { + else { // Fields not selected print ''; //print $text.'-'.$htmltext."
"; @@ -673,13 +663,11 @@ if ($step == 2 && $datatoexport) { print ''.$langs->trans("NextStep").''; } - else - { + else { print ''.$langs->trans("NextStep").''; } } - else - { + else { print ''.$langs->trans("NextStep").''; } @@ -811,8 +799,7 @@ if ($step == 3 && $datatoexport) { $htmltext .= ''.$langs->trans("ComputedField")." -> ".$langs->trans("Method")." : ".$objexport->array_export_special[0][$code]."
"; } - else - { + else { $htmltext .= ''.$langs->trans("Table")." -> ".$langs->trans("Field").": ".$tablename." -> ".preg_replace('/^.*\./', '', $code)."
"; } if (!empty($objexport->array_export_examplevalues[0][$code])) @@ -842,8 +829,7 @@ if ($step == 3 && $datatoexport) $tmp = $objexport->build_filterField($Typefieldsarray[$code], $code, $ValueFilter); print $form->textwithpicto($tmp, $szInfoFiltre); } - else - { + else { print $objexport->build_filterField($Typefieldsarray[$code], $code, $ValueFilter); } } @@ -1006,8 +992,7 @@ if ($step == 4 && $datatoexport) { $htmltext .= ''.$langs->trans("ComputedField")." -> ".$langs->trans("Method")." : ".$objexport->array_export_special[0][$code]."
"; } - else - { + else { $htmltext .= ''.$langs->trans("Table")." -> ".$langs->trans("Field").": ".$tablename." -> ".preg_replace('/^.*\./', '', $code)."
"; } if (!empty($objexport->array_export_examplevalues[0][$code])) diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 408f4b2a1a8..792f72d8831 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -88,8 +88,7 @@ elseif (versioncompare(versionphparray(), $arrayphpminversionwarning) < 0) // print 'Error '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionwarning)); $checksok = 0; // 0=error, 1=warning } -else -{ +else { print 'Ok '.$langs->trans("PHPVersion")." ".versiontostring(versionphparray()); } if (empty($force_install_nophpinfo)) print ' ('.$langs->trans("MoreInformation").')'; @@ -104,8 +103,7 @@ if (!isset($_GET["testget"]) && !isset($_POST["testpost"])) print "
\n"; $checksok = 0; } -else -{ +else { print 'Ok '.$langs->trans("PHPSupportPOSTGETOk")."
\n"; } @@ -116,8 +114,7 @@ if (!function_exists("session_id")) print 'Error '.$langs->trans("ErrorPHPDoesNotSupportSessions")."
\n"; $checksok = 0; } -else -{ +else { print 'Ok '.$langs->trans("PHPSupportSessions")."
\n"; } @@ -129,8 +126,7 @@ if (!function_exists("imagecreate")) print 'Error '.$langs->trans("ErrorPHPDoesNotSupportGD")."
\n"; // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } -else -{ +else { print 'Ok '.$langs->trans("PHPSupportGD")."
\n"; } @@ -142,8 +138,7 @@ if (!function_exists("curl_init")) print 'Error '.$langs->trans("ErrorPHPDoesNotSupportCurl")."
\n"; // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } -else -{ +else { print 'Ok '.$langs->trans("PHPSupportCurl")."
\n"; } @@ -152,8 +147,7 @@ if (!function_exists("easter_date")) { print 'Error '.$langs->trans("ErrorPHPDoesNotSupportCalendar")."
\n"; } -else -{ +else { print 'Ok '.$langs->trans("PHPSupportCalendar")."
\n"; } @@ -165,8 +159,7 @@ if (!function_exists("utf8_encode")) print 'Error '.$langs->trans("ErrorPHPDoesNotSupportUTF8")."
\n"; // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } -else -{ +else { print 'Ok '.$langs->trans("PHPSupportUTF8")."
\n"; } @@ -180,8 +173,7 @@ if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@loc print 'Error '.$langs->trans("ErrorPHPDoesNotSupportIntl")."
\n"; // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } - else - { + else { print 'Ok '.$langs->trans("PHPSupportIntl")."
\n"; } } @@ -192,8 +184,7 @@ if (!class_exists('ZipArchive')) print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "ZIP")."
\n"; // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } -else -{ +else { print 'Ok '.$langs->trans("PHPSupport", "ZIP")."
\n"; } @@ -215,8 +206,7 @@ if ($memmaxorig != '') { print 'Ok '.$langs->trans("PHPMemoryOK", $memmaxorig, $memrequiredorig)."
\n"; } - else - { + else { print 'Warning '.$langs->trans("PHPMemoryTooLow", $memmaxorig, $memrequiredorig)."
\n"; } } @@ -236,13 +226,11 @@ if (is_readable($conffile) && filesize($conffile) > 8) // Already installed for all parts (config and database). We can propose upgrade. $allowupgrade = true; } - else - { + else { $allowupgrade = false; } } -else -{ +else { // If not, we create it dolibarr_install_syslog("check: we try to create conf file '".$conffile."'"); $confexists = 0; @@ -253,8 +241,7 @@ else // Success dolibarr_install_syslog("check: successfully copied file ".$conffile.".example into ".$conffile); } - else - { + else { // If failed, we try to create an empty file dolibarr_install_syslog("check: failed to copy file ".$conffile.".example into ".$conffile.". We try to create it.", LOG_WARNING); @@ -285,8 +272,7 @@ if (!file_exists($conffile)) print $langs->trans("CorrectProblemAndReloadPage", $_SERVER['PHP_SELF'].'?testget=ok'); $err++; } -else -{ +else { if (dol_is_dir($conffile)) { print 'Warning '.$langs->trans("ConfFileMustBeAFileNotADir", $conffiletoshow); @@ -300,8 +286,7 @@ else { print 'Ok '.$langs->trans("ConfFileExists", $conffiletoshow); } - else - { + else { print 'Ok '.$langs->trans("ConfFileCouldBeCreated", $conffiletoshow); } print "
"; @@ -311,14 +296,12 @@ else $allowinstall = 0; } // File exists and can be modified - else - { + else { if ($confexists) { print 'Ok '.$langs->trans("ConfFileExists", $conffiletoshow); } - else - { + else { print 'Ok '.$langs->trans("ConfFileCouldBeCreated", $conffiletoshow); } print "
"; @@ -345,8 +328,7 @@ else print 'A '.$conffiletoshow.' file exists with a dolibarr_main_document_root to '.$dolibarr_main_document_root.' that seems wrong. Try to fix or remove the '.$conffiletoshow.' file.
'."\n"; dol_syslog("A '".$conffiletoshow."' file exists with a dolibarr_main_document_root to ".$dolibarr_main_document_root." that seems wrong. Try to fix or remove the '".$conffiletoshow."' file.", LOG_WARNING); } - else - { + else { require_once $dolibarr_main_document_root.'/core/lib/admin.lib.php'; // If password is encoded, we decode it @@ -440,8 +422,7 @@ else { $choice .= ''.$langs->trans("Start").''; } - else - { + else { $choice .= ($foundrecommandedchoice ? '' : '').$langs->trans("InstallNotAllowed").($foundrecommandedchoice ? '' : ''); } $choice .= ''."\n"; @@ -560,13 +541,11 @@ else { $choice .= ''.$langs->trans("NotYetAvailable").''; } - else - { + else { $choice .= ''.$langs->trans("Start").''; } } - else - { + else { $choice .= $langs->trans("NotAvailable"); } $choice .= ''; diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index 3a3adc2322c..aab1615ed64 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -124,13 +124,11 @@ if (!defined('DONOTLOADCONF') && file_exists($conffile) && filesize($conffile) > } } } - else - { + else { $includeconferror = 'ErrorBadValueForDolibarrMainDocumentRoot'; } } - else - { + else { $includeconferror = 'ErrorBadFormatForConfFile'; } } @@ -210,8 +208,7 @@ if (@file_exists($lockfile)) print $langs->trans("ClickHereToGoToApp"); print ''; } - else - { + else { print 'If you always reach this page, you must remove install.lock file manually.
'; } exit; @@ -365,8 +362,7 @@ function pHeader($subtitle, $next, $action = 'set', $param = '', $forcejqueryurl $jQueryCustomPath = $forcejqueryurl; $jQueryUiCustomPath = $forcejqueryurl; } - else - { + else { $jQueryCustomPath = (defined('JS_JQUERY') && constant('JS_JQUERY')) ? JS_JQUERY : false; $jQueryUiCustomPath = (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) ? JS_JQUERY_UI : false; } diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 034741c7c7e..f6f5eb83003 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -124,8 +124,7 @@ if ($db->connected) dolibarr_install_syslog("repair: ".$langs->transnoentities("ServerConnection").": ".$dolibarr_main_db_host.$langs->transnoentities("OK")); $ok = 1; } -else -{ +else { print "".$langs->trans("ErrorFailedToConnectToDatabase", $dolibarr_main_db_name)."".$langs->transnoentities("Error").""; dolibarr_install_syslog("repair: ".$langs->transnoentities("ErrorFailedToConnectToDatabase", $dolibarr_main_db_name)); $ok = 0; @@ -140,8 +139,7 @@ if ($ok) dolibarr_install_syslog("repair: database connection successful: ".$dolibarr_main_db_name); $ok = 1; } - else - { + else { print "".$langs->trans("ErrorFailedToConnectToDatabase", $dolibarr_main_db_name)."".$langs->trans("Error").""; dolibarr_install_syslog("repair: ".$langs->transnoentities("ErrorFailedToConnectToDatabase", $dolibarr_main_db_name)); $ok = 0; @@ -257,8 +255,7 @@ if ($ok && GETPOST('standard', 'alpha')) $fieldname = $obj->Field; $fieldtype = $obj->Type; } - else - { + else { $fieldname = isset($obj->Key) ? $obj->Key : $obj->attname; $fieldtype = isset($obj->Type) ? $obj->Type : 'varchar'; } @@ -318,13 +315,11 @@ if ($ok && GETPOST('standard', 'alpha')) { print "KO ".$db->lasterror."
\n"; } - else - { + else { print "OK
\n"; } } - else - { + else { print ' - Mode test, no column added.'; } } @@ -332,8 +327,7 @@ if ($ok && GETPOST('standard', 'alpha')) print " \n"; } - else - { + else { dol_print_error($db); } } @@ -399,13 +393,11 @@ if ($ok && GETPOST('standard', 'alpha')) print 'Widget '.$obj->name.' set in entity '.$obj->entity.' with value '.$obj->value.' -> Module '.$name.' not enabled in entity '.$obj->entity.', we delete record'; } - else - { + else { print 'Widget '.$obj->name.' set in entity '.$obj->entity.' with value '.$obj->value.' -> Module '.$name.' not enabled in entity '.$obj->entity.', we should delete record (not done, mode test)'; } } - else - { + else { //print 'Constant '.$obj->name.' set in entity '.$obj->entity.' with value '.$obj->value.' -> Module found in entity '.$obj->entity.', we keep record'; } } @@ -472,13 +464,11 @@ if ($ok && GETPOST('standard', 'alpha')) print 'Constant '.$obj->file.' set in boxes_def for entity '.$obj->entity.' but MAIN_MODULE_'.strtoupper($module).' not defined in entity '.$obj->entity.', we delete record'; } - else - { + else { print 'Constant '.$obj->file.' set in boxes_def for entity '.$obj->entity.' but MAIN_MODULE_'.strtoupper($module).' not defined in entity '.$obj->entity.', we should delete record (not done, mode test)'; } } - else - { + else { //print 'Constant '.$obj->name.' set in entity '.$obj->entity.' with value '.$obj->value.' -> Module found in entity '.$obj->entity.', we keep record'; } } @@ -567,8 +557,7 @@ if ($ok && GETPOST('restore_thirdparties_logos')) $i++; } } - else - { + else { $ok = 0; dol_print_error($db); } @@ -671,8 +660,7 @@ if ($ok && GETPOST('restore_user_pictures', 'alpha')) $i++; } } - else - { + else { $ok = 0; dol_print_error($db); } @@ -730,8 +718,7 @@ if ($ok && GETPOST('rebuild_product_thumbs', 'alpha')) $i++; } } - else - { + else { $ok = 0; dol_print_error($db); } @@ -816,16 +803,13 @@ if ($ok && GETPOST('clean_menus', 'alpha')) $error++; dol_print_error($db); } - else - print ' - Cleaned'; + else print ' - Cleaned'; } - else - { + else { print ' - Canceled (test mode)'; } } - else - { + else { print ' - Module condition '.$modulecond.' is ok, we do nothing.'; } } @@ -840,13 +824,11 @@ if ($ok && GETPOST('clean_menus', 'alpha')) $i++; } } - else - { + else { print 'No menu entries of disabled menus found'; } } - else - { + else { dol_print_error($db); } } @@ -1049,8 +1031,7 @@ if ($ok && GETPOST('clean_product_stock_batch', 'alpha')) dol_print_error($db); } } - else - { + else { $error++; dol_print_error($db); } @@ -1066,13 +1047,11 @@ if ($ok && GETPOST('clean_product_stock_batch', 'alpha')) $i++; } } - else - { + else { print 'Nothing to do'; } } - else - { + else { dol_print_error($db); } } @@ -1156,13 +1135,11 @@ if ($ok && GETPOST('set_empty_time_spent_amount', 'alpha')) $i++; } } - else - { + else { print 'No time spent with empty line on users with a hourly rate defined'; } } - else - { + else { dol_print_error($db); } } @@ -1257,16 +1234,13 @@ if ($ok && GETPOST('force_disable_of_modules_not_found', 'alpha')) $error++; dol_print_error($db); } - else - print ' - Cleaned'; + else print ' - Cleaned'; } - else - { + else { print ' - Canceled (test mode)'; } } - else - { + else { print ' - File of '.$key.' ('.$reloffile.') found, we do nothing.'; } } @@ -1282,13 +1256,11 @@ if ($ok && GETPOST('force_disable_of_modules_not_found', 'alpha')) $i++; } } - else - { + else { print 'No active module with missing files found by searching on MAIN_MODULE_(.*)_'.strtoupper($key).''; } } - else - { + else { dol_print_error($db); } } @@ -1334,13 +1306,11 @@ if ($ok && GETPOST('clean_perm_table', 'alpha')) $i++; } } - else - { + else { print 'No lines of a disabled external module (with id > 100000) found into table rights_def'; } } - else - { + else { dol_print_error($db); } } @@ -1392,8 +1362,7 @@ if ($ok && GETPOST('force_utf8_on_tables', 'alpha')) $resql = $db->query($sql); } } - else - { + else { print 'Not available with database type '.$db->type.''; } } @@ -1496,8 +1465,7 @@ if ($ok && GETPOST('repair_link_dispatch_lines_supplier_order_lines')) { { $resql_attach = $db->query($sql_attach); } - else - { + else { $resql_attach = true; // Force success in test mode } @@ -1552,8 +1520,7 @@ if ($oneoptionset) print $langs->trans("GoToDolibarr"); print ''; } -else -{ +else { print '
'; print $langs->trans("SetAtLeastOneOptionAsUrlParameter"); print '
'; diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php index a5e6b9d3377..6bf2e1d3dff 100644 --- a/htdocs/install/step1.php +++ b/htdocs/install/step1.php @@ -231,8 +231,7 @@ if (!$error) { { $databasefortest = 'postgres'; } - else - { + else { $databasefortest = 'master'; } } @@ -275,8 +274,7 @@ if (!$error) { } } } - else - { + else { print "
\nFailed to include_once(\"".$main_dir."/core/db/".$db_type.".class.php\")
\n"; print '
'.$langs->trans("ErrorWrongValueForParameter", $langs->transnoentities("WebPagesDirectory")).'
'; //print ''; @@ -286,8 +284,7 @@ if (!$error) { } } -else -{ +else { if (isset($db)) print $db->lasterror(); if (isset($db) && !$db->connected) print '
'.$langs->trans("BecauseConnectionFailedParametersMayBeWrong").'

'; print $langs->trans("ErrorGoBackAndCorrectParameters"); @@ -318,7 +315,7 @@ if (!$error && $db->connected) $defaultCharacterSet = $db->forcecharset; $defaultDBSortingCollation = $db->forcecollate; } - else // If already created, we take current value + else // If already created, we take current value { $defaultCharacterSet = $db->getDefaultCharacterSetDatabase(); $defaultDBSortingCollation = $db->getDefaultCollationDatabase(); @@ -401,8 +398,7 @@ if (!$error && $db->connected && $action == "set") print '
'.$langs->trans("CorrectProblemAndReloadPage", $_SERVER['PHP_SELF'].'?testget=ok').''; $error++; } - else - { + else { // Create .htaccess file in document directory $pathhtaccess = $main_data_dir.'/.htaccess'; if (!file_exists($pathhtaccess)) @@ -438,8 +434,7 @@ if (!$error && $db->connected && $action == "set") { dolibarr_install_syslog("step1: directory '".$dir[$i]."' exists"); } - else - { + else { if (dol_mkdir($dir[$i]) < 0) { print ""; @@ -449,8 +444,7 @@ if (!$error && $db->connected && $action == "set") print ""; $error++; } - else - { + else { dolibarr_install_syslog("step1: directory '".$dir[$i]."' created"); } } @@ -472,8 +466,7 @@ if (!$error && $db->connected && $action == "set") print ""; print '
'.$langs->trans("CorrectProblemAndReloadPage", $_SERVER['PHP_SELF'].'?testget=ok').''; } - else - { + else { //ODT templates $srcroot = $main_dir.'/install/doctemplates'; $destroot = $main_data_dir.'/doctemplates'; @@ -592,8 +585,7 @@ if (!$error && $db->connected && $action == "set") print ''; print 'Ok'; } - else - { + else { if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS' || $db->errno() == 'DB_ERROR_KEY_NAME_ALREADY_EXISTS' || $db->errno() == 'DB_ERROR_USER_ALREADY_EXISTS') @@ -605,8 +597,7 @@ if (!$error && $db->connected && $action == "set") print ''; print ''.$langs->trans("LoginAlreadyExists").''; } - else - { + else { dolibarr_install_syslog("step1: failed to create user", LOG_ERR); print ''; print $langs->trans("UserCreation").' : '; @@ -618,8 +609,7 @@ if (!$error && $db->connected && $action == "set") $db->close(); } - else - { + else { print ''; print $langs->trans("UserCreation").' : '; print $dolibarr_main_db_user; @@ -668,8 +658,7 @@ if (!$error && $db->connected && $action == "set") //if ($check1 != $dolibarr_main_db_character_set) dolibarr_install_syslog('step1: value for character_set is not the one asked for database creation', LOG_WARNING); //if ($check2 != $dolibarr_main_db_collation) dolibarr_install_syslog('step1: value for collation is not the one asked for database creation', LOG_WARNING); } - else - { + else { // warning message print '
'; print $langs->trans("ErrorFailedToCreateDatabase", $dolibarr_main_db_name).'
'; @@ -735,8 +724,7 @@ if (!$error && $db->connected && $action == "set") $error = 0; } - else - { + else { dolibarr_install_syslog("step1: connection to database ".$conf->db->name." by user ".$conf->db->user." failed", LOG_ERR); print ""; print $langs->trans("DatabaseConnection")." (".$langs->trans("User")." ".$conf->db->user.") : "; @@ -755,8 +743,7 @@ if (!$error && $db->connected && $action == "set") $error++; } } - else - { + else { dolibarr_install_syslog("step1: connection to server by user ".$conf->db->user." failed", LOG_ERR); print ""; print $langs->trans("ServerConnection")." (".$langs->trans("User")." ".$conf->db->user.") : "; @@ -1031,8 +1018,7 @@ function write_conf_file($conffile) print 'Ok'; print ""; } - else - { + else { $error++; } } diff --git a/htdocs/install/step2.php b/htdocs/install/step2.php index 5b794b781bd..f33319ba57c 100644 --- a/htdocs/install/step2.php +++ b/htdocs/install/step2.php @@ -100,8 +100,7 @@ if ($action == "set") print $langs->trans("ServerConnection")." : ".$conf->db->host.'Ok'; $ok = 1; } - else - { + else { print "Failed to connect to server : ".$conf->db->host.'Error'; } @@ -111,8 +110,7 @@ if ($action == "set") { dolibarr_install_syslog("step2: successful connection to database: ".$conf->db->name); } - else - { + else { dolibarr_install_syslog("step2: failed connection to database :".$conf->db->name, LOG_ERR); print "Failed to select database ".$conf->db->name.'Error'; $ok = 0; @@ -202,8 +200,7 @@ if ($action == "set") { $buffer = preg_replace('/type=innodb/i', 'ENGINE=innodb', $buffer); } - else - { + else { // Keyword ENGINE is MySQL-specific, so scrub it for // other database types (mssql, pgsql) $buffer = preg_replace('/type=innodb/i', '', $buffer); @@ -226,15 +223,13 @@ if ($action == "set") // print "OK requete ==== $buffer"; $db->free($resql); } - else - { + else { if ($db->errno() == 'DB_ERROR_TABLE_ALREADY_EXISTS' || $db->errno() == 'DB_ERROR_TABLE_OR_KEY_ALREADY_EXISTS') { //print "Deja existante"; } - else - { + else { print "".$langs->trans("CreateTableAndPrimaryKey", $name); print "
\n".$langs->trans("Request").' '.$requestnb.' : '.$buffer.'
Executed query : '.$db->lastquery; print "\n"; @@ -243,8 +238,7 @@ if ($action == "set") } } } - else - { + else { print "".$langs->trans("CreateTableAndPrimaryKey", $name); print ""; print ''.$langs->trans("Error").' Failed to open file '.$dir.$file.''; @@ -262,8 +256,7 @@ if ($action == "set") $ok = 1; } } - else - { + else { print ''.$langs->trans("ErrorFailedToFindSomeFiles", $dir).'Error'; dolibarr_install_syslog("step2: failed to find files to create database in directory ".$dir, LOG_ERR); } @@ -369,8 +362,7 @@ if ($action == "set") //print "OK requete ==== $buffer"; $db->free($resql); } - else - { + else { if ($db->errno() == 'DB_ERROR_KEY_NAME_ALREADY_EXISTS' || $db->errno() == 'DB_ERROR_CANNOT_CREATE' || $db->errno() == 'DB_ERROR_PRIMARY_KEY_ALREADY_EXISTS' || @@ -380,8 +372,7 @@ if ($action == "set") //print "Deja existante"; $key_exists = 1; } - else - { + else { print "".$langs->trans("CreateOtherKeysForTable", $name); print "
\n".$langs->trans("Request").' '.$requestnb.' : '.$db->lastqueryerror(); print "\n"; @@ -392,8 +383,7 @@ if ($action == "set") } } } - else - { + else { print "".$langs->trans("CreateOtherKeysForTable", $name); print ""; print ''.$langs->trans("Error")." Failed to open file ".$dir.$file.""; @@ -465,15 +455,13 @@ if ($action == "set") $ok = 1; $db->free($resql); } - else - { + else { if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS' || $db->errno() == 'DB_ERROR_KEY_NAME_ALREADY_EXISTS') { //print "Insert line : ".$buffer."
\n"; } - else - { + else { $ok = 0; print "".$langs->trans("FunctionsCreation"); @@ -491,8 +479,7 @@ if ($action == "set") { print 'Ok'; } - else - { + else { print 'Error'; $ok = 1; } @@ -589,14 +576,12 @@ if ($action == "set") { //$db->free($resql); // Not required as request we launch here does not return memory needs. } - else - { + else { if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { //print "Insertion ligne : $buffer"; } - else - { + else { $ok = 0; $okallfile = 0; print ''.$langs->trans("ErrorSQL")." : ".$db->lasterrno()." - ".$db->lastqueryerror()." - ".$db->lasterror()."
"; @@ -614,16 +599,14 @@ if ($action == "set") { print 'Ok'; } - else - { + else { print 'Error'; $ok = 1; // Data loading are not blocking errors } } print ''; } -else -{ +else { print 'Parameter action=set not defined'; } diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php index b74594ce8da..a30a6040fb9 100644 --- a/htdocs/install/step5.php +++ b/htdocs/install/step5.php @@ -187,8 +187,7 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) dolibarr_set_const($db, "MAIN_SECURITY_SALT", dol_print_date(dol_now(), 'dayhourlog'), 'chaine', 0, '', 0); // All entities if (function_exists('password_hash')) dolibarr_set_const($db, "MAIN_SECURITY_HASH_ALGO", 'password_hash', 'chaine', 0, '', 0); // All entities - else - dolibarr_set_const($db, "MAIN_SECURITY_HASH_ALGO", 'sha1md5', 'chaine', 0, '', 0); // All entities + else dolibarr_set_const($db, "MAIN_SECURITY_HASH_ALGO", 'sha1md5', 'chaine', 0, '', 0); // All entities } dolibarr_install_syslog('step5: DATABASE_PWD_ENCRYPTED = '.$conf->global->DATABASE_PWD_ENCRYPTED.' MAIN_SECURITY_HASH_ALGO = '.$conf->global->MAIN_SECURITY_HASH_ALGO, LOG_INFO); @@ -215,16 +214,14 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) print $langs->trans("AdminLoginCreatedSuccessfuly", $login)."
"; $success = 1; } - else - { + else { if ($newuser->error == 'ErrorLoginAlreadyExists') { dolibarr_install_syslog('step5: AdminLoginAlreadyExists', LOG_WARNING); print '
'.$langs->trans("AdminLoginAlreadyExists", $login)."

"; $success = 1; } - else - { + else { dolibarr_install_syslog('step5: FailedToCreateAdminLogin '.$newuser->error, LOG_ERR); print '
'.$langs->trans("FailedToCreateAdminLogin").' '.$newuser->error.'


'; } @@ -241,8 +238,7 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) $conf->global->MAIN_VERSION_FIRST_INSTALL = $targetversion; $db->commit(); } - else - { + else { //if (! $resql) dol_print_error($db,'Error in setup program'); // We ignore errors. Key may already exists $db->commit(); } @@ -293,8 +289,7 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) $db->commit(); } } - else - { + else { print $langs->trans("ErrorFailedToConnect")."
"; } } @@ -311,8 +306,7 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) // Define if we need to update the MAIN_VERSION_LAST_UPGRADE value in database $tagdatabase = false; if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE)) $tagdatabase = true; // We don't know what it was before, so now we consider we are version choosed. - else - { + else { $mainversionlastupgradearray = preg_split('/[.-]/', $conf->global->MAIN_VERSION_LAST_UPGRADE); $targetversionarray = preg_split('/[.-]/', $targetversion); if (versioncompare($targetversionarray, $mainversionlastupgradearray) > 0) $tagdatabase = true; @@ -327,18 +321,15 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) if (!$resql) dol_print_error($db, 'Error in setup program'); $conf->global->MAIN_VERSION_LAST_UPGRADE = $targetversion; } - else - { + else { dolibarr_install_syslog('step5: we run an upgrade to version '.$targetversion.' but database was already upgraded to '.$conf->global->MAIN_VERSION_LAST_UPGRADE.'. We keep MAIN_VERSION_LAST_UPGRADE as it is.'); } } - else - { + else { print $langs->trans("ErrorFailedToConnect")."
"; } } - else - { + else { dol_print_error('', 'step5.php: unknown choice of action'); } @@ -390,8 +381,7 @@ if ($action == "set" && $success) print ' '.$langs->trans("GoToSetupArea"); print '
'; } - else - { + else { // If here MAIN_VERSION_LAST_UPGRADE is not empty print $langs->trans("VersionLastUpgrade").': '.$conf->global->MAIN_VERSION_LAST_UPGRADE.'
'; print $langs->trans("VersionProgram").': '.DOL_VERSION.'
'; @@ -438,8 +428,7 @@ elseif (empty($action) || preg_match('/upgrade/i', $action)) print ' '.$langs->trans("GoToDolibarr").'...'; print '
'; } - else - { + else { // If here MAIN_VERSION_LAST_UPGRADE is not empty print $langs->trans("VersionLastUpgrade").': '.$conf->global->MAIN_VERSION_LAST_UPGRADE.'
'; print $langs->trans("VersionProgram").': '.DOL_VERSION.''; @@ -451,8 +440,7 @@ elseif (empty($action) || preg_match('/upgrade/i', $action)) print ''; } } -else -{ +else { dol_print_error('', 'step5.php: unknown choice of action'); } diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index b71707bef4b..91242b7429a 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -151,8 +151,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ dolibarr_install_syslog("upgrade: ".$langs->transnoentities("ServerConnection").": $dolibarr_main_db_host ".$langs->transnoentities("OK")); $ok = 1; } - else - { + else { print "".$langs->trans("ErrorFailedToConnectToDatabase", $dolibarr_main_db_name)."".$langs->transnoentities("Error")."\n"; dolibarr_install_syslog("upgrade: ".$langs->transnoentities("ErrorFailedToConnectToDatabase", $dolibarr_main_db_name)); $ok = 0; @@ -167,8 +166,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ dolibarr_install_syslog("upgrade: Database connection successful: ".$dolibarr_main_db_name); $ok = 1; } - else - { + else { print "".$langs->trans("ErrorFailedToConnectToDatabase", $dolibarr_main_db_name)."".$langs->trans("Error")."\n"; dolibarr_install_syslog("upgrade: ".$langs->transnoentities("ErrorFailedToConnectToDatabase", $dolibarr_main_db_name)); $ok = 0; @@ -293,8 +291,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ } $db->free($resql); } - else - { + else { if ($db->lasterrno() != 'DB_ERROR_NOSUCHTABLE') { print ''.$sql.' : '.$db->lasterror()."\n"; @@ -335,8 +332,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ } sort($filesindir); } - else - { + else { print '
'.$langs->trans("ErrorCanNotReadDir", $dir).'
'; } @@ -357,8 +353,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ { print '
'.$langs->trans("ErrorNoMigrationFilesFoundForParameters").'
'; } - else - { + else { $listoffileprocessed = array(); // Protection to avoid to process twice the same file // Loop on each migrate files diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 765a8796a76..b8e9ad30076 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -68,8 +68,7 @@ $err = error_reporting(); error_reporting(0); if (!empty($conf->global->MAIN_OVERRIDE_TIME_LIMIT)) @set_time_limit((int) $conf->global->MAIN_OVERRIDE_TIME_LIMIT); -else - @set_time_limit(600); +else @set_time_limit(600); error_reporting($err); $setuplang = GETPOST("selectlang", 'aZ09', 3) ?GETPOST("selectlang", 'aZ09', 3) : 'auto'; @@ -159,8 +158,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ { dolibarr_install_syslog('upgrade2: database connection successful :'.$dolibarr_main_db_name); } - else - { + else { $error++; } } @@ -536,16 +534,14 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ print ""; print ''; } - else - { + else { print ''; print ''.$langs->trans('UpgradeExternalModule').': OK'; print ""; print ''; } } - else - { + else { //if (! empty($conf->modules)) if (!empty($conf->modules_parts['hooks'])) // If there is at least one module with one hook, we show message to say nothing was done { @@ -585,8 +581,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ print '

'.$langs->trans("MigrationFinished").'
'; } -else -{ +else { print '
'.$langs->trans('ErrorWrongParameters').'
'; $error++; } @@ -646,8 +641,7 @@ function migrate_paiements($db, $langs, $conf) $i++; } } - else - { + else { dol_print_error($db); } @@ -678,19 +672,16 @@ function migrate_paiements($db, $langs, $conf) $db->commit(); print $langs->trans('MigrationSuccessfullUpdate')."
"; } - else - { + else { $db->rollback(); print $langs->trans('MigrationUpdateFailed').'
'; } } - else - { + else { print $langs->trans('MigrationPaymentsNothingToUpdate')."
\n"; } } - else - { + else { print $langs->trans('MigrationPaymentsNothingToUpdate')."
\n"; } @@ -753,8 +744,7 @@ function migrate_paiements_orphelins_1($db, $langs, $conf) $i++; } } - else - { + else { dol_print_error($db); } @@ -794,8 +784,7 @@ function migrate_paiements_orphelins_1($db, $langs, $conf) print $langs->trans('MigrationProcessPaymentUpdate', 'facid='.$facid.'-paymentid='.$row[$i]['paymentid'].'-amount='.$row[$i]['pamount'])."
\n"; } } - else - { + else { print 'ERROR'; } } @@ -804,20 +793,17 @@ function migrate_paiements_orphelins_1($db, $langs, $conf) { print $langs->trans('MigrationSuccessfullUpdate')."
"; } - else - { + else { print $langs->trans('MigrationPaymentsNothingUpdatable')."
\n"; } $db->commit(); } - else - { + else { print $langs->trans('MigrationPaymentsNothingUpdatable')."
\n"; } } - else - { + else { print $langs->trans('MigrationPaymentsNothingUpdatable')."
\n"; } @@ -879,8 +865,7 @@ function migrate_paiements_orphelins_2($db, $langs, $conf) $i++; } } - else - { + else { dol_print_error($db); } @@ -921,8 +906,7 @@ function migrate_paiements_orphelins_2($db, $langs, $conf) print $langs->trans('MigrationProcessPaymentUpdate', 'facid='.$facid.'-paymentid='.$row[$i]['paymentid'].'-amount='.$row[$i]['pamount'])."
\n"; } } - else - { + else { print 'ERROR'; $nberr++; } @@ -932,15 +916,13 @@ function migrate_paiements_orphelins_2($db, $langs, $conf) { print $langs->trans('MigrationSuccessfullUpdate')."
"; } - else - { + else { print $langs->trans('MigrationPaymentsNothingUpdatable')."
\n"; } $db->commit(); } - else - { + else { print $langs->trans('MigrationPaymentsNothingUpdatable')."
\n"; } @@ -954,14 +936,12 @@ function migrate_paiements_orphelins_2($db, $langs, $conf) { $db->commit(); } - else - { + else { print 'ERROR'; $db->rollback(); } } - else - { + else { print $langs->trans('MigrationPaymentsNothingUpdatable')."
\n"; } @@ -1032,8 +1012,7 @@ function migrate_contracts_det($db, $langs, $conf) { print $langs->trans('MigrationContractsLineCreation', $obj->cref)."
\n"; } - else - { + else { dol_print_error($db); $nberr++; } @@ -1047,19 +1026,16 @@ function migrate_contracts_det($db, $langs, $conf) $db->commit(); print $langs->trans('MigrationSuccessfullUpdate')."
"; } - else - { + else { $db->rollback(); print $langs->trans('MigrationUpdateFailed').'
'; } } - else - { + else { print $langs->trans('MigrationContractsNothingToUpdate')."
\n"; } } - else - { + else { print $langs->trans('MigrationContractsFieldDontExist')."
\n"; // dol_print_error($db); } @@ -1133,8 +1109,7 @@ function migrate_links_transfert($db, $langs, $conf) $db->commit(); print $langs->trans('MigrationSuccessfullUpdate')."
"; } - else - { + else { $db->rollback(); print $langs->trans('MigrationUpdateFailed').'
'; } @@ -1143,8 +1118,7 @@ function migrate_links_transfert($db, $langs, $conf) print $langs->trans('MigrationBankTransfertsNothingToUpdate')."
\n"; } } - else - { + else { dol_print_error($db); } @@ -1172,8 +1146,7 @@ function migrate_contracts_date1($db, $langs, $conf) if (!$resql) dol_print_error($db); if ($db->affected_rows($resql) > 0) print $langs->trans('MigrationContractsEmptyDatesUpdateSuccess')."
\n"; - else - print $langs->trans('MigrationContractsEmptyDatesNothingToUpdate')."
\n"; + else print $langs->trans('MigrationContractsEmptyDatesNothingToUpdate')."
\n"; $sql = "update ".MAIN_DB_PREFIX."contrat set datec=tms where datec is null"; dolibarr_install_syslog("upgrade2::migrate_contracts_date1"); @@ -1181,8 +1154,7 @@ function migrate_contracts_date1($db, $langs, $conf) if (!$resql) dol_print_error($db); if ($db->affected_rows($resql) > 0) print $langs->trans('MigrationContractsEmptyCreationDatesUpdateSuccess')."
\n"; - else - print $langs->trans('MigrationContractsEmptyCreationDatesNothingToUpdate')."
\n"; + else print $langs->trans('MigrationContractsEmptyCreationDatesNothingToUpdate')."
\n"; print ''; } @@ -1244,12 +1216,10 @@ function migrate_contracts_date2($db, $langs, $conf) if ($nbcontratsmodifie) print $langs->trans('MigrationContractsInvalidDatesNumber', $nbcontratsmodifie)."
\n"; - else - print $langs->trans('MigrationContractsInvalidDatesNothingToUpdate')."
\n"; + else print $langs->trans('MigrationContractsInvalidDatesNothingToUpdate')."
\n"; } } - else - { + else { dol_print_error($db); } @@ -1277,8 +1247,7 @@ function migrate_contracts_date3($db, $langs, $conf) if (!$resql) dol_print_error($db); if ($db->affected_rows($resql) > 0) print $langs->trans('MigrationContractsIncoherentCreationDateUpdateSuccess')."
\n"; - else - print $langs->trans('MigrationContractsIncoherentCreationDateNothingToUpdate')."
\n"; + else print $langs->trans('MigrationContractsIncoherentCreationDateNothingToUpdate')."
\n"; print ''; } @@ -1333,8 +1302,7 @@ function migrate_contracts_open($db, $langs, $conf) if ($nbcontratsmodifie) print $langs->trans('MigrationReopenedContractsNumber', $nbcontratsmodifie)."
\n"; - else - print $langs->trans('MigrationReopeningContractsNothingToUpdate')."
\n"; + else print $langs->trans('MigrationReopeningContractsNothingToUpdate')."
\n"; } } else print $langs->trans('MigrationReopeningContractsNothingToUpdate')."
\n"; @@ -1416,23 +1384,20 @@ function migrate_paiementfourn_facturefourn($db, $langs, $conf) $nb++; print ''.$langs->trans("OK").''; } - else - { + else { print 'Error on insert'; $error++; } print ''; } } - else - { + else { $error++; } $i++; } } - else - { + else { $error++; } @@ -1447,14 +1412,12 @@ function migrate_paiementfourn_facturefourn($db, $langs, $conf) $sql = "ALTER TABLE ".MAIN_DB_PREFIX."paiementfourn DROP COLUMN fk_facture_fourn"; $db->query($sql); } - else - { + else { print ''.$langs->trans("Error").''; $db->rollback(); } } - else - { + else { print ''.$langs->trans("AlreadyDone").''; } } @@ -1540,14 +1503,12 @@ function migrate_price_facture($db, $langs, $conf) { //print $facture->id; } - else - { + else { print "Error id=".$facture->id; $err++; } } - else - { + else { print "Error #3"; $err++; } @@ -1557,16 +1518,14 @@ function migrate_price_facture($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans("AlreadyDone"); } $db->free($resql); $db->commit(); } - else - { + else { print "Error #1 ".$db->error(); $err++; @@ -1665,8 +1624,7 @@ function migrate_price_propal($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans("AlreadyDone"); } @@ -1674,8 +1632,7 @@ function migrate_price_propal($db, $langs, $conf) $db->commit(); } - else - { + else { print "Error #1 ".$db->error(); $db->rollback(); @@ -1754,8 +1711,7 @@ function migrate_price_contrat($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans("AlreadyDone"); } @@ -1763,8 +1719,7 @@ function migrate_price_contrat($db, $langs, $conf) $db->commit(); } - else - { + else { print "Error #1 ".$db->error(); $db->rollback(); @@ -1861,8 +1816,7 @@ function migrate_price_commande($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans("AlreadyDone"); } @@ -1880,8 +1834,7 @@ function migrate_price_commande($db, $langs, $conf) $db->commit(); } - else - { + else { print "Error #1 ".$db->error(); $db->rollback(); @@ -1978,8 +1931,7 @@ function migrate_price_commande_fournisseur($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans("AlreadyDone"); } @@ -1997,8 +1949,7 @@ function migrate_price_commande_fournisseur($db, $langs, $conf) $db->commit(); } - else - { + else { print "Error #1 ".$db->error(); $db->rollback(); @@ -2126,19 +2077,16 @@ function migrate_commande_expedition($db, $langs, $conf) print $langs->trans('FieldRenamed')."
\n"; $db->query($sql); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } print ''; @@ -2202,8 +2150,7 @@ function migrate_commande_livraison($db, $langs, $conf) dol_print_error($db); } } - else - { + else { $error++; dol_print_error($db); } @@ -2219,19 +2166,16 @@ function migrate_commande_livraison($db, $langs, $conf) print $langs->trans('FieldRenamed')."
\n"; $db->query($sql); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } print ''; @@ -2310,14 +2254,12 @@ function migrate_detail_livraison($db, $langs, $conf) dol_print_error($db); } } - else - { + else { $error++; dol_print_error($db); } } - else - { + else { $error++; dol_print_error($db); } @@ -2333,19 +2275,16 @@ function migrate_detail_livraison($db, $langs, $conf) print $langs->trans('FieldRenamed')."
\n"; $db->query($sql); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { $result = $db->DDLDescTable(MAIN_DB_PREFIX."livraisondet", "fk_origin_line"); $obj = $db->fetch_object($result); if (!$obj) @@ -2402,8 +2341,7 @@ function migrate_stocks($db, $langs, $conf) if ($resql2) { } - else - { + else { $error++; dol_print_error($db); } @@ -2416,13 +2354,11 @@ function migrate_stocks($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } @@ -2478,8 +2414,7 @@ function migrate_menus($db, $langs, $conf) if ($resql2) { } - else - { + else { $error++; dol_print_error($db); } @@ -2492,19 +2427,16 @@ function migrate_menus($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -2567,8 +2499,7 @@ function migrate_commande_deliveryaddress($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -2576,19 +2507,16 @@ function migrate_commande_deliveryaddress($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -2670,13 +2598,11 @@ function migrate_restore_missing_links($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } @@ -2729,8 +2655,7 @@ function migrate_restore_missing_links($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -2738,13 +2663,11 @@ function migrate_restore_missing_links($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } @@ -2826,24 +2749,20 @@ function migrate_project_user_resp($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } print ''; @@ -2918,24 +2837,20 @@ function migrate_project_task_actors($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } print ''; @@ -3006,8 +2921,7 @@ function migrate_relationship_tables($db, $langs, $conf, $table, $fk_source, $so $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3018,24 +2932,20 @@ function migrate_relationship_tables($db, $langs, $conf, $table, $fk_source, $so { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3104,8 +3014,7 @@ function migrate_project_task_time($db, $langs, $conf) if (!empty($totaltime[$obj->fk_task])) $totaltime[$obj->fk_task] += $newtime; else $totaltime[$obj->fk_task] = $newtime; } - else - { + else { if (!empty($totaltime[$obj->fk_task])) $totaltime[$obj->fk_task] += $obj->task_duration; else $totaltime[$obj->fk_task] = $obj->task_duration; } @@ -3131,23 +3040,19 @@ function migrate_project_task_time($db, $langs, $conf) } } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } } - else - { + else { dol_print_error($db); } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } } - else - { + else { dol_print_error($db); } @@ -3155,8 +3060,7 @@ function migrate_project_task_time($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } @@ -3229,8 +3133,7 @@ function migrate_customerorder_shipping($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3238,26 +3141,22 @@ function migrate_customerorder_shipping($db, $langs, $conf) { $db->commit(); } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3331,16 +3230,14 @@ function migrate_shipping_delivery($db, $langs, $conf) } print ". "; } - else - { + else { $error++; dol_print_error($db); } $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3355,20 +3252,17 @@ function migrate_shipping_delivery($db, $langs, $conf) $sqlDrop = "ALTER TABLE ".MAIN_DB_PREFIX."livraison DROP COLUMN fk_expedition"; $db->query($sqlDrop); } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3436,8 +3330,7 @@ function migrate_shipping_delivery2($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3445,14 +3338,12 @@ function migrate_shipping_delivery2($db, $langs, $conf) { $db->commit(); } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } @@ -3511,14 +3402,12 @@ function migrate_actioncomm_element($db, $langs, $conf) //$db->query($sqlDrop); //print ". "; } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } } @@ -3603,14 +3492,12 @@ function migrate_mode_reglement($db, $langs, $conf) { $db->commit(); } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } @@ -3694,16 +3581,14 @@ function migrate_clean_association($db, $langs, $conf) print ''.$langs->trans("RemoveDuplicates").' '.$langs->trans("Success").' ('.$num.'=>'.count($couples).')'; $db->commit(); } - else - { + else { print ''.$langs->trans("MigrationCategorieAssociation").''; print ''.$langs->trans("RemoveDuplicates").' '.$langs->trans("Failed").''; $db->rollback(); } } } - else - { + else { print ''.$langs->trans("Error").''; print '
'.$db->lasterror().'
'; } @@ -3764,8 +3649,7 @@ function migrate_categorie_association($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3786,19 +3670,16 @@ function migrate_categorie_association($db, $langs, $conf) $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3858,8 +3739,7 @@ function migrate_event_assignement($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3867,13 +3747,11 @@ function migrate_event_assignement($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } @@ -3935,8 +3813,7 @@ function migrate_event_assignement_contact($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3944,13 +3821,11 @@ function migrate_event_assignement_contact($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } @@ -4022,8 +3897,7 @@ function migrate_reset_blocked_log($db, $langs, $conf) $error++; dol_print_error($db); } - else - { + else { // Add set line $object = new stdClass(); $object->id = 1; @@ -4041,21 +3915,18 @@ function migrate_reset_blocked_log($db, $langs, $conf) } } } - else - { + else { print ' - '.$langs->trans('AlreadyInV7').'
'; } } - else - { + else { dol_print_error($db); } $i++; } } - else - { + else { print $langs->trans('NothingToDo')."
\n"; } @@ -4063,13 +3934,11 @@ function migrate_reset_blocked_log($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } @@ -4132,8 +4001,7 @@ function migrate_remise_entity($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -4141,13 +4009,11 @@ function migrate_remise_entity($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } @@ -4207,8 +4073,7 @@ function migrate_remise_except_entity($db, $langs, $conf) $sqlSelect2 .= " WHERE fd.rowid = ".$obj->fk_facture_line; $sqlSelect2 .= " AND fd.fk_facture = f.rowid"; } - else - { + else { $sqlSelect2 = "SELECT s.entity"; $sqlSelect2 .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sqlSelect2 .= " WHERE s.rowid = ".$obj->fk_soc; @@ -4233,8 +4098,7 @@ function migrate_remise_except_entity($db, $langs, $conf) } } } - else - { + else { $error++; dol_print_error($db); } @@ -4243,8 +4107,7 @@ function migrate_remise_except_entity($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -4252,13 +4115,11 @@ function migrate_remise_except_entity($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } @@ -4319,8 +4180,7 @@ function migrate_user_rights_entity($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -4328,13 +4188,11 @@ function migrate_user_rights_entity($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } @@ -4395,8 +4253,7 @@ function migrate_usergroup_rights_entity($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -4404,13 +4261,11 @@ function migrate_usergroup_rights_entity($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } @@ -4774,8 +4629,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo $mod->init($reloadmode); } } - else - { + else { $reg = array(); $tmp = preg_match('/MAIN_MODULE_([a-zA-Z0-9]+)/', $moduletoreload, $reg); if (!empty($reg[1])) @@ -4784,7 +4638,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo { $moduletoreloadshort = ucfirst(strtolower($reg[1])); } - else // If key is a mix of up and low case + else // If key is a mix of up and low case { $moduletoreloadshort = $reg[1]; } @@ -4796,8 +4650,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo //$mod->remove('noboxes'); $mod->init($reloadmode); } - else - { + else { dolibarr_install_syslog('Failed to include '.DOL_DOCUMENT_ROOT.'/core/modules/mod'.$moduletoreloadshort.'.class.php'); $res = @dol_include_once(strtolower($moduletoreloadshort).'/core/modules/mod'.$moduletoreloadshort.'.class.php'); @@ -4807,14 +4660,12 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo //$mod->remove('noboxes'); $mod->init($reloadmode); } - else - { + else { dolibarr_install_syslog('Failed to include '.strtolower($moduletoreloadshort).'/core/modules/mod'.$moduletoreloadshort.'.class.php'); } } } - else - { + else { dolibarr_install_syslog("Error, can't find module with name ".$moduletoreload, LOG_WARNING); print "Error, can't find module with name ".$moduletoreload; } @@ -4949,7 +4800,7 @@ function migrate_user_photospath() // dol_delete_dir($origin.'/'.$file); } } - else // it is a file + else // it is a file { if (!dol_is_file($destin.'/'.$file)) {