diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index efb3627ddbf..3b200ed526c 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -293,6 +293,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! { $error++; setEventMessages($errmsg, null, 'errors'); + $error++; $action='addsubscription'; } } diff --git a/htdocs/admin/system/dbtable.php b/htdocs/admin/system/dbtable.php index 19fa3fc1abd..d6e05ed2e72 100644 --- a/htdocs/admin/system/dbtable.php +++ b/htdocs/admin/system/dbtable.php @@ -75,7 +75,7 @@ else } } - if ($base == 1) + if ($base == 1) // mysql { $link=array(); $cons = explode(";", $row[14]); @@ -97,11 +97,19 @@ else // var_dump($link); - print ''; - print ''; - print ''; + print '
'.$langs->trans("Fields").''.$langs->trans("Type").''.$langs->trans("Index").''.$langs->trans("FieldsLinked").'
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; - $sql = "DESCRIBE ".$table; + //$sql = "DESCRIBE ".$table; + $sql = "SHOW FULL COLUMNS IN ".$db->escape($table); + $resql = $db->query($sql); if ($resql) { @@ -111,12 +119,18 @@ else { $row = $db->fetch_row($resql); print ''; - print ""; - print ""; - print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; - + + print ''; print ''; $i++; } diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index bbf2435436e..a4aa1afbd8c 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -30,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; $langs->load('admin'); +$langs->load("products"); if (!$user->admin) accessforbidden(); diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index c829b139436..64811c7604a 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -205,7 +205,7 @@ if ($result) print_liste_field_titre("Bill",$_SERVER["PHP_SELF"],"p.ref",'',$param,'',$sortfield,$sortorder); print_liste_field_titre("ThirdParty",$_SERVER["PHP_SELF"],"s.nom",'',$param,'',$sortfield,$sortorder); print_liste_field_titre("AmountInvoice",$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre("AmountRequested",$_SERVER["PHP_SELF"],"pl.amount_requested","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("AmountRequested",$_SERVER["PHP_SELF"],"pl.amount","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre("StatusDebitCredit",$_SERVER["PHP_SELF"],"","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre(''); print "\n"; diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index 7f938ba9b6c..6e5ac327e9b 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -176,11 +176,11 @@ elseif ($action == 'confirm_updateline' && GETPOST('save','alpha') && GETPOST('l } elseif ($action == 'renamefile' && GETPOST('renamefilesave','alpha')) { - // For documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile. - if (! empty($upload_dir)) - { - $filenamefrom=dol_sanitizeFileName(GETPOST('renamefilefrom','alpha'), '_', 0); // Do not remove accents - $filenameto=dol_sanitizeFileName(GETPOST('renamefileto','alpha'), '_', 0); // Do not remove accents + // For documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile. + if (! empty($upload_dir)) + { + $filenamefrom=dol_sanitizeFileName(GETPOST('renamefilefrom','alpha'), '_', 0); // Do not remove accents + $filenameto=dol_sanitizeFileName(GETPOST('renamefileto','alpha'), '_', 0); // Do not remove accents if ($filenamefrom != $filenameto) { @@ -197,23 +197,38 @@ elseif ($action == 'renamefile' && GETPOST('renamefilesave','alpha')) $srcpath = $upload_dir.'/'.$filenamefrom; $destpath = $upload_dir.'/'.$filenameto; - $result = dol_move($srcpath, $destpath); - if ($result) + $reshook=$hookmanager->initHooks(array('actionlinkedfiles')); + $parameters=array('filenamefrom' => $filenamefrom, 'filenameto' => $filenameto, 'upload_dir' => $upload_dir); + $reshook=$hookmanager->executeHooks('renameUploadedFile', $parameters, $object); + + if (empty($reshook)) { - if ($object->id) + if (! file_exists($destpath)) { - $object->addThumbs($destpath); + $result = dol_move($srcpath, $destpath); + if ($result) + { + if ($object->id) + { + $object->addThumbs($destpath); + } + + // TODO Add revert function of addThumbs to remove for old name + //$object->delThumbs($srcpath); + + setEventMessages($langs->trans("FileRenamed"), null); + } + else + { + $langs->load("errors"); // key must be loaded because we can't rely on loading during output, we need var substitution to be done now. + setEventMessages($langs->trans("ErrorFailToRenameFile", $filenamefrom, $filenameto), null, 'errors'); + } + } + else + { + $langs->load("errors"); // key must be loaded because we can't rely on loading during output, we need var substitution to be done now. + setEventMessages($langs->trans("ErrorDestinationAlreadyExists", $filenameto), null, 'errors'); } - - // TODO Add revert function of addThumbs to remove for old name - //$object->delThumbs($srcpath); - - setEventMessages($langs->trans("FileRenamed"), null); - } - else - { - $langs->load("errors"); // key must be loaded because we can't rely on loading during output, we need var substitution to be done now. - setEventMessages($langs->trans("ErrorFailToRenameFile", $filenamefrom, $filenameto), null, 'errors'); } } } diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 7d5f742a779..37ccea748f1 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -67,7 +67,7 @@ class Utils // Delete temporary files if ($dolibarr_main_data_root) { - $filesarray=dol_dir_list($dolibarr_main_data_root, "directories", 1, '^temp$', '', '', '', 2, 0, '', 1); // Do not follow symlinks + $filesarray=dol_dir_list($dolibarr_main_data_root, "directories", 1, '^temp$', '', 'name', SORT_ASC, 2, 0, '', 1); // Do not follow symlinks if ($choice == 'tempfilesold') { $now = dol_now(); @@ -81,10 +81,10 @@ class Utils if ($choice=='allfiles') { - // Delete all files (except install.lock) + // Delete all files (except install.lock, do not follow symbolic links) if ($dolibarr_main_data_root) { - $filesarray=dol_dir_list($dolibarr_main_data_root,"all",0,'','install\.lock$'); + $filesarray=dol_dir_list($dolibarr_main_data_root, "all", 0, '', 'install\.lock$', 'name', SORT_ASC, 0, 0, '', 1); } } @@ -93,7 +93,7 @@ class Utils // Define files log if ($dolibarr_main_data_root) { - $filesarray=dol_dir_list($dolibarr_main_data_root, "files", 0, '.*\.log[\.0-9]*$', 'install\.lock$'); + $filesarray=dol_dir_list($dolibarr_main_data_root, "files", 0, '.*\.log[\.0-9]*$', 'install\.lock$', 'name', SORT_ASC, 0, 0, '', 1); } $filelog=''; diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index b8eef6b5102..61b95c50064 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -398,7 +398,7 @@ class Expedition extends CommonObject if (($lineId = $expeditionline->insert()) < 0) { - $this->error[]=$expeditionline->error; + $this->errors[]=$expeditionline->error; } return $lineId; } @@ -2383,9 +2383,9 @@ class ExpeditionLigne extends CommonObjectLine $error=0; // Check parameters - if (empty($this->fk_expedition) || empty($this->fk_origin_line) || empty($this->qty)) + if (empty($this->fk_expedition) || empty($this->fk_origin_line) || ! is_numeric($this->qty)) { - $this->errors[] = 'ErrorMandatoryParametersNotProvided'; + $this->error = 'ErrorMandatoryParametersNotProvided'; return -1; } // Clean parameters @@ -2425,7 +2425,6 @@ class ExpeditionLigne extends CommonObjectLine $result=$this->call_trigger('LINESHIPPING_INSERT',$user); if ($result < 0) { - $this->errors[]=$this->error; $error++; } // End call triggers @@ -2441,6 +2440,7 @@ class ExpeditionLigne extends CommonObjectLine dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); $this->error.=($this->error?', '.$errmsg:$errmsg); } + $this->db->rollback(); return -1*$error; } diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index e3e78d4a338..2a130fad193 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -437,7 +437,7 @@ CREATE TABLE llx_expensereport_rules ( fk_usergroup integer DEFAULT NULL, fk_c_type_fees integer NOT NULL, code_expense_rules_type varchar(50) NOT NULL, - is_for_all tinyint DEFAULT '0', + is_for_all tinyint DEFAULT 0, entity integer DEFAULT 1 )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_expensereport_rules.sql b/htdocs/install/mysql/tables/llx_expensereport_rules.sql index 3aaca6f00b5..feacf572c1f 100644 --- a/htdocs/install/mysql/tables/llx_expensereport_rules.sql +++ b/htdocs/install/mysql/tables/llx_expensereport_rules.sql @@ -29,6 +29,6 @@ CREATE TABLE llx_expensereport_rules ( fk_usergroup integer DEFAULT NULL, fk_c_type_fees integer NOT NULL, code_expense_rules_type varchar(50) NOT NULL, - is_for_all tinyint DEFAULT '0', + is_for_all tinyint DEFAULT 0, entity integer DEFAULT 1 ) ENGINE=InnoDB; \ No newline at end of file diff --git a/htdocs/langs/fr_FR/accountancy.lang b/htdocs/langs/fr_FR/accountancy.lang index 85d1f6a5b58..ff24ea0c023 100644 --- a/htdocs/langs/fr_FR/accountancy.lang +++ b/htdocs/langs/fr_FR/accountancy.lang @@ -224,8 +224,8 @@ GeneralLedgerSomeRecordWasNotRecorded=Certaines des opérations n'ont pu être e NoNewRecordSaved=Plus d'enregistrements à journaliser ListOfProductsWithoutAccountingAccount=Liste des produits non liés à un compte comptable ChangeBinding=Changer les liens -Accounted=Comptabilisé dans le grand livre -NotYetAccounted=Pas encore comptabilisé dans le grand livre +Accounted=Comptabilisé +NotYetAccounted=Pas encore comptabilisé ## Admin ApplyMassCategories=Application en masse des catégories diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index baa0b424650..1e24190f90d 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -384,6 +384,7 @@ class SupplierProposal extends CommonObject if (empty($info_bits)) $info_bits=0; if (empty($rang)) $rang=0; if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0; + if (empty($pu_ht)) $pu_ht=0; $remise_percent=price2num($remise_percent); $qty=price2num($qty);
'.$langs->trans("Fields").''.$langs->trans("Type").''.$langs->trans("Index").''.$langs->trans("FieldsLinked").'
$row[0]$row[1]$row[3]".$row[0]."".$row[1]."".$row[3]."".(empty($row[4])?'':$row[4])."".(empty($row[5])?'':$row[5])."".(empty($row[6])?'':$row[6])."".(empty($row[7])?'':$row[7])."".(isset($link[$row[0]][0])?$link[$row[0]][0]:'')."."; print (isset($link[$row[0]][1])?$link[$row[0]][1]:'')."