Merge branch 'Dolibarr:develop' into develop
This commit is contained in:
commit
adb30b6acd
@ -220,7 +220,7 @@ if (!empty($conf->multicompany->enabled) && !$user->entity) {
|
||||
print '<td class="center">';
|
||||
print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
|
||||
}
|
||||
print '<input type="submit" class="button button-add" name="add" value="'.$langs->trans("Add").'">';
|
||||
print '<input type="submit" class="button button-add small" name="add" value="'.$langs->trans("Add").'">';
|
||||
print "</td>\n";
|
||||
print '</tr>';
|
||||
|
||||
@ -273,7 +273,7 @@ if ($result) {
|
||||
print '</td>';
|
||||
|
||||
// Date last change
|
||||
print '<td class="nowraponall">';
|
||||
print '<td class="nowraponall center">';
|
||||
print dol_print_date($db->jdate($obj->tms), 'dayhour');
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -134,6 +134,8 @@ if ($action == 'add' && !empty($permissiontoadd)) {
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$db->begin();
|
||||
|
||||
$result = $object->create($user);
|
||||
if ($result > 0) {
|
||||
// Creation OK
|
||||
@ -141,14 +143,19 @@ if ($action == 'add' && !empty($permissiontoadd)) {
|
||||
$categories = GETPOST('categories', 'array:int');
|
||||
$object->setCategories($categories);
|
||||
}
|
||||
|
||||
$urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist;
|
||||
$urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation
|
||||
|
||||
$db->commit();
|
||||
|
||||
if (empty($noback)) {
|
||||
header("Location: " . $urltogo);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$db->rollback();
|
||||
|
||||
$error++;
|
||||
// Creation KO
|
||||
if (!empty($object->errors)) {
|
||||
|
||||
@ -895,7 +895,12 @@ abstract class CommonDocGenerator
|
||||
//Add value to store price with currency
|
||||
$array_to_fill = array_merge($array_to_fill, array($array_key.'_options_'.$key.'_currency' => $object->array_options['options_'.$key.'_currency']));
|
||||
} elseif ($extrafields->attributes[$object->table_element]['type'][$key] == 'select') {
|
||||
$object->array_options['options_'.$key] = $extrafields->attributes[$object->table_element]['param'][$key]['options'][$object->array_options['options_'.$key]];
|
||||
$valueofselectkey = $object->array_options['options_'.$key];
|
||||
if (array_key_exists($valueofselectkey, $extrafields->attributes[$object->table_element]['param'][$key]['options'])) {
|
||||
$object->array_options['options_'.$key] = $extrafields->attributes[$object->table_element]['param'][$key]['options'][$valueofselectkey];
|
||||
} else {
|
||||
$object->array_options['options_'.$key] = '';
|
||||
}
|
||||
} elseif ($extrafields->attributes[$object->table_element]['type'][$key] == 'checkbox') {
|
||||
$valArray = explode(',', $object->array_options['options_'.$key]);
|
||||
$output = array();
|
||||
@ -945,7 +950,11 @@ abstract class CommonDocGenerator
|
||||
}
|
||||
}
|
||||
|
||||
$array_to_fill = array_merge($array_to_fill, array($array_key.'_options_'.$key => $object->array_options['options_'.$key]));
|
||||
if (array_key_exists('option_'.$key, $object->array_options)) {
|
||||
$array_to_fill = array_merge($array_to_fill, array($array_key.'_options_'.$key => $object->array_options['options_'.$key]));
|
||||
} else {
|
||||
$array_to_fill = array_merge($array_to_fill, array($array_key.'_options_'.$key => ''));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -904,11 +904,11 @@ class Translate
|
||||
* This function need module "numberwords" to be installed. If not it will return
|
||||
* same number (this module is not provided by default as it use non GPL source code).
|
||||
*
|
||||
* @param int $number Number to encode in full text
|
||||
* @param string $isamount ''=it's just a number, '1'=It's an amount (default currency), 'currencycode'=It's an amount (foreign currency)
|
||||
* @return string Label translated in UTF8 (but without entities)
|
||||
* 10 if setDefaultLang was en_US => ten
|
||||
* 123 if setDefaultLang was fr_FR => cent vingt trois
|
||||
* @param int|string $number Number to encode in full text
|
||||
* @param string $isamount ''=it's just a number, '1'=It's an amount (default currency), 'currencycode'=It's an amount (foreign currency)
|
||||
* @return string Label translated in UTF8 (but without entities)
|
||||
* 10 if setDefaultLang was en_US => ten
|
||||
* 123 if setDefaultLang was fr_FR => cent vingt trois
|
||||
*/
|
||||
public function getLabelFromNumber($number, $isamount = '')
|
||||
{
|
||||
|
||||
@ -8611,7 +8611,7 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1'
|
||||
}
|
||||
} elseif ($onlysimplestring == '2') {
|
||||
// We must accept: (($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : "Parent project not found"
|
||||
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/;[]', '/').']/i', $s)) {
|
||||
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/@;[]', '/').']/i', $s)) {
|
||||
if ($returnvalue) {
|
||||
return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s;
|
||||
} else {
|
||||
@ -9020,7 +9020,6 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type,
|
||||
if ($values[0] != $type) {
|
||||
continue;
|
||||
}
|
||||
//var_dump(verifCond($values[4]));
|
||||
|
||||
if (verifCond($values[4])) {
|
||||
if ($values[3]) {
|
||||
|
||||
@ -2683,7 +2683,7 @@ if ($action == 'create') {
|
||||
$delallowed = $usercancreate;
|
||||
$modelpdf = (!empty($object->model_pdf) ? $object->model_pdf : (empty($conf->global->COMMANDE_SUPPLIER_ADDON_PDF) ? '' : $conf->global->COMMANDE_SUPPLIER_ADDON_PDF));
|
||||
|
||||
print $formfile->showdocuments('commande_fournisseur', $objref, $filedir, $urlsource, $genallowed, $delallowed, $modelpdf, 1, 0, 0, 0, 0, '', '', '', $object->thirdparty->default_lang);
|
||||
print $formfile->showdocuments('commande_fournisseur', $objref, $filedir, $urlsource, $genallowed, $delallowed, $modelpdf, 1, 0, 0, 0, 0, '', '', '', $object->thirdparty->default_lang, '', $object);
|
||||
$somethingshown = $formfile->numoffiles;
|
||||
|
||||
// Show links to link elements
|
||||
|
||||
@ -307,7 +307,7 @@ $sql .= " p.rowid as project_id, p.ref as project_ref,";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
$sql .= " sc.fk_soc, sc.fk_user,";
|
||||
}
|
||||
$sql .= " u.firstname, u.lastname, u.photo, u.login, u.statut as status, u.admin, u.employee, u.email as uemail";
|
||||
$sql .= " u.firstname, u.lastname, u.photo, u.login, u.statut as ustatus, u.admin, u.employee, u.email as uemail";
|
||||
// Add fields from extrafields
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user