'.$langs->trans("Description").' ';
if ($action == 'edit') {
print ' ';
- $linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.$project->id;
- $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 'md5');
+ $linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.((int) $project->id);
+ $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.((int) $project->id), 'md5');
$linksuggest .= '&securekey='.urlencode($encodedsecurekey);
//print '';
//print ' ';
@@ -447,8 +450,8 @@ if ($projectid > 0) {
print $langs->trans("PublicAttendeeSubscriptionGlobalPage");
//print '';
print '
';
- $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_register.php?id='.$project->id.'&type=global';
- $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 'md5');
+ $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_register.php?id='.((int) $project->id).'&type=global';
+ $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.((int) $project->id), 'md5');
$link_subscription .= '&securekey='.urlencode($encodedsecurekey);
//print '';
//print '
';
@@ -582,7 +585,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
- header("Location: ".dol_buildpath('/eventorganization/conferenceorbooth_card.php', 1).'?id='.$id);
+ header("Location: ".DOL_URL_ROOT.'/eventorganization/conferenceorbooth_card.php?id='.((int) $id));
exit;
}
diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php
index f10c0b694cb..c5562e39c37 100644
--- a/htdocs/eventorganization/conferenceorboothattendee_card.php
+++ b/htdocs/eventorganization/conferenceorboothattendee_card.php
@@ -48,7 +48,7 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
$conf_or_booth_id = GETPOST('conforboothid', 'int');
$fk_project = GETPOST('fk_project', 'int');
-$withproject = GETPOST('withproject', 'int');
+$withproject = 1;
// Initialize technical objects
$object = new ConferenceOrBoothAttendee($db);
@@ -65,6 +65,7 @@ if ($conf_or_booth_id > 0) {
} else {
$object->fk_actioncomm = $confOrBooth->id;
$object->fk_project = $confOrBooth->fk_project;
+ $fk_project = $object->fk_project;
}
}
@@ -74,12 +75,24 @@ $extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// Initialize array of search criterias
-$search_all = GETPOST("search_all", 'alpha');
+$search_all = GETPOST('search_all', 'alphanohtml');
$search = array();
foreach ($object->fields as $key => $val) {
- if (GETPOST('search_'.$key, 'alpha')) {
+ if (GETPOST('search_'.$key, 'alpha') !== '') {
$search[$key] = GETPOST('search_'.$key, 'alpha');
}
+ if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
+ $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int'));
+ $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int'));
+ }
+}
+
+// List of fields to search into when doing a "search in all"
+$fieldstosearchall = array();
+foreach ($object->fields as $key => $val) {
+ if (!empty($val['searchall'])) {
+ $fieldstosearchall['t.'.$key] = $val['label'];
+ }
}
if (empty($action) && empty($id) && empty($ref)) {
@@ -174,8 +187,6 @@ if (empty($reshook)) {
/*
* View
- *
- * Put here all code to build page
*/
$form = new Form($db);
@@ -194,13 +205,12 @@ if (!empty($projectstatic->socid)) {
$projectstatic->fetch_thirdparty();
}
-$withProjectUrl='';
+
$object->project = clone $projectstatic;
if (!empty($withproject)) {
// Tabs for project
$tab = 'eventorganisation';
- $withProjectUrl = "&withproject=1";
$head = project_prepare_head($projectstatic);
print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', '');
@@ -305,7 +315,7 @@ if (!empty($withproject)) {
print '
';
print '
';
- print '
';
+ print '';
// Description
print ''.$langs->trans("Description").' ';
@@ -319,7 +329,7 @@ if (!empty($withproject)) {
print " ";
}
- print '';
+ print ' ';
$typeofdata = 'checkbox:'.($projectstatic->accept_conference_suggestions ? ' checked="checked"' : '');
$htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp");
print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
@@ -336,15 +346,15 @@ if (!empty($withproject)) {
print " ";
print '';
- print $form->editfieldkey('PriceOfRegistration', 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
+ print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
print ' ';
- print $form->editfieldval('PriceOfRegistration', 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
+ print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
print " ";
print '';
- print $form->editfieldkey('PriceOfBooth', 'price_booth', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
+ print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
print ' ';
- print $form->editfieldval('PriceOfBooth', 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
+ print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
print " ";
print ''.$langs->trans("EventOrganizationICSLink").' ';
@@ -353,7 +363,7 @@ if (!empty($withproject)) {
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
// Show message
- $message = 'entity : "");
+ $message = ' entity : "");
$message .= '&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...');
$message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').img_picto('', 'download', 'class="paddingleft"').' ';
print $message;
@@ -366,7 +376,7 @@ if (!empty($withproject)) {
//print '';
print ' ';
$linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.$projectstatic->id;
- $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 2);
+ $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 'md5');
$linksuggest .= '&securekey='.urlencode($encodedsecurekey);
//print '';
//print ' ';
@@ -383,7 +393,7 @@ if (!empty($withproject)) {
//print '';
print '
';
$link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_register.php?id='.$projectstatic->id.'&type=global';
- $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 2);
+ $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 'md5');
$link_subscription .= '&securekey='.urlencode($encodedsecurekey);
//print '';
//print '
';
@@ -410,8 +420,10 @@ if (!empty($withproject)) {
if ($action == 'create') {
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("ConferenceOrBoothAttendee")), '', 'object_'.$object->picto);
- print '
\n";
} else {
if ($id > 0 || !empty($ref)) {
//
@@ -2654,7 +2662,7 @@ if ($action == 'create') {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($usercancreate) {
if ($action != 'classify') {
- $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
@@ -3413,7 +3421,7 @@ if ($action == 'create') {
|| ($object->type == FactureFournisseur::TYPE_DEPOSIT && empty($discount->id)))
&& ($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED)) { // A paid invoice (partially or completely)
if (!$facidnext && $object->close_code != 'replaced' && $usercancreate) { // Not replaced by another invoice
- print '
'.$langs->trans('ReOpen').' ';
+ print '
'.$langs->trans('ReOpen').' ';
} else {
if ($usercancreate) {
print '
'.$langs->trans('ReOpen').' ';
@@ -3531,7 +3539,7 @@ if ($action == 'create') {
} elseif ($isErasable <= 0) { // Any other cases
print '
'.$langs->trans('Delete').' ';
} else {
- print '
id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').' ';
+ print '
id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').' ';
}
}
print '
';
diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php
index 22892823f05..81d72f7750c 100644
--- a/htdocs/fourn/facture/contact.php
+++ b/htdocs/fourn/facture/contact.php
@@ -142,7 +142,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->facture->creer) {
if ($action != 'classify') {
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php
index d7c11045f03..f6954635db1 100644
--- a/htdocs/fourn/facture/document.php
+++ b/htdocs/fourn/facture/document.php
@@ -118,7 +118,7 @@ if ($object->id > 0) {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->facture->creer) {
if ($action != 'classify') {
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php
index efe91880a56..de8c68bc29c 100644
--- a/htdocs/fourn/facture/info.php
+++ b/htdocs/fourn/facture/info.php
@@ -86,7 +86,7 @@ if (!empty($conf->projet->enabled)) {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->facture->creer) {
if ($action != 'classify') {
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php
index 358b1c59c1b..6a23cdbdd91 100644
--- a/htdocs/fourn/facture/list.php
+++ b/htdocs/fourn/facture/list.php
@@ -119,7 +119,7 @@ $search_btn = GETPOST('button_search', 'alpha');
$search_remove_btn = GETPOST('button_removefilter', 'alpha');
$search_categ_sup = trim(GETPOST("search_categ_sup", 'int'));
-$option = GETPOST('option');
+$option = GETPOST('search_option');
if ($option == 'late') {
$search_status = '1';
}
@@ -803,7 +803,7 @@ if ($resql) {
$param .= '&show_files='.urlencode($show_files);
}
if ($option) {
- $param .= "&option=".urlencode($option);
+ $param .= "&search_option=".urlencode($option);
}
if ($optioncss != '') {
$param .= '&optioncss='.urlencode($optioncss);
@@ -1428,9 +1428,9 @@ if ($resql) {
// Date limit
if (!empty($arrayfields['f.date_lim_reglement']['checked'])) {
- print ' '.dol_print_date($datelimit, 'day');
+ print ' '.dol_print_date($datelimit, 'day');
if ($facturestatic->hasDelay()) {
- print img_warning($langs->trans('Late'));
+ print img_warning($langs->trans('Alert').' - '.$langs->trans('Late'));
}
print ' ';
if (!$i) {
diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php
index c5ea5feac68..5fa555fca9e 100644
--- a/htdocs/fourn/facture/note.php
+++ b/htdocs/fourn/facture/note.php
@@ -115,7 +115,7 @@ if ($object->id > 0) {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) {
if ($action != 'classify') {
- // $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ // $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php
index ae600ec4080..4188fef716e 100644
--- a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php
@@ -71,7 +71,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
echo $objectlink->getLibStatut(3);
}
?>
- id).'&action=dellink&dellinkid='.urlencode($key); ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
+ id).'&action=dellink&token='.newToken().'&dellinkid='.urlencode($key); ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
0) {
if ($user->socid == 0 && $action == '') {
if ($user->rights->fournisseur->facture->supprimer) {
if ($allow_delete) {
- print ''.$langs->trans('Delete').' ';
+ print ''.$langs->trans('Delete').' ';
} else {
print ''.$langs->trans('Delete').' ';
}
diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php
index 8534ad8bac1..96af99d3f06 100644
--- a/htdocs/fourn/paiement/list.php
+++ b/htdocs/fourn/paiement/list.php
@@ -48,6 +48,9 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 've
$socid = GETPOST('socid', 'int');
+// Security check
+if ($user->socid) $socid = $user->socid;
+
$search_ref = GETPOST('search_ref', 'alpha');
$search_date_startday = GETPOST('search_date_startday', 'int');
$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php
index ae920da31a1..65c3521bf20 100644
--- a/htdocs/holiday/card.php
+++ b/htdocs/holiday/card.php
@@ -1549,10 +1549,6 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
$MAXEVENT = 10;
- /*$morehtmlright = '';
- $morehtmlright .= $langs->trans("SeeAll");
- $morehtmlright .= ' ';*/
-
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
diff --git a/htdocs/hrm/establishment/info.php b/htdocs/hrm/establishment/info.php
index 517b76de93a..30dbd932dcb 100644
--- a/htdocs/hrm/establishment/info.php
+++ b/htdocs/hrm/establishment/info.php
@@ -137,7 +137,7 @@ if ($object->id > 0) {
// Object card
// ------------------------------------------------------------
- $linkback = ''.$langs->trans("BackToList").' ';
+ $linkback = ''.$langs->trans("BackToList").' ';
$morehtmlref = '';
/*
@@ -154,7 +154,7 @@ if ($object->id > 0) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql
index 11358781e37..63f20198658 100644
--- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql
+++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql
@@ -403,6 +403,7 @@ CREATE TABLE llx_eventorganization_conferenceorboothattendee(
fk_soc integer,
fk_actioncomm integer,
fk_project integer NOT NULL,
+ fk_invoice integer NULL,
email varchar(100),
date_subscription datetime,
amount double DEFAULT NULL,
@@ -422,6 +423,7 @@ CREATE TABLE llx_eventorganization_conferenceorboothattendee(
-- VPGSQL8.2 ALTER TABLE llx_eventorganization_conferenceorboothattendee ALTER COLUMN fk_actioncomm DROP NOT NULL;
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN fk_project integer NOT NULL;
+ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN fk_invoice integer NULL;
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_rowid (rowid);
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_ref (ref);
diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql
index fb0969dc7ef..f4f6e9e349f 100644
--- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql
+++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql
@@ -57,6 +57,7 @@ INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private,
-- v15
+ALTER TABLE llx_product ADD COLUMN mandatory_period tinyint NULL DEFAULT 0;
ALTER TABLE llx_holiday ADD COLUMN date_approve DATETIME DEFAULT NULL;
ALTER TABLE llx_holiday ADD COLUMN fk_user_approve integer DEFAULT NULL;
diff --git a/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.sql b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.sql
index 6d01cf4bba1..b505f8f6a31 100644
--- a/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.sql
+++ b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.sql
@@ -21,6 +21,7 @@ CREATE TABLE llx_eventorganization_conferenceorboothattendee(
fk_soc integer,
fk_actioncomm integer,
fk_project integer NOT NULL,
+ fk_invoice integer NULL,
email varchar(100),
date_subscription datetime,
amount double DEFAULT NULL,
diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql
index e89a7658e5a..463ed33a86e 100644
--- a/htdocs/install/mysql/tables/llx_product.sql
+++ b/htdocs/install/mysql/tables/llx_product.sql
@@ -103,6 +103,9 @@ create table llx_product
desiredstock float DEFAULT 0,
fk_unit integer DEFAULT NULL,
price_autogen tinyint DEFAULT 0,
+ fk_project integer DEFAULT NULL, -- Used when product was generated by a project or is specifif to a project
+ mandatory_period tinyint DEFAULT 0 -- is used to signal to the user that the start and end dates are mandatory for this type of product the fk_product_type == 1 (service) (non-blocking action)
+
fk_default_bom integer DEFAULT NULL,
fk_project integer DEFAULT NULL -- Used when the product was generated by a project or is specific to a project
)ENGINE=innodb;
diff --git a/htdocs/install/step2.php b/htdocs/install/step2.php
index f95cb218561..1835c87f759 100644
--- a/htdocs/install/step2.php
+++ b/htdocs/install/step2.php
@@ -141,7 +141,7 @@ if ($action == "set") {
$requestnb = 0;
// To disable some code, so you can call step2 with url like
- // http://localhost/dolibarrnew/install/step2.php?action=set&createtables=0&createkeys=0&createfunctions=0&createdata=llx_20_c_departements
+ // http://localhost/dolibarrnew/install/step2.php?action=set&token='.newToken().'&createtables=0&createkeys=0&createfunctions=0&createdata=llx_20_c_departements
$createtables = isset($_GET['createtables']) ?GETPOST('createtables') : 1;
$createkeys = isset($_GET['createkeys']) ?GETPOST('createkeys') : 1;
$createfunctions = isset($_GET['createfunctions']) ?GETPOST('createfunction') : 1;
diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php
index f2cb92efc7f..27d34e2aa51 100644
--- a/htdocs/install/upgrade2.php
+++ b/htdocs/install/upgrade2.php
@@ -144,11 +144,6 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ
$db = getDoliDBInstance($conf->db->type, $conf->db->host, $conf->db->user, $conf->db->pass, $conf->db->name, $conf->db->port);
- // Create the global $hookmanager object
- include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
- $hookmanager = new HookManager($db);
- $hookmanager->initHooks(array('upgrade'));
-
if (!$db->connected) {
print '
'.$langs->trans("ErrorFailedToConnectToDatabase", $conf->db->name).' '.$langs->trans('Error').' ';
dolibarr_install_syslog('upgrade2: failed to connect to database :'.$conf->db->name.' on '.$conf->db->host.' for user '.$conf->db->user, LOG_ERR);
@@ -182,6 +177,11 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ
$conf->global->MAIN_ENABLE_LOG_TO_HTML = 1;
}
+ // Create the global $hookmanager object
+ include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
+ $hookmanager = new HookManager($db);
+ $hookmanager->initHooks(array('upgrade'));
+
/***************************************************************************************
*
diff --git a/htdocs/knowledgemanagement/knowledgerecord_agenda.php b/htdocs/knowledgemanagement/knowledgerecord_agenda.php
index 7853aa7e2ff..2779fca570a 100644
--- a/htdocs/knowledgemanagement/knowledgerecord_agenda.php
+++ b/htdocs/knowledgemanagement/knowledgerecord_agenda.php
@@ -154,7 +154,7 @@ if ($object->id > 0) {
$morehtmlref.='
'.$langs->trans('Project') . ' ';
if ($permissiontoadd) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
}
$morehtmlref.=' : ';
if ($action == 'classify') {
diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php
index 4b35e3be1c3..99aaabe7744 100644
--- a/htdocs/knowledgemanagement/knowledgerecord_card.php
+++ b/htdocs/knowledgemanagement/knowledgerecord_card.php
@@ -105,14 +105,14 @@ if ($reshook < 0) {
if (empty($reshook)) {
$error = 0;
- $backurlforlist = dol_buildpath('/knowledgemanagement/knowledgerecord_list.php', 1);
+ $backurlforlist = DOL_URL_ROOT.'/knowledgemanagement/knowledgerecord_list.php';
if (empty($backtopage) || ($cancel && empty($id))) {
if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
$backtopage = $backurlforlist;
} else {
- $backtopage = dol_buildpath('/knowledgemanagement/knowledgerecord_card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
+ $backtopage = DOL_URL_ROOT.'/knowledgemanagement/knowledgerecord_card.php?id='.($id > 0 ? $id : '__ID__');
}
}
}
@@ -310,7 +310,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Object card
// ------------------------------------------------------------
- $linkback = '
'.$langs->trans("BackToList").' ';
+ $linkback = '
'.$langs->trans("BackToList").' ';
$morehtmlref = '
';
/*
@@ -324,7 +324,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$langs->load("projects");
$morehtmlref .= '
'.$langs->trans('Project') . ' ';
if ($permissiontoadd) {
- //if ($action != 'classify') $morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
+ //if ($action != 'classify') $morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
$morehtmlref .= ' : ';
if ($action == 'classify') {
//$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
@@ -438,7 +438,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
*/
// Delete (need delete permission, or if draft, just need create/modify permission)
- print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete', '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
+ print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
}
print '
'."\n";
}
@@ -475,7 +475,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$MAXEVENT = 10;
- $morehtmlright = '
';
+ $morehtmlright = ' ';
$morehtmlright .= $langs->trans("SeeAll");
$morehtmlright .= ' ';
diff --git a/htdocs/knowledgemanagement/knowledgerecord_contact.php b/htdocs/knowledgemanagement/knowledgerecord_contact.php
index 1eb80efafa1..c338653b840 100644
--- a/htdocs/knowledgemanagement/knowledgerecord_contact.php
+++ b/htdocs/knowledgemanagement/knowledgerecord_contact.php
@@ -139,7 +139,7 @@ if ($object->id) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/knowledgemanagement/knowledgerecord_document.php b/htdocs/knowledgemanagement/knowledgerecord_document.php
index 4a572ee22bb..f3d23fba4bd 100644
--- a/htdocs/knowledgemanagement/knowledgerecord_document.php
+++ b/htdocs/knowledgemanagement/knowledgerecord_document.php
@@ -137,7 +137,7 @@ if ($object->id) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/knowledgemanagement/knowledgerecord_note.php b/htdocs/knowledgemanagement/knowledgerecord_note.php
index 87d9eed9bdb..2e58480adec 100644
--- a/htdocs/knowledgemanagement/knowledgerecord_note.php
+++ b/htdocs/knowledgemanagement/knowledgerecord_note.php
@@ -111,7 +111,7 @@ if ($id > 0 || !empty($ref)) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/langs/am_ET/mrp.lang b/htdocs/langs/am_ET/mrp.lang
index 2414a92cefb..5d226c0f77b 100644
--- a/htdocs/langs/am_ET/mrp.lang
+++ b/htdocs/langs/am_ET/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/ar_IQ/mrp.lang b/htdocs/langs/ar_IQ/mrp.lang
index 2414a92cefb..5d226c0f77b 100644
--- a/htdocs/langs/ar_IQ/mrp.lang
+++ b/htdocs/langs/ar_IQ/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/ar_SA/mrp.lang b/htdocs/langs/ar_SA/mrp.lang
index 97c6e6378bb..fe2c1a87769 100644
--- a/htdocs/langs/ar_SA/mrp.lang
+++ b/htdocs/langs/ar_SA/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=أوامر التصنيع
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/az_AZ/mrp.lang b/htdocs/langs/az_AZ/mrp.lang
index 2414a92cefb..5d226c0f77b 100644
--- a/htdocs/langs/az_AZ/mrp.lang
+++ b/htdocs/langs/az_AZ/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/bg_BG/mrp.lang b/htdocs/langs/bg_BG/mrp.lang
index 0c39bca3291..933315a64d4 100644
--- a/htdocs/langs/bg_BG/mrp.lang
+++ b/htdocs/langs/bg_BG/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Стойност 0,95 означава сре
DeleteBillOfMaterials=Изтриване на списък с материали
DeleteMo=Изтриване на поръчка за производство
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Поръчки за производство
NewMO=Нова поръчка за производство
QtyToProduce=Кол. за производство
diff --git a/htdocs/langs/bn_BD/mrp.lang b/htdocs/langs/bn_BD/mrp.lang
index 2414a92cefb..5d226c0f77b 100644
--- a/htdocs/langs/bn_BD/mrp.lang
+++ b/htdocs/langs/bn_BD/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/bn_IN/mrp.lang b/htdocs/langs/bn_IN/mrp.lang
index 2414a92cefb..5d226c0f77b 100644
--- a/htdocs/langs/bn_IN/mrp.lang
+++ b/htdocs/langs/bn_IN/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/bs_BA/mrp.lang b/htdocs/langs/bs_BA/mrp.lang
index 16ab0c8ac49..999a6ec67b8 100644
--- a/htdocs/langs/bs_BA/mrp.lang
+++ b/htdocs/langs/bs_BA/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/cs_CZ/mrp.lang b/htdocs/langs/cs_CZ/mrp.lang
index 948205b3887..13d519a79b7 100644
--- a/htdocs/langs/cs_CZ/mrp.lang
+++ b/htdocs/langs/cs_CZ/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Hodnota 0,95 znamená průměrně ztrátu vyr
DeleteBillOfMaterials=Odstranit kusovník
DeleteMo=Smazat výrobní zakázku
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Výrobní zakázky
NewMO=Nová výrobní objednávka
QtyToProduce=Množství k výrobě
diff --git a/htdocs/langs/de_DE/mrp.lang b/htdocs/langs/de_DE/mrp.lang
index 0c90379fd43..323bbe74d59 100644
--- a/htdocs/langs/de_DE/mrp.lang
+++ b/htdocs/langs/de_DE/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Ein Wert von 0,95 bedeutet im Durchschnitt 5%
DeleteBillOfMaterials=Stückliste löschen
DeleteMo=Fertigungsauftrag löschen
ConfirmDeleteBillOfMaterials=Möchten Sie diese Stückliste wirklich löschen?
-ConfirmDeleteMo=Möchten Sie diese Stückliste wirklich löschen?
+ConfirmDeleteMo=Möchten Sie diese Fertigungsauftrag wirklich löschen?
MenuMRP=Fertigungsaufträge
NewMO=Neuer Fertigungsauftrag
QtyToProduce=Produktionsmenge
diff --git a/htdocs/langs/el_GR/mrp.lang b/htdocs/langs/el_GR/mrp.lang
index 3d622d1de8b..f70ffcd3117 100644
--- a/htdocs/langs/el_GR/mrp.lang
+++ b/htdocs/langs/el_GR/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Η τιμή 0,95 σημαίνει κατά μ
DeleteBillOfMaterials=Διαγραφή λογαριασμού υλικών
DeleteMo=Διαγραφή Παραγγελίας Παραγωγής
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Παραγγελίες Παραγωγής
NewMO=Νέα Παραγγελία Παραγωγής
QtyToProduce=Ποσότητα για παραγωγή
diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang
index 771f0a83e7b..c20e0a339f6 100644
--- a/htdocs/langs/en_US/accountancy.lang
+++ b/htdocs/langs/en_US/accountancy.lang
@@ -37,8 +37,8 @@ OtherInfo=Other information
DeleteCptCategory=Remove accounting account from group
ConfirmDeleteCptCategory=Are you sure you want to remove this accounting account from the accounting account group?
JournalizationInLedgerStatus=Status of journalization
-AlreadyInGeneralLedger=Already transferred in accounting journals and ledger
-NotYetInGeneralLedger=Not yet transferred in accouting journals and ledger
+AlreadyInGeneralLedger=Already transferred to accounting journals and ledger
+NotYetInGeneralLedger=Not yet transferred to accouting journals and ledger
GroupIsEmptyCheckSetup=Group is empty, check setup of the personalized accounting group
DetailByAccount=Show detail by account
AccountWithNonZeroValues=Accounts with non-zero values
@@ -298,7 +298,7 @@ NoNewRecordSaved=No more record to journalize
ListOfProductsWithoutAccountingAccount=List of products not bound to any accounting account
ChangeBinding=Change the binding
Accounted=Accounted in ledger
-NotYetAccounted=Not yet accounted in the ledger
+NotYetAccounted=Not yet transferred to accounting
ShowTutorial=Show Tutorial
NotReconciled=Not reconciled
WarningRecordWithoutSubledgerAreExcluded=Warning, all operations without subledger account defined are filtered and excluded from this view
@@ -329,8 +329,8 @@ ACCOUNTING_DISABLE_BINDING_ON_PURCHASES=Disable binding & transfer in accountanc
ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS=Disable binding & transfer in accountancy on expense reports (expense reports will not be taken into account in accounting)
## Export
-NotifiedExportDate=Notified export date (modification of the entries will not be possible)
-NotifiedValidationDate=Validation of the entries (modification or deletion of the entries will not be possible)
+NotifiedExportDate=Flag exported lines as exported (modification of the lines will not be possible)
+NotifiedValidationDate=Validate the exported entries (modification or deletion of the lines will not be possible)
ConfirmExportFile=Confirmation of the generation of the accounting export file ?
ExportDraftJournal=Export draft journal
Modelcsv=Model of export
@@ -343,7 +343,7 @@ Modelcsv_ciel=Export for Sage50, Ciel Compta or Compta Evo. (Format XIMPORT)
Modelcsv_quadratus=Export for Quadratus QuadraCompta
Modelcsv_ebp=Export for EBP
Modelcsv_cogilog=Export for Cogilog
-Modelcsv_agiris=Export for Agiris
+Modelcsv_agiris=Export for Agiris Isacompta
Modelcsv_LDCompta=Export for LD Compta (v9) (Test)
Modelcsv_LDCompta10=Export for LD Compta (v10 & higher)
Modelcsv_openconcerto=Export for OpenConcerto (Test)
@@ -351,9 +351,10 @@ Modelcsv_configurable=Export CSV Configurable
Modelcsv_FEC=Export FEC
Modelcsv_FEC2=Export FEC (With dates generation writing / document reversed)
Modelcsv_Sage50_Swiss=Export for Sage 50 Switzerland
-Modelcsv_winfic=Export Winfic - eWinfic - WinSis Compta
+Modelcsv_winfic=Export for Winfic - eWinfic - WinSis Compta
Modelcsv_Gestinumv3=Export for Gestinum (v3)
-Modelcsv_Gestinumv5Export for Gestinum (v5)
+Modelcsv_Gestinumv5=Export for Gestinum (v5)
+Modelcsv_charlemagne=Export for Aplim Charlemagne
ChartofaccountsId=Chart of accounts Id
## Tools - Init accounting account on product / service
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 26edb7f0518..53355dd15ce 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -898,6 +898,11 @@ Permission1002=Create/modify warehouses
Permission1003=Delete warehouses
Permission1004=Read stock movements
Permission1005=Create/modify stock movements
+Permission1011=View inventories
+Permission1012=Create new inventory
+Permission1014=Validate inventory
+Permission1015=Allow to change PMP value for a product
+Permission1016=Delete inventory
Permission1101=Read delivery receipts
Permission1102=Create/modify delivery receipts
Permission1104=Validate delivery receipts
@@ -1626,8 +1631,7 @@ ProductSetup=Products module setup
ServiceSetup=Services module setup
ProductServiceSetup=Products and Services modules setup
NumberOfProductShowInSelect=Maximum number of products to show in combo select lists (0=no limit)
-ViewProductDescInFormAbility=Display product descriptions in forms (otherwise shown in a tooltip popup)
-DoNotAddProductDescAtAddLines=Do not add product description (from product card) on submit add lines on forms
+ViewProductDescInFormAbility=Display product descriptions in lines of items (otherwise show description in a tooltip popup)
OnProductSelectAddProductDesc=How to use the description of the products when adding a product as a line of a document
AutoFillFormFieldBeforeSubmit=Auto fill the description input field with the description of product
DoNotAutofillButAutoConcat=Do not autofill the input field with description of product. Description of the product will be concatenated to the entered description automatically.
diff --git a/htdocs/langs/en_US/ecm.lang b/htdocs/langs/en_US/ecm.lang
index bc18bed4a29..494a6c55164 100644
--- a/htdocs/langs/en_US/ecm.lang
+++ b/htdocs/langs/en_US/ecm.lang
@@ -45,3 +45,5 @@ GenerateImgWebp=Duplicate all images with another version with .webp format
ConfirmGenerateImgWebp=If you confirm, you will generate an image in .webp format for all images currently into this folder (subfolders are not included)...
ConfirmImgWebpCreation=Confirm all images duplication
SucessConvertImgWebp=Images successfully duplicated
+ECMDirName=Dir name
+ECMParentDirectory=Parent directory
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index 79bc0e1c088..efe5e069b60 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -270,6 +270,7 @@ ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Ev
CheckVersionFail=Version check fail
ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it
ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify.
+ErrorIsNotADraft=%s is not a draft
# Warnings
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.
diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang
index 8f941d094c7..5da6be656e5 100644
--- a/htdocs/langs/en_US/eventorganization.lang
+++ b/htdocs/langs/en_US/eventorganization.lang
@@ -19,7 +19,7 @@
#
ModuleEventOrganizationName = Event Organization
EventOrganizationDescription = Event Organization through Module Project
-EventOrganizationDescriptionLong= Manage the organization of an event (conferences, attendees, speakers, with public suggestion, vote or registration pages)
+EventOrganizationDescriptionLong= Manage the organization of an event (show, conferences, attendees or speakers, with public pages for suggestion, vote or registration)
#
# Menu
#
@@ -155,3 +155,7 @@ PaymentConferenceAttendee = Conference attendee payment
PaymentBoothLocation = Booth location payment
RegistrationAndPaymentWereAlreadyRecorder=A registration and a payment were already recorded for the email
%s
+EmailAttendee=Attendee email
+EmailCompanyForInvoice=Company email (for invoice, if different of attendee email)
+ErrorSeveralCompaniesWithEmailContactUs=Several companies with this email has been found so we can't validate automaticaly your registration. Please contact us at %s for a manual validation
+ErrorSeveralCompaniesWithNameContactUs=Several companies with this name has been found so we can't validate automaticaly your registration. Please contact us at %s for a manual validation
\ No newline at end of file
diff --git a/htdocs/langs/en_US/languages.lang b/htdocs/langs/en_US/languages.lang
index e3b6bed94c8..ca962811831 100644
--- a/htdocs/langs/en_US/languages.lang
+++ b/htdocs/langs/en_US/languages.lang
@@ -6,6 +6,7 @@ Language_ar_MA=Arabic (Moroco)
Language_ar_SA=Arabic
Language_ar_TN=Arabic (Tunisia)
Language_ar_IQ=Arabic (Iraq)
+Language_as_IN=Assamese
Language_az_AZ=Azerbaijani
Language_bn_BD=Bengali
Language_bn_IN=Bengali (India)
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 6c3061a192f..b68b62c2a43 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -1155,3 +1155,4 @@ ConfirmMassLeaveApproval=Mass leave approval confirmation
RecordAproved=Record approved
RecordsApproved=%s Record(s) approved
Properties=Properties
+hasBeenValidated=%s has been validated
\ No newline at end of file
diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang
index 8d4cabc2bb8..3f1aac53340 100644
--- a/htdocs/langs/en_US/mrp.lang
+++ b/htdocs/langs/en_US/mrp.lang
@@ -32,7 +32,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/en_US/opensurvey.lang b/htdocs/langs/en_US/opensurvey.lang
index 7d26151fa16..9fafacaf8bf 100644
--- a/htdocs/langs/en_US/opensurvey.lang
+++ b/htdocs/langs/en_US/opensurvey.lang
@@ -48,6 +48,8 @@ AddEndHour=Add end hour
votes=vote(s)
NoCommentYet=No comments have been posted for this poll yet
CanComment=Voters can comment in the poll
+YourVoteIsPrivate=This poll is private, nobody can see your vote.
+YourVoteIsPublic=This poll is public, anybody with the link can see your vote.
CanSeeOthersVote=Voters can see other people's vote
SelectDayDesc=For each selected day, you can choose, or not, meeting hours in the following format:
- empty,
- "8h", "8H" or "8:00" to give a meeting's start hour,
- "8-11", "8h-11h", "8H-11H" or "8:00-11:00" to give a meeting's start and end hour,
- "8h15-11h15", "8H15-11H15" or "8:15-11:15" for the same thing but with minutes.
BackToCurrentMonth=Back to current month
diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang
index ae199f4136b..128eb120e0b 100644
--- a/htdocs/langs/en_US/products.lang
+++ b/htdocs/langs/en_US/products.lang
@@ -75,6 +75,7 @@ SellingPriceTTC=Selling price (inc. tax)
SellingMinPriceTTC=Minimum Selling price (inc. tax)
CostPriceDescription=This price field (excl. tax) can be used to capture the average amount this product costs to your company. It may be any price you calculate yourself, for example, from the average buying price plus average production and distribution cost.
CostPriceUsage=This value could be used for margin calculation.
+ManufacturingPrice=Manufacturing price
SoldAmount=Sold amount
PurchasedAmount=Purchased amount
NewPrice=New price
@@ -397,7 +398,14 @@ ActionAvailableOnVariantProductOnly=Action only available on the variant of prod
ProductsPricePerCustomer=Product prices per customers
ProductSupplierExtraFields=Additional Attributes (Supplier Prices)
DeleteLinkedProduct=Delete the child product linked to the combination
+AmountUsedToUpdateWAP=Amount to use to update the Weighted Average Price
PMPValue=Weighted average price
PMPValueShort=WAP
+
+mandatoryperiod=Mandatory periods
+mandatoryPeriodNeedTobeSet=Attention periods not entered and mandatory
+mandatoryPeriodNeedTobeSetMsgValidate=A service requires a start and end period
+mandatoryHelper=Message to the user on the need to enter a start date and an end date on a service when creating / validating an invoice, commercial proposal, sales order.
This action is not blocking in the process of confirmation
DefaultBOM=Default BOM
-DefaultBOMDesc=The default BOM recommended to use to manufacture this product. This field can be set only if nature of product is '%s'.
\ No newline at end of file
+DefaultBOMDesc=The default BOM recommended to use to manufacture this product. This field can be set only if nature of product is '%s'.
+
diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang
index 6709a1de200..6531a74840d 100644
--- a/htdocs/langs/en_US/projects.lang
+++ b/htdocs/langs/en_US/projects.lang
@@ -282,3 +282,4 @@ UsageOrganizeEvent=Usage: Event Organization
PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE=Classify project as closed when all its tasks are completed (100%% progress)
PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE_help=Note: existing projects with all tasks at 100 %% progress won't be affected: you will have to close them manually. This option only affects open projects.
SelectLinesOfTimeSpentToInvoice=Select lines of time spent that are unbilled, then bulk action "Generate Invoice" to bill them
+ProjectTasksWithoutTimeSpent=Project tasks without time spent
diff --git a/htdocs/langs/et_EE/mrp.lang b/htdocs/langs/et_EE/mrp.lang
index c7146c45dfe..32e99e6e6b7 100644
--- a/htdocs/langs/et_EE/mrp.lang
+++ b/htdocs/langs/et_EE/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/eu_ES/mrp.lang b/htdocs/langs/eu_ES/mrp.lang
index acf5a23db9b..a6e57a1168a 100644
--- a/htdocs/langs/eu_ES/mrp.lang
+++ b/htdocs/langs/eu_ES/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/fa_IR/mrp.lang b/htdocs/langs/fa_IR/mrp.lang
index c00afb9dd3a..d536b6b661c 100644
--- a/htdocs/langs/fa_IR/mrp.lang
+++ b/htdocs/langs/fa_IR/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/fi_FI/mrp.lang b/htdocs/langs/fi_FI/mrp.lang
index 2eafe6926bb..14f2af7e1fe 100644
--- a/htdocs/langs/fi_FI/mrp.lang
+++ b/htdocs/langs/fi_FI/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Valmistustilaukset
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/fr_FR/ecm.lang b/htdocs/langs/fr_FR/ecm.lang
index 605cc97625d..c5867cbc7ed 100644
--- a/htdocs/langs/fr_FR/ecm.lang
+++ b/htdocs/langs/fr_FR/ecm.lang
@@ -45,3 +45,5 @@ GenerateImgWebp=Dupliquer toutes les images avec une autre version au format .we
ConfirmGenerateImgWebp=Si vous confirmez, vous générerez une image au format .webp pour toutes les images actuellement dans ce dossier (les sous-dossiers ne sont pas inclus)...
ConfirmImgWebpCreation=Confirmer la duplication de toutes les images
SucessConvertImgWebp=Images dupliquées avec succès
+ECMDirName=Nom du dossier
+ECMParentDirectory=Dossier parent
diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang
index 013d75d2ec0..83514bd95ff 100644
--- a/htdocs/langs/fr_FR/products.lang
+++ b/htdocs/langs/fr_FR/products.lang
@@ -399,3 +399,7 @@ ProductSupplierExtraFields=Attributs supplémentaires (Prix fournisseur)
DeleteLinkedProduct=Supprimer le produit enfant lié à la combinaison
PMPValue=Prix moyen pondéré (PMP)
PMPValueShort=PMP
+mandatoryperiod=Périodes obligatoires
+mandatoryPeriodNeedTobeSet=Attention périodes non saisies et obligatoires
+mandatoryPeriodNeedTobeSetMsgValidate=Un service nécessite une période de début et de fin
+mandatoryHelper=Message à l'utilisateur sur la necessité de saisir une date de début et une date de fin sur un service lors de la création/validation de facture, proposition commerciale , commande client.
Cette action n'est pas bloquante dans le processus de validation
diff --git a/htdocs/langs/he_IL/mrp.lang b/htdocs/langs/he_IL/mrp.lang
index 2414a92cefb..5d226c0f77b 100644
--- a/htdocs/langs/he_IL/mrp.lang
+++ b/htdocs/langs/he_IL/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/hi_IN/mrp.lang b/htdocs/langs/hi_IN/mrp.lang
index 2414a92cefb..5d226c0f77b 100644
--- a/htdocs/langs/hi_IN/mrp.lang
+++ b/htdocs/langs/hi_IN/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/hr_HR/mrp.lang b/htdocs/langs/hr_HR/mrp.lang
index dd2c40eda6c..00710061f2a 100644
--- a/htdocs/langs/hr_HR/mrp.lang
+++ b/htdocs/langs/hr_HR/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Proizvodni nalozi
NewMO=Novi proizvodni nalog
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/hu_HU/mrp.lang b/htdocs/langs/hu_HU/mrp.lang
index 350817adedb..0623b3a8447 100644
--- a/htdocs/langs/hu_HU/mrp.lang
+++ b/htdocs/langs/hu_HU/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Gyártási rendelések
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/id_ID/mrp.lang b/htdocs/langs/id_ID/mrp.lang
index 76290ed5ea9..6f0d5c87b0a 100644
--- a/htdocs/langs/id_ID/mrp.lang
+++ b/htdocs/langs/id_ID/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Nilai 0,95 berarti rata-rata 5%% dari kehilan
DeleteBillOfMaterials=Hapus Bill Of Material
DeleteMo=Hapus Pesanan Pembuatan
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Pesanan Manufaktur
NewMO=Pesanan Manufaktur Baru
QtyToProduce=Jumlah yang akan diproduksi
diff --git a/htdocs/langs/is_IS/mrp.lang b/htdocs/langs/is_IS/mrp.lang
index 8fe3fd8f4c1..ca52ce21b60 100644
--- a/htdocs/langs/is_IS/mrp.lang
+++ b/htdocs/langs/is_IS/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/it_IT/mrp.lang b/htdocs/langs/it_IT/mrp.lang
index 1e6247f3799..6d54470bf3f 100644
--- a/htdocs/langs/it_IT/mrp.lang
+++ b/htdocs/langs/it_IT/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Il valore di 0,95 indica una media di 5%% di
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Elimina Ordine di Produzione
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Ordini di produzione
NewMO=Nuovo ordine di produzione
QtyToProduce=Qtà da produrre
diff --git a/htdocs/langs/ka_GE/mrp.lang b/htdocs/langs/ka_GE/mrp.lang
index 2414a92cefb..5d226c0f77b 100644
--- a/htdocs/langs/ka_GE/mrp.lang
+++ b/htdocs/langs/ka_GE/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/kk_KZ/mrp.lang b/htdocs/langs/kk_KZ/mrp.lang
index 2414a92cefb..5d226c0f77b 100644
--- a/htdocs/langs/kk_KZ/mrp.lang
+++ b/htdocs/langs/kk_KZ/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/km_KH/mrp.lang b/htdocs/langs/km_KH/mrp.lang
index 2414a92cefb..5d226c0f77b 100644
--- a/htdocs/langs/km_KH/mrp.lang
+++ b/htdocs/langs/km_KH/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/kn_IN/mrp.lang b/htdocs/langs/kn_IN/mrp.lang
index 2414a92cefb..5d226c0f77b 100644
--- a/htdocs/langs/kn_IN/mrp.lang
+++ b/htdocs/langs/kn_IN/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/ko_KR/mrp.lang b/htdocs/langs/ko_KR/mrp.lang
index 131e1f376ac..9ea63ea0c0c 100644
--- a/htdocs/langs/ko_KR/mrp.lang
+++ b/htdocs/langs/ko_KR/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/lo_LA/mrp.lang b/htdocs/langs/lo_LA/mrp.lang
index 00db7f202ec..daffab535ba 100644
--- a/htdocs/langs/lo_LA/mrp.lang
+++ b/htdocs/langs/lo_LA/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/lt_LT/mrp.lang b/htdocs/langs/lt_LT/mrp.lang
index 9760b1babbe..a88ffc2687d 100644
--- a/htdocs/langs/lt_LT/mrp.lang
+++ b/htdocs/langs/lt_LT/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/mk_MK/mrp.lang b/htdocs/langs/mk_MK/mrp.lang
index 2414a92cefb..5d226c0f77b 100644
--- a/htdocs/langs/mk_MK/mrp.lang
+++ b/htdocs/langs/mk_MK/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/mn_MN/mrp.lang b/htdocs/langs/mn_MN/mrp.lang
index 2414a92cefb..5d226c0f77b 100644
--- a/htdocs/langs/mn_MN/mrp.lang
+++ b/htdocs/langs/mn_MN/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/ne_NP/mrp.lang b/htdocs/langs/ne_NP/mrp.lang
index 2414a92cefb..5d226c0f77b 100644
--- a/htdocs/langs/ne_NP/mrp.lang
+++ b/htdocs/langs/ne_NP/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/nl_NL/mrp.lang b/htdocs/langs/nl_NL/mrp.lang
index d94344175c0..143e3cb4d55 100644
--- a/htdocs/langs/nl_NL/mrp.lang
+++ b/htdocs/langs/nl_NL/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Waarde van 0,95 betekent een gemiddelde van 5
DeleteBillOfMaterials=Stuklijst verwijderen
DeleteMo=Productieorder verwijderen
ConfirmDeleteBillOfMaterials=Weet u zeker dat u deze stuklijst wilt verwijderen?
-ConfirmDeleteMo=Weet u zeker dat u deze stuklijst wilt verwijderen?
+ConfirmDeleteMo=Weet u zeker dat u deze Productieorder wilt verwijderen?
MenuMRP=Productieorders
NewMO=Nieuwe productieorder
QtyToProduce=Te produceren aantal
diff --git a/htdocs/langs/pt_PT/mrp.lang b/htdocs/langs/pt_PT/mrp.lang
index 025f164f94e..39982e5bd35 100644
--- a/htdocs/langs/pt_PT/mrp.lang
+++ b/htdocs/langs/pt_PT/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Eliminar Faturas de Materiais
DeleteMo=Eliminar Encomenda de Manufaturação
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Encomendas de Manufatura
NewMO=Nova Encomenda de Manufatura
QtyToProduce=Qt. a produzir
diff --git a/htdocs/langs/sk_SK/mrp.lang b/htdocs/langs/sk_SK/mrp.lang
index d620b7e31e3..9917552ba94 100644
--- a/htdocs/langs/sk_SK/mrp.lang
+++ b/htdocs/langs/sk_SK/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/sl_SI/mrp.lang b/htdocs/langs/sl_SI/mrp.lang
index 30bf0ca0238..b700927dd12 100644
--- a/htdocs/langs/sl_SI/mrp.lang
+++ b/htdocs/langs/sl_SI/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/sq_AL/mrp.lang b/htdocs/langs/sq_AL/mrp.lang
index 29554c164a3..20a6d7238de 100644
--- a/htdocs/langs/sq_AL/mrp.lang
+++ b/htdocs/langs/sq_AL/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/sr_RS/mrp.lang b/htdocs/langs/sr_RS/mrp.lang
index 16ab0c8ac49..999a6ec67b8 100644
--- a/htdocs/langs/sr_RS/mrp.lang
+++ b/htdocs/langs/sr_RS/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/sw_SW/mrp.lang b/htdocs/langs/sw_SW/mrp.lang
index 2414a92cefb..5d226c0f77b 100644
--- a/htdocs/langs/sw_SW/mrp.lang
+++ b/htdocs/langs/sw_SW/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/tg_TJ/mrp.lang b/htdocs/langs/tg_TJ/mrp.lang
index 2414a92cefb..5d226c0f77b 100644
--- a/htdocs/langs/tg_TJ/mrp.lang
+++ b/htdocs/langs/tg_TJ/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/th_TH/mrp.lang b/htdocs/langs/th_TH/mrp.lang
index d5d061b855b..229690f76fd 100644
--- a/htdocs/langs/th_TH/mrp.lang
+++ b/htdocs/langs/th_TH/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/tr_TR/mrp.lang b/htdocs/langs/tr_TR/mrp.lang
index 574ddefd491..b9c69a56364 100644
--- a/htdocs/langs/tr_TR/mrp.lang
+++ b/htdocs/langs/tr_TR/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Üretim Emri Sil
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Üretim Emirleri
NewMO=Yeni Üretim Emiri
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/uk_UA/mrp.lang b/htdocs/langs/uk_UA/mrp.lang
index 2414a92cefb..5d226c0f77b 100644
--- a/htdocs/langs/uk_UA/mrp.lang
+++ b/htdocs/langs/uk_UA/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/vi_VN/mrp.lang b/htdocs/langs/vi_VN/mrp.lang
index f708bed87af..d24ddfe3b48 100644
--- a/htdocs/langs/vi_VN/mrp.lang
+++ b/htdocs/langs/vi_VN/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Xóa hóa đơn vật liệu
DeleteMo=Xóa đơn hàng sản xuất
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Đơn đặt hàng sản xuất
NewMO=Thêm Đơn hàng sản xuất
QtyToProduce=Số lượng để sản xuất
diff --git a/htdocs/langs/zh_CN/mrp.lang b/htdocs/langs/zh_CN/mrp.lang
index 86170bd9d91..e9f0381124a 100644
--- a/htdocs/langs/zh_CN/mrp.lang
+++ b/htdocs/langs/zh_CN/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/langs/zh_HK/mrp.lang b/htdocs/langs/zh_HK/mrp.lang
index 2414a92cefb..5d226c0f77b 100644
--- a/htdocs/langs/zh_HK/mrp.lang
+++ b/htdocs/langs/zh_HK/mrp.lang
@@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials?
-ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials?
+ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order?
MenuMRP=Manufacturing Orders
NewMO=New Manufacturing Order
QtyToProduce=Qty to produce
diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php
index f54da087731..df24e022d90 100644
--- a/htdocs/loan/card.php
+++ b/htdocs/loan/card.php
@@ -429,7 +429,7 @@ if ($id > 0) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->loan->write) {
if ($action != 'classify') {
- $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
@@ -727,12 +727,12 @@ if ($id > 0) {
// Classify 'paid'
if (($object->paid == 0 || $object->paid == 2) && round($staytopay) <= 0 && $user->rights->loan->write) {
- print '
';
+ print '
';
}
// Delete
if (($object->paid == 0 || $object->paid == 2) && $user->rights->loan->delete) {
- print '
';
+ print '
';
}
print "
";
diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php
index 97c0ea56b15..2d6bfef3079 100644
--- a/htdocs/loan/document.php
+++ b/htdocs/loan/document.php
@@ -106,7 +106,7 @@ if ($object->id) {
$morehtmlref .= ' '.$langs->trans('Project').' : ';
if ($user->rights->loan->write) {
//if ($action != 'classify')
- // $morehtmlref .= '' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ // $morehtmlref .= '' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
if ($action == 'classify') {
// $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref .= '';
diff --git a/htdocs/loan/info.php b/htdocs/loan/info.php
index 7ecc41fe4d6..54fd3cd6f97 100644
--- a/htdocs/loan/info.php
+++ b/htdocs/loan/info.php
@@ -72,7 +72,7 @@ if (!empty($conf->projet->enabled)) {
$morehtmlref .= ' '.$langs->trans('Project').' : ';
if ($user->rights->loan->write) {
//if ($action != 'classify')
- // $morehtmlref .= '' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ // $morehtmlref .= '' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
if ($action == 'classify') {
// $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref .= ' ';
diff --git a/htdocs/loan/note.php b/htdocs/loan/note.php
index a17445db6cf..14ffcadc27d 100644
--- a/htdocs/loan/note.php
+++ b/htdocs/loan/note.php
@@ -97,7 +97,7 @@ if ($id > 0) {
$morehtmlref .= ' '.$langs->trans('Project').' : ';
if ($user->rights->loan->write) {
//if ($action != 'classify')
- // $morehtmlref .= '' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ // $morehtmlref .= '' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
if ($action == 'classify') {
// $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref .= ' ';
diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php
index 0292fbf5b2c..198025215b7 100644
--- a/htdocs/loan/payment/card.php
+++ b/htdocs/loan/payment/card.php
@@ -222,7 +222,7 @@ print '';
if (empty($action) && !empty($user->rights->loan->delete)) {
if (!$disable_delete) {
- print '
'.$langs->trans('Delete').' ';
+ print '
'.$langs->trans('Delete').' ';
} else {
print '
'.$langs->trans('Delete').' ';
}
diff --git a/htdocs/loan/schedule.php b/htdocs/loan/schedule.php
index 6dae3383d47..d9b6120691b 100644
--- a/htdocs/loan/schedule.php
+++ b/htdocs/loan/schedule.php
@@ -154,7 +154,7 @@ if (!empty($conf->projet->enabled)) {
$morehtmlref .= '
'.$langs->trans('Project').' : ';
if ($user->rights->loan->write) {
if ($action != 'classify') {
- //$morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ //$morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref .= '
';
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index d3d70a8e6aa..1567df55a56 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -460,33 +460,34 @@ if (!defined('NOTOKENRENEWAL') && !defined('NOSESSION')) {
//dol_syslog("aaaa - ".defined('NOCSRFCHECK')." - ".$dolibarr_nocsrfcheck." - ".$conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN." - ".$_SERVER['REQUEST_METHOD']." - ".GETPOST('token', 'alpha'));
// Check validity of token, only if option MAIN_SECURITY_CSRF_WITH_TOKEN enabled or if constant CSRFCHECK_WITH_TOKEN is set into page
-if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && !empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) || defined('CSRFCHECK_WITH_TOKEN')) {
+if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN')) || defined('CSRFCHECK_WITH_TOKEN')) {
// Array of action code where CSRFCHECK with token will be forced (so token must be provided on url request)
- $arrayofactiontoforcetokencheck = array(
- 'activate', 'add', 'addrights', 'addtimespent',
- 'confirm_create_user', 'confirm_create_thirdparty', 'confirm_delete', 'confirm_deletedir', 'confirm_deletefile', 'confirm_purge', 'confirm_reject_check',
- 'delete', 'deletefilter', 'deleteoperation', 'deleteprof', 'deletepayment', 'delrights',
- 'disable',
- 'doprev', 'donext', 'dvprev', 'dvnext',
- 'enable',
- 'install',
- 'setpricelevel',
- 'update'
- );
$sensitiveget = false;
- if (in_array(GETPOST('action', 'aZ09'), $arrayofactiontoforcetokencheck)) {
+ if ((GETPOSTISSET('massaction') || GETPOST('action', 'aZ09')) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') == 2) {
+ // All GET actions and mass actions are processed as sensitive.
$sensitiveget = true;
+ } else {
+ // Only GET actions coded with a &token into url are processed as sensitive.
+ $arrayofactiontoforcetokencheck = array(
+ 'activate', 'add', 'addrights', 'addtimespent',
+ 'doprev', 'donext', 'dvprev', 'dvnext',
+ 'install',
+ 'reopen'
+ );
+ if (in_array(GETPOST('action', 'aZ09'), $arrayofactiontoforcetokencheck)) {
+ $sensitiveget = true;
+ }
+ if (preg_match('/^(classify|close|confirm|del|disable|enable|remove|set|unset|update)/', GETPOST('action', 'aZ09'))) {
+ $sensitiveget = true;
+ }
}
- if (preg_match('/^(disable_|enable_|setremise)/', GETPOST('action', 'aZ09'))) {
- $sensitiveget = true;
- }
-
// Check a token is provided for all cases that need a mandatory token
// (all POST actions + all login, actions and mass actions on pages with CSRFCHECK_WITH_TOKEN set + all sensitive GET actions)
if (
$_SERVER['REQUEST_METHOD'] == 'POST' ||
$sensitiveget ||
- ((GETPOSTISSET('actionlogin') || GETPOSTISSET('action') || GETPOSTISSET('massaction')) && defined('CSRFCHECK_WITH_TOKEN'))
+ GETPOSTISSET('massaction') ||
+ ((GETPOSTISSET('actionlogin') || GETPOSTISSET('action')) && defined('CSRFCHECK_WITH_TOKEN'))
) {
// If token is not provided or empty, error (we are in case it is mandatory)
if (!GETPOST('token', 'alpha') || GETPOST('token', 'alpha') == 'notrequired') {
@@ -1039,6 +1040,28 @@ if (!defined('NOLOGIN')) {
$user->rights->user->user->supprimer = 1;
$user->rights->user->self->creer = 1;
$user->rights->user->self->password = 1;
+
+ //Required if advanced permissions are used with MAIN_USE_ADVANCED_PERMS
+ if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
+ if (empty($user->rights->user->user_advance)) {
+ $user->rights->user->user_advance = new stdClass(); // To avoid warnings
+ }
+ if (empty($user->rights->user->self_advance)) {
+ $user->rights->user->self_advance = new stdClass(); // To avoid warnings
+ }
+ if (empty($user->rights->user->group_advance)) {
+ $user->rights->user->group_advance = new stdClass(); // To avoid warnings
+ }
+
+ $user->rights->user->user_advance->readperms = 1;
+ $user->rights->user->user_advance->write = 1;
+ $user->rights->user->self_advance->readperms = 1;
+ $user->rights->user->self_advance->writeperms = 1;
+ $user->rights->user->group_advance->read = 1;
+ $user->rights->user->group_advance->readperms = 1;
+ $user->rights->user->group_advance->write = 1;
+ $user->rights->user->group_advance->delete = 1;
+ }
}
/*
diff --git a/htdocs/margin/admin/margin.php b/htdocs/margin/admin/margin.php
index 939b084fe41..30c85197337 100644
--- a/htdocs/margin/admin/margin.php
+++ b/htdocs/margin/admin/margin.php
@@ -155,9 +155,9 @@ if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff('DISPLAY_MARGIN_RATES');
} else {
if (empty($conf->global->DISPLAY_MARGIN_RATES)) {
- print ''.img_picto($langs->trans("Disabled"), 'off').' ';
+ print ''.img_picto($langs->trans("Disabled"), 'off').' ';
} else {
- print ''.img_picto($langs->trans("Enabled"), 'on').' ';
+ print ''.img_picto($langs->trans("Enabled"), 'on').' ';
}
}
print '';
@@ -172,9 +172,9 @@ if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff('DISPLAY_MARK_RATES');
} else {
if (empty($conf->global->DISPLAY_MARK_RATES)) {
- print ''.img_picto($langs->trans("Disabled"), 'off').' ';
+ print ''.img_picto($langs->trans("Disabled"), 'off').' ';
} else {
- print ''.img_picto($langs->trans("Enabled"), 'on').' ';
+ print ''.img_picto($langs->trans("Enabled"), 'on').' ';
}
}
print '';
@@ -189,9 +189,9 @@ if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff('ForceBuyingPriceIfNull');
} else {
if (empty($conf->global->ForceBuyingPriceIfNull)) {
- print ''.img_picto($langs->trans("Disabled"), 'off').' ';
+ print ''.img_picto($langs->trans("Disabled"), 'off').' ';
} else {
- print ''.img_picto($langs->trans("Enabled"), 'on').' ';
+ print ''.img_picto($langs->trans("Enabled"), 'on').' ';
}
}
print '';
diff --git a/htdocs/margin/index.php b/htdocs/margin/index.php
index cab6dd9f0da..0dcab7435f7 100644
--- a/htdocs/margin/index.php
+++ b/htdocs/margin/index.php
@@ -32,4 +32,4 @@ if ($user->rights->produit->lire) {
$page = 'agentMargins';
}
-header('Location: '.dol_buildpath('/margin/'.$page.'.php', 1));
+header('Location: '.DOL_URL_ROOT.'/margin/'.$page.'.php');
diff --git a/htdocs/modulebuilder/admin/setup.php b/htdocs/modulebuilder/admin/setup.php
index 5aaae9f93eb..e5ccb0c3966 100644
--- a/htdocs/modulebuilder/admin/setup.php
+++ b/htdocs/modulebuilder/admin/setup.php
@@ -125,9 +125,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
print ajax_constantonoff('MODULEBUILDER_USE_ABOUT');
} else {
if (empty($conf->global->MODULEBUILDER_USE_ABOUT)) {
- print ''.img_picto($langs->trans("Disabled"), 'off').' ';
+ print ''.img_picto($langs->trans("Disabled"), 'off').' ';
} else {
- print ''.img_picto($langs->trans("Enabled"), 'on').' ';
+ print ''.img_picto($langs->trans("Enabled"), 'on').' ';
}
}
print '';
diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php
index 9007eab60cc..d0d4a404dcf 100644
--- a/htdocs/modulebuilder/template/admin/setup.php
+++ b/htdocs/modulebuilder/template/admin/setup.php
@@ -598,13 +598,13 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
// Active
if (in_array($name, $def)) {
print ''."\n";
- print '';
+ print ' ';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
print ' ';
} else {
print ''."\n";
- print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
@@ -614,9 +614,9 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($conf->global->$constforvar == $name) {
//print img_picto($langs->trans("Default"), 'on');
// Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset
- print 'scandir.'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').' ';
+ print 'scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').' ';
} else {
- print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php
index e5babacef17..e7db2a1275a 100644
--- a/htdocs/modulebuilder/template/class/myobject.class.php
+++ b/htdocs/modulebuilder/template/class/myobject.class.php
@@ -847,6 +847,17 @@ class MyObject extends CommonObject
return $result;
}
+ /**
+ * Return the label of the status
+ *
+ * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
+ * @return string Label of status
+ */
+ public function getLabelStatus($mode = 0)
+ {
+ return $this->LibStatut($this->status, $mode);
+ }
+
/**
* Return the label of the status
*
diff --git a/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php b/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php
index 67aac8c0e98..3c6442bd454 100644
--- a/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php
+++ b/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php
@@ -50,7 +50,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
date, 'day'); ?>
getLibStatut(7); ?>
- id.'&action=dellink&dellinkid='.$key; ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
+ id.'&action=dellink&token='.newToken().'&dellinkid='.$key; ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
id > 0) {
$morehtmlref.=' '.$langs->trans('Project') . ' ';
if ($permissiontoadd) {
if ($action != 'classify') {
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
}
$morehtmlref.=' : ';
if ($action == 'classify') {
diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php
index 87a28615806..f790f433e8c 100644
--- a/htdocs/modulebuilder/template/myobject_card.php
+++ b/htdocs/modulebuilder/template/myobject_card.php
@@ -368,7 +368,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project') . ' ';
if ($permissiontoadd) {
- //if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
+ //if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
$morehtmlref .= ' : ';
if ($action == 'classify') {
//$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/modulebuilder/template/myobject_contact.php b/htdocs/modulebuilder/template/myobject_contact.php
index 171ef3aab1d..d2de342c861 100644
--- a/htdocs/modulebuilder/template/myobject_contact.php
+++ b/htdocs/modulebuilder/template/myobject_contact.php
@@ -171,7 +171,7 @@ if ($object->id) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php
index 2db325b8b41..5e8d09db179 100644
--- a/htdocs/modulebuilder/template/myobject_document.php
+++ b/htdocs/modulebuilder/template/myobject_document.php
@@ -188,7 +188,7 @@ if ($object->id) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php
index 11a55126884..99946ff54ce 100644
--- a/htdocs/modulebuilder/template/myobject_list.php
+++ b/htdocs/modulebuilder/template/myobject_list.php
@@ -135,7 +135,7 @@ if (!$sortorder) {
}
// Initialize array of search criterias
-$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml');
+$search_all = GETPOST('search_all', 'alphanohtml');
$search = array();
foreach ($object->fields as $key => $val) {
if (GETPOST('search_'.$key, 'alpha') !== '') {
@@ -432,9 +432,11 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
foreach ($search as $key => $val) {
if (is_array($search[$key]) && count($search[$key])) {
foreach ($search[$key] as $skey) {
- $param .= '&search_'.$key.'[]='.urlencode($skey);
+ if ($skey != '') {
+ $param .= '&search_'.$key.'[]='.urlencode($skey);
+ }
}
- } else {
+ } elseif ($search[$key] != '') {
$param .= '&search_'.$key.'='.urlencode($search[$key]);
}
}
diff --git a/htdocs/modulebuilder/template/myobject_note.php b/htdocs/modulebuilder/template/myobject_note.php
index 7f324fbd456..d1c4e4c8837 100644
--- a/htdocs/modulebuilder/template/myobject_note.php
+++ b/htdocs/modulebuilder/template/myobject_note.php
@@ -162,7 +162,7 @@ if ($id > 0 || !empty($ref)) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php
index 8c48228f2be..a7ed52687df 100644
--- a/htdocs/mrp/class/mo.class.php
+++ b/htdocs/mrp/class/mo.class.php
@@ -1027,9 +1027,9 @@ class Mo extends CommonObject
$label .= ''.$langs->trans('Label').': '.$this->label;
}
- $url = dol_buildpath('/mrp/mo_card.php', 1).'?id='.$this->id;
+ $url = DOL_URL_ROOT.'/mrp/mo_card.php?id='.$this->id;
if ($option == 'production') {
- $url = dol_buildpath('/mrp/mo_production.php', 1).'?id='.$this->id;
+ $url = DOL_URL_ROOT.'/mrp/mo_production.php?id='.$this->id;
}
if ($option != 'nolink') {
diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php
index bbd2724fb1c..95dab4e62ab 100644
--- a/htdocs/mrp/mo_agenda.php
+++ b/htdocs/mrp/mo_agenda.php
@@ -158,7 +158,7 @@ if ($object->id > 0) {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($permissiontoadd) {
if ($action != 'classify') {
- $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php
index c8383301799..51f35bbc33d 100644
--- a/htdocs/mrp/mo_card.php
+++ b/htdocs/mrp/mo_card.php
@@ -452,7 +452,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($permissiontoadd) {
if ($action != 'classify') {
- $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 1);
@@ -699,7 +699,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
- $somethingshown = $formactions->showactions($object, 'mo', $socid, 1, '', $MAXEVENT, '', $morehtmlright);
+ $somethingshown = $formactions->showactions($object, $object->element, $socid, 1, '', $MAXEVENT, '', $morehtmlright);
print ' ';
}
diff --git a/htdocs/mrp/mo_document.php b/htdocs/mrp/mo_document.php
index 211fa897c09..7e297206b3d 100644
--- a/htdocs/mrp/mo_document.php
+++ b/htdocs/mrp/mo_document.php
@@ -134,7 +134,7 @@ if ($object->id) {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($permissiontoadd) {
if ($action != 'classify') {
- $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php
index 5b4215f91db..10470c17f6d 100644
--- a/htdocs/mrp/mo_list.php
+++ b/htdocs/mrp/mo_list.php
@@ -84,7 +84,7 @@ if (!$sortorder) {
}
// Initialize array of search criterias
-$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml');
+$search_all = GETPOST('search_all', 'alphanohtml');
$search = array();
foreach ($object->fields as $key => $val) {
if (GETPOST('search_'.$key, 'alpha') !== '') {
@@ -270,8 +270,7 @@ $sql .= $hookmanager->resPrint;
/* If a group by is required
$sql.= " GROUP BY ";
-foreach($object->fields as $key => $val)
-{
+foreach($object->fields as $key => $val) {
$sql .= "t.".$key.", ";
}
// Add fields from extrafields
@@ -343,9 +342,11 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
foreach ($search as $key => $val) {
if (is_array($search[$key]) && count($search[$key])) {
foreach ($search[$key] as $skey) {
- $param .= '&search_'.$key.'[]='.urlencode($skey);
+ if ($skey != '') {
+ $param .= '&search_'.$key.'[]='.urlencode($skey);
+ }
}
- } else {
+ } elseif ($search[$key] != '') {
$param .= '&search_'.$key.'='.urlencode($search[$key]);
}
}
diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php
index bab57db22ea..3b1ac109e5d 100644
--- a/htdocs/mrp/mo_movements.php
+++ b/htdocs/mrp/mo_movements.php
@@ -328,7 +328,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($permissiontoadd) {
if ($action != 'classify') {
- $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/mrp/mo_note.php b/htdocs/mrp/mo_note.php
index fd1e2d8cbfa..12b9ade3f2a 100644
--- a/htdocs/mrp/mo_note.php
+++ b/htdocs/mrp/mo_note.php
@@ -112,7 +112,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($permissiontoadd) {
if ($action != 'classify') {
- $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php
index 929e82824d6..84dab109b91 100644
--- a/htdocs/mrp/mo_production.php
+++ b/htdocs/mrp/mo_production.php
@@ -38,7 +38,7 @@ dol_include_once('/bom/class/bom.class.php');
dol_include_once('/mrp/lib/mrp_mo.lib.php');
// Load translation files required by the page
-$langs->loadLangs(array("mrp", "stocks", "other", "productbatch"));
+$langs->loadLangs(array("mrp", "stocks", "other", "product", "productbatch"));
// Get parameters
$id = GETPOST('id', 'int');
@@ -520,7 +520,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($permissiontoadd) {
if ($action != 'classify') {
- $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_soc, $object->fk_project, 'projectid', 0, 0, 1, 1);
@@ -691,6 +691,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$bom = new Bom($db);
$res = $bom->fetch($object->fk_bom);
if ($res > 0) {
+ $bom->calculateCosts();
$bomcost = $bom->unit_cost;
}
}
@@ -818,6 +819,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
}
+ $bomcost = price2num($bomcost, 'MU');
+
$arrayoflines = $object->fetchLinesLinked('consumed', $line->id);
$alreadyconsumed = 0;
foreach ($arrayoflines as $line2) {
@@ -1006,9 +1009,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print ''.$langs->trans("Qty").' ';
if ($permissiontoupdatecost) {
if (empty($bomcost)) {
- print ''.$langs->trans("PMPValue").' ';
+ print ''.$form->textwithpicto($langs->trans("UnitCost"), $langs->trans("AmountUsedToUpdateWAP")).' ';
} else {
- print ''.$langs->trans("UnitCost").' ';
+ print ''.$form->textwithpicto($langs->trans("ManufacturingPrice"), $langs->trans("AmountUsedToUpdateWAP")).' ';
}
}
print ''.$langs->trans("QtyAlreadyProduced").' ';
@@ -1073,10 +1076,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$tmpproduct = new Product($db);
$tmpproduct->fetch($line->fk_product);
- if (empty($bomcost)) {
- $bomcost = $tmpproduct->pmp;
- }
-
$arrayoflines = $object->fetchLinesLinked('produced', $line->id);
$alreadyproduced = 0;
foreach ($arrayoflines as $line2) {
@@ -1095,8 +1094,19 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '';
print ''.$line->qty.' ';
if ($permissiontoupdatecost) {
+ // Defined $manufacturingcost
+ $manufacturingcost = $bomcost;
+ if (empty($manufacturingcost)) {
+ $manufacturingcost = price2num($tmpproduct->cost_price, 'MU');
+ }
+ if (empty($manufacturingcost)) {
+ $manufacturingcost = price2num($tmpproduct->pmp, 'MU');
+ }
+
print '';
- print price($bomcost);
+ if ($manufacturingcost) {
+ print price($manufacturingcost);
+ }
print ' ';
}
print '';
@@ -1188,11 +1198,20 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
print ' ';
if ($permissiontoupdatecost) {
+ // Defined $manufacturingcost
+ $manufacturingcost = $bomcost;
+ if (empty($manufacturingcost)) {
+ $manufacturingcost = price2num($tmpproduct->cost_price, 'MU');
+ }
+ if (empty($manufacturingcost)) {
+ $manufacturingcost = price2num($tmpproduct->pmp, 'MU');
+ }
+
if ($tmpproduct->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
- $preselected = (GETPOSTISSET('pricetoproduce-'.$line->id.'-'.$i) ? GETPOST('pricetoproduce-'.$line->id.'-'.$i) : price($bomcost));
+ $preselected = (GETPOSTISSET('pricetoproduce-'.$line->id.'-'.$i) ? GETPOST('pricetoproduce-'.$line->id.'-'.$i) : price($manufacturingcost));
print ' ';
} else {
- print ' ';
+ print ' ';
}
}
print ' ';
diff --git a/htdocs/mrp/tpl/linkedobjectblock.tpl.php b/htdocs/mrp/tpl/linkedobjectblock.tpl.php
index 4f26d4c36dd..ac3a6bafc07 100644
--- a/htdocs/mrp/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/mrp/tpl/linkedobjectblock.tpl.php
@@ -73,7 +73,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
echo '';
// For now, shipments must stay linked to order, so link is not deletable
if ($object->element != 'shipping') {
- echo 'id.'&action=dellink&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').' ';
+ echo 'id.'&action=dellink&token='.newToken().'&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').' ';
}
echo ' ';
echo "\n";
diff --git a/htdocs/multicurrency/multicurrency_rate.php b/htdocs/multicurrency/multicurrency_rate.php
index 35b7544ccbc..d0be7666a95 100644
--- a/htdocs/multicurrency/multicurrency_rate.php
+++ b/htdocs/multicurrency/multicurrency_rate.php
@@ -526,8 +526,8 @@ if ($resql) {
if (in_array($obj->rowid, $arrayofselected)) {
$selected = 1;
}
- print 'rowid.'">'.img_picto('edit', 'edit').' ';
- print 'rowid.'">'.img_picto('delete', 'delete').' ';
+ print 'rowid.'">'.img_picto('edit', 'edit').' ';
+ print 'rowid.'">'.img_picto('delete', 'delete').' ';
print ' ';
}
print '';
diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php
index db3f54901b9..c32b49ff1a1 100644
--- a/htdocs/opensurvey/card.php
+++ b/htdocs/opensurvey/card.php
@@ -156,14 +156,16 @@ if (empty($reshook)) {
}
// Delete comment
- $idcomment = GETPOST('deletecomment', 'int');
- if ($idcomment) {
- // Security check
- if (!$user->rights->opensurvey->write) {
- accessforbidden();
- }
+ if ($action == 'deletecomment') {
+ $idcomment = GETPOST('idcomment', 'int');
+ if ($idcomment > 0) {
+ // Security check
+ if (!$user->rights->opensurvey->write) {
+ accessforbidden();
+ }
- $resql = $object->deleteComment($idcomment);
+ $resql = $object->deleteComment($idcomment);
+ }
}
if ($action == 'edit') {
@@ -220,20 +222,21 @@ dol_banner_tab($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage', $morehtm
print '';
-print '
';
+print '
';
+print '
';
print '
';
// Type
$type = ($object->format == "A") ? 'classic' : 'date';
-print ''.$langs->trans("Type").' ';
+print ' '.$langs->trans("Type").' ';
print img_picto('', dol_buildpath('/opensurvey/img/'.($type == 'classic' ? 'chart-32.png' : 'calendar-32.png'), 1), 'width="16"', 1);
print ' '.$langs->trans($type == 'classic' ? "TypeClassic" : "TypeDate").' ';
// Title
print '';
$adresseadmin = $object->mail_admin;
-print $langs->trans("Title").' ';
+print $langs->trans("Title").' ';
if ($action == 'edit') {
print ' ';
} else {
@@ -242,7 +245,7 @@ if ($action == 'edit') {
print ' ';
// Description
-print ''.$langs->trans("Description").' ';
+print ' '.$langs->trans("Description").' ';
if ($action == 'edit') {
$doleditor = new DolEditor('nouveauxcommentaires', $object->description, '', 120, 'dolibarr_notes', 'In', 1, 1, 1, ROWS_7, '90%');
$doleditor->Create(0, '');
@@ -254,17 +257,17 @@ print ' ';
// EMail
//If linked user, then emails are going to be sent to users' email
if (!$object->fk_user_creat) {
- print ''.$langs->trans("EMail").' ';
+ print ' '.$langs->trans("EMail").' ';
if ($action == 'edit') {
print ' ';
} else {
- print dol_print_email($object->mail_admin, 0, 0, 1);
+ print dol_print_email($object->mail_admin, 0, 0, 1, 0, 1, 1);
}
print ' ';
}
// Receive an email with each vote
-print ''.$langs->trans('ToReceiveEMailForEachVote').' ';
+print ' '.$langs->trans('ToReceiveEMailForEachVote').' ';
if ($action == 'edit') {
print ' mailsonde ? 'checked="checked"' : '').'">';
} else {
@@ -280,7 +283,7 @@ if ($action == 'edit') {
print ' ';
// Users can comment
-print ''.$langs->trans('CanComment').' ';
+print ' '.$langs->trans('CanComment').' ';
if ($action == 'edit') {
print ' allow_comments ? 'checked="checked"' : '').'">';
} else {
@@ -289,7 +292,7 @@ if ($action == 'edit') {
print ' ';
// Users can see others vote
-print ''.$langs->trans('CanSeeOthersVote').' ';
+print ' '.$langs->trans('CanSeeOthersVote').' ';
if ($action == 'edit') {
print ' allow_spy ? 'checked="checked"' : '').'">';
} else {
@@ -297,8 +300,16 @@ if ($action == 'edit') {
}
print ' ';
+print '
';
+
+print '
';
+print '
';
+print '
';
+
+print '
';
+
// Expire date
-print ''.$langs->trans('ExpireDate').' ';
+print ' '.$langs->trans('ExpireDate').' ';
if ($action == 'edit') {
print $form->selectDate($expiredate ? $expiredate : $object->date_fin, 'expire', 0, 0, 0, '', 1, 0);
} else {
@@ -311,7 +322,7 @@ print ' ';
// Author
print '';
-print $langs->trans("Author").' ';
+print $langs->trans("Author").' ';
if ($object->fk_user_creat) {
print $userstatic->getLoginUrl(1);
} else {
@@ -320,7 +331,7 @@ if ($object->fk_user_creat) {
print ' ';
// Link
-print ''.img_picto('', 'globe').' '.$langs->trans("UrlForSurvey", '').' ';
+print ' '.img_picto('', 'globe').' '.$langs->trans("UrlForSurvey", '').' ';
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
@@ -336,8 +347,10 @@ if ($action != 'edit') {
print ' ';
print '
';
+print '
';
print '
';
+print '
';
print dol_get_fiche_end();
@@ -356,32 +369,35 @@ print '';
if ($action == 'delete') {
- print $form->formconfirm($_SERVER["PHP_SELF"].'?&id='.$numsondage, $langs->trans("RemovePoll"), $langs->trans("ConfirmRemovalOfPoll", $id), 'delete_confirm', '', '', 1);
+ print $form->formconfirm($_SERVER["PHP_SELF"].'?&id='.urlencode($numsondage), $langs->trans("RemovePoll"), $langs->trans("ConfirmRemovalOfPoll", $id), 'delete_confirm', '', '', 1);
}
-print ' '."\n";
+print ' '."\n";
print ' ';
+print ' ';
+print ' ';
+print ' ';
print load_fiche_titre($langs->trans("CommentsOfVoters"), '', '');
@@ -391,7 +407,7 @@ $comments = $object->getComments();
if ($comments) {
foreach ($comments as $comment) {
if ($user->rights->opensurvey->write) {
- print ' '.img_picto('', 'delete.png', '', false, 0, 0, '', '', 0).' ';
+ print ' '.img_picto('', 'delete.png', '', false, 0, 0, '', '', 0).' ';
}
print dol_htmlentities($comment->usercomment).': '.dol_nl2br(dol_htmlentities($comment->comment))." ";
@@ -407,10 +423,7 @@ if ($object->allow_comments) {
print $langs->trans("AddACommentForPoll").' ';
print ' '."\n";
print $langs->trans("Name").': '."\n";
- print ' '."\n";
- if (isset($erreur_commentaire_vide) && $erreur_commentaire_vide == "yes") {
- print "".$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name"))." ";
- }
+ print ' '."\n";
}
print ' ';
diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php
index ff5198c006a..d03cbca69c5 100644
--- a/htdocs/opensurvey/results.php
+++ b/htdocs/opensurvey/results.php
@@ -455,20 +455,21 @@ dol_banner_tab($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage', $morehtm
print '';
-print '
';
+print '
';
+print '
';
print '
';
// Type
$type = ($object->format == "A") ? 'classic' : 'date';
-print ''.$langs->trans("Type").' ';
+print ' '.$langs->trans("Type").' ';
print img_picto('', dol_buildpath('/opensurvey/img/'.($type == 'classic' ? 'chart-32.png' : 'calendar-32.png'), 1), 'width="16"', 1);
print ' '.$langs->trans($type == 'classic' ? "TypeClassic" : "TypeDate").' ';
// Title
print '';
$adresseadmin = $object->mail_admin;
-print $langs->trans("Title").' ';
+print $langs->trans("Title").' ';
if ($action == 'edit') {
print ' ';
} else {
@@ -476,8 +477,39 @@ if ($action == 'edit') {
}
print ' ';
+// Description
+print ''.$langs->trans("Description").' ';
+if ($action == 'edit') {
+ $doleditor = new DolEditor('nouveauxcommentaires', $object->description, '', 120, 'dolibarr_notes', 'In', 1, 1, 1, ROWS_7, '90%');
+ $doleditor->Create(0, '');
+} else {
+ print (dol_textishtml($object->description) ? $object->description : dol_nl2br($object->description, 1, true));
+}
+print ' ';
+
+// EMail
+//If linked user, then emails are going to be sent to users' email
+if (!$object->fk_user_creat) {
+ print ''.$langs->trans("EMail").' ';
+ if ($action == 'edit') {
+ print ' ';
+ } else {
+ print dol_print_email($object->mail_admin, 0, 0, 1, 0, 1, 1);
+ }
+ print ' ';
+}
+
+print '
';
+
+print '
';
+print '
';
+print '
';
+
+print '
';
+
+
// Expire date
-print ''.$langs->trans('ExpireDate').' ';
+print ' '.$langs->trans('ExpireDate').' ';
if ($action == 'edit') {
print $form->selectDate($expiredate ? $expiredate : $object->date_fin, 'expire', 0, 0, 0, '', 1, 0);
} else {
@@ -490,7 +522,7 @@ print ' ';
// Author
print '';
-print $langs->trans("Author").' ';
+print $langs->trans("Author").' ';
if ($object->fk_user_creat) {
print $userstatic->getLoginUrl(1);
} else {
@@ -499,7 +531,7 @@ if ($object->fk_user_creat) {
print ' ';
// Link
-print ''.img_picto('', 'globe').' '.$langs->trans("UrlForSurvey", '').' ';
+print ' '.img_picto('', 'globe').' '.$langs->trans("UrlForSurvey", '').' ';
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
@@ -521,8 +553,10 @@ if ($action != 'edit') {
print ' ';
print '
';
+print '
';
print '
';
+print '
';
print dol_get_fiche_end();
diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php
index 6458c9ab71c..f40b771b34d 100644
--- a/htdocs/partnership/class/partnership.class.php
+++ b/htdocs/partnership/class/partnership.class.php
@@ -121,6 +121,7 @@ class Partnership extends CommonObject
'count_last_url_check_error' => array('type'=>'integer', 'label'=>'CountLastUrlCheckError', 'enabled'=>'1', 'position'=>63, 'notnull'=>0, 'visible'=>-2, 'default'=>'0',),
'last_check_backlink' => array('type'=>'datetime', 'label'=>'LastCheckBacklink', 'enabled'=>'1', 'position'=>65, 'notnull'=>0, 'visible'=>-2,),
'reason_decline_or_cancel' => array('type'=>'text', 'label'=>'ReasonDeclineOrCancel', 'enabled'=>'1', 'position'=>64, 'notnull'=>0, 'visible'=>-2,),
+ // fk_member and fk_soc are added into constructor
);
/**
@@ -197,9 +198,9 @@ class Partnership extends CommonObject
$this->db = $db;
if (!empty($conf->global->PARTNERSHIP_IS_MANAGED_FOR) && $conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') {
- $this->fields['fk_member'] = array('type'=>'integer:Adherent:adherents/class/adherent.class.php:1', 'label'=>'Member', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'member');
+ $this->fields['fk_member'] = array('type'=>'integer:Adherent:adherents/class/adherent.class.php:1', 'label'=>'Member', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'member', 'csslist'=>'tdoverflowmax150');
} else {
- $this->fields['fk_soc'] = array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'company');
+ $this->fields['fk_soc'] = array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'company', 'csslist'=>'tdoverflowmax150');
}
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) {
@@ -951,7 +952,7 @@ class Partnership extends CommonObject
$label .= ' ';
$label .= ''.$langs->trans('Ref').': '.$this->ref;
- $url = dol_buildpath('/partnership/partnership_card.php', 1).'?id='.$this->id;
+ $url = DOL_URL_ROOT.'/partnership/partnership_card.php?id='.$this->id;
if ($option != 'nolink') {
// Add param to save lastsearch_values or not
diff --git a/htdocs/partnership/partnership_agenda.php b/htdocs/partnership/partnership_agenda.php
index 799aadd24cd..f154e1b9f5b 100644
--- a/htdocs/partnership/partnership_agenda.php
+++ b/htdocs/partnership/partnership_agenda.php
@@ -154,7 +154,7 @@ if ($object->id > 0) {
$morehtmlref.=' '.$langs->trans('Project') . ' ';
if ($permissiontoadd) {
if ($action != 'classify') {
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
}
$morehtmlref.=' : ';
if ($action == 'classify') {
diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php
index bf980ab9cda..db637136cad 100644
--- a/htdocs/partnership/partnership_card.php
+++ b/htdocs/partnership/partnership_card.php
@@ -412,7 +412,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project') . ' ';
if ($permissiontoadd) {
- //if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
+ //if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
$morehtmlref .= ' : ';
if ($action == 'classify') {
//$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
@@ -643,14 +643,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$MAXEVENT = 10;
- $morehtmlright = '';
+ $morehtmlright = ' ';
$morehtmlright .= $langs->trans("SeeAll");
$morehtmlright .= ' ';
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
- $somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright);
+ $somethingshown = $formactions->showactions($object, $object->element, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright);
print '';
}
diff --git a/htdocs/partnership/partnership_contact.php b/htdocs/partnership/partnership_contact.php
index 1c416cf690c..a4a61c6e907 100644
--- a/htdocs/partnership/partnership_contact.php
+++ b/htdocs/partnership/partnership_contact.php
@@ -140,7 +140,7 @@ if ($object->id) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/partnership/partnership_document.php b/htdocs/partnership/partnership_document.php
index e7fae7ee7ff..79b7be0057a 100644
--- a/htdocs/partnership/partnership_document.php
+++ b/htdocs/partnership/partnership_document.php
@@ -137,7 +137,7 @@ if ($object->id) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/partnership/partnership_note.php b/htdocs/partnership/partnership_note.php
index cc97eac5515..67f963b155e 100644
--- a/htdocs/partnership/partnership_note.php
+++ b/htdocs/partnership/partnership_note.php
@@ -110,7 +110,7 @@ if ($id > 0 || !empty($ref)) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/printing/admin/printing.php b/htdocs/printing/admin/printing.php
index 2b86efa507c..a0849f082e8 100644
--- a/htdocs/printing/admin/printing.php
+++ b/htdocs/printing/admin/printing.php
@@ -274,13 +274,13 @@ if ($mode == 'config' && $user->admin) {
print ajax_constantonoff($printer->active);
} else {
if (empty($conf->global->{$printer->conf})) {
- print ''.img_picto($langs->trans("Disabled"), 'off').' ';
+ print ''.img_picto($langs->trans("Disabled"), 'off').' ';
} else {
- print ''.img_picto($langs->trans("Enabled"), 'on').' ';
+ print ''.img_picto($langs->trans("Enabled"), 'on').' ';
}
}
- print ''.img_picto('', 'setup').' ';
- print ''.img_picto('', 'setup').' ';
+ print ''.img_picto('', 'setup').' ';
+ print ''.img_picto('', 'setup').' ';
print ''."\n";
}
diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php
index fa75a20277f..4f6094e1787 100644
--- a/htdocs/product/admin/product.php
+++ b/htdocs/product/admin/product.php
@@ -346,7 +346,7 @@ foreach ($dirproduct as $dirroot) {
}
print '';
if (!$disabled) {
- print '';
+ print ' ';
}
print img_picto($langs->trans("Disabled"), 'switch_off');
if (!$disabled) {
@@ -448,13 +448,13 @@ foreach ($dirmodels as $reldir) {
// Active
if (in_array($name, $def)) {
print ' '."\n";
- print '';
+ print ' ';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
print ' ';
} else {
print ''."\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
@@ -463,7 +463,7 @@ foreach ($dirmodels as $reldir) {
if ($conf->global->PRODUCT_ADDON_PDF == $name) {
print img_picto($langs->trans("Default"), 'on');
} else {
- print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
@@ -762,10 +762,10 @@ if (!empty($conf->global->PRODUCT_CANVAS_ABILITY)) {
if ($conf->global->$const) {
print img_picto($langs->trans("Active"), 'tick');
print '';
- print ''.$langs->trans("Disable").' ';
+ print ''.$langs->trans("Disable").' ';
} else {
print ' ';
- print ''.$langs->trans("Activate").' ';
+ print ''.$langs->trans("Activate").' ';
}
print ' ';
diff --git a/htdocs/product/admin/product_lot.php b/htdocs/product/admin/product_lot.php
index 3f4fd636de4..24f515fa0bc 100644
--- a/htdocs/product/admin/product_lot.php
+++ b/htdocs/product/admin/product_lot.php
@@ -161,7 +161,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($conf->global->PRODUCTBATCH_LOT_ADDON == $file) {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
- print '';
+ print ' ';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
}
@@ -253,7 +253,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($conf->global->PRODUCTBATCH_SN_ADDON == $file) {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
- print '';
+ print ' ';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
}
diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php
index 77acafbbd55..9ba8d9cec09 100644
--- a/htdocs/product/ajax/products.php
+++ b/htdocs/product/ajax/products.php
@@ -91,7 +91,7 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) {
$outtype = $object->type;
$outqty = 1;
$outdiscount = 0;
-
+ $mandatory_period = $object->mandatory_period;
$found = false;
$price_level = 1;
@@ -203,6 +203,7 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) {
'tva_tx' => $outtva_tx,
'qty' => $outqty,
'discount' => $outdiscount,
+ 'mandatory_period' => $mandatory_period,
'array_options'=>$object->array_options);
}
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index 23fc0077c97..fd9b129e30d 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -105,6 +105,7 @@ $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
$accountancy_code_buy_intra = GETPOST('accountancy_code_buy_intra', 'alpha');
$accountancy_code_buy_export = GETPOST('accountancy_code_buy_export', 'alpha');
+$checkmandatory = GETPOST('accountancy_code_buy_export', 'alpha');
// by default 'alphanohtml' (better security); hidden conf MAIN_SECURITY_ALLOW_UNSECURED_LABELS_WITH_HTML allows basic html
$label_security_check = empty($conf->global->MAIN_SECURITY_ALLOW_UNSECURED_LABELS_WITH_HTML) ? 'alphanohtml' : 'restricthtml';
@@ -131,7 +132,9 @@ $extrafields->fetch_name_optionals_label($object->table_element);
if ($id > 0 || !empty($ref)) {
$result = $object->fetch($id, $ref);
-
+ if ($result < 0) {
+ dol_print_error($db, $object->error, $object->errors);
+ }
if (!empty($conf->product->enabled)) {
$upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref);
} elseif (!empty($conf->service->enabled)) {
@@ -298,7 +301,7 @@ if (empty($reshook)) {
$object->ref = $ref;
$object->label = GETPOST('label', $label_security_check);
$object->price_base_type = GETPOST('price_base_type', 'aZ09');
-
+ $object->mandatory_period = !empty(GETPOST("mandatoryperiod", 'alpha')) ? 1 : 0;
if ($object->price_base_type == 'TTC') {
$object->price_ttc = GETPOST('price');
} else {
@@ -481,7 +484,7 @@ if (empty($reshook)) {
$object->setCategories($categories);
if (!empty($backtopage)) {
- $backtopage = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $backtopage); // New method to autoselect project after a New on another form object creation
+ $backtopage = preg_replace('/__ID__/', $object->id, $backtopage); // New method to autoselect project after a New on another form object creation
if (preg_match('/\?/', $backtopage)) {
$backtopage .= '&socid='.$object->id; // Old method
}
@@ -599,7 +602,7 @@ if (empty($reshook)) {
$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
$accountancy_code_buy_intra = GETPOST('accountancy_code_buy_intra', 'alpha');
$accountancy_code_buy_export = GETPOST('accountancy_code_buy_export', 'alpha');
-
+ $checkmandatory = GETPOST('mandatoryperiod', 'alpha');
if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
$object->accountancy_code_sell = '';
} else {
@@ -630,6 +633,11 @@ if (empty($reshook)) {
} else {
$object->accountancy_code_buy_export = $accountancy_code_buy_export;
}
+ if ($object->isService()) {
+ $object->mandatory_period = (!empty($checkmandatory)) ? 1 : 0 ;
+ }
+
+
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
@@ -1284,6 +1292,15 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ''.$langs->trans("Duration").' ';
print ' ';
print $formproduct->selectMeasuringUnits("duration_unit", "time", (GETPOSTISSET('duration_value') ? GETPOSTISSET('duration_value', 'alpha') : 'h'), 0, 1);
+
+ // Mandatory period
+ print ' ';
+ print ' mandatory_period == 1 ? ' checked="checked"' : '').'>';
+ print '';
+ $htmltooltip = $langs->trans("mandatoryHelper");
+ print $form->textwithpicto($langs->trans("mandatoryperiod"), $htmltooltip, 1, 0);
+ print ' ';
+
print ' ';
}
@@ -1423,6 +1440,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$defaultva = get_default_tva($mysoc, $mysoc);
print $form->load_tva("tva_tx", $defaultva, $mysoc, $mysoc, 0, 0, '', false, 1);
print '';
+
print '
';
print ' ';
@@ -1820,6 +1838,15 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ''.$langs->trans("Duration").' ';
print ' ';
print $formproduct->selectMeasuringUnits("duration_unit", "time", $object->duration_unit, 0, 1);
+
+ // Mandatory period
+ print ' ';
+ print ' mandatory_period == 1 ? ' checked="checked"' : '').'>';
+ print '';
+ $htmltooltip = $langs->trans("mandatoryHelper");
+ print $form->textwithpicto($langs->trans("mandatoryperiod"), $htmltooltip, 1, 0);
+ print ' ';
+
print ' ';
} else {
if (empty($conf->global->PRODUCT_DISABLE_NATURE)) {
@@ -2301,13 +2328,22 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if ($object->isService()) {
// Duration
- print ''.$langs->trans("Duration").' '.$object->duration_value.' ';
+ print ' '.$langs->trans("Duration").' ';
+ print $object->duration_value;
if ($object->duration_value > 1) {
$dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years"));
} elseif ($object->duration_value > 0) {
$dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year"));
}
- print (!empty($object->duration_unit) && isset($dur[$object->duration_unit]) ? $langs->trans($dur[$object->duration_unit]) : '')." ";
+ print (!empty($object->duration_unit) && isset($dur[$object->duration_unit]) ? " ".$langs->trans($dur[$object->duration_unit])." " : '');
+
+ // Mandatory period
+ if ($object->duration_value > 0) {
+ print ' ';
+ }
+ $htmltooltip = $langs->trans("mandatoryHelper");
+ print ' mandatory_period == 1 ? ' checked="checked"' : '').' disabled>';
+ print $form->textwithpicto($langs->trans("mandatoryperiod"), $htmltooltip, 1, 0);
print ' ';
} else {
@@ -2525,7 +2561,7 @@ if ($action != 'create' && $action != 'edit') {
if (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile)) {
print ''.$langs->trans('Delete').' '."\n";
} else {
- print 'id.'">'.$langs->trans("Delete").' ';
+ print 'id.'">'.$langs->trans("Delete").' ';
}
} else {
print ''.$langs->trans("Delete").' ';
@@ -2538,8 +2574,9 @@ if ($action != 'create' && $action != 'edit') {
print "\n\n";
}
+
/*
- * All the "Add to" areas
+ * All the "Add to" areas if PRODUCT_ADD_FORM_ADD_TO is set
*/
if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action == '' || $action == 'view') && $object->status) {
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index e0a8ccb78a5..fd5d8ecf1db 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -434,6 +434,13 @@ class Product extends CommonObject
public $is_object_used;
+ /**
+ *
+ *
+ *
+ */
+ public $mandatory_period;
+
/**
* 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
@@ -484,6 +491,8 @@ class Product extends CommonObject
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000),
//'tosell' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
//'tobuy' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
+ 'mandatory_period' =>array('type'=>'integer', 'label'=>'mandatory_period', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>1000),
+
);
/**
@@ -635,7 +644,7 @@ class Product extends CommonObject
// Barcode value
$this->barcode = trim($this->barcode);
-
+ $this->mandatory_period = empty($this->mandatory_period) ? 0 : $this->mandatory_period;
// Check parameters
if (empty($this->label)) {
$this->error = 'ErrorMandatoryParametersNotProvided';
@@ -717,6 +726,7 @@ class Product extends CommonObject
$sql .= ", tobatch";
$sql .= ", batch_mask";
$sql .= ", fk_unit";
+ $sql .= ", mandatory_period";
$sql .= ") VALUES (";
$sql .= "'".$this->db->idate($now)."'";
$sql .= ", ".((int) $conf->entity);
@@ -745,6 +755,7 @@ class Product extends CommonObject
$sql .= ", ".((empty($this->status_batch) || $this->status_batch < 0) ? '0' : ((int) $this->status_batch));
$sql .= ", '".$this->db->escape($this->batch_mask)."'";
$sql .= ", ".($this->fk_unit > 0 ? ((int) $this->fk_unit) : 'NULL');
+ $sql .= ", '".$this->db->escape($this->mandatory_period)."'";
$sql .= ")";
dol_syslog(get_class($this)."::Create", LOG_DEBUG);
@@ -1016,7 +1027,6 @@ class Product extends CommonObject
$this->accountancy_code_sell_export = trim($this->accountancy_code_sell_export);
-
$this->db->begin();
$result = 0;
@@ -1150,7 +1160,7 @@ class Product extends CommonObject
$sql .= ", price_autogen = ".(!$this->price_autogen ? 0 : 1);
$sql .= ", fk_price_expression = ".($this->fk_price_expression != 0 ? (int) $this->fk_price_expression : 'NULL');
$sql .= ", fk_user_modif = ".($user->id > 0 ? $user->id : 'NULL');
-
+ $sql .= ", mandatory_period = ".($this->mandatory_period );
// stock field is not here because it is a denormalized value from product_stock.
$sql .= " WHERE rowid = ".((int) $id);
@@ -2253,7 +2263,7 @@ class Product extends CommonObject
$sql .= " p.price_min, p.price_min_ttc, p.price_base_type, p.cost_price, p.default_vat_code, p.tva_tx, p.recuperableonly as tva_npr, p.localtax1_tx, p.localtax2_tx, p.localtax1_type, p.localtax2_type, p.tosell,";
$sql .= " p.tobuy, p.fk_product_type, p.duration, p.fk_default_warehouse, p.seuil_stock_alerte, p.canvas, p.net_measure, p.net_measure_units, p.weight, p.weight_units,";
$sql .= " p.length, p.length_units, p.width, p.width_units, p.height, p.height_units,";
- $sql .= " p.surface, p.surface_units, p.volume, p.volume_units, p.barcode, p.fk_barcode_type, p.finished, p.fk_default_bom,";
+ $sql .= " p.surface, p.surface_units, p.volume, p.volume_units, p.barcode, p.fk_barcode_type, p.finished, p.fk_default_bom, p.mandatory_period,";
if (empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
$sql .= " p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export,";
} else {
@@ -2428,6 +2438,8 @@ class Product extends CommonObject
$this->price_autogen = $obj->price_autogen;
$this->model_pdf = $obj->model_pdf;
+ $this->mandatory_period = $obj->mandatory_period;
+
$this->db->free($resql);
// fetch optionals attributes and labels
@@ -5643,6 +5655,16 @@ class Product extends CommonObject
return ($this->type == Product::TYPE_SERVICE ? true : false);
}
+
+ /**
+ * Return if object have a constraint on mandatory_period
+ *
+ * @return boolean True if mandatory_period setted to 1
+ */
+ public function isMandatoryPeriod()
+ {
+ return ($this->mandatory_period == 1 ? true : false);
+ }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Get a barcode from the module to generate barcode values.
@@ -5814,7 +5836,6 @@ class Product extends CommonObject
*/
public function setCategories($categories)
{
-
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
return parent::setCategoriesCommon($categories, Categorie::TYPE_PRODUCT);
}
diff --git a/htdocs/product/dynamic_price/editor.php b/htdocs/product/dynamic_price/editor.php
index 418a71166a8..784be41dfe9 100644
--- a/htdocs/product/dynamic_price/editor.php
+++ b/htdocs/product/dynamic_price/editor.php
@@ -190,7 +190,7 @@ print ''.$langs->trans("Back").' ';
if ($eid == 0) {
print ''.$langs->trans('Delete').'
'."\n";
} else {
- print '';
+ print '';
}
print '';
diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php
index 67912d4acab..72af7b6e886 100644
--- a/htdocs/product/fournisseurs.php
+++ b/htdocs/product/fournisseurs.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2004-2013 Laurent Destailleur
+ * Copyright (C) 2004-2021 Laurent Destailleur
* Copyright (C) 2004 Eric Seigne
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2010-2012 Juanjo Menent
@@ -54,7 +54,9 @@ $cancel = GETPOST('cancel', 'alpha');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'pricesuppliercard';
$socid = GETPOST('socid', 'int');
-$cost_price = GETPOST('cost_price', 'alpha');
+$cost_price = price2num(GETPOST('cost_price', 'alpha'), '', 2);
+$pmp = price2num(GETPOST('pmp', 'alpha'), '', 2);
+
$backtopage = GETPOST('backtopage', 'alpha');
$error = 0;
@@ -147,13 +149,29 @@ if (empty($reshook)) {
}
}
}
+ if ($action == 'setpmp') {
+ if ($id) {
+ $result = $object->fetch($id);
+ $object->pmp = price2num($pmp);
+ $sql = "UPDATE ".MAIN_DB_PREFIX."product SET pmp = ".((float) $object->pmp)." WHERE rowid = ".((int) $id);
+ $resql = $db->query($sql);
+ //$result = $object->update($object->id, $user);
+ if ($resql) {
+ setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
+ $action = '';
+ } else {
+ $error++;
+ setEventMessages($object->error, $object->errors, 'errors');
+ }
+ }
+ }
if ($action == 'confirm_remove_pf') {
if ($rowid) { // id of product supplier price to remove
$action = '';
$result = $object->remove_product_fournisseur_price($rowid);
if ($result > 0) {
- $db->query("DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur_price_extrafields WHERE fk_object = $rowid");
+ $db->query("DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur_price_extrafields WHERE fk_object = ".((int) $rowid));
setEventMessages($langs->trans("PriceRemoved"), null, 'mesgs');
} else {
$error++;
@@ -425,11 +443,25 @@ if ($id > 0 || $ref) {
print '';
// PMP
- print ''.$form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $langs->trans("AverageUnitPricePMPDesc")).' ';
+ $usercaneditpmp = 0;
+ if (!empty($conf->global->PRODUCT_CAN_EDIT_WAP)) {
+ $usercaneditpmp = $usercancreate;
+ }
+ print '';
+ $textdesc = $langs->trans("AverageUnitPricePMPDesc");
+ $text = $form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $textdesc, 1, 'help', '');
+ print $form->editfieldkey($text, 'pmp', $object->pmp, $object, $usercaneditpmp, 'amount:6');
+ print ' ';
+ print $form->editfieldval($text, 'pmp', ($object->pmp > 0 ? $object->pmp : ''), $object, $usercaneditpmp, 'amount:6');
+ if ($object->pmp > 0) {
+ print ' '.$langs->trans("HT");
+ }
+ /*
+ .$form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $langs->trans("AverageUnitPricePMPDesc")).' ';
print '';
if ($object->pmp > 0) {
print price($object->pmp).' '.$langs->trans("HT");
- }
+ }*/
print ' ';
print ' ';
diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php
index 539456351cb..ee39486fb5b 100644
--- a/htdocs/product/inventory/card.php
+++ b/htdocs/product/inventory/card.php
@@ -315,7 +315,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{
if ($action != 'classify')
{
- $morehtmlref .= '' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ $morehtmlref .= '' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
if ($action == 'classify') {
//$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref .= '';
@@ -462,7 +462,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
- $somethingshown = $formactions->showactions($object, 'inventory', 0, 1, '', $MAXEVENT, '', $morehtmlright);
+ $somethingshown = $formactions->showactions($object, $object->element, 0, 1, '', $MAXEVENT, '', $morehtmlright);
print '';
}
diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php
index 916e9a4e01d..2ebde580db7 100644
--- a/htdocs/product/inventory/inventory.php
+++ b/htdocs/product/inventory/inventory.php
@@ -399,7 +399,7 @@ if ($object->id > 0) {
{
if ($action != 'classify')
{
- $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.=' ';
diff --git a/htdocs/product/price.php b/htdocs/product/price.php
index e21d17d823f..ecdddba712c 100644
--- a/htdocs/product/price.php
+++ b/htdocs/product/price.php
@@ -953,9 +953,9 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_
print ''.price($prices['remise_percent']).' % ';
print '';
if (($user->rights->produit->creer || $user->rights->service->creer)) {
- print 'id.'&action=edit_price_by_qty&rowid='.$prices["rowid"].'">';
+ print ' id.'&action=edit_price_by_qty&rowid='.$prices["rowid"].'">';
print img_edit().' ';
- print 'id.'&action=delete_price_by_qty&token='.newToken().'&rowid='.$prices["rowid"].'">';
+ print ' id.'&action=delete_price_by_qty&token='.newToken().'&rowid='.$prices["rowid"].'">';
print img_delete().' ';
} else {
print ' ';
@@ -1106,9 +1106,9 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_
print ' '.price($prices['remise_percent']).' % ';
print '';
if (($user->rights->produit->creer || $user->rights->service->creer)) {
- print 'id.'&action=edit_price_by_qty&rowid='.$prices["rowid"].'">';
+ print ' id.'&action=edit_price_by_qty&rowid='.$prices["rowid"].'">';
print img_edit().' ';
- print 'id.'&action=delete_price_by_qty&token='.newToken().'&rowid='.$prices["rowid"].'">';
+ print ' id.'&action=delete_price_by_qty&token='.newToken().'&rowid='.$prices["rowid"].'">';
print img_delete().' ';
} else {
print ' ';
@@ -1638,7 +1638,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
print ' ';
if ($candelete || ($db->jdate($objp->dp) >= dol_now())) { // Test on date is to be able to delete a corrupted record with a date in future
- print 'id.'&lineid='.$objp->rowid.'">';
+ print ' id.'&lineid='.$objp->rowid.'">';
print img_delete();
print ' ';
} else {
@@ -2193,11 +2193,11 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
print img_info($langs->trans('PriceByCustomerLog'));
print '';
print ' ';
- print 'id.'&lineid='.$line->id.'">';
+ print ' id.'&lineid='.$line->id.'">';
print img_edit('default', 0, 'style="vertical-align: middle;"');
print ' ';
print ' ';
- print 'id.'&lineid='.$line->id.'">';
+ print ' id.'&lineid='.$line->id.'">';
print img_delete('default', 'style="vertical-align: middle;"');
print ' ';
print ' ';
diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php
index fc394d6203a..529c0205d32 100644
--- a/htdocs/product/stock/card.php
+++ b/htdocs/product/stock/card.php
@@ -434,7 +434,7 @@ if ($action == 'create') {
$morehtmlref .= ' '.img_picto('', 'project').' '.$langs->trans('Project').' ';
if ($usercancreate) {
if ($action != 'classify') {
- $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
$projectid = $object->fk_project;
diff --git a/htdocs/product/stock/info.php b/htdocs/product/stock/info.php
index 9fc4e81075a..36897c7aef0 100644
--- a/htdocs/product/stock/info.php
+++ b/htdocs/product/stock/info.php
@@ -64,7 +64,7 @@ if (!empty($conf->projet->enabled)) {
$morehtmlref .= ' '.img_picto('', 'project').' '.$langs->trans('Project').' ';
if ($usercancreate) {
if ($action != 'classify') {
- $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
$projectid = $object->fk_project;
diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php
index da8ef2e5b37..af6d6c08740 100644
--- a/htdocs/product/stock/massstockmove.php
+++ b/htdocs/product/stock/massstockmove.php
@@ -632,7 +632,7 @@ foreach ($listofdata as $key => $val) {
print '';
}
print ''.$val['qty'].' ';
- print ''.img_delete($langs->trans("Remove")).' ';
+ print ''.img_delete($langs->trans("Remove")).' ';
print '';
}
}
diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php
index a3ceb84ed23..6601edd5e10 100644
--- a/htdocs/product/stock/movement_list.php
+++ b/htdocs/product/stock/movement_list.php
@@ -654,7 +654,7 @@ if ($object->id > 0) {
$morehtmlref .= ' '.img_picto('', 'project').' '.$langs->trans('Project').' ';
if ($usercancreate && 1 == 2) {
if ($action != 'classify') {
- $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
$projectid = $object->fk_project;
diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php
index 7a75019c8d1..36e230b911d 100644
--- a/htdocs/product/stock/productlot_card.php
+++ b/htdocs/product/stock/productlot_card.php
@@ -532,12 +532,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (empty($reshook)) {
/*TODO if ($user->rights->stock->lire)
{
- print ''."\n";
+ print ''."\n";
}
if ($user->rights->stock->supprimer)
{
- print ''."\n";
+ print ''."\n";
}
*/
}
diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php
index eaea44dd22b..adef0826992 100644
--- a/htdocs/projet/admin/project.php
+++ b/htdocs/projet/admin/project.php
@@ -347,7 +347,7 @@ foreach ($dirmodels as $reldir) {
if ($conf->global->PROJECT_ADDON == 'mod_'.$classname) {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
- print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
print '';
@@ -443,7 +443,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) {
if ($conf->global->PROJECT_TASK_ADDON == 'mod_'.$classname) {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
- print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
print '';
@@ -564,13 +564,13 @@ foreach ($dirmodels as $reldir) {
// Active
if (in_array($name, $def)) {
print "\n";
- print 'scandir.'&label='.urlencode($module->name).'">';
+ print ' scandir).'&label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
print " ";
} else {
print "\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
@@ -579,7 +579,7 @@ foreach ($dirmodels as $reldir) {
if ($conf->global->PROJECT_ADDON_PDF == "$name") {
print img_picto($langs->trans("Default"), 'on');
} else {
- print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
@@ -704,13 +704,13 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) {
// Active
if (in_array($name, $def)) {
print "\n";
- print 'scandir.'&label='.urlencode($module->name).'">';
+ print ' scandir).'&label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
print " ";
} else {
print "\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
@@ -719,7 +719,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) {
if ($conf->global->PROJECT_TASK_ADDON_PDF == "$name") {
print img_picto($langs->trans("Default"), 'on');
} else {
- print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index 12b6d8f32df..21b49b9447e 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -1281,7 +1281,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
// Reopen
if ($object->statut == Project::STATUS_CLOSED && $user->rights->projet->creer) {
if ($userWrite > 0) {
- print ''.$langs->trans("ReOpen").' ';
+ print ''.$langs->trans("ReOpen").' ';
} else {
print ''.$langs->trans('ReOpen').' ';
}
@@ -1343,7 +1343,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
// Delete
if ($user->rights->projet->supprimer || ($object->statut == Project::STATUS_DRAFT && $user->rights->projet->creer)) {
if ($userDelete > 0 || ($object->statut == Project::STATUS_DRAFT && $user->rights->projet->creer)) {
- print ''.$langs->trans("Delete").' ';
+ print ''.$langs->trans("Delete").' ';
} else {
print ''.$langs->trans('Delete').' ';
}
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index ff406e33131..af1fb65337b 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -814,7 +814,7 @@ class Project extends CommonObject
'propal'=>'fk_projet', 'commande'=>'fk_projet', 'facture'=>'fk_projet',
'supplier_proposal'=>'fk_projet', 'commande_fournisseur'=>'fk_projet', 'facture_fourn'=>'fk_projet',
'expensereport_det'=>'fk_projet', 'contrat'=>'fk_projet', 'fichinter'=>'fk_projet', 'don'=>'fk_projet',
- 'actioncomm'=>'fk_project', 'mrp_mo'=>'fk_project'
+ 'actioncomm'=>'fk_project', 'mrp_mo'=>'fk_project', 'entrepot'=>'fk_project'
);
foreach ($listoftables as $key => $value) {
$sql = "UPDATE ".MAIN_DB_PREFIX.$key." SET ".$value." = NULL where ".$value." = ".((int) $this->id);
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index cd18a9b6819..085d092c2ac 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -181,8 +181,8 @@ class Task extends CommonObject
$sql .= ", '".$this->db->escape($this->description)."'";
$sql .= ", '".$this->db->idate($now)."'";
$sql .= ", ".((int) $user->id);
- $sql .= ", ".($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : 'null');
- $sql .= ", ".($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : 'null');
+ $sql .= ", ".($this->date_start ? "'".$this->db->idate($this->date_start)."'" : 'null');
+ $sql .= ", ".($this->date_end ? "'".$this->db->idate($this->date_end)."'" : 'null');
$sql .= ", ".(($this->planned_workload != '' && $this->planned_workload >= 0) ? ((int) $this->planned_workload) : 'null');
$sql .= ", ".(($this->progress != '' && $this->progress >= 0) ? ((int) $this->progress) : 'null');
$sql .= ")";
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index 7fcfe3bc92b..9e14a53e7ea 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -36,6 +36,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
+if (!empty($conf->stock->enabled)) {
+ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
+}
if (!empty($conf->propal->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
}
diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php
index c5e5b20fb88..b5325ca93b2 100644
--- a/htdocs/projet/ganttview.php
+++ b/htdocs/projet/ganttview.php
@@ -89,6 +89,7 @@ if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $c
$title = ($object->ref ? $object->ref.' '.$object->name.' - ' : '').$langs->trans("Gantt");
}
$help_url = "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos";
+
llxHeader("", $title, $help_url, '', 0, 0, $arrayofjs, $arrayofcss);
if (($id > 0 && is_numeric($id)) || !empty($ref)) {
@@ -136,29 +137,36 @@ if (($id > 0 && is_numeric($id)) || !empty($ref)) {
print '';
// Usage
- print '';
- print $langs->trans("Usage");
- print ' ';
- print '';
- if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
- print ' usage_opportunity ? ' checked="checked"' : '')).'"> ';
- $htmltext = $langs->trans("ProjectFollowOpportunity");
- print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
- print ' ';
+ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) {
+ print ' ';
+ print $langs->trans("Usage");
+ print ' ';
+ print '';
+ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
+ print ' usage_opportunity ? ' checked="checked"' : '')).'"> ';
+ $htmltext = $langs->trans("ProjectFollowOpportunity");
+ print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
+ print ' ';
+ }
+ if (empty($conf->global->PROJECT_HIDE_TASKS)) {
+ print ' usage_task ? ' checked="checked"' : '')).'"> ';
+ $htmltext = $langs->trans("ProjectFollowTasks");
+ print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
+ print ' ';
+ }
+ if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
+ print ' usage_bill_time ? ' checked="checked"' : '')).'"> ';
+ $htmltext = $langs->trans("ProjectBillTimeDescription");
+ print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
+ print ' ';
+ }
+ if (!empty($conf->eventorganization->enabled)) {
+ print ' usage_organize_event ? ' checked="checked"' : '')).'"> ';
+ $htmltext = $langs->trans("EventOrganizationDescriptionLong");
+ print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
+ }
+ print ' ';
}
- if (empty($conf->global->PROJECT_HIDE_TASKS)) {
- print ' usage_task ? ' checked="checked"' : '')).'"> ';
- $htmltext = $langs->trans("ProjectFollowTasks");
- print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
- print ' ';
- }
- if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
- print ' usage_bill_time ? ' checked="checked"' : '')).'"> ';
- $htmltext = $langs->trans("ProjectBillTimeDescription");
- print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
- print ' ';
- }
- print '';
// Visibility
print ''.$langs->trans("Visibility").' ';
diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php
index aa9d9a8a437..6f670af2bb6 100644
--- a/htdocs/projet/index.php
+++ b/htdocs/projet/index.php
@@ -223,7 +223,7 @@ if ($resql) {
print '';
print '
';
print '';
- print ''.$langs->trans("LatestModifiedProjects", $max).' ';
+ print ''.$langs->trans("LatestModifiedProjects", $max).' ';
print ' ';
$num = $db->num_rows($resql);
@@ -277,12 +277,22 @@ if ($resql) {
print '';
+ // Label
+ print '';
+ print $projectstatic->title;
+ print ' ';
+
+ // Thirdparty
print '';
if ($companystatic->id > 0) {
print $companystatic->getNomUrl(1, 'company', 16);
}
print ' ';
+
+ // Date
print ''.dol_print_date($db->jdate($obj->datem), 'day').' ';
+
+ // Status
print ''.$projectstatic->LibStatut($obj->status, 3).' ';
print '';
$i++;
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index 0b47b164c5a..2a814cd9cc5 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -555,7 +555,7 @@ if ($id > 0 || !empty($ref)) {
print '';
print '
';
- print '
';
+ print '';
// Usage
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) {
@@ -628,7 +628,7 @@ if ($id > 0 || !empty($ref)) {
print '';
print '
';
- print '
';
+ print '';
// Description
print ''.$langs->trans("Description").' ';
@@ -637,7 +637,7 @@ if ($id > 0 || !empty($ref)) {
// Categories
if ($conf->categorie->enabled) {
- print ' '.$langs->trans("Categories").' ';
+ print ' '.$langs->trans("Categories").' ';
print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
print " ";
}
diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php
index aaa8bd0cd89..76c5239fc17 100644
--- a/htdocs/projet/tasks/comment.php
+++ b/htdocs/projet/tasks/comment.php
@@ -47,13 +47,6 @@ $withproject = GETPOST('withproject', 'int');
$project_ref = GETPOST('project_ref', 'alpha');
$planned_workload = ((GETPOST('planned_workloadhour', 'int') != '' || GETPOST('planned_workloadmin', 'int') != '') ? (GETPOST('planned_workloadhour', 'int') > 0 ?GETPOST('planned_workloadhour', 'int') * 3600 : 0) + (GETPOST('planned_workloadmin', 'int') > 0 ?GETPOST('planned_workloadmin', 'int') * 60 : 0) : '');
-// Security check
-$socid = 0;
-//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
-if (!$user->rights->projet->lire) {
- accessforbidden();
-}
-
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('projecttaskcommentcard', 'globalcard'));
@@ -79,10 +72,21 @@ if (!empty($project_ref) && !empty($withproject)) {
}
}
+
+if ($id > 0 || $ref) {
+ $object->fetch($id, $ref);
+}
+
+// Security check
+$socid = 0;
+
+restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
+
+
+
/*
* View
-*/
-
+ */
llxHeader('', $langs->trans("CommentPage"));
diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php
index f693d0bf94a..d79406d2d14 100644
--- a/htdocs/projet/tasks/contact.php
+++ b/htdocs/projet/tasks/contact.php
@@ -40,17 +40,18 @@ $confirm = GETPOST('confirm', 'alpha');
$withproject = GETPOST('withproject', 'int');
$project_ref = GETPOST('project_ref', 'alpha');
-// Security check
-$socid = 0;
-//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
-//$result = restrictedArea($user, 'projet', $id, 'projet_task');
-if (!$user->rights->projet->lire) {
- accessforbidden();
-}
-
$object = new Task($db);
$projectstatic = new Project($db);
+if ($id > 0 || $ref) {
+ $object->fetch($id, $ref);
+}
+
+// Security check
+$socid = 0;
+
+restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
+
/*
* Actions
diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php
index d9c49001dfc..3a56a7a018a 100644
--- a/htdocs/projet/tasks/document.php
+++ b/htdocs/projet/tasks/document.php
@@ -37,21 +37,13 @@ $langs->loadLangs(array('projects', 'other'));
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
-$mine = $_REQUEST['mode'] == 'mine' ? 1 : 0;
+$mine = GETPOST('mode') == 'mine' ? 1 : 0;
//if (! $user->rights->projet->all->lire) $mine=1; // Special for projects
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$withproject = GETPOST('withproject', 'int');
$project_ref = GETPOST('project_ref', 'alpha');
-// Security check
-$socid = 0;
-//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
-//$result=restrictedArea($user,'projet',$id,'');
-if (!$user->rights->projet->lire) {
- accessforbidden();
-}
-
// Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
@@ -73,6 +65,17 @@ if (!$sortfield) {
$object = new Task($db);
$projectstatic = new Project($db);
+if ($id > 0 || $ref) {
+ $object->fetch($id, $ref);
+}
+
+// Security check
+$socid = 0;
+
+restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
+
+
+
/*
* Actions
*/
@@ -92,25 +95,21 @@ if (!empty($project_ref) && !empty($withproject)) {
}
if ($id > 0 || !empty($ref)) {
- if ($object->fetch($id, $ref) > 0) {
- if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) {
- $object->fetchComments();
- }
- $projectstatic->fetch($object->fk_project);
- if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) {
- $projectstatic->fetchComments();
- }
-
- if (!empty($projectstatic->socid)) {
- $projectstatic->fetch_thirdparty();
- }
-
- $object->project = clone $projectstatic;
-
- $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref);
- } else {
- dol_print_error($db);
+ if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) {
+ $object->fetchComments();
}
+ $projectstatic->fetch($object->fk_project);
+ if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) {
+ $projectstatic->fetchComments();
+ }
+
+ if (!empty($projectstatic->socid)) {
+ $projectstatic->fetch_thirdparty();
+ }
+
+ $object->project = clone $projectstatic;
+
+ $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref);
}
include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php
index f1fc0c31524..21be9b6d5c4 100644
--- a/htdocs/projet/tasks/note.php
+++ b/htdocs/projet/tasks/note.php
@@ -31,7 +31,7 @@ $langs->load('projects');
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
-$mine = $_REQUEST['mode'] == 'mine' ? 1 : 0;
+$mine = GETPOST('mode') == 'mine' ? 1 : 0;
//if (! $user->rights->projet->all->lire) $mine=1; // Special for projects
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
@@ -85,6 +85,12 @@ if (!empty($project_ref) && !empty($withproject)) {
}
}
+if ($id > 0 || $ref) {
+ $object->fetch($id, $ref);
+}
+
+restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
+
$permissionnote = ($user->rights->projet->creer || $user->rights->projet->all->creer);
diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php
index 99b390870a8..2ae9bb7cc80 100644
--- a/htdocs/projet/tasks/task.php
+++ b/htdocs/projet/tasks/task.php
@@ -46,13 +46,6 @@ $withproject = GETPOST('withproject', 'int');
$project_ref = GETPOST('project_ref', 'alpha');
$planned_workload = ((GETPOST('planned_workloadhour', 'int') != '' || GETPOST('planned_workloadmin', 'int') != '') ? (GETPOST('planned_workloadhour', 'int') > 0 ?GETPOST('planned_workloadhour', 'int') * 3600 : 0) + (GETPOST('planned_workloadmin', 'int') > 0 ?GETPOST('planned_workloadmin', 'int') * 60 : 0) : '');
-// Security check
-$socid = 0;
-//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
-if (!$user->rights->projet->lire) {
- accessforbidden();
-}
-
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('projecttaskcard', 'globalcard'));
@@ -69,6 +62,17 @@ if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
+if ($id > 0 || $ref) {
+ $object->fetch($id, $ref);
+}
+
+// Security check
+$socid = 0;
+
+restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
+
+
+
/*
* Actions
*/
@@ -85,7 +89,6 @@ if ($action == 'update' && !GETPOST("cancel") && $user->rights->projet->creer) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
}
if (!$error) {
- $object->fetch($id, $ref);
$object->oldcopy = clone $object;
$tmparray = explode('_', $_POST['task_parent']);
@@ -121,17 +124,15 @@ if ($action == 'update' && !GETPOST("cancel") && $user->rights->projet->creer) {
}
if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->projet->supprimer) {
- if ($object->fetch($id, $ref) >= 0) {
- $result = $projectstatic->fetch($object->fk_project);
- $projectstatic->fetch_thirdparty();
+ $result = $projectstatic->fetch($object->fk_project);
+ $projectstatic->fetch_thirdparty();
- if ($object->delete($user) > 0) {
- header('Location: '.DOL_URL_ROOT.'/projet/tasks.php?restore_lastsearch_values=1&id='.$projectstatic->id.($withproject ? '&withproject=1' : ''));
- exit;
- } else {
- setEventMessages($object->error, $object->errors, 'errors');
- $action = '';
- }
+ if ($object->delete($user) > 0) {
+ header('Location: '.DOL_URL_ROOT.'/projet/tasks.php?restore_lastsearch_values=1&id='.$projectstatic->id.($withproject ? '&withproject=1' : ''));
+ exit;
+ } else {
+ setEventMessages($object->error, $object->errors, 'errors');
+ $action = '';
}
}
@@ -149,8 +150,6 @@ if (!empty($project_ref) && !empty($withproject)) {
// Build doc
if ($action == 'builddoc' && $user->rights->projet->creer) {
- $object->fetch($id, $ref);
-
// Save last template used to generate document
if (GETPOST('model')) {
$object->setDocModel($user, GETPOST('model', 'alpha'));
@@ -172,17 +171,15 @@ if ($action == 'builddoc' && $user->rights->projet->creer) {
if ($action == 'remove_file' && $user->rights->projet->creer) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
- if ($object->fetch($id, $ref) >= 0) {
- $langs->load("other");
- $upload_dir = $conf->projet->dir_output;
- $file = $upload_dir.'/'.dol_sanitizeFileName(GETPOST('file'));
+ $langs->load("other");
+ $upload_dir = $conf->projet->dir_output;
+ $file = $upload_dir.'/'.dol_sanitizeFileName(GETPOST('file'));
- $ret = dol_delete_file($file);
- if ($ret) {
- setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
- } else {
- setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
- }
+ $ret = dol_delete_file($file);
+ if ($ret) {
+ setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
+ } else {
+ setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
}
}
@@ -198,449 +195,447 @@ $formother = new FormOther($db);
$formfile = new FormFile($db);
if ($id > 0 || !empty($ref)) {
- if ($object->fetch($id, $ref) > 0) {
- $res = $object->fetch_optionals();
- if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) {
- $object->fetchComments();
+ $res = $object->fetch_optionals();
+ if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) {
+ $object->fetchComments();
+ }
+
+ $result = $projectstatic->fetch($object->fk_project);
+ if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) {
+ $projectstatic->fetchComments();
+ }
+ if (!empty($projectstatic->socid)) {
+ $projectstatic->fetch_thirdparty();
+ }
+
+ $object->project = clone $projectstatic;
+
+ //$userWrite = $projectstatic->restrictedProjectArea($user, 'write');
+
+ if (!empty($withproject)) {
+ // Tabs for project
+ $tab = 'tasks';
+ $head = project_prepare_head($projectstatic);
+ print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', '');
+
+ $param = ($mode == 'mine' ? '&mode=mine' : '');
+
+ // Project card
+
+ $linkback = ''.$langs->trans("BackToList").' ';
+
+ $morehtmlref = '';
+ // Title
+ $morehtmlref .= $projectstatic->title;
+ // Thirdparty
+ if ($projectstatic->thirdparty->id > 0) {
+ $morehtmlref .= ' '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project');
+ }
+ $morehtmlref .= '
';
+
+ // Define a complementary filter for search of next/prev ref.
+ if (!$user->rights->projet->all->lire) {
+ $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
+ $projectstatic->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
}
- $result = $projectstatic->fetch($object->fk_project);
- if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) {
- $projectstatic->fetchComments();
- }
- if (!empty($projectstatic->socid)) {
- $projectstatic->fetch_thirdparty();
- }
+ dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
- $object->project = clone $projectstatic;
+ print '';
+ print '
';
+ print '
';
- //$userWrite = $projectstatic->restrictedProjectArea($user, 'write');
+ print '
';
- if (!empty($withproject)) {
- // Tabs for project
- $tab = 'tasks';
- $head = project_prepare_head($projectstatic);
- print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', '');
-
- $param = ($mode == 'mine' ? '&mode=mine' : '');
-
- // Project card
-
- $linkback = ''.$langs->trans("BackToList").' ';
-
- $morehtmlref = '';
- // Title
- $morehtmlref .= $projectstatic->title;
- // Thirdparty
- if ($projectstatic->thirdparty->id > 0) {
- $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project');
+ // Usage
+ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) {
+ print '
';
+ print $langs->trans("Usage");
+ print ' ';
+ print '';
+ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
+ print ' usage_opportunity ? ' checked="checked"' : '')).'"> ';
+ $htmltext = $langs->trans("ProjectFollowOpportunity");
+ print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
+ print ' ';
}
- $morehtmlref .= '';
-
- // Define a complementary filter for search of next/prev ref.
- if (!$user->rights->projet->all->lire) {
- $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
- $projectstatic->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
+ if (empty($conf->global->PROJECT_HIDE_TASKS)) {
+ print ' usage_task ? ' checked="checked"' : '')).'"> ';
+ $htmltext = $langs->trans("ProjectFollowTasks");
+ print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
+ print ' ';
}
-
- dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
-
- print '';
- print '
';
- print '
';
-
- print '
';
-
- // Usage
- if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) {
- print '';
- print $langs->trans("Usage");
- print ' ';
- print '';
- if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
- print ' usage_opportunity ? ' checked="checked"' : '')).'"> ';
- $htmltext = $langs->trans("ProjectFollowOpportunity");
- print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
- print ' ';
- }
- if (empty($conf->global->PROJECT_HIDE_TASKS)) {
- print ' usage_task ? ' checked="checked"' : '')).'"> ';
- $htmltext = $langs->trans("ProjectFollowTasks");
- print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
- print ' ';
- }
- if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
- print ' usage_bill_time ? ' checked="checked"' : '')).'"> ';
- $htmltext = $langs->trans("ProjectBillTimeDescription");
- print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
- print ' ';
- }
- if (!empty($conf->eventorganization->enabled)) {
- print ' usage_organize_event ? ' checked="checked"' : '')).'"> ';
- $htmltext = $langs->trans("EventOrganizationDescriptionLong");
- print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
- }
- print ' ';
+ if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
+ print ' usage_bill_time ? ' checked="checked"' : '')).'"> ';
+ $htmltext = $langs->trans("ProjectBillTimeDescription");
+ print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
+ print ' ';
}
-
- // Visibility
- print ''.$langs->trans("Visibility").' ';
- if ($projectstatic->public) {
- print $langs->trans('SharedProject');
- } else {
- print $langs->trans('PrivateProject');
+ if (!empty($conf->eventorganization->enabled)) {
+ print ' usage_organize_event ? ' checked="checked"' : '')).'"> ';
+ $htmltext = $langs->trans("EventOrganizationDescriptionLong");
+ print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
}
print ' ';
-
- // Date start - end
- print ''.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").' ';
- $start = dol_print_date($projectstatic->date_start, 'day');
- print ($start ? $start : '?');
- $end = dol_print_date($projectstatic->date_end, 'day');
- print ' - ';
- print ($end ? $end : '?');
- if ($projectstatic->hasDelay()) {
- print img_warning("Late");
- }
- print ' ';
-
- // Budget
- print ''.$langs->trans("Budget").' ';
- if (strcmp($projectstatic->budget_amount, '')) {
- print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency);
- }
- print ' ';
-
- // Other attributes
- $cols = 2;
- //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
-
- print '
';
-
- print '
';
-
- print '
';
- print '
';
- print '
';
-
- print '
';
-
- // Description
- print ''.$langs->trans("Description").' ';
- print nl2br($projectstatic->description);
- print ' ';
-
- // Categories
- if ($conf->categorie->enabled) {
- print ''.$langs->trans("Categories").' ';
- print $form->showCategories($projectstatic->id, 'project', 1);
- print " ";
- }
-
- print '
';
-
- print '
';
- print '
';
- print '
';
-
- print '
';
-
- print dol_get_fiche_end();
-
- print ' ';
}
- /*
- * Actions
- */
- /*print '';
+ // Visibility
+ print '
'.$langs->trans("Visibility").' ';
+ if ($projectstatic->public) {
+ print $langs->trans('SharedProject');
+ } else {
+ print $langs->trans('PrivateProject');
+ }
+ print ' ';
- if ($user->rights->projet->all->creer || $user->rights->projet->creer)
- {
- if ($projectstatic->public || $userWrite > 0)
- {
- print '
'.$langs->trans('AddTask').' ';
+ // Date start - end
+ print '
'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").' ';
+ $start = dol_print_date($projectstatic->date_start, 'day');
+ print ($start ? $start : '?');
+ $end = dol_print_date($projectstatic->date_end, 'day');
+ print ' - ';
+ print ($end ? $end : '?');
+ if ($projectstatic->hasDelay()) {
+ print img_warning("Late");
}
- else
- {
- print ''.$langs->trans('AddTask').' ';
- }
- }
- else
- {
- print ''.$langs->trans('AddTask').' ';
+ print ' ';
+
+ // Budget
+ print '
'.$langs->trans("Budget").' ';
+ if (strcmp($projectstatic->budget_amount, '')) {
+ print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency);
}
+ print ' ';
+
+ // Other attributes
+ $cols = 2;
+ //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
+
+ print '
';
print '
';
- */
- // To verify role of users
- //$userAccess = $projectstatic->restrictedProjectArea($user); // We allow task affected to user even if a not allowed project
- //$arrayofuseridoftask=$object->getListContactId('internal');
+ print '
';
+ print '
';
+ print '
';
- $head = task_prepare_head($object);
+ print '
';
- if ($action == 'edit' && $user->rights->projet->creer) {
- print '';
- print ' ';
- print ' ';
- print ' ';
- print ' ';
+ // Description
+ print ''.$langs->trans("Description").' ';
+ print nl2br($projectstatic->description);
+ print ' ';
- print dol_get_fiche_head($head, 'task_task', $langs->trans("Task"), 0, 'projecttask', 0, '', '');
+ // Categories
+ if ($conf->categorie->enabled) {
+ print ''.$langs->trans("Categories").' ';
+ print $form->showCategories($projectstatic->id, 'project', 1);
+ print " ";
+ }
- print '';
- // Ref
- print ''.$langs->trans("Ref").' ';
- print ' ';
+ print '';
+ print '';
+ print '';
- // Label
- print ''.$langs->trans("Label").' ';
- print ' ';
+ print '
';
- // Project
- if (empty($withproject)) {
- print ''.$langs->trans("Project").' ';
- print $projectstatic->getNomUrl(1);
- print ' ';
+ print dol_get_fiche_end();
- // Third party
- print ''.$langs->trans("ThirdParty").' ';
- if ($projectstatic->societe->id) {
- print $projectstatic->societe->getNomUrl(1);
- } else {
- print ' ';
- }
- print ' ';
+ print ' ';
+ }
+
+ /*
+ * Actions
+ */
+ /*print '';
+ */
+
+ // To verify role of users
+ //$userAccess = $projectstatic->restrictedProjectArea($user); // We allow task affected to user even if a not allowed project
+ //$arrayofuseridoftask=$object->getListContactId('internal');
+
+ $head = task_prepare_head($object);
+
+ if ($action == 'edit' && $user->rights->projet->creer) {
+ print ' ';
+ print ' ';
+ print ' ';
+ print ' ';
+ print ' ';
+
+ print dol_get_fiche_head($head, 'task_task', $langs->trans("Task"), 0, 'projecttask', 0, '', '');
+
+ print '';
+
+ // Ref
+ print ''.$langs->trans("Ref").' ';
+ print ' ';
+
+ // Label
+ print ''.$langs->trans("Label").' ';
+ print ' ';
+
+ // Project
+ if (empty($withproject)) {
+ print ''.$langs->trans("Project").' ';
+ print $projectstatic->getNomUrl(1);
+ print ' ';
+
+ // Third party
+ print ''.$langs->trans("ThirdParty").' ';
+ if ($projectstatic->societe->id) {
+ print $projectstatic->societe->getNomUrl(1);
+ } else {
+ print ' ';
}
-
- // Task parent
- print ' '.$langs->trans("ChildOfProjectTask").' ';
- print $formother->selectProjectTasks($object->fk_task_parent, $projectstatic->id, 'task_parent', ($user->admin ? 0 : 1), 0, 0, 0, $object->id);
print ' ';
+ }
- // Date start
- print ''.$langs->trans("DateStart").' ';
- print $form->selectDate($object->date_start, 'dateo', 1, 1, 0, '', 1, 0);
- print ' ';
+ // Task parent
+ print ''.$langs->trans("ChildOfProjectTask").' ';
+ print $formother->selectProjectTasks($object->fk_task_parent, $projectstatic->id, 'task_parent', ($user->admin ? 0 : 1), 0, 0, 0, $object->id);
+ print ' ';
- // Date end
- print ''.$langs->trans("Deadline").' ';
- print $form->selectDate($object->date_end ? $object->date_end : -1, 'datee', 1, 1, 0, '', 1, 0);
- print ' ';
+ // Date start
+ print ''.$langs->trans("DateStart").' ';
+ print $form->selectDate($object->date_start, 'dateo', 1, 1, 0, '', 1, 0);
+ print ' ';
- // Planned workload
- print ''.$langs->trans("PlannedWorkload").' ';
- print $form->select_duration('planned_workload', $object->planned_workload, 0, 'text');
- print ' ';
+ // Date end
+ print ''.$langs->trans("Deadline").' ';
+ print $form->selectDate($object->date_end ? $object->date_end : -1, 'datee', 1, 1, 0, '', 1, 0);
+ print ' ';
- // Progress declared
- print ''.$langs->trans("ProgressDeclared").' ';
- print $formother->select_percent($object->progress, 'progress', 0, 5, 0, 100, 1);
- print ' ';
+ // Planned workload
+ print ''.$langs->trans("PlannedWorkload").' ';
+ print $form->select_duration('planned_workload', $object->planned_workload, 0, 'text');
+ print ' ';
- // Description
- print ''.$langs->trans("Description").' ';
- print '';
- print ''.$object->description.' ';
- print ' ';
+ // Progress declared
+ print ''.$langs->trans("ProgressDeclared").' ';
+ print $formother->select_percent($object->progress, 'progress', 0, 5, 0, 100, 1);
+ print ' ';
- // Other options
- $parameters = array();
- $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
- if (empty($reshook)) {
- print $object->showOptionals($extrafields, 'edit');
- }
+ // Description
+ print ''.$langs->trans("Description").' ';
+ print '';
+ print ''.$object->description.' ';
+ print ' ';
- print '
';
+ // Other options
+ $parameters = array();
+ $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+ print $hookmanager->resPrint;
+ if (empty($reshook)) {
+ print $object->showOptionals($extrafields, 'edit');
+ }
- print dol_get_fiche_end();
+ print '
';
- print $form->buttonsSaveCancel("Modify");
+ print dol_get_fiche_end();
- print '';
+ print $form->buttonsSaveCancel("Modify");
+
+ print '';
+ } else {
+ /*
+ * Fiche tache en mode visu
+ */
+ $param = ($withproject ? '&withproject=1' : '');
+ $linkback = $withproject ? '
'.$langs->trans("BackToList").' ' : '';
+
+ print dol_get_fiche_head($head, 'task_task', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition');
+
+ if ($action == 'delete') {
+ print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".GETPOST("id", 'int').'&withproject='.$withproject, $langs->trans("DeleteATask"), $langs->trans("ConfirmDeleteATask"), "confirm_delete");
+ }
+
+ if (!GETPOST('withproject') || empty($projectstatic->id)) {
+ $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
+ $object->next_prev_filter = " fk_projet IN (".$db->sanitize($projectsListId).")";
} else {
- /*
- * Fiche tache en mode visu
- */
- $param = ($withproject ? '&withproject=1' : '');
- $linkback = $withproject ? '
'.$langs->trans("BackToList").' ' : '';
-
- print dol_get_fiche_head($head, 'task_task', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition');
-
- if ($action == 'delete') {
- print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".GETPOST("id", 'int').'&withproject='.$withproject, $langs->trans("DeleteATask"), $langs->trans("ConfirmDeleteATask"), "confirm_delete");
- }
-
- if (!GETPOST('withproject') || empty($projectstatic->id)) {
- $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
- $object->next_prev_filter = " fk_projet IN (".$db->sanitize($projectsListId).")";
- } else {
- $object->next_prev_filter = " fk_projet = ".((int) $projectstatic->id);
- }
-
- $morehtmlref = '';
-
- // Project
- if (empty($withproject)) {
- $morehtmlref .= '
';
- $morehtmlref .= $langs->trans("Project").': ';
- $morehtmlref .= $projectstatic->getNomUrl(1);
- $morehtmlref .= ' ';
-
- // Third party
- $morehtmlref .= $langs->trans("ThirdParty").': ';
- if (!empty($projectstatic->thirdparty)) {
- $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1);
- }
- $morehtmlref .= '
';
- }
-
- dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);
-
- print '
';
- print '
';
-
- print '
';
- print '
';
-
- // Task parent
- print ''.$langs->trans("ChildOfTask").' ';
- if ($object->fk_task_parent > 0) {
- $tasktmp = new Task($db);
- $tasktmp->fetch($object->fk_task_parent);
- print $tasktmp->getNomUrl(1);
- }
- print ' ';
-
- // Date start - Date end
- print ''.$langs->trans("DateStart").' - '.$langs->trans("Deadline").' ';
- $start = dol_print_date($object->date_start, 'dayhour');
- print ($start ? $start : '?');
- $end = dol_print_date($object->date_end, 'dayhour');
- print ' - ';
- print ($end ? $end : '?');
- if ($object->hasDelay()) {
- print img_warning("Late");
- }
- print ' ';
-
- // Planned workload
- print ''.$langs->trans("PlannedWorkload").' ';
- if ($object->planned_workload != '') {
- print convertSecondToTime($object->planned_workload, 'allhourmin');
- }
- print ' ';
-
- // Description
- print ''.$langs->trans("Description").' ';
- print nl2br($object->description);
- print ' ';
-
- print '
';
- print '
';
-
- print '
';
-
- print '
';
- print '
';
-
- // Progress declared
- print ''.$langs->trans("ProgressDeclared").' ';
- if ($object->progress != '') {
- print $object->progress.' %';
- }
- print ' ';
-
- // Progress calculated
- print ''.$langs->trans("ProgressCalculated").' ';
- if ($object->planned_workload != '') {
- $tmparray = $object->getSummaryOfTimeSpent();
- if ($tmparray['total_duration'] > 0 && !empty($object->planned_workload)) {
- print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %';
- } else {
- print '0 %';
- }
- } else {
- print ''.$langs->trans("WorkloadNotDefined").' ';
- }
- print ' ';
-
- // Other attributes
- $cols = 3;
- $parameters = array('socid'=>$socid);
- include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
-
- print '
';
-
- print '
';
- print '
';
-
- print '
';
- print '
';
-
- print dol_get_fiche_end();
+ $object->next_prev_filter = " fk_projet = ".((int) $projectstatic->id);
}
+ $morehtmlref = '';
- if ($action != 'edit') {
- /*
- * Actions
- */
+ // Project
+ if (empty($withproject)) {
+ $morehtmlref .= '
';
+ $morehtmlref .= $langs->trans("Project").': ';
+ $morehtmlref .= $projectstatic->getNomUrl(1);
+ $morehtmlref .= '
';
- print '
';
+ // Third party
+ $morehtmlref .= $langs->trans("ThirdParty").': ';
+ if (!empty($projectstatic->thirdparty)) {
+ $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1);
+ }
+ $morehtmlref .= '
';
+ }
- $parameters = array();
- $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
- // modified by hook
- if (empty($reshook)) {
- // Modify
- if ($user->rights->projet->creer) {
- print '
'.$langs->trans('Modify').' ';
- } else {
- print '
'.$langs->trans('Modify').' ';
- }
+ dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);
- // Delete
- if ($user->rights->projet->supprimer) {
- if (!$object->hasChildren() && !$object->hasTimeSpent()) {
- print '
'.$langs->trans('Delete').' ';
- } else {
- print '
'.$langs->trans('Delete').' ';
- }
- } else {
- print '
'.$langs->trans('Delete').' ';
- }
+ print '
';
+ print '
';
- print '
';
+ print '
';
+ print '
';
+
+ // Task parent
+ print ''.$langs->trans("ChildOfTask").' ';
+ if ($object->fk_task_parent > 0) {
+ $tasktmp = new Task($db);
+ $tasktmp->fetch($object->fk_task_parent);
+ print $tasktmp->getNomUrl(1);
+ }
+ print ' ';
+
+ // Date start - Date end
+ print ''.$langs->trans("DateStart").' - '.$langs->trans("Deadline").' ';
+ $start = dol_print_date($object->date_start, 'dayhour');
+ print ($start ? $start : '?');
+ $end = dol_print_date($object->date_end, 'dayhour');
+ print ' - ';
+ print ($end ? $end : '?');
+ if ($object->hasDelay()) {
+ print img_warning("Late");
+ }
+ print ' ';
+
+ // Planned workload
+ print ''.$langs->trans("PlannedWorkload").' ';
+ if ($object->planned_workload != '') {
+ print convertSecondToTime($object->planned_workload, 'allhourmin');
+ }
+ print ' ';
+
+ // Description
+ print ''.$langs->trans("Description").' ';
+ print nl2br($object->description);
+ print ' ';
+
+ print '
';
+ print '
';
+
+ print '
';
+
+ print '
';
+ print '
';
+
+ // Progress declared
+ print ''.$langs->trans("ProgressDeclared").' ';
+ if ($object->progress != '') {
+ print $object->progress.' %';
+ }
+ print ' ';
+
+ // Progress calculated
+ print ''.$langs->trans("ProgressCalculated").' ';
+ if ($object->planned_workload != '') {
+ $tmparray = $object->getSummaryOfTimeSpent();
+ if ($tmparray['total_duration'] > 0 && !empty($object->planned_workload)) {
+ print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %';
+ } else {
+ print '0 %';
+ }
+ } else {
+ print ''.$langs->trans("WorkloadNotDefined").' ';
+ }
+ print ' ';
+
+ // Other attributes
+ $cols = 3;
+ $parameters = array('socid'=>$socid);
+ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
+
+ print '
';
+
+ print '
';
+ print '
';
+
+ print '
';
+ print '
';
+
+ print dol_get_fiche_end();
+ }
+
+
+ if ($action != 'edit') {
+ /*
+ * Actions
+ */
+
+ print '
';
+
+ $parameters = array();
+ $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
+ // modified by hook
+ if (empty($reshook)) {
+ // Modify
+ if ($user->rights->projet->creer) {
+ print '
'.$langs->trans('Modify').' ';
+ } else {
+ print '
'.$langs->trans('Modify').' ';
}
- print '
';
- print '
'; // ancre
+ // Delete
+ if ($user->rights->projet->supprimer) {
+ if (!$object->hasChildren() && !$object->hasTimeSpent()) {
+ print '
'.$langs->trans('Delete').' ';
+ } else {
+ print '
'.$langs->trans('Delete').' ';
+ }
+ } else {
+ print '
'.$langs->trans('Delete').' ';
+ }
- /*
- * Generated documents
- */
- $filename = dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
- $filedir = $conf->projet->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
- $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
- $genallowed = ($user->rights->projet->lire);
- $delallowed = ($user->rights->projet->creer);
-
- print $formfile->showdocuments('project_task', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf);
-
- print '
';
-
- // List of actions on element
- include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
- $formactions = new FormActions($db);
- $defaultthirdpartyid = $socid > 0 ? $socid : $object->project->socid;
- $formactions->showactions($object, 'task', $defaultthirdpartyid, 1, '', 10, 'withproject='.$withproject);
-
- print '
';
+ print '
';
}
+
+ print '
';
+ print '
'; // ancre
+
+ /*
+ * Generated documents
+ */
+ $filename = dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
+ $filedir = $conf->projet->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
+ $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
+ $genallowed = ($user->rights->projet->lire);
+ $delallowed = ($user->rights->projet->creer);
+
+ print $formfile->showdocuments('project_task', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf);
+
+ print '
';
+
+ // List of actions on element
+ include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
+ $formactions = new FormActions($db);
+ $defaultthirdpartyid = $socid > 0 ? $socid : $object->project->socid;
+ $formactions->showactions($object, 'task', $defaultthirdpartyid, 1, '', 10, 'withproject='.$withproject);
+
+ print '
';
}
}
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index fa6884ee920..7bea2477bfe 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -108,6 +108,13 @@ $extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label($projectstatic->table_element);
$extrafields->fetch_name_optionals_label($object->table_element);
+if ($id > 0 || $ref) {
+ $object->fetch($id, $ref);
+}
+
+restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
+
+
/*
* Actions
@@ -1219,6 +1226,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as inv ON inv.rowid = il.fk_facture,";
$sql .= " ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE t.fk_user = u.rowid AND t.fk_task = pt.rowid";
+
if (empty($projectidforalltimes)) {
$sql .= " AND t.fk_task =".((int) $object->id);
} else {
@@ -1234,7 +1242,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
$sql .= natural_search('pt.label', $search_task_label);
}
if ($search_user > 0) {
- $sql .= natural_search('t.fk_user', $search_user);
+ $sql .= natural_search('t.fk_user', $search_user, 2);
}
if ($search_valuebilled == '1') {
$sql .= ' AND t.invoice_id > 0';
@@ -1249,6 +1257,12 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$resql = $db->query($sql);
+
+ if (! $resql) {
+ dol_print_error($db);
+ exit;
+ }
+
$nbtotalofrecords = $db->num_rows($resql);
if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0
$page = 0;
@@ -1335,7 +1349,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
$nboftasks = 0;
if (empty($id)) {
print '
';
- $nboftasks = $formproject->selectTasks(-1, GETPOST('taskid', 'int'), 'taskid', 0, 0, 1, 1, 0, 0, 'maxwidth300', $projectstatic->id, '');
+ $nboftasks = $formproject->selectTasks(-1, GETPOST('taskid', 'int'), 'taskid', 0, 0, 1, 1, 0, 0, 'maxwidth300', $projectstatic->id, 'progress');
print ' ';
}
@@ -1729,12 +1743,12 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
}
print ' ';
- print '
fk_task.'&action=editline&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
+ print ' fk_task.'&action=editline&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
print img_edit();
print ' ';
print ' ';
- print '
fk_task.'&action=deleteline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
+ print ' fk_task.'&action=deleteline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
print img_delete('default', 'class="pictodelete paddingleft"');
print ' ';
diff --git a/htdocs/public/eventorganization/attendee_register.php b/htdocs/public/eventorganization/attendee_register.php
index 0cfdf1dabc0..a454f214316 100644
--- a/htdocs/public/eventorganization/attendee_register.php
+++ b/htdocs/public/eventorganization/attendee_register.php
@@ -64,19 +64,21 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/paymentterm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
+require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
global $dolibarr_main_instance_unique_id;
global $dolibarr_main_url_root;
// Init vars
$errmsg = '';
-$num = 0;
$error = 0;
$backtopage = GETPOST('backtopage', 'alpha');
$action = GETPOST('action', 'aZ09');
$email = GETPOST("email");
$societe = GETPOST("societe");
+$emailcompany = GETPOST("emailcompany");
+$note_public = GETPOST('note_public', "nohtml");
// Getting id from Post and decoding it
$type = GETPOST('type', 'aZ09');
@@ -234,7 +236,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
// If the price has been set, name is required for the invoice
if (!GETPOST("societe") && !empty(floatval($project->price_registration))) {
$error++;
- $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."
\n";
+ $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Company"))."
\n";
}
if (GETPOST("email") && !isValidEmail(GETPOST("email"))) {
$error++;
@@ -269,6 +271,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
$confattendee->email = $email;
$confattendee->fk_project = $project->id;
$confattendee->fk_actioncomm = $id;
+ $confattendee->note_public = $note_public;
$resultconfattendee = $confattendee->create($user);
if ($resultconfattendee < 0) {
$error++;
@@ -293,7 +296,9 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
exit;
}
- $resultfetchthirdparty = -1;
+ $resultfetchthirdparty = 0;
+
+ $genericcompanyname = $langs->trans('EventParticipant').' '.($emailcompany ? $emailcompany : $email); // Keep this label simple so we can retreive same thirdparty for another event
// Getting the thirdparty or creating it
$thirdparty = new Societe($db);
@@ -303,45 +308,104 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
$resultfetchthirdparty = $thirdparty->fetch($confattendee->fk_soc);
} else {
if (empty($conf->global->EVENTORGANIZATION_DISABLE_RETREIVE_THIRDPARTY_FROM_NAME)) {
- // Fetch using the input field by user if we just created the attendee
- if (!empty($societe)) {
- $resultfetchthirdparty = $thirdparty->fetch('', $societe, '', '', '', '', '', '', '', '', $email);
- if ($resultfetchthirdparty <= 0) {
- // Try to find the thirdparty from the contact
- $resultfetchcontact = $contact->fetch('', null, '', $email);
- if ($resultfetchcontact <= 0 || $contact->fk_soc <= 0) {
- // Need to create a new one (not found or multiple with the same name/email)
- $resultfetchthirdparty = 0;
- } else {
- $thirdparty->fetch($contact->fk_soc);
- $confattendee->fk_soc = $thirdparty->id;
- $confattendee->update($user);
- $resultfetchthirdparty = 1;
- }
- } else {
- // We found a unique result with that name/email, so we set the fk_soc of attendee
+ // Fetch using the field input by end user if we have just created the attendee
+ if ($resultfetchthirdparty <= 0 && !empty($societe) && !empty($emailcompany)) {
+ $resultfetchthirdparty = $thirdparty->fetch('', $societe, '', '', '', '', '', '', '', '', $emailcompany);
+ if ($resultfetchthirdparty > 0) {
+ // We found a unique result with the name + emailcompany, so we set the fk_soc of attendee
$confattendee->fk_soc = $thirdparty->id;
$confattendee->update($user);
+ } elseif ($resultfetchthirdparty == -2) {
+ $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithNameContactUs", $mysoc->email);
}
- } else {
- // Need to create a thirdparty (put number>0 if we do not want to create a thirdparty for free-conferences)
- $resultfetchthirdparty = 0;
}
- } else {
- // Need to create a thirdparty (put number>0 if we do not want to create a thirdparty for free-conferences)
- $resultfetchthirdparty = 0;
+ // Fetch using the field input by end user if we have just created the attendee
+ if ($resultfetchthirdparty <= 0 && !empty($societe) && !empty($email) && $email != $emailcompany) {
+ $resultfetchthirdparty = $thirdparty->fetch('', $societe, '', '', '', '', '', '', '', '', $email);
+ if ($resultfetchthirdparty > 0) {
+ // We found a unique result with the name + email, so we set the fk_soc of attendee
+ $confattendee->fk_soc = $thirdparty->id;
+ $confattendee->update($user);
+ } elseif ($resultfetchthirdparty == -2) {
+ $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithNameContactUs", $mysoc->email);
+ }
+ }
+ }
+ if ($resultfetchthirdparty <= 0 && !empty($emailcompany)) {
+ // Try to find thirdparty from the email only
+ $resultfetchthirdparty = $thirdparty->fetch('', '', '', '', '', '', '', '', '', '', $emailcompany);
+ if ($resultfetchthirdparty > 0) {
+ // We found a unique result with that email only, so we set the fk_soc of attendee
+ $confattendee->fk_soc = $thirdparty->id;
+ $confattendee->update($user);
+ } elseif ($resultfetchthirdparty == -2) {
+ $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithEmailContactUs", $mysoc->email);
+ }
+ }
+ if ($resultfetchthirdparty <= 0 && !empty($email) && $email != $emailcompany) {
+ // Try to find thirdparty from the email only
+ $resultfetchthirdparty = $thirdparty->fetch('', '', '', '', '', '', '', '', '', '', $email);
+ if ($resultfetchthirdparty > 0) {
+ // We found a unique result with that email only, so we set the fk_soc of attendee
+ $confattendee->fk_soc = $thirdparty->id;
+ $confattendee->update($user);
+ } elseif ($resultfetchthirdparty == -2) {
+ $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithEmailContactUs", $mysoc->email);
+ }
+ }
+ if ($resultfetchthirdparty <= 0 && !empty($genericcompanyname)) {
+ // Try to find thirdparty from the generic mail only
+ $resultfetchthirdparty = $thirdparty->fetch('', $genericcompanyname, '', '', '', '', '', '', '', '', '');
+ if ($resultfetchthirdparty > 0) {
+ // We found a unique result with that name + email, so we set the fk_soc of attendee
+ $confattendee->fk_soc = $thirdparty->id;
+ $confattendee->update($user);
+ } elseif ($resultfetchthirdparty == -2) {
+ $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithNameContactUs", $mysoc->email);
+ }
+ }
+
+ // TODO Add more tests on a VAT number, profid or a name ?
+
+ if ($resultfetchthirdparty <= 0 && !empty($email)) {
+ // Try to find the thirdparty from the contact
+ $resultfetchcontact = $contact->fetch('', null, '', $email);
+ if ($resultfetchcontact > 0 && $contact->fk_soc > 0) {
+ $thirdparty->fetch($contact->fk_soc);
+ $confattendee->fk_soc = $thirdparty->id;
+ $confattendee->update($user);
+ $resultfetchthirdparty = 1;
+ }
+ }
+
+ if ($resultfetchthirdparty <= 0 && !empty($societe)) {
+ // Try to find thirdparty from the company name only
+ $resultfetchthirdparty = $thirdparty->fetch('', $societe, '', '', '', '', '', '', '', '', '');
+ if ($resultfetchthirdparty > 0) {
+ // We found a unique result with that name only, so we set the fk_soc of attendee
+ $confattendee->fk_soc = $thirdparty->id;
+ $confattendee->update($user);
+ } elseif ($resultfetchthirdparty == -2) {
+ $thirdparty->error = "ErrorSeveralCompaniesWithNameContactUs";
+ }
}
}
+ // If price is empty, no need to create a thirdparty, so we force $resultfetchthirdparty as if we have already found thirdp party.
+ if (empty(floatval($project->price_registration))) {
+ $resultfetchthirdparty = 1;
+ }
+
if ($resultfetchthirdparty < 0) {
+ // If an error was found
$error++;
$errmsg .= $thirdparty->error;
- } elseif ($resultfetchthirdparty == 0) {
+ } elseif ($resultfetchthirdparty == 0) { // No thirdparty found + a payment is expected
// Creation of a new thirdparty
if (!empty($societe)) {
$thirdparty->name = $societe;
} else {
- $thirdparty->name = $email;
+ $thirdparty->name = $genericcompanyname;
}
$thirdparty->address = GETPOST("address");
$thirdparty->zip = GETPOST("zipcode");
@@ -350,7 +414,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
$thirdparty->fournisseur = 0;
$thirdparty->country_id = GETPOST("country_id", 'int');
$thirdparty->state_id = GETPOST("state_id", 'int');
- $thirdparty->email = $email;
+ $thirdparty->email = ($emailcompany ? $emailcompany : $email);
// Load object modCodeTiers
$module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard');
@@ -386,8 +450,10 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
}
if (!$error) {
+ // If the registration needs a payment
if (!empty(floatval($project->price_registration))) {
$outputlangs = $langs;
+
// TODO Use default language of $thirdparty->default_lang to build $outputlang
// Get product to use for invoice
@@ -405,30 +471,41 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
$errmsg .= $productforinvoicerow->error;
} else {
$facture = new Facture($db);
- $facture->type = Facture::TYPE_STANDARD;
- $facture->socid = $thirdparty->id;
- $facture->paye = 0;
- $facture->date = dol_now();
- $facture->cond_reglement_id = $confattendee->cond_reglement_id;
- $facture->fk_project = $project->id;
+ if (empty($confattendee->fk_invoice)) {
+ $facture->type = Facture::TYPE_STANDARD;
+ $facture->socid = $thirdparty->id;
+ $facture->paye = 0;
+ $facture->date = dol_now();
+ $facture->cond_reglement_id = $confattendee->cond_reglement_id;
+ $facture->fk_project = $project->id;
+ $facture->status = Facture::STATUS_DRAFT;
- if (empty($facture->cond_reglement_id)) {
- $paymenttermstatic = new PaymentTerm($confattendee->db);
- $facture->cond_reglement_id = $paymenttermstatic->getDefaultId();
if (empty($facture->cond_reglement_id)) {
- $error++;
- $confattendee->error = 'ErrorNoPaymentTermRECEPFound';
- $confattendee->errors[] = $confattendee->error;
+ $paymenttermstatic = new PaymentTerm($confattendee->db);
+ $facture->cond_reglement_id = $paymenttermstatic->getDefaultId();
+ if (empty($facture->cond_reglement_id)) {
+ $error++;
+ $confattendee->error = 'ErrorNoPaymentTermRECEPFound';
+ $confattendee->errors[] = $confattendee->error;
+ }
+ }
+ $resultfacture = $facture->create($user);
+ if ($resultfacture <= 0) {
+ $confattendee->error = $facture->error;
+ $confattendee->errors = $facture->errors;
+ $error++;
+ } else {
+ $confattendee->fk_invoice = $resultfacture;
+ $confattendee->update($user);
}
- }
- $resultfacture = $facture->create($user);
- if ($resultfacture <= 0) {
- $confattendee->error = $facture->error;
- $confattendee->errors = $facture->errors;
- $error++;
} else {
- $facture->add_object_linked($confattendee->element, $confattendee->id);
+ $facture->fetch($confattendee->fk_invoice);
}
+
+ // Add link between invoice and the attendee registration
+ /*if (!$error) {
+ $facture->add_object_linked($confattendee->element, $confattendee->id);
+ }*/
}
if (!$error) {
@@ -439,11 +516,14 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
$date_start = $project->date_start;
$date_end = $project->date_end;
- $result = $facture->addline($labelforproduct, floatval($project->price_registration), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, $date_start, $date_end, 0, 0, '', 'HT', 0, 1);
- if ($result <= 0) {
- $confattendee->error = $facture->error;
- $confattendee->errors = $facture->errors;
- $error++;
+ // If there is no lines yet, we add one
+ if (empty($facture->lines)) {
+ $result = $facture->addline($labelforproduct, floatval($project->price_registration), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, $date_start, $date_end, 0, 0, '', 'HT', 0, 1);
+ if ($result <= 0) {
+ $confattendee->error = $facture->error;
+ $confattendee->errors = $facture->errors;
+ $error++;
+ }
}
}
@@ -610,7 +690,10 @@ if (!empty($conference->id) && $conference->status==ConferenceOrBooth::STATUS_CO
print '
' . "\n";
// Email
- print '' . $langs->trans("Email") . '* ' . "\n";
+ print '' . $langs->trans("EmailAttendee") . '* ';
+ print img_picto('', 'email', 'class="pictofixedwidth"');
+ print ' ' . "\n";
+
// Company
print '' . $langs->trans("Company");
if (!empty(floatval($project->price_registration))) {
@@ -619,15 +702,25 @@ if (!empty($conference->id) && $conference->status==ConferenceOrBooth::STATUS_CO
print ' ';
print img_picto('', 'company', 'class="pictofixedwidth"');
print ' ' . "\n";
+
+ // Email company for invoice
+ if ($project->price_registration) {
+ print '' . $langs->trans("EmailCompanyForInvoice") . ' ';
+ print img_picto('', 'email', 'class="pictofixedwidth"');
+ print ' ' . "\n";
+ }
+
// Address
print '' . $langs->trans("Address") . ' ' . "\n";
- print '' . dol_escape_htmltag(GETPOST('address', 'restricthtml'), 0, 1) . ' ' . "\n";
+ print '' . dol_escape_htmltag(GETPOST('address', 'restricthtml'), 0, 1) . ' ' . "\n";
+
// Zip / Town
print '' . $langs->trans('Zip') . ' / ' . $langs->trans('Town') . ' ';
print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1);
print ' / ';
print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1);
print ' ';
+
// Country
print '' . $langs->trans('Country') . '* ';
print img_picto('', 'country', 'class="pictofixedwidth"');
@@ -666,6 +759,14 @@ if (!empty($conference->id) && $conference->status==ConferenceOrBooth::STATUS_CO
print ' ';
}
+ $notetoshow = $note_public;
+ print '' . $langs->trans('Note') . ' ';
+ if (!empty($conf->global->EVENTORGANIZATION_DEFAULT_NOTE_ON_REGISTRATION)) {
+ $notetoshow = str_replace('\n', "\n", $conf->global->EVENTORGANIZATION_DEFAULT_NOTE_ON_REGISTRATION);
+ }
+ print ''.dol_escape_htmltag($notetoshow, 0, 1).' ';
+ print ' ';
+
print "
\n";
print dol_get_fiche_end();
diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php
index 2a39e6e4730..7be05684fd2 100644
--- a/htdocs/public/opensurvey/studs.php
+++ b/htdocs/public/opensurvey/studs.php
@@ -274,7 +274,13 @@ $toutsujet = str_replace("°", "'", $toutsujet);
print '
'.$langs->trans("YouAreInivitedToVote").'
';
-print $langs->trans("OpenSurveyHowTo").'
';
+print $langs->trans("OpenSurveyHowTo").'
';
+if (empty($object->allow_spy)) {
+ print '
'.$langs->trans("YourVoteIsPrivate").' ';
+} else {
+ print $form->textwithpicto('
'.$langs->trans("YourVoteIsPublic").' ', $langs->trans("CanSeeOthersVote")).'
';
+}
+print '
';
print '
'."\n";
diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php
index d7bf9b3d565..059042399a2 100644
--- a/htdocs/public/payment/newpayment.php
+++ b/htdocs/public/payment/newpayment.php
@@ -115,6 +115,8 @@ if (!$action) {
if ($source == 'organizedeventregistration') {
// Finding the Attendee
+ $attendee = new ConferenceOrBoothAttendee($db);
+
$invoiceid = GETPOST('ref', 'int');
$invoice = new Facture($db);
@@ -123,14 +125,28 @@ if ($source == 'organizedeventregistration') {
if ($resultinvoice <= 0) {
setEventMessages(null, $invoice->errors, "errors");
} else {
+ /*
+ $attendeeid = 0;
+
$invoice->fetchObjectLinked();
$linkedAttendees = $invoice->linkedObjectsIds['conferenceorboothattendee'];
if (is_array($linkedAttendees)) {
$linkedAttendees = array_values($linkedAttendees);
+ $attendeeid = $linkedAttendees[0];
+ }*/
+ $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."eventorganization_conferenceorboothattendee";
+ $sql .= " WHERE fk_invoice = ".((int) $invoiceid);
+ $resql = $db->query($sql);
+ if ($resql) {
+ $obj = $db->fetch_object($resql);
+ if ($obj) {
+ $attendeeid = $obj->rowid;
+ }
+ }
- $attendee = new ConferenceOrBoothAttendee($db);
- $resultattendee = $attendee->fetch($linkedAttendees[0]);
+ if ($attendeeid > 0) {
+ $resultattendee = $attendee->fetch($attendeeid);
if ($resultattendee <= 0) {
setEventMessages(null, $attendee->errors, "errors");
@@ -1840,7 +1856,7 @@ if ($source == 'organizedeventregistration') {
print ''."\n";
if (! is_object($attendee->project)) {
- $text = 'ErrorProjectotFound';
+ $text = 'ErrorProjectNotFound';
} else {
$text = $langs->trans("PaymentEvent").' - '.$attendee->project->title;
}
diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php
index 20a5239153a..70a684f5932 100644
--- a/htdocs/public/payment/paymentok.php
+++ b/htdocs/public/payment/paymentok.php
@@ -1037,7 +1037,7 @@ if ($ispaymentok) {
}
// TODO send email with acknowledgment for the donation
- // (need that the donation module can gen a pdf document for the cerfa with pre filled content)
+ // (we need first that the donation module is able to generate a pdf document for the cerfa with pre filled content)
} elseif (array_key_exists('ATT', $tmptag) && $tmptag['ATT'] > 0) {
// Record payment for registration to an event for an attendee
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php
index 3317288a4e1..fbb9d246431 100644
--- a/htdocs/reception/card.php
+++ b/htdocs/reception/card.php
@@ -1317,7 +1317,7 @@ if ($action == 'create') {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if (0) { // Do not change on reception
if ($action != 'classify') {
- $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
// $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
@@ -1920,10 +1920,10 @@ if ($action == 'create') {
} elseif ($object->statut == Reception::STATUS_DRAFT) {
// edit-delete buttons
print '
';
- print 'id.'&action=editline&token='.newToken().'&lineid='.$lines[$i]->id.'">'.img_edit().' ';
+ print 'id.'&action=editline&token='.newToken().'&lineid='.$lines[$i]->id.'">'.img_edit().' ';
print ' ';
print '
';
- print 'id.'&action=deleteline&token='.newToken().'&lineid='.$lines[$i]->id.'">'.img_delete().' ';
+ print 'id.'&action=deleteline&token='.newToken().'&lineid='.$lines[$i]->id.'">'.img_delete().' ';
print ' ';
// Display lines extrafields
@@ -1990,9 +1990,9 @@ if ($action == 'create') {
// 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order)
if ($object->statut == Reception::STATUS_CLOSED && $user->rights->reception->creer) {
if (!empty($conf->facture->enabled) && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ?
- print '
id.'&action=reopen">'.$langs->trans("ClassifyUnbilled").' ';
+ print '
id.'&action=reopen&token='.newToken().'">'.$langs->trans("ClassifyUnbilled").' ';
} else {
- print '
id.'&action=reopen">'.$langs->trans("ReOpen").' ';
+ print '
id.'&action=reopen&token='.newToken().'">'.$langs->trans("ReOpen").' ';
}
}
@@ -2026,12 +2026,12 @@ if ($action == 'create') {
$label = "ClassifyBilled";
$paramaction = 'classifybilled';
}
- print '
id.'&action='.$paramaction.'">'.$langs->trans($label).' ';
+ print '
id.'&action='.$paramaction.'">'.$langs->trans($label).' ';
}
}
if ($user->rights->reception->supprimer) {
- print '
id.'&action=delete&token='.newToken().'">'.$langs->trans("Delete").' ';
+ print '
id.'&action=delete&token='.newToken().'">'.$langs->trans("Delete").' ';
}
}
diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php
index ddc28c72896..498b67d1593 100644
--- a/htdocs/reception/contact.php
+++ b/htdocs/reception/contact.php
@@ -152,7 +152,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if (0) { // Do not change on reception
if ($action != 'classify') {
- $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
// $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php
index 76eb78b856a..b7f3f577ce2 100644
--- a/htdocs/reception/list.php
+++ b/htdocs/reception/list.php
@@ -579,43 +579,43 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&limit='.urlencode($limit);
}
if ($sall) {
- $param .= "&sall=".urlencode($sall);
+ $param .= "&sall=".urlencode($sall);
}
if ($search_ref_rcp) {
- $param .= "&search_ref_rcp=".urlencode($search_ref_rcp);
+ $param .= "&search_ref_rcp=".urlencode($search_ref_rcp);
}
if ($search_ref_liv) {
- $param .= "&search_ref_liv=".urlencode($search_ref_liv);
+ $param .= "&search_ref_liv=".urlencode($search_ref_liv);
}
if ($search_company) {
- $param .= "&search_company=".urlencode($search_company);
+ $param .= "&search_company=".urlencode($search_company);
}
if ($optioncss != '') {
- $param .= '&optioncss='.urlencode($optioncss);
+ $param .= '&optioncss='.urlencode($optioncss);
}
if ($search_billed != '' && $search_billed >= 0) {
- $param .= "&search_billed=".urlencode($search_billed);
+ $param .= "&search_billed=".urlencode($search_billed);
}
if ($search_town) {
- $param .= "&search_town=".urlencode($search_town);
+ $param .= "&search_town=".urlencode($search_town);
}
if ($search_zip) {
- $param .= "&search_zip=".urlencode($search_zip);
+ $param .= "&search_zip=".urlencode($search_zip);
}
if ($search_state) {
- $param .= "&search_state=".urlencode($search_state);
+ $param .= "&search_state=".urlencode($search_state);
}
if ($search_status != '') {
- $param .= "&search_status=".urlencode($search_status);
+ $param .= "&search_status=".urlencode($search_status);
}
if ($search_country) {
- $param .= "&search_country=".urlencode($search_country);
+ $param .= "&search_country=".urlencode($search_country);
}
if ($search_type_thirdparty) {
- $param .= "&search_type_thirdparty=".urlencode($search_type_thirdparty);
+ $param .= "&search_type_thirdparty=".urlencode($search_type_thirdparty);
}
if ($search_ref_supplier) {
- $param .= "&search_ref_supplier=".urlencode($search_ref_supplier);
+ $param .= "&search_ref_supplier=".urlencode($search_ref_supplier);
}
// Add $param from extra fields
foreach ($search_array_options as $key => $val) {
@@ -891,7 +891,7 @@ while ($i < min($num, $limit)) {
// Ref
if (!empty($arrayfields['e.ref']['checked'])) {
- print "
";
+ print ' ';
print $reception->getNomUrl(1);
$filename = dol_sanitizeFileName($reception->ref);
$filedir = $conf->reception->dir_output.'/'.dol_sanitizeFileName($reception->ref);
@@ -904,10 +904,10 @@ while ($i < min($num, $limit)) {
}
}
- // Ref customer
+ // Ref supplier
if (!empty($arrayfields['e.ref_supplier']['checked'])) {
- print " ";
- print $obj->ref_supplier;
+ print ' ';
+ print dol_escape_htmltag($obj->ref_supplier);
print " \n";
if (!$i) {
$totalarray['nbfield']++;
@@ -916,7 +916,7 @@ while ($i < min($num, $limit)) {
// Third party
if (!empty($arrayfields['s.nom']['checked'])) {
- print '
';
+ print ' ';
print $companystatic->getNomUrl(1);
print ' ';
if (!$i) {
@@ -925,8 +925,8 @@ while ($i < min($num, $limit)) {
}
// Town
if (!empty($arrayfields['s.town']['checked'])) {
- print '
';
- print $obj->town;
+ print ' ';
+ print dol_escape_htmltag($obj->town);
print ' ';
if (!$i) {
$totalarray['nbfield']++;
@@ -934,8 +934,8 @@ while ($i < min($num, $limit)) {
}
// Zip
if (!empty($arrayfields['s.zip']['checked'])) {
- print '
';
- print $obj->zip;
+ print ' ';
+ print dol_escape_htmltag($obj->zip);
print ' ';
if (!$i) {
$totalarray['nbfield']++;
@@ -943,7 +943,7 @@ while ($i < min($num, $limit)) {
}
// State
if (!empty($arrayfields['state.nom']['checked'])) {
- print "
".$obj->state_name." \n";
+ print "
".dol_escape_htmltag($obj->state_name)." \n";
if (!$i) {
$totalarray['nbfield']++;
}
@@ -952,7 +952,7 @@ while ($i < min($num, $limit)) {
if (!empty($arrayfields['country.code_iso']['checked'])) {
print '
';
$tmparray = getCountry($obj->fk_pays, 'all');
- print $tmparray['label'];
+ print dol_escape_htmltag($tmparray['label']);
print ' ';
if (!$i) {
$totalarray['nbfield']++;
diff --git a/htdocs/reception/note.php b/htdocs/reception/note.php
index bbf2c80be2f..a75dd432082 100644
--- a/htdocs/reception/note.php
+++ b/htdocs/reception/note.php
@@ -129,7 +129,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if (0) { // Do not change on reception
if ($action != 'classify') {
- $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
// $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/reception/tpl/linkedobjectblock.tpl.php b/htdocs/reception/tpl/linkedobjectblock.tpl.php
index 39a5a24347d..41ebc02747f 100644
--- a/htdocs/reception/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/reception/tpl/linkedobjectblock.tpl.php
@@ -69,7 +69,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
// For now, receptions must stay linked to order, so link is not deletable
if ($object->element != 'order_supplier') {
?>
-
id.'&action=dellink&dellinkid='.$key; ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
+
id.'&action=dellink&token='.newToken().'&dellinkid='.$key; ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
diff --git a/htdocs/recruitment/admin/setup.php b/htdocs/recruitment/admin/setup.php
index 6da39445f7f..3f71b0397a1 100644
--- a/htdocs/recruitment/admin/setup.php
+++ b/htdocs/recruitment/admin/setup.php
@@ -459,13 +459,13 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
// Active
if (in_array($name, $def)) {
print '
'."\n";
- print '';
+ print ' ';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
print ' ';
} else {
print '
'."\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
@@ -475,9 +475,9 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($conf->global->$constforvar == $name) {
//print img_picto($langs->trans("Default"), 'on');
// Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset
- print '
scandir.'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').' ';
+ print '
scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').' ';
} else {
- print '
scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
+ print '
scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
diff --git a/htdocs/recruitment/admin/setup_candidatures.php b/htdocs/recruitment/admin/setup_candidatures.php
index 2bcddf58964..9c30f0d1ccf 100644
--- a/htdocs/recruitment/admin/setup_candidatures.php
+++ b/htdocs/recruitment/admin/setup_candidatures.php
@@ -457,13 +457,13 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
// Active
if (in_array($name, $def)) {
print '
'."\n";
- print '';
+ print ' ';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
print ' ';
} else {
print '
'."\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
@@ -473,9 +473,9 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($conf->global->$constforvar == $name) {
//print img_picto($langs->trans("Default"), 'on');
// Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset
- print '
scandir.'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').' ';
+ print '
scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').' ';
} else {
- print '
scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
+ print '
scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
diff --git a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php
index 192d1d4c526..ce96d1cd67b 100644
--- a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php
+++ b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php
@@ -36,7 +36,7 @@ class mod_recruitmentcandidature_standard extends ModeleNumRefRecruitmentCandida
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
- public $prefix = 'JOC';
+ public $prefix = 'JOA';
/**
* @var string Error code (or message)
diff --git a/htdocs/recruitment/recruitmentcandidature_agenda.php b/htdocs/recruitment/recruitmentcandidature_agenda.php
index 01ac72065ea..79795472b4e 100644
--- a/htdocs/recruitment/recruitmentcandidature_agenda.php
+++ b/htdocs/recruitment/recruitmentcandidature_agenda.php
@@ -186,7 +186,7 @@ if ($object->id > 0) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php
index db51171a04a..4e6390314f5 100644
--- a/htdocs/recruitment/recruitmentcandidature_card.php
+++ b/htdocs/recruitment/recruitmentcandidature_card.php
@@ -482,7 +482,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$morehtmlref .= '
'.$langs->trans('Project') . ' ';
if ($permissiontoadd)
{
- //if ($action != 'classify') $morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
+ //if ($action != 'classify') $morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
$morehtmlref .= ' : ';
if ($action == 'classify') {
//$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
@@ -567,7 +567,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($object->status == $object::STATUS_DRAFT) {
if ($permissiontoadd) {
if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) {
- print '
'.$langs->trans("Validate").' ';
+ print '
'.$langs->trans("Validate").' ';
} else {
$langs->load("errors");
print '
'.$langs->trans("Validate").' ';
@@ -620,7 +620,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Delete (need delete permission, or if draft, just need create/modify permission)
if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)) {
- print '
id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').' '."\n";
+ print '
id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').' '."\n";
} else {
print '
'.$langs->trans('Delete').' '."\n";
}
diff --git a/htdocs/recruitment/recruitmentcandidature_document.php b/htdocs/recruitment/recruitmentcandidature_document.php
index 2e8c29cf2fe..dcd29c88118 100644
--- a/htdocs/recruitment/recruitmentcandidature_document.php
+++ b/htdocs/recruitment/recruitmentcandidature_document.php
@@ -167,7 +167,7 @@ if ($object->id) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php
index 70b5366aec7..d2315b1f756 100644
--- a/htdocs/recruitment/recruitmentcandidature_list.php
+++ b/htdocs/recruitment/recruitmentcandidature_list.php
@@ -338,7 +338,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
- header("Location: ".dol_buildpath('/recruitment/recruitmentcandidature_card.php', 1).'?id='.$id);
+ header("Location: ".DOL_URL_ROOT.'/recruitment/recruitmentcandidature_card.php?id='.$id);
exit;
}
diff --git a/htdocs/recruitment/recruitmentcandidature_note.php b/htdocs/recruitment/recruitmentcandidature_note.php
index 19808ca1b59..ead2df3c973 100644
--- a/htdocs/recruitment/recruitmentcandidature_note.php
+++ b/htdocs/recruitment/recruitmentcandidature_note.php
@@ -140,7 +140,7 @@ if ($id > 0 || !empty($ref)) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/recruitment/recruitmentjobposition_agenda.php b/htdocs/recruitment/recruitmentjobposition_agenda.php
index 253bf2a7e0c..4c3e642a224 100644
--- a/htdocs/recruitment/recruitmentjobposition_agenda.php
+++ b/htdocs/recruitment/recruitmentjobposition_agenda.php
@@ -184,7 +184,7 @@ if ($object->id > 0) {
$morehtmlref .= $langs->trans('Project').' ';
if ($permissiontoadd) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/recruitment/recruitmentjobposition_applications.php b/htdocs/recruitment/recruitmentjobposition_applications.php
index e5740fb203c..4295ce73284 100644
--- a/htdocs/recruitment/recruitmentjobposition_applications.php
+++ b/htdocs/recruitment/recruitmentjobposition_applications.php
@@ -148,14 +148,14 @@ if ($reshook < 0) {
if (empty($reshook)) {
$error = 0;
- $backurlforlist = dol_buildpath('/recruitment/recruitmentjobposition_list.php', 1);
+ $backurlforlist = DOL_URL_ROOT.'/recruitment/recruitmentjobposition_list.php';
if (empty($backtopage) || ($cancel && empty($id))) {
if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
$backtopage = $backurlforlist;
} else {
- $backtopage = dol_buildpath('/recruitment/recruitmentjobposition_card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
+ $backtopage = DOL_URL_ROOT.'/recruitment/recruitmentjobposition_card.php?id='.($id > 0 ? $id : '__ID__');
}
}
}
@@ -352,7 +352,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$morehtmlref .= $langs->trans('Project').' ';
if ($permissiontoadd) {
if ($action != 'classify') {
- $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' ';
+ $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' ';
}
$morehtmlref .= ' : ';
if ($action == 'classify') {
diff --git a/htdocs/recruitment/recruitmentjobposition_card.php b/htdocs/recruitment/recruitmentjobposition_card.php
index e2a848e9760..89124068ce2 100644
--- a/htdocs/recruitment/recruitmentjobposition_card.php
+++ b/htdocs/recruitment/recruitmentjobposition_card.php
@@ -379,7 +379,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$morehtmlref .= $langs->trans('Project').' ';
if ($permissiontoadd) {
if ($action != 'classify') {
- $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' ';
+ $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' ';
}
$morehtmlref .= ' : ';
if ($action == 'classify') {
@@ -466,7 +466,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($object->status == $object::STATUS_DRAFT) {
if ($permissiontoadd) {
if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) {
- print '
'.$langs->trans("Validate").' ';
+ print '
'.$langs->trans("Validate").' ';
} else {
$langs->load("errors");
print '
'.$langs->trans("Validate").' ';
@@ -505,7 +505,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Delete (need delete permission, or if draft, just need create/modify permission)
if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)) {
- print '
id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').' '."\n";
+ print '
id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').' '."\n";
} else {
print '
'.$langs->trans('Delete').' '."\n";
}
diff --git a/htdocs/recruitment/recruitmentjobposition_document.php b/htdocs/recruitment/recruitmentjobposition_document.php
index 43d80901f3d..14355aeb0e3 100644
--- a/htdocs/recruitment/recruitmentjobposition_document.php
+++ b/htdocs/recruitment/recruitmentjobposition_document.php
@@ -165,7 +165,7 @@ if ($object->id) {
$morehtmlref .= $langs->trans('Project').' ';
if ($permissiontoadd) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php
index 8f45caed040..0544cdb160f 100644
--- a/htdocs/recruitment/recruitmentjobposition_list.php
+++ b/htdocs/recruitment/recruitmentjobposition_list.php
@@ -359,7 +359,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
- header("Location: ".dol_buildpath('/recruitment/recruitmentjobposition_card.php', 1).'?id='.$id);
+ header("Location: ".DOL_URL_ROOT.'/recruitment/recruitmentjobposition_card.php?id='.$id);
exit;
}
diff --git a/htdocs/recruitment/recruitmentjobposition_note.php b/htdocs/recruitment/recruitmentjobposition_note.php
index dc7cdaef4ae..2645980f7bb 100644
--- a/htdocs/recruitment/recruitmentjobposition_note.php
+++ b/htdocs/recruitment/recruitmentjobposition_note.php
@@ -143,7 +143,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= $langs->trans('Project').' ';
if ($permissiontoadd) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php
index 88b3d0fdb03..649d69d7fb5 100644
--- a/htdocs/resource/card.php
+++ b/htdocs/resource/card.php
@@ -347,7 +347,7 @@ if ($action == 'create' || $object->fetch($id, $ref) > 0) {
// Delete resource
if ($user->rights->resource->delete) {
print '
';
}
}
diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php
index 7020beced48..a0f80d7b27c 100644
--- a/htdocs/resource/class/dolresource.class.php
+++ b/htdocs/resource/class/dolresource.class.php
@@ -974,7 +974,7 @@ class Dolresource extends CommonObject
$linkstart = '
';
$linkend = ' ';
- /*$linkstart = '
';
+ /*$linkstart = ' ';
$linkend = ' ';*/
$result .= $linkstart;
diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php
index 4d0736c5f64..4a51f1dfbb3 100644
--- a/htdocs/resource/element_resource.php
+++ b/htdocs/resource/element_resource.php
@@ -502,7 +502,7 @@ if (!$ret) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->commande->creer) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php
index 699b0ec35ba..e06f55fc523 100755
--- a/htdocs/salaries/card.php
+++ b/htdocs/salaries/card.php
@@ -628,12 +628,12 @@ if ($action == 'create') {
}
}
);
-
+
} else {
alert("'.$langs->trans("FillFieldFirst").'");
}
});
-
+
})';
print '';
}
@@ -732,7 +732,7 @@ if ($id) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->salaries->write) {
if ($action != 'classify') {
- $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
@@ -977,17 +977,17 @@ if ($id) {
if ($action != 'edit') {
// Reopen
if ($object->paye && $user->rights->salaries->write) {
- print "
";
+ print '
";
}
// Edit
if ($object->paye == 0 && $user->rights->salaries->write) {
- print "
";
+ print '
";
}
// Emit payment
if ($object->paye == 0 && ((price2num($object->amount) < 0 && price2num($resteapayer, 'MT') < 0) || (price2num($object->amount) > 0 && price2num($resteapayer, 'MT') > 0)) && $user->rights->salaries->write) {
- print "
";
+ print '
";
}
// Classify 'paid'
diff --git a/htdocs/salaries/payment_salary/card.php b/htdocs/salaries/payment_salary/card.php
index e4364f6727f..d33d04c49ff 100644
--- a/htdocs/salaries/payment_salary/card.php
+++ b/htdocs/salaries/payment_salary/card.php
@@ -248,7 +248,7 @@ print '
';
if ($action == '') {
if ($user->rights->salaries->delete) {
if (!$disable_delete) {
- print '
'.$langs->trans('Delete').' ';
+ print '
'.$langs->trans('Delete').' ';
} else {
print '
'.$langs->trans('Delete').' ';
}
diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php
index b9b2046fd90..29f8d0b175d 100644
--- a/htdocs/societe/admin/societe.php
+++ b/htdocs/societe/admin/societe.php
@@ -391,7 +391,7 @@ foreach ($arrayofmodules as $file => $modCodeTiers) {
$disabled = (!empty($conf->multicompany->enabled) && (is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity) ? true : false);
print '
';
if (!$disabled) {
- print '';
+ print ' ';
}
print img_picto($langs->trans("Disabled"), 'switch_off');
if (!$disabled) {
@@ -468,7 +468,7 @@ foreach ($arrayofmodules as $file => $modCodeCompta) {
print img_picto($langs->trans("Activated"), 'switch_on');
print ' ';
} else {
- print '
';
+ print ' ';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
}
@@ -560,7 +560,7 @@ foreach ($dirsociete as $dirroot) {
print "
\n";
//if ($conf->global->COMPANY_ADDON_PDF != "$name")
//{
- print 'scandir.'&label='.urlencode($module->name).'">';
+ print ' scandir.'&label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
//}
@@ -576,7 +576,7 @@ foreach ($dirsociete as $dirroot) {
print " ";
} else {
print '
'."\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
}
diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php
index 8169a6ca22f..7dfe7c212f2 100644
--- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php
+++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php
@@ -267,7 +267,7 @@ for ($i = 1; $i <= 4; $i++) {
use_javascript_ajax) { ?>
trans('Delete'); ?>
-
control->tpl['id'].'&action=delete&token='.newToken().'&canvas='.$canvas; ?>">trans('Delete'); ?>
+
control->tpl['id'].'&action=delete&token='.newToken().'&canvas='.$canvas; ?>">trans('Delete'); ?>
diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php
index f058d38cd7c..86c7d9c9f65 100644
--- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php
+++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php
@@ -194,7 +194,7 @@ if ($this->control->tpl['action_delete']) {
use_javascript_ajax) { ?>
trans('Delete'); ?>
-
control->tpl['id'].'&action=delete&token='.newToken().'&canvas='.$canvas; ?>">trans('Delete'); ?>
+
control->tpl['id'].'&action=delete&token='.newToken().'&canvas='.$canvas; ?>">trans('Delete'); ?>
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index 96142f65cd6..a155f08e529 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -2942,7 +2942,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) { // We can't use preloaded confirm form with jmobile
print '
'.$langs->trans('Delete').' '."\n";
} else {
- print '
id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').' '."\n";
+ print '
id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').' '."\n";
}
}
}
diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php
index 1f11e6a29c3..9574544a11a 100644
--- a/htdocs/societe/class/companypaymentmode.class.php
+++ b/htdocs/societe/class/companypaymentmode.class.php
@@ -394,7 +394,7 @@ class CompanyPaymentMode extends CommonObject
$label .= '
';
$label .= '
'.$langs->trans('Ref').': '.$this->ref;
- $url = dol_buildpath('/monmodule/companypaymentmode_card.php', 1).'?id='.$this->id;
+ $url = '';
if ($option != 'nolink') {
// Add param to save lastsearch_values or not
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 4110e59d4de..8f0e2c84805 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -2581,7 +2581,7 @@ class Societe extends CommonObject
$label .= ' ('.dol_escape_htmltag($this->name_alias).')';
}
}
- $label .= '
'.$langs->trans('Email').': '.$this->email;
+ $label .= '
'.img_picto('', 'email', 'class="pictofixedwidth"').$this->email;
if (!empty($this->phone) || !empty($this->fax)) {
$phonelist = array();
if ($this->phone) {
@@ -2590,7 +2590,7 @@ class Societe extends CommonObject
if ($this->fax) {
$phonelist[] = dol_print_phone($this->fax, $this->country_code, $this->id, 0, '', ' ', 'fax');
}
- $label .= '
'.$langs->trans('Phone').': '.implode(' ', $phonelist);
+ $label .= '
'.implode(' ', $phonelist);
}
if (!empty($this->address)) {
$label .= '
'.$langs->trans("Address").': '.dol_format_address($this, 1, ' ', $langs); // Address + country
diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php
index 8fbbbbcee6e..f73c460b4a4 100644
--- a/htdocs/societe/class/societeaccount.class.php
+++ b/htdocs/societe/class/societeaccount.class.php
@@ -392,7 +392,7 @@ class SocieteAccount extends CommonObject
$label .= '
'.$langs->trans('Login').': '.$this->ref;
//$label.= '
' . $langs->trans('WebSite') . ': ' . $this->ref;
- $url = dol_buildpath('/website/websiteaccount_card.php', 1).'?id='.$this->id;
+ $url = DOL_URL_ROOT.'/website/websiteaccount_card.php?id='.$this->id;
if ($option != 'nolink') {
// Add param to save lastsearch_values or not
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index ca4793c2c60..bc786a540d6 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -1639,7 +1639,7 @@ while ($i < min($num, $limit)) {
$titlealt = $val['label'];
}
if ($obj->stcomm_id != $val['id']) {
- print '
rowid.'&stcomm='.$val['code'].'&action=setstcomm&token='.newToken().$param.($page ? '&page='.urlencode($page) : '').'">'.img_action($titlealt, $val['code'], $val['picto']).' ';
+ print '
rowid.'&stcomm='.urlencode($val['code']).'&action=setstcomm&token='.newToken().$param.($page ? '&page='.urlencode($page) : '').'">'.img_action($titlealt, $val['code'], $val['picto']).' ';
}
}
print '
';
diff --git a/htdocs/societe/partnership.php b/htdocs/societe/partnership.php
index 295fe8b2075..85223e856f3 100644
--- a/htdocs/societe/partnership.php
+++ b/htdocs/societe/partnership.php
@@ -132,7 +132,7 @@ $date_end = dol_mktime(0, 0, 0, GETPOST('date_partnership_endmonth', 'int'), GET
if (empty($reshook)) {
$error = 0;
- $backtopage = dol_buildpath('/partnership/partnership.php', 1).'?id='.($id > 0 ? $id : '__ID__');
+ $backtopage = DOL_URL_ROOT.'/partnership/partnership.php?id='.($id > 0 ? $id : '__ID__');
// Actions when linking object each other
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php
index da4ca1c0cd7..dbb0e8f0553 100644
--- a/htdocs/societe/price.php
+++ b/htdocs/societe/price.php
@@ -620,11 +620,11 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
print img_info();
print '';
print ' ';
- print '
id.'&lineid='.$line->id.'">';
+ print ' id.'&lineid='.$line->id.'">';
print img_edit('default', 0, 'style="vertical-align: middle;"');
print ' ';
print ' ';
- print '
id.'&lineid='.$line->id.'">';
+ print ' id.'&lineid='.$line->id.'">';
print img_delete('default', 'style="vertical-align: middle;"');
print ' ';
print '';
diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index b00e5954e6d..bc677f29f53 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -1463,7 +1463,7 @@ if ($action == 'create') {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($usercancreate) {
if ($action != 'classify') {
- $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
@@ -1848,12 +1848,12 @@ if ($action == 'create') {
// Edit
if ($object->statut == SupplierProposal::STATUS_VALIDATED && $usercancreate) {
- print '
';
+ print '
';
}
// ReOpen
if (($object->statut == SupplierProposal::STATUS_SIGNED || $object->statut == SupplierProposal::STATUS_NOTSIGNED || $object->statut == SupplierProposal::STATUS_CLOSE) && $usercanclose) {
- print '
id.'&action=reopen'.(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#reopen').'"';
+ print '';
}
@@ -1861,7 +1861,7 @@ if ($action == 'create') {
if (empty($user->socid)) {
if ($object->statut == SupplierProposal::STATUS_VALIDATED || $object->statut == SupplierProposal::STATUS_SIGNED) {
if ($usercansend) {
- print '';
+ print '';
} else {
print '';
}
@@ -1889,12 +1889,12 @@ if ($action == 'create') {
// Clone
if ($usercancreate) {
- print '';
+ print '';
}
// Delete
if (($object->statut == SupplierProposal::STATUS_DRAFT && $usercancreate) || $usercandelete) {
- print 'id.'&action=delete&token='.newToken().'"';
+ print '';
}
}
diff --git a/htdocs/supplier_proposal/contact.php b/htdocs/supplier_proposal/contact.php
index 02a4fc51966..faa9127779c 100644
--- a/htdocs/supplier_proposal/contact.php
+++ b/htdocs/supplier_proposal/contact.php
@@ -139,7 +139,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($permissiontoedit) {
if ($action != 'classify') {
- //$morehtmlref.=' ' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php
index 580c0f0974e..2795c006723 100644
--- a/htdocs/supplier_proposal/document.php
+++ b/htdocs/supplier_proposal/document.php
@@ -116,7 +116,7 @@ if ($object->id > 0) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->supplier_proposal->creer) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/supplier_proposal/info.php b/htdocs/supplier_proposal/info.php
index 80c67871e91..7d6d72276d8 100644
--- a/htdocs/supplier_proposal/info.php
+++ b/htdocs/supplier_proposal/info.php
@@ -81,7 +81,7 @@ if (!empty($conf->projet->enabled)) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->supplier_proposal->creer) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/supplier_proposal/note.php b/htdocs/supplier_proposal/note.php
index c4ab85e8e20..6466c6f42cb 100644
--- a/htdocs/supplier_proposal/note.php
+++ b/htdocs/supplier_proposal/note.php
@@ -110,7 +110,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->supplier_proposal->creer) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php b/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php
index c33c3b2ebac..d0fce33ed22 100644
--- a/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php
@@ -53,7 +53,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
echo price($objectlink->total_ht);
} ?>
getLibStatut(3); ?>
-
id.'&action=dellink&dellinkid='.$key; ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
+
id.'&action=dellink&token='.newToken().'&dellinkid='.$key; ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
global->TAKEPOS_REF_ADDON == "$file") {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
- print '
';
+ print ' ';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
}
diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php
index ed52280a8f4..858531e97a1 100644
--- a/htdocs/takepos/index.php
+++ b/htdocs/takepos/index.php
@@ -999,36 +999,39 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
query($sql);
-$paiementsModes = array();
-if ($resql) {
- while ($obj = $db->fetch_object($resql)) {
- $paycode = $obj->code;
- if ($paycode == 'LIQ') {
- $paycode = 'CASH';
- }
- if ($paycode == 'CHQ') {
- $paycode = 'CHEQUE';
- }
+ $resql = $db->query($sql);
+ $paiementsModes = array();
+ if ($resql) {
+ while ( $obj = $db->fetch_object($resql) ) {
+ $paycode = $obj->code;
+ if ($paycode == 'LIQ') {
+ $paycode = 'CASH';
+ }
+ if ($paycode == 'CHQ') {
+ $paycode = 'CHEQUE';
+ }
- $constantforkey = "CASHDESK_ID_BANKACCOUNT_".$paycode.$_SESSION["takeposterminal"];
- //var_dump($constantforkey.' '.$conf->global->$constantforkey);
- if (!empty($conf->global->$constantforkey) && $conf->global->$constantforkey > 0) {
- array_push($paiementsModes, $obj);
+ $constantforkey = "CASHDESK_ID_BANKACCOUNT_" . $paycode . $_SESSION["takeposterminal"];
+ //var_dump($constantforkey.' '.$conf->global->$constantforkey);
+ if ( ! empty($conf->global->$constantforkey) && $conf->global->$constantforkey > 0) {
+ array_push($paiementsModes, $obj);
+ }
}
}
+
+ if (empty($paiementsModes)) {
+ $langs->load('errors');
+ setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("TakePOS")), null, 'errors');
+ setEventMessages($langs->trans("ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"]), null, 'errors');
+ }
}
-if (empty($paiementsModes)) {
- $langs->load('errors');
- setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("TakePOS")), null, 'errors');
- setEventMessages($langs->trans("ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"]), null, 'errors');
-}
if (count($maincategories) == 0) {
if ($conf->global->TAKEPOS_ROOT_CATEGORY_ID > 0) {
$tmpcategory = new Categorie($db);
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php
index 520fe8dccdb..ae12665e008 100644
--- a/htdocs/takepos/invoice.php
+++ b/htdocs/takepos/invoice.php
@@ -188,11 +188,9 @@ if ($action == 'valid' && $user->rights->facture->creer) {
if (!empty($conf->global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) {
$bankaccount = GETPOST('accountid', 'int');
} else {
- if ($pay == "cash") {
+ if ($pay == 'LIQ') {
$bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]}; // For backward compatibility
- } elseif ($pay == "card") {
- $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$_SESSION["takeposterminal"]}; // For backward compatibility
- } elseif ($pay == "cheque") {
+ } elseif ($pay == "CHQ") {
$bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]}; // For backward compatibility
} else {
$accountname = "CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takeposterminal"];
diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php
index 773118e670f..51744ce0528 100644
--- a/htdocs/takepos/pay.php
+++ b/htdocs/takepos/pay.php
@@ -330,23 +330,20 @@ print '
'.(!empty($payIcon) ? ' '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code)).' ';
+ print '
'.(!empty($payIcon) ? ' '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code)).' ';
} else {
print '
'.$langs->trans("NoPaimementModesDefined").' ';
}
@@ -359,23 +356,20 @@ print '
'.(!empty($payIcon) ? ' '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code)).' ';
+ print '
'.(!empty($payIcon) ? ' '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code)).' ';
} else {
$button = array_pop($action_buttons);
print '
'.$button["text"].' ';
@@ -389,23 +383,20 @@ print '
'.(!empty($payIcon) ? ' '.(!empty($conf->global->TAKEPOS_NUMPAD_FORCE_PAYMENT_ICONS_LABELS) ? ' '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code) : '') : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code)).' ';
+ print '
'.(!empty($payIcon) ? ' '.(!empty($conf->global->TAKEPOS_NUMPAD_FORCE_PAYMENT_ICONS_LABELS) ? ' '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code) : '') : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code)).' ';
} else {
$button = array_pop($action_buttons);
print '
'.$button["text"].' ';
diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php
index fee91e959aa..9acf76b30c2 100644
--- a/htdocs/ticket/agenda.php
+++ b/htdocs/ticket/agenda.php
@@ -190,7 +190,7 @@ if (!empty($conf->projet->enabled)) {
$morehtmlref .= '
'.$langs->trans('Project');
if ($user->rights->ticket->write) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
@@ -217,7 +217,7 @@ if (!empty($conf->projet->enabled)) {
$morehtmlref .= '
';
-$linkback = ' '.$langs->trans("BackToList").' ';
+$linkback = '
'.$langs->trans("BackToList").' ';
dol_banner_tab($object, 'ref', $linkback, ($user->socid ? 0 : 1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php
index e7a00699733..f91fe4f01b3 100644
--- a/htdocs/ticket/card.php
+++ b/htdocs/ticket/card.php
@@ -532,7 +532,7 @@ if (empty($reshook)) {
}
}
- if ($action == 'setsubject') {
+ if ($action == 'setsubject' && $user->rights->ticket->write) {
if ($object->fetch(GETPOST('id', 'int'))) {
if ($action == 'setsubject') {
$object->subject = GETPOST('subject', 'alphanohtml');
@@ -946,7 +946,7 @@ if ($action == 'create' || $action == 'presend') {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->ticket->write) {
if ($action != 'classify') {
- $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' ';
+ $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' ';
}
$morehtmlref .= ' : ';
if ($action == 'classify') {
@@ -1340,28 +1340,28 @@ if ($action == 'create' || $action == 'presend') {
print '
';
}
if ($object->fk_soc > 0 && $object->fk_statut < Ticket::STATUS_CLOSED && $user->rights->ficheinter->creer) {
- print '
';
+ print '
';
}
/* This is useless. We can already modify each field individually
if ($user->rights->ticket->write && $object->fk_statut < Ticket::STATUS_CLOSED) {
- print '
';
+ print '
';
}
*/
// Close ticket if statut is read
if ($object->fk_statut > 0 && $object->fk_statut < Ticket::STATUS_CLOSED && $user->rights->ticket->write) {
- print '
';
+ print '
';
}
// Abadon ticket if statut is read
if ($object->fk_statut > 0 && $object->fk_statut < Ticket::STATUS_CLOSED && $user->rights->ticket->write) {
- print '
';
+ print '
';
}
// Re-open ticket
if (!$user->socid && ($object->fk_statut == Ticket::STATUS_CLOSED || $object->fk_statut == Ticket::STATUS_CANCELED) && !$user->socid) {
- print '
';
+ print '
';
}
// Delete ticket
diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php
index ea273064840..874036a5c38 100644
--- a/htdocs/ticket/class/ticket.class.php
+++ b/htdocs/ticket/class/ticket.class.php
@@ -1344,7 +1344,7 @@ class Ticket extends CommonObject
$label .= '
'.$langs->trans('TicketTrackId').': '.$this->track_id.'
';
$label .= '
'.$langs->trans('Subject').': '.$this->subject;
- $url = dol_buildpath('/ticket/card.php', 1).'?id='.$this->id;
+ $url = DOL_URL_ROOT.'/ticket/card.php?id='.$this->id;
if ($option != 'nolink') {
// Add param to save lastsearch_values or not
diff --git a/htdocs/ticket/contact.php b/htdocs/ticket/contact.php
index 8d450ffb44b..dbd553f9c1f 100644
--- a/htdocs/ticket/contact.php
+++ b/htdocs/ticket/contact.php
@@ -52,7 +52,7 @@ $lineid = GETPOST('lineid', 'int');
// Store current page url
-$url_page_current = dol_buildpath('/ticket/contact.php', 1);
+$url_page_current = DOL_URL_ROOT.'/ticket/contact.php';
$object = new Ticket($db);
@@ -192,7 +192,7 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->ticket->write) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php
index d534e8a1123..8b45b8ebbf7 100644
--- a/htdocs/ticket/document.php
+++ b/htdocs/ticket/document.php
@@ -161,7 +161,7 @@ if ($object->id) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->ticket->write) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php
index 4b048d54671..aeab9ac6e27 100644
--- a/htdocs/ticket/list.php
+++ b/htdocs/ticket/list.php
@@ -159,7 +159,7 @@ if (!$user->rights->ticket->read) {
}
// Store current page url
-$url_page_current = dol_buildpath('/ticket/list.php', 1);
+$url_page_current = DOL_URL_ROOT.'/ticket/list.php';
if ($project_ref) {
$tmpproject = new Project($db);
diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php
index 68615424abf..365376f0add 100644
--- a/htdocs/ticket/messaging.php
+++ b/htdocs/ticket/messaging.php
@@ -188,7 +188,7 @@ if (!empty($conf->projet->enabled)) {
$morehtmlref .= '
'.$langs->trans('Project');
if ($user->rights->ticket->write) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
@@ -215,7 +215,7 @@ if (!empty($conf->projet->enabled)) {
$morehtmlref .= '
';
-$linkback = '
'.$langs->trans("BackToList").' ';
+$linkback = '
'.$langs->trans("BackToList").' ';
dol_banner_tab($object, 'ref', $linkback, ($user->socid ? 0 : 1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
@@ -248,7 +248,7 @@ if (!empty($object->id)) {
// Show link to add event (if read and not closed)
$btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage";
- $url = dol_buildpath('/comm/action/card.php', 1).'?action=create&datep='.date('YmdHi').'&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id);
+ $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.date('YmdHi').'&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id);
$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, 'add-new-ticket-even-button', $btnstatus);
diff --git a/htdocs/ticket/tpl/linkedobjectblock.tpl.php b/htdocs/ticket/tpl/linkedobjectblock.tpl.php
index 17da4cd2db5..51c2cbfb7fd 100644
--- a/htdocs/ticket/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/ticket/tpl/linkedobjectblock.tpl.php
@@ -65,7 +65,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
// For now, shipments must stay linked to order, so link is not deletable
if ($object->element != 'shipping') {
?>
-
id.'&action=dellink&dellinkid='.$key; ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
+
id.'&action=dellink&token='.newToken().'&dellinkid='.$key; ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 649b8b55502..2dbc2a3f020 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -663,26 +663,103 @@ class User extends CommonObject
* You can use it like this: if ($user->hasRight('module', 'level11')).
* It replaces old syntax: if ($user->rights->module->level1)
*
- * @param int $module Id of permission to add or 0 to add several permissions
- * @param string $permlevel1 Permission level1
+ * @param int $module Module of permission to check
+ * @param string $permlevel1 Permission level1 (Example: 'read', 'write', 'delete')
* @param string $permlevel2 Permission level2
* @return int 1 if user has permission, 0 if not.
* @see clearrights(), delrights(), getrights(), hasRight()
*/
public function hasRight($module, $permlevel1, $permlevel2 = '')
{
+ global $conf;
+
+ // For compatibility with bad naming permissions on module
+ $moduletomoduletouse = array(
+ 'contract' => 'contrat',
+ 'member' => 'adherent', // We must check $user->rights->adherent...
+ 'mo' => 'mrp',
+ 'order' => 'commande',
+ 'product' => 'produit', // We must check $user->rights->produit...
+ 'project' => 'projet',
+ 'shipping' => 'expedition',
+ 'task' => 'task@projet',
+ 'fichinter' => 'ficheinter',
+ 'invoice' => 'facture',
+ 'invoice_supplier' => 'fournisseur',
+ 'knowledgerecord' => 'knowledgerecord@knowledgemanagement'
+ );
+ if (!empty($moduletomoduletouse[$module])) {
+ $module = $moduletomoduletouse[$module];
+ }
+
+ // If module is abc@module, we check permission user->rights->module->abc->permlevel1
+ $tmp = explode('@', $module, 2);
+ if (! empty($tmp[1])) {
+ $module = $tmp[1];
+ $permlevel2 = $permlevel1;
+ $permlevel1 = $tmp[0];
+ }
+
+ //var_dump($module);
+ //var_dump($this->rights->$module);
+ if (!in_array($module, $conf->modules)) {
+ return 0;
+ }
+
+ // For compatibility with bad naming permissions on permlevel1
+ if ($permlevel1 == 'propale') {
+ $permlevel1 = 'propal';
+ }
+ if ($permlevel1 == 'member') {
+ $permlevel1 = 'adherent';
+ }
+ if ($permlevel1 == 'recruitmentcandidature') {
+ $permlevel1 = 'recruitmentjobposition';
+ }
+
+ //var_dump($module.' '.$permlevel1.' '.$permlevel2);
if (empty($module) || empty($this->rights) || empty($this->rights->$module) || empty($permlevel1)) {
return 0;
}
if ($permlevel2) {
- if (!empty($this->rights->$module->$permlevel1) && !empty($this->rights->$module->$permlevel1->$permlevel2)) {
- return $this->rights->$module->$permlevel1->$permlevel2;
+ if (!empty($this->rights->$module->$permlevel1)) {
+ if (!empty($this->rights->$module->$permlevel1->$permlevel2)) {
+ return $this->rights->$module->$permlevel1->$permlevel2;
+ }
+ // For backward compatibility with old permissions called "lire", "creer", "create", "supprimer"
+ // instead of "read", "write", "delete"
+ if ($permlevel2 == 'read' && !empty($this->rights->$module->$permlevel1->lire)) {
+ return $this->rights->$module->lire;
+ }
+ if ($permlevel2 == 'write' && !empty($this->rights->$module->$permlevel1->creer)) {
+ return $this->rights->$module->create;
+ }
+ if ($permlevel2 == 'write' && !empty($this->rights->$module->$permlevel1->create)) {
+ return $this->rights->$module->create;
+ }
+ if ($permlevel2 == 'delete' && !empty($this->rights->$module->$permlevel1->supprimer)) {
+ return $this->rights->$module->supprimer;
+ }
}
} else {
if (!empty($this->rights->$module->$permlevel1)) {
return $this->rights->$module->$permlevel1;
}
+ // For backward compatibility with old permissions called "lire", "creer", "create", "supprimer"
+ // instead of "read", "write", "delete"
+ if ($permlevel1 == 'read' && !empty($this->rights->$module->lire)) {
+ return $this->rights->$module->lire;
+ }
+ if ($permlevel1 == 'write' && !empty($this->rights->$module->creer)) {
+ return $this->rights->$module->create;
+ }
+ if ($permlevel1 == 'write' && !empty($this->rights->$module->create)) {
+ return $this->rights->$module->create;
+ }
+ if ($permlevel1 == 'delete' && !empty($this->rights->$module->supprimer)) {
+ return $this->rights->$module->supprimer;
+ }
}
return 0;
diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php
index 186d8463549..4fb9c51644f 100644
--- a/htdocs/user/group/card.php
+++ b/htdocs/user/group/card.php
@@ -96,7 +96,7 @@ if (empty($reshook)) {
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
$backtopage = $backurlforlist;
} else {
- $backtopage = dol_buildpath('/user/group/card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
+ $backtopage = DOL_URL_ROOT.'/user/group/card.php?id='.($id > 0 ? $id : '__ID__');
}
}
}
@@ -380,11 +380,11 @@ if ($action == 'create') {
}
if ($caneditperms) {
- print '
'.$langs->trans("Modify").' ';
+ print '
'.$langs->trans("Modify").' ';
}
if ($candisableperms) {
- print '
'.$langs->trans("DeleteGroup").' ';
+ print '
'.$langs->trans("DeleteGroup").' ';
}
print "
\n";
diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php
index e2c419b0543..46506163c1f 100644
--- a/htdocs/user/group/perms.php
+++ b/htdocs/user/group/perms.php
@@ -332,7 +332,7 @@ if ($object->id > 0) {
if (in_array($obj->id, $permsgroupbyentity[$entity])) {
// Own permission by group
if ($caneditperms) {
- print 'id.'&action=delrights&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&token='.newToken().'">';
+ print ' id.'&action=delrights&token='.newToken().'&entity='.$entity.'&rights='.$obj->id.'&confirm=yes">';
//print img_edit_remove($langs->trans("Remove"));
print img_picto($langs->trans("Remove"), 'switch_on');
print ' ';
@@ -343,7 +343,7 @@ if ($object->id > 0) {
} else {
// Do not own permission
if ($caneditperms) {
- print 'id.'&action=addrights&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&token='.newToken().'">';
+ print ' id.'&action=addrights&token='.newToken().'&entity='.$entity.'&rights='.$obj->id.'&confirm=yes">';
//print img_edit_add($langs->trans("Add"));
print img_picto($langs->trans("Add"), 'switch_off');
print ' ';
diff --git a/htdocs/user/list.php b/htdocs/user/list.php
index 89f9191751b..e302a0fac85 100644
--- a/htdocs/user/list.php
+++ b/htdocs/user/list.php
@@ -371,7 +371,7 @@ if ($search_supervisor > 0) {
if ($search_thirdparty != '') {
$sql .= natural_search(array('s.nom'), $search_thirdparty);
}
-if ($search_warehouse != '') {
+if ($search_warehouse > 0) {
$sql .= natural_search(array('u.fk_warehouse'), $search_warehouse);
}
if ($search_login != '') {
diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php
index 5ff285972df..48cbad46799 100644
--- a/htdocs/user/notify/card.php
+++ b/htdocs/user/notify/card.php
@@ -337,7 +337,7 @@ if ($result > 0) {
print $langs->trans("SMS");
}
print '';
- print ''.img_delete().' ';
+ print ''.img_delete().' ';
print '';
$i++;
}
diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php
index 391682b2d6d..7c7fe868b2f 100644
--- a/htdocs/user/perms.php
+++ b/htdocs/user/perms.php
@@ -279,9 +279,9 @@ print ''.$langs->trans("Module").' ';
if (($caneditperms && empty($objMod->rights_admin_allowed)) || empty($object->admin)) {
if ($caneditperms) {
print '';
- print 'id.'&action=addrights&entity='.$entity.'&module=allmodules&confirm=yes&token='.newToken().'">'.$langs->trans("All")." ";
+ print 'id.'&action=addrights&token='.newToken().'&entity='.$entity.'&module=allmodules&confirm=yes">'.$langs->trans("All")." ";
print ' / ';
- print 'id.'&action=delrights&entity='.$entity.'&module=allmodules&confirm=yes&token='.newToken().'">'.$langs->trans("None")." ";
+ print 'id.'&action=delrights&token='.newToken().'&entity='.$entity.'&module=allmodules&confirm=yes">'.$langs->trans("None")." ";
print ' ';
}
print ' ';
@@ -359,9 +359,9 @@ if ($result) {
if (($caneditperms && empty($objMod->rights_admin_allowed)) || empty($object->admin)) {
if ($caneditperms) {
print '';
- print 'id.'&action=addrights&entity='.$entity.'&module='.$obj->module.'&confirm=yes&token='.newToken().'">'.$langs->trans("All")." ";
+ print 'id.'&action=addrights&token='.newToken().'&entity='.$entity.'&module='.$obj->module.'&confirm=yes">'.$langs->trans("All")." ";
print ' / ';
- print 'id.'&action=delrights&entity='.$entity.'&module='.$obj->module.'&confirm=yes&token='.newToken().'">'.$langs->trans("None")." ";
+ print 'id.'&action=delrights&token='.newToken().'&entity='.$entity.'&module='.$obj->module.'&confirm=yes">'.$langs->trans("None")." ";
print ' ';
}
print ' ';
@@ -399,7 +399,7 @@ if ($result) {
print '';
} elseif (in_array($obj->id, $permsuser)) { // Permission granted by user
if ($caneditperms) {
- print 'id.'&action=delrights&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&token='.newToken().'">';
+ print ' id.'&action=delrights&token='.newToken().'&entity='.$entity.'&rights='.$obj->id.'&confirm=yes">';
//print img_edit_remove($langs->trans("Remove"));
print img_picto($langs->trans("Remove"), 'switch_on');
print ' ';
diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php
index c29fc519258..a3ad036ca9a 100644
--- a/htdocs/variants/combinations.php
+++ b/htdocs/variants/combinations.php
@@ -888,7 +888,7 @@ if (!empty($id) || !empty($ref)) {
print ''.$prodstatic->getLibStatut(2, 0).' ';
print ''.$prodstatic->getLibStatut(2, 1).' ';
print '';
- print 'id.'">'.img_edit().' ';
+ print 'id.'">'.img_edit().' ';
print 'id.'">'.img_delete().' ';
print ' ';
print '';
diff --git a/htdocs/website/index.php b/htdocs/website/index.php
index 5d941d0564b..62b024047e4 100644
--- a/htdocs/website/index.php
+++ b/htdocs/website/index.php
@@ -3123,7 +3123,7 @@ if (!GETPOST('hide_websitemenu')) {
print ''; // end websitetools
print '';
- if (GETPOST('editsource', 'alpha') || GETPOST('editcontent', 'alpha')) {
+ if ($action == 'editsource' || $action == 'editcontent' || GETPOST('editsource', 'alpha') || GETPOST('editcontent', 'alpha')) {
$url = 'https://wiki.dolibarr.org/index.php/Module_Website';
$htmltext = $langs->transnoentitiesnoconv("YouCanEditHtmlSource", $url);
diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php
index 398affc8cb2..ac035127f14 100644
--- a/htdocs/website/websiteaccount_card.php
+++ b/htdocs/website/websiteaccount_card.php
@@ -230,7 +230,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{
if ($action != 'classify')
{
- $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='';
@@ -344,7 +344,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
- $somethingshown = $formactions->showactions($object, 'websiteaccount', $socid, 1, '', $MAXEVENT);
+ $somethingshown = $formactions->showactions($object, $object->element, $socid, 1, '', $MAXEVENT);
*/
print '';
diff --git a/htdocs/workstation/workstation_agenda.php b/htdocs/workstation/workstation_agenda.php
index 682431d7c8a..a3204e76459 100755
--- a/htdocs/workstation/workstation_agenda.php
+++ b/htdocs/workstation/workstation_agenda.php
@@ -154,7 +154,7 @@ if ($object->id > 0) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/workstation/workstation_card.php b/htdocs/workstation/workstation_card.php
index 0cf0f628492..8bf2dc48e2d 100755
--- a/htdocs/workstation/workstation_card.php
+++ b/htdocs/workstation/workstation_card.php
@@ -345,7 +345,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project') . ' ';
if ($permissiontoadd) {
- //if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
+ //if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
$morehtmlref .= ' : ';
if ($action == 'classify') {
//$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/workstation/workstation_document.php b/htdocs/workstation/workstation_document.php
index b33be2818dc..7c5d654a7d9 100755
--- a/htdocs/workstation/workstation_document.php
+++ b/htdocs/workstation/workstation_document.php
@@ -118,7 +118,7 @@ if ($object->id) {
// Object card
// ------------------------------------------------------------
- $linkback = ''.$langs->trans("BackToList").' ';
+ $linkback = ''.$langs->trans("BackToList").' ';
$morehtmlref = '';
/*
@@ -135,7 +135,7 @@ if ($object->id) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php
index b395c5e5a1b..b5a27aeb1e2 100755
--- a/htdocs/workstation/workstation_list.php
+++ b/htdocs/workstation/workstation_list.php
@@ -345,7 +345,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
- header("Location: ".dol_buildpath('/workstation/workstation_card.php', 1).'?id='.$id);
+ header("Location: ".DOL_URL_ROOT.'/workstation/workstation_card.php?id='.$id);
exit;
}
diff --git a/htdocs/workstation/workstation_note.php b/htdocs/workstation/workstation_note.php
index 7e1b765bf82..ebe8d99af16 100755
--- a/htdocs/workstation/workstation_note.php
+++ b/htdocs/workstation/workstation_note.php
@@ -96,7 +96,7 @@ if ($id > 0 || !empty($ref)) {
// Object card
// ------------------------------------------------------------
- $linkback = '
'.$langs->trans("BackToList").' ';
+ $linkback = '
'.$langs->trans("BackToList").' ';
$morehtmlref = '
';
/*
@@ -113,7 +113,7 @@ if ($id > 0 || !empty($ref)) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php
index b27959a24c6..5d0155885c2 100644
--- a/htdocs/zapier/class/hook.class.php
+++ b/htdocs/zapier/class/hook.class.php
@@ -516,7 +516,7 @@ class Hook extends CommonObject
$label .= '
';
$label .= '
'.$langs->trans('Ref').': '.$this->ref;
- $url = dol_buildpath('/zapier/hook_card.php', 1).'?id='.$this->id;
+ $url = DOL_URL_ROOT.'/zapier/hook_card.php?id='.$this->id;
if ($option != 'nolink') {
// Add param to save lastsearch_values or not