diff --git a/dev/initdemo/mysqldump_dolibarr_19.0.0.sql b/dev/initdemo/mysqldump_dolibarr_19.0.0.sql index 83d4645572a..78a4358879e 100644 --- a/dev/initdemo/mysqldump_dolibarr_19.0.0.sql +++ b/dev/initdemo/mysqldump_dolibarr_19.0.0.sql @@ -1389,7 +1389,7 @@ CREATE TABLE `llx_c_action_trigger` ( LOCK TABLES `llx_c_action_trigger` WRITE; /*!40000 ALTER TABLE `llx_c_action_trigger` DISABLE KEYS */; -INSERT INTO `llx_c_action_trigger` VALUES (131,'COMPANY_SENTBYMAIL','Mails sent from third party card','Executed when you send email from third party card','societe',1,NULL),(132,'COMPANY_CREATE','Third party created','Executed when a third party is created','societe',1,NULL),(133,'PROPAL_VALIDATE','Customer proposal validated','Executed when a commercial proposal is validated','propal',2,NULL),(134,'PROPAL_SENTBYMAIL','Commercial proposal sent by mail','Executed when a commercial proposal is sent by mail','propal',3,NULL),(135,'ORDER_VALIDATE','Customer order validate','Executed when a customer order is validated','commande',4,NULL),(136,'ORDER_CLOSE','Customer order classify delivered','Executed when a customer order is set delivered','commande',5,NULL),(137,'ORDER_CLASSIFY_BILLED','Customer order classify billed','Executed when a customer order is set to billed','commande',5,NULL),(138,'ORDER_CANCEL','Customer order canceled','Executed when a customer order is canceled','commande',5,NULL),(139,'ORDER_SENTBYMAIL','Customer order sent by mail','Executed when a customer order is sent by mail ','commande',5,NULL),(140,'BILL_VALIDATE','Customer invoice validated','Executed when a customer invoice is approved','facture',6,NULL),(141,'BILL_PAYED','Customer invoice payed','Executed when a customer invoice is payed','facture',7,NULL),(142,'BILL_CANCEL','Customer invoice canceled','Executed when a customer invoice is conceled','facture',8,NULL),(143,'BILL_SENTBYMAIL','Customer invoice sent by mail','Executed when a customer invoice is sent by mail','facture',9,NULL),(144,'BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',9,NULL),(145,'ORDER_SUPPLIER_VALIDATE','Supplier order validated','Executed when a supplier order is validated','order_supplier',11,NULL),(146,'ORDER_SUPPLIER_APPROVE','Supplier order request approved','Executed when a supplier order is approved','order_supplier',12,NULL),(147,'ORDER_SUPPLIER_REFUSE','Supplier order request refused','Executed when a supplier order is refused','order_supplier',13,NULL),(148,'ORDER_SUPPLIER_SENTBYMAIL','Supplier order sent by mail','Executed when a supplier order is sent by mail','order_supplier',14,NULL),(149,'BILL_SUPPLIER_VALIDATE','Supplier invoice validated','Executed when a supplier invoice is validated','invoice_supplier',15,NULL),(150,'BILL_SUPPLIER_PAYED','Supplier invoice payed','Executed when a supplier invoice is payed','invoice_supplier',16,NULL),(151,'BILL_SUPPLIER_SENTBYMAIL','Supplier invoice sent by mail','Executed when a supplier invoice is sent by mail','invoice_supplier',17,NULL),(152,'BILL_SUPPLIER_CANCELED','Supplier invoice cancelled','Executed when a supplier invoice is cancelled','invoice_supplier',17,NULL),(153,'CONTRACT_VALIDATE','Contract validated','Executed when a contract is validated','contrat',18,NULL),(154,'SHIPPING_VALIDATE','Shipping validated','Executed when a shipping is validated','shipping',20,NULL),(155,'SHIPPING_SENTBYMAIL','Shipping sent by mail','Executed when a shipping is sent by mail','shipping',21,NULL),(156,'MEMBER_VALIDATE','Member validated','Executed when a member is validated','member',22,NULL),(158,'MEMBER_RESILIATE','Member resiliated','Executed when a member is resiliated','member',24,NULL),(159,'MEMBER_MODIFY','Member modified','Executed when a member is modified','member',24,NULL),(160,'MEMBER_DELETE','Member deleted','Executed when a member is deleted','member',25,NULL),(161,'FICHINTER_VALIDATE','Intervention validated','Executed when a intervention is validated','ficheinter',19,NULL),(162,'FICHINTER_CLASSIFY_BILLED','Intervention set billed','Executed when a intervention is set to billed (when option FICHINTER_CLASSIFY_BILLED is set)','ficheinter',19,NULL),(163,'FICHINTER_CLASSIFY_UNBILLED','Intervention set unbilled','Executed when a intervention is set to unbilled (when option FICHINTER_CLASSIFY_BILLED is set)','ficheinter',19,NULL),(164,'FICHINTER_REOPEN','Intervention opened','Executed when a intervention is re-opened','ficheinter',19,NULL),(165,'FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',19,NULL),(166,'PROJECT_CREATE','Project creation','Executed when a project is created','project',140,NULL),(167,'PROPAL_CLOSE_SIGNED','Customer proposal closed signed','Executed when a customer proposal is closed signed','propal',2,NULL),(168,'PROPAL_CLOSE_REFUSED','Customer proposal closed refused','Executed when a customer proposal is closed refused','propal',2,NULL),(169,'PROPAL_CLASSIFY_BILLED','Customer proposal set billed','Executed when a customer proposal is set to billed','propal',2,NULL),(170,'TASK_CREATE','Task created','Executed when a project task is created','project',35,NULL),(171,'TASK_MODIFY','Task modified','Executed when a project task is modified','project',36,NULL),(172,'TASK_DELETE','Task deleted','Executed when a project task is deleted','project',37,NULL),(173,'BILL_SUPPLIER_UNVALIDATE','Supplier invoice unvalidated','Executed when a supplier invoice status is set back to draft','invoice_supplier',15,NULL),(174,'PROJECT_MODIFY','Project modified','Executed when a project is modified','project',141,NULL),(175,'PROJECT_DELETE','Project deleted','Executed when a project is deleted','project',142,NULL),(176,'ORDER_SUPPLIER_CREATE','Supplier order validated','Executed when a supplier order is validated','order_supplier',11,NULL),(177,'ORDER_SUPPLIER_SUBMIT','Supplier order request submited','Executed when a supplier order is approved','order_supplier',12,NULL),(178,'ORDER_SUPPLIER_RECEIVE','Supplier order request received','Executed when a supplier order is received','order_supplier',12,NULL),(179,'ORDER_SUPPLIER_CLASSIFY_BILLED','Supplier order set billed','Executed when a supplier order is set as billed','order_supplier',14,NULL),(180,'PRODUCT_CREATE','Product or service created','Executed when a product or sevice is created','product',30,NULL),(181,'PRODUCT_MODIFY','Product or service modified','Executed when a product or sevice is modified','product',30,NULL),(182,'PRODUCT_DELETE','Product or service deleted','Executed when a product or sevice is deleted','product',30,NULL),(183,'EXPENSE_REPORT_CREATE','Expense report created','Executed when an expense report is created','expensereport',201,NULL),(185,'EXPENSE_REPORT_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',202,NULL),(186,'EXPENSE_REPORT_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',203,NULL),(187,'EXPENSE_REPORT_PAID','Expense report billed','Executed when an expense report is set as billed','expensereport',204,NULL),(192,'HOLIDAY_CREATE','Leave request created','Executed when a leave request is created','holiday',221,NULL),(193,'HOLIDAY_VALIDATE','Leave request validated','Executed when a leave request is validated','holiday',222,NULL),(194,'HOLIDAY_APPROVE','Leave request approved','Executed when a leave request is approved','holiday',223,NULL),(210,'MEMBER_SENTBYMAIL','Mails sent from member card','Executed when you send email from member card','member',23,NULL),(211,'CONTRACT_SENTBYMAIL','Contract sent by mail','Executed when a contract is sent by mail','contrat',18,NULL),(212,'PROPOSAL_SUPPLIER_VALIDATE','Price request validated','Executed when a commercial proposal is validated','proposal_supplier',10,NULL),(213,'PROPOSAL_SUPPLIER_SENTBYMAIL','Price request sent by mail','Executed when a commercial proposal is sent by mail','proposal_supplier',10,NULL),(214,'PROPOSAL_SUPPLIER_CLOSE_SIGNED','Price request closed signed','Executed when a customer proposal is closed signed','proposal_supplier',10,NULL),(215,'PROPOSAL_SUPPLIER_CLOSE_REFUSED','Price request closed refused','Executed when a customer proposal is closed refused','proposal_supplier',10,NULL),(216,'MEMBER_SUBSCRIPTION_CREATE','Member subscribtion recorded','Executed when a member subscribtion is deleted','member',24,NULL),(217,'MEMBER_SUBSCRIPTION_MODIFY','Member subscribtion modified','Executed when a member subscribtion is modified','member',24,NULL),(218,'MEMBER_SUBSCRIPTION_DELETE','Member subscribtion deleted','Executed when a member subscribtion is deleted','member',24,NULL),(225,'COMPANY_DELETE','Third party deleted','Executed when you delete third party','societe',1,NULL),(226,'PROPAL_DELETE','Customer proposal deleted','Executed when a customer proposal is deleted','propal',2,NULL),(227,'ORDER_DELETE','Customer order deleted','Executed when a customer order is deleted','commande',5,NULL),(228,'BILL_DELETE','Customer invoice deleted','Executed when a customer invoice is deleted','facture',9,NULL),(229,'PROPOSAL_SUPPLIER_DELETE','Price request deleted','Executed when a customer proposal delete','proposal_supplier',10,NULL),(230,'ORDER_SUPPLIER_DELETE','Supplier order deleted','Executed when a supplier order is deleted','order_supplier',14,NULL),(231,'BILL_SUPPLIER_DELETE','Supplier invoice deleted','Executed when a supplier invoice is deleted','invoice_supplier',17,NULL),(232,'CONTRACT_DELETE','Contract deleted','Executed when a contract is deleted','contrat',18,NULL),(233,'FICHINTER_DELETE','Intervention is deleted','Executed when a intervention is deleted','ficheinter',35,NULL),(234,'EXPENSE_REPORT_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',204,NULL),(249,'TICKET_CREATE','Ticket created','Executed when a ticket is created','ticket',161,NULL),(250,'TICKET_MODIFY','Ticket modified','Executed when a ticket is modified','ticket',163,NULL),(251,'TICKET_ASSIGNED','Ticket assigned','Executed when a ticket is assigned to another user','ticket',164,NULL),(252,'TICKET_CLOSE','Ticket closed','Executed when a ticket is closed','ticket',165,NULL),(253,'TICKET_SENTBYMAIL','Ticket message sent by email','Executed when a message is sent from the ticket record','ticket',166,NULL),(254,'TICKET_DELETE','Ticket deleted','Executed when a ticket is deleted','ticket',167,NULL),(261,'USER_SENTBYMAIL','Email sent','Executed when an email is sent from user card','user',300,NULL),(262,'BOM_VALIDATE','BOM validated','Executed when a BOM is validated','bom',650,NULL),(263,'BOM_UNVALIDATE','BOM unvalidated','Executed when a BOM is unvalidated','bom',651,NULL),(264,'BOM_CLOSE','BOM disabled','Executed when a BOM is disabled','bom',652,NULL),(265,'BOM_REOPEN','BOM reopen','Executed when a BOM is re-open','bom',653,NULL),(266,'BOM_DELETE','BOM deleted','Executed when a BOM deleted','bom',654,NULL),(351,'MRP_MO_VALIDATE','MO validated','Executed when a MO is validated','bom',660,NULL),(352,'MRP_MO_PRODUCED','MO produced','Executed when a MO is produced','bom',661,NULL),(353,'MRP_MO_DELETE','MO deleted','Executed when a MO is deleted','bom',662,NULL),(354,'MRP_MO_CANCEL','MO canceled','Executed when a MO is canceled','bom',663,NULL),(365,'CONTACT_CREATE','Contact address created','Executed when a contact is created','contact',50,NULL),(366,'CONTACT_SENTBYMAIL','Mails sent from third party card','Executed when you send email from contact adress card','contact',51,NULL),(367,'CONTACT_DELETE','Contact address deleted','Executed when a contact is deleted','contact',52,NULL),(368,'RECRUITMENTJOBPOSITION_CREATE','Job created','Executed when a job is created','recruitment',7500,NULL),(369,'RECRUITMENTJOBPOSITION_MODIFY','Job modified','Executed when a job is modified','recruitment',7502,NULL),(370,'RECRUITMENTJOBPOSITION_SENTBYMAIL','Mails sent from job record','Executed when you send email from job record','recruitment',7504,NULL),(371,'RECRUITMENTJOBPOSITION_DELETE','Job deleted','Executed when a job is deleted','recruitment',7506,NULL),(372,'RECRUITMENTCANDIDATURE_CREATE','Candidature created','Executed when a candidature is created','recruitment',7510,NULL),(373,'RECRUITMENTCANDIDATURE_MODIFY','Candidature modified','Executed when a candidature is modified','recruitment',7512,NULL),(374,'RECRUITMENTCANDIDATURE_SENTBYMAIL','Mails sent from candidature record','Executed when you send email from candidature record','recruitment',7514,NULL),(375,'RECRUITMENTCANDIDATURE_DELETE','Candidature deleted','Executed when a candidature is deleted','recruitment',7516,NULL),(392,'COMPANY_MODIFY','Third party update','Executed when you update third party','societe',1,NULL),(393,'CONTACT_MODIFY','Contact address update','Executed when a contact is updated','contact',51,NULL),(394,'ORDER_SUPPLIER_CANCEL','Supplier order request canceled','Executed when a supplier order is canceled','order_supplier',13,NULL),(395,'MEMBER_EXCLUDE','Member excluded','Executed when a member is excluded','member',27,NULL),(396,'USER_CREATE','User created','Executed when a user is created','user',301,NULL),(397,'USER_MODIFY','User update','Executed when a user is updated','user',302,NULL),(398,'USER_DELETE','User update','Executed when a user is deleted','user',303,NULL),(399,'USER_NEW_PASSWORD','User update','Executed when a user is change password','user',304,NULL),(400,'USER_ENABLEDISABLE','User update','Executed when a user is enable or disable','user',305,NULL),(402,'HOLIDAY_MODIFY','Holiday modified','Executed when a holiday is modified','holiday',801,NULL),(405,'HOLIDAY_CANCEL','Holiday canceled','Executed when a holiday is canceled','holiday',802,NULL),(406,'HOLIDAY_DELETE','Holiday deleted','Executed when a holiday is deleted','holiday',804,NULL),(407,'PROPAL_MODIFY','Customer proposal modified','Executed when a customer proposal is modified','propal',2,NULL),(408,'ORDER_MODIFY','Customer order modified','Executed when a customer order is set modified','commande',5,NULL),(409,'BILL_MODIFY','Customer invoice modified','Executed when a customer invoice is modified','facture',7,NULL),(410,'PROPOSAL_SUPPLIER_MODIFY','Price request modified','Executed when a commercial proposal is modified','proposal_supplier',10,NULL),(411,'ORDER_SUPPLIER_MODIFY','Supplier order request modified','Executed when a supplier order is modified','order_supplier',13,NULL),(412,'BILL_SUPPLIER_MODIFY','Supplier invoice modified','Executed when a supplier invoice is modified','invoice_supplier',15,NULL),(413,'CONTRACT_MODIFY','Contract modified','Executed when a contract is modified','contrat',18,NULL),(414,'SHIPPING_MODIFY','Shipping modified','Executed when a shipping is modified','shipping',20,NULL),(415,'FICHINTER_MODIFY','Intervention modify','Executed when a intervention is modify','ficheinter',30,NULL),(417,'EXPENSE_REPORT_MODIFY','Expense report modified','Executed when an expense report is modified','expensereport',202,NULL),(455,'PROJECT_SENTBYMAIL','Project sent by mail','Executed when a project is sent by email','project',144,NULL),(511,'SHIPPING_DELETE','Shipping sent is deleted','Executed when a shipping is deleted','shipping',21,NULL),(512,'RECEPTION_VALIDATE','Reception validated','Executed when a reception is validated','reception',22,NULL),(513,'RECEPTION_SENTBYMAIL','Reception sent by mail','Executed when a reception is sent by mail','reception',22,NULL),(543,'PROJECT_VALIDATE','Project validation','Executed when a project is validated','project',141,NULL),(584,'ACTION_CREATE','Action added','Executed when an action is added to the agenda','agenda',700,NULL),(591,'BILLREC_CREATE','Template invoices created','Executed when a Template invoices is created','facturerec',900,NULL),(592,'BILLREC_MODIFY','Template invoices update','Executed when a Template invoices is updated','facturerec',901,NULL),(593,'BILLREC_DELETE','Template invoices deleted','Executed when a Template invoices is deleted','facturerec',902,NULL),(594,'BILLREC_AUTOCREATEBILL','Template invoices use to create invoices with auto batch','Executed when a Template invoices is use to create invoice with auto batch','facturerec',903,NULL),(875,'PARTNERSHIP_CREATE','Partnership created','Executed when a partnership is created','partnership',58000,NULL),(876,'PARTNERSHIP_MODIFY','Partnership modified','Executed when a partnership is modified','partnership',58002,NULL),(877,'PARTNERSHIP_SENTBYMAIL','Mails sent from partnership file','Executed when you send email from partnership file','partnership',58004,NULL),(878,'PARTNERSHIP_DELETE','Partnership deleted','Executed when a partnership is deleted','partnership',58006,NULL),(879,'PROJECT_CLOSE','Project closed','Executed when a project is closed','project',145,NULL),(881,'COMPANY_RIB_CREATE','Third party payment information created','Executed when a third party payment information is created','societe',1,NULL),(882,'COMPANY_RIB_MODIFY','Third party payment information updated','Executed when a third party payment information is updated','societe',1,NULL),(883,'COMPANY_RIB_DELETE','Third party payment information deleted','Executed when a third party payment information is deleted','societe',1,NULL),(884,'FICHINTER_CLOSE','Intervention is done','Executed when a intervention is done','ficheinter',36,NULL); +INSERT INTO `llx_c_action_trigger` VALUES (131,'COMPANY_SENTBYMAIL','Mails sent from third party card','Executed when you send email from third party card','societe',1,NULL),(132,'COMPANY_CREATE','Third party created','Executed when a third party is created','societe',1,NULL),(133,'PROPAL_VALIDATE','Customer proposal validated','Executed when a commercial proposal is validated','propal',2,NULL),(134,'PROPAL_SENTBYMAIL','Commercial proposal sent by mail','Executed when a commercial proposal is sent by mail','propal',3,NULL),(135,'ORDER_VALIDATE','Customer order validate','Executed when a customer order is validated','commande',4,NULL),(136,'ORDER_CLOSE','Customer order classify delivered','Executed when a customer order is set delivered','commande',5,NULL),(137,'ORDER_CLASSIFY_BILLED','Customer order classify billed','Executed when a customer order is set to billed','commande',5,NULL),(138,'ORDER_CANCEL','Customer order canceled','Executed when a customer order is canceled','commande',5,NULL),(139,'ORDER_SENTBYMAIL','Customer order sent by mail','Executed when a customer order is sent by mail ','commande',5,NULL),(140,'BILL_VALIDATE','Customer invoice validated','Executed when a customer invoice is approved','facture',6,NULL),(141,'BILL_PAYED','Customer invoice payed','Executed when a customer invoice is payed','facture',7,NULL),(142,'BILL_CANCEL','Customer invoice canceled','Executed when a customer invoice is canceled','facture',8,NULL),(143,'BILL_SENTBYMAIL','Customer invoice sent by mail','Executed when a customer invoice is sent by mail','facture',9,NULL),(144,'BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',9,NULL),(145,'ORDER_SUPPLIER_VALIDATE','Supplier order validated','Executed when a supplier order is validated','order_supplier',11,NULL),(146,'ORDER_SUPPLIER_APPROVE','Supplier order request approved','Executed when a supplier order is approved','order_supplier',12,NULL),(147,'ORDER_SUPPLIER_REFUSE','Supplier order request refused','Executed when a supplier order is refused','order_supplier',13,NULL),(148,'ORDER_SUPPLIER_SENTBYMAIL','Supplier order sent by mail','Executed when a supplier order is sent by mail','order_supplier',14,NULL),(149,'BILL_SUPPLIER_VALIDATE','Supplier invoice validated','Executed when a supplier invoice is validated','invoice_supplier',15,NULL),(150,'BILL_SUPPLIER_PAYED','Supplier invoice payed','Executed when a supplier invoice is payed','invoice_supplier',16,NULL),(151,'BILL_SUPPLIER_SENTBYMAIL','Supplier invoice sent by mail','Executed when a supplier invoice is sent by mail','invoice_supplier',17,NULL),(152,'BILL_SUPPLIER_CANCELED','Supplier invoice cancelled','Executed when a supplier invoice is cancelled','invoice_supplier',17,NULL),(153,'CONTRACT_VALIDATE','Contract validated','Executed when a contract is validated','contrat',18,NULL),(154,'SHIPPING_VALIDATE','Shipping validated','Executed when a shipping is validated','shipping',20,NULL),(155,'SHIPPING_SENTBYMAIL','Shipping sent by mail','Executed when a shipping is sent by mail','shipping',21,NULL),(156,'MEMBER_VALIDATE','Member validated','Executed when a member is validated','member',22,NULL),(158,'MEMBER_RESILIATE','Member resiliated','Executed when a member is resiliated','member',24,NULL),(159,'MEMBER_MODIFY','Member modified','Executed when a member is modified','member',24,NULL),(160,'MEMBER_DELETE','Member deleted','Executed when a member is deleted','member',25,NULL),(161,'FICHINTER_VALIDATE','Intervention validated','Executed when a intervention is validated','ficheinter',19,NULL),(162,'FICHINTER_CLASSIFY_BILLED','Intervention set billed','Executed when a intervention is set to billed (when option FICHINTER_CLASSIFY_BILLED is set)','ficheinter',19,NULL),(163,'FICHINTER_CLASSIFY_UNBILLED','Intervention set unbilled','Executed when a intervention is set to unbilled (when option FICHINTER_CLASSIFY_BILLED is set)','ficheinter',19,NULL),(164,'FICHINTER_REOPEN','Intervention opened','Executed when a intervention is re-opened','ficheinter',19,NULL),(165,'FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',19,NULL),(166,'PROJECT_CREATE','Project creation','Executed when a project is created','project',140,NULL),(167,'PROPAL_CLOSE_SIGNED','Customer proposal closed signed','Executed when a customer proposal is closed signed','propal',2,NULL),(168,'PROPAL_CLOSE_REFUSED','Customer proposal closed refused','Executed when a customer proposal is closed refused','propal',2,NULL),(169,'PROPAL_CLASSIFY_BILLED','Customer proposal set billed','Executed when a customer proposal is set to billed','propal',2,NULL),(170,'TASK_CREATE','Task created','Executed when a project task is created','project',35,NULL),(171,'TASK_MODIFY','Task modified','Executed when a project task is modified','project',36,NULL),(172,'TASK_DELETE','Task deleted','Executed when a project task is deleted','project',37,NULL),(173,'BILL_SUPPLIER_UNVALIDATE','Supplier invoice unvalidated','Executed when a supplier invoice status is set back to draft','invoice_supplier',15,NULL),(174,'PROJECT_MODIFY','Project modified','Executed when a project is modified','project',141,NULL),(175,'PROJECT_DELETE','Project deleted','Executed when a project is deleted','project',142,NULL),(176,'ORDER_SUPPLIER_CREATE','Supplier order validated','Executed when a supplier order is validated','order_supplier',11,NULL),(177,'ORDER_SUPPLIER_SUBMIT','Supplier order request submited','Executed when a supplier order is approved','order_supplier',12,NULL),(178,'ORDER_SUPPLIER_RECEIVE','Supplier order request received','Executed when a supplier order is received','order_supplier',12,NULL),(179,'ORDER_SUPPLIER_CLASSIFY_BILLED','Supplier order set billed','Executed when a supplier order is set as billed','order_supplier',14,NULL),(180,'PRODUCT_CREATE','Product or service created','Executed when a product or sevice is created','product',30,NULL),(181,'PRODUCT_MODIFY','Product or service modified','Executed when a product or sevice is modified','product',30,NULL),(182,'PRODUCT_DELETE','Product or service deleted','Executed when a product or sevice is deleted','product',30,NULL),(183,'EXPENSE_REPORT_CREATE','Expense report created','Executed when an expense report is created','expensereport',201,NULL),(185,'EXPENSE_REPORT_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',202,NULL),(186,'EXPENSE_REPORT_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',203,NULL),(187,'EXPENSE_REPORT_PAID','Expense report billed','Executed when an expense report is set as billed','expensereport',204,NULL),(192,'HOLIDAY_CREATE','Leave request created','Executed when a leave request is created','holiday',221,NULL),(193,'HOLIDAY_VALIDATE','Leave request validated','Executed when a leave request is validated','holiday',222,NULL),(194,'HOLIDAY_APPROVE','Leave request approved','Executed when a leave request is approved','holiday',223,NULL),(210,'MEMBER_SENTBYMAIL','Mails sent from member card','Executed when you send email from member card','member',23,NULL),(211,'CONTRACT_SENTBYMAIL','Contract sent by mail','Executed when a contract is sent by mail','contrat',18,NULL),(212,'PROPOSAL_SUPPLIER_VALIDATE','Price request validated','Executed when a commercial proposal is validated','proposal_supplier',10,NULL),(213,'PROPOSAL_SUPPLIER_SENTBYMAIL','Price request sent by mail','Executed when a commercial proposal is sent by mail','proposal_supplier',10,NULL),(214,'PROPOSAL_SUPPLIER_CLOSE_SIGNED','Price request closed signed','Executed when a customer proposal is closed signed','proposal_supplier',10,NULL),(215,'PROPOSAL_SUPPLIER_CLOSE_REFUSED','Price request closed refused','Executed when a customer proposal is closed refused','proposal_supplier',10,NULL),(216,'MEMBER_SUBSCRIPTION_CREATE','Member subscribtion recorded','Executed when a member subscribtion is deleted','member',24,NULL),(217,'MEMBER_SUBSCRIPTION_MODIFY','Member subscribtion modified','Executed when a member subscribtion is modified','member',24,NULL),(218,'MEMBER_SUBSCRIPTION_DELETE','Member subscribtion deleted','Executed when a member subscribtion is deleted','member',24,NULL),(225,'COMPANY_DELETE','Third party deleted','Executed when you delete third party','societe',1,NULL),(226,'PROPAL_DELETE','Customer proposal deleted','Executed when a customer proposal is deleted','propal',2,NULL),(227,'ORDER_DELETE','Customer order deleted','Executed when a customer order is deleted','commande',5,NULL),(228,'BILL_DELETE','Customer invoice deleted','Executed when a customer invoice is deleted','facture',9,NULL),(229,'PROPOSAL_SUPPLIER_DELETE','Price request deleted','Executed when a customer proposal delete','proposal_supplier',10,NULL),(230,'ORDER_SUPPLIER_DELETE','Supplier order deleted','Executed when a supplier order is deleted','order_supplier',14,NULL),(231,'BILL_SUPPLIER_DELETE','Supplier invoice deleted','Executed when a supplier invoice is deleted','invoice_supplier',17,NULL),(232,'CONTRACT_DELETE','Contract deleted','Executed when a contract is deleted','contrat',18,NULL),(233,'FICHINTER_DELETE','Intervention is deleted','Executed when a intervention is deleted','ficheinter',35,NULL),(234,'EXPENSE_REPORT_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',204,NULL),(249,'TICKET_CREATE','Ticket created','Executed when a ticket is created','ticket',161,NULL),(250,'TICKET_MODIFY','Ticket modified','Executed when a ticket is modified','ticket',163,NULL),(251,'TICKET_ASSIGNED','Ticket assigned','Executed when a ticket is assigned to another user','ticket',164,NULL),(252,'TICKET_CLOSE','Ticket closed','Executed when a ticket is closed','ticket',165,NULL),(253,'TICKET_SENTBYMAIL','Ticket message sent by email','Executed when a message is sent from the ticket record','ticket',166,NULL),(254,'TICKET_DELETE','Ticket deleted','Executed when a ticket is deleted','ticket',167,NULL),(261,'USER_SENTBYMAIL','Email sent','Executed when an email is sent from user card','user',300,NULL),(262,'BOM_VALIDATE','BOM validated','Executed when a BOM is validated','bom',650,NULL),(263,'BOM_UNVALIDATE','BOM unvalidated','Executed when a BOM is unvalidated','bom',651,NULL),(264,'BOM_CLOSE','BOM disabled','Executed when a BOM is disabled','bom',652,NULL),(265,'BOM_REOPEN','BOM reopen','Executed when a BOM is re-open','bom',653,NULL),(266,'BOM_DELETE','BOM deleted','Executed when a BOM deleted','bom',654,NULL),(351,'MRP_MO_VALIDATE','MO validated','Executed when a MO is validated','bom',660,NULL),(352,'MRP_MO_PRODUCED','MO produced','Executed when a MO is produced','bom',661,NULL),(353,'MRP_MO_DELETE','MO deleted','Executed when a MO is deleted','bom',662,NULL),(354,'MRP_MO_CANCEL','MO canceled','Executed when a MO is canceled','bom',663,NULL),(365,'CONTACT_CREATE','Contact address created','Executed when a contact is created','contact',50,NULL),(366,'CONTACT_SENTBYMAIL','Mails sent from third party card','Executed when you send email from contact adress card','contact',51,NULL),(367,'CONTACT_DELETE','Contact address deleted','Executed when a contact is deleted','contact',52,NULL),(368,'RECRUITMENTJOBPOSITION_CREATE','Job created','Executed when a job is created','recruitment',7500,NULL),(369,'RECRUITMENTJOBPOSITION_MODIFY','Job modified','Executed when a job is modified','recruitment',7502,NULL),(370,'RECRUITMENTJOBPOSITION_SENTBYMAIL','Mails sent from job record','Executed when you send email from job record','recruitment',7504,NULL),(371,'RECRUITMENTJOBPOSITION_DELETE','Job deleted','Executed when a job is deleted','recruitment',7506,NULL),(372,'RECRUITMENTCANDIDATURE_CREATE','Candidature created','Executed when a candidature is created','recruitment',7510,NULL),(373,'RECRUITMENTCANDIDATURE_MODIFY','Candidature modified','Executed when a candidature is modified','recruitment',7512,NULL),(374,'RECRUITMENTCANDIDATURE_SENTBYMAIL','Mails sent from candidature record','Executed when you send email from candidature record','recruitment',7514,NULL),(375,'RECRUITMENTCANDIDATURE_DELETE','Candidature deleted','Executed when a candidature is deleted','recruitment',7516,NULL),(392,'COMPANY_MODIFY','Third party update','Executed when you update third party','societe',1,NULL),(393,'CONTACT_MODIFY','Contact address update','Executed when a contact is updated','contact',51,NULL),(394,'ORDER_SUPPLIER_CANCEL','Supplier order request canceled','Executed when a supplier order is canceled','order_supplier',13,NULL),(395,'MEMBER_EXCLUDE','Member excluded','Executed when a member is excluded','member',27,NULL),(396,'USER_CREATE','User created','Executed when a user is created','user',301,NULL),(397,'USER_MODIFY','User update','Executed when a user is updated','user',302,NULL),(398,'USER_DELETE','User update','Executed when a user is deleted','user',303,NULL),(399,'USER_NEW_PASSWORD','User update','Executed when a user is change password','user',304,NULL),(400,'USER_ENABLEDISABLE','User update','Executed when a user is enable or disable','user',305,NULL),(402,'HOLIDAY_MODIFY','Holiday modified','Executed when a holiday is modified','holiday',801,NULL),(405,'HOLIDAY_CANCEL','Holiday canceled','Executed when a holiday is canceled','holiday',802,NULL),(406,'HOLIDAY_DELETE','Holiday deleted','Executed when a holiday is deleted','holiday',804,NULL),(407,'PROPAL_MODIFY','Customer proposal modified','Executed when a customer proposal is modified','propal',2,NULL),(408,'ORDER_MODIFY','Customer order modified','Executed when a customer order is set modified','commande',5,NULL),(409,'BILL_MODIFY','Customer invoice modified','Executed when a customer invoice is modified','facture',7,NULL),(410,'PROPOSAL_SUPPLIER_MODIFY','Price request modified','Executed when a commercial proposal is modified','proposal_supplier',10,NULL),(411,'ORDER_SUPPLIER_MODIFY','Supplier order request modified','Executed when a supplier order is modified','order_supplier',13,NULL),(412,'BILL_SUPPLIER_MODIFY','Supplier invoice modified','Executed when a supplier invoice is modified','invoice_supplier',15,NULL),(413,'CONTRACT_MODIFY','Contract modified','Executed when a contract is modified','contrat',18,NULL),(414,'SHIPPING_MODIFY','Shipping modified','Executed when a shipping is modified','shipping',20,NULL),(415,'FICHINTER_MODIFY','Intervention modify','Executed when a intervention is modify','ficheinter',30,NULL),(417,'EXPENSE_REPORT_MODIFY','Expense report modified','Executed when an expense report is modified','expensereport',202,NULL),(455,'PROJECT_SENTBYMAIL','Project sent by mail','Executed when a project is sent by email','project',144,NULL),(511,'SHIPPING_DELETE','Shipping sent is deleted','Executed when a shipping is deleted','shipping',21,NULL),(512,'RECEPTION_VALIDATE','Reception validated','Executed when a reception is validated','reception',22,NULL),(513,'RECEPTION_SENTBYMAIL','Reception sent by mail','Executed when a reception is sent by mail','reception',22,NULL),(543,'PROJECT_VALIDATE','Project validation','Executed when a project is validated','project',141,NULL),(584,'ACTION_CREATE','Action added','Executed when an action is added to the agenda','agenda',700,NULL),(591,'BILLREC_CREATE','Template invoices created','Executed when a Template invoices is created','facturerec',900,NULL),(592,'BILLREC_MODIFY','Template invoices update','Executed when a Template invoices is updated','facturerec',901,NULL),(593,'BILLREC_DELETE','Template invoices deleted','Executed when a Template invoices is deleted','facturerec',902,NULL),(594,'BILLREC_AUTOCREATEBILL','Template invoices use to create invoices with auto batch','Executed when a Template invoices is use to create invoice with auto batch','facturerec',903,NULL),(875,'PARTNERSHIP_CREATE','Partnership created','Executed when a partnership is created','partnership',58000,NULL),(876,'PARTNERSHIP_MODIFY','Partnership modified','Executed when a partnership is modified','partnership',58002,NULL),(877,'PARTNERSHIP_SENTBYMAIL','Mails sent from partnership file','Executed when you send email from partnership file','partnership',58004,NULL),(878,'PARTNERSHIP_DELETE','Partnership deleted','Executed when a partnership is deleted','partnership',58006,NULL),(879,'PROJECT_CLOSE','Project closed','Executed when a project is closed','project',145,NULL),(881,'COMPANY_RIB_CREATE','Third party payment information created','Executed when a third party payment information is created','societe',1,NULL),(882,'COMPANY_RIB_MODIFY','Third party payment information updated','Executed when a third party payment information is updated','societe',1,NULL),(883,'COMPANY_RIB_DELETE','Third party payment information deleted','Executed when a third party payment information is deleted','societe',1,NULL),(884,'FICHINTER_CLOSE','Intervention is done','Executed when a intervention is done','ficheinter',36,NULL); /*!40000 ALTER TABLE `llx_c_action_trigger` ENABLE KEYS */; UNLOCK TABLES; diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 97e91d7bb07..f7210c92b8d 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -23,7 +23,6 @@ return [ // PhanUndeclaredFunctionInCallable : 4 occurrences // PhanAccessMethodProtected : 1 occurrence // PhanAccessPropertyStaticAsNonStatic : 1 occurrence - // PhanNoopArray : 1 occurrence // PhanNoopArrayAccess : 1 occurrence // PhanNoopStringLiteral : 1 occurrence // PhanPluginAlwaysReturnFunction : 1 occurrence @@ -50,7 +49,7 @@ return [ 'htdocs/core/class/commondocgenerator.class.php' => ['PhanTypeArraySuspiciousNull'], 'htdocs/core/class/evalmath.class.php' => ['PhanPluginUnsafeEval'], 'htdocs/core/class/html.form.class.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/core/class/html.formmail.class.php' => ['PhanNoopArray'], + 'htdocs/core/class/html.formprojet.class.php' => ['PhanTypeMismatchReturnNullable'], 'htdocs/core/class/rssparser.class.php' => ['PhanUndeclaredFunctionInCallable'], 'htdocs/core/db/mysqli.class.php' => ['PhanParamSignatureMismatch'], 'htdocs/core/db/pgsql.class.php' => ['PhanParamSignatureMismatch'], diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index 5cb5b5b2f07..1c4297caad8 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -499,7 +499,7 @@ return [ 'PhanUndeclaredVariableAssignOp', 'PhanTypeExpectedObjectOrClassName', 'PhanEmptyFQSENInClasslike', - 'PhanTypeMismatchArgumentInternalReal', + // 'PhanTypeMismatchArgumentInternalReal', // 'PhanUnextractableAnnotationElementName', // 'PhanCommentParamWithoutRealParam', // 'PhanRedefinedExtendedClass', @@ -518,7 +518,7 @@ return [ // 'PhanCommentDuplicateMagicMethod', // 'PhanParamSpecial1', 'PhanPluginInlineHTMLLeading', - 'PhanPluginUseReturnValueInternalKnown', + // 'PhanPluginUseReturnValueInternalKnown', // 'PhanRedefinedInheritedInterface', // 'PhanTypeComparisonToArray', 'PhanTypeConversionFromArray', @@ -550,14 +550,14 @@ return [ // 'PhanTypeInstantiateTraitStaticOrSelf', // 'PhanUndeclaredInvokeInCallable', // 'PhanNoopProperty', - 'PhanNoopVariable', + // 'PhanNoopVariable', // 'PhanPluginPrintfUnusedArgument', // 'PhanSyntaxReturnExpectedValue', // 'PhanAccessClassInternal', // 'PhanCompatibleAccessMethodOnTraitDefinition', // 'PhanNoopSwitchCases', // 'PhanNoopTernary', - 'PhanNoopUnaryOperator', + // 'PhanNoopUnaryOperator', // 'PhanParamNameIndicatingUnusedInClosure', // 'PhanParamSignatureRealMismatchTooFewParametersInternal', // 'PhanPluginEmptyStatementSwitch', diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 20d561ed752..567af5d4d10 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -67,7 +67,7 @@ if (!$user->hasRight('accounting', 'chartofaccount')) { } // Load variable for pagination -$limit = GETPOSTINT('limit', $conf->liste_limit); +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); diff --git a/htdocs/admin/hrm.php b/htdocs/admin/hrm.php index c057181dd25..fecafa518f5 100644 --- a/htdocs/admin/hrm.php +++ b/htdocs/admin/hrm.php @@ -116,8 +116,9 @@ if ($action == 'update') { $modele = GETPOST('module', 'alpha'); $tmpobjectkey = GETPOST('object', 'aZ09'); - if (in_array($tmpobjectkey, $myTmpObjects)) { - $tmpobject = new $tmpobjectkey($db); + if (array_key_exists($tmpobjectkey, $myTmpObjects)) { + $nameofclass = ucfirst($tmpobjectkey); + $tmpobject = new $nameofclass($db); $tmpobject->initAsSpecimen(); // Search template files @@ -295,6 +296,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { $nameofclass = ucfirst($myTmpObjectKey); $mytmpinstance = new $nameofclass($db); + '@phan-var-force Evaluation $mytmpinstance'; $mytmpinstance->initAsSpecimen(); // Info diff --git a/htdocs/admin/knowledgemanagement.php b/htdocs/admin/knowledgemanagement.php index c3b7a4be39c..10ee2610079 100644 --- a/htdocs/admin/knowledgemanagement.php +++ b/htdocs/admin/knowledgemanagement.php @@ -1,7 +1,7 @@ - * Copyright (C) 2021 SuperAdmin - * Copyright (C) 2024 MDW +/* Copyright (C) 2004-2017 Laurent Destailleur + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -31,6 +31,7 @@ global $langs, $user; // Libraries require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; require_once DOL_DOCUMENT_ROOT."/knowledgemanagement/lib/knowledgemanagement.lib.php"; +require_once DOL_DOCUMENT_ROOT."/knowledgemanagement/class/knowledgerecord.class.php"; // Translations $langs->loadLangs(array("admin", "knowledgemanagement")); @@ -65,7 +66,7 @@ if (!$user->admin) { $moduledir = 'knowledgemanagement'; $myTmpObjects = array(); // TODO Scan list of objects to fill this array -$myTmpObjects['knowledgemanagement'] = array('label'=>'KnowledgeManagement', 'includerefgeneration'=>0, 'includedocgeneration'=>0, 'class'=>'KnowledgeManagement'); +$myTmpObjects['knowledgemanagement'] = array('label' => 'KnowledgeManagement', 'includerefgeneration' => 1, 'includedocgeneration' => 0, 'class' => 'KnowledgeRecord'); /* @@ -94,26 +95,27 @@ if ($action == 'updateMask') { $modele = GETPOST('module', 'alpha'); $tmpobjectkey = GETPOST('object', 'aZ09'); - if (in_array($tmpobjectkey, $myTmpObjects)) { - $tmpobject = new $tmpobjectkey($db); + if (array_key_exists($tmpobjectkey, $myTmpObjects)) { + $className = $myTmpObjects[$tmpobjectkey]['class']; + $tmpobject = new $className($db); $tmpobject->initAsSpecimen(); // Search template files $file = ''; - $classname = ''; + $className = ''; $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); foreach ($dirmodels as $reldir) { $file = dol_buildpath($reldir."core/modules/knowledgemanagement/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0); if (file_exists($file)) { - $classname = "pdf_".$modele; + $className = "pdf_".$modele; break; } } - if ($classname !== '') { + if ($className !== '') { require_once $file; - $module = new $classname($db); + $module = new $className($db); if ($module->write_file($tmpobject, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=".strtolower($tmpobjectkey)."&file=SPECIMEN.pdf"); @@ -339,16 +341,8 @@ if ($action == 'edit') { } -$moduledir = 'knowledgemanagement'; -$myTmpObjects = array(); -$myTmpObjects['MyObject'] = array('includerefgeneration' => 0, 'includedocgeneration' => 0); - - foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { - if ($myTmpObjectKey == 'MyObject') { - continue; - } - if ($myTmpObjectArray['includerefgeneration']) { + if (!empty($myTmpObjectArray['includerefgeneration'])) { /* * Orders Numbering model */ @@ -374,7 +368,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { $handle = opendir($dir); if (is_resource($handle)) { while (($file = readdir($handle)) !== false) { - if (strpos($file, 'mod_'.strtolower($myTmpObjectKey).'_') === 0 && substr($file, dol_strlen($file) - 3, 3) == 'php') { + if (strpos($file, 'mod_'.strtolower($myTmpObjectArray['class']).'_') === 0 && substr($file, dol_strlen($file) - 3, 3) == 'php') { $file = substr($file, 0, dol_strlen($file) - 4); require_once $dir.'/'.$file.'.php'; @@ -420,7 +414,8 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { } print ''; - $mytmpinstance = new $myTmpObjectKey($db); + $className = $myTmpObjectArray['class']; + $mytmpinstance = new $className($db); $mytmpinstance->initAsSpecimen(); // Info @@ -455,7 +450,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { print "
\n"; } - if ($myTmpObjectArray['includedocgeneration']) { + if (!empty($myTmpObjectArray['includedocgeneration'])) { /* * Document templates generators */ @@ -514,10 +509,10 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { if (file_exists($dir.'/'.$file)) { $name = substr($file, 4, dol_strlen($file) - 16); - $classname = substr($file, 0, dol_strlen($file) - 12); + $className = substr($file, 0, dol_strlen($file) - 12); require_once $dir.'/'.$file; - $module = new $classname($db); + $module = new $className($db); $modulequalified = 1; if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 893523f22da..435fb37e1f6 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -1318,7 +1318,7 @@ if ($mode == 'deploy') { print ' '; - print ''; + print ''; if (getDolGlobalString('MAIN_UPLOAD_DOC')) { if ($user->admin) { diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 307f4e3a579..fa6547f2eb0 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -51,14 +51,15 @@ if ($mode == 'searchkey') { $transvalue = GETPOST('transvalue', 'restricthtml'); } - +// Load variable for pagination $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); -if (empty($page) || $page == -1) { +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; -} // If $page is not defined, or '' or -1 +} $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -248,7 +249,7 @@ if ($transvalue) { } -print '
entity) && !empty($debug)) ? '?debug=1' : '').'" method="POST">'; +print ''; if (isset($optioncss) && $optioncss != '') { print ''; } @@ -400,12 +401,12 @@ if ($mode == 'overwrite') { print ''; - print ''.$obj->lang.''."\n"; + print ''.dol_escape_htmltag($obj->lang).''."\n"; print ''; if ($action == 'edit' && $obj->rowid == GETPOSTINT('rowid')) { print ''; } else { - print $obj->transkey; + print dol_escape_htmltag($obj->transkey); } print ''."\n"; @@ -420,7 +421,7 @@ if ($mode == 'overwrite') { print ''; } else { //print $obj->transkey.' '.$langsenfileonly->tab_translate[$obj->transkey]; - $titleforvalue = $langs->trans("Translation").' en_US for key '.$obj->transkey.':
'.($langsenfileonly->tab_translate[$obj->transkey] ? $langsenfileonly->trans($obj->transkey) : ''.$langs->trans("None").''); + $titleforvalue = $langs->trans("Translation").' en_US for key '.$obj->transkey.':
'.(!empty($langsenfileonly->tab_translate[$obj->transkey]) ? $langsenfileonly->trans($obj->transkey) : ''.$langs->trans("None").''); /*if ($obj->lang != 'en_US') { $titleforvalue .= '
'.$langs->trans("Translation").' '.$obj->lang.' '...; }*/ @@ -437,9 +438,9 @@ if ($mode == 'overwrite') { print '   '; print ''; } else { - print ''.img_edit().''; + print ''.img_edit().''; print '   '; - print ''.img_delete().''; + print ''.img_delete().''; } print ''; @@ -565,7 +566,7 @@ if ($mode == 'searchkey') { if ($i <= $offset) { continue; } - if ($i > ($offset + $limit)) { + if ($limit && $i > ($offset + $limit)) { break; } print ''.$langcode.''.$key.''; diff --git a/htdocs/admin/workstation.php b/htdocs/admin/workstation.php index 78715860e12..c98e036c1d3 100644 --- a/htdocs/admin/workstation.php +++ b/htdocs/admin/workstation.php @@ -84,8 +84,9 @@ if ($action == 'updateMask') { $modele = GETPOST('module', 'alpha'); $tmpobjectkey = GETPOST('object', 'aZ09'); - if (in_array($tmpobjectkey, $myTmpObjects)) { - $tmpobject = new $tmpobjectkey($db); + if (array_key_exists($tmpobjectkey, $myTmpObjects)) { + $nameofclass = ucfirst($tmpobjectkey); + $tmpobject = new $nameofclass($db); $tmpobject->initAsSpecimen(); // Search template files diff --git a/htdocs/ai/admin/custom_prompt.php b/htdocs/ai/admin/custom_prompt.php index 628b3adf568..5836a0d5b26 100644 --- a/htdocs/ai/admin/custom_prompt.php +++ b/htdocs/ai/admin/custom_prompt.php @@ -159,10 +159,10 @@ if ($action == 'confirm_deleteproperty' && GETPOST('confirm') == 'yes') { $res = dolibarr_set_const($db, 'AI_CONFIGURATIONS_PROMPT', $newConfigurationsJson, 'chaine', 0, '', $conf->entity); if ($res) { header("Location: ".$_SERVER['PHP_SELF']); - setEventMessages($langs->trans("SetupDeleted"), null, 'mesgs'); + setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); exit; } else { - setEventMessages($langs->trans("ErrorDeleting"), null, 'errors'); + setEventMessages($langs->trans("NoRecordDeleted"), null, 'errors'); } } } diff --git a/htdocs/ai/admin/setup.php b/htdocs/ai/admin/setup.php index 02ecda6a727..a2bb8f77a23 100644 --- a/htdocs/ai/admin/setup.php +++ b/htdocs/ai/admin/setup.php @@ -173,9 +173,6 @@ print load_fiche_titre($langs->trans($title), $linkback, 'title_setup'); $head = aiAdminPrepareHead(); print dol_get_fiche_head($head, 'settings', $langs->trans($title), -1, "fa-microchip"); -// Setup page goes here -//echo ''.$langs->trans("AiSetupPage").'

'; - if ($action == 'edit') { print $formSetup->generateOutput(true); diff --git a/htdocs/ai/ajax/generate_content.php b/htdocs/ai/ajax/generate_content.php index 11aaa3e787b..bba1402d340 100644 --- a/htdocs/ai/ajax/generate_content.php +++ b/htdocs/ai/ajax/generate_content.php @@ -68,12 +68,12 @@ $format = empty($jsonData['instructions']) ? '' : $jsonData['instructions']; $generatedContent = $ai->generateContent($instructions, 'auto', $function, $format); if (is_array($generatedContent) && $generatedContent['error']) { - // client errors - if ($generatedContent['code'] >= 400) { - print "Error : " . $generatedContent['message']; - print '
'.$langs->trans('Check Config of Module').''; - } elseif ($generatedContent['code'] == 429) { + // Output error + if ($generatedContent['code'] == 429) { print "Quota or allowed period exceeded. Retry Later !"; + } elseif ($generatedContent['code'] >= 400) { + print "Error : " . $generatedContent['message']; + print '
'.$langs->trans('ErrorGoToModuleSetup').''; } else { print "Error returned by API call: " . $generatedContent['message']; } diff --git a/htdocs/asset/admin/setup.php b/htdocs/asset/admin/setup.php index 0297cce5031..5850128b3d2 100644 --- a/htdocs/asset/admin/setup.php +++ b/htdocs/asset/admin/setup.php @@ -95,8 +95,9 @@ if ($action == 'updateMask') { $modele = GETPOST('module', 'alpha'); $tmpobjectkey = GETPOST('object', 'aZ09'); - if (in_array($tmpobjectkey, $myTmpObjects)) { - $tmpobject = new $tmpobjectkey($db); + if (array_key_exists($tmpobjectkey, $myTmpObjects)) { + $nameofclass = ucfirst($tmpobjectkey); + $tmpobject = new $nameofclass($db); $tmpobject->initAsSpecimen(); // Search template files diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index f65789c855c..57365ce5f50 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -256,7 +256,7 @@ class Categorie extends CommonObject public $type; /** - * @var array Categories table in memory + * @var array Categories table in memory */ public $cats = array(); @@ -970,7 +970,7 @@ class Categorie extends CommonObject * @param string $sortorder Sort order * @param int $limit Limit for list * @param int $page Page number - * @return array|int Array of categories, 0 if no cat, -1 on error + * @return int<-1,0>|array,visible:int,ref_ext:string,picto:string,multilangs?:string}> Array of categories, 0 if no cat, -1 on error */ public function getListForItem($id, $type = 'customer', $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) { @@ -1139,7 +1139,7 @@ class Categorie extends CommonObject * - string (categories ids separated by comma) * - array (list of categories ids) * @param int $include [=0] Removed or 1=Keep only - * @return array|int Array of categories. this->cats and this->motherof are set, -1 on error + * @return int<-1,-1>|array Array of categories. this->cats and this->motherof are set, -1 on error */ public function get_full_arbo($type, $markafterid = 0, $include = 0) { @@ -1222,9 +1222,10 @@ class Categorie extends CommonObject $keyfilter2 = '_'.$keyfiltercatid.'$'; $keyfilter3 = '^'.$keyfiltercatid.'_'; $keyfilter4 = '_'.$keyfiltercatid.'_'; - foreach ($this->cats as $key => $val) { - $test = (preg_match('/'.$keyfilter1.'/', $val['fullpath']) || preg_match('/'.$keyfilter2.'/', $val['fullpath']) - || preg_match('/'.$keyfilter3.'/', $val['fullpath']) || preg_match('/'.$keyfilter4.'/', $val['fullpath'])); + foreach (array_keys($this->cats) as $key) { + $fullpath = $this->cats[$key]['fullpath']; + $test = (preg_match('/'.$keyfilter1.'/', $fullpath) || preg_match('/'.$keyfilter2.'/', $fullpath) + || preg_match('/'.$keyfilter3.'/', $fullpath) || preg_match('/'.$keyfilter4.'/', $fullpath)); if (($test && !$include) || (!$test && $include)) { unset($this->cats[$key]); @@ -1245,7 +1246,7 @@ class Categorie extends CommonObject * * @param int $id_categ id_categ entry to update * @param int $protection Deep counter to avoid infinite loop - * @return int Return integer <0 if KO, >0 if OK + * @return int<-1,1> Return integer <0 if KO, >0 if OK * @see get_full_arbo() */ private function buildPathFromId($id_categ, $protection = 1000) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 216ec9bbdd8..d0efa85599e 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -895,10 +895,10 @@ if ($action == 'create') { '; } if ($formmail->withfckeditor) { - $out .= $formmail->getModelEmailTemplate(); + $out .= $formmail->getModelEmailTemplate('bodyemail'); } if ($formmail->withaiprompt && isModEnabled('ai')) { - $out .= $formmail->getSectionForAIPrompt(); + $out .= $formmail->getSectionForAIPrompt('', 'bodyemail'); } print $out; print ''; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 2950d5d2248..69d3e5b59c9 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2461,136 +2461,6 @@ class Propal extends CommonObject return -1; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Set an overall discount on the proposal - * - * @param User $user Object user that modify - * @param double $remise Amount discount - * @param int $notrigger 1=Does not execute triggers, 0= execute triggers - * @return int Return integer <0 if ko, >0 if ok - * @deprecated remise_percent is a deprecated field for object parent - */ - /* - public function set_remise_percent($user, $remise, $notrigger = 0) - { - // phpcs:enable - $remise = trim($remise) ?trim($remise) : 0; - - if ($user->hasRight('propal', 'creer')) { - $remise = price2num($remise, 2); - - $error = 0; - - $this->db->begin(); - - $sql = "UPDATE ".MAIN_DB_PREFIX."propal SET remise_percent = ".((float) $remise); - $sql .= " WHERE rowid = ".((int) $this->id)." AND fk_statut = ".self::STATUS_DRAFT; - - dol_syslog(__METHOD__, LOG_DEBUG); - $resql = $this->db->query($sql); - if (!$resql) { - $this->errors[] = $this->db->error(); - $error++; - } - - if (!$error) { - $this->oldcopy = clone $this; - $this->remise_percent = $remise; - $this->update_price(1); - } - - if (!$notrigger && empty($error)) { - // Call trigger - $result = $this->call_trigger('PROPAL_MODIFY', $user); - if ($result < 0) { - $error++; - } - // End call triggers - } - - if (!$error) { - $this->db->commit(); - return 1; - } else { - foreach ($this->errors as $errmsg) { - dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); - $this->error .= ($this->error ? ', '.$errmsg : $errmsg); - } - $this->db->rollback(); - return -1 * $error; - } - } - - return -1; - } - */ - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Set an absolute overall discount on the proposal - * - * @param User $user Object user that modify - * @param double $remise Amount discount - * @param int $notrigger 1=Does not execute triggers, 0= execute triggers - * @return int Return integer <0 if ko, >0 if ok - */ - /* - public function set_remise_absolue($user, $remise, $notrigger = 0) - { - // phpcs:enable - if (empty($remise)) { - $remise = 0; - } - $remise = price2num($remise); - - if ($user->hasRight('propal', 'creer')) { - $error = 0; - - $this->db->begin(); - - $sql = "UPDATE ".MAIN_DB_PREFIX."propal"; - $sql .= " SET remise_absolue = ".((float) $remise); - $sql .= " WHERE rowid = ".((int) $this->id)." AND fk_statut = ".self::STATUS_DRAFT; - - dol_syslog(__METHOD__, LOG_DEBUG); - $resql = $this->db->query($sql); - if (!$resql) { - $this->errors[] = $this->db->error(); - $error++; - } - - if (!$error) { - $this->oldcopy = clone $this; - $this->update_price(1); - } - - if (!$notrigger && empty($error)) { - // Call trigger - $result = $this->call_trigger('PROPAL_MODIFY', $user); - if ($result < 0) { - $error++; - } - // End call triggers - } - - if (!$error) { - $this->db->commit(); - return 1; - } else { - foreach ($this->errors as $errmsg) { - dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); - $this->error .= ($this->error ? ', '.$errmsg : $errmsg); - } - $this->db->rollback(); - return -1 * $error; - } - } - - return -1; - } - */ - /** * Reopen the commercial proposal diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 8d67611ad20..b03fe2ae009 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2445,7 +2445,6 @@ class Commande extends CommonOrder * @param float $remise Discount (percent) * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int Return integer <0 if KO, >0 if OK - * @deprecated remise_percent is a deprecated field for object parent */ public function setDiscount($user, $remise, $notrigger = 0) { diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 55c89240fa8..c161836279c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -4424,7 +4424,6 @@ class Facture extends CommonInvoice * @param float $remise Discount * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int Return integer <0 if KO, >0 if OK - * @deprecated remise_percent is a deprecated field for object parent */ public function setDiscount($user, $remise, $notrigger = 0) { diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 0594855dce2..d60aa17ce3b 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -68,12 +68,12 @@ class Paiement extends CommonObject public $socid; /** - * @var int + * @var int|string */ public $datepaye; /** - * @var int same than $datepaye + * @var int|string same than $datepaye */ public $date; diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 0094a541cf6..31b4daceabf 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -1,6 +1,6 @@ - * Copyright (C) 2016-2018 Frédéric France + * Copyright (C) 2016-2024 Frédéric France * Copyright (C) 2022 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -85,7 +85,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y foreach ($_POST as $key => $value) { if (substr($key, 0, 7) == 'amount_') { $other_chid = substr($key, 7); - $amounts[$other_chid] = price2num(GETPOST($key)); + $amounts[$other_chid] = (float) price2num(GETPOST($key)); } } diff --git a/htdocs/compta/paiement_vat.php b/htdocs/compta/paiement_vat.php index 3b98f540a22..af4e1463ae3 100644 --- a/htdocs/compta/paiement_vat.php +++ b/htdocs/compta/paiement_vat.php @@ -1,6 +1,6 @@ - * Copyright (C) 2016-2021 Frédéric France + * Copyright (C) 2016-2024 Frédéric France * Copyright (C) 2021 Gauthier VERDOL * * This program is free software; you can redistribute it and/or modify @@ -80,7 +80,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y foreach ($_POST as $key => $value) { if (substr($key, 0, 7) == 'amount_') { $other_chid = substr($key, 7); - $amounts[$other_chid] = price2num(GETPOST($key)); + $amounts[$other_chid] = (float) price2num(GETPOST($key)); } } diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 6713da39db7..6d552f245f9 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -186,7 +186,7 @@ class PaymentSocialContribution extends CommonObject $this->fk_charge = (int) $this->fk_charge; } if (isset($this->amount)) { - $this->amount = trim($this->amount); + $this->amount = (float) $this->amount; } if (isset($this->fk_typepaiement)) { $this->fk_typepaiement = (int) $this->fk_typepaiement; diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index d3f0886eae9..863eb956f33 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2015-2023 Alexandre Spangaro - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2021 Gauthier VERDOL * * This program is free software; you can redistribute it and/or modify @@ -179,7 +179,7 @@ if (empty($reshook)) { $object->datev = $datev; $object->datep = $datep; - $amount = price2num(GETPOST("amount", 'alpha')); + $amount = (float) price2num(GETPOST("amount", 'alpha')); if ($refund == 1) { $amount = price2num(-1 * $amount); } diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index a7b38cc85c7..1a11ac4f65a 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -52,7 +52,8 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; // Load translation files required by the page $langs->loadLangs(array('companies', 'users', 'other', 'commercial')); -$mesg = ''; $error = 0; $errors = array(); +$error = 0; +$errors = array(); // Get parameters $action = (GETPOST('action', 'alpha') ? GETPOST('action', 'alpha') : 'view'); diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index 680e46a244c..8161f22d703 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -1,6 +1,7 @@ * Copyright (C) 2018 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -218,6 +219,7 @@ if (empty($conf->use_javascript_ajax) || getDolGlobalString('MAIN_ECM_DISABLE_JS // We removed all expanded sections that are child of the closed section $oldexpandedsectionarray = $expandedsectionarray; $expandedsectionarray = array(); // Reset + // @phan-suppress-next-line PhanEmptyForeachBody foreach ($oldexpandedsectionarray as $sectioncursor) { // TODO is_in_subtree(fulltree,sectionparent,sectionchild) does nox exists. Enable or remove this... //if ($sectioncursor && ! is_in_subtree($sqltree,$section,$sectioncursor)) $expandedsectionarray[]=$sectioncursor; diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 5c6154a4605..048f5f68dc0 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -130,6 +130,8 @@ class FormCompany extends Form } $this->db->free($resql); } + //return natural sorted list + natsort($effs); return $effs; } diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 7557a9d89ce..2bca27f5aca 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -647,7 +647,7 @@ class FormMail extends Form if ($this->frommail) { $s .= ' <' . getDolGlobalString('MAIN_MAIL_EMAIL_FROM').'>'; } - array('label' => $s, 'data-html' => $s); + $liste['main_from'] = array('label' => $s, 'data-html' => $s); } } @@ -1440,9 +1440,10 @@ class FormMail extends Form * Return Html code for AI instruction of message and autofill result * * @param string $format Format for output ('', 'html', ...) + * @param string $htmlContent HTML name of WYSIWIG field * @return string HTML code to ask AI instruction and autofill result */ - public function getSectionForAIPrompt($format = '') + public function getSectionForAIPrompt($format = '', $htmlContent = 'message') { global $langs; @@ -1454,7 +1455,8 @@ class FormMail extends Form $out .= ''; $out .= ''; $out .= ''; - $out .= '
'.$langs->trans("AIProcessingPleaseWait").'
'; + $out .= '
'; + $out .= ''.$langs->trans("AIProcessingPleaseWait").'
'; $out .= "\n"; $out .= "