diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 24b06065a5b..a825c4709e6 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -992,6 +992,9 @@ class FormFile global $dolibarr_main_url_root; global $form; + $disablecrop=1; + if (in_array($modulepart, array('societe','product','produit','service','expensereport','holiday','member','project','ticketsup','user'))) $disablecrop=0; + // Define relative path used to store the file if (empty($relativepath)) { @@ -1253,9 +1256,6 @@ class FormFile $newmodulepart=$modulepart; if (in_array($modulepart, array('product','produit','service'))) $newmodulepart='produit|service'; - $disablecrop=1; - if (in_array($modulepart, array('societe','product','produit','service','expensereport','holiday','member','project','ticketsup','user'))) $disablecrop=0; - if (! $disablecrop && image_format_supported($file['name']) > 0) { if ($permtoeditline) diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php index 01d7b091a49..9bd0cc7e976 100644 --- a/htdocs/core/tpl/document_actions_post_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php @@ -19,10 +19,10 @@ */ // Following var can be set -// $permission = permission or not to add a file -// $permtoedit = permission or not to edit file name, crop file -// $modulepart = for download -// $param = param to add to download links +// $permission = permission or not to add a file +// $permtoedit = permission or not to edit file name, crop file +// $modulepart = for download +// $param = param to add to download links // Protection to avoid direct call of template if (empty($langs) || ! is_object($langs)) @@ -36,6 +36,15 @@ $langs->load("link"); if (empty($relativepathwithnofile)) $relativepathwithnofile=''; if (empty($permtoedit)) $permtoedit=-1; +// Drag and drop for up and down allowed on product, thirdparty, ... +// The drag and drop call the page core/ajax/row.php +// If you enable the move up/down of files here, check that page that include template set its sortorder on 'position_name' instead of 'name' +// Also the object->fk_element must be defined. +$disablemove=1; +if (in_array($modulepart, array('product', 'produit', 'societe', 'user', 'ticketsup', 'holiday', 'expensereport'))) $disablemove=0; + + + /* * Confirm form to delete */ @@ -86,11 +95,6 @@ $formfile->form_attach_new_file( $savingdocmask ); -// Drag and drop for up and down allowed on product, thirdparty, ... -// The drag and drop call the page core/ajax/row.php -$disablemove=1; -if (in_array($modulepart, array('product', 'produit', 'societe', 'user', 'ticketsup'))) $disablemove=0; - // List of document $formfile->list_of_documents( $filearray, diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 1faa521d8b7..a2d67d627c0 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -44,9 +44,7 @@ if (! empty($conf->accounting->enabled)) { require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; } -$langs->load("trips"); -$langs->load("bills"); -$langs->load("mails"); +$langs->loadLangs(array("trips","bills","mails")); $action=GETPOST('action','aZ09'); $cancel=GETPOST('cancel','alpha'); diff --git a/htdocs/expensereport/document.php b/htdocs/expensereport/document.php index dc4f1c8a7af..67f074d7f92 100644 --- a/htdocs/expensereport/document.php +++ b/htdocs/expensereport/document.php @@ -34,10 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; -$langs->load("other"); -$langs->load("trips"); -$langs->load("companies"); -$langs->load("interventions"); +$langs->loadLangs(array("other","trips","companies","interventions")); $id = GETPOST('id','int'); $ref = GETPOST('ref', 'alpha'); @@ -58,7 +55,7 @@ $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder="ASC"; -if (! $sortfield) $sortfield="name"; +if (! $sortfield) $sortfield="position_name"; $object = new ExpenseReport($db); @@ -67,6 +64,9 @@ $object->fetch($id, $ref); $upload_dir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($object->ref); $modulepart='trip'; +// Load object +//include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals + /* * Actions diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 950c297fb3b..c034db59c57 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -35,6 +35,7 @@ class Holiday extends CommonObject public $element='holiday'; public $table_element='holiday'; public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + var $fk_element = 'fk_holiday'; public $picto = 'holiday'; /** diff --git a/htdocs/holiday/document.php b/htdocs/holiday/document.php index 6e5137e5b57..52386acf93c 100644 --- a/htdocs/holiday/document.php +++ b/htdocs/holiday/document.php @@ -59,7 +59,7 @@ $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder="ASC"; -if (! $sortfield) $sortfield="name"; +if (! $sortfield) $sortfield="position_name"; $object = new Holiday($db); diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php index 8ce85b8eee6..905f16d8780 100644 --- a/htdocs/modulebuilder/template/myobject_document.php +++ b/htdocs/modulebuilder/template/myobject_document.php @@ -81,8 +81,8 @@ $extralabels = $extrafields->fetch_name_optionals_label('myobject'); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals -//if ($id > 0 || ! empty($ref)) $upload_dir = $conf->sellyoursaas->multidir_output[$object->entity] . "/packages/" . dol_sanitizeFileName($object->id); -if ($id > 0 || ! empty($ref)) $upload_dir = $conf->sellyoursaas->multidir_output[$object->entity] . "/packages/" . dol_sanitizeFileName($object->ref); +//if ($id > 0 || ! empty($ref)) $upload_dir = $conf->sellyoursaas->multidir_output[$object->entity] . "/myobject/" . dol_sanitizeFileName($object->id); +if ($id > 0 || ! empty($ref)) $upload_dir = $conf->sellyoursaas->multidir_output[$object->entity] . "/myobject/" . dol_sanitizeFileName($object->ref); /*