diff --git a/ChangeLog b/ChangeLog index 68d6b1848f1..e70169095be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -43,14 +43,31 @@ Dolibarr better: - All fields "fk_societe" were renamed into "fk_soc". ***** ChangeLog for 3.7.1 compared to 3.7.* ***** -- Fix: Bug in the new photo system -- Fix: Error management -- Fix: [ Bug #2714 ] Members -> Memberxy-> Agenda -> technical Error -- Fix: [ Bug #2713 ] 3.7.0 mailing-unsubscribe.php not unsubscribe +FIX Bug in the new photo system +FIX Error management +FIX [ Bug #2714 ] Members -> Memberxy-> Agenda -> technical Error +FIX [ Bug #2713 ] 3.7.0 mailing-unsubscribe.php not unsubscribe +FIX #2901 +FIX when we create an agenda event with "Not applicable" status, it is automatically saved with "To do" status +FIX check the user status during authentication +FIX top links menu have target attribute with wrong value +FIX extrafields required on thirdparty +FIX create contact with extrafield is null when it is require +FIX width multiselect +FIX "script" tag with wrong syntax +Fix bug debian 786479 +FIX update usergroup name +Fix facturestats was not filtering on invoice type +FIX #2856 : Wrong table design +FIX button create payment hide if tax amount is less than 1 +FIX event for restricted user was restricted if company null +FIX send mail, copy sendto don't read the list of contact +FIX Properly escape untrusted data to prevent HTML injection. +FIX send mail, copy sendto don't read the list of contact -- Path to save photos of products was moved in 3.7.0 to match path of other attached files. If you had loose - your photo on the photo tab of products, you can set the constant "PRODUCT_USE_OLD_PATH_FOR_PHOTO" to - restore old path. +Path to save photos of products was moved in 3.7.0 to match path of other attached files. If you had loose +your photo on the photo tab of products, you can set the constant "PRODUCT_USE_OLD_PATH_FOR_PHOTO" to +restore old path. WARNING: @@ -236,8 +253,8 @@ Dolibarr better: - Table llx_c_pays were renamed into llx_c_country. - Triggers *_BUILDDOC are removed. Building a doc is not a business event. For action after creation of a pdf or odt, hook "afterPDFCreation" or "afterODTCreation" must be used instead. -- A lot of pages called fiche.php were renamed into card.php -- A lot of pages called liste.php were renamed into list.php +- A lot of pages named fiche.php were renamed into card.php +- A lot of pages named liste.php were renamed into list.php - If you used warehouse/stock module, recheck setup of stock increase/decrease rules of the warehouse module and your Point Of Sale module setup if you use one. - Replaced USER_UPDATE_SESSION trigger with an updateSession hook may break modules using it. diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index e5962978e2b..bdfc9d8972a 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -982,10 +982,10 @@ if ($nboftargetok) { mkdir($DESTI.'/package_windows'); if (-d $DESTI.'/package_windows') { $NEWDESTI=$DESTI.'/package_windows'; } - print "Remove target $FILENAMEEXEDOLIWAMP.exe...\n"; + print "Remove target $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe...\n"; unlink "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"; - print "Check that in your Wine setup, you create a Z: drive that point to your /tmp directory.\n"; + print "Check that in your Wine setup, you create a Z: drive that point to your / directory.\n"; $SOURCEBACK=$SOURCE; $SOURCEBACK =~ s/\//\\/g; diff --git a/dev/codesniffer/ruleset.xml b/dev/codesniffer/ruleset.xml index 7f16ad02a76..9b5c0931650 100755 --- a/dev/codesniffer/ruleset.xml +++ b/dev/codesniffer/ruleset.xml @@ -350,6 +350,11 @@ + + + 0 + + \ No newline at end of file + diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 7c0e9f14a0b..45ba2b24f8c 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -37,22 +37,17 @@ if (! defined('EURO')) define('EURO',chr(128)); // Define syslog constants if (! defined('LOG_DEBUG')) { - if (function_exists("define_syslog_variables")) - { - define_syslog_variables(); // Deprecated since php 5.3.0, syslog variables no longer need to be initialized - } - else - { - // Pour PHP sans syslog (comme sous Windows) - define('LOG_EMERG',0); - define('LOG_ALERT',1); - define('LOG_CRIT',2); - define('LOG_ERR',3); - define('LOG_WARNING',4); - define('LOG_NOTICE',5); - define('LOG_INFO',6); - define('LOG_DEBUG',7); - } + if (! function_exists("syslog")) { + // For PHP versions without syslog (like running on Windows OS) + define('LOG_EMERG',0); + define('LOG_ALERT',1); + define('LOG_CRIT',2); + define('LOG_ERR',3); + define('LOG_WARNING',4); + define('LOG_NOTICE',5); + define('LOG_INFO',6); + define('LOG_DEBUG',7); + } } // End of common declaration part diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index ccd17a2f97b..6628aeb19d7 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -55,6 +55,7 @@ class CommandeFournisseur extends CommonOrder /** * TODO: Remove * @deprecated + * @see product_ref */ var $ref; var $product_ref; @@ -78,8 +79,13 @@ class CommandeFournisseur extends CommonOrder var $total_localtax2; // Total Local tax 2 var $total_ttc; var $source; + /** + * @deprecated + * @see note_private, note_public + */ var $note; - var $note_public; + public $note_private; + public $note_public; var $model_pdf; var $fk_project; var $cond_reglement_id; @@ -2465,6 +2471,7 @@ class CommandeFournisseurLigne extends CommonOrderLine * Supplier ref * @var string * @deprecated Use ref_supplier + * @see ref_supplier */ public $ref_fourn; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 1cfbe941d9a..03ff0ff1eb2 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -58,12 +58,9 @@ class FactureFournisseur extends CommonInvoice var $type = self::TYPE_STANDARD; /** - * Check constants for more info: - * - STATUS_DRAFT - * - STATUS_VALIDATED - * - STATUS_PAID - * - STATUS_ABANDONED + * Supplier invoice status * @var int + * @see FactureFournisseur::STATUS_DRAFT, FactureFournisseur::STATUS_VALIDATED, FactureFournisseur::STATUS_PAID, FactureFournisseur::STATUS_ABANDONED */ var $statut; //! 1 si facture payee COMPLETEMENT, 0 sinon (ce champ ne devrait plus servir car insuffisant) @@ -85,7 +82,11 @@ class FactureFournisseur extends CommonInvoice var $total_localtax1; var $total_localtax2; var $total_ttc; - var $note; // deprecated + /** + * @deprecated + * @see note_private, note_public + */ + var $note; var $note_private; var $note_public; var $propalid; @@ -100,7 +101,10 @@ class FactureFournisseur extends CommonInvoice * @var SupplierInvoiceLine[] */ public $lines = array(); - var $fournisseur; // deprecated + /** + * @deprecated + */ + var $fournisseur; //Incorterms var $fk_incoterms; @@ -1896,9 +1900,17 @@ class SupplierInvoiceLine extends CommonObjectLine var $oldline; + /** + * @deprecated + * @see product_ref + */ public $ref; public $product_ref; public $ref_supplier; + /** + * @deprecated + * @see label + */ public $libelle; public $product_desc; @@ -1906,8 +1918,10 @@ class SupplierInvoiceLine extends CommonObjectLine * Unit price before taxes * @var float * @deprecated Use $subprice + * @see subprice */ public $pu_ht; + public $subprice; /** * Unit price included taxes @@ -1919,8 +1933,10 @@ class SupplierInvoiceLine extends CommonObjectLine * Total VAT amount * @var float * @deprecated Use $total_tva instead + * @see total_tva */ public $tva; + public $total_tva; /** * Id of the corresponding supplier invoice @@ -1932,7 +1948,7 @@ class SupplierInvoiceLine extends CommonObjectLine * Product label * @var string */ - var $label; // deprecated + var $label; /** * Description of the line diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 48c238d60be..9c4a95c7c52 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -42,7 +42,11 @@ class ProductFournisseur extends Product var $product_fourn_price_id; // id of ligne product-supplier var $id; // product id - var $fourn_ref; // deprecated + /** + * @deprecated + * @see ref_supplier + */ + var $fourn_ref; var $delivery_time_days; var $ref_supplier; // ref supplier (can be set by get_buyprice) var $vatrate_supplier; // default vat rate for this supplier/qty/product (can be set by get_buyprice) @@ -161,6 +165,7 @@ class ProductFournisseur extends Product function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges=0, $remise_percent=0, $remise=0, $newnpr=0, $delivery_time_days=0) { global $conf, $langs; + //global $mysoc; // Clean parameter if (empty($qty)) $qty=0; @@ -348,7 +353,8 @@ class ProductFournisseur extends Product if ($obj) { $this->product_fourn_price_id = $rowid; - $this->fourn_ref = $obj->ref_fourn; + $this->fourn_ref = $obj->ref_fourn; // deprecated + $this->ref_supplier = $obj->ref_fourn; $this->fourn_price = $obj->price; $this->fourn_charges = $obj->charges; $this->fourn_qty = $obj->quantity; diff --git a/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php index 3fb22d4a101..0c2d5eed0af 100644 --- a/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php @@ -39,6 +39,7 @@ print_titre($langs->trans('RelatedSupplierOrders')); trans("Status"); ?> - \ No newline at end of file + diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index bf310d92f8d..b4b853b58bc 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1508,7 +1508,16 @@ if ($action == 'create') $langs->load('orders'); $txt=$langs->trans("SupplierOrder"); } - print ''.$txt.''.$objectsrc->getNomUrl(1).''; + print ''.$txt.''.$objectsrc->getNomUrl(1); + //We check if Origin document has already an invoice attached to it + $objectsrc->fetchObjectLinked($originid,'','','invoice_supplier'); + $cntinvoice=count($objectsrc->linkedObjects['invoice_supplier']); + if ($cntinvoice>=1) + { + setEventMessage('WarningBillExist','warnings'); + echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['facture'])->getNomUrl(1).')'; + } + echo ''; print ''.$langs->trans('TotalHT').''.price($objectsrc->total_ht).''; print ''.$langs->trans('TotalVAT').''.price($objectsrc->total_tva).""; if ($mysoc->country_code=='ES') diff --git a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php index 6bbee5a33fc..81f259d67c6 100644 --- a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php @@ -40,6 +40,7 @@ print_titre($langs->trans("RelatedSupplierInvoices")); trans("Status"); ?> - \ No newline at end of file + diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 90492fa16f1..f76d9843e02 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -38,6 +38,10 @@ class Holiday extends CommonObject var $error; var $errors=array(); + /** + * @deprecated + * @see id + */ var $rowid; var $ref; diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index e73b716a654..399f8099ca6 100755 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -98,36 +98,36 @@ ALTER TABLE llx_accountingaccount add column fk_user_author integer DEFAULT NULL ALTER TABLE llx_accountingaccount add column fk_user_modif integer DEFAULT NULL AFTER fk_user_author; -- Qual -UPDATE llx_const SET name = 'ACCOUNTING_MODE' WHERE name = 'COMPTA_MODE'; -UPDATE llx_const SET name = 'ACCOUNTING_ACCOUNT_CUSTOMER' WHERE name = 'COMPTA_ACCOUNT_CUSTOMER'; -UPDATE llx_const SET name = 'ACCOUNTING_ACCOUNT_SUPPLIER' WHERE name = 'COMPTA_ACCOUNT_SUPPLIER'; -UPDATE llx_const SET name = 'ACCOUNTING_PRODUCT_BUY_ACCOUNT' WHERE name = 'COMPTA_PRODUCT_BUY_ACCOUNT'; -UPDATE llx_const SET name = 'ACCOUNTING_PRODUCT_SOLD_ACCOUNT' WHERE name = 'COMPTA_PRODUCT_SOLD_ACCOUNT'; -UPDATE llx_const SET name = 'ACCOUNTING_SERVICE_BUY_ACCOUNT' WHERE name = 'COMPTA_SERVICE_BUY_ACCOUNT'; -UPDATE llx_const SET name = 'ACCOUNTING_SERVICE_SOLD_ACCOUNT' WHERE name = 'COMPTA_SERVICE_SOLD_ACCOUNT'; -UPDATE llx_const SET name = 'ACCOUNTING_VAT_ACCOUNT' WHERE name = 'COMPTA_VAT_ACCOUNT'; -UPDATE llx_const SET name = 'ACCOUNTING_VAT_BUY_ACCOUNT' WHERE name = 'COMPTA_VAT_BUY_ACCOUNT'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_MODE')__ WHERE __DECRYPT('name')__ = 'COMPTA_MODE'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_ACCOUNT_CUSTOMER')__ WHERE __DECRYPT('name')__ = 'COMPTA_ACCOUNT_CUSTOMER'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_ACCOUNT_SUPPLIER')__ WHERE __DECRYPT('name')__ = 'COMPTA_ACCOUNT_SUPPLIER'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_PRODUCT_BUY_ACCOUNT')__ WHERE __DECRYPT('name')__ = 'COMPTA_PRODUCT_BUY_ACCOUNT'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_PRODUCT_SOLD_ACCOUNT')__ WHERE __DECRYPT('name')__ = 'COMPTA_PRODUCT_SOLD_ACCOUNT'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_SERVICE_BUY_ACCOUNT')__ WHERE __DECRYPT('name')__ = 'COMPTA_SERVICE_BUY_ACCOUNT'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_SERVICE_SOLD_ACCOUNT')__ WHERE __DECRYPT('name')__ = 'COMPTA_SERVICE_SOLD_ACCOUNT'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_VAT_ACCOUNT')__ WHERE __DECRYPT('name')__ = 'COMPTA_VAT_ACCOUNT'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_VAT_BUY_ACCOUNT')__ WHERE __DECRYPT('name')__ = 'COMPTA_VAT_BUY_ACCOUNT'; -- Compatibility with module Accounting Expert -UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_MODELCSV' WHERE name = 'ACCOUNTINGEX_MODELCSV'; -UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_SEPARATORCSV' WHERE name = 'ACCOUNTINGEX_SEPARATORCSV'; -UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_DATE' WHERE name = 'ACCOUNTINGEX_EXP_DATE'; -UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_PIECE' WHERE name = 'ACCOUNTINGEX_EXP_PIECE'; -UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_GLOBAL_ACCOUNT' WHERE name = 'ACCOUNTINGEX_EXP_GLOBAL_ACCOUNT'; -UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_LABEL' WHERE name = 'ACCOUNTINGEX_EXP_LABEL'; -UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_AMOUNT' WHERE name = 'ACCOUNTINGEX_EXP_AMOUNT'; -UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_DEVISE' WHERE name = 'ACCOUNTINGEX_EXP_DEVISE'; -UPDATE llx_const SET name = 'ACCOUNTING_ACCOUNT_SUSPENSE' WHERE name = 'ACCOUNTINGEX_ACCOUNT_SUSPENSE'; -UPDATE llx_const SET name = 'ACCOUNTING_SELL_JOURNAL' WHERE name = 'ACCOUNTINGEX_SELL_JOURNAL'; -UPDATE llx_const SET name = 'ACCOUNTING_PURCHASE_JOURNAL' WHERE name = 'ACCOUNTINGEX_PURCHASE_JOURNAL'; -UPDATE llx_const SET name = 'ACCOUNTING_SOCIAL_JOURNAL' WHERE name = 'ACCOUNTINGEX_SOCIAL_JOURNAL'; -UPDATE llx_const SET name = 'ACCOUNTING_MISCELLANEOUS_JOURNAL' WHERE name = 'ACCOUNTINGEX_MISCELLANEOUS_JOURNAL'; -UPDATE llx_const SET name = 'ACCOUNTING_ACCOUNT_TRANSFER_CASH' WHERE name = 'ACCOUNTINGEX_ACCOUNT_TRANSFER_CASH'; -UPDATE llx_const SET name = 'ACCOUNTING_LENGTH_GACCOUNT' WHERE name = 'ACCOUNTINGEX_LENGTH_GACCOUNT'; -UPDATE llx_const SET name = 'ACCOUNTING_LENGTH_AACCOUNT' WHERE name = 'ACCOUNTINGEX_LENGTH_AACCOUNT'; -UPDATE llx_const SET name = 'ACCOUNTING_LIMIT_LIST_VENTILATION' WHERE name = 'ACCOUNTINGEX_LIMIT_LIST_VENTILATION'; -UPDATE llx_const SET name = 'ACCOUNTING_LIST_SORT_VENTILATION_TODO' WHERE name = 'ACCOUNTINGEX_LIST_SORT_VENTILATION_TODO'; -UPDATE llx_const SET name = 'ACCOUNTING_LIST_SORT_VENTILATION_DONE' WHERE name = 'ACCOUNTINGEX_LIST_SORT_VENTILATION_DONE'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_EXPORT_MODELCSV')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_MODELCSV'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_EXPORT_SEPARATORCSV')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_SEPARATORCSV'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_EXPORT_DATE')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_EXP_DATE'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_EXPORT_PIECE')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_EXP_PIECE'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_EXPORT_GLOBAL_ACCOUNT')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_EXP_GLOBAL_ACCOUNT'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_EXPORT_LABEL')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_EXP_LABEL'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_EXPORT_AMOUNT')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_EXP_AMOUNT'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_EXPORT_DEVISE')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_EXP_DEVISE'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_ACCOUNT_SUSPENSE')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_ACCOUNT_SUSPENSE'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_SELL_JOURNAL')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_SELL_JOURNAL'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_PURCHASE_JOURNAL')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_PURCHASE_JOURNAL'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_SOCIAL_JOURNAL')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_SOCIAL_JOURNAL'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_MISCELLANEOUS_JOURNAL')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_MISCELLANEOUS_JOURNAL'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_ACCOUNT_TRANSFER_CASH')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_ACCOUNT_TRANSFER_CASH'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_LENGTH_GACCOUNT')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_LENGTH_GACCOUNT'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_LENGTH_AACCOUNT')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_LENGTH_AACCOUNT'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_LIMIT_LIST_VENTILATION')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_LIMIT_LIST_VENTILATION'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_LIST_SORT_VENTILATION_TODO')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_LIST_SORT_VENTILATION_TODO'; +UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_LIST_SORT_VENTILATION_DONE')__ WHERE __DECRYPT('name')__ = 'ACCOUNTINGEX_LIST_SORT_VENTILATION_DONE'; -- Drop old table DROP TABLE llx_compta; @@ -1133,9 +1133,9 @@ ALTER TABLE llx_c_email_templates ADD UNIQUE INDEX uk_c_email_templates(entity, ALTER TABLE llx_c_email_templates ADD INDEX idx_type(type_template); -- Remove OSC module -DELETE FROM llx_const WHERE name = 'MAIN_MODULE_BOUTIQUE'; -DELETE FROM llx_const WHERE name = 'OSC_DB_HOST'; -DELETE FROM llx_menu WHERE module = 'boutique'; +DELETE FROM llx_const WHERE __DECRYPT('name')__ = 'MAIN_MODULE_BOUTIQUE'; +DELETE FROM llx_const WHERE __DECRYPT('name')__ = 'OSC_DB_HOST'; +DELETE FROM llx_menu WHERE __DECRYPT('module')__ = 'boutique'; -- Add option always editable on extrafield ALTER TABLE llx_extrafields ADD alwayseditable INTEGER DEFAULT 0 AFTER pos; @@ -1181,4 +1181,5 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_typ ALTER TABLE llx_livraison MODIFY COLUMN date_delivery DATETIME NULL DEFAULT NULL; -INSERT INTO llx_const (name, value, type, note, visible, entity) SELECT 'PRODUCT_USE_OLD_PATH_FOR_PHOTO','1','chaine','Use old path for products images',0,1 FROM llx_const WHERE name='MAIN_VERSION_LAST_INSTALL' AND value < '3.7.0'; +-- This constant is for compatibility if user come from 3.6 or lower. Must not be enabled on 3.7.0 or + +INSERT INTO llx_const (name, value, type, note, visible, entity) SELECT __ENCRYPT('PRODUCT_USE_OLD_PATH_FOR_PHOTO')__,__ENCRYPT('1')__,'chaine','Use old path for products images',1,0 FROM llx_const WHERE __DECRYPT('name')__ = 'MAIN_VERSION_LAST_INSTALL' AND __DECRYPT('value')__ < '3.7.0'; diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index a9203bdf127..6f14791f6b4 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -3824,8 +3824,9 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array()) if ($moduletoreload == 'MAIN_MODULE_SERVICE') // Permission has changed into 2.7 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Service"); + + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php'; if ($res) { - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php'; $mod=new modService($db); //$mod->remove('noboxes'); $mod->init('newboxdefonly'); @@ -3834,8 +3835,9 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array()) if ($moduletoreload == 'MAIN_MODULE_COMMANDE') // Permission has changed into 2.9 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Commande"); + + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php'; if ($res) { - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php'; $mod=new modCommande($db); //$mod->remove('noboxes'); $mod->init('newboxdefonly'); @@ -3844,8 +3846,8 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array()) if ($moduletoreload == 'MAIN_MODULE_FACTURE') // Permission has changed into 2.9 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Facture"); + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFacture.class.php'; if ($res) { - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFacture.class.php'; $mod=new modFacture($db); //$mod->remove('noboxes'); $mod->init('newboxdefonly'); @@ -3884,8 +3886,8 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array()) if ($moduletoreload == 'MAIN_MODULE_ECM') // Permission has changed into 3.0 and 3.1 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module ECM"); + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modECM.class.php'; if ($res) { - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modECM.class.php'; $mod=new modECM($db); $mod->remove('noboxes'); // We need to remove because a permission id has been removed $mod->init('newboxdefonly'); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index b333442d53b..163267ff52f 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -231,8 +231,8 @@ Security=Security Passwords=Passwords DoNotStoreClearPassword=Do no store clear passwords in database but store only encrypted value (Activated recommended) MainDbPasswordFileConfEncrypted=Database password encrypted in conf.php (Activated recommended) -InstrucToEncodePass=To have password encoded into the conf.php file, replace the line
$dolibarr_main_db_pass="..."
by
$dolibarr_main_db_pass="crypted:%s" -InstrucToClearPass=To have password decoded (clear) into the conf.php file, replace the line
$dolibarr_main_db_pass="crypted:..."
by
$dolibarr_main_db_pass="%s" +InstrucToEncodePass=To have password encoded into the conf.php file, replace the line
$dolibarr_main_db_pass="...";
by
$dolibarr_main_db_pass="crypted:%s"; +InstrucToClearPass=To have password decoded (clear) into the conf.php file, replace the line
$dolibarr_main_db_pass="crypted:...";
by
$dolibarr_main_db_pass="%s"; ProtectAndEncryptPdfFiles=Protection of generated pdf files (Activated NOT recommended, breaks mass pdf generation) ProtectAndEncryptPdfFilesDesc=Protection of a PDF document keeps it available to read and print with any PDF browser. However, editing and copying is not possible anymore. Note that using this feature make building of a global cumulated pdf not working (like unpaid invoices). Feature=Feature @@ -939,6 +939,7 @@ CompanyZip=Zip CompanyTown=Town CompanyCountry=Country CompanyCurrency=Main currency +CompanyObject=Object of the company Logo=Logo DoNotShow=Do not show DoNotSuggestPaymentMode=Do not suggest @@ -1638,4 +1639,4 @@ InstallModuleFromWebHasBeenDisabledByFile=Install of external module from applic ConfFileMuseContainCustom=Installing an external module from application save the module files into directory %s. To have this directory processed by Dolibarr, you must setup your conf/conf.php to have option
- $dolibarr_main_url_root_alt enabled to value $dolibarr_main_url_root_alt="/custom"
- $dolibarr_main_document_root_alt enabled to value "%s/custom" HighlightLinesOnMouseHover=Highlight table lines when mouse move passes over PressF5AfterChangingThis=Press F5 on keyboard after changing this value to have it effective -NotSupportedByAllThemes=Will works with eldy theme but is not supported by all themes \ No newline at end of file +NotSupportedByAllThemes=Will works with eldy theme but is not supported by all themes diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index e700271368d..a0626c1087f 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -410,10 +410,10 @@ OutstandingBillReached=Reached max. for outstanding bill MonkeyNumRefModelDesc=Return numero with format %syymm-nnnn for customer code and %syymm-nnnn for supplier code where yy is year, mm is month and nnnn is a sequence with no break and no return to 0. LeopardNumRefModelDesc=The code is free. This code can be modified at any time. ManagingDirectors=Manager(s) name (CEO, director, president...) -SearchThirdparty=Search thirdparty +SearchThirdparty=Search third party SearchContact=Search contact -MergeOriginThirdparty=Origin thirdparty -MergeThirdparties=Merge thirdparties -ConfirmMergeThirdparties=Are you sure you want to merge this thirdparty? All linked objects (invoices...) will be linked with the destination thirdparty +MergeOriginThirdparty=Duplicate third party (third party you want to delete) +MergeThirdparties=Merge third parties +ConfirmMergeThirdparties=Are you sure you want to merge this third party into the current one ? All linked objects (invoices, orders, ...) will be moved to current third party so you will be able to delete the duplicate one. ThirdpartiesMergeSuccess=Thirdparties have been merged ErrorThirdpartiesMerge=There was an error when deleting the thirdparties. Please check the log. Changes have been reverted. \ No newline at end of file diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index 52db876fbf0..3a1704f8d8d 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -52,6 +52,11 @@ class Livraison extends CommonObject var $ref_customer; var $statut; + /** + * @deprecated + * @see note_public, note_private + */ + var $note; var $note_public; var $note_private; @@ -1014,10 +1019,8 @@ class Livraison extends CommonObject /** * Classe de gestion des lignes de bons de livraison */ -class LivraisonLigne +class LivraisonLigne extends CommonObjectLine { - var $db; - // From llx_expeditiondet var $qty; var $qty_asked; @@ -1027,7 +1030,19 @@ class LivraisonLigne var $origin_id; var $label; // Label produit var $description; // Description produit + /** + * @deprecated + * @see product_ref + */ var $ref; + /** + * @deprecated + * @see product_label; + */ + var $libelle; + + public $product_ref; + public $product_label; /** * Constructor diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php index 51961e37e6e..35ce4cbaaa0 100644 --- a/htdocs/loan/class/paymentloan.class.php +++ b/htdocs/loan/class/paymentloan.class.php @@ -52,6 +52,12 @@ class PaymentLoan extends CommonObject var $fk_user_creat; var $fk_user_modif; + /** + * @deprecated + * @see amount, amounts + */ + var $total; + /** * Constructor * diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index b4c8570dec8..1ab2352395d 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -43,7 +43,12 @@ class Opensurveysondage extends CommonObject var $id; var $id_sondage; + /** + * @deprecated + * @see description + */ var $commentaires; + public $description; var $mail_admin; var $nom_admin; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index d2c3deeb2e4..079c0772d8b 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -59,10 +59,15 @@ class Product extends CommonObject var $id ; //! Ref var $ref; - /** - * Product label - * @var string - */ + /* + * @deprecated + * @see label + */ + var $libelle; + /** + * Product label + * @var string + */ var $label; /** * Product descripion @@ -183,6 +188,20 @@ class Product extends CommonObject var $fk_price_expression; + /** + * @deprecated + * @see fourn_pu + */ + var $buyprice; + public $fourn_pu; + + /** + * @deprecated + * @see ref_supplier + */ + var $ref_fourn; + public $ref_supplier; + /** * Unit code ('km', 'm', 'l', 'p', ...) * @var string @@ -817,6 +836,11 @@ class Product extends CommonObject */ function delete($id=0) { + // Deprecation warning + if (0 == $id) { + dol_syslog(__METHOD__ . " with parameter is deprecated", LOG_WARNING); + } + global $conf,$user,$langs; require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; @@ -1252,7 +1276,7 @@ class Product extends CommonObject $obj->price = $price_result; } } - $this->buyprice = $obj->price; // \deprecated + $this->buyprice = $obj->price; // deprecated $this->fourn_pu = $obj->price / $obj->quantity; // Prix unitaire du produit pour le fournisseur $fourn_id $this->ref_fourn = $obj->ref_fourn; // Ref supplier $this->vatrate_supplier = $obj->tva_tx; // Vat ref supplier @@ -3915,9 +3939,9 @@ class Product extends CommonObject /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id + * @param DoliDB $db Database handler + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id * @return bool */ public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 6a36d59b3b2..860475c5596 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -311,7 +311,7 @@ if (empty($reshook)) $result = $object->setValid($user); if ($result <= 0) { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -320,7 +320,7 @@ if (empty($reshook)) $result = $object->setClose($user); if ($result <= 0) { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -329,7 +329,7 @@ if (empty($reshook)) $result = $object->setValid($user); if ($result <= 0) { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -339,14 +339,14 @@ if (empty($reshook)) $result=$object->delete($user); if ($result > 0) { - header("Location: index.php"); + setEventMessage($langs->trans("RecordDeleted"), 'info'); + header("Location: index.php"); exit; } else { dol_syslog($object->error,LOG_DEBUG); - setEventMessage($object->error,'errors'); - setEventMessage($object->errors,'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -737,11 +737,11 @@ else { if ($userWrite > 0) { - print ''.$langs->trans("Modify").''; + print ''; } else { - print ''.$langs->trans('Modify').''; + print ''; } } @@ -750,11 +750,11 @@ else { if ($userWrite > 0) { - print ''.$langs->trans("Validate").''; + print ''; } else { - print ''.$langs->trans('Validate').''; + print ''; } } @@ -763,11 +763,11 @@ else { if ($userWrite > 0) { - print ''.$langs->trans("Close").''; + print ''; } else { - print ''.$langs->trans('Close').''; + print ''; } } @@ -776,11 +776,11 @@ else { if ($userWrite > 0) { - print ''.$langs->trans("ReOpen").''; + print ''; } else { - print ''.$langs->trans('ReOpen').''; + print ''; } } @@ -789,11 +789,11 @@ else { if ($userWrite > 0) { - print ''.$langs->trans('ToClone').''; + print ''; } else { - print ''.$langs->trans('ToClone').''; + print ''; } } @@ -802,11 +802,11 @@ else { if ($userDelete > 0) { - print ''.$langs->trans("Delete").''; + print ''; } else { - print ''.$langs->trans('Delete').''; + print ''; } } } diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index a5ae027d2b7..4e505eb0910 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -46,6 +46,12 @@ class Project extends CommonObject var $id; var $ref; var $description; + /** + * @var string + * @deprecated + * @see title + */ + public $titre; var $title; var $date_start; var $date_end; @@ -66,6 +72,27 @@ class Project extends CommonObject var $weekWorkLoad; // Used to store workload details of a projet var $weekWorkLoadPerTask; // Used to store workload details of tasks of a projet + /** + * @var int Creation date + * @deprecated + * @see date_c + */ + public $datec; + /** + * @var int Creation date + */ + public $date_c; + /** + * @var int Modification date + * @deprecated + * @see date_m + */ + public $datem; + /** + * @var int Modification date + */ + public $date_m; + /** * Constructor @@ -515,7 +542,7 @@ class Project extends CommonObject // Set fk_projet into elements to null $listoftables=array( 'facture'=>'fk_projet','propal'=>'fk_projet','commande'=>'fk_projet','facture_fourn'=>'fk_projet','commande_fournisseur'=>'fk_projet', - 'expensereport_det'=>'fk_projet','contrat'=>'fk_projet','fichinter'=>'fk_projet','don'=>'fk_project' + 'expensereport_det'=>'fk_projet','contrat'=>'fk_projet','fichinter'=>'fk_projet','don'=>'fk_projet' ); foreach($listoftables as $key => $value) { diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 5d8085efcdd..93dcc7226a2 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -37,7 +37,7 @@ $langs->load("projects"); $langs->load("companies"); $id=GETPOST('id','int'); -$ref=GETPOST('ref','alpha'); +$ref=GETPOST("ref",'alpha',1); $action=GETPOST('action','alpha'); $confirm=GETPOST('confirm','alpha'); $withproject=GETPOST('withproject','int'); @@ -81,6 +81,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer) $task_parent=$tmparray[1]; if (empty($task_parent)) $task_parent = 0; // If task_parent is '' + $object->ref = GETPOST("ref",'alpha',2); $object->label = $_POST["label"]; $object->description = $_POST['description']; $object->fk_task_parent = $task_parent; @@ -308,7 +309,7 @@ if ($id > 0 || ! empty($ref)) // Ref print ''.$langs->trans("Ref").''; - print ''.$object->ref.''; + print ''; // Label print ''.$langs->trans("Label").''; diff --git a/htdocs/public/api/index.php b/htdocs/public/api/index.php index d5065e45a32..17b691675c5 100644 --- a/htdocs/public/api/index.php +++ b/htdocs/public/api/index.php @@ -28,7 +28,7 @@ if (! defined("NOLOGIN")) define("NOLOGIN",'1'); $res=0; -if (! $res && file_exists("../../main.inc.php")) $res=@include '../../main.inc.php'; +if (! $res && file_exists("../../main.inc.php")) $res=@include '../../main.inc.php'; if (! $res && file_exists("../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../dolibarr/htdocs/main.inc.php'; // For custom directory if (! $res) die("Include of main fails"); @@ -47,7 +47,7 @@ if (empty($conf->global->MAIN_MODULE_API)) exit; } -use Luracast\Restler\Defaults; +use \Luracast\Restler\Defaults; Defaults::setProperty('authenticationMethod','_isAllowed'); $api = new DolibarrApi($db); @@ -64,7 +64,7 @@ foreach ($modulesdir as $dir) * Search available module */ dol_syslog("Scan directory ".$dir." for API modules"); - + $handle=@opendir(dol_osencode($dir)); if (is_resource($handle)) { @@ -81,7 +81,7 @@ foreach ($modulesdir as $dir) if ($module == 'societe') { $obj = 'thirdparty'; } - if ($module == 'categorie') { + if ($module == 'categorie') { $part = 'categories'; $obj = 'category'; } @@ -90,7 +90,7 @@ foreach ($modulesdir as $dir) $obj = 'facture'; } if (empty($conf->$module->enabled)) $enabled=false; - + if ($enabled) { /* @@ -102,7 +102,7 @@ foreach ($modulesdir as $dir) * @todo : use getElementProperties() function ? */ $dir_part = DOL_DOCUMENT_ROOT.'/'.$part.'/class/'; - + $handle_part=@opendir(dol_osencode($dir_part)); if (is_resource($handle_part)) { @@ -125,4 +125,4 @@ foreach ($modulesdir as $dir) } } -$api->r->handle(); //serve the response \ No newline at end of file +$api->r->handle(); //serve the response diff --git a/htdocs/public/test/test_forms.php b/htdocs/public/test/test_forms.php index f14652f6dc0..0a99b11e3aa 100644 --- a/htdocs/public/test/test_forms.php +++ b/htdocs/public/test/test_forms.php @@ -17,8 +17,8 @@ llxHeader();

This page is a sample of page using Dolibarr HTML widget methods. It is designed to make test with
- css (add parameter &theme=newtheme to test another theme or edit css of current theme)
-- jmobile (add parameter dol_use_jmobile=1&dol_optimize_smallscreen=1 to enable view with jmobile)
-- no javascript / usage for bind people (add parameter nojs=1 to force disable javascript)
+- jmobile (add parameter ">dol_use_jmobile=1&dol_optimize_smallscreen=1 to enable view with jmobile)
+- no javascript / usage for bind people (add parameter ">nojs=1 to force disable javascript)


diff --git a/htdocs/resource/class/resource.class.php b/htdocs/resource/class/resource.class.php index 33df80fc095..cac917fa85b 100644 --- a/htdocs/resource/class/resource.class.php +++ b/htdocs/resource/class/resource.class.php @@ -606,9 +606,9 @@ class Resource extends CommonObject * Fetch all resources available, declared by modules * Load available resource in array $this->available_resources * - * note : deprecated, remplaced by hook getElementResources - * * @return int number of available resources declared by modules + * @deprecated, remplaced by hook getElementResources + * @see getElementResources() */ function fetch_all_available() { global $conf; diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index f1472dcb2d7..383ed9e8ff8 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -52,6 +52,8 @@ abstract class ActionsCardCommon */ private function getInstanceDao() { + dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING); + if (! is_object($this->object)) { $modelclassfile = dol_buildpath('/'.$this->dirmodule.'/canvas/'.$this->canvas.'/dao_'.$this->targetmodule.'_'.$this->canvas.'.class.php'); diff --git a/htdocs/societe/class/client.class.php b/htdocs/societe/class/client.class.php index 2bff90f2f3f..f3e7a8dcce9 100644 --- a/htdocs/societe/class/client.class.php +++ b/htdocs/societe/class/client.class.php @@ -108,7 +108,7 @@ class Client extends Societe while ($i < $num) { $obj=$this->db->fetch_object($resql); - $this->cacheprospectstatus[$obj->id]=array('id'=>$obj->id, 'code'=>$obj->code, 'label'=> $langs->trans("aaa")?$obj->label:''); + $this->cacheprospectstatus[$obj->id]=array('id'=>$obj->id, 'code'=>$obj->code, 'label'=> ($langs->trans("ST_".strtoupper($obj->code))=="ST_".strtoupper($obj->code))?$obj->label:$langs->trans("ST_".strtoupper($obj->code))); $i++; } return 1; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index e4b6334690e..bce15b081bb 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -59,6 +59,7 @@ class Societe extends CommonObject * Thirdparty name * @var string * @deprecated Use $name instead + * @see name */ public $nom; @@ -88,18 +89,21 @@ class Societe extends CommonObject * State code * @var string * @deprecated Use state_code instead + * @see state_code */ var $departement_code; /** * @var string * @deprecated Use state instead + * @see state */ var $departement; /** * @var string * @deprecated Use country instead + * @see country */ var $pays; var $country_id; @@ -298,6 +302,7 @@ class Societe extends CommonObject /** * @var string * @deprecated Note is split in public and private notes + * @see note_public, note_private */ var $note; @@ -2804,7 +2809,7 @@ class Societe extends CommonObject if (empty($name)) $name=$member->getFullName($langs); // Positionne parametres - $this->nom=$name; // TODO obsolete + $this->nom=$name; // TODO deprecated $this->name=$name; $this->address=$member->address; $this->zip=$member->zip; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 810055da1f1..ec9a63f64d4 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Brian Fraval - * Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Patrick Raguin @@ -98,22 +98,29 @@ if (empty($reshook)) { if ($action == 'confirm_merge' && $confirm == 'yes') { + $object->fetch($socid); + $errors = 0; $soc_origin_id = GETPOST('soc_origin', 'int'); $soc_origin = new Societe($db); - if ($soc_origin_id < 1) { + if ($soc_origin_id < 1) + { $langs->load('errors'); $langs->load('companies'); setEventMessage($langs->trans('ErrorProdIdIsMandatory', $langs->trans('MergeOriginThirdparty')), 'errors'); - } else { + } + else + { - if (!$errors && $soc_origin->fetch($soc_origin_id) < 1) { + if (!$errors && $soc_origin->fetch($soc_origin_id) < 1) + { setEventMessage($langs->trans('ErrorRecordNotFound'), 'errors'); $errors++; } - if (!$errors) { + if (!$errors) + { $db->begin(); $objects = array( @@ -141,13 +148,13 @@ if (empty($reshook)) ); //First, all core objects must update their tables - foreach ($objects as $object_name => $object_file) { - + foreach ($objects as $object_name => $object_file) + { require_once DOL_DOCUMENT_ROOT.$object_file; - if (!$errors && !$object_name::replaceThirdparty($db, $soc_origin->id, $object->id)) { + if (!$errors && !$object_name::replaceThirdparty($db, $soc_origin->id, $object->id)) + { $errors++; - $db->rollback(); } } @@ -156,32 +163,37 @@ if (empty($reshook)) 'mergethirds' )); - if (!$errors) { + if (!$errors) + { $reshook = $hookmanager->executeHooks('replaceThirdparty', array( 'soc_origin' => $soc_origin->id, 'soc_dest' => $object->id ), $soc_dest, $action); - if ($reshook < 0) { + if ($reshook < 0) + { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); $errors++; } } - if (!$errors) { + if (!$errors) + { //We finally remove the old thirdparty - if ($soc_origin->delete($soc_origin->id, $user) < 1) { - $db->rollback(); + if ($soc_origin->delete($soc_origin->id, $user) < 1) + { $errors++; } } - } - if (!$errors) { - setEventMessage($langs->trans('ThirdpartiesMergeSuccess')); - $db->commit(); - } else { - setEventMessage($langs->trans('ErrorsThirdpartyMerge'), 'errors'); + if (!$errors) + { + setEventMessage($langs->trans('ThirdpartiesMergeSuccess')); + $db->commit(); + } else { + setEventMessage($langs->trans('ErrorsThirdpartyMerge'), 'errors'); + $db->rollback(); + } } } } @@ -230,15 +242,15 @@ if (empty($reshook)) { $object->particulier = GETPOST("private"); - $object->name = dolGetFirstLastname(GETPOST('firstname','alpha'),GETPOST('nom','alpha')?GETPOST('nom','alpha'):GETPOST('name','alpha')); + $object->name = dolGetFirstLastname(GETPOST('firstname','alpha'),GETPOST('name','alpha')); $object->civility_id = GETPOST('civility_id', 'int'); // Add non official properties - $object->name_bis = GETPOST('name','alpha')?GETPOST('name','alpha'):GETPOST('nom','alpha'); + $object->name_bis = GETPOST('name','alpha'); $object->firstname = GETPOST('firstname','alpha'); } else { - $object->name = GETPOST('name', 'alpha')?GETPOST('name', 'alpha'):GETPOST('nom', 'alpha'); + $object->name = GETPOST('name', 'alpha'); } $object->address = GETPOST('address', 'alpha'); $object->zip = GETPOST('zipcode', 'alpha'); @@ -796,7 +808,7 @@ else if (GETPOST("type")=='p') { $object->client=2; } if (! empty($conf->fournisseur->enabled) && (GETPOST("type")=='f' || (GETPOST("type")=='' && empty($conf->global->THIRDPARTY_NOTSUPPLIER_BY_DEFAULT)))) { $object->fournisseur=1; } - $object->name = GETPOST('nom', 'alpha'); + $object->name = GETPOST('name', 'alpha'); $object->firstname = GETPOST('firstname', 'alpha'); $object->particulier = $private; $object->prefix_comm = GETPOST('prefix_comm'); @@ -963,14 +975,14 @@ else print ''; if ($object->particulier || $private) { - print ''; + print ''.$langs->trans('LastName','name').''; } else { - print ''; + print ''.fieldLabel('ThirdPartyName','name').''; } print 'global->SOCIETE_USEPREFIX)?' colspan="3"':'').'>'; - print ''; + print ''; if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { print ''.$langs->trans('Prefix').''; @@ -980,16 +992,16 @@ else // If javascript on, we show option individual if ($conf->use_javascript_ajax) { - print ''; + print ''.fieldLabel('FirstName','firstname').''; print ''; print ' '; - print ''; + print ''.fieldLabel('UserTitle','cibility_id').''; print $formcompany->select_civility($object->civility_id).''; print ' '; } // Prospect/Customer - print ''; + print ''.fieldLabel('ProspectCustomer','customerprospect',1).''; print ''; - print ''; + print ''.fieldLabel('CustomerCode','customer_code').''; print ''; - print ''; - print '
'; $tmpcode=$object->code_client; if (empty($tmpcode) && ! empty($modCodeClient->code_auto)) $tmpcode=$modCodeClient->getNextValue($object,0); @@ -1013,10 +1025,10 @@ else { // Supplier print '
'; + print ''.fieldLabel('Supplier','fournisseur',1).''; print $form->selectyesno("fournisseur",(isset($_POST['fournisseur'])?GETPOST('fournisseur'):$object->fournisseur),1); print ''; + print ''.fieldLabel('SupplierCode','supplier_code').''; print ''; // Barcode if (! empty($conf->barcode->enabled)) { - print ''; + print ''; print ''; } // Address - print ''; + print ''; print ''; // Zip / Town - print ''; // Country - print ''; @@ -1063,29 +1075,29 @@ else // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - print ''; } // Email web - print ''; + print ''; print ''; - print ''; + print ''; print ''; // Skype if (! empty($conf->skype->enabled)) { - print ''; + print ''; print ''; } // Phone / Fax - print ''; + print ''; print ''; - print ''; + print ''; print ''; // Prof ids @@ -1101,9 +1113,9 @@ else $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY'; if(empty($conf->global->$idprof_mandatory)) - print ''; @@ -1115,11 +1127,11 @@ else if ($j % 2 == 1) print ''; // Assujeti TVA - print ''; + print ''; print ''; - print ''; + print ''; print ''; // Type - Size - print ''; - print ''; // Legal Form - print ''; + print ''; print ''; // Capital - print ''; + print ''; print ''; @@ -1202,7 +1214,7 @@ else if (! empty($conf->global->MAIN_MULTILANGS)) { - print ''; print ''; @@ -1212,7 +1224,7 @@ else { // Assign a Name print ''; - print ''; + print ''; print ''; @@ -1222,7 +1234,7 @@ else if (!empty($conf->incoterm->enabled)) { print ''; - print ''; + print ''; print ''; @@ -1231,12 +1243,12 @@ else // Categories if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) { - print '"; } - + // Other attributes $parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook @@ -1247,7 +1259,7 @@ else // Ajout du logo print ''; - print ''; + print ''; print ''; @@ -1319,10 +1331,10 @@ else $object->oldcopy=dol_clone($object); - if (GETPOST('nom')) + if (GETPOST('name')) { // We overwrite with values if posted - $object->name = GETPOST('nom', 'alpha'); + $object->name = GETPOST('name', 'alpha'); $object->prefix_comm = GETPOST('prefix_comm', 'alpha'); $object->client = GETPOST('client', 'int'); $object->code_client = GETPOST('code_client', 'alpha'); @@ -1452,13 +1464,13 @@ else print '
'; $tmpcode=$object->code_fournisseur; if (empty($tmpcode) && ! empty($modCodeFournisseur->code_auto)) $tmpcode=$modCodeFournisseur->getNextValue($object,1); @@ -1029,33 +1041,33 @@ else } // Status - print '
'; + print '
'.fieldLabel('Status','status').''; print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),1); print '
'.fieldLabel('Gencod','barcode').''; print '
'.fieldLabel('Address','address').'
'; + print '
'.fieldLabel('Zip','zipcode').''; print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','state_id'),6); - print ''; + print ''.fieldLabel('Town','town').''; print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','state_id')); print '
'; + print '
'.fieldLabel('Country','selectcountry_id').''; print $form->select_country((GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id)); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'; + print '
'.fieldLabel('State','state_id').''; if ($object->country_id) print $formcompany->select_state($object->state_id,$object->country_code); else print $countrynotdefined; print '
'.fieldLabel('EMail','email').(! empty($conf->global->SOCIETE_MAIL_REQUIRED)?'*':'').'
'.fieldLabel('Web','url').'
'.fieldLabel('Skype','skype').'
'.fieldLabel('Phone','phone').''.fieldLabel('Fax','fax').'
'; + print ''.fieldLabel($idprof,$key).''; else - print ''; + print ''.fieldLabel($idprof,$key,1).''; print $formcompany->get_input_id_prof($i,$key,$object->$key,$object->country_code); print '
'.fieldLabel('VATIsUsed','assujtva_value').''; print $form->selectyesno('assujtva_value',1,1); // Assujeti par defaut en creation print ''.fieldLabel('VATIntra','inra_vat').''; $s = ''; @@ -1149,17 +1161,17 @@ else print '
'."\n"; + print '
'.fieldLabel('ThirdPartyType','typent_id').''."\n"; print $form->selectarray("typent_id", $formcompany->typent_array(0), $object->typent_id, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print ''; + print ''.fieldLabel('Staff','effectif_id').''; print $form->selectarray("effectif_id", $formcompany->effectif_array(0), $object->effectif_id); if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'.fieldLabel('JuridicalStatus','legal_form').''; if ($object->country_id) { @@ -1172,7 +1184,7 @@ else print '
'.fieldLabel('Capital','capital').' '; print ''.$langs->trans("Currency".$conf->currency).'
'."\n"; + print '
'.fieldLabel('DefaultLang','default_lang').''."\n"; print $formadmin->select_language(($object->default_lang?$object->default_lang:$conf->global->MAIN_LANG_DEFAULT),'default_lang',0,0,1); print '
'.fieldLabel('AllocateCommercial','commercial_id').''; $form->select_users((! empty($object->commercial_id)?$object->commercial_id:$user->id),'commercial_id',1); // Add current user by default print '
'.fieldLabel('IncotermLabel','incoterm_id').''; print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:'')); print '
'.$langs->trans("Categories").''; + print '
'.fieldLabel('Categories','custcats').''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1); print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, null, "90%"); print "
'.fieldLabel('Logo','photoinput').''; print ''; print '
'; // Name - print ''; - print ''; + print ''; + print ''; // Prefix if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { - print ''; + print ''; print ''; - print '
'.fieldLabel('ThirdPartyName','name',1).'
'; + print '
'.fieldLabel('Prefix','prefix').''; // It does not change the prefix mode using the auto numbering prefix if (($prefixCustomerIsUsed || $prefixSupplierIsUsed) && $object->prefix_comm) { @@ -1473,14 +1485,14 @@ else } // Prospect/Customer - print '
'.fieldLabel('ProspectCustomer','customerprospect',1).''; + print ''.fieldLabel('CustomerCode','customer_code').''; print ''; - print ''; - print '
'; if ((!$object->code_client || $object->code_client == -1) && $modCodeClient->code_auto) @@ -1510,10 +1522,10 @@ else if (! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire)) { print '
'; + print ''.fieldLabel('Supplier','fournisseur',1).''; print $form->selectyesno("fournisseur",$object->fournisseur,1); print ''; + print ''.fieldLabel('SupplierCode','supplier_code').''; print ''; + print ''; print ''; } // Status - print ''; // Address - print ''; + print ''; print ''; // Zip / Town - print ''; // Country - print ''; @@ -1575,28 +1587,28 @@ else // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - print ''; } // EMail / Web - print ''; + print ''; print ''; - print ''; + print ''; print ''; // Skype if (! empty($conf->skype->enabled)) { - print ''; + print ''; print ''; } // Phone / Fax - print ''; + print ''; print ''; - print ''; + print ''; print ''; // Prof ids @@ -1612,9 +1624,9 @@ else $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY'; if(empty($conf->global->$idprof_mandatory)) - print ''; @@ -1626,12 +1638,12 @@ else if ($j % 2 == 1) print ''; // VAT payers - print ''; // VAT Code - print ''; + print ''; print ''; - print ''; // Juridical type - print ''; // Capital - print ''; + print ''; print ''; // Default language if (! empty($conf->global->MAIN_MULTILANGS)) { - print ''; print ''; @@ -1741,7 +1753,7 @@ else // Categories if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) { - print ''; + print ''; print '"; } - + // Other attributes $parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook @@ -1763,9 +1775,9 @@ else // Webservices url/key if (!empty($conf->syncsupplierwebservices->enabled)) { - print ''; + print ''; print ''; - print ''; + print ''; print ''; } @@ -1773,7 +1785,7 @@ else if (!empty($conf->incoterm->enabled)) { print ''; - print ''; + print ''; print ''; @@ -1781,7 +1793,7 @@ else // Logo print ''; - print ''; + print ''; print '"; } - + // Incoterms if (!empty($conf->incoterm->enabled)) { diff --git a/htdocs/theme/common/logo_cerfa.png b/htdocs/theme/common/logo_cerfa.png new file mode 100644 index 00000000000..0db57c205ab Binary files /dev/null and b/htdocs/theme/common/logo_cerfa.png differ diff --git a/htdocs/theme/eldy/img/info_black.png b/htdocs/theme/eldy/img/info_black.png new file mode 100644 index 00000000000..741dabd5e19 Binary files /dev/null and b/htdocs/theme/eldy/img/info_black.png differ diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 25bb20432ff..01caa7a7282 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1400,7 +1400,12 @@ div.tabs { clear:both; height:100%; } -div.tabsElem { margin-top: 1px; } /* To avoid overlap of tabs when not browser */ +div.tabsElem { + margin-top: 1px; + dol_use_jmobile)) { ?>; + margin-bottom: -1px; + +} /* To avoid overlap of tabs when not browser */ div.tabBar { color: #; @@ -1828,7 +1833,7 @@ div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar .table-val-border-col { vertical-align: middle; } -div.tabBar .tdtop { +div .tdtop { vertical-align: top; padding-top: 5px; padding-bottom: 0px; @@ -1969,6 +1974,13 @@ table.liste td { /* Pagination */ +div.refid { + padding-top: dol_use_jmobile)?'8':'12'; ?>px; + font-weight: bold; + color: #766; + font-size: 120%; +} + div.pagination { float: right; } @@ -1987,8 +1999,10 @@ div.pagination li { display: inline-block; padding-left: 0px; padding-right: 0px; +dol_use_jmobile)) { ?> padding-top: 6px; - padding-bottom: 6px; + padding-bottom: 5px; + } .pagination { display: inline-block; @@ -1997,7 +2011,9 @@ div.pagination li { } div.pagination li.pagination a, div.pagination li.pagination span { +dol_use_jmobile)) { ?> padding: 6px 12px; + margin-left: -1px; line-height: 1.42857143; color: #000; @@ -2006,10 +2022,26 @@ div.pagination li.pagination span { div.pagination li.pagination span.inactive { cursor: default; } +div.pagination li.litext a { +border: none; + padding-right: 10px; + padding-left: 4px; + font-weight: bold; +} +dol_use_jmobile)) { ?> +div.pagination li.litext { + padding-top: 13px; + vertical-align: top; +} +dol_use_jmobile)) { ?> +div.pagination li.noborder a:hover { + border: none; + background-color: transparent; +} div.pagination li a, div.pagination li span { - background-color: #fff; + background-color: #fff; border: 1px solid #ddd; } div.pagination li:first-child a, @@ -3471,6 +3503,14 @@ ul.ulmenu { color: # !important; text-shadow: none !important; } +/* +.ui-btn-up-c { + background: transparent; +} +*/ +div.tabsElem a.tab { + background: transparent; +} .ui-controlgroup-horizontal .ui-btn.ui-first-child { -webkit-border-top-left-radius: 6px; border-top-left-radius: 6px; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index b255e3ffa68..4d7a3d18a5c 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -74,8 +74,16 @@ class User extends CommonObject var $datem; //! If this is defined, it is an external user - var $societe_id; // deprecated - var $contact_id; // deprecated + /** + * @deprecated + * @see socid + */ + var $societe_id; + /** + * @deprecated + * @see contactid + */ + var $contact_id; var $socid; var $contactid; diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 35663f05978..687c2077760 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -40,8 +40,12 @@ class UserGroup extends CommonObject var $id; // Group id var $entity; // Entity of group + /** + * @deprecated + * @see name + */ var $nom; // Name of group - var $name; // Name of group // deprecated + var $name; // Name of group var $globalgroup; // Global group var $note; // Note on group var $datec; // Creation date of group diff --git a/scripts/product/migrate_picture_path.php b/scripts/product/migrate_picture_path.php new file mode 100755 index 00000000000..a03e2549006 --- /dev/null +++ b/scripts/product/migrate_picture_path.php @@ -0,0 +1,148 @@ +#!/usr/bin/php + + * Copyright (C) 2015 Jean Heimburger + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file scripts/product/migrate_picture_path.php + * \ingroup scripts + * \brief Migrate pictures from old system prior to 3.7 to new path for 3.7+ + * + */ + +$sapi_type = php_sapi_name(); +$script_file = basename(__FILE__); +$path=dirname(__FILE__).'/'; + +// Test if batch mode +if (substr($sapi_type, 0, 3) == 'cgi') { + echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n"; + exit(-1); +} + +@set_time_limit(0); // No timeout for this script +define('EVEN_IF_ONLY_LOGIN_ALLOWED',1); // Set this define to 0 if you want to lock your script when dolibarr setup is "locked to admin user only". + +// Include and load Dolibarr environment variables +require_once($path."../../htdocs/master.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); +// After this $db, $mysoc, $langs, $conf and $hookmanager are defined (Opened $db handler to database will be closed at end of file). +// $user is created but empty. + +//$langs->setDefaultLang('en_US'); // To change default language of $langs +$langs->load("main"); // To load language file for default language + + +// Global variables +$version=DOL_VERSION; +$error=0; +$forcecommit=0; + + +print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; +dol_syslog($script_file." launched with arg ".join(',',$argv)); + +if (! isset($argv[1]) || $argv[1] != 'product') { + print "Usage: $script_file product\n"; + exit(-1); +} + +print '--- start'."\n"; + +// Case to migrate products path +if ($argv[1] == 'product') +{ + $product = new Product($db); + + $sql = "SELECT rowid as pid from ".MAIN_DB_PREFIX."product"; // Get list of all products + $resql = $db->query($sql); + if ($resql) + { + while ($obj = $db->fetch_object($resql)) + { + $product->fetch($obj->pid); + print " migrating product id=".$product->id." ref=".$product->ref."\n"; + migrate_product_photospath($product); + } + } + else + { + print "\n sql error ".$sql; + exit; + } +} + + +$db->close(); // Close $db database opened handler + +exit($error); + + + +/** + * Migrate file from old path to new one for product $product + * + * @param Product $product Object product + * @return void + */ +function migrate_product_photospath($product) +{ + global $conf; + + $dir = $conf->product->multidir_output[$product->entity]; + $origin = $dir .'/'. get_exdir($product->id,2) . $product->id ."/photos"; + $destin = $dir.'/'.dol_sanitizeFileName($product->ref); + + $error = 0; + + $origin_osencoded=dol_osencode($origin); + $destin_osencoded=dol_osencode($destin); + dol_mkdir($destin); + + if (dol_is_dir($origin)) + { + $handle=opendir($origin_osencoded); + if (is_resource($handle)) + { + while (($file = readdir($handle)) != false) + { + if ($file != '.' && $file != '..' && is_dir($origin_osencoded.'/'.$file)) + { + $thumbs = opendir($origin_osencoded.'/'.$file); + if (is_resource($thumbs)) + { + dol_mkdir($destin.'/'.$file); + while (($thumb = readdir($thumbs)) != false) + { + dol_move($origin.'/'.$file.'/'.$thumb, $destin.'/'.$file.'/'.$thumb); + } +// dol_delete_dir($origin.'/'.$file); + } + } + else + { + if (dol_is_file($origin.'/'.$file) ) + { + dol_move($origin.'/'.$file, $destin.'/'.$file); + } + + } + } + } + } +}
'; if ((!$object->code_fournisseur || $object->code_fournisseur == -1) && $modCodeFournisseur->code_auto) @@ -1543,31 +1555,31 @@ else // Barcode if (! empty($conf->barcode->enabled)) { - print '
'.fieldLabel('Gencod','barcode').''; print '
'; + print '
'.fieldLabel('Status','status').''; print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$object->status); print '
'.fieldLabel('Address','address').'
'; + print '
'.fieldLabel('Zip','zipcode').''; print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','state_id'),6); - print ''; + print ''.fieldLabel('Town','town').''; print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','state_id')); print '
'; + print '
'.fieldLabel('Country','selectcounty_id').''; print $form->select_country((GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id),'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'; + print '
'.fieldLabel('State','state_id').''; print $formcompany->select_state($object->state_id,$object->country_code); print '
'.fieldLabel('EMail','email',(! empty($conf->global->SOCIETE_MAIL_REQUIRED))).'
'.fieldLabel('Web','url').'
'.fieldLabel('Skype','skype').'
'.fieldLabel('Phone','phone').''.fieldLabel('Fax','fax').'
'; + print ''.fieldLabel($idprof,$key).''; else - print ''; + print ''.fieldLabel($idprof,$key).''; print $formcompany->get_input_id_prof($i,$key,$object->$key,$object->country_code); print '
'; + print '
'.fieldLabel('VATIsUsed','assujtva_value').''; print $form->selectyesno('assujtva_value',$object->tva_assuj,1); print ''.fieldLabel('VATIntra','intra_vat').''; $s =''; @@ -1664,7 +1676,7 @@ else //TODO: Place into a function to control showing by country or study better option if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") { - print '
'; + print '
'.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').''; print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1); if(! isOnlyOneLocalTax(1)) { @@ -1673,7 +1685,7 @@ else print ''; } - print ''; + print ''.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').''; print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1); if (! isOnlyOneLocalTax(2)) { @@ -1686,7 +1698,7 @@ else } elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1") { - print '
'; + print '
'.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').''; print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1); if(! isOnlyOneLocalTax(1)) { @@ -1699,7 +1711,7 @@ else } elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1") { - print '
'; + print '
'.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').''; print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1); if(! isOnlyOneLocalTax(2)) { @@ -1711,28 +1723,28 @@ else } // Type - Size - print '
'; + print '
'.fieldLabel('ThirdPartyType','typent_id').''; print $form->selectarray("typent_id",$formcompany->typent_array(0), $object->typent_id, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print ''; + print ''.fieldLabel('Staff','effectif_id').''; print $form->selectarray("effectif_id",$formcompany->effectif_array(0), $object->effectif_id); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'; + print '
'.fieldLabel('JuridicalStatus','legal_form').''; print $formcompany->select_juridicalstatus($object->forme_juridique_code, $object->country_code, '', 'legal_form'); print '
'.fieldLabel('Capital','capital').''.$langs->trans("Currency".$conf->currency).'
'."\n"; + print '
'.fieldLabel('DefaultLang','default_lang').''."\n"; print $formadmin->select_language($object->default_lang,'default_lang',0,0,1); print '
'.fieldLabel('Categories', 'custcats').''; $cate_arbo = $form->select_all_categories( Categorie::TYPE_CUSTOMER, null, null, null, null, 1); $c = new Categorie( $db ); @@ -1752,7 +1764,7 @@ else print $form->multiselectarray( 'custcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%'); print "
'.fieldLabel('WebServiceURL','webservices_url').''.fieldLabel('WebServiceKey','webservices_key').'
'.fieldLabel('IncotermLabel','incoterm_id').''; print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:'')); print '
'.fieldLabel('Logo','photoinput').''; if ($object->logo) print $form->showphoto('societe',$object); $caneditfield=1; @@ -1827,21 +1839,21 @@ else // Confirm delete third party if ($action == 'delete' || ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile))) { - print $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id,$langs->trans("DeleteACompany"),$langs->trans("ConfirmDeleteCompany"),"confirm_delete",'',0,"action-delete"); + print $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id, $langs->trans("DeleteACompany"), $langs->trans("ConfirmDeleteCompany"), "confirm_delete", '', 0, "action-delete"); } - if ($action == 'merge') { - $form = new Form($db); - - $options = array( + if ($action == 'merge') + { + $formquestion = array( array( - 'label' => $langs->trans('MergeOriginThirdparty'), + 'name' => 'soc_origin', + 'label' => $langs->trans('MergeOriginThirdparty'), 'type' => 'other', - 'value' => $form->select_company('', 'soc_origin', 's.rowid != '.$object->id, 1) + 'value' => $form->select_thirdparty('', 'soc_origin', 's.rowid != '.$object->id) ) ); - print $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id,$langs->trans("MergeThirdparties"),$langs->trans("ConfirmMergeThirdparties"),"confirm_merge",$options,'',1); + print $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id, $langs->trans("MergeThirdparties"), $langs->trans("ConfirmMergeThirdparties"), "confirm_merge", $formquestion, 'no', 1); } dol_htmloutput_errors($error,$errors); @@ -2187,7 +2199,7 @@ else print $form->showCategories( $object->id, 'customer', 1 ); print "