forked from Wavyzz/dolibarr
Merge branch 'develop' of github.com:Dolibarr/dolibarr into develop#1
This commit is contained in:
@@ -542,7 +542,7 @@ $cfg['ThemePerServer'] = FALSE; // allow diferent theme for each co
|
||||
* %f will be replaced by a list of field names.
|
||||
* (%t and %f only applies to DefaultQueryTable)
|
||||
*/
|
||||
$cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1';
|
||||
$cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1 = 1';
|
||||
$cfg['DefaultQueryDatabase'] = '';
|
||||
|
||||
/**
|
||||
|
||||
@@ -100,7 +100,7 @@ $hookmanager->initHooks(array('admin'));
|
||||
// Put here declaration of dictionaries properties
|
||||
|
||||
// Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this.
|
||||
$taborder = array(9, 0, 4, 3, 2, 0, 1, 8, 19, 16, 39, 27, 40, 38, 0, 5, 11, 0, 32, 33, 34, 0, 6, 0, 29, 0, 7, 24, 28, 17, 35, 36, 0, 10, 23, 12, 13, 0, 14, 0, 22, 20, 18, 21, 41, 0, 15, 30, 0, 37, 42, 0, 25, 0);
|
||||
$taborder = array(9, 0, 4, 3, 2, 0, 1, 8, 19, 16, 39, 27, 40, 38, 0, 5, 11, 0, 6, 0, 29, 0, 33, 34, 32, 24, 28, 17, 35, 36, 0, 10, 23, 12, 13, 7, 0, 14, 0, 22, 20, 18, 21, 41, 0, 15, 30, 0, 37, 42, 0, 25, 0, 43, 0);
|
||||
|
||||
// Name of SQL tables of dictionaries
|
||||
$tabname = array();
|
||||
@@ -146,6 +146,7 @@ $tabname[39] = MAIN_DB_PREFIX."c_prospectcontactlevel";
|
||||
$tabname[40] = MAIN_DB_PREFIX."c_stcommcontact";
|
||||
$tabname[41] = MAIN_DB_PREFIX."c_transport_mode";
|
||||
$tabname[42] = MAIN_DB_PREFIX."c_product_nature";
|
||||
$tabname[43] = MAIN_DB_PREFIX."c_productbatch_qcstatus";
|
||||
|
||||
// Dictionary labels
|
||||
$tablib = array();
|
||||
@@ -191,6 +192,7 @@ $tablib[39] = "DictionaryProspectContactLevel";
|
||||
$tablib[40] = "DictionaryProspectContactStatus";
|
||||
$tablib[41] = "DictionaryTransportMode";
|
||||
$tablib[42] = "DictionaryProductNature";
|
||||
$tablib[43] = "DictionaryBatchStatus";
|
||||
|
||||
// Requests to extract data
|
||||
$tabsql = array();
|
||||
@@ -236,6 +238,7 @@ $tabsql[39] = "SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_P
|
||||
$tabsql[40] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcommcontact";
|
||||
$tabsql[41] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_transport_mode";
|
||||
$tabsql[42] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_product_nature";
|
||||
$tabsql[43] = "SELECT rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_productbatch_qcstatus";
|
||||
|
||||
// Criteria to sort dictionaries
|
||||
$tabsqlsort = array();
|
||||
@@ -281,6 +284,7 @@ $tabsqlsort[39] = "sortorder ASC";
|
||||
$tabsqlsort[40] = "code ASC";
|
||||
$tabsqlsort[41] = "code ASC";
|
||||
$tabsqlsort[42] = "code ASC";
|
||||
$tabsqlsort[43] = "code ASC";
|
||||
|
||||
// Field names in select result for dictionary display
|
||||
$tabfield = array();
|
||||
@@ -326,6 +330,7 @@ $tabfield[39] = "code,libelle,sortorder";
|
||||
$tabfield[40] = "code,libelle,picto";
|
||||
$tabfield[41] = "code,label";
|
||||
$tabfield[42] = "code,label";
|
||||
$tabfield[43] = "code,label";
|
||||
|
||||
// Edit field names for editing a record
|
||||
$tabfieldvalue = array();
|
||||
@@ -371,6 +376,7 @@ $tabfieldvalue[39] = "code,libelle,sortorder";
|
||||
$tabfieldvalue[40] = "code,libelle,picto";
|
||||
$tabfieldvalue[41] = "code,label";
|
||||
$tabfieldvalue[42] = "code,label";
|
||||
$tabfieldvalue[43] = "code,label";
|
||||
|
||||
// Field names in the table for inserting a record
|
||||
$tabfieldinsert = array();
|
||||
@@ -417,6 +423,7 @@ $tabfieldinsert[39] = "code,label,sortorder";
|
||||
$tabfieldinsert[40] = "code,libelle,picto";
|
||||
$tabfieldinsert[41] = "code,label";
|
||||
$tabfieldinsert[42] = "code,label";
|
||||
$tabfieldinsert[43] = "code,label";
|
||||
|
||||
// Rowid name of field depending if field is autoincrement on or off..
|
||||
// Use "" if id field is "rowid" and has autoincrement on
|
||||
@@ -464,6 +471,7 @@ $tabrowid[39] = "code";
|
||||
$tabrowid[40] = "id";
|
||||
$tabrowid[41] = "";
|
||||
$tabrowid[42] = "rowid";
|
||||
$tabrowid[43] = "rowid";
|
||||
|
||||
// Condition to show dictionary in setup page
|
||||
$tabcond = array();
|
||||
@@ -509,6 +517,7 @@ $tabcond[39] = (!empty($conf->societe->enabled) && empty($conf->global->SOCIETE_
|
||||
$tabcond[40] = (!empty($conf->societe->enabled) && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES));
|
||||
$tabcond[41] = !empty($conf->intracommreport->enabled);
|
||||
$tabcond[42] = !empty($conf->product->enabled);
|
||||
$tabcond[43] = !empty($conf->product->enabled) && !empty($conf->productbatch->enabled) && $conf->global->MAIN_FEATURES_LEVEL >= 2;
|
||||
|
||||
// List of help for fields
|
||||
$tabhelp = array();
|
||||
@@ -554,55 +563,58 @@ $tabhelp[39] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
$tabhelp[40] = array('code'=>$langs->trans("EnterAnyCode"), 'picto'=>$langs->trans("PictoHelp"));
|
||||
$tabhelp[41] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
$tabhelp[42] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
$tabhelp[43] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
|
||||
// Table to store complete informations (will replace all other table). Key is table name.
|
||||
$tabcomplete = array(
|
||||
'c_forme_juridique'=>array('picto'=>'company'),
|
||||
'c_departements'=>array('picto'=>'country'),
|
||||
'c_regions'=>array('picto'=>'country'),
|
||||
'c_country'=>array('picto'=>'country'),
|
||||
'c_civility'=>array('picto'=>'contact'),
|
||||
'c_actioncomm'=>array('picto'=>'action'),
|
||||
'c_chargesociales'=>array('picto'=>'bill'),
|
||||
'c_typent'=>array('picto'=>'company'),
|
||||
'c_currencies'=>array('picto'=>'multicurrency'),
|
||||
'c_tva'=>array('picto'=>'bill'),
|
||||
'c_type_contact'=>array('picto'=>'contact'),
|
||||
'c_payment_term'=>array('picto'=>'bill'),
|
||||
'c_paiement'=>array('picto'=>'bill'),
|
||||
'c_ecotaxe'=>array('picto'=>'bill'),
|
||||
'c_paper_format'=>array('picto'=>'generic'),
|
||||
'c_prospectlevel'=>array('picto'=>'company'),
|
||||
'c_type_fees'=>array('picto'=>'trip'),
|
||||
'c_effectif'=>array('picto'=>'company'),
|
||||
'c_input_method'=>array('picto'=>'order'),
|
||||
'c_input_reason'=>array('picto'=>'order'),
|
||||
'c_availability'=>array('picto'=>'shipment'),
|
||||
'c_shipment_mode'=>array('picto'=>'shipment'),
|
||||
'c_revenuestamp'=>array('picto'=>'bill'),
|
||||
'c_type_resource'=>array('picto'=>'resource'),
|
||||
'c_type_container'=>array('picto'=>'website'),
|
||||
'c_stcomm'=>array('picto'=>'company'),
|
||||
'c_holiday_types'=>array('picto'=>'holiday'),
|
||||
'c_lead_status'=>array('picto'=>'project'),
|
||||
'c_format_cards'=>array('picto'=>'generic'),
|
||||
'c_hrm_public_holiday'=>array('picto'=>'holiday'),
|
||||
'c_hrm_department'=>array('picto'=>'hrm'),
|
||||
'c_hrm_function'=>array('picto'=>'hrm'),
|
||||
'c_exp_tax_cat'=>array('picto'=>'expensereport'),
|
||||
'c_exp_tax_range'=>array('picto'=>'expensereport'),
|
||||
'c_units'=>array('picto'=>'product'),
|
||||
'c_socialnetworks'=>array('picto'=>'share-alt'),
|
||||
'c_product_nature'=>array('picto'=>'product'),
|
||||
'c_transport_mode'=>array('picto'=>'incoterm'),
|
||||
'c_prospectcontactlevel'=>array('picto'=>'company'),
|
||||
'c_stcommcontact'=>array('picto'=>'company'),
|
||||
'c_product_nature'=>array('picto'=>'product'),
|
||||
'c_productbatch_qcstatus'=>array('picto'=>'batch'),
|
||||
|
||||
);
|
||||
|
||||
// List of check for fields (NOT USED YET)
|
||||
$tabfieldcheck = array();
|
||||
$tabfieldcheck[1] = array();
|
||||
$tabfieldcheck[2] = array();
|
||||
$tabfieldcheck[3] = array();
|
||||
$tabfieldcheck[4] = array();
|
||||
$tabfieldcheck[5] = array();
|
||||
$tabfieldcheck[6] = array();
|
||||
$tabfieldcheck[7] = array();
|
||||
$tabfieldcheck[8] = array();
|
||||
$tabfieldcheck[9] = array();
|
||||
$tabfieldcheck[10] = array();
|
||||
$tabfieldcheck[11] = array();
|
||||
$tabfieldcheck[12] = array();
|
||||
$tabfieldcheck[13] = array();
|
||||
$tabfieldcheck[14] = array();
|
||||
$tabfieldcheck[15] = array();
|
||||
$tabfieldcheck[16] = array();
|
||||
$tabfieldcheck[17] = array();
|
||||
$tabfieldcheck[18] = array();
|
||||
$tabfieldcheck[19] = array();
|
||||
$tabfieldcheck[20] = array();
|
||||
$tabfieldcheck[21] = array();
|
||||
$tabfieldcheck[22] = array();
|
||||
$tabfieldcheck[23] = array();
|
||||
$tabfieldcheck[24] = array();
|
||||
$tabfieldcheck[25] = array();
|
||||
//$tabfieldcheck[26] = array();
|
||||
$tabfieldcheck[27] = array();
|
||||
$tabfieldcheck[28] = array();
|
||||
$tabfieldcheck[29] = array();
|
||||
$tabfieldcheck[30] = array();
|
||||
//$tabfieldcheck[31] = array();
|
||||
$tabfieldcheck[32] = array();
|
||||
$tabfieldcheck[33] = array();
|
||||
$tabfieldcheck[34] = array();
|
||||
$tabfieldcheck[35] = array();
|
||||
$tabfieldcheck[36] = array();
|
||||
$tabfieldcheck[37] = array();
|
||||
$tabfieldcheck[38] = array();
|
||||
$tabfieldcheck[39] = array();
|
||||
$tabfieldcheck[40] = array();
|
||||
$tabfieldcheck[41] = array();
|
||||
$tabfieldcheck[42] = array();
|
||||
|
||||
// Complete all arrays with entries found into modules
|
||||
complete_dictionary_with_modules($taborder, $tabname, $tablib, $tabsql, $tabsqlsort, $tabfield, $tabfieldvalue, $tabfieldinsert, $tabrowid, $tabcond, $tabhelp, $tabfieldcheck);
|
||||
|
||||
complete_dictionary_with_modules($taborder, $tabname, $tablib, $tabsql, $tabsqlsort, $tabfield, $tabfieldvalue, $tabfieldinsert, $tabrowid, $tabcond, $tabhelp, $tabcomplete);
|
||||
|
||||
// Defaut sortorder
|
||||
if (empty($sortfield)) {
|
||||
@@ -1968,6 +1980,9 @@ if ($id) {
|
||||
} elseif ($value == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_product_nature') {
|
||||
$langs->load("products");
|
||||
$valuetoshow = $langs->trans($obj->{$value});
|
||||
} elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_productbatch_qcstatus') {
|
||||
$langs->load("productbatch");
|
||||
$valuetoshow = $langs->trans($obj->{$value});
|
||||
}
|
||||
$class .= ($class ? ' ' : '').'tddict';
|
||||
if ($value == 'note' && $id == 10) {
|
||||
@@ -2123,7 +2138,7 @@ if ($id) {
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">'.$langs->trans("Dictionary").'</td>';
|
||||
print '<td>'.$langs->trans("Table").'</td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
|
||||
$showemptyline = '';
|
||||
@@ -2142,18 +2157,26 @@ if ($id) {
|
||||
$value = $tabname[$i];
|
||||
print '<tr class="oddeven"><td width="50%">';
|
||||
if (!empty($tabcond[$i])) {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$i.'">'.$langs->trans($tablib[$i]).'</a>';
|
||||
$tabnamenoprefix = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabname[$i]);
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$i.'">';
|
||||
if (!empty($tabcomplete[$tabnamenoprefix]['picto'])) {
|
||||
print img_picto('', $tabcomplete[$tabnamenoprefix]['picto'], 'class="pictofixedwidth paddingrightonly"');
|
||||
}
|
||||
print $langs->trans($tablib[$i]);
|
||||
print '</a>';
|
||||
} else {
|
||||
print $langs->trans($tablib[$i]);
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
/*if (empty($tabcond[$i]))
|
||||
{
|
||||
print info_admin($langs->trans("DictionaryDisabledSinceNoModuleNeedIt"),1);
|
||||
}*/
|
||||
print '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?id='.$i.'">';
|
||||
print img_picto('Edit', 'edit', '');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
print '<td>'.$tabname[$i].'</td></tr>';
|
||||
print '<td class="right">';
|
||||
print $form->textwithpicto('', $langs->trans("Table").': '.$tabname[$i]);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
$lastlineisempty = false;
|
||||
} else {
|
||||
if (!$lastlineisempty) {
|
||||
|
||||
@@ -61,6 +61,8 @@ $arrayofparameters = array(
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_SECUREKEY'=>array('type'=>'securekey', 'enabled'=>1),
|
||||
'SERVICE_BOOTH_LOCATION'=>array('type'=>'product', 'enabled'=>1),
|
||||
'SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION'=>array('type'=>'product', 'enabled'=>1),
|
||||
);
|
||||
|
||||
$error = 0;
|
||||
@@ -277,6 +279,11 @@ if ($action == 'edit') {
|
||||
});';
|
||||
print '</script>';
|
||||
}
|
||||
} elseif ($val['type'] == 'product') {
|
||||
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
|
||||
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
|
||||
$form->select_produits($selected, $constname, '', 0);
|
||||
}
|
||||
} else {
|
||||
print '<input name="' . $constname . '" class="flat ' . (empty($val['css']) ? 'minwidth200' : $val['css']) . '" value="' . $conf->global->{$constname} . '">';
|
||||
}
|
||||
@@ -347,6 +354,14 @@ if ($action == 'edit') {
|
||||
} elseif ($conf->global->{$constname}==0) {
|
||||
print $langs->trans("NorProspectNorCustomer");
|
||||
}
|
||||
} elseif ($val['type'] == 'product') {
|
||||
$product = new Product($db);
|
||||
$resprod = $product->fetch($conf->global->{$constname});
|
||||
if ($resprod > 0) {
|
||||
print $product->ref;
|
||||
} elseif ($resprod < 0) {
|
||||
setEventMessages(null, $object->errors, "errors");
|
||||
}
|
||||
} else {
|
||||
print $conf->global->{$constname};
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
* Copyright (C) 2011-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -333,13 +333,13 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
// Si verif ok et action add, on ajoute la ligne
|
||||
// If previous test is ok action is add, we add the line
|
||||
if ($ok && GETPOST('actionadd')) {
|
||||
// Add new entry
|
||||
$sql = "INSERT INTO ".$tabname[$id]." (";
|
||||
// List of fields
|
||||
$sql .= $tabfieldinsert[$id];
|
||||
$sql .= ",active)";
|
||||
$sql .= ", active, enabled)";
|
||||
$sql .= " VALUES(";
|
||||
|
||||
// List of values
|
||||
@@ -390,7 +390,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$sql .= ", 1)";
|
||||
$sql .= ", 1, 1)";
|
||||
|
||||
dol_syslog("actionadd", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -610,7 +610,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
// Back to draft
|
||||
if ($object->status == $object::STATUS_VALIDATED) {
|
||||
if ($permissiontoadd) {
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=setdraft&token='.newToken().'">'.$langs->trans("SetToDraft").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=setdraft&token='.newToken().'">'.$langs->trans("SetToDraft").'</a>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -627,34 +627,34 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
if ($object->status == $object::STATUS_DRAFT) {
|
||||
if ($permissiontoadd) {
|
||||
if (is_array($object->lines) && count($object->lines) > 0) {
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=validate&token='.newToken().'">'.$langs->trans("Validate").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=validate&token='.newToken().'">'.$langs->trans("Validate").'</a>'."\n";
|
||||
} else {
|
||||
$langs->load("errors");
|
||||
print '<a class="butActionRefused" href="" title="'.$langs->trans("ErrorAddAtLeastOneLineFirst").'">'.$langs->trans("Validate").'</a>';
|
||||
print '<a class="butActionRefused" href="" title="'.$langs->trans("ErrorAddAtLeastOneLineFirst").'">'.$langs->trans("Validate").'</a>'."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Re-open
|
||||
if ($permissiontoadd && $object->status == $object::STATUS_CANCELED) {
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen">'.$langs->trans("ReOpen").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen">'.$langs->trans("ReOpen").'</a>'."\n";
|
||||
}
|
||||
|
||||
// Create MO
|
||||
if ($conf->mrp->enabled) {
|
||||
if ($object->status == $object::STATUS_VALIDATED && !empty($user->rights->mrp->write)) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/mrp/mo_card.php?action=create&fk_bom='.$object->id.'&backtopageforcancel='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id).'">'.$langs->trans("CreateMO").'</a>';
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/mrp/mo_card.php?action=create&fk_bom='.$object->id.'&backtopageforcancel='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id).'">'.$langs->trans("CreateMO").'</a>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Clone
|
||||
if ($permissiontoadd) {
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=clone&object=bom">'.$langs->trans("ToClone").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=clone&object=bom">'.$langs->trans("ToClone").'</a>'."\n";
|
||||
}
|
||||
|
||||
// Close / Cancel
|
||||
if ($permissiontoadd && $object->status == $object::STATUS_VALIDATED) {
|
||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=close">'.$langs->trans("Disable").'</a>';
|
||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=close">'.$langs->trans("Disable").'</a>'."\n";
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -495,20 +495,20 @@ print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwit
|
||||
// --------------------------------------------------------------------
|
||||
print '<tr class="liste_titre">';
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['css']) ? '' : $val['css']);
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
if ($key == 'status') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') {
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
|
||||
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
|
||||
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
|
||||
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth150', 1);
|
||||
} elseif (strpos($val['type'], 'integer:') === 0) {
|
||||
print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1);
|
||||
} elseif (!preg_match('/^(date|timestamp)/', $val['type'])) {
|
||||
@@ -543,7 +543,7 @@ foreach ($object->fields as $key => $val) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') {
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
@@ -601,7 +601,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
}
|
||||
|
||||
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') {
|
||||
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status' && empty($val['arrayofkeyval'])) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) {
|
||||
|
||||
@@ -97,7 +97,7 @@ class BOM extends CommonObject
|
||||
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>5),
|
||||
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'noteditable'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',),
|
||||
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'autofocusoncreate'=>1),
|
||||
'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth150', 'csslist'=>'minwidth150'),
|
||||
'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth150', 'csslist'=>'minwidth150 center'),
|
||||
//'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>32, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing')),
|
||||
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'picto'=>'product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp', 'css'=>'maxwidth500'),
|
||||
'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,),
|
||||
|
||||
@@ -222,14 +222,23 @@ if (empty($reshook)) {
|
||||
$onlinepaymentenabled++;
|
||||
}
|
||||
if ($onlinepaymentenabled && !empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
$substitutionarray['__ONLINEPAYMENTLINK_MEMBER__'] = getHtmlOnlinePaymentLink('member', $obj->source_id);
|
||||
$substitutionarray['__ONLINEPAYMENTLINK_DONATION__'] = getHtmlOnlinePaymentLink('donation', $obj->source_id);
|
||||
$substitutionarray['__ONLINEPAYMENTLINK_ORDER__'] = getHtmlOnlinePaymentLink('order', $obj->source_id);
|
||||
$substitutionarray['__ONLINEPAYMENTLINK_INVOICE__'] = getHtmlOnlinePaymentLink('invoice', $obj->source_id);
|
||||
$substitutionarray['__ONLINEPAYMENTLINK_CONTRACTLINE__'] = getHtmlOnlinePaymentLink('contractline', $obj->source_id);
|
||||
|
||||
$substitutionarray['__SECUREKEYPAYMENT__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2);
|
||||
if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
|
||||
$substitutionarray['__SECUREKEYPAYMENT_MEMBER__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2);
|
||||
$substitutionarray['__SECUREKEYPAYMENT_DONATION__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2);
|
||||
$substitutionarray['__SECUREKEYPAYMENT_ORDER__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2);
|
||||
$substitutionarray['__SECUREKEYPAYMENT_INVOICE__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2);
|
||||
$substitutionarray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2);
|
||||
} else {
|
||||
$substitutionarray['__SECUREKEYPAYMENT_MEMBER__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$obj->source_id, 2);
|
||||
$substitutionarray['__SECUREKEYPAYMENT_MEMBER__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'member'.$obj->source_id, 2);
|
||||
$substitutionarray['__SECUREKEYPAYMENT_DONATION__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'donation'.$obj->source_id, 2);
|
||||
$substitutionarray['__SECUREKEYPAYMENT_ORDER__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'order'.$obj->source_id, 2);
|
||||
$substitutionarray['__SECUREKEYPAYMENT_INVOICE__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'invoice'.$obj->source_id, 2);
|
||||
$substitutionarray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'contractline'.$obj->source_id, 2);
|
||||
|
||||
@@ -1680,6 +1680,27 @@ class Account extends CommonObject
|
||||
$this->owner_address = 'Owner address';
|
||||
$this->country_id = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function used to replace a thirdparty id with another one.
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param int $origin_id Old thirdparty id
|
||||
* @param int $dest_id New thirdparty id
|
||||
* @return bool
|
||||
*/
|
||||
public static function replaceThirdparty($db, $origin_id, $dest_id)
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank_url SET url_id = ".((int) $dest_id)." WHERE url_id = ".((int) $origin_id)." AND type='company'";
|
||||
|
||||
if (!$db->query($sql)) {
|
||||
//if ($ignoreerrors) return true; // TODO Not enough. If there is A-B on kept thirdarty and B-C on old one, we must get A-B-C after merge. Not A-B.
|
||||
//$this->errors = $db->lasterror();
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC)) {
|
||||
} elseif (GETPOST('linkit', 'restricthtml') && !empty($conf->global->MAIN_UPLOAD_DOC)) {
|
||||
$link = GETPOST('link', 'alpha');
|
||||
if ($link) {
|
||||
if (substr($link, 0, 7) != 'http://' && substr($link, 0, 8) != 'https://' && substr($link, 0, 7) != 'file://') {
|
||||
if (substr($link, 0, 7) != 'http://' && substr($link, 0, 8) != 'https://' && substr($link, 0, 7) != 'file://' && substr($link, 0, 7) != 'davs://') {
|
||||
$link = 'http://'.$link;
|
||||
}
|
||||
dol_add_file_process($upload_dir, 0, 1, 'userfile', null, $link, '', 0);
|
||||
|
||||
@@ -3820,6 +3820,11 @@ abstract class CommonObject
|
||||
$classpath = 'projet/class';
|
||||
$classfile = 'project';
|
||||
$classname = 'Project';
|
||||
} elseif ($objecttype == 'conferenceorboothattendee') {
|
||||
$classpath = 'eventorganization/class';
|
||||
$classfile = 'conferenceorboothattendee';
|
||||
$classname = 'ConferenceOrBoothAttendee';
|
||||
$module = 'eventorganization';
|
||||
}
|
||||
|
||||
// Here $module, $classfile and $classname are set
|
||||
|
||||
@@ -2029,7 +2029,7 @@ class FormFile
|
||||
print '<td class="center">'.dol_print_date($link->datea, "dayhour", "tzuser").'</td>';
|
||||
print '<td class="center"></td>';
|
||||
print '<td class="right">';
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=update&linkid='.$link->id.$param.'" class="editfilelink editfielda reposition" >'.img_edit().'</a>'; // id= is included into $param
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=update&linkid='.$link->id.$param.'&token='.newToken().'" class="editfilelink editfielda reposition" >'.img_edit().'</a>'; // id= is included into $param
|
||||
if ($permissiontodelete) {
|
||||
print ' <a class="deletefilelink" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&linkid='.$link->id.$param.'">'.img_delete().'</a>'; // id= is included into $param
|
||||
} else {
|
||||
|
||||
@@ -1594,6 +1594,9 @@ class FormMail extends Form
|
||||
if ($conf->adherent->enabled) {
|
||||
$tmparray['__SECUREKEYPAYMENT_MEMBER__'] = 'SecureKeyPAYMENTUniquePerMember';
|
||||
}
|
||||
if ($conf->donation->enabled) {
|
||||
$tmparray['__SECUREKEYPAYMENT_DONATION__'] = 'SecureKeyPAYMENTUniquePerDonation';
|
||||
}
|
||||
if ($conf->facture->enabled) {
|
||||
$tmparray['__SECUREKEYPAYMENT_INVOICE__'] = 'SecureKeyPAYMENTUniquePerInvoice';
|
||||
}
|
||||
@@ -1603,6 +1606,23 @@ class FormMail extends Form
|
||||
if ($conf->contrat->enabled) {
|
||||
$tmparray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = 'SecureKeyPAYMENTUniquePerContractLine';
|
||||
}
|
||||
|
||||
//Online payement link
|
||||
if ($conf->adherent->enabled) {
|
||||
$tmparray['__ONLINEPAYMENTLINK_MEMBER__'] = 'OnlinePaymentLinkUniquePerMember';
|
||||
}
|
||||
if ($conf->donation->enabled) {
|
||||
$tmparray['__ONLINEPAYMENTLINK_DONATION__'] = 'OnlinePaymentLinkUniquePerDonation';
|
||||
}
|
||||
if ($conf->facture->enabled) {
|
||||
$tmparray['__ONLINEPAYMENTLINK_INVOICE__'] = 'OnlinePaymentLinkUniquePerInvoice';
|
||||
}
|
||||
if ($conf->commande->enabled) {
|
||||
$tmparray['__ONLINEPAYMENTLINK_ORDER__'] = 'OnlinePaymentLinkUniquePerOrder';
|
||||
}
|
||||
if ($conf->contrat->enabled) {
|
||||
$tmparray['__ONLINEPAYMENTLINK_CONTRACTLINE__'] = 'OnlinePaymentLinkUniquePerContractLine';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* No need to show into tooltip help, option is not enabled
|
||||
|
||||
@@ -1189,10 +1189,10 @@ function unActivateModule($value, $requiredby = 1)
|
||||
* @param array $tabrowid Tabrowid
|
||||
* @param array $tabcond Tabcond
|
||||
* @param array $tabhelp Tabhelp
|
||||
* @param array $tabfieldcheck Tabfieldcheck
|
||||
* @param array $tabcomplete Tab complete (will replace all other in future). Key is table name.
|
||||
* @return int 1
|
||||
*/
|
||||
function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tabsql, &$tabsqlsort, &$tabfield, &$tabfieldvalue, &$tabfieldinsert, &$tabrowid, &$tabcond, &$tabhelp, &$tabfieldcheck)
|
||||
function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tabsql, &$tabsqlsort, &$tabfield, &$tabfieldvalue, &$tabfieldinsert, &$tabrowid, &$tabcond, &$tabhelp, &$tabcomplete)
|
||||
{
|
||||
global $db, $modules, $conf, $langs;
|
||||
|
||||
@@ -1255,53 +1255,76 @@ function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tab
|
||||
if (!empty($objMod->dictionaries)) {
|
||||
//var_dump($objMod->dictionaries['tabname']);
|
||||
$nbtabname = $nbtablib = $nbtabsql = $nbtabsqlsort = $nbtabfield = $nbtabfieldvalue = $nbtabfieldinsert = $nbtabrowid = $nbtabcond = $nbtabfieldcheck = $nbtabhelp = 0;
|
||||
foreach ($objMod->dictionaries['tabname'] as $val) {
|
||||
$tabnamerelwithkey = array();
|
||||
foreach ($objMod->dictionaries['tabname'] as $key => $val) {
|
||||
$tmptablename = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $val);
|
||||
$nbtabname++;
|
||||
$taborder[] = max($taborder) + 1;
|
||||
$tabname[] = $val;
|
||||
$tabnamerelwithkey[$key] = $val;
|
||||
$tabcomplete[$tmptablename]['picto'] = $objMod->picto;
|
||||
} // Position
|
||||
foreach ($objMod->dictionaries['tablib'] as $val) {
|
||||
foreach ($objMod->dictionaries['tablib'] as $key => $val) {
|
||||
$tmptablename = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabnamerelwithkey[$key]);
|
||||
$nbtablib++;
|
||||
$tablib[] = $val;
|
||||
$tabcomplete[$tmptablename]['lib'] = $val;
|
||||
}
|
||||
foreach ($objMod->dictionaries['tabsql'] as $val) {
|
||||
foreach ($objMod->dictionaries['tabsql'] as $key => $val) {
|
||||
$tmptablename = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabnamerelwithkey[$key]);
|
||||
$nbtabsql++;
|
||||
$tabsql[] = $val;
|
||||
$tabcomplete[$tmptablename]['sql'] = $val;
|
||||
}
|
||||
foreach ($objMod->dictionaries['tabsqlsort'] as $val) {
|
||||
foreach ($objMod->dictionaries['tabsqlsort'] as $key => $val) {
|
||||
$tmptablename = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabnamerelwithkey[$key]);
|
||||
$nbtabsqlsort++;
|
||||
$tabsqlsort[] = $val;
|
||||
$tabcomplete[$tmptablename]['sqlsort'] = $val;
|
||||
}
|
||||
foreach ($objMod->dictionaries['tabfield'] as $val) {
|
||||
foreach ($objMod->dictionaries['tabfield'] as $key => $val) {
|
||||
$tmptablename = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabnamerelwithkey[$key]);
|
||||
$nbtabfield++;
|
||||
$tabfield[] = $val;
|
||||
$tabcomplete[$tmptablename]['field'] = $val;
|
||||
}
|
||||
foreach ($objMod->dictionaries['tabfieldvalue'] as $val) {
|
||||
foreach ($objMod->dictionaries['tabfieldvalue'] as $key => $val) {
|
||||
$tmptablename = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabnamerelwithkey[$key]);
|
||||
$nbtabfieldvalue++;
|
||||
$tabfieldvalue[] = $val;
|
||||
$tabcomplete[$tmptablename]['value'] = $val;
|
||||
}
|
||||
foreach ($objMod->dictionaries['tabfieldinsert'] as $val) {
|
||||
foreach ($objMod->dictionaries['tabfieldinsert'] as $key => $val) {
|
||||
$tmptablename = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabnamerelwithkey[$key]);
|
||||
$nbtabfieldinsert++;
|
||||
$tabfieldinsert[] = $val;
|
||||
$tabcomplete[$tmptablename]['fieldinsert'] = $val;
|
||||
}
|
||||
foreach ($objMod->dictionaries['tabrowid'] as $val) {
|
||||
foreach ($objMod->dictionaries['tabrowid'] as $key => $val) {
|
||||
$tmptablename = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabnamerelwithkey[$key]);
|
||||
$nbtabrowid++;
|
||||
$tabrowid[] = $val;
|
||||
$tabcomplete[$tmptablename]['rowid'] = $val;
|
||||
}
|
||||
foreach ($objMod->dictionaries['tabcond'] as $val) {
|
||||
foreach ($objMod->dictionaries['tabcond'] as $key => $val) {
|
||||
$tmptablename = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabnamerelwithkey[$key]);
|
||||
$nbtabcond++;
|
||||
$tabcond[] = $val;
|
||||
$tabcomplete[$tmptablename]['rowid'] = $val;
|
||||
}
|
||||
if (!empty($objMod->dictionaries['tabhelp'])) {
|
||||
foreach ($objMod->dictionaries['tabhelp'] as $val) {
|
||||
foreach ($objMod->dictionaries['tabhelp'] as $key => $val) {
|
||||
$tmptablename = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabnamerelwithkey[$key]);
|
||||
$nbtabhelp++;
|
||||
$tabhelp[] = $val;
|
||||
$tabcomplete[$tmptablename]['help'] = $val;
|
||||
}
|
||||
}
|
||||
if (!empty($objMod->dictionaries['tabfieldcheck'])) {
|
||||
foreach ($objMod->dictionaries['tabfieldcheck'] as $val) {
|
||||
foreach ($objMod->dictionaries['tabfieldcheck'] as $key => $val) {
|
||||
$tmptablename = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabnamerelwithkey[$key]);
|
||||
$nbtabfieldcheck++;
|
||||
$tabfieldcheck[] = $val;
|
||||
$tabcomplete[$tmptablename]['fieldcheck'] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3492,7 +3492,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
|
||||
'accountancy', 'account', 'accountline', 'action', 'add', 'address', 'angle-double-down', 'angle-double-up', 'asset',
|
||||
'bank_account', 'barcode', 'bank', 'bill', 'billa', 'billr', 'billd', 'bookmark', 'bom', 'bug', 'building',
|
||||
'cash-register', 'category', 'chart', 'check', 'clock', 'close_title', 'cog', 'collab', 'company', 'contact', 'country', 'contract', 'cron', 'cubes',
|
||||
'cash-register', 'category', 'chart', 'check', 'clock', 'close_title', 'cog', 'collab', 'company', 'contact', 'country', 'contract', 'cron', 'cubes', 'multicurrency',
|
||||
'delete', 'dolly', 'dollyrevert', 'donation', 'download', 'dynamicprice',
|
||||
'edit', 'ellipsis-h', 'email', 'eraser', 'establishment', 'expensereport', 'external-link-alt', 'external-link-square-alt',
|
||||
'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'autofill', 'folder', 'folder-open', 'folder-plus',
|
||||
@@ -9385,7 +9385,8 @@ function getDictvalue($tablename, $field, $id, $checkentity = false, $rowidfield
|
||||
|
||||
if (!isset($dictvalues[$tablename])) {
|
||||
$dictvalues[$tablename] = array();
|
||||
$sql = 'SELECT * FROM '.$tablename.' WHERE 1'; // Here select * is allowed as it is generic code and we don't have list of fields
|
||||
|
||||
$sql = 'SELECT * FROM '.$tablename.' WHERE 1 = 1'; // Here select * is allowed as it is generic code and we don't have list of fields
|
||||
if ($checkentity) {
|
||||
$sql .= ' AND entity IN (0,'.getEntity($tablename).')';
|
||||
}
|
||||
@@ -9674,6 +9675,7 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
|
||||
$class = 'butAction';
|
||||
if ($actionType == 'danger' || $actionType == 'delete') {
|
||||
$class = 'butActionDelete';
|
||||
if (strpos($url, 'token=') === false) $url .= '&token='.newToken();
|
||||
}
|
||||
|
||||
$attr = array(
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2020 Abbes Bahfir <bafbes@gmail.com>
|
||||
* Copyright (C) 2021 Waël Almoman <info@almoman.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -155,7 +156,7 @@ function getValidOnlinePaymentMethods($paymentmethod = '')
|
||||
}
|
||||
|
||||
/**
|
||||
* Return string with full Url
|
||||
* Return string with full online payment Url
|
||||
*
|
||||
* @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'membersubscription' ...)
|
||||
* @param string $ref Ref of object
|
||||
@@ -178,6 +179,22 @@ function showOnlinePaymentUrl($type, $ref)
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return string with HTML link for online payment
|
||||
*
|
||||
* @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'membersubscription' ...)
|
||||
* @param string $ref Ref of object
|
||||
* @param string $label Text or HTML tag to display, if empty it display the URL
|
||||
* @return string Url string
|
||||
*/
|
||||
function getHtmlOnlinePaymentLink($type, $ref, $label = '')
|
||||
{
|
||||
$url = getOnlinePaymentUrl(0, $type, $ref);
|
||||
$label = $label ? $label : $url;
|
||||
return'<a href="'.$url.'" target="_blank">'.$label.'</a>';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return string with full Url
|
||||
*
|
||||
|
||||
@@ -20,10 +20,6 @@
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \class ModeleProductCode
|
||||
* \brief Parent class for product code generators
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/modules/member/modules_member.class.php
|
||||
|
||||
@@ -198,11 +198,25 @@ class modTakePos extends DolibarrModules
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = 50151;
|
||||
$this->rights[$r][1] = 'Use Point Of Sale';
|
||||
$this->rights[$r][1] = 'Use Point Of Sale (record a sale, add products, record payment)';
|
||||
$this->rights[$r][2] = 'a';
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'run';
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = 50152;
|
||||
$this->rights[$r][1] = 'Can modify added sales lines (prices, discount)';
|
||||
$this->rights[$r][2] = 'a';
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'editlines';
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = 50153;
|
||||
$this->rights[$r][1] = 'Edit ordered sales lines (useful only when option "Order printers" has been enabled). Allow to edit sales lines even after the order has been printed';
|
||||
$this->rights[$r][2] = 'a';
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'editorderedlines';
|
||||
|
||||
|
||||
// Main menu entries
|
||||
$this->menu = array(); // List of menus to add
|
||||
|
||||
@@ -231,10 +231,10 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
||||
$objphoto->fetch($object->lines[$i]->fk_product);
|
||||
|
||||
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) {
|
||||
$pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/";
|
||||
$pdir = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/";
|
||||
$dir = $conf->product->dir_output.'/'.$pdir;
|
||||
} else {
|
||||
$pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/';
|
||||
$pdir = get_exdir($objphoto->id, 0, 0, 0, $objphoto, 'product');
|
||||
$dir = $conf->product->dir_output.'/'.$pdir;
|
||||
}
|
||||
|
||||
|
||||
@@ -246,13 +246,12 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$objphoto->fetch($object->lines[$i]->fk_product);
|
||||
|
||||
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) {
|
||||
$pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/";
|
||||
$pdir = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/";
|
||||
$dir = $conf->product->dir_output.'/'.$pdir;
|
||||
} else {
|
||||
$pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/';
|
||||
$pdir = get_exdir($objphoto->id, 0, 0, 0, $objphoto, 'product');
|
||||
$dir = $conf->product->dir_output.'/'.$pdir;
|
||||
}
|
||||
|
||||
$realpath = '';
|
||||
foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) {
|
||||
$filename = $obj['photo'];
|
||||
|
||||
@@ -237,7 +237,18 @@ class ConferenceOrBooth extends ActionComm
|
||||
*/
|
||||
public function fetch($id, $ref = null, $ref_ext = '', $email_msgid = '')
|
||||
{
|
||||
global $dolibarr_main_url_root, $dolibarr_main_instance_unique_id, $conf, $langs;
|
||||
|
||||
$result = parent::fetch($id, $ref, $ref_ext, $email_msgid);
|
||||
|
||||
$link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.$id;
|
||||
|
||||
$encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2);
|
||||
$link_subscription .= '&securekey='.urlencode($encodedsecurekey);
|
||||
|
||||
$this->fields['pubregister'] = array('type'=>'url', 'label'=>$langs->trans("PublicAttendeeSubscriptionPage"), 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>1);
|
||||
$this->pubregister = $link_subscription;
|
||||
|
||||
$this->getActionCommFields();
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -493,16 +493,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
//$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
|
||||
//unset($object->fields['fk_project']); // Hide field already shown in banner
|
||||
//unset($object->fields['fk_soc']); // Hide field already shown in banner
|
||||
global $dolibarr_main_url_root;
|
||||
|
||||
$encodedid = dol_encode($id, $dolibarr_main_instance_unique_id);
|
||||
$link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.$encodedid;
|
||||
|
||||
$encodedsecurekey = dol_encode($conf->global->EVENTORGANIZATION_SECUREKEY.$encodedid, $dolibarr_main_instance_unique_id);
|
||||
$link_subscription .= '&securekey='.urlencode($encodedsecurekey);
|
||||
|
||||
$object->fields['pubregister'] = array('type'=>'url', 'label'=>$langs->trans("PublicAttendeeSubscriptionPage"), 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>1);
|
||||
$object->pubregister = $link_subscription;
|
||||
$keyforbreak='pubregister';
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
|
||||
|
||||
@@ -39,6 +39,8 @@ if ($conf->categorie->enabled) {
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("eventorganization", "other"));
|
||||
|
||||
global $dolibarr_main_url_root, $dolibarr_main_instance_unique_id;
|
||||
|
||||
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
|
||||
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
|
||||
$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
|
||||
@@ -360,6 +362,14 @@ if ($projectid > 0) {
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Link to the vote/register page
|
||||
print '<tr><td>'.$langs->trans("RegisterPage").'</td><td>';
|
||||
$linkregister = $dolibarr_main_url_root.'/public/project/index.php?id='.$project->id;
|
||||
$encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 2);
|
||||
$linkregister .= '&securekey='.urlencode($encodedsecurekey);
|
||||
print '<a target="_blank" href="'.$linkregister.'">'.$linkregister.'</a>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$cols = 2;
|
||||
$objectconf=$object;
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
delete from llx_c_action_trigger;
|
||||
-- actions enabled by default (constant created for that) when we enable module agenda
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('COMPANY_CREATE','Third party created','Executed when a third party is created','societe',1);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('COMPANY_MODIFY','Third party update','Executed when you update third party','societe',1);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('COMPANY_SENTBYMAIL','Mails sent from third party card','Executed when you send email from third party card','societe',1);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('COMPANY_DELETE','Third party deleted','Executed when you delete third party','societe',1);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_VALIDATE','Customer proposal validated','Executed when a commercial proposal is validated','propal',2);
|
||||
@@ -129,8 +130,9 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_DELETE','MO deleted','Executed when a MO is deleted','mrp',662);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_CANCEL','MO canceled','Executed when a MO is canceled','mrp',663);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_CREATE','Contact address created','Executed when a contact is created','contact',50);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_SENTBYMAIL','Mails sent from third party card','Executed when you send email from contact address record','contact',51);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_DELETE','Contact address deleted','Executed when a contact is deleted','contact',52);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_MODIFY','Contact address update','Executed when a contact is updated','contact',51);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_SENTBYMAIL','Mails sent from third party card','Executed when you send email from contact address record','contact',52);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_DELETE','Contact address deleted','Executed when a contact is deleted','contact',53);
|
||||
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_CREATE','Job created','Executed when a job is created','recruitment',7500);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_MODIFY','Job modified','Executed when a job is modified','recruitment',7502);
|
||||
|
||||
@@ -35,6 +35,6 @@ INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_u
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailAskConf', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventConfRequestWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailAskBooth', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBoothRequestWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailSubsBooth', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBoothSubscriptionWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailSubsEvent', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventEventSubscriptionWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailSubsEvent', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventEventSubscriptionWasReceived)__<br /><br />__(Sincerely)__<br /><br />__MYCOMPANY_NAME__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationMassEmailAttendees', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBulkMailToAttendees)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationMassEmailSpeakers', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBulkMailToSpeakers)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
|
||||
28
htdocs/install/mysql/data/llx_c_productbatch_qcstatus.sql
Normal file
28
htdocs/install/mysql/data/llx_c_productbatch_qcstatus.sql
Normal file
@@ -0,0 +1,28 @@
|
||||
-- Copyright (C) 2021 Noé Cendrier <noe.cendrier@altairis.fr>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
--
|
||||
--
|
||||
|
||||
--
|
||||
-- Do not place a comment at the end of the line, this file is parsed when
|
||||
-- from the install and all '--' are removed.
|
||||
--
|
||||
-- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors
|
||||
-- de l'install et tous les sigles '--' sont supprimés.
|
||||
--
|
||||
|
||||
INSERT INTO llx_c_productbatch_qcstatus (code, label, active) VALUES ('OK', 'InWorkingOrder', 1);
|
||||
INSERT INTO llx_c_productbatch_qcstatus (code, label, active) VALUES ('KO', 'OutOfOrder', 1);
|
||||
|
||||
@@ -587,4 +587,5 @@ insert into llx_c_actioncomm (id, code, type, libelle, module, active, position)
|
||||
-- VMYSQL4.3 ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN montant double(24,8) NULL;
|
||||
-- VPGSQL8.2 ALTER TABLE llx_accounting_bookkeeping ALTER COLUMN montant DROP NOT NULL;
|
||||
|
||||
ALTER TABLE llx_export_model MODIFY COLUMN type varchar(64);
|
||||
|
||||
|
||||
@@ -59,11 +59,11 @@ insert into llx_c_actioncomm (id, code, type, libelle, module, active, position)
|
||||
|
||||
UPDATE llx_c_country SET eec = 1 WHERE code IN ('AT','BE','BG','CY','CZ','DE','DK','EE','ES','FI','FR','GR','HR','NL','HU','IE','IM','IT','LT','LU','LV','MC','MT','PL','PT','RO','SE','SK','SI');
|
||||
|
||||
ALTER TABLE llx_export_model MODIFY COLUMN type varchar(64);
|
||||
|
||||
|
||||
-- For v14
|
||||
|
||||
ALTER TABLE llx_export_model MODIFY COLUMN type varchar(64);
|
||||
|
||||
create table llx_accounting_groups_account
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
@@ -157,6 +157,18 @@ CREATE TABLE llx_workstation_workstation_usergroup(
|
||||
fk_workstation integer
|
||||
) ENGINE=innodb;
|
||||
|
||||
CREATE TABLE llx_c_producbatch_qcstatus(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
entity integer NOT NULL DEFAULT 1,
|
||||
code varchar(16) NOT NULL,
|
||||
label varchar(50) NOT NULL,
|
||||
active integer DEFAULT 1 NOT NULL
|
||||
) ENGINE=innodb;
|
||||
|
||||
ALTER TABLE llx_c_productbatch_qcstatus ADD UNIQUE INDEX uk_c_productbatch_qcstatus(code, entity);
|
||||
|
||||
INSERT INTO llx_c_productbatch_qcstatus (code, label, active) VALUES ('OK', 'InWorkingOrder', 1);
|
||||
INSERT INTO llx_c_productbatch_qcstatus (code, label, active) VALUES ('KO', 'OutOfOrder', 1);
|
||||
|
||||
ALTER TABLE llx_product_customer_price ADD COLUMN ref_customer varchar(30);
|
||||
ALTER TABLE llx_product_customer_price_log ADD COLUMN ref_customer varchar(30);
|
||||
@@ -187,6 +199,7 @@ ALTER TABLE llx_mrp_production ADD COLUMN origin_type varchar(10) AFTER origin_i
|
||||
|
||||
ALTER TABLE llx_fichinter ADD COLUMN last_main_doc varchar(255) AFTER model_pdf;
|
||||
ALTER TABLE llx_projet ADD COLUMN last_main_doc varchar(255) AFTER model_pdf;
|
||||
ALTER TABLE llx_expensereport ADD COLUMN last_main_doc varchar(255) DEFAULT NULL AFTER model_pdf;
|
||||
|
||||
create table llx_payment_vat
|
||||
(
|
||||
@@ -220,7 +233,7 @@ ALTER TABLE llx_tva ALTER COLUMN paye SET DEFAULT 0;
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailAskConf', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventConfRequestWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailAskBooth', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBoothRequestWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailSubsBooth', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBoothSubscriptionWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailSubsEvent', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventEventSubscriptionWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailSubsEvent', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventEventSubscriptionWasReceived)__<br /><br />__(Sincerely)__<br /><br />__MYCOMPANY_NAME__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationMassEmailAttendees', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBulkMailToAttendees)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationMassEmailSpeakers', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBulkMailToSpeakers)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
|
||||
@@ -487,3 +500,9 @@ create table llx_knowledgemanagement_knowledgerecord_extrafields
|
||||
|
||||
-- add default amount by member type
|
||||
ALTER TABLE llx_adherent_type ADD COLUMN amount DOUBLE(24,8) NULL DEFAULT NULL AFTER subscription;
|
||||
|
||||
-- add action trigger
|
||||
INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('COMPANY_MODIFY','Third party update','Executed when you update third party','societe',1);
|
||||
INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('CONTACT_MODIFY','Contact address update','Executed when a contact is updated','contact',51);
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
-- ========================================================================
|
||||
-- Copyright (C) 2021 Noé Cendrier <noe.cendrier@altairis.fr>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- ========================================================================
|
||||
|
||||
ALTER TABLE llx_c_productbatch_qcstatus ADD UNIQUE INDEX uk_c_productbatch_qcstatus(code, entity);
|
||||
26
htdocs/install/mysql/tables/llx_c_productbatch_qcstatus.sql
Normal file
26
htdocs/install/mysql/tables/llx_c_productbatch_qcstatus.sql
Normal file
@@ -0,0 +1,26 @@
|
||||
-- ========================================================================
|
||||
-- Copyright (C) 2012-2017 Noé Cendrier <noe.cendrier@altairis.fr>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 2 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- ========================================================================
|
||||
|
||||
CREATE TABLE llx_c_productbatch_qcstatus
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
entity integer NOT NULL DEFAULT 1,
|
||||
code varchar(16) NOT NULL,
|
||||
label varchar(50) NOT NULL,
|
||||
active integer DEFAULT 1 NOT NULL
|
||||
)ENGINE=innodb;
|
||||
@@ -966,6 +966,8 @@ Permission23003=Delete Scheduled job
|
||||
Permission23004=Execute Scheduled job
|
||||
Permission50101=Use Point of Sale (SimplePOS)
|
||||
Permission50151=Use Point of Sale (TakePOS)
|
||||
Permission50152=Edit sales lines
|
||||
Permission50153=Edit ordered sales lines
|
||||
Permission50201=Read transactions
|
||||
Permission50202=Import transactions
|
||||
Permission50330=Read objects of Zapier
|
||||
@@ -1040,11 +1042,12 @@ DictionaryMeasuringUnits=Measuring Units
|
||||
DictionarySocialNetworks=Social Networks
|
||||
DictionaryProspectStatus=Prospect status for companies
|
||||
DictionaryProspectContactStatus=Prospect status for contacts
|
||||
DictionaryHolidayTypes=Types of leave
|
||||
DictionaryHolidayTypes=Leave - Types of leave
|
||||
DictionaryOpportunityStatus=Lead status for project/lead
|
||||
DictionaryExpenseTaxCat=Expense report - Transportation categories
|
||||
DictionaryExpenseTaxRange=Expense report - Range by transportation category
|
||||
DictionaryTransportMode=Intracomm report - Transport mode
|
||||
DictionaryBatchStatus=Product lot/serial Quality Control status
|
||||
TypeOfUnit=Type of unit
|
||||
SetupSaved=Setup saved
|
||||
SetupNotSaved=Setup not saved
|
||||
|
||||
@@ -102,7 +102,7 @@ CashDeskGenericMaskCodes6 = <br><b>{TN}</b> tag is used to add the terminal numb
|
||||
TakeposGroupSameProduct=Group same products lines
|
||||
StartAParallelSale=Start a new parallel sale
|
||||
SaleStartedAt=Sale started at %s
|
||||
ControlCashOpening=Control cash popup at opening POS
|
||||
ControlCashOpening=Open the "Control cash" popup when opening the POS
|
||||
CloseCashFence=Close cash desk control
|
||||
CashReport=Cash report
|
||||
MainPrinterToUse=Main printer to use
|
||||
@@ -126,5 +126,5 @@ ModuleReceiptPrinterMustBeEnabled=Module Receipt printer must have been enabled
|
||||
AllowDelayedPayment=Allow delayed payment
|
||||
PrintPaymentMethodOnReceipts=Print payment method on tickets|receipts
|
||||
WeighingScale=Weighing scale
|
||||
ShowPriceHT = Display the price excluding tax column
|
||||
ShowPriceHTOnReceipt = Display the price excluding tax column on receipt
|
||||
ShowPriceHT = Display the column with the price excluding tax (on screen)
|
||||
ShowPriceHTOnReceipt = Display the column with the price excluding tax (on receipt)
|
||||
|
||||
@@ -82,6 +82,8 @@ EventOrganizationICSLink=Link ICS for events
|
||||
ConferenceOrBoothInformation=Conference Or Booth informations
|
||||
Attendees = Attendees
|
||||
EVENTORGANIZATION_SECUREKEY = Secure Key of the public registration link to a conference
|
||||
SERVICE_BOOTH_LOCATION = Service used for the invoice row about a booth location
|
||||
SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION = Service used for the invoice row about an attendee subscription to a conference
|
||||
#
|
||||
# Status
|
||||
#
|
||||
@@ -94,8 +96,27 @@ EvntOrgCancelled = Cancelled
|
||||
#
|
||||
# Public page
|
||||
#
|
||||
RegisterPage = Page for conferences or booth
|
||||
EvntOrgRegistrationWelcomeMessage = Welcome on the conference or booth suggestion page.
|
||||
EvntOrgRegistrationHelpMessage = Here, you can suggest a new conference or a new booth for the project
|
||||
SuggestConference = Suggest a new conference
|
||||
SuggestBooth = Suggest a booth
|
||||
ViewAndVote = View and vote for suggested events
|
||||
PublicAttendeeSubscriptionPage = Public link of registration to a conference
|
||||
MissingOrBadSecureKey = The security key is invalid or missing
|
||||
EvntOrgWelcomeMessage = This form allows you to register as a new participant to the conference
|
||||
EvntOrgStartDuration = This conference starts on
|
||||
EvntOrgEndDuration = and ends on
|
||||
EvntOrgWelcomeMessage = This form allows you to register as a new participant to the conference : '%s'
|
||||
EvntOrgDuration = This conference starts on %s and ends on %s.
|
||||
ConferenceAttendeeFee = Conference attendee fee for the event : '%s' occurring from %s to %s.
|
||||
#
|
||||
# SubscriptionOk page
|
||||
#
|
||||
SubscriptionOk = Your subscription to this conference has been validated
|
||||
#
|
||||
# Subscription validation mail
|
||||
#
|
||||
ConfAttendeeSubscriptionConfirmation = Confirmation of your subscription to a conference
|
||||
#
|
||||
# Payment page
|
||||
#
|
||||
Attendee = Participant
|
||||
PaymentConferenceAttendee = Paiement de participation à une conférence
|
||||
|
||||
@@ -9,7 +9,7 @@ ConfirmDeleteEstablishment=Are you sure you wish to delete this establishment?
|
||||
OpenEtablishment=Open establishment
|
||||
CloseEtablishment=Close establishment
|
||||
# Dictionary
|
||||
DictionaryPublicHolidays=HRM - Public holidays
|
||||
DictionaryPublicHolidays=Leave - Public holidays
|
||||
DictionaryDepartment=HRM - Department list
|
||||
DictionaryFunction=HRM - Job positions
|
||||
# Module
|
||||
|
||||
@@ -13,7 +13,7 @@ BOMsSetup=Setup of module BOM
|
||||
ListOfBOMs=List of bills of material - BOM
|
||||
ListOfManufacturingOrders=List of Manufacturing Orders
|
||||
NewBOM=New bill of materials
|
||||
ProductBOMHelp=Product to create with this BOM.<br>Note: Products with the property 'Nature of product' = 'Raw material' are not visible into this list.
|
||||
ProductBOMHelp=Product to create (or disassemble) with this BOM.<br>Note: Products with the property 'Nature of product' = 'Raw material' are not visible into this list.
|
||||
BOMsNumberingModules=BOM numbering templates
|
||||
BOMsModelModule=BOM document templates
|
||||
MOsNumberingModules=MO numbering templates
|
||||
@@ -39,7 +39,7 @@ DateStartPlannedMo=Date start planned
|
||||
DateEndPlannedMo=Date end planned
|
||||
KeepEmptyForAsap=Empty means 'As Soon As Possible'
|
||||
EstimatedDuration=Estimated duration
|
||||
EstimatedDurationDesc=Estimated duration to manufacture this product using this BOM
|
||||
EstimatedDurationDesc=Estimated duration to manufacture (or disassemble) this product using this BOM
|
||||
ConfirmValidateBom=Are you sure you want to validate the BOM with the reference <strong>%s</strong> (you will be able to use it to build new Manufacturing Orders)
|
||||
ConfirmCloseBom=Are you sure you want to cancel this BOM (you won't be able to use it to build new Manufacturing Orders anymore) ?
|
||||
ConfirmReopenBom=Are you sure you want to re-open this BOM (you will be able to use it to build new Manufacturing Orders)
|
||||
@@ -63,6 +63,7 @@ ConsumeAndProduceAll=Consume and Produce All
|
||||
Manufactured=Manufactured
|
||||
TheProductXIsAlreadyTheProductToProduce=The product to add is already the product to produce.
|
||||
ForAQuantityOf=For a quantity to produce of %s
|
||||
ForAQuantityToConsumeOf=For a quantity to disassemble of %s
|
||||
ConfirmValidateMo=Are you sure you want to validate this Manufacturing Order?
|
||||
ConfirmProductionDesc=By clicking on '%s', you will validate the consumption and/or production for the quantities set. This will also update the stock and record stock movements.
|
||||
ProductionForRef=Production of %s
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# ProductBATCH language file - en_US - ProductBATCH
|
||||
# ProductBATCH language file - Source file is en_US - ProductBATCH
|
||||
ManageLotSerial=Use lot/serial number
|
||||
ProductStatusOnBatch=Yes (lot required)
|
||||
ProductStatusOnSerial=Yes (unique serial number required)
|
||||
@@ -33,3 +33,7 @@ CustomMasks=Adds an option to define mask in the product card
|
||||
LotProductTooltip=Adds an option in the product card to define a dedicated batch number mask
|
||||
SNProductTooltip=Adds an option in the product card to define a dedicated serial number mask
|
||||
QtyToAddAfterBarcodeScan=Qty to add for each barcode/lot/serial scanned
|
||||
|
||||
#Traceability - qc status
|
||||
OutOfOrder=Out of order
|
||||
InWorkingOrder=In working order
|
||||
|
||||
@@ -1044,6 +1044,7 @@ DictionaryOpportunityStatus=Statut d'opportunités pour les affaires/projets
|
||||
DictionaryExpenseTaxCat=Note de frais - catégories de déplacement
|
||||
DictionaryExpenseTaxRange=Note de frais - Tri par catégorie de déplacement
|
||||
DictionaryTransportMode=Déclaration d'échanges intracommunautaires - Mode de transport
|
||||
DictionaryBatchStatus=État de qualité du lot/série (produits)
|
||||
TypeOfUnit=Type d'unité
|
||||
SetupSaved=Configuration sauvegardée
|
||||
SetupNotSaved=Configuration non enregistrée
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# ProductBATCH language file - en_US - ProductBATCH
|
||||
# ProductBATCH language file - Source file is en_US - ProductBATCH
|
||||
ManageLotSerial=Utiliser les numéros de lots/série
|
||||
ProductStatusOnBatch=Oui (Lot/Série requis)
|
||||
ProductStatusOnSerial=Oui (numéro de série unique requis)
|
||||
@@ -33,3 +33,5 @@ CustomMasks=Ajoute une option pour définir le masque dans la fiche produit
|
||||
LotProductTooltip=Ajoute une option dans la fiche produit pour définir un masque de numéro de lot dédié
|
||||
SNProductTooltip=Ajoute une option dans la fiche produit pour définir un masque de numéro de série dédié
|
||||
QtyToAddAfterBarcodeScan=Quantité à ajouter pour chaque code à barres/lot/série scanné
|
||||
LotProductTooltip=Crée un champ dans la fiche produit pour définir un modèle spécifique de numéro de lot
|
||||
SNProductTooltip=Crée un champ dans la fiche produit pour définir un modèle spécifique de numéro de série
|
||||
@@ -82,6 +82,7 @@ $arrayofparameters = array(
|
||||
//'MYMODULE_MYPARAM5'=>array('type'=>'yesno', 'enabled'=>1),
|
||||
//'MYMODULE_MYPARAM5'=>array('type'=>'thirdparty_type', 'enabled'=>1),
|
||||
//'MYMODULE_MYPARAM6'=>array('type'=>'securekey', 'enabled'=>1),
|
||||
//'MYMODULE_MYPARAM7'=>array('type'=>'product', 'enabled'=>1),
|
||||
);
|
||||
|
||||
$error = 0;
|
||||
@@ -299,6 +300,11 @@ if ($action == 'edit') {
|
||||
});';
|
||||
print '</script>';
|
||||
}
|
||||
} elseif ($val['type'] == 'product') {
|
||||
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
|
||||
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
|
||||
$form->select_produits($selected, $constname, '', 0);
|
||||
}
|
||||
} else {
|
||||
print '<input name="'.$constname.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->{$constname}.'">';
|
||||
}
|
||||
@@ -365,6 +371,14 @@ if ($action == 'edit') {
|
||||
} elseif ($conf->global->{$constname}==0) {
|
||||
print $langs->trans("NorProspectNorCustomer");
|
||||
}
|
||||
} elseif ($val['type'] == 'product') {
|
||||
$product = new Product($db);
|
||||
$resprod = $product->fetch($conf->global->{$constname});
|
||||
if ($resprod > 0) {
|
||||
print $product->ref;
|
||||
} elseif ($resprod < 0) {
|
||||
setEventMessages(null, $object->errors, "errors");
|
||||
}
|
||||
} else {
|
||||
print $conf->global->{$constname};
|
||||
}
|
||||
|
||||
@@ -506,7 +506,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
} else {
|
||||
$langs->load("errors");
|
||||
//print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes', '', 0);
|
||||
print '<a class="butActionRefused" href="" title="'.$langs->trans("ErrorAddAtLeastOneLineFirst").'">'.$langs->trans("Validate").'</a>';
|
||||
print '<a class="butActionRefused" href="" title="'.dol_escape_htmltag($langs->trans("ErrorAddAtLeastOneLineFirst")).'">'.$langs->trans("Validate").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -516,16 +516,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
/*
|
||||
if ($permissiontoadd) {
|
||||
if ($object->status == $object::STATUS_ENABLED) {
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=disable&token='.newToken().'">'.$langs->trans("Disable").'</a>'."\n";
|
||||
print dolGetButtonAction($langs->trans('Disable'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=disable&token='.newToken(), '', $permissiontoadd);
|
||||
} else {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=enable&token='.newToken().'">'.$langs->trans("Enable").'</a>'."\n";
|
||||
print dolGetButtonAction($langs->trans('Enable'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable&token='.newToken(), '', $permissiontoadd);
|
||||
}
|
||||
}
|
||||
if ($permissiontoadd) {
|
||||
if ($object->status == $object::STATUS_VALIDATED) {
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close&token='.newToken().'">'.$langs->trans("Cancel").'</a>'."\n";
|
||||
print dolGetButtonAction($langs->trans('Cancel'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=close&token='.newToken(), '', $permissiontoadd);
|
||||
} else {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken().'">'.$langs->trans("Re-Open").'</a>'."\n";
|
||||
print dolGetButtonAction($langs->trans('Re-Open'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen&token='.newToken(), '', $permissiontoadd);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -502,14 +502,14 @@ print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwit
|
||||
// --------------------------------------------------------------------
|
||||
print '<tr class="liste_titre">';
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['css']) ? '' : $val['css']);
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
if ($key == 'status') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') {
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
@@ -557,7 +557,7 @@ foreach ($object->fields as $key => $val) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') {
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
@@ -615,7 +615,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
}
|
||||
|
||||
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status'))) {
|
||||
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
//if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
|
||||
|
||||
@@ -1280,7 +1280,13 @@ class Mo extends CommonObject
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans('Ref').'</td>';
|
||||
print '<td class="right">'.$langs->trans('Qty').' <span class="opacitymedium">('.$langs->trans("ForAQuantityOf", $this->bom->qty).')</span></td>';
|
||||
print '<td class="right">'.$langs->trans('Qty');
|
||||
if ($this->bom->bomtype == 0) {
|
||||
print ' <span class="opacitymedium">('.$langs->trans("ForAQuantityOf", $this->bom->qty).')</span>';
|
||||
} else {
|
||||
print ' <span class="opacitymedium">('.$langs->trans("ForAQuantityToConsumeOf", $this->bom->qty).')</span>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="center">'.$langs->trans('QtyFrozen').'</td>';
|
||||
print '<td class="center">'.$langs->trans('DisableStockChange').'</td>';
|
||||
//print '<td class="right">'.$langs->trans('Efficiency').'</td>';
|
||||
|
||||
@@ -707,16 +707,21 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Product").'</td>';
|
||||
// Qty
|
||||
print '<td class="right">'.$langs->trans("Qty").'</td>';
|
||||
// Cost price
|
||||
if ($permissiontoupdatecost && !empty($conf->global->MRP_SHOW_COST_FOR_CONSUMPTION)) {
|
||||
print '<td class="right">'.$langs->trans("UnitCost").'</td>';
|
||||
}
|
||||
// Qty already consumed
|
||||
print '<td class="right">'.$langs->trans("QtyAlreadyConsumed").'</td>';
|
||||
// Warehouse
|
||||
print '<td>';
|
||||
if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
|
||||
print $langs->trans("Warehouse");
|
||||
}
|
||||
print '</td>';
|
||||
// Lot - serial
|
||||
if ($conf->productbatch->enabled) {
|
||||
print '<td>';
|
||||
if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
|
||||
@@ -724,6 +729,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
// Action
|
||||
if ($permissiontodelete) {
|
||||
print '<td></td>';
|
||||
}
|
||||
@@ -735,17 +741,26 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<td>';
|
||||
print $form->select_produits('', 'productidtoadd', '', 0, 0, -1, 2, '', 0, array(), 0, '1', 0, 'maxwidth300');
|
||||
print '</td>';
|
||||
// Qty
|
||||
print '<td class="right"><input type="text" name="qtytoadd" value="1" class="width50 right"></td>';
|
||||
// Cost price
|
||||
if ($permissiontoupdatecost && !empty($conf->global->MRP_SHOW_COST_FOR_CONSUMPTION)) {
|
||||
print '<td></td>';
|
||||
}
|
||||
print '<td class="right"></td>';
|
||||
// Qty already consumed
|
||||
print '<td></td>';
|
||||
// Warehouse
|
||||
print '<td>';
|
||||
print '<input type="submit" class="button buttongen" name="addconsumelinebutton" value="'.$langs->trans("Add").'">';
|
||||
print '</td>';
|
||||
// Lot - serial
|
||||
if ($conf->productbatch->enabled) {
|
||||
print '<td></td>';
|
||||
}
|
||||
// Action
|
||||
if ($permissiontodelete) {
|
||||
print '<td></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
@@ -119,6 +119,10 @@ class Partnership extends CommonObject
|
||||
public $date_partnership_end;
|
||||
public $count_last_url_check_error;
|
||||
public $last_check_backlink;
|
||||
|
||||
/**
|
||||
* @var string reason_decline_or_cancel
|
||||
*/
|
||||
public $reason_decline_or_cancel;
|
||||
// END MODULEBUILDER PROPERTIES
|
||||
|
||||
@@ -849,6 +853,7 @@ class Partnership extends CommonObject
|
||||
* Set refused status
|
||||
*
|
||||
* @param User $user Object user that modify
|
||||
* @param string $reasondeclinenote Reason decline
|
||||
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
|
||||
* @return int <0 if KO, 0=Nothing done, >0 if OK
|
||||
*/
|
||||
|
||||
@@ -67,8 +67,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php';
|
||||
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';
|
||||
|
||||
global $dolibarr_main_instance_unique_id;
|
||||
global $dolibarr_main_url_root;
|
||||
|
||||
// Init vars
|
||||
$errmsg = '';
|
||||
$num = 0;
|
||||
@@ -77,15 +82,15 @@ $backtopage = GETPOST('backtopage', 'alpha');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
$email = GETPOST("email");
|
||||
$societe = GETPOST("societe");
|
||||
|
||||
// Getting id from Post and decoding it
|
||||
$encodedid = GETPOST('id');
|
||||
$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id);
|
||||
$id = GETPOST('id');
|
||||
|
||||
$conference = new ConferenceOrBooth($db);
|
||||
$resultconf = $conference->fetch($id);
|
||||
if ($resultconf < 0) {
|
||||
setEventMessages(null, $object->errors, "errors");
|
||||
setEventMessages(null, $conference->errors, "errors");
|
||||
}
|
||||
|
||||
$project = new Project($db);
|
||||
@@ -95,16 +100,13 @@ if ($resultproject < 0) {
|
||||
$errmsg .= $project->error;
|
||||
}
|
||||
|
||||
// Getting 'securekey'.'id' from Post and decoding it
|
||||
$encodedsecurekeyandid = GETPOST('securekey', 'alpha');
|
||||
$securekeyandid = dol_decode($encodedsecurekeyandid, $dolibarr_main_instance_unique_id);
|
||||
|
||||
// Securekey decomposition into pure securekey and id added at the end
|
||||
$securekey = substr($securekeyandid, 0, strlen($securekeyandid)-strlen($encodedid));
|
||||
$idgotfromsecurekey = dol_decode(substr($securekeyandid, -strlen($encodedid), strlen($encodedid)), $dolibarr_main_instance_unique_id);
|
||||
// Security check
|
||||
$securekeyreceived = GETPOST('securekey', 'alpha');
|
||||
$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2);
|
||||
|
||||
// We check if the securekey collected is OK and if the id collected is the same than the id in the securekey
|
||||
if ($securekey != $conf->global->EVENTORGANIZATION_SECUREKEY || $idgotfromsecurekey != $id) {
|
||||
// We check if the securekey collected is OK
|
||||
if ($securekeytocompare != $securekeyreceived) {
|
||||
print $langs->trans('MissingOrBadSecureKey');
|
||||
exit;
|
||||
}
|
||||
@@ -188,6 +190,7 @@ function llxFooterVierge()
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
global $mysoc;
|
||||
$parameters = array();
|
||||
// Note that $action and $object may have been modified by some hooks
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);
|
||||
@@ -223,22 +226,64 @@ if (empty($reshook) && $action == 'add') {
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
// Vérifier si client existe par l'email
|
||||
$thirdparty = new Societe($db);
|
||||
$resultfetchthirdparty = $thirdparty->fetch('', '', '', '', '', '', '', '', '', '', $email);
|
||||
// Check if attendee already exists (by email and for this event)
|
||||
$confattendee = new ConferenceOrBoothAttendee($db);
|
||||
$resultfetchconfattendee = $confattendee->fetchAll('', '', 0, 0, array('t.fk_actioncomm'=>$id, 'customsql'=>'t.email="'.$email.'"'));
|
||||
if ($resultfetchconfattendee > 0 && count($resultfetchconfattendee)>0) {
|
||||
// Found confattendee
|
||||
$confattendee = array_shift($resultfetchconfattendee);
|
||||
} else {
|
||||
// Need to create a confattendee
|
||||
$confattendee->date_subscription = dol_now();
|
||||
$confattendee->email = $email;
|
||||
$confattendee->fk_actioncomm = $id;
|
||||
$resultconfattendee = $confattendee->create($user);
|
||||
if ($resultconfattendee < 0) {
|
||||
$error++;
|
||||
$errmsg .= $confattendee->error;
|
||||
}
|
||||
}
|
||||
// At this point, we have an attendee. It may not be linked to a thirdparty if we just created it
|
||||
|
||||
// If the attendee has already paid
|
||||
if ($confattendee->status == 1) {
|
||||
$securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2);
|
||||
$redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$id.'&securekey='.$securekeyurl;
|
||||
Header("Location: ".$redirection);
|
||||
exit;
|
||||
}
|
||||
// Getting the thirdparty or creating it
|
||||
$thirdparty = new Societe($db);
|
||||
// Fetch using fk_soc if the attendee was already existing
|
||||
if (!empty($confattendee->fk_soc)) {
|
||||
$resultfetchthirdparty = $thirdparty->fetch($confattendee->fk_soc);
|
||||
} else {
|
||||
// Fetch using the input field by user if we just created the attendee
|
||||
if (!empty($societe)) {
|
||||
$resultfetchthirdparty = $thirdparty->fetch('', $societe);
|
||||
if ($resultfetchthirdparty<=0) {
|
||||
// Need to create a new one (not found or multiple with the same name)
|
||||
$resultfetchthirdparty = 0;
|
||||
} else {
|
||||
// We found an unique result with that name, so we put in in fk_soc of attendee
|
||||
$confattendee->fk_soc = $thirdparty->id;
|
||||
$confattendee->update($user);
|
||||
}
|
||||
} else {
|
||||
// Need to create a thirdparty (put number>0 if we do not want to create a thirdparty for free-conferences)
|
||||
$resultfetchthirdparty = 0;
|
||||
}
|
||||
}
|
||||
if ($resultfetchthirdparty<0) {
|
||||
$error++;
|
||||
$errmsg .= $thirdparty->error;
|
||||
$readythirdparty = -1;
|
||||
} elseif ($resultfetchthirdparty==0) {
|
||||
// creation of a new thirdparty
|
||||
if (!empty(GETPOST("societe"))) {
|
||||
$thirdparty->name = GETPOST("societe");
|
||||
if (!empty($societe)) {
|
||||
$thirdparty->name = $societe;
|
||||
} else {
|
||||
$thirdparty->name = $email;
|
||||
}
|
||||
|
||||
$thirdparty->address = GETPOST("address");
|
||||
$thirdparty->zip = GETPOST("zipcode");
|
||||
$thirdparty->town = GETPOST("town");
|
||||
@@ -267,31 +312,131 @@ if (empty($reshook) && $action == 'add') {
|
||||
}
|
||||
$thirdparty->code_client = $tmpcode;
|
||||
$readythirdparty = $thirdparty->create($user);
|
||||
} else {
|
||||
// We have an existing thirdparty ready to use
|
||||
$readythirdparty = 1;
|
||||
}
|
||||
|
||||
if ($readythirdparty <0) {
|
||||
$error++;
|
||||
$errmsg .= $thirdparty->error;
|
||||
} else {
|
||||
// creation of an attendee
|
||||
$confattendee = new ConferenceOrBoothAttendee($db);
|
||||
$thirdparty->country_code = getCountry($thirdparty->country_id, 2, $db, $langs);
|
||||
$thirdparty->country = getCountry($thirdparty->country_code, 0, $db, $langs);
|
||||
$confattendee->fk_soc = $thirdparty->id;
|
||||
$confattendee->date_subscription = dol_now();
|
||||
$confattendee->email = GETPOST("email");
|
||||
$confattendee->fk_actioncomm = $id;
|
||||
$resultconfattendee = $confattendee->create($user);
|
||||
if ($resultconfattendee < 0) {
|
||||
$error++;
|
||||
$errmsg .= $confattendee->error;
|
||||
$confattendee->update($user);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
if (!empty(floatval($project->price_registration))) {
|
||||
$productforinvoicerow = new Product($db);
|
||||
$resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION);
|
||||
if ($resultprod < 0) {
|
||||
$error++;
|
||||
$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($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;
|
||||
}
|
||||
}
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
// Add line to draft invoice
|
||||
$vattouse = get_default_tva($mysoc, $thirdparty, $productforinvoicerow->id);
|
||||
$result = $facture->addline($langs->trans("ConferenceAttendeeFee", $conference->label, dol_print_date($conference->datep, '%d/%m/%y %H:%M:%S'), dol_print_date($conference->datep2, '%d/%m/%y %H:%M:%S')), floatval($project->price_registration), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, dol_now(), '', 0, 0, '', 'HT', 0, 1);
|
||||
if ($result <= 0) {
|
||||
$confattendee->error = $facture->error;
|
||||
$confattendee->errors = $facture->errors;
|
||||
$error++;
|
||||
}
|
||||
if (!$error) {
|
||||
$valid = true;
|
||||
$sourcetouse = 'conferencesubscription';
|
||||
$reftouse = $facture->id;
|
||||
$redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse;
|
||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
|
||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
|
||||
$redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical
|
||||
} else {
|
||||
$redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN;
|
||||
}
|
||||
}
|
||||
Header("Location: ".$redirection);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// No price has been set
|
||||
// Validating the subscription
|
||||
$confattendee->setStatut(1);
|
||||
|
||||
// Sending mail
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
// Set output language
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang);
|
||||
// Load traductions files required by page
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
// Get email content from template
|
||||
$arraydefaultmessage = null;
|
||||
|
||||
$labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT;
|
||||
if (!empty($labeltouse)) {
|
||||
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, '');
|
||||
}
|
||||
|
||||
if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
|
||||
$subject = $arraydefaultmessage->topic;
|
||||
$msg = $arraydefaultmessage->content;
|
||||
}
|
||||
|
||||
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty);
|
||||
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||
|
||||
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
|
||||
$texttosend = make_substitutions($msg, $substitutionarray, $outputlangs);
|
||||
|
||||
$sendto = $thirdparty->email;
|
||||
$from = $conf->global->MAILING_EMAIL_FROM;
|
||||
$urlback = $_SERVER["REQUEST_URI"];
|
||||
|
||||
$ishtml = dol_textishtml($texttosend); // May contain urls
|
||||
|
||||
$mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml);
|
||||
|
||||
$result = $mailfile->sendfile();
|
||||
if ($result) {
|
||||
dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment');
|
||||
} else {
|
||||
dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment');
|
||||
}
|
||||
|
||||
$securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2);
|
||||
$redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$id.'&securekey='.$securekeyurl;
|
||||
Header("Location: ".$redirection);
|
||||
exit;
|
||||
}
|
||||
//Header("Location: ".$urlback);
|
||||
//exit;
|
||||
} else {
|
||||
@@ -307,12 +452,6 @@ if (empty($reshook) && $action == 'add') {
|
||||
$form = new Form($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
|
||||
$conference = new ConferenceOrBooth($db);
|
||||
$resultconf = $conference->fetch($id);
|
||||
if ($resultconf < 0) {
|
||||
setEventMessages(null, $object->errors, "errors");
|
||||
}
|
||||
|
||||
llxHeaderVierge($langs->trans("NewSubscription"));
|
||||
|
||||
|
||||
@@ -324,12 +463,9 @@ print '<div id="divsubscribe">';
|
||||
print '<div class="center subscriptionformhelptext justify">';
|
||||
|
||||
// Welcome message
|
||||
print $langs->trans("EvntOrgWelcomeMessage");
|
||||
print $id.".".'<br>';
|
||||
print $langs->trans("EvntOrgStartDuration");
|
||||
print dol_print_date($conference->datep).' ';
|
||||
print $langs->trans("EvntOrgEndDuration");
|
||||
print ' '.dol_print_date($conference->datef).".";
|
||||
print $langs->trans("EvntOrgWelcomeMessage", $conference->label);
|
||||
print '<br>';
|
||||
print $langs->trans("EvntOrgDuration", dol_print_date($conference->datep), dol_print_date($conference->datef));
|
||||
print '</div>';
|
||||
|
||||
dol_htmloutput_errors($errmsg);
|
||||
@@ -339,8 +475,8 @@ print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="newmember">'.
|
||||
print '<input type="hidden" name="token" value="'.newToken().'" / >';
|
||||
print '<input type="hidden" name="entity" value="'.$entity.'" />';
|
||||
print '<input type="hidden" name="action" value="add" />';
|
||||
print '<input type="hidden" name="id" value="'.$encodedid.'" />';
|
||||
print '<input type="hidden" name="securekey" value="'.$encodedsecurekeyandid.'" />';
|
||||
print '<input type="hidden" name="id" value="'.$id.'" />';
|
||||
print '<input type="hidden" name="securekey" value="'.$securekeyreceived.'" />';
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
167
htdocs/public/eventorganization/subscriptionok.php
Normal file
167
htdocs/public/eventorganization/subscriptionok.php
Normal file
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2021 Waël Almoman <info@almoman.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/public/payment/paymentok.php
|
||||
* \ingroup core
|
||||
* \brief File to show page after a successful payment
|
||||
* This page is called by payment system with url provided to it completed with parameter TOKEN=xxx
|
||||
* This token can be used to get more informations.
|
||||
*/
|
||||
|
||||
if (!defined('NOLOGIN')) {
|
||||
define("NOLOGIN", 1); // This means this output page does not require to be logged.
|
||||
}
|
||||
if (!defined('NOCSRFCHECK')) {
|
||||
define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
|
||||
}
|
||||
if (!defined('NOIPCHECK')) {
|
||||
define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
|
||||
}
|
||||
if (!defined('NOBROWSERNOTIF')) {
|
||||
define('NOBROWSERNOTIF', '1');
|
||||
}
|
||||
|
||||
// For MultiCompany module.
|
||||
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
|
||||
// TODO This should be useless. Because entity must be retrieve from object ref and not from url.
|
||||
$entity = (!empty($_GET['e']) ? (int) $_GET['e'] : (!empty($_POST['e']) ? (int) $_POST['e'] : 1));
|
||||
if (is_numeric($entity)) {
|
||||
define("DOLENTITY", $entity);
|
||||
}
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
|
||||
if (!empty($conf->paypal->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypalfunctions.lib.php';
|
||||
}
|
||||
|
||||
global $dolibarr_main_instance_unique_id, $dolibarr_main_url_root, $mysoc;
|
||||
|
||||
$langs->loadLangs(array("main", "companies", "install", "other", "eventorganization"));
|
||||
|
||||
$object = new stdClass(); // For triggers
|
||||
|
||||
$error = 0;
|
||||
|
||||
// Security check
|
||||
$id = GETPOST("id");
|
||||
$securekeyreceived = GETPOST("securekey");
|
||||
$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2);
|
||||
|
||||
if ($securekeyreceived != $securekeytocompare) {
|
||||
print $langs->trans('MissingOrBadSecureKey');
|
||||
exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
dol_syslog("Callback url when a payment was done. query_string=".(dol_escape_htmltag($_SERVER["QUERY_STRING"]) ?dol_escape_htmltag($_SERVER["QUERY_STRING"]) : '')." script_uri=".(dol_escape_htmltag($_SERVER["SCRIPT_URI"]) ?dol_escape_htmltag($_SERVER["SCRIPT_URI"]) : ''), LOG_DEBUG, 0, '_payment');
|
||||
|
||||
$tracepost = "";
|
||||
foreach ($_POST as $k => $v) {
|
||||
$tracepost .= "{$k} - {$v}\n";
|
||||
}
|
||||
dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_payment');
|
||||
|
||||
$head = '';
|
||||
if (!empty($conf->global->ONLINE_PAYMENT_CSS_URL)) {
|
||||
$head = '<link rel="stylesheet" type="text/css" href="'.$conf->global->ONLINE_PAYMENT_CSS_URL.'?lang='.$langs->defaultlang.'">'."\n";
|
||||
}
|
||||
|
||||
$conf->dol_hide_topmenu = 1;
|
||||
$conf->dol_hide_leftmenu = 1;
|
||||
|
||||
$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '<div>' : '').'<div>';
|
||||
llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea);
|
||||
|
||||
|
||||
// Show message
|
||||
print '<span id="dolpaymentspan"></span>'."\n";
|
||||
print '<div id="dolpaymentdiv" class="center">'."\n";
|
||||
|
||||
|
||||
// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo)
|
||||
// Define logo and logosmall
|
||||
$logosmall = $mysoc->logo_small;
|
||||
$logo = $mysoc->logo;
|
||||
$paramlogo = 'ONLINE_PAYMENT_LOGO_'.$suffix;
|
||||
if (!empty($conf->global->$paramlogo)) {
|
||||
$logosmall = $conf->global->$paramlogo;
|
||||
} elseif (!empty($conf->global->ONLINE_PAYMENT_LOGO)) {
|
||||
$logosmall = $conf->global->ONLINE_PAYMENT_LOGO;
|
||||
}
|
||||
//print '<!-- Show logo (logosmall='.$logosmall.' logo='.$logo.') -->'."\n";
|
||||
// Define urllogo
|
||||
$urllogo = '';
|
||||
$urllogofull = '';
|
||||
if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) {
|
||||
$urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall);
|
||||
$urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall);
|
||||
} elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) {
|
||||
$urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo);
|
||||
$urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo);
|
||||
}
|
||||
|
||||
// Output html code for logo
|
||||
if ($urllogo) {
|
||||
print '<div class="backgreypublicpayment">';
|
||||
print '<div class="logopublicpayment">';
|
||||
print '<img id="dolpaymentlogo" src="'.$urllogo.'"';
|
||||
print '>';
|
||||
print '</div>';
|
||||
if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
|
||||
print '<div class="poweredbypublicpayment opacitymedium right"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans("PoweredBy").'<br><img class="poweredbyimg" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
|
||||
}
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
print '<br><br><br>';
|
||||
|
||||
print $langs->trans("SubscriptionOk");
|
||||
|
||||
print "\n</div>\n";
|
||||
|
||||
|
||||
htmlPrintOnlinePaymentFooter($mysoc, $langs, 0, $suffix);
|
||||
|
||||
|
||||
// Clean session variables to avoid duplicate actions if post is resent
|
||||
unset($_SESSION["FinalPaymentAmt"]);
|
||||
unset($_SESSION["TRANSACTIONID"]);
|
||||
|
||||
|
||||
llxFooter('', 'public');
|
||||
|
||||
$db->close();
|
||||
@@ -6,6 +6,7 @@
|
||||
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
|
||||
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2021 Waël Almoman <info@almoman.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -543,6 +544,10 @@ jQuery(document).ready(function () {
|
||||
document.newmember.action.value="create";
|
||||
document.newmember.submit();
|
||||
});
|
||||
jQuery("#typeid").change(function() {
|
||||
document.newmember.action.value="create";
|
||||
document.newmember.submit();
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
@@ -561,7 +566,7 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) {
|
||||
$isempty = 0;
|
||||
}
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Type").' <FONT COLOR="red">*</FONT></td><td>';
|
||||
print $form->selectarray("typeid", $adht->liste_array(), GETPOST('typeid') ? GETPOST('typeid') : $defaulttype, $isempty);
|
||||
print $form->selectarray("typeid", $adht->liste_array(1), GETPOST('typeid') ? GETPOST('typeid') : $defaulttype, $isempty);
|
||||
print '</td></tr>'."\n";
|
||||
} else {
|
||||
$adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE);
|
||||
@@ -704,7 +709,8 @@ if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER
|
||||
// $conf->global->MEMBER_NEWFORM_SHOWAMOUNT is an amount
|
||||
|
||||
// Set amount for the subscription
|
||||
$amount = isset($amount) ? $amount : 0;
|
||||
$amountbytype = $adht->amountByType(1);
|
||||
$amount = !empty($amountbytype[GETPOST('typeid', 'int')]) ? $amountbytype[GETPOST('typeid', 'int')] : (isset($amount) ? $amount : 0);
|
||||
|
||||
if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
|
||||
$amount = $conf->global->MEMBER_NEWFORM_AMOUNT;
|
||||
@@ -713,6 +719,9 @@ if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER
|
||||
if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) {
|
||||
$amount = $amount ? $amount : (GETPOST('amount') ? GETPOST('amount') : $conf->global->MEMBER_NEWFORM_AMOUNT);
|
||||
}
|
||||
|
||||
$amount = price2num($amount);
|
||||
|
||||
// $conf->global->MEMBER_NEWFORM_PAYONLINE is 'paypal', 'paybox' or 'stripe'
|
||||
print '<tr><td>'.$langs->trans("Subscription").'</td><td class="nowrap">';
|
||||
if (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) {
|
||||
|
||||
@@ -59,13 +59,19 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
// Hook to be used by external payment modules (ie Payzen, ...)
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager = new HookManager($db);
|
||||
$hookmanager->initHooks(array('newpayment'));
|
||||
|
||||
// For encryption
|
||||
global $dolibarr_main_instance_unique_id;
|
||||
|
||||
// Load translation files
|
||||
$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox", "paypal", "stripe")); // File with generic data
|
||||
|
||||
@@ -106,6 +112,38 @@ if (!$action) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($source == 'conferencesubscription') {
|
||||
// Finding the Attendee
|
||||
$invoiceid = GETPOST('ref');
|
||||
$invoice = new Facture($db);
|
||||
$resultinvoice = $invoice->fetch($invoiceid);
|
||||
if ($resultinvoice <= 0) {
|
||||
setEventMessages(null, $invoice->errors, "errors");
|
||||
} else {
|
||||
$invoice->fetchObjectLinked();
|
||||
$linkedAttendees = $invoice->linkedObjectsIds['conferenceorboothattendee'];
|
||||
|
||||
if (is_array($linkedAttendees)) {
|
||||
$linkedAttendees = array_values($linkedAttendees);
|
||||
|
||||
$attendee = new ConferenceOrBoothAttendee($db);
|
||||
$resultattendee = $attendee->fetch($linkedAttendees[0]);
|
||||
if ($resultattendee <= 0) {
|
||||
setEventMessages(null, $attendee->errors, "errors");
|
||||
} else {
|
||||
$amount = price2num($invoice->total_ttc);
|
||||
// Finding the associated thirdparty
|
||||
$thirdparty = new Societe($db);
|
||||
$resultthirdparty = $thirdparty->fetch($invoice->socid);
|
||||
if ($resultthirdparty <= 0) {
|
||||
setEventMessages(null, $thirdparty->errors, "errors");
|
||||
}
|
||||
$object = $thirdparty;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$paymentmethod = GETPOST('paymentmethod', 'alphanohtml') ?GETPOST('paymentmethod', 'alphanohtml') : ''; // Empty in most cases. Defined when a payment mode is forced
|
||||
$validpaymentmethod = array();
|
||||
@@ -132,6 +170,7 @@ $ref = $REF = GETPOST('ref', 'alpha');
|
||||
$TAG = GETPOST("tag", 'alpha');
|
||||
$FULLTAG = GETPOST("fulltag", 'alpha'); // fulltag is tag with more informations
|
||||
$SECUREKEY = GETPOST("securekey"); // Secure key
|
||||
|
||||
if ($paymentmethod && !preg_match('/'.preg_quote('PM='.$paymentmethod, '/').'/', $FULLTAG)) {
|
||||
$FULLTAG .= ($FULLTAG ? '.' : '').'PM='.$paymentmethod;
|
||||
}
|
||||
@@ -1723,6 +1762,94 @@ if ($source == 'donation') {
|
||||
print '<input type="hidden" name="desc" value="'.dol_escape_htmltag($labeldesc).'">'."\n";
|
||||
}
|
||||
|
||||
if ($source == 'conferencesubscription') {
|
||||
$found = true;
|
||||
$langs->load("members");
|
||||
|
||||
if (GETPOST('fulltag', 'alpha')) {
|
||||
$fulltag = GETPOST('fulltag', 'alpha');
|
||||
} else {
|
||||
$fulltag = 'ATT='.$attendee->id.'.DAT='.dol_print_date(dol_now(), '%Y%m%d%H%M%S');
|
||||
if (!empty($TAG)) {
|
||||
$tag = $TAG; $fulltag .= '.TAG='.$TAG;
|
||||
}
|
||||
}
|
||||
$fulltag = dol_string_unaccent($fulltag);
|
||||
|
||||
// Creditor
|
||||
print '<tr class="CTableRow'.($var ? '1' : '2').'"><td class="CTableRow'.($var ? '1' : '2').'">'.$langs->trans("Creditor");
|
||||
print '</td><td class="CTableRow'.($var ? '1' : '2').'"><b>'.$creditor.'</b>';
|
||||
print '<input type="hidden" name="creditor" value="'.$creditor.'">';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Debitor
|
||||
print '<tr class="CTableRow'.($var ? '1' : '2').'"><td class="CTableRow'.($var ? '1' : '2').'">'.$langs->trans("Attendee");
|
||||
print '</td><td class="CTableRow'.($var ? '1' : '2').'"><b>';
|
||||
print $thirdparty->name;
|
||||
print '</b>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Object
|
||||
$text = '<b>'.$langs->trans("PaymentConferenceAttendee").'</b>';
|
||||
if (GETPOST('desc', 'alpha')) {
|
||||
$text = '<b>'.$langs->trans(GETPOST('desc', 'alpha')).'</b>';
|
||||
}
|
||||
print '<tr class="CTableRow'.($var ? '1' : '2').'"><td class="CTableRow'.($var ? '1' : '2').'">'.$langs->trans("Designation");
|
||||
print '</td><td class="CTableRow'.($var ? '1' : '2').'">'.$text;
|
||||
print '<input type="hidden" name="source" value="'.dol_escape_htmltag($source).'">';
|
||||
print '<input type="hidden" name="ref" value="'.dol_escape_htmltag($invoice->id).'">';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Amount
|
||||
print '<tr class="CTableRow'.($var ? '1' : '2').'"><td class="CTableRow'.($var ? '1' : '2').'">'.$langs->trans("Amount");
|
||||
print '</td><td class="CTableRow'.($var ? '1' : '2').'">';
|
||||
$valtoshow = $amount;
|
||||
print '<b>'.price($valtoshow).'</b>';
|
||||
print '<input type="hidden" name="amount" value="'.$valtoshow.'">';
|
||||
print '<input type="hidden" name="newamount" value="'.$valtoshow.'">';
|
||||
|
||||
// Currency
|
||||
print ' <b>'.$langs->trans("Currency".$currency).'</b>';
|
||||
print '<input type="hidden" name="currency" value="'.$currency.'">';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Tag
|
||||
print '<tr class="CTableRow'.($var ? '1' : '2').'"><td class="CTableRow'.($var ? '1' : '2').'">'.$langs->trans("PaymentCode");
|
||||
print '</td><td class="CTableRow'.($var ? '1' : '2').'"><b style="word-break: break-all;">'.$fulltag.'</b>';
|
||||
print '<input type="hidden" name="tag" value="'.$tag.'">';
|
||||
print '<input type="hidden" name="fulltag" value="'.$fulltag.'">';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Shipping address
|
||||
$shipToName = $thirdparty->getFullName($langs);
|
||||
$shipToStreet = $thirdparty->address;
|
||||
$shipToCity = $thirdparty->town;
|
||||
$shipToState = $thirdparty->state_code;
|
||||
$shipToCountryCode = $thirdparty->country_code;
|
||||
$shipToZip = $thirdparty->zip;
|
||||
$shipToStreet2 = '';
|
||||
$phoneNum = $thirdparty->phone;
|
||||
if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip) {
|
||||
print '<!-- Shipping address information -->';
|
||||
print '<input type="hidden" name="shipToName" value="'.$shipToName.'">'."\n";
|
||||
print '<input type="hidden" name="shipToStreet" value="'.$shipToStreet.'">'."\n";
|
||||
print '<input type="hidden" name="shipToCity" value="'.$shipToCity.'">'."\n";
|
||||
print '<input type="hidden" name="shipToState" value="'.$shipToState.'">'."\n";
|
||||
print '<input type="hidden" name="shipToCountryCode" value="'.$shipToCountryCode.'">'."\n";
|
||||
print '<input type="hidden" name="shipToZip" value="'.$shipToZip.'">'."\n";
|
||||
print '<input type="hidden" name="shipToStreet2" value="'.$shipToStreet2.'">'."\n";
|
||||
print '<input type="hidden" name="phoneNum" value="'.$phoneNum.'">'."\n";
|
||||
} else {
|
||||
print '<!-- Shipping address not complete, so we don t use it -->'."\n";
|
||||
}
|
||||
print '<input type="hidden" name="thirdparty_id" value="'.$thirdparty->id.'">'."\n";
|
||||
print '<input type="hidden" name="email" value="'.$thirdparty->email.'">'."\n";
|
||||
$labeldesc = $langs->trans("PaymentSubscription");
|
||||
if (GETPOST('desc', 'alpha')) {
|
||||
$labeldesc = GETPOST('desc', 'alpha');
|
||||
}
|
||||
print '<input type="hidden" name="desc" value="'.dol_escape_htmltag($labeldesc).'">'."\n";
|
||||
}
|
||||
|
||||
if (!$found && !$mesg) {
|
||||
$mesg = $langs->trans("ErrorBadParameters");
|
||||
@@ -1753,7 +1880,7 @@ if ($action != 'dopayment') {
|
||||
print '<br><br><span class="amountpaymentcomplete size15x">'.$langs->trans("DonationPaid").'</span>';
|
||||
} else {
|
||||
// Membership can be paid and we still allow to make renewal
|
||||
if ($source == 'membersubscription' && $object->datefin > dol_now()) {
|
||||
if (($source == 'member' || $source == 'membersubscription') && $object->datefin > dol_now()) {
|
||||
$langs->load("members");
|
||||
print '<br><span class="amountpaymentcomplete size15x">'.$langs->trans("MembershipPaid", dol_print_date($object->datefin, 'day')).'</span><br>';
|
||||
print '<div class="opacitymedium margintoponly">'.$langs->trans("PaymentWillBeRecordedForNextPeriod").'</div>';
|
||||
|
||||
@@ -51,12 +51,15 @@ if (is_numeric($entity)) {
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php';
|
||||
|
||||
if (!empty($conf->paypal->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypalfunctions.lib.php';
|
||||
}
|
||||
|
||||
global $dolibarr_main_instance_unique_id;
|
||||
|
||||
$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "paybox", "paypal"));
|
||||
|
||||
// Clean parameters
|
||||
@@ -912,6 +915,177 @@ 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)
|
||||
} elseif (array_key_exists('ATT', $tmptag) && $tmptag['ATT'] > 0) {
|
||||
// Record payment
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
$object = new Facture($db);
|
||||
$result = $object->fetch($ref);
|
||||
if ($result) {
|
||||
$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
|
||||
|
||||
$paymentTypeId = 0;
|
||||
if ($paymentmethod == 'paybox') {
|
||||
$paymentTypeId = $conf->global->PAYBOX_PAYMENT_MODE_FOR_PAYMENTS;
|
||||
}
|
||||
if ($paymentmethod == 'paypal') {
|
||||
$paymentTypeId = $conf->global->PAYPAL_PAYMENT_MODE_FOR_PAYMENTS;
|
||||
}
|
||||
if ($paymentmethod == 'stripe') {
|
||||
$paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS;
|
||||
}
|
||||
if (empty($paymentTypeId)) {
|
||||
$paymentType = $_SESSION["paymentType"];
|
||||
if (empty($paymentType)) {
|
||||
$paymentType = 'CB';
|
||||
}
|
||||
$paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1);
|
||||
}
|
||||
|
||||
$currencyCodeType = $_SESSION['currencyCodeType'];
|
||||
|
||||
// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)
|
||||
if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) {
|
||||
$resultvalidate = $object->validate($user);
|
||||
if ($resultvalidate < 0) {
|
||||
$postactionmessages[] = 'Cannot validate invoice';
|
||||
$ispostactionok = -1;
|
||||
$error++; // Not yet supported
|
||||
} else {
|
||||
$db->begin();
|
||||
|
||||
// Creation of payment line
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
$paiement = new Paiement($db);
|
||||
$paiement->datepaye = $now;
|
||||
if ($currencyCodeType == $conf->currency) {
|
||||
$paiement->amounts = array($object->id => $FinalPaymentAmt); // Array with all payments dispatching with invoice id
|
||||
} else {
|
||||
$paiement->multicurrency_amounts = array($object->id => $FinalPaymentAmt); // Array with all payments dispatching
|
||||
|
||||
$postactionmessages[] = 'Payment was done in a different currency that currency expected of company';
|
||||
$ispostactionok = -1;
|
||||
$error++; // Not yet supported
|
||||
}
|
||||
$paiement->paiementid = $paymentTypeId;
|
||||
$paiement->num_payment = '';
|
||||
$paiement->note_public = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress;
|
||||
$paiement->ext_payment_id = $TRANSACTIONID;
|
||||
$paiement->ext_payment_site = $service;
|
||||
|
||||
if (!$error) {
|
||||
$paiement_id = $paiement->create($user, 1); // This include closing invoices and regenerating documents
|
||||
if ($paiement_id < 0) {
|
||||
$postactionmessages[] = $paiement->error.' '.join("<br>\n", $paiement->errors);
|
||||
$ispostactionok = -1;
|
||||
$error++;
|
||||
} else {
|
||||
$postactionmessages[] = 'Payment created';
|
||||
$ispostactionok = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error && !empty($conf->banque->enabled)) {
|
||||
$bankaccountid = 0;
|
||||
if ($paymentmethod == 'paybox') {
|
||||
$bankaccountid = $conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS;
|
||||
} elseif ($paymentmethod == 'paypal') {
|
||||
$bankaccountid = $conf->global->PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS;
|
||||
} elseif ($paymentmethod == 'stripe') {
|
||||
$bankaccountid = $conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS;
|
||||
}
|
||||
|
||||
if ($bankaccountid > 0) {
|
||||
$label = '(CustomerInvoicePayment)';
|
||||
if ($object->type == Facture::TYPE_CREDIT_NOTE) {
|
||||
$label = '(CustomerInvoicePaymentBack)'; // Refund of a credit note
|
||||
}
|
||||
$result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, '', '');
|
||||
if ($result < 0) {
|
||||
$postactionmessages[] = $paiement->error.' '.join("<br>\n", $paiement->errors);
|
||||
$ispostactionok = -1;
|
||||
$error++;
|
||||
} else {
|
||||
$postactionmessages[] = 'Bank transaction of payment created';
|
||||
$ispostactionok = 1;
|
||||
}
|
||||
} else {
|
||||
$postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.';
|
||||
$ispostactionok = -1;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
|
||||
// Validating the attendee
|
||||
$attendeetovalidate = new ConferenceOrBoothAttendee($db);
|
||||
$resultattendee = $attendeetovalidate->fetch($tmptag['ATT']);
|
||||
if ($resultattendee < 0) {
|
||||
setEventMessages(null, $attendeetovalidate->errors, "errors");
|
||||
} else {
|
||||
$attendeetovalidate->setStatut(1);
|
||||
|
||||
// Sending mail
|
||||
$thirdparty = new Societe($db);
|
||||
$thirdparty->fetch($attendeetovalidate->fk_soc);
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
// Set output language
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang);
|
||||
// Load traductions files required by page
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
// Get email content from template
|
||||
$arraydefaultmessage = null;
|
||||
|
||||
$labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT;
|
||||
if (!empty($labeltouse)) {
|
||||
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, '');
|
||||
}
|
||||
|
||||
if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
|
||||
$subject = $arraydefaultmessage->topic;
|
||||
$msg = $arraydefaultmessage->content;
|
||||
}
|
||||
|
||||
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty);
|
||||
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||
|
||||
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
|
||||
$texttosend = make_substitutions($msg, $substitutionarray, $outputlangs);
|
||||
|
||||
$sendto = $thirdparty->email;
|
||||
$from = $conf->global->MAILING_EMAIL_FROM;
|
||||
$urlback = $_SERVER["REQUEST_URI"];
|
||||
|
||||
$ishtml = dol_textishtml($texttosend); // May contain urls
|
||||
|
||||
$mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml);
|
||||
|
||||
$result = $mailfile->sendfile();
|
||||
if ($result) {
|
||||
dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment');
|
||||
} else {
|
||||
dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$postactionmessages[] = 'Failed to get a valid value for "amount paid" ('.$FinalPaymentAmt.') or "payment type" ('.$paymentType.') to record the payment of invoice '.$tmptag['ATT'].'. May be payment was already recorded.';
|
||||
$ispostactionok = -1;
|
||||
}
|
||||
} else {
|
||||
$postactionmessages[] = 'Invoice paid '.$tmptag['ATT'].' was not found';
|
||||
$ispostactionok = -1;
|
||||
}
|
||||
} elseif (array_key_exists('BOO', $tmptag) && $tmptag['BOO'] > 0) {
|
||||
// @todo BOOTH CASE (to copy and adapt from above)
|
||||
} else {
|
||||
// Nothing done
|
||||
}
|
||||
|
||||
228
htdocs/public/project/index.php
Normal file
228
htdocs/public/project/index.php
Normal file
@@ -0,0 +1,228 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2018 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2018-2019 Thibault FOUCART <support@ptibogxiv.net>
|
||||
* Copyright (C) 2021 Waël Almoman <info@almoman.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For Paypal test: https://developer.paypal.com/
|
||||
* For Paybox test: ???
|
||||
* For Stripe test: Use credit card 4242424242424242 .More example on https://stripe.com/docs/testing
|
||||
*
|
||||
* Variants:
|
||||
* - When option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION is on, we use the new PaymentIntent API
|
||||
* - When option STRIPE_USE_NEW_CHECKOUT is on, we use the new checkout API
|
||||
* - If no option set, we use old APIS (charge)
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/public/payment/newpayment.php
|
||||
* \ingroup core
|
||||
* \brief File to offer a way to make a payment for a particular Dolibarr object
|
||||
*/
|
||||
|
||||
if (!defined('NOLOGIN')) {
|
||||
define("NOLOGIN", 1); // This means this output page does not require to be logged.
|
||||
}
|
||||
if (!defined('NOCSRFCHECK')) {
|
||||
define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
|
||||
}
|
||||
if (!defined('NOIPCHECK')) {
|
||||
define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
|
||||
}
|
||||
if (!defined('NOBROWSERNOTIF')) {
|
||||
define('NOBROWSERNOTIF', '1');
|
||||
}
|
||||
|
||||
// For MultiCompany module.
|
||||
// Do not use GETPOST here, function is not defined and get of entity must be done before including main.inc.php
|
||||
$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : (!empty($_GET['e']) ? (int) $_GET['e'] : (!empty($_POST['e']) ? (int) $_POST['e'] : 1))));
|
||||
if (is_numeric($entity)) {
|
||||
define("DOLENTITY", $entity);
|
||||
}
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
// Hook to be used by external payment modules (ie Payzen, ...)
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager = new HookManager($db);
|
||||
$hookmanager->initHooks(array('newpayment'));
|
||||
|
||||
// For encryption
|
||||
global $dolibarr_main_instance_unique_id;
|
||||
|
||||
// Load translation files
|
||||
$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox", "paypal", "stripe")); // File with generic data
|
||||
|
||||
// Security check
|
||||
// No check on module enabled. Done later according to $validpaymentmethod
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$id = GETPOST('id');
|
||||
$securekeyreceived = GETPOST("securekey");
|
||||
$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2);
|
||||
|
||||
if ($securekeytocompare != $securekeyreceived) {
|
||||
print $langs->trans('MissingOrBadSecureKey');
|
||||
exit;
|
||||
}
|
||||
|
||||
// Define $urlwithroot
|
||||
//$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
|
||||
//$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||
$urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current. For Paypal payment, we can use internal URL like localhost.
|
||||
|
||||
$project = new Project($db);
|
||||
$resultproject = $project->fetch($id);
|
||||
if ($resultproject < 0) {
|
||||
$error++;
|
||||
$errmsg .= $project->error;
|
||||
}
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$head = '';
|
||||
if (!empty($conf->global->ONLINE_PAYMENT_CSS_URL)) {
|
||||
$head = '<link rel="stylesheet" type="text/css" href="'.$conf->global->ONLINE_PAYMENT_CSS_URL.'?lang='.$langs->defaultlang.'">'."\n";
|
||||
}
|
||||
|
||||
$conf->dol_hide_topmenu = 1;
|
||||
$conf->dol_hide_leftmenu = 1;
|
||||
|
||||
$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '<div>' : '').'<div>';
|
||||
llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea);
|
||||
|
||||
|
||||
// Show sandbox warning
|
||||
if ((empty($paymentmethod) || $paymentmethod == 'paypal') && !empty($conf->paypal->enabled) && (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox', 'int'))) { // We can force sand box with param 'forcesandbox'
|
||||
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Paypal'), '', 'warning');
|
||||
}
|
||||
if ((empty($paymentmethod) || $paymentmethod == 'stripe') && !empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'int'))) {
|
||||
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning');
|
||||
}
|
||||
|
||||
|
||||
print '<span id="dolpaymentspan"></span>'."\n";
|
||||
print '<div class="center">'."\n";
|
||||
print '<form id="dolpaymentform" class="center" name="paymentform" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
|
||||
print '<input type="hidden" name="action" value="dopayment">'."\n";
|
||||
print '<input type="hidden" name="tag" value="'.GETPOST("tag", 'alpha').'">'."\n";
|
||||
print '<input type="hidden" name="suffix" value="'.dol_escape_htmltag($suffix).'">'."\n";
|
||||
print '<input type="hidden" name="securekey" value="'.dol_escape_htmltag($SECUREKEY).'">'."\n";
|
||||
print '<input type="hidden" name="e" value="'.$entity.'" />';
|
||||
print '<input type="hidden" name="forcesandbox" value="'.GETPOST('forcesandbox', 'int').'" />';
|
||||
print "\n";
|
||||
|
||||
|
||||
// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo)
|
||||
// Define logo and logosmall
|
||||
$logosmall = $mysoc->logo_small;
|
||||
$logo = $mysoc->logo;
|
||||
$paramlogo = 'ONLINE_PAYMENT_LOGO_'.$suffix;
|
||||
if (!empty($conf->global->$paramlogo)) {
|
||||
$logosmall = $conf->global->$paramlogo;
|
||||
} elseif (!empty($conf->global->ONLINE_PAYMENT_LOGO)) {
|
||||
$logosmall = $conf->global->ONLINE_PAYMENT_LOGO;
|
||||
}
|
||||
//print '<!-- Show logo (logosmall='.$logosmall.' logo='.$logo.') -->'."\n";
|
||||
// Define urllogo
|
||||
$urllogo = '';
|
||||
$urllogofull = '';
|
||||
if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) {
|
||||
$urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall);
|
||||
$urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall);
|
||||
} elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) {
|
||||
$urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo);
|
||||
$urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo);
|
||||
}
|
||||
|
||||
// Output html code for logo
|
||||
if ($urllogo) {
|
||||
print '<div class="backgreypublicpayment">';
|
||||
print '<div class="logopublicpayment">';
|
||||
print '<img id="dolpaymentlogo" src="'.$urllogo.'"';
|
||||
print '>';
|
||||
print '</div>';
|
||||
if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
|
||||
print '<div class="poweredbypublicpayment opacitymedium right"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans("PoweredBy").'<br><img class="poweredbyimg" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
|
||||
}
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
print '<table id="dolpaymenttable" summary="Payment form" class="center">'."\n";
|
||||
|
||||
$text = '<tr><td class="textpublicpayment"><br><strong>'.$langs->trans("EvntOrgRegistrationWelcomeMessage").'</strong></td></tr>'."\n";
|
||||
$text .= '<tr><td class="textpublicpayment">'.$langs->trans("EvntOrgRegistrationHelpMessage").' '.$id.'.<br><br></td></tr>'."\n";
|
||||
$text .= '<tr><td class="textpublicpayment">'.$project->note_public.'<br><br></td></tr>'."\n";;
|
||||
|
||||
print $text;
|
||||
|
||||
// Output payment summary form
|
||||
print '<tr><td align="center">';
|
||||
|
||||
$found = false;
|
||||
$error = 0;
|
||||
$var = false;
|
||||
|
||||
$object = null;
|
||||
|
||||
print "\n";
|
||||
|
||||
|
||||
// Show all action buttons
|
||||
print '<br>';
|
||||
// Output introduction text
|
||||
if ($project->accept_conference_suggestions) {
|
||||
print '<input type="submit" value="'.$langs->trans("SuggestConference").'" id="suggestconference" class="button">';
|
||||
print '<br><br>';
|
||||
}
|
||||
print '<input type="submit" value="'.$langs->trans("ViewAndVote").'" id="viewandvote" class="button">';
|
||||
print '<br><br>';
|
||||
if ($project->accept_booth_suggestions) {
|
||||
print '<input type="submit" value="'.$langs->trans("SuggestBooth").'" id="suggestbooth" class="button">';
|
||||
}
|
||||
|
||||
|
||||
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '</table>'."\n";
|
||||
|
||||
print '</form>'."\n";
|
||||
print '</div>'."\n";
|
||||
print '<br>';
|
||||
|
||||
|
||||
htmlPrintOnlinePaymentFooter($mysoc, $langs, 1, $suffix, $object);
|
||||
|
||||
llxFooter('', 'public');
|
||||
|
||||
$db->close();
|
||||
@@ -270,7 +270,8 @@ if (empty($reshook)) {
|
||||
'Product' => '/product/class/product.class.php',
|
||||
'Project' => '/projet/class/project.class.php',
|
||||
'Ticket' => '/ticket/class/ticket.class.php',
|
||||
'User' => '/user/class/user.class.php'
|
||||
'User' => '/user/class/user.class.php',
|
||||
'Account' => '/compta/bank/class/account.class.php',
|
||||
);
|
||||
|
||||
//First, all core objects must update their tables
|
||||
|
||||
@@ -445,7 +445,8 @@ class Thirdparties extends DolibarrApi
|
||||
'Product' => '/product/class/product.class.php',
|
||||
'Project' => '/projet/class/project.class.php',
|
||||
'Ticket' => '/ticket/class/ticket.class.php',
|
||||
'User' => '/user/class/user.class.php'
|
||||
'User' => '/user/class/user.class.php',
|
||||
'Account' => '/compta/bank/class/account.class.php'
|
||||
);
|
||||
|
||||
//First, all core objects must update their tables
|
||||
|
||||
@@ -352,7 +352,7 @@ if (!empty($sql_select)) {
|
||||
$sql .= " AND ".$doc_number." LIKE '%".$db->escape($sref)."%'";
|
||||
}
|
||||
if ($sprod_fulldescr) {
|
||||
$sql .= " AND (d.description LIKE '%".$db->escape($sprod_fulldescr)."%'";
|
||||
$sql .= " AND (d.description LIKE '%".$db->escape($sprod_fulldescr)."%' OR d.description LIKE '%".$db->escape(dol_htmlentities($sprod_fulldescr))."%'";
|
||||
if (GETPOST('type_element') != 'fichinter') {
|
||||
$sql .= " OR p.ref LIKE '%".$db->escape($sprod_fulldescr)."%'";
|
||||
}
|
||||
|
||||
@@ -631,7 +631,8 @@ if ($action == "delete") {
|
||||
if ($action == "updateqty") {
|
||||
foreach ($invoice->lines as $line) {
|
||||
if ($line->id == $idline) {
|
||||
$result = $invoice->updateline($line->id, $line->desc, $line->subprice, $number, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
|
||||
if (!$user->rights->takepos->editlines || (!$user->rights->takepos->editorderedlines && $line->special_code == "4")) dol_htmloutput_errors($langs->trans("NotEnoughPermissions", "TakePos"), null, 1);
|
||||
else $result = $invoice->updateline($line->id, $line->desc, $line->subprice, $number, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -653,7 +654,8 @@ if ($action == "updateprice") {
|
||||
if ($usercanproductignorepricemin && (!empty($price_min) && (price2num($pu_ht) * (1 - price2num($line->remise_percent) / 100) < price2num($price_min)))) {
|
||||
echo $langs->trans("CantBeLessThanMinPrice");
|
||||
} else {
|
||||
$result = $invoice->updateline($line->id, $line->desc, $number, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'TTC', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
|
||||
if (!$user->rights->takepos->editlines || (!$user->rights->takepos->editorderedlines && $line->special_code == "4")) dol_htmloutput_errors($langs->trans("NotEnoughPermissions", "TakePos"), null, 1);
|
||||
else $result = $invoice->updateline($line->id, $line->desc, $number, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'TTC', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -675,7 +677,8 @@ if ($action == "updatereduction") {
|
||||
if ($usercanproductignorepricemin && (!empty($price_min) && (price2num($line->multicurrency_subprice) * (1 - price2num($number) / 100) < price2num($price_min)))) {
|
||||
echo $langs->trans("CantBeLessThanMinPrice");
|
||||
} else {
|
||||
$result = $invoice->updateline($line->id, $line->desc, $line->multicurrency_subprice, $line->qty, $number, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
|
||||
if (!$user->rights->takepos->editlines || (!$user->rights->takepos->editorderedlines && $line->special_code == "4")) dol_htmloutput_errors($langs->trans("NotEnoughPermissions", "TakePos"), null, 1);
|
||||
else $result = $invoice->updateline($line->id, $line->desc, $line->multicurrency_subprice, $line->qty, $number, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4790,7 +4790,6 @@ span.websitebuttonsitepreviewdisabled img, a.websitebuttonsitepreviewdisabled im
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ============================================================================== */
|
||||
/* Module agenda */
|
||||
/* ============================================================================== */
|
||||
@@ -6991,6 +6990,10 @@ div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before
|
||||
input#addedfile {
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
#divbodywebsite {
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 320px)
|
||||
|
||||
@@ -3399,7 +3399,7 @@ class User extends CommonObject
|
||||
$sql .= " WHERE t.entity IN (".getEntity('user').")";
|
||||
}
|
||||
} else {
|
||||
$sql .= " WHERE 1";
|
||||
$sql .= " WHERE 1 = 1";
|
||||
}
|
||||
|
||||
// Manage filter
|
||||
|
||||
@@ -2745,7 +2745,7 @@ if (!GETPOST('hide_websitemenu')) {
|
||||
|
||||
if (in_array($action, array('editcss', 'editmenu', 'file_manager', 'replacesite', 'replacesiteconfirm'))) {
|
||||
if ($action == 'editcss') {
|
||||
print '<input type="submit" id="savefilean stay" class="button buttonforacesave" value="'.dol_escape_htmltag($langs->trans("SaveAndStay")).'" name="updateandstay">';
|
||||
print '<input type="submit" id="savefileandstay" class="button buttonforacesave hideonsmartphone" value="'.dol_escape_htmltag($langs->trans("SaveAndStay")).'" name="updateandstay">';
|
||||
}
|
||||
if (preg_match('/^create/', $action) && $action != 'file_manager' && $action != 'replacesite' && $action != 'replacesiteconfirm') {
|
||||
print '<input type="submit" id="savefile" class="button buttonforacesave button-save" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">';
|
||||
@@ -3075,7 +3075,7 @@ if (!GETPOST('hide_websitemenu')) {
|
||||
}
|
||||
if (!in_array($action, array('editcss', 'editmenu', 'file_manager', 'replacesite', 'replacesiteconfirm', 'createsite', 'createcontainer', 'createfromclone', 'createpagefromclone', 'deletesite'))) {
|
||||
if ($action == 'editsource' || $action == 'editmeta') {
|
||||
print '<input type="submit" id="savefilean stay" class="button buttonforacesave" value="'.dol_escape_htmltag($langs->trans("SaveAndStay")).'" name="updateandstay">';
|
||||
print '<input type="submit" id="savefileandstay" class="button buttonforacesave hideonsmartphone" value="'.dol_escape_htmltag($langs->trans("SaveAndStay")).'" name="updateandstay">';
|
||||
}
|
||||
if (preg_match('/^create/', $action)) {
|
||||
print '<input type="submit" id="savefile" class="button buttonforacesave button-save" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">';
|
||||
|
||||
@@ -219,7 +219,8 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
|
||||
'multicurrency.class.php',
|
||||
'productbatch.class.php',
|
||||
'reception.class.php',
|
||||
'societe.class.php'
|
||||
'societe.class.php' ,
|
||||
'account.class.php'
|
||||
))) {
|
||||
// Must must not found $db->
|
||||
$ok=true;
|
||||
|
||||
Reference in New Issue
Block a user