diff --git a/ChangeLog b/ChangeLog index 3a539a63938..b22376cebac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.7 compared to 3.6.* ***** For users: +- New: Each user can include its own external ics calendar into dolibarr agenda view. - New: Intervention documents are now available in ECM module. - New: Can attach supplier order to a customer order. - New: Supervisor is now visible into user list. @@ -38,6 +39,11 @@ For users: - New: Intervention documents are now available in ECM module - New: Add attachments on user card + in ECM module - New: Can add __PROJECT_REF__ and __TIHRPARTY_NAME__ into email topic or content template. +- New: [ task #1204 ] add Numering contrat module free (like leopard in product module) +- New: [ task #712 ] Add warning when creating invoice from proposal or order, when there is already one invoice +- New: Enable supplier price log table +- New: [ task #1204 ] add a External reference to contract +- New: [ task #1218 ] Can drag and drop an event from calendar to change its day. - Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action - Fix: [ bug #1470, #1472, #1473] User trigger problem - Fix: [ bug #1489, #1491 ] Intervention trigger problem @@ -55,7 +61,6 @@ For users: - Fix: [ bug #1506, #1507 ] ECM trigger error problem - Fix: [ bug #1469 ] Triggers CONTACT_MODIFY and CONTACT_DELETE duplicates error message - Fix: [ bug #1537 ] Difference between societe.nom and adherent.societe. -- New: [ task #1204 ] add a External reference to contract For translators: - Update language files. @@ -71,8 +76,9 @@ For developers: - LINEBILL_DELETE, LINK_DELETE, ORDER_SUPPLIER_DELETE, RESOURCE_DELETE trigger called before SQL delete - New: [ Task #1481 ] Add trigger BILL_SUPPLIER_UPDATE. - New: [ Task #1495 ] Add trigger LINECONTRACT_CREATE. -- New: Added hook "formConfirm" and "doActions" for supplier invoice card. -- New: [ task #1511, #1426 ] Added hook "doActions" for supplier card and supplier order card. +- New: Added hook "formConfirm" and "doActions" for supplier invoice card +- New: [ task #1511, #1426 ] Added hook "doActions" for supplier card and supplier order card +- New: renamed table llx_c_pays to llx_c_country & libelle field to label - Qual: Renamed table llx_c_civilite into llx_c_civility field civilite into label in the same table and field civilite into civility in other table @@ -80,7 +86,9 @@ For developers: WARNING: Following change may create regression for some external modules, but was necessary to make Dolibarr better: -- Changed the way parameters are provided to scripts sync_xxx_ldap2dolibarr.php +- Changed the way parameters are provided to scripts sync_xxx_ldap2dolibarr.php +- Some field into database wwere renamed from "libelle" to "label". +- Table llx_c_pays were renamed into llx_c_country. ***** ChangeLog for 3.6 compared to 3.5.* ***** @@ -199,19 +207,23 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f ***** ChangeLog for 3.5.5 compared to 3.5.4 ***** Fix: Holiday module was broken. Initializaion of amount of holidays failed. Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas. -Fix: Fusion PDF button on unpaid invoice is no more displayed -Fix: Unpaid invoice launch fusion PDF action even if it is only search (with enter keyboard input instead of lens click) +Fix: Fusion PDF button on unpaid invoice is no more displayed. +Fix: Unpaid invoice launch fusion PDF action even if it is only search (with enter keyboard input instead of lens click). Fix: Pb when showing log list of holiday module with some mysql versions. Fix: Error with bad timezone pushed by some browsers. Fix: shipping list SQL request was not filtering on shipping element Fix: debian package provided by dolibarr team must use embedded libraries. Fix: [ bug #1528 ] Leopard Services numeration module description is not translated. -Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas -Fix: [ bug #1534 ] Unknown error when deleting a product photo under special circumstances +Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas. +Fix: [ bug #1534 ] Unknown error when deleting a product photo under special circumstances. Fix: Update impayees.php -Fix: Link product, In list view and label product +Fix: Link product, In list view and label product. Fix: visible task into area "time" for "My task" must limit task to tasks i am assigned to. Fix: When disabled, all fields to add time into task line must be disabled. +Fix: Missing include files.lib.php in some pages that use dol_delete_recursive +Fix: Missing include files.lib.php in some pages ti use dol_delete_recursive. +Fix: [ bug #1558 ] Product/service edit page title shows new Ref instead of old ref. +Fix: [ bug #1553 ] Saving User displays setup removes menu. ***** ChangeLog for 3.5.4 compared to 3.5.3 ***** Fix: Hide title of event when agenda module disabled. diff --git a/dev/skeletons/skeleton_class.class.php b/dev/skeletons/skeleton_class.class.php index d8bda8922cb..781bbc1f77c 100644 --- a/dev/skeletons/skeleton_class.class.php +++ b/dev/skeletons/skeleton_class.class.php @@ -106,7 +106,7 @@ class Skeleton_Class extends CommonObject //// Call triggers //$result=$this->call_trigger('MYOBJECT_CREATE',$user); - //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} + //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} //// End call triggers } } @@ -133,10 +133,11 @@ class Skeleton_Class extends CommonObject /** * Load object in memory from the database * - * @param int $id Id object + * @param int $id Id object + * @param string $ref Ref * @return int <0 if KO, >0 if OK */ - function fetch($id) + function fetch($id,$ref='') { global $langs; $sql = "SELECT"; @@ -145,7 +146,8 @@ class Skeleton_Class extends CommonObject $sql.= " t.field2"; //... $sql.= " FROM ".MAIN_DB_PREFIX."mytable as t"; - $sql.= " WHERE t.rowid = ".$id; + if ($ref) $sql.= " WHERE t.ref = '".$ref."'"; + else $sql.= " WHERE t.rowid = ".$id; dol_syslog(get_class($this)."::fetch"); $resql=$this->db->query($sql); @@ -214,7 +216,7 @@ class Skeleton_Class extends CommonObject //// Call triggers //$result=$this->call_trigger('MYOBJECT_MODIFY',$user); - //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} + //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} //// End call triggers } } @@ -261,7 +263,7 @@ class Skeleton_Class extends CommonObject //// Call triggers //$result=$this->call_trigger('MYOBJECT_DELETE',$user); - //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} + //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} //// End call triggers } } diff --git a/dev/skeletons/skeleton_page.php b/dev/skeletons/skeleton_page.php index 00222bcce61..67d6298863a 100644 --- a/dev/skeletons/skeleton_page.php +++ b/dev/skeletons/skeleton_page.php @@ -43,6 +43,7 @@ if (! $res && file_exists("../../../dolibarr/htdocs/main.inc.php")) $res=@includ if (! $res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only if (! $res) die("Include of main fails"); // Change this following line to use the correct relative path from htdocs +include_once(DOL_DOCUMENT_ROOT.'/core/class/formcompany.class.php'); dol_include_once('/module/class/skeleton_class.class.php'); // Load traductions files requiredby by page @@ -52,6 +53,7 @@ $langs->load("other"); // Get parameters $id = GETPOST('id','int'); $action = GETPOST('action','alpha'); +$backtopage = GETPOST('backtopage'); $myparam = GETPOST('myparam','alpha'); // Protection if external user @@ -60,6 +62,16 @@ if ($user->societe_id > 0) //accessforbidden(); } +if (empty($action) && empty($id) && empty($ref)) $action='create'; + +// Load object if id or ref is provided as parameter +$object=new Skeleton_Class($db); +if (($id > 0 || ! empty($ref)) && $action != 'add') +{ + $result=$object->fetch($id,$ref); + if ($result < 0) dol_print_error($db); +} + /******************************************************************* @@ -68,19 +80,104 @@ if ($user->societe_id > 0) * Put here all code to do according to value of "action" parameter ********************************************************************/ +// Action to add record if ($action == 'add') { - $object=new Skeleton_Class($db); - $object->prop1=$_POST["field1"]; - $object->prop2=$_POST["field2"]; - $result=$object->create($user); + if (GETPOST('cancel')) + { + $urltogo=$backtopage?$backtopage:dol_buildpath('/buildingmanagement/list.php',1); + header("Location: ".$urltogo); + exit; + } + + $error=0; + + /* object_prop_getpost_prop */ + $object->prop1=GETPOST("field1"); + $object->prop2=GETPOST("field2"); + + if (empty($object->ref)) + { + $error++; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),'errors'); + } + + if (! $error) + { + $result=$object->create($user); + if ($result > 0) + { + // Creation OK + $urltogo=$backtopage?$backtopage:dol_buildpath('/mymodule/list.php',1); + header("Location: ".$urltogo); + exit; + } + { + // Creation KO + if (! empty($object->errors)) setEventMessage($object->errors, 'errors'); + else setEventMessage($object->error, 'errors'); + $action='create'; + } + } + else + { + $action='create'; + } +} + +// Cancel +if ($action == 'update' && GETPOST('cancel')) $action='view'; + +// Action to update record +if ($action == 'update' && ! GETPOST('cancel')) +{ + $error=0; + + $object->prop1=GETPOST("field1"); + $object->prop2=GETPOST("field2"); + + if (empty($object->ref)) + { + $error++; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),'errors'); + } + + if (! $error) + { + $result=$object->update($user); + if ($result > 0) + { + $action='view'; + } + else + { + // Creation KO + if (! empty($object->errors)) setEventMessage($object->errors, 'errors'); + else setEventMessage($object->error, 'errors'); + $action='edit'; + } + } + else + { + $action='edit'; + } +} + +// Action to delete +if ($action == 'confirm_delete') +{ + $result=$object->delete($user); if ($result > 0) { - // Creation OK + // Delete OK + setEventMessage($langs->trans("RecordDeleted")); + header("Location: ".dol_buildpath('/buildingmanagement/list.php',1)); + exit; } + else { - // Creation KO - $mesg=$object->error; + if (! empty($object->errors)) setEventMessage($object->errors,'errors'); + else setEventMessage($object->error,'errors'); } } @@ -101,7 +198,7 @@ $form=new Form($db); // Put here content of your page -// Example 1 : Adding jquery code +// Example : Adding jquery code print ''; -// Example 2 : Adding links to objects -// The class must extends CommonObject class to have this method available -//$somethingshown=$object->showLinkedObjectBlock(); - - -// Example 3 : List of data -if ($action == 'list') +// Part to show a list +if ($action == 'list' || empty($id)) { $sql = "SELECT"; $sql.= " t.rowid,"; @@ -145,21 +237,18 @@ if ($action == 'list') { $num = $db->num_rows($resql); $i = 0; - if ($num) + while ($i < $num) { - while ($i < $num) + $obj = $db->fetch_object($resql); + if ($obj) { - $obj = $db->fetch_object($resql); - if ($obj) - { - // You can use here results - print '
| '.$langs->trans('Ref').' | '; print ''.$langs->trans('RefSupplier').' | '; @@ -370,8 +381,10 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''.price($objp->total_ttc - $objp->am).' | '; print ''; $namef = 'amount_'.$objp->facid; + if(!empty($conf->global->FAC_AUTO_FILLJS)) + print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($objp->total_ttc - $objp->am)."'"); print ''; - print " |