'.$langs->trans("BackgroundImageLogin").' (png,jpg) ';
print '';
diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php
index cc8a92f819b..37d1f903b4a 100644
--- a/htdocs/admin/mails_templates.php
+++ b/htdocs/admin/mails_templates.php
@@ -536,7 +536,7 @@ $errors = $hookmanager->errors;
// Line to enter new values (input fields)
-print "
";
+print ' ';
if (empty($reshook))
{
@@ -976,12 +976,9 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
{
global $conf, $langs, $user, $db;
global $form;
- global $region_id;
- global $elementList, $sourceList, $localtax_typeList;
- global $bc;
+ global $elementList, $sourceList;
$formadmin = new FormAdmin($db);
- $formcompany = new FormCompany($db);
foreach ($fieldlist as $field => $value)
{
diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php
index cc83e019833..56251e48f7b 100644
--- a/htdocs/admin/menus/index.php
+++ b/htdocs/admin/menus/index.php
@@ -325,6 +325,22 @@ if ($conf->use_javascript_ajax)
if (!empty($menu['langs'])) $langs->load($menu['langs']);
$titre = $langs->trans($menu['titre']);
+ $entry = '';
+
+ $buttons = ''.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').' ';
+ $buttons .= ''.img_edit_add('default').' ';
+ $buttons .= ''.img_delete('default').' ';
+ $buttons .= ' ';
+ $buttons .= ''.img_picto("Up", "1uparrow").' '.img_picto("Down", "1downarrow").' ';
+
$data[] = array(
'rowid'=>$menu['rowid'],
'module'=>$menu['module'],
@@ -335,20 +351,8 @@ if ($conf->use_javascript_ajax)
'fk_mainmenu'=>$menu['fk_mainmenu'],
'fk_leftmenu'=>$menu['fk_leftmenu'],
'position'=>$menu['position'],
- 'entry'=>'',
- 'buttons'=>''.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').' '.
- ''.img_edit_add('default').' '.
- ''.img_delete('default').' '.
- ' '.
- ''.img_picto("Up", "1uparrow").' '.img_picto("Down", "1downarrow").' '
+ 'entry'=>$entry,
+ 'buttons'=>$buttons
);
$i++;
}
diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php
index 339b98be44a..d5bf12f1061 100644
--- a/htdocs/admin/modulehelp.php
+++ b/htdocs/admin/modulehelp.php
@@ -387,7 +387,7 @@ if ($mode == 'feature')
$filedata = dol_buildpath($moduledir.'/sql/data.sql');
if (dol_is_file($filedata))
{
- $text .= $langs->trans("Yes").' ('.$moduledir.'/sql/data.sql'.')';
+ $text .= $langs->trans("Yes").' ('.$moduledir.'/sql/data.sql)';
}
else $text .= $langs->trans("No");
diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php
index 99643401386..97b09861a42 100644
--- a/htdocs/admin/notification.php
+++ b/htdocs/admin/notification.php
@@ -48,19 +48,19 @@ $action = GETPOST('action', 'aZ09');
if ($action == 'update' || $action == 'add')
{
$constlineid = GETPOST('rowid', 'int');
- $constname=GETPOST('constname', 'alpha');
+ $constname = GETPOST('constname', 'alpha');
- $constvalue=(GETPOSTISSET('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname, 'alpha') : GETPOST('constvalue'));
- $consttype=(GETPOSTISSET('consttype_'.$constname) ? GETPOST('consttype_'.$constname, 'alphanohtml') : GETPOST('consttype'));
- $constnote=(GETPOSTISSET('constnote_'.$constname) ? GETPOST('constnote_'.$constname, 'none') : GETPOST('constnote'));
+ $constvalue = (GETPOSTISSET('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname, 'alpha') : GETPOST('constvalue'));
+ $consttype = (GETPOSTISSET('consttype_'.$constname) ? GETPOST('consttype_'.$constname, 'alphanohtml') : GETPOST('consttype'));
+ $constnote = (GETPOSTISSET('constnote_'.$constname) ? GETPOST('constnote_'.$constname, 'none') : GETPOST('constnote'));
$typetouse = empty($oldtypetonewone[$consttype]) ? $consttype : $oldtypetonewone[$consttype];
- $res=dolibarr_set_const($db, $constname, $constvalue, $typetouse, 0, $constnote, $conf->entity);
+ $res = dolibarr_set_const($db, $constname, $constvalue, $typetouse, 0, $constnote, $conf->entity);
- if (! $res > 0) $error++;
+ if (!$res > 0) $error++;
- if (! $error)
+ if (!$error)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
@@ -183,7 +183,7 @@ $listofnotifiedevents = $notificationtrigger->getListOfManagedEvents();
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
// Editing global variables not related to a specific theme
- $constantes=array();
+ $constantes = array();
foreach ($listofnotifiedevents as $notifiedevent)
{
$label = $langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];
@@ -210,7 +210,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
$constantes[$notifiedevent['code'].'_TEMPLATE'] = array('type'=>'emailtemplate:'.$model, 'label'=>$label);
}
- $helptext='';
+ $helptext = '';
form_constantes($constantes, 0, $helptext);
} else {
print '';
@@ -265,7 +265,7 @@ print ''.$langs->trans("Code").' ';
print ''.$langs->trans("Label").' ';
print ''.$langs->trans("FixedEmailTarget").' ';
print ''.$langs->trans("Threshold").' ';
-print ''.' ';
+print ' ';
print "\n";
foreach ($listofnotifiedevents as $notifiedevent)
diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php
index fcfe25ce3d3..dd77c41a673 100644
--- a/htdocs/admin/system/perf.php
+++ b/htdocs/admin/system/perf.php
@@ -66,7 +66,7 @@ if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled");
else
{
print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("XDebug"));
- print ' - '.$langs->trans("MoreInformation").' XDebug admin page ';
+ print ' - '.$langs->trans("MoreInformation").' XDebug admin page ';
}
print ' ';
@@ -123,7 +123,7 @@ if (!$foundcache && $test)
{
$foundcache++;
print img_picto('', 'tick.png').' '.$langs->trans("PHPModuleLoaded", "XCache");
- print ' '.$langs->trans("MoreInformation").' Xcache admin page ';
+ print ' '.$langs->trans("MoreInformation").' Xcache admin page ';
}
$test = function_exists('eaccelerator_info');
if (!$foundcache && $test)
diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php
index 68bbd03162f..f88563ff512 100644
--- a/htdocs/admin/tools/dolibarr_export.php
+++ b/htdocs/admin/tools/dolibarr_export.php
@@ -303,7 +303,7 @@ if (in_array($type, array('mysql', 'mysqli'))) {
print ' ';
print ''.$langs->trans('ExportStructure').' ';
- print ' ';
+ print ' ';
print ''.$langs->trans("AddDropTable").' ';
print ' ';
print ' ';
diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php
index 02abcf59660..99185cce733 100644
--- a/htdocs/admin/workflow.php
+++ b/htdocs/admin/workflow.php
@@ -85,11 +85,11 @@ $workflowcodes = array(
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array('family'=>'classify_order', 'position'=>41, 'enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order', 'warning'=>''), // For this option, if module invoice is disabled, it does not exists, so "Classify billed" for order must be done manually from order card.
'separator2'=>array('family'=>'separator', 'position'=>50),
// Automatic classification supplier proposal
- 'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array('family'=>'classify_supplier_proposal', 'position'=>60, 'enabled'=>'! empty($conf->supplier_proposal->enabled) && ! empty($conf->fournisseur->enabled)', 'picto'=>'propal', 'warning'=>''),
+ 'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array('family'=>'classify_supplier_proposal', 'position'=>60, 'enabled'=>'! empty($conf->supplier_proposal->enabled) && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))', 'picto'=>'propal', 'warning'=>''),
// Automatic classification supplier order
- 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER'=>array('family'=>'classify_supplier_order', 'position'=>62, 'enabled'=>'! empty($conf->fournisseur->enabled)', 'picto'=>'order', 'warning'=>''),
+ 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER'=>array('family'=>'classify_supplier_order', 'position'=>62, 'enabled'=>'!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)', 'picto'=>'order', 'warning'=>''),
//Automatic classification reception
- 'WORKFLOW_BILL_ON_RECEPTION'=>array('family'=>'classify_reception', 'position'=>64, 'enabled'=>'! empty($conf->reception->enabled) && ! empty($conf->fournisseur->enabled)', 'picto'=>'bill'),
+ 'WORKFLOW_BILL_ON_RECEPTION'=>array('family'=>'classify_reception', 'position'=>64, 'enabled'=>'! empty($conf->reception->enabled) && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))', 'picto'=>'bill'),
);
if (!empty($conf->modules_parts['workflow']) && is_array($conf->modules_parts['workflow']))
diff --git a/htdocs/api/admin/index.php b/htdocs/api/admin/index.php
index 73041f6c386..d0a0e79c855 100644
--- a/htdocs/api/admin/index.php
+++ b/htdocs/api/admin/index.php
@@ -153,7 +153,7 @@ $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domai
// Show message
$message = '';
$url = $urlwithroot.'/api/index.php/login?login=auserlogin &password=thepassword [&reset=1]';
-$message .= $langs->trans("UrlToGetKeyToUseAPIs").': ';
+$message .= ''.$langs->trans("UrlToGetKeyToUseAPIs").': ';
$message .= img_picto('', 'globe').' '.$url;
print $message;
print ' ';
diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php
index 6b106efc450..5e051420748 100644
--- a/htdocs/api/class/api.class.php
+++ b/htdocs/api/class/api.class.php
@@ -137,6 +137,15 @@ class DolibarrApi
unset($object->labelStatus);
unset($object->labelStatusShort);
+ unset($object->stats_propale);
+ unset($object->stats_commande);
+ unset($object->stats_contrat);
+ unset($object->stats_facture);
+ unset($object->stats_commande_fournisseur);
+ unset($object->stats_reception);
+ unset($object->stats_mrptoconsume);
+ unset($object->stats_mrptoproduce);
+
unset($object->element);
unset($object->fk_element);
unset($object->table_element);
diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php
index 1216cd67fe7..ec7a6b89596 100644
--- a/htdocs/api/class/api_setup.class.php
+++ b/htdocs/api/class/api_setup.class.php
@@ -1409,15 +1409,15 @@ class Setup extends DolibarrApi
*
* Note that conf variables that stores security key or password hashes can't be loaded with API.
*
- * @url GET /conf
- *
- * @param string $confname Name of conf variable to get
+ * @param string $constantname Name of conf variable to get
* @return array|mixed Data without useless information
*
+ * @url GET conf/{constantname}
+ *
* @throws RestException 403 Forbidden
- * @throws RestException 500 Error Bad or unknown value for constname
+ * @throws RestException 500 Error Bad or unknown value for constantname
*/
- public function getConf($confname)
+ public function getConf($constantname)
{
global $conf;
@@ -1426,14 +1426,14 @@ class Setup extends DolibarrApi
throw new RestException(403, 'Error API open to admin users only or to the login user defined with constant API_LOGIN_ALLOWED_FOR_ADMIN_CHECK');
}
- if (!preg_match('/^[a-zA-Z0-9_]+$/', $confname) || !isset($conf->global->$confname)) {
- throw new RestException(500, 'Error Bad or unknown value for constname');
+ if (!preg_match('/^[a-zA-Z0-9_]+$/', $constantname) || !isset($conf->global->$constantname)) {
+ throw new RestException(500, 'Error Bad or unknown value for constantname');
}
- if (preg_match('/(_pass|password|secret|_key|key$)/i', $confname)) {
+ if (preg_match('/(_pass|password|secret|_key|key$)/i', $constantname)) {
throw new RestException(403, 'Forbidden');
}
- return $conf->global->$confname;
+ return $conf->global->$constantname;
}
/**
diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php
index ddb2eaed9c4..110d662c9e8 100644
--- a/htdocs/asset/card.php
+++ b/htdocs/asset/card.php
@@ -34,15 +34,18 @@ $langs->loadLangs(array("asset"));
// Get parameters
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
-$action = GETPOST('action', 'alpha');
+$action = GETPOST('action', 'aZ09');
+$confirm = GETPOST('confirm', 'alpha');
$cancel = GETPOST('cancel', 'aZ09');
+$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha');
+$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
// Initialize technical objects
$object = new Asset($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->asset->dir_output.'/temp/massgeneration/'.$user->id;
-$hookmanager->initHooks(array('assetcard')); // Note that conf->hooks_modules contains array
+$hookmanager->initHooks(array('assetcard', 'globalcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
@@ -59,23 +62,20 @@ foreach ($object->fields as $key => $val)
if (empty($action) && empty($id) && empty($ref)) $action = 'view';
-// Security check - Protection if external user
-//if ($user->socid > 0) accessforbidden();
-//if ($user->socid > 0) $socid = $user->socid;
-//$result = restrictedArea($user, 'asset', $id);
-
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
+
+$permissiontoread = $user->rights->asset->read;
+$permissiontoadd = $user->rights->asset->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
+$permissiontodelete = $user->rights->asset->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
$permissionnote = $user->rights->asset->write; // Used by the include of actions_setnotes.inc.php
$permissiondellink = $user->rights->asset->write; // Used by the include of actions_dellink.inc.php
-$permissiontoadd = $user->rights->asset->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
+$upload_dir = $conf->mymodule->multidir_output[isset($object->entity) ? $object->entity : 1];
/*
* Actions
- *
- * Put here all code to do according to value of "action" parameter
*/
$parameters = array();
@@ -86,16 +86,35 @@ if (empty($reshook))
{
$error = 0;
- $permissiontoadd = $user->rights->asset->create;
- $permissiontodelete = $user->rights->asset->delete;
$backurlforlist = dol_buildpath('/asset/list.php', 1);
// Actions cancel, add, update or delete
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
+ // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
+ include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
+
+ // Actions when linking object each other
+ include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
+
// Actions when printing a doc from card
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
+ // Action to move up and down lines of object
+ //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
+
+ // Action to build doc
+ include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
+
+ if ($action == 'set_thirdparty' && $permissiontoadd)
+ {
+ $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, 'MYOBJECT_MODIFY');
+ }
+ if ($action == 'classin' && $permissiontoadd)
+ {
+ $object->setProject(GETPOST('projectid', 'int'));
+ }
+
// Actions to send emails
$triggersendname = 'ASSET_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_ASSET_TO';
@@ -143,11 +162,12 @@ if ($action == 'create')
print '