diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 70c38205eac..c3bb46c198a 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -897,7 +897,7 @@ class ActionComm extends CommonObject $val=array('id'=>$val); } $sql ="INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)"; - $sql.=" VALUES(".$this->id.", 'user', ".$val['id'].", ".(empty($val['manadatory'])?'0':$val['manadatory']).", ".(empty($val['transparency'])?'0':$val['transparency']).", ".(empty($val['answer_status'])?'0':$val['answer_status']).")"; + $sql.=" VALUES(".$this->id.", 'user', ".$val['id'].", ".(empty($val['mandatory'])?'0':$val['mandatory']).", ".(empty($val['transparency'])?'0':$val['transparency']).", ".(empty($val['answer_status'])?'0':$val['answer_status']).")"; $resql = $this->db->query($sql); if (! $resql) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 2808a501112..cc918b5b9f1 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1332,6 +1332,7 @@ class Propal extends CommonObject $sql.= ", p.fk_shipping_method"; $sql.= ", p.fk_incoterms, p.location_incoterms"; $sql.= ", p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva, p.multicurrency_total_ttc"; + $sql.= ", p.tms as date_modification"; $sql.= ", i.libelle as libelle_incoterms"; $sql.= ", c.label as statut_label"; $sql.= ", ca.code as availability_code, ca.label as availability"; @@ -1388,6 +1389,7 @@ class Propal extends CommonObject $this->datev = $this->db->jdate($obj->datev); // TODO deprecated $this->date_creation = $this->db->jdate($obj->datec); //Creation date $this->date_validation = $this->db->jdate($obj->datev); //Validation date + $this->date_modification = $this->db->jdate($obj->date_modification); // tms $this->date = $this->db->jdate($obj->dp); // Proposal date $this->datep = $this->db->jdate($obj->dp); // deprecated $this->fin_validite = $this->db->jdate($obj->dfv); diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 1c34a64f986..b3251a853c3 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -685,6 +685,7 @@ class Contact extends CommonObject $sql.= " c.photo,"; $sql.= " c.priv, c.note_private, c.note_public, c.default_lang, c.no_email, c.canvas,"; $sql.= " c.import_key,"; + $sql.= " c.datec as date_creation, c.tms as date_modification,"; $sql.= " co.label as country, co.code as country_code,"; $sql.= " d.nom as state, d.code_departement as state_code,"; $sql.= " u.rowid as user_id, u.login as user_login,"; @@ -719,6 +720,9 @@ class Contact extends CommonObject $this->zip = $obj->zip; $this->town = $obj->town; + $this->date_creation = $this->db->jdate($obj->date_creation); + $this->date_modification = $this->db->jdate($obj->date_modification); + $this->fk_departement = $obj->fk_departement; // deprecated $this->state_id = $obj->fk_departement; $this->departement_code = $obj->state_code; // deprecated diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 13a52ac22ef..537d18245fd 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1055,7 +1055,7 @@ class Contrat extends CommonObject } else { - $this->error="Failed to add contact"; + $this->error="Failed to add contract"; dol_syslog(get_class($this)."::create - 20 - ".$this->error, LOG_ERR); $this->db->rollback(); return -2; diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index d608a1d1dcf..d7691e05c30 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -74,6 +74,8 @@ class box_graph_propales_permonth extends ModeleBoxes //include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; //$propalstatic=new Propal($db); + $langs->load("propal"); + $text = $langs->trans("BoxProposalsPerMonth",$max); $this->info_box_head = array( 'text' => $text, diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 629bc19e390..8f3f763f0b2 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -599,15 +599,16 @@ abstract class CommonDocGenerator } // Retrieve extrafields - /*if(is_array($object->array_options) && count($object->array_options)) + if (is_array($object->array_options) && count($object->array_options)) { require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields = new ExtraFields($this->db); - $extralabels = $extrafields->fetch_name_optionals_label('shipment',true); + $extralabels = $extrafields->fetch_name_optionals_label('expedition',true); $object->fetch_optionals(); $array_shipment = $this->fill_substitutionarray_with_extrafields($object,$array_shipment,$extrafields,$array_key,$outputlangs); - }*/ + } + return $array_shipment; } @@ -615,16 +616,16 @@ abstract class CommonDocGenerator /** * Define array with couple substitution key => substitution value * - * @param array $line Array of lines + * @param ExpeditionLigne $line Object line * @param Translate $outputlangs Lang object to use for output * @return array Substitution array */ - function get_substitutionarray_shipment_lines($line,$outputlangs) + function get_substitutionarray_shipment_lines($line, $outputlangs) { global $conf; dol_include_once('/core/lib/product.lib.php'); - return array( + $resarray = array( 'line_fulldesc'=>doc_getlinedesc($line,$outputlangs), 'line_product_ref'=>$line->product_ref, 'line_product_label'=>$line->product_label, @@ -643,6 +644,18 @@ abstract class CommonDocGenerator 'line_surface'=>empty($line->surface) ? '' : $line->surface*$line->qty_shipped.' '.measuring_units_string($line->surface_units, 'surface'), 'line_volume'=>empty($line->volume) ? '' : $line->volume*$line->qty_shipped.' '.measuring_units_string($line->volume_units, 'volume'), ); + + // Retrieve extrafields + $extrafieldkey = $line->element; + $array_key = "line"; + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + $extrafields = new ExtraFields($this->db); + $extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey, true); + $line->fetch_optionals(); + + $resarray = $this->fill_substitutionarray_with_extrafields($line, $resarray, $extrafields, $array_key, $outputlangs); + + return $resarray; } diff --git a/htdocs/dav/index.html b/htdocs/dav/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/dav/index.html @@ -0,0 +1 @@ + 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 fb890d14375..570bd340146 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 @@ -675,7 +675,7 @@ ALTER TABLE llx_blockedlog MODIFY COLUMN ref_object varchar(255); -- SPEC : use database type 'double' to store monetary values ALTER TABLE llx_blockedlog MODIFY COLUMN amounts double(24,8) NOT NULL; -ALTER TABLE llx_chargessociales MODIFY COLUMN amount double(24,8); +ALTER TABLE llx_chargesociales MODIFY COLUMN amount double(24,8); ALTER TABLE llx_commande MODIFY COLUMN amount_ht double(24,8) default 0; ALTER TABLE llx_commande_fournisseur MODIFY COLUMN amount_ht double(24,8); ALTER TABLE llx_don MODIFY COLUMN amount double(24,8); diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql index 3252a394c00..14c4f2b6672 100644 --- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -52,6 +52,7 @@ ALTER TABLE llx_ecm_files ADD UNIQUE INDEX uk_ecm_files (filepath, filename, ent UPDATE llx_const set name = __ENCRYPT('INVOICE_FREE_TEXT')__ where name = __ENCRYPT('FACTURE_FREE_TEXT')__; +ALTER TABLE llx_chargesociales MODIFY COLUMN amount double(24,8); -- drop very old table (bad name) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index ea3824fc5fb..c66e7b932f3 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -121,20 +121,22 @@ if ($dirins && $action == 'initmodule' && $modulename) } } - if(!empty($conf->global->MODULEBUILDER_USE_ABOUT)){ - dol_delete_file($destdir.'/admin/about.php'); - } - if(!empty($conf->global->MODULEBUILDER_USE_DOCFOLDER)){ - dol_delete_dir($destdir.'/doc/'); - } + if (!empty($conf->global->MODULEBUILDER_USE_ABOUT)) + { + dol_delete_file($destdir.'/admin/about.php'); + } + if (!empty($conf->global->MODULEBUILDER_USE_DOCFOLDER)) + { + dol_delete_dir($destdir.'/doc/'); + } - // Delete some files + // Delete some files related to object (because to previous dolCopyDir has copied everything) dol_delete_file($destdir.'/myobject_card.php'); dol_delete_file($destdir.'/myobject_note.php'); dol_delete_file($destdir.'/myobject_document.php'); dol_delete_file($destdir.'/myobject_agenda.php'); dol_delete_file($destdir.'/myobject_list.php'); - dol_delete_file($destdir.'/lib/myobject.lib.php'); + dol_delete_file($destdir.'/lib/mymodule_myobject.lib.php'); dol_delete_file($destdir.'/test/phpunit/MyObjectTest.php'); dol_delete_file($destdir.'/sql/llx_mymodule_myobject.sql'); dol_delete_file($destdir.'/sql/llx_mymodule_myobject_extrafields.sql'); @@ -291,14 +293,14 @@ if ($dirins && $action == 'initobject' && $module && $objectname) if (! $error) { - // Delete some files + // Copy some files $filetogenerate = array( 'myobject_card.php'=>strtolower($objectname).'_card.php', 'myobject_note.php'=>strtolower($objectname).'_note.php', 'myobject_document.php'=>strtolower($objectname).'_document.php', 'myobject_agenda.php'=>strtolower($objectname).'_agenda.php', 'myobject_list.php'=>strtolower($objectname).'_list.php', - 'lib/myobject.lib.php'=>'lib/'.strtolower($objectname).'.lib.php', + 'lib/mymodule_myobject.lib.php'=>'lib/'.strtolower($module).'_'.strtolower($objectname).'.lib.php', 'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.$objectname.'Test.php', 'sql/llx_mymodule_myobject.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql', 'sql/llx_mymodule_myobject_extrafields.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.sql', @@ -660,7 +662,8 @@ if ($dirins && $action == 'confirm_deleteobject' && $objectname) 'myobject_document.php'=>strtolower($objectname).'_document.php', 'myobject_agenda.php'=>strtolower($objectname).'_agenda.php', 'myobject_list.php'=>strtolower($objectname).'_list.php', - 'lib/myobject.lib.php'=>'lib/'.strtolower($objectname).'.lib.php', + 'lib/mymodule.lib.php'=>'lib/'.strtolower($module).'.lib.php', + 'lib/mymodule_myobject.lib.php'=>'lib/'.strtolower($module).'_'.strtolower($objectname).'.lib.php', 'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.$objectname.'Test.php', 'sql/llx_mymodule_myobject.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql', 'sql/llx_mymodule_myobject_extrafields.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.sql', diff --git a/htdocs/modulebuilder/template/README.md b/htdocs/modulebuilder/template/README.md index d745c808bf4..635e1eed5b0 100644 --- a/htdocs/modulebuilder/template/README.md +++ b/htdocs/modulebuilder/template/README.md @@ -13,7 +13,7 @@ Other modules are available on