Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
0842e19f28
@ -83,9 +83,7 @@ if ($cancel) {
|
||||
$action ='';
|
||||
}
|
||||
|
||||
if ((float) DOL_VERSION >= 6) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
}
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
if ($action == 'updateMask') {
|
||||
$maskconstorder = GETPOST('maskconstorder', 'alpha');
|
||||
|
||||
@ -70,9 +70,7 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ((float) DOL_VERSION >= 6) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
}
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
if ($action == 'update') {
|
||||
$max_rank = GETPOST('HRM_MAXRANK', 'int');
|
||||
|
||||
@ -68,16 +68,14 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ((float) DOL_VERSION >= 6) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
}
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
if ($action == 'updateMask') {
|
||||
$maskconstorder = GETPOST('maskconstorder', 'alpha');
|
||||
$maskorder = GETPOST('maskorder', 'alpha');
|
||||
$maskconst = GETPOST('maskconst', 'alpha');
|
||||
$mask = GETPOST('mask', 'alpha');
|
||||
|
||||
if ($maskconstorder) {
|
||||
$res = dolibarr_set_const($db, $maskconstorder, $maskorder, 'chaine', 0, '', $conf->entity);
|
||||
if ($maskconst) {
|
||||
$res = dolibarr_set_const($db, $maskconst, $mask, 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
@ -206,7 +204,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
||||
}
|
||||
if ($myTmpObjectArray['includerefgeneration']) {
|
||||
/*
|
||||
* Orders Numbering model
|
||||
* Assets Numbering model
|
||||
*/
|
||||
$setupnotempty++;
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2019-2022 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* 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
|
||||
@ -63,12 +63,12 @@ class mod_asset_advanced extends ModeleNumRefAsset
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
$texte .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$texte .= '<input type="hidden" name="action" value="updateMask">';
|
||||
$texte .= '<input type="hidden" name="maskconstBom" value="ASSET_ASSET_ADVANCED_MASK">';
|
||||
$texte .= '<table class="nobordernopadding" width="100%">';
|
||||
$text = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$text .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
$text .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$text .= '<input type="hidden" name="action" value="updateMask">';
|
||||
$text .= '<input type="hidden" name="maskconst" value="ASSET_ADVANCED_MASK">';
|
||||
$text .= '<table class="nobordernopadding" width="100%">';
|
||||
|
||||
$tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Asset"), $langs->transnoentities("Asset"));
|
||||
$tooltip .= $langs->trans("GenericMaskCodes2");
|
||||
@ -77,17 +77,17 @@ class mod_asset_advanced extends ModeleNumRefAsset
|
||||
$tooltip .= $langs->trans("GenericMaskCodes5");
|
||||
|
||||
// Parametrage du prefix
|
||||
$texte .= '<tr><td>'.$langs->trans("Mask").':</td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskAsset" value="'.getDolGlobalString('ASSET_ASSET_ADVANCED_MASK').'">', $tooltip, 1, 1).'</td>';
|
||||
$text .= '<tr><td>'.$langs->trans("Mask").':</td>';
|
||||
$text .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="mask" value="'.getDolGlobalString('ASSET_ADVANCED_MASK').'">', $tooltip, 1, 1).'</td>';
|
||||
|
||||
$texte .= '<td class="left" rowspan="2"> <input type="submit" class="button button-edit" name="Button"value="'.$langs->trans("Modify").'"></td>';
|
||||
$text .= '<td class="left" rowspan="2"> <input type="submit" class="button button-edit" name="Button"value="'.$langs->trans("Modify").'"></td>';
|
||||
|
||||
$texte .= '</tr>';
|
||||
$text .= '</tr>';
|
||||
|
||||
$texte .= '</table>';
|
||||
$texte .= '</form>';
|
||||
$text .= '</table>';
|
||||
$text .= '</form>';
|
||||
|
||||
return $texte;
|
||||
return $text;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -102,16 +102,8 @@ class mod_asset_advanced extends ModeleNumRefAsset
|
||||
$object = new Asset($db);
|
||||
$object->initAsSpecimen();
|
||||
|
||||
/*$old_code_client = $mysoc->code_client;
|
||||
$old_code_type = $mysoc->typent_code;
|
||||
$mysoc->code_client = 'CCCCCCCCCC';
|
||||
$mysoc->typent_code = 'TTTTTTTTTT';*/
|
||||
|
||||
$numExample = $this->getNextValue($object);
|
||||
|
||||
/*$mysoc->code_client = $old_code_client;
|
||||
$mysoc->typent_code = $old_code_type;*/
|
||||
|
||||
if (!$numExample) {
|
||||
$numExample = $langs->trans('NotConfigured');
|
||||
}
|
||||
@ -121,7 +113,7 @@ class mod_asset_advanced extends ModeleNumRefAsset
|
||||
/**
|
||||
* Return next free value
|
||||
*
|
||||
* @param Object $object Object we need next value for
|
||||
* @param Asset $object Object we need next value for
|
||||
* @return string Value if KO, <0 if KO
|
||||
*/
|
||||
public function getNextValue($object)
|
||||
@ -131,7 +123,7 @@ class mod_asset_advanced extends ModeleNumRefAsset
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
// We get cursor rule
|
||||
$mask = getDolGlobalString('ASSET_ASSET_ADVANCED_MASK');
|
||||
$mask = getDolGlobalString('ASSET_ADVANCED_MASK');
|
||||
|
||||
if (!$mask) {
|
||||
$this->error = 'NotConfigured';
|
||||
@ -140,7 +132,7 @@ class mod_asset_advanced extends ModeleNumRefAsset
|
||||
|
||||
$date = $object->date;
|
||||
|
||||
$numFinal = get_next_value($db, $mask, 'asset_asset', 'ref', '', null, $date);
|
||||
$numFinal = get_next_value($db, $mask, 'asset', 'ref', '', null, $date);
|
||||
|
||||
return $numFinal;
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* 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
|
||||
@ -83,7 +84,8 @@ class mod_asset_standard extends ModeleNumRefAsset
|
||||
{
|
||||
global $conf, $langs, $db;
|
||||
|
||||
$coyymm = ''; $max = '';
|
||||
$coyymm = '';
|
||||
$max = '';
|
||||
|
||||
$posindice = strlen($this->prefix) + 6;
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
@ -124,7 +126,7 @@ class mod_asset_standard extends ModeleNumRefAsset
|
||||
// first we get the max value
|
||||
$posindice = strlen($this->prefix) + 6;
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."asset_asset";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."asset";
|
||||
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
|
||||
if ($object->ismultientitymanaged == 1) {
|
||||
$sql .= " AND entity = ".$conf->entity;
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
* Copyright (C) 2013 Cedric GROSS <c.gross@kreiz-it.fr>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
|
||||
* Copyright (C) 2022 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@ -861,6 +862,16 @@ class InterfaceActionsAuto extends DolibarrTriggers
|
||||
|
||||
// Parameters $object->sendtoid defined by caller
|
||||
//$object->sendtoid=0;
|
||||
} elseif ($action == 'PROJECT_CLOSE') {
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("agenda", "other", "projects"));
|
||||
|
||||
if (empty($object->actionmsg2)) {
|
||||
$object->actionmsg2 = $langs->transnoentities("ProjectClosedInDolibarr", $object->ref);
|
||||
}
|
||||
$object->actionmsg = $langs->transnoentities("ProjectClosedInDolibarr", $object->ref);
|
||||
|
||||
$object->sendtoid = 0;
|
||||
} elseif ($action == 'TASK_CREATE') {
|
||||
// Project tasks
|
||||
// Load translation files required by the page
|
||||
|
||||
@ -126,6 +126,7 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_MODIFY','Project modified','Executed when a project is modified','project',142);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_DELETE','Project deleted','Executed when a project is deleted','project',143);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_SENTBYMAIL','Project sent by mail','Executed when a project is sent by email','project',144);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_CLOSE','Project closed','Executed when a project is closed','project',145);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_CREATE','Ticket created','Executed when a ticket is created','ticket',161);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_MODIFY','Ticket modified','Executed when a ticket is modified','ticket',163);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_ASSIGNED','Ticket assigned','Executed when a ticket is modified','ticket',164);
|
||||
|
||||
36
htdocs/install/mysql/migration/17.0.0-18.0.0.sql
Normal file
36
htdocs/install/mysql/migration/17.0.0-18.0.0.sql
Normal file
@ -0,0 +1,36 @@
|
||||
--
|
||||
-- Be carefull to requests order.
|
||||
-- This file must be loaded by calling /install/index.php page
|
||||
-- when current version is 18.0.0 or higher.
|
||||
--
|
||||
-- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y
|
||||
-- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y
|
||||
-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new;
|
||||
-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol;
|
||||
-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60);
|
||||
-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname;
|
||||
-- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60);
|
||||
-- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name;
|
||||
-- To create a unique index ALTER TABLE llx_table ADD UNIQUE INDEX uk_table_field (field);
|
||||
-- To drop an index: -- VMYSQL4.1 DROP INDEX nomindex on llx_table;
|
||||
-- To drop an index: -- VPGSQL8.2 DROP INDEX nomindex;
|
||||
-- To make pk to be auto increment (mysql):
|
||||
-- -- VMYSQL4.3 ALTER TABLE llx_table ADD PRIMARY KEY(rowid);
|
||||
-- -- VMYSQL4.3 ALTER TABLE llx_table CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT;
|
||||
-- To make pk to be auto increment (postgres):
|
||||
-- -- VPGSQL8.2 CREATE SEQUENCE llx_table_rowid_seq OWNED BY llx_table.rowid;
|
||||
-- -- VPGSQL8.2 ALTER TABLE llx_table ADD PRIMARY KEY (rowid);
|
||||
-- -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN rowid SET DEFAULT nextval('llx_table_rowid_seq');
|
||||
-- -- VPGSQL8.2 SELECT setval('llx_table_rowid_seq', MAX(rowid)) FROM llx_table;
|
||||
-- To set a field as NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NULL;
|
||||
-- To set a field as NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL;
|
||||
-- To set a field as NOT NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NOT NULL;
|
||||
-- To set a field as NOT NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET NOT NULL;
|
||||
-- To set a field as default NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL;
|
||||
-- Note: fields with type BLOB/TEXT can't have default value.
|
||||
-- To rebuild sequence for postgresql after insert by forcing id autoincrement fields:
|
||||
-- -- VPGSQL8.2 SELECT dol_util_rebuild_sequences();
|
||||
|
||||
-- v18
|
||||
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_CLOSE','Project closed','Executed when a project is closed','project',145);
|
||||
@ -156,6 +156,7 @@ ProjectsAndTasksLines=Projects and tasks
|
||||
ProjectCreatedInDolibarr=Project %s created
|
||||
ProjectValidatedInDolibarr=Project %s validated
|
||||
ProjectModifiedInDolibarr=Project %s modified
|
||||
ProjectClosedInDolibarr=Project %s closed
|
||||
TaskCreatedInDolibarr=Task %s created
|
||||
TaskModifiedInDolibarr=Task %s modified
|
||||
TaskDeletedInDolibarr=Task %s deleted
|
||||
|
||||
@ -88,9 +88,7 @@ $setupnotempty = 0;
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ((float) DOL_VERSION >= 6) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
}
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
if ($action == 'updateMask') {
|
||||
$maskconstjob = GETPOST('maskconstjob', 'alpha');
|
||||
|
||||
@ -88,9 +88,7 @@ $setupnotempty = 0;
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ((float) DOL_VERSION >= 6) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
}
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
if ($action == 'updateMask') {
|
||||
$maskconstcand = GETPOST('maskconstcand', 'alpha');
|
||||
|
||||
@ -54,10 +54,7 @@ if (empty($user->admin)) accessforbidden();
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ((float) DOL_VERSION >= 6) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
}
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
/*
|
||||
* View
|
||||
|
||||
Loading…
Reference in New Issue
Block a user