diff --git a/ChangeLog b/ChangeLog index b468ebcc931..f4945b44df0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,20 +10,176 @@ For users: --------------- NEW: PHP 8.1 compatibility - - +NEW: Support for recurring purchase invoices. +NEW: #20292 Include German public holidays +NEW: #17123 added ExtraFields for Stock Mouvement +NEW: #20609 : new massaction to assign a sale representatives on a selection of thirdparties +NEW: #20653 edit discount pourcentage for all lines in one shot +NEW: Accept 'auto' for ref of object on import of purchase order/proposal +NEW: Accountancy - Add more filters and info on page to bind accounting accounts +NEW: Accountancy - Add subledger account when we generate a transaction with a deposit invoice +NEW: Accountancy - Add a massaction to preselect an account (customer and supplier list) +NEW: ACE Editor is restored at same cursor position after a save. +NEW: Add "addMoreActionsButtons" hook to subscription form +NEW: Add an option in GUI to show a Quick add button into top menu bar +NEW: Module Recruitment - Add a public page with all list of open job positions. +NEW: Module Recruitment - Add a tab with list of application on the jobposition file. +NEW: Add a workflow to auto link contract on a ticket +NEW: Add column date of Signature on proposal list +NEW: Add column template invoice in invoice list +NEW: Add column "Total HT" to products array on document creation card +NEW: ADD configuration for text color of button action +NEW: Add constant to hide categories in TakePos +NEW: Add constant to show category description in TakePos +NEW: Add constant to show only the products in stock in TakePos +NEW: Add entity filter in exports +NEW: Show the event block on recurring invoices #20870 +NEW: Add filter "opportunity status" on statistics of projects. +NEW: Add firstname, lastname and max number of attendees for module "Event Organization" +NEW: add margin info in proposal and order list +NEW: Add massaction "Edit Extrafield" for Product +NEW: Add more fields to detect duplicate during import of thirdparties +NEW: Add option to foce delivery on email for purchase order receipt to yes +NEW: Add param boder table for md theme +NEW: Add param color button action +NEW: Add possibility to create contract from invoice +NEW: Add possibility with constant MAIN_LOGIN_BADCHARUNAUTHORIZED to define bad character unauthorized into login name +NEW: Add private and public notes on tax files. +NEW: Add status "Obsolete" to KM articles +NEW: Add substitutions "user numbers" +NEW: Add the possibility to add sub-BOMs to BOM +NEW: allow a ticket to be automatically marked as read when created from backend. +NEW: allow cut&paste as real numeric value to excel +NEW: A public form to send a message and create a lead is available +NEW: automatically set totally received status in reception +NEW: Auto set invoice paid when adding credit not and remain to pay is 0 +NEW: Availibility dictionnary has a new column unit and number +NEW: barcode rule to insert product in takepos +NEW: Can change value of AWP during the inventory +NEW: Can enter price with tax for predefined products on purchase objects +NEW: Can filter on a thirdparty on product statistics +NEW: Can removed doc templates from setup page of thirdparty +NEW: Can set the parent company during the creation of thirdparty (action=add of societe/card.php) +NEW: Can use ! to make a search that exclude a string +NEW: Change in theme colors does not need to use the refresh button +NEW: clean values and amount in FEC import +NEW: const MAIL_MASS_ACTION_ADD_LAST_IF_MAIN_DOC_NOT_FOUND for mailing mass action +NEW: Contact filter project list +NEW: Create contract from invoice +NEW: create third-party with contact if not found on public ticket +NEW: Default value for MAIN_SECURITY_CSRF_WITH_TOKEN is now 2 (GET are also protected agains CSRF attacks) +NEW: deposit payment terms: add field into dictionary admin page to define default percentage of deposit. +NEW: Dictionaries - add possibility to manage countries in EEC +NEW: display errors in a message box after generating documents +NEW: Display physical and virtual stock of the products when creating OF from a BOM +NEW: Display product ref in "Object link" product tab for BOM +NEW: Enhance the import. Can use 'auto' for the ref (import of orders) +NEW: Events on Proposal to Return to Draft +NEW: Page to list expense report payments +NEW: JS inventory autocalc input +NEW: language support for more emailing target selectors +NEW: leave requests: add field into type dictionary to block request if balance is negative +NEW: MAIN_MAIL_AUTOCOPY_TO can accept several email and special keys +NEW: MAIN_SEARCH_CAT_OR_BY_DEFAULT const for search by category +NEW: Mass action "Close shipments" +NEW: Module website now supports the multicompany module +NEW: More mode for THEME_TOPMENU_DISABLE_IMAGE (2, 3, ...) +NEW: Add option to move checkbox column as first column on Thirdparty list (only few screens) +NEW: Add tabs for nets Bom +NEW: on redirect of page in website module, GET parameters are kept. +NEW: optional display warning icons on ticket list +NEW: option to default check "notify tier at creation" in ticket module +NEW: option update prices on proposal cloning +NEW: payment conditions enabling semi-automatic deposit creation (Issue #18439) +NEW: possibility to consume multiple batch +NEW: Reverse movement product consumption +NEW: Send email to the supplier order contact +NEW: New permission to report time on timesheet. +NEW: SEPA XML - option to place payment Type Info at Credit transfer Transaction level +NEW: Show number of votes into the label of tab "Results" of a survey +NEW: Show product reference in Takepos +NEW: Some core tables are created only at module activation +NEW: split consumption line on MO +NEW: stock filter in reassort lists +NEW: stock limit in stock export CSV +NEW: Sub-bom are availables +NEW: Supplier order - Show ref supplier of reception in linked object block +NEW: support user_modif in order +NEW: TakePos - pagination on search results +NEW: The backup tools has an "lowmemory" option for mysqldump on large database +NEW: The 'reposition' class works on ajax constantonoff that make redirects +NEW: Thirdparty - Add rules "customer accountancy code" is mandatory to validate invoice +NEW: thumbnail field in product list +NEW: total mark rate in list +NEW: uncheck "send message" by default on a ticket when private messages has been checked +NEW: VAT Report by month - Show detail by rate and also by code +NEW: Ticket triggers: allow to automatically send messages on new tickets +NEW: Accountancy - Add hidden feature for accounting reconciliation +NEW: Can store the session into database (instead of beeing managed by PHP) Modules +NEW: Module Partnership Management NEW: Experimental module Event Organization Management -NEW: Experimental module Workstations Management -NEW: Experimental module Partnership Management -For developers: ---------------- - -NEW: A lot of addition of hooks. - +For developers or integrators: +------------------------------ +NEW: dol_uncompress() supports more extensions (.gz, .bz2, .zstd). Only .zip was supported before. +NEW: Implement a generic method for Kaban views +NEW: Upgrade chartjs library to 3.7.1 +NEW: update rank line is possible on API for customer invoices, sales orders and supplier invoice +NEW: stripe element with more gateways +NEW: solde() function evolution to be able to get solde until a chosen date +NEW: Suggest a way to run upgrade per entities. +NEW: Support html content for multiselect component. +NEW: ModuleBuilder - Add tabs view in module builder +NEW: ModuleBuilder - More feature that can be modifed after module generation +NEW: Hook getNomUrl available everywhere in tooltip of ref links +NEW: Identification of tr is possible with by attribute data-id on some pages +NEW: Import with select boxes V2 +NEW: Can update rank of invoice, proposal and order lines with API update +NEW: Can use current entity filter on 'chkbxlst' +NEW: Creation of the function select_bom() used to display bom select list +NEW: add printFieldListWhere hook in product reassort card +NEW: Add trigger and event on completely received status change +NEW: Add utility function send backup by mail +NEW: add WordPress OAuth to save a token (not SSO) +NEW: A module can embed a sql script run at each Dolibarr upgrade +NEW: API Proposals - Add POST lines +NEW: API REST filter states by country +NEW: Add option INVOICEREC_SET_AUTOFILL_DATE_START/END +NEW: Add option MAIN_API_DEBUG to save API logs into a file +NEW: Add param to keep the robot=index meta tag on public pages +NEW: Add method hintindex() in database handlers. +NEW: add modifications for new function "$db->prefix()" +NEW: addMoreActionsButtonsList hook for button in list +NEW: Add API to get a template invoice +NEW: Standardize a lot of code. +NEW: #20736 Allow extrafields SQL filters on REST API product lookup +NEW: #19294 implement detailed timespent in task of project API +NEW: Add a protection into PHPunit to avoid to forget a var_dump +NEW: Add datem and type parameters to API to create movements +NEW: Add hidden option on contract PDF line to hide qty and price +NEW: Option MAIL_MASS_ACTION_ADD_LAST_IF_MAIN_DOC_NOT_FOUND to send last document in mass mailing action +NEW: Add hooks: selectContactListWhere hook, selectThirdpartyListWhere hook +NEW: TakePos - add hooks complete product display +NEW: TakePos - add hooks for cart display +NEW: TakePos - add hooks to complete ajax return array +NEW: Add hook before the public ticket list +NEW: Add hook doaction in takepos invoice +NEW: Add Hook for Notif +NEW: Add hook for more buttons +NEW: Add hook printFieldListWhere in "show_contacts" function +NEW: Add hook printFieldWhere in load_state_board function +NEW: Add hooks contact tab badge and hooks parameter for avoid conflicts +NEW: Add hook selectProductsListWhere in select_produits_list function +NEW: Add hooks in commercial index +NEW: Add hooks in customers and products boxes +NEW: Add hooks in thirdparty index page +NEW: Add hooks on project task time page +NEW: Add hooks on salaries and sociales card +NEW: Add hooks select product list and select thirdparty list function +NEW: Add hook to getSellPrice function Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 3c2e8763fe1..7a65fa0ffaa 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -349,7 +349,7 @@ if ($action != 'export_csv') { $sql .= " GROUP BY t.numero_compte"; $resql = $db->query($sql); - $nrows = $resql->num_rows; + $nrows = $db->num_rows($resql); $opening_balances = array(); for ($i = 0; $i < $nrows; $i++) { $arr = $resql->fetch_array(); diff --git a/htdocs/accountancy/journal/variousjournal.php b/htdocs/accountancy/journal/variousjournal.php index 0d95ff61763..49b4fc2c98c 100644 --- a/htdocs/accountancy/journal/variousjournal.php +++ b/htdocs/accountancy/journal/variousjournal.php @@ -43,17 +43,6 @@ if ($in_bookkeeping == '') { $in_bookkeeping = 'notyet'; } -// Security check -if (empty($conf->accounting->enabled)) { - accessforbidden(); -} -if ($user->socid > 0) { - accessforbidden(); -} -if (empty($user->rights->accounting->mouvements->lire)) { - accessforbidden(); -} - // Get information of journal $object = new AccountingJournal($db); $result = $object->fetch($id_journal); @@ -65,7 +54,7 @@ if ($result > 0) { accessforbidden($langs->trans('ErrorRecordNotFound')); } -$hookmanager->initHooks(array('globaljournal', $object->nature_text . 'journal')); +$hookmanager->initHooks(array('globaljournal', $object->nature.'journal')); $parameters = array(); $date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear); @@ -93,6 +82,18 @@ if (!is_array($journal_data)) { setEventMessages($object->error, $object->errors, 'errors'); } +// Security check +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} +if ($user->socid > 0) { + accessforbidden(); +} +if (empty($user->rights->accounting->mouvements->lire)) { + accessforbidden(); +} + + /* * Actions */ diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 350713ca17e..88a63af0ae1 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -2030,7 +2030,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $MAX = 10; - $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/adherents/agenda.php?id='.$object->id); + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/adherents/agenda.php?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index c2ef4583bdc..72f75cdf4c8 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -305,6 +305,8 @@ $formother = new FormOther($db); $membertypestatic = new AdherentType($db); $memberstatic = new Adherent($db); +$title = $langs->trans("Members"); + $now = dol_now(); if ((!empty($search_categ) && $search_categ > 0) || !empty($catid)) { @@ -471,42 +473,41 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ exit; } -llxHeader('', $langs->trans("Member"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); +llxHeader('', $title, 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); -$titre = $langs->trans("MembersList"); if (GETPOSTISSET("search_status")) { if ($search_status == '-1,1') { // TODO : check this test as -1 == Adherent::STATUS_DRAFT and -2 == Adherent::STATUS_EXLCUDED - $titre = $langs->trans("MembersListQualified"); + $title = $langs->trans("MembersListQualified"); } if ($search_status == Adherent::STATUS_DRAFT) { - $titre = $langs->trans("MembersListToValid"); + $title = $langs->trans("MembersListToValid"); } if ($search_status == Adherent::STATUS_VALIDATED && $filter == '') { - $titre = $langs->trans("MenuMembersValidated"); + $title = $langs->trans("MenuMembersValidated"); } if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'withoutsubscription') { - $titre = $langs->trans("MembersWithSubscriptionToReceive"); + $title = $langs->trans("MembersWithSubscriptionToReceive"); } if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'uptodate') { - $titre = $langs->trans("MembersListUpToDate"); + $title = $langs->trans("MembersListUpToDate"); } if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'outofdate') { - $titre = $langs->trans("MembersListNotUpToDate"); + $title = $langs->trans("MembersListNotUpToDate"); } if ((string) $search_status == (string) Adherent::STATUS_RESILIATED) { // The cast to string is required to have test false when search_status is '' - $titre = $langs->trans("MembersListResiliated"); + $title = $langs->trans("MembersListResiliated"); } if ($search_status == Adherent::STATUS_EXCLUDED) { - $titre = $langs->trans("MembersListExcluded"); + $title = $langs->trans("MembersListExcluded"); } } elseif ($action == 'search') { - $titre = $langs->trans("MembersListQualified"); + $title = $langs->trans("MembersListQualified"); } if ($search_type > 0) { $membertype = new AdherentType($db); $result = $membertype->fetch($search_type); - $titre .= " (".$membertype->label.")"; + $title .= " (".$membertype->label.")"; } $param = ''; @@ -623,7 +624,7 @@ print ''; print ''; print ''; -print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); $topicmail = "Information"; $modelmail = "member"; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 8ed6615965b..dbf4ca53686 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -529,7 +529,7 @@ if ($mode == 'common' || $mode == 'commonkanban') { $moreforfilter .= dolGetButtonTitle($langs->trans('CheckForModuleUpdate'), $langs->trans('CheckForModuleUpdate').'
'.$langs->trans('CheckForModuleUpdateHelp'), 'fa fa-sync', $_SERVER["PHP_SELF"].'?action=checklastversion&token='.newToken().'&mode='.$mode.$param, '', 1, array('morecss'=>'reposition')); $moreforfilter .= dolGetButtonTitleSeparator(); $moreforfilter .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=commonkanban'.$param, '', ($mode == 'commonkanban' ? 2 : 1), array('morecss'=>'reposition')); - $moreforfilter .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.$param, '', ($mode == 'common' ? 2 : 1), array('morecss'=>'reposition')); + $moreforfilter .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.$param, '', ($mode == 'common' ? 2 : 1), array('morecss'=>'reposition')); $moreforfilter .= ''; //$moreforfilter .= '
'.$moreinfo.' '.$moreinfo2.'
'; diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php index ebd1269f74a..1d3e29c9cd4 100644 --- a/htdocs/admin/resource.php +++ b/htdocs/admin/resource.php @@ -78,7 +78,7 @@ print '
'; print ''; print ''; print ''."\n"; -print ''."\n"; +print ''."\n"; print ''; @@ -106,6 +106,15 @@ if (empty($conf->use_javascript_ajax)) { print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +/* print ''; print ''; print ''; print ''; print ''; - - -print ''; -print ''; -print ''; -print ''; -print ''; +*/ print '
'.$langs->trans("Parameters").''.$langs->trans("Value").''.$langs->trans("Value").'
'.$langs->trans('EnableResourceUsedInEventCheck').''; +echo ajax_constantonoff('RESOURCE_USED_IN_EVENT_CHECK'); +print '
'.$langs->trans('DisabledResourceLinkUser').''; @@ -122,15 +131,7 @@ echo ajax_constantonoff('RESOURCE_HIDE_ADD_CONTACT_THIPARTY'); print '
'.$langs->trans('EnableResourceUsedInEventCheck').''; -echo ajax_constantonoff('RESOURCE_USED_IN_EVENT_CHECK'); -print '
'; print '
'; diff --git a/htdocs/admin/resource_extrafields.php b/htdocs/admin/resource_extrafields.php index c4967f75313..0af4a3384e0 100644 --- a/htdocs/admin/resource_extrafields.php +++ b/htdocs/admin/resource_extrafields.php @@ -74,7 +74,6 @@ llxHeader('', $langs->trans("ResourceSetup")); $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ResourceSetup"), $linkback, 'title_setup'); -print "
\n"; $head = resource_admin_prepare_head(); diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index 4df687dd2bd..621eceb50a3 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -408,7 +408,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { print '

'; - print_fiche_titre($langs->trans("Emails")); + print load_fiche_titre($langs->trans("Emails")); print '
'; print ''; diff --git a/htdocs/api/index.php b/htdocs/api/index.php index c66573e8022..afb0289aa32 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -100,7 +100,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $url = $_SERVER['PHP_SELF']; if (preg_match('/api\/index\.php$/', $url)) { // sometimes $_SERVER['PHP_SELF'] is 'api\/index\.php' instead of 'api\/index\.php/explorer.php' or 'api\/index\.php/method' - $url = $_SERVER['PHP_SELF'].$_SERVER['PATH_INFO']; + $url = $_SERVER['PHP_SELF'].(empty($_SERVER['PATH_INFO']) ? $_SERVER['ORIG_PATH_INFO'] : $_SERVER['PATH_INFO']); } // Fix for some NGINX setups (this should not be required even with NGINX, however setup of NGINX are often mysterious and this may help is such cases) if (!empty($conf->global->MAIN_NGINX_FIX)) { diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index c516866b7d0..d94ba613d91 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -408,7 +408,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $MAXEVENT = 10; - $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/asset/agenda.php?id='.$object->id); + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/asset/agenda.php?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; diff --git a/htdocs/asset/model/card.php b/htdocs/asset/model/card.php index 3e0858da55e..89843f0fc4e 100644 --- a/htdocs/asset/model/card.php +++ b/htdocs/asset/model/card.php @@ -315,7 +315,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // $MAXEVENT = 10; // - // $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT . '/asset/model/agenda.php?id=' . $object->id); + // $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT . '/asset/model/agenda.php?id=' . $object->id); // // // List of actions on element // include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 96fb68b6e9b..3de176a1995 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -742,7 +742,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $MAXEVENT = 10; - $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/bom/bom_agenda.php?id='.$object->id); + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/bom/bom_agenda.php?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; diff --git a/htdocs/bom/bom_net_needs.php b/htdocs/bom/bom_net_needs.php index 30cd6792c55..e850365d365 100644 --- a/htdocs/bom/bom_net_needs.php +++ b/htdocs/bom/bom_net_needs.php @@ -184,7 +184,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print dol_get_fiche_end(); - $viewlink = dolGetButtonTitle($langs->trans('GroupByProduct'), '', 'fa fa-list-alt imgforviewmode', $_SERVER['PHP_SELF'].'?id='.$object->id.'&token='.newToken(), '', 1, array('morecss' => 'reposition '.($action !== 'treeview' ? 'btnTitleSelected':''))); + $viewlink = dolGetButtonTitle($langs->trans('GroupByProduct'), '', 'fa fa-bars imgforviewmode', $_SERVER['PHP_SELF'].'?id='.$object->id.'&token='.newToken(), '', 1, array('morecss' => 'reposition '.($action !== 'treeview' ? 'btnTitleSelected':''))); $viewlink .= dolGetButtonTitle($langs->trans('TreeStructure'), '', 'fa fa-stream imgforviewmode', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=treeview&token='.newToken(), '', 1, array('morecss' => 'reposition marginleftonly '.($action == 'treeview' ? 'btnTitleSelected':''))); print load_fiche_titre($langs->trans("BillOfMaterials"), $viewlink, 'cubes'); diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index aa513e07794..737ff059eee 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -461,6 +461,13 @@ if (empty($reshook) && $action == 'add') { } } + // Modify $moreparam so we are sure to see the event we have just created, whatever are the default value of filter on next page. + /*$moreparam .= ($moreparam ? '&' : '').'search_actioncode=0'; + $moreparam .= ($moreparam ? '&' : '').'search_status=-1'; + $moreparam .= ($moreparam ? '&' : '').'search_filtert='.$object->userownerid; + */ + $moreparam .= ($moreparam ? '&' : '').'disabledefaultvalues=1'; + if ($error) { $db->rollback(); } else { @@ -674,7 +681,7 @@ if (empty($reshook) && $action == 'update') { $object->errors[] = $object->error; } else { if ($db->num_rows($resql) > 0) { - // already in use + // Resource already in use $error++; $object->error = $langs->trans('ErrorResourcesAlreadyInUse').' : '; while ($obj = $db->fetch_object($resql)) { @@ -853,7 +860,7 @@ if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate') { $object->errors[] = $object->error; } else { if ($db->num_rows($resql) > 0) { - // already in use + // Resource already in use $error++; $object->error = $langs->trans('ErrorResourcesAlreadyInUse').' : '; while ($obj = $db->fetch_object($resql)) { @@ -952,16 +959,17 @@ if ($action == 'create') { console.log("setdatefields"); setdatefields(); }); + $("#selectcomplete").change(function() { - if ($("#selectcomplete").val() == 100) - { + console.log("we change the complete status - set the doneby"); + if ($("#selectcomplete").val() == 100) { if ($("#doneby").val() <= 0) $("#doneby").val(\''.((int) $user->id).'\'); } - if ($("#selectcomplete").val() == 0) - { + if ($("#selectcomplete").val() == 0) { $("#doneby").val(-1); } }); + $("#actioncode").change(function() { if ($("#actioncode").val() == \'AC_RDV\') $("#dateend").addClass("fieldrequired"); else $("#dateend").removeClass("fieldrequired"); @@ -1019,59 +1027,15 @@ if ($action == 'create') { print 'global->AGENDA_USE_EVENT_TYPE) ? ' class="fieldrequired titlefieldcreate"' : '').'>'.$langs->trans("Label").''; // Full day - print ''; + print ''; - - // Date end - /*print ''; - print '';*/ - - // Dev in progress + // Recurring event $userepeatevent = ($conf->global->MAIN_FEATURES_LEVEL == 2 ? 1 : 0); if ($userepeatevent) { // Repeat - print ''; + print ''; + //print ''; } - // Status - print ''; - print ''; - // Location - if (empty($conf->global->AGENDA_DISABLE_LOCATION)) { - print ''; + $datep = ($datep ? $datep : (is_null($object->datep) ? '' : $object->datep)); + if (GETPOST('datep', 'int', 1)) { + $datep = dol_stringtotime(GETPOST('datep', 'int', 1), 'tzuser'); + } + $datef = ($datef ? $datef : $object->datef); + if (GETPOST('datef', 'int', 1)) { + $datef = dol_stringtotime(GETPOST('datef', 'int', 1), 'tzuser'); + } + if (empty($datef) && !empty($datep)) { + if (GETPOST("actioncode", 'aZ09') == 'AC_RDV' || empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT)) { + $datef = dol_time_plus_duree($datep, (empty($conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS) ? 1 : $conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS), 'h'); + } } + // Date start + print ''; + + print ''; + // Assigned to - print ''; } + // Location + if (empty($conf->global->AGENDA_DISABLE_LOCATION)) { + print ''; + } + + // Status + print ''; + print ''; + if ($conf->categorie->enabled) { // Categories print ''; + print 'global->AGENDA_USE_EVENT_TYPE) ? ' class="fieldrequired titlefieldcreate"' : '').'>'.$langs->trans("Title").''; // Full day event - print ''; + print ''; - - // Dev in progress + // Recurring event $userepeatevent = ($conf->global->MAIN_FEATURES_LEVEL == 2 ? 1 : 0); if ($userepeatevent) { // Repeat - print ''; + print ''; + //print ''; } - - // Status - print ''; - // Location - if (empty($conf->global->AGENDA_DISABLE_LOCATION)) { - print ''; + // Date start - end + print ''; + + print ''; // Assigned to $listofuserid = array(); // User assigned @@ -1678,6 +1680,18 @@ if ($id > 0) { print $form->select_dolusers($object->userdoneid > 0 ? $object->userdoneid : -1, 'doneby', 1); print ''; } + + // Location + if (empty($conf->global->AGENDA_DISABLE_LOCATION)) { + print ''; + } + + // Status + print ''; + // Tags-Categories if ($conf->categorie->enabled) { print ''; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index f5bbeb6467d..dee6c459433 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -49,6 +49,8 @@ if (empty($conf->global->AGENDA_EXT_NB)) { } $MAXAGENDA = $conf->global->AGENDA_EXT_NB; +$disabledefaultvalues = GETPOST('disabledefaultvalues', 'int'); + $check_holiday = GETPOST('check_holiday', 'int'); $filter = GETPOST("search_filter", 'alpha', 3) ? GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3); $filtert = GETPOST("search_filtert", "int", 3) ? GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3); @@ -128,14 +130,11 @@ if (GETPOST('search_actioncode', 'array:aZ09')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("search_actioncode", "alpha", 3) ?GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE)); -} -if ($actioncode == '' && empty($actioncodearray)) { - $actioncode = (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE); + $actioncode = GETPOST("search_actioncode", "alpha", 3) ?GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode") == '0' ? '0' : ((empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE)); } if ($status == '' && !GETPOSTISSET('search_status')) { - $status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); + $status = ((empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); } $defaultview = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW); diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 86b8a3b5ce5..7d8861aded3 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -45,6 +45,11 @@ $langs->loadLangs(array("users", "companies", "agenda", "commercial", "other", " $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'actioncommlist'; // To manage different context of search +$optioncss = GETPOST('optioncss', 'alpha'); +$toselect = GETPOST('toselect', 'array'); +$confirm = GETPOST('confirm', 'alpha'); + +$disabledefaultvalues = GETPOST('disabledefaultvalues', 'int'); $mode = GETPOST('mode', 'aZ09'); if (empty($mode) && preg_match('/show_/', $action)) { @@ -54,12 +59,9 @@ $resourceid = GETPOST("search_resourceid", "int") ?GETPOST("search_resourceid", $pid = GETPOST("search_projectid", 'int', 3) ?GETPOST("search_projectid", 'int', 3) : GETPOST("projectid", 'int', 3); $search_status = (GETPOST("search_status", 'aZ09') != '') ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); $type = GETPOST('search_type', 'alphanohtml') ?GETPOST('search_type', 'alphanohtml') : GETPOST('type', 'alphanohtml'); -$optioncss = GETPOST('optioncss', 'alpha'); $year = GETPOST("year", 'int'); $month = GETPOST("month", 'int'); $day = GETPOST("day", 'int'); -$toselect = GETPOST('toselect', 'array'); -$confirm = GETPOST('confirm', 'alpha'); // Set actioncode (this code must be same for setting actioncode into peruser, listacton and index) if (GETPOST('search_actioncode', 'array')) { @@ -68,11 +70,9 @@ if (GETPOST('search_actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("search_actioncode", "alpha", 3) ?GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE)); -} -if ($actioncode == '' && empty($actioncodearray)) { - $actioncode = (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE); + $actioncode = GETPOST("search_actioncode", "alpha", 3) ?GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode") == '0' ? '0' : ((empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE)); } + $search_id = GETPOST('search_id', 'alpha'); $search_title = GETPOST('search_title', 'alpha'); $search_note = GETPOST('search_note', 'alpha'); @@ -83,7 +83,7 @@ $datestart_dtend = dol_mktime(23, 59, 59, GETPOST('datestart_dtendmonth', 'int') $dateend_dtstart = dol_mktime(0, 0, 0, GETPOST('dateend_dtstartmonth', 'int'), GETPOST('dateend_dtstartday', 'int'), GETPOST('dateend_dtstartyear', 'int'), 'tzuserrel'); $dateend_dtend = dol_mktime(23, 59, 59, GETPOST('dateend_dtendmonth', 'int'), GETPOST('dateend_dtendday', 'int'), GETPOST('dateend_dtendyear', 'int'), 'tzuserrel'); if ($search_status == '' && !GETPOSTISSET('search_status')) { - $search_status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); + $search_status = ((empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); } if (empty($mode) && !GETPOSTISSET('mode')) { $mode = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW); @@ -216,7 +216,14 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $datestart_dtend = ''; $dateend_dtstart = ''; $dateend_dtend = ''; + $actioncode = ''; $search_status = ''; + $pid = ''; + $socid = ''; + $resourceid = ''; + $filter = ''; + $filtert = ''; + $usergroup = ''; $toselect = array(); $search_array_options = array(); } @@ -299,7 +306,7 @@ if ($actioncode != '') { if ($resourceid > 0) { $param .= "&search_resourceid=".urlencode($resourceid); } -if ($search_status != '' && $search_status > -1) { +if ($search_status != '') { $param .= "&search_status=".urlencode($search_status); } if ($filter) { diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 64b635d169d..d4e005ae3e5 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -45,6 +45,8 @@ if (!isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) { $action = GETPOST('action', 'aZ09'); +$disabledefaultvalues = GETPOST('disabledefaultvalues', 'int'); + $filter = GETPOST("search_filter", 'alpha', 3) ? GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3); $filtert = GETPOST("search_filtert", "int", 3) ? GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3); $usergroup = GETPOST("search_usergroup", "int", 3) ? GETPOST("search_usergroup", "int", 3) : GETPOST("usergroup", "int", 3); @@ -110,10 +112,7 @@ if (GETPOST('search_actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("search_actioncode", "alpha", 3) ?GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode", "alpha") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE)); -} -if ($actioncode == '' && empty($actioncodearray)) { - $actioncode = (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE); + $actioncode = GETPOST("search_actioncode", "alpha", 3) ?GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode", "alpha") == '0' ? '0' : ((empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE)); } $dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int')); @@ -145,7 +144,7 @@ $begin_d = 1; $end_d = 53; if ($status == '' && !GETPOSTISSET('search_status')) { - $status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); + $status = ((empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); } if (empty($mode) && !GETPOSTISSET('mode')) { $mode = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW); diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 07bcd90e972..b9e190729e0 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -45,6 +45,8 @@ if (!isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) { $action = GETPOST('action', 'aZ09'); +$disabledefaultvalues = GETPOST('disabledefaultvalues', 'int'); + $filter = GETPOST("search_filter", 'alpha', 3) ? GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3); $filtert = GETPOST("search_filtert", "int", 3) ? GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3); $usergroup = GETPOST("search_usergroup", "int", 3) ? GETPOST("search_usergroup", "int", 3) : GETPOST("usergroup", "int", 3); @@ -110,10 +112,7 @@ if (GETPOST('search_actioncode', 'array:aZ09')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("search_actioncode", "alpha", 3) ?GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode", "alpha") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE)); -} -if ($actioncode == '' && empty($actioncodearray)) { - $actioncode = (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE); + $actioncode = GETPOST("search_actioncode", "alpha", 3) ?GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode", "alpha") == '0' ? '0' : ((empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE)); } $dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int')); @@ -154,7 +153,7 @@ if ($end_d < $begin_d) { } if ($status == '' && !GETPOSTISSET('search_status')) { - $status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); + $status = ((empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); } if (empty($mode) && !GETPOSTISSET('mode')) { diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index f82df06313b..b3d3dd25e90 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -961,7 +961,7 @@ if ($action == 'create') { if (GETPOST('cancel', 'alpha') || $confirm == 'no' || $action == '' || in_array($action, array('settodraft', 'valid', 'delete', 'sendall', 'clone', 'test'))) { print "\n\n
\n"; - if (($object->statut == 1) && ($user->rights->mailing->valider || $object->fk_user_valid == $user->id)) { + if (($object->statut == 1) && ($user->rights->mailing->valider || $object->user_validation == $user->id)) { print ''.$langs->trans("SetToDraft").''; } @@ -1066,7 +1066,7 @@ if ($action == 'create') { print dol_get_fiche_end(); - print dol_set_focus('#sendto'); + dol_set_focus('#sendto'); } diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 588faa392e3..0c2bf539384 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -86,6 +86,11 @@ class Mailing extends CommonObject */ public $email_from; + /** + * @var string email to + */ + public $sendto; + /** * @var string email reply to */ @@ -175,6 +180,11 @@ class Mailing extends CommonObject */ public $statuts = array(); + /** + * @var array substitutionarray + */ + public $substitutionarray; + /** * Constructor diff --git a/htdocs/comm/propal/class/api_proposals.class.php b/htdocs/comm/propal/class/api_proposals.class.php index ffd7d611f5a..9c8b3c653e6 100644 --- a/htdocs/comm/propal/class/api_proposals.class.php +++ b/htdocs/comm/propal/class/api_proposals.class.php @@ -645,7 +645,7 @@ class Proposals extends DolibarrApi throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - $contacts = $this->invoice->liste_contact(); + $contacts = $this->propal->liste_contact(); foreach ($contacts as $contact) { if ($contact['id'] == $contactid && $contact['code'] == $type) { diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 732569fc844..fc1f12afa04 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -490,7 +490,6 @@ class Propal extends CommonObject $line->subprice = -$remise->amount_ht; $line->fk_product = 0; // Id produit predefined $line->qty = 1; - $line->remise = 0; $line->remise_percent = 0; $line->rang = -1; $line->info_bits = 2; @@ -736,7 +735,6 @@ class Propal extends CommonObject // TODO deprecated $this->line->price = $price; - $this->line->remise = $remise; if (is_array($array_options) && count($array_options) > 0) { $this->line->array_options = $array_options; @@ -936,7 +934,6 @@ class Propal extends CommonObject // TODO deprecated $this->line->price = $price; - $this->line->remise = $remise; if (is_array($array_options) && count($array_options) > 0) { // We replace values in this->line->array_options only for entries defined into $array_options @@ -1900,14 +1897,15 @@ class Propal extends CommonObject // multilangs if (!empty($conf->global->MAIN_MULTILANGS) && !empty($objp->fk_product) && !empty($loadalsotranslation)) { - $line = new Product($this->db); - $line->fetch($objp->fk_product); - $line->getMultiLangs(); + $tmpproduct = new Product($this->db); + $tmpproduct->fetch($objp->fk_product); + $tmpproduct->getMultiLangs(); + + $line->multilangs = $tmpproduct->multilangs; } $this->lines[$i] = $line; - //dol_syslog("1 ".$line->fk_product); - //print "xx $i ".$this->lines[$i]->fk_product; + $i++; } @@ -3993,6 +3991,7 @@ class PropaleLigne extends CommonObjectLine public $multicurrency_total_tva; public $multicurrency_total_ttc; + /** * Class line Contructor * @@ -4132,9 +4131,6 @@ class PropaleLigne extends CommonObjectLine if (empty($this->rang)) { $this->rang = 0; } - if (empty($this->remise)) { - $this->remise = 0; - } if (empty($this->remise_percent) || !is_numeric($this->remise_percent)) { $this->remise_percent = 0; } @@ -4364,9 +4360,6 @@ class PropaleLigne extends CommonObjectLine if (empty($this->price)) { $this->price = 0; // TODO A virer } - if (empty($this->remise)) { - $this->remise = 0; // TODO A virer - } if (empty($this->remise_percent)) { $this->remise_percent = 0; } diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 51869825600..d59505e5fb7 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -377,14 +377,14 @@ if ($action == 'validate' && $permissiontovalidate) { if ($tmpproposal->fetch($checked) > 0) { if ($tmpproposal->statut == $tmpproposal::STATUS_DRAFT) { if ($tmpproposal->valid($user) > 0) { - setEventMessage($langs->trans('hasBeenValidated', $tmpproposal->ref), 'mesgs'); + setEventMessages($langs->trans('hasBeenValidated', $tmpproposal->ref), null, 'mesgs'); } else { - setEventMessage($tmpproposal->error, $tmpproposal->errors, 'errors'); + setEventMessages($tmpproposal->error, $tmpproposal->errors, 'errors'); $error++; } } else { $langs->load("errors"); - setEventMessage($langs->trans('ErrorIsNotADraft', $tmpproposal->ref), 'errors'); + setEventMessages($langs->trans('ErrorIsNotADraft', $tmpproposal->ref), null, 'errors'); $error++; } } else { @@ -410,7 +410,7 @@ if ($action == "sign" && $permissiontoclose) { if ($tmpproposal->statut == $tmpproposal::STATUS_VALIDATED) { $tmpproposal->statut = $tmpproposal::STATUS_SIGNED; if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_SIGNED) >= 0) { - setEventMessage($tmpproposal->ref." ".$langs->trans('Signed'), 'mesgs'); + setEventMessages($tmpproposal->ref." ".$langs->trans('Signed'), null, 'mesgs'); } else { setEventMessages($tmpproposal->error, $tmpproposal->errors, 'errors'); $error++; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 7390b5f39b9..5d5e5c2a7c4 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1666,7 +1666,6 @@ class Commande extends CommonOrder // TODO Ne plus utiliser $this->line->price = $price; - $this->line->remise = $remise; if (is_array($array_options) && count($array_options) > 0) { $this->line->array_options = $array_options; @@ -2010,7 +2009,6 @@ class Commande extends CommonOrder $line->price = -$remise->amount_ht; $line->fk_product = 0; // Id produit predefini $line->qty = 1; - $line->remise = 0; $line->remise_percent = 0; $line->rang = -1; $line->info_bits = 2; @@ -2154,9 +2152,11 @@ class Commande extends CommonOrder // multilangs if (!empty($conf->global->MAIN_MULTILANGS) && !empty($objp->fk_product) && !empty($loadalsotranslation)) { - $line = new Product($this->db); - $line->fetch($objp->fk_product); - $line->getMultiLangs(); + $tmpproduct = new Product($this->db); + $tmpproduct->fetch($objp->fk_product); + $tmpproduct->getMultiLangs(); + + $line->multilangs = $tmpproduct->multilangs; } $this->lines[$i] = $line; @@ -3262,7 +3262,6 @@ class Commande extends CommonOrder // TODO deprecated $this->line->price = $price; - $this->line->remise = $remise; if (is_array($array_options) && count($array_options) > 0) { // We replace values in this->line->array_options only for entries defined into $array_options @@ -4404,9 +4403,6 @@ class OrderLine extends CommonOrderLine if (empty($this->rang)) { $this->rang = 0; } - if (empty($this->remise)) { - $this->remise = 0; - } if (empty($this->remise_percent)) { $this->remise_percent = 0; } @@ -4579,9 +4575,6 @@ class OrderLine extends CommonOrderLine if (empty($this->marge_tx)) { $this->marge_tx = 0; } - if (empty($this->remise)) { - $this->remise = 0; - } if (empty($this->remise_percent)) { $this->remise_percent = 0; } diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 18b1e752c0b..39b8c16614d 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1700,7 +1700,7 @@ if ($action == 'create') { $MAXEVENT = 10; - //$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id); + //$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 3dde8ce2638..64d83cb2123 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -560,7 +560,6 @@ class Facture extends CommonInvoice $this->array_options = $_facrec->array_options; - //if (! $this->remise) $this->remise = 0; if (!$this->mode_reglement_id) { $this->mode_reglement_id = 0; } @@ -2194,9 +2193,11 @@ class Facture extends CommonInvoice // multilangs if (!empty($conf->global->MAIN_MULTILANGS) && !empty($objp->fk_product) && !empty($loadalsotranslation)) { - $line = new Product($this->db); - $line->fetch($objp->fk_product); - $line->getMultiLangs(); + $tmpproduct = new Product($this->db); + $tmpproduct->fetch($objp->fk_product); + $tmpproduct->getMultiLangs(); + + $line->multilangs = $tmpproduct->multilangs; } $this->lines[$i] = $line; @@ -5024,7 +5025,7 @@ class Facture extends CommonInvoice $sql .= " WHERE f.entity IN (".getEntity('invoice', 0).")"; $resql = $this->db->query($sql); if ($resql) { - if ($resql->num_rows > 0) { + if ($this->db->num_rows($resql) > 0) { $res = $this->db->fetch_array($resql); $ref = $res['max(situation_cycle_ref)']; $ref++; @@ -5069,7 +5070,7 @@ class Facture extends CommonInvoice $sql .= ' AND entity = '.($this->entity > 0 ? $this->entity : $conf->entity); $resql = $this->db->query($sql); $res = array(); - if ($resql && $resql->num_rows > 0) { + if ($resql && $this->db->num_rows($resql) > 0) { while ($row = $this->db->fetch_object($resql)) { $id = $row->rowid; $situation = new Facture($this->db); @@ -5147,7 +5148,7 @@ class Facture extends CommonInvoice $sql .= ' AND entity = '.($this->entity > 0 ? $this->entity : $conf->entity); $resql = $this->db->query($sql); - if ($resql && $resql->num_rows > 0) { + if ($resql && $this->db->num_rows($resql) > 0) { $res = $this->db->fetch_array($resql); $last = $res['max(situation_counter)']; return ($last == $this->situation_counter); @@ -6287,7 +6288,7 @@ class FactureLigne extends CommonInvoiceLine $sql = "SELECT situation_percent FROM ".MAIN_DB_PREFIX."facturedet WHERE rowid = ".((int) $this->fk_prev_id); $resql = $this->db->query($sql); - if ($resql && $resql->num_rows > 0) { + if ($resql && $this->db->num_rows($resql) > 0) { $res = $this->db->fetch_array($resql); $returnPercent = floatval($res['situation_percent']); diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index af1ab95c2b5..02925225df9 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -857,7 +857,7 @@ if ($resql) { } } if (!empty($arrayfields['f.datec']['checked'])) { - print '
'; if (!$i) { @@ -865,7 +865,7 @@ if ($resql) { } } if (!empty($arrayfields['f.tms']['checked'])) { - print ''; if (!$i) { diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 0ea9b1ba30d..b586d4c88a6 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -863,7 +863,7 @@ if ($id > 0) { /* $MAXEVENT = 10; - $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id); + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index ed37c72c1c4..26f8e754dd2 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -853,7 +853,7 @@ if ($id > 0) { /* $MAXEVENT = 10; - $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id); + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index cd664f5970e..fae36d323e3 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1550,7 +1550,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $MAXEVENT = 10; - $morehtmlright = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/contact/agenda.php?id='.$object->id); + $morehtmlright = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/contact/agenda.php?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 487c075b3a1..587972fa83b 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -181,6 +181,12 @@ class Contact extends CommonObject */ public $email; + /** + * URL + * @var string + */ + public $url; + /** * Unsuscribe all : 1 = contact has globaly unsubscribe of all mass emailings * @var int @@ -315,6 +321,7 @@ class Contact extends CommonObject */ public $stcomm_picto; + /** * Constructor * diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 7265a69d1af..7ad5ceedb85 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -2161,7 +2161,7 @@ if ($action == 'create') { $MAXEVENT = 10; - $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/contrat/agenda.php?id='.$object->id); + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/contrat/agenda.php?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 0befd4820ff..494c3cb1369 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -871,9 +871,11 @@ class Contrat extends CommonObject // multilangs if (!empty($conf->global->MAIN_MULTILANGS) && !empty($objp->fk_product) && !empty($loadalsotranslation)) { - $line = new Product($this->db); - $line->fetch($objp->fk_product); - $line->getMultiLangs(); + $tmpproduct = new Product($this->db); + $tmpproduct->fetch($objp->fk_product); + $tmpproduct->getMultiLangs(); + + $line->multilangs = $tmpproduct->multilangs; } $this->lines[$pos] = $line; @@ -2744,6 +2746,7 @@ class ContratLigne extends CommonObjectLine public $commentaire; + const STATUS_INITIAL = 0; const STATUS_OPEN = 4; const STATUS_CLOSED = 5; @@ -2988,7 +2991,6 @@ class ContratLigne extends CommonObjectLine $this->localtax2_type = $obj->localtax2_type; $this->qty = $obj->qty; $this->remise_percent = $obj->remise_percent; - $this->remise = $obj->remise; $this->fk_remise_except = $obj->fk_remise_except; $this->subprice = $obj->subprice; $this->price_ht = $obj->price_ht; @@ -3046,7 +3048,6 @@ class ContratLigne extends CommonObjectLine $this->localtax2_tx = trim($this->localtax2_tx); $this->qty = trim($this->qty); $this->remise_percent = trim($this->remise_percent); - $this->remise = trim($this->remise); $this->fk_remise_except = (int) $this->fk_remise_except; $this->subprice = price2num($this->subprice); $this->price_ht = price2num($this->price_ht); diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index dc35cfbc7aa..e88b42950f3 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -93,12 +93,17 @@ abstract class CommonInvoice extends CommonObject const STATUS_ABANDONED = 3; + public $totalpaid; // duplicate with sumpayed + public $totaldeposits; // duplicate with sumdeposit + public $totalcreditnotes; // duplicate with sumcreditnote + public $sumpayed; public $sumpayed_multicurrency; public $sumdeposit; public $sumdeposit_multicurrency; public $sumcreditnote; public $sumcreditnote_multicurrency; + public $remaintopay; /** diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e1c2bf662df..079401d045a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -115,6 +115,11 @@ abstract class CommonObject */ public $array_languages = null; // Value is array() when load already tried + /** + * @var array To sotre result of ->liste_contact() + */ + public $contacts_ids; + /** * @var mixed Array of linked objects, set and used when calling ->create() to be able to create links during the creation of object */ diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index 8d577d94ca2..c45e3f1698c 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -74,6 +74,21 @@ abstract class CommonObjectLine extends CommonObject public $volume; public $volume_units; + public $multilangs; + + public $product_type; // type in line + public $product_ref; // ref in product table + public $product_label; // label in product table + public $product_desc; // desc in product table + public $fk_product_type; // type in product table + + public $qty; + public $duree; + public $remise_percent; + public $info_bits; + public $special_code; + + /** * Constructor diff --git a/htdocs/core/class/commonstickergenerator.class.php b/htdocs/core/class/commonstickergenerator.class.php index 8085adf6283..e388159f978 100644 --- a/htdocs/core/class/commonstickergenerator.class.php +++ b/htdocs/core/class/commonstickergenerator.class.php @@ -64,10 +64,40 @@ abstract class CommonStickerGenerator public $code; // Code of format /** - * @var array format Array with informations + * @var int page_largeur + */ + public $page_largeur; + + /** + * @var int page_hauteur + */ + public $page_hauteur; + + /** + * @var array format */ public $format; + /** + * @var int marge_gauche + */ + public $marge_gauche; + + /** + * @var int marge_droite + */ + public $marge_droite; + + /** + * @var int marge_haute + */ + public $marge_haute; + + /** + * @var int marge_basse + */ + public $marge_basse; + // phpcs:disable PEAR.NamingConventions.ValidVariableName.PublicUnderscore // protected // Nom du format de l'etiquette @@ -100,6 +130,8 @@ abstract class CommonStickerGenerator protected $_COUNTY = 1; protected $_First = 1; public $Tformat; + + // phpcs:enable /** * Constructor diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 37b8d580d1c..da3ba49095f 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -917,44 +917,46 @@ class dolReceiptPrinter extends Printer $resql = $this->db->query($sql); if ($resql) { $obj = $this->db->fetch_array($resql); + if (empty($obj)) { + $error++; + $this->errors[] = 'PrinterDontExist'; + } + if (!$error) { + $parameter = (isset($obj['parameter']) ? $obj['parameter'] : ''); + try { + $type = $obj['fk_type']; + switch ($type) { + case 1: + $this->connector = new DummyPrintConnector(); + break; + case 2: + $this->connector = new FilePrintConnector($parameter); + break; + case 3: + $parameters = explode(':', $parameter); + $this->connector = new NetworkPrintConnector($parameters[0], $parameters[1]); + break; + case 4: // LPT1, smb://... + $this->connector = new WindowsPrintConnector(dol_sanitizePathName($parameter)); + break; + case 5: + $this->connector = new CupsPrintConnector($parameter); + break; + default: + $this->connector = 'CONNECTOR_UNKNOWN'; + break; + } + $this->printer = new Printer($this->connector, $this->profile); + } catch (Exception $e) { + $this->errors[] = $e->getMessage(); + $error++; + } + } } else { $error++; $this->errors[] = $this->db->lasterror; } - if (empty($obj)) { - $error++; - $this->errors[] = 'PrinterDontExist'; - } - if (!$error) { - $parameter = $obj['parameter']; - try { - switch ($obj['fk_type']) { - case 1: - $this->connector = new DummyPrintConnector(); - break; - case 2: - $this->connector = new FilePrintConnector($parameter); - break; - case 3: - $parameters = explode(':', $parameter); - $this->connector = new NetworkPrintConnector($parameters[0], $parameters[1]); - break; - case 4: // LPT1, smb://... - $this->connector = new WindowsPrintConnector(dol_sanitizePathName($parameter)); - break; - case 5: - $this->connector = new CupsPrintConnector($parameter); - break; - default: - $this->connector = 'CONNECTOR_UNKNOWN'; - break; - } - $this->printer = new Printer($this->connector, $this->profile); - } catch (Exception $e) { - $this->errors[] = $e->getMessage(); - $error++; - } - } + return $error; } } diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index 517fc953830..b5b1619443b 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -56,6 +56,8 @@ class EmailSenderProfile extends CommonObject */ public $picto = 'emailsenderprofile'; + public $fk_user_creat; + const STATUS_DISABLED = 0; const STATUS_ENABLED = 1; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index e96b042beae..bc404f98cbc 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2755,7 +2755,6 @@ class Form $objp->price = $objp2->price; $objp->unitprice = $objp2->unitprice; $objp->remise_percent = $objp2->remise_percent; - $objp->remise = $objp2->remise; //$objp->tva_tx is not overwritten by $objp2 value //$objp->default_vat_code is not overwritten by $objp2 value @@ -10142,9 +10141,6 @@ class Form window.parent.jQuery(\'#idfordialog'.$dol_openinpopup.'\').dialog(\'close\'); });'; $retstring .= ''; - // TODO @LDR for the save button, in action "add", set parent var to return data and close the window - //$retstring .= 'setid '; - //$retstring .= 'setlabel'; } return $retstring; diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 457d310492c..fac32e62e5e 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -86,23 +86,21 @@ class FormActions select_status(); $('#select' + htmlname).change(function() { + console.log('We change field select '+htmlname); select_status(); }); - // FIXME use another method for update combobox - //$('#val' + htmlname).change(function() { - //select_status(); - //}); }); function select_status() { var defaultvalue = $('#select' + htmlname).val(); + console.log('val='+defaultvalue); var percentage = $('input[name=percentage]'); var selected = '".(isset($selected) ? dol_escape_js($selected) : '')."'; var value = (selected>0?selected:(defaultvalue>=0?defaultvalue:'')); percentage.val(value); - if (defaultvalue == -1) { + if (defaultvalue == 'na' || defaultvalue == -1) { percentage.prop('disabled', true); $('.hideifna').hide(); } @@ -131,7 +129,7 @@ class FormActions } print ''; @@ -1623,7 +1631,7 @@ function dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $di width: \'80%\', title: \''.dol_escape_js($label).'\', open: function (event, ui) { - console.log("open popup"); + console.log("open popup name='.$name.', backtopagejsfields='.$backtopagejsfields.'"); }, close: function (event, ui) { returnedid = jQuery("#varforreturndialogid'.$name.'").text(); diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 37223701ff7..a4232095f4b 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -527,102 +527,100 @@ function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $t if ($mode == 'target' || preg_match('/targetwithdetails/', $mode)) { if ($usecontact) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($targetcontact->getFullName($outputlangs, 1)); + if (is_object($targetcontact)) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($targetcontact->getFullName($outputlangs, 1)); - if (!empty($targetcontact->address)) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($targetcontact)); - } else { - $companytouseforaddress = $targetcompany; + if (!empty($targetcontact->address)) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($targetcontact)); + } else { + $companytouseforaddress = $targetcompany; - // Contact on a thirdparty that is a different thirdparty than the thirdparty of object - if ($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id) { - $targetcontact->fetch_thirdparty(); - $companytouseforaddress = $targetcontact->thirdparty; + // Contact on a thirdparty that is a different thirdparty than the thirdparty of object + if ($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id) { + $targetcontact->fetch_thirdparty(); + $companytouseforaddress = $targetcontact->thirdparty; + } + + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($companytouseforaddress)); + } + // Country + if (!empty($targetcontact->country_code) && $targetcontact->country_code != $sourcecompany->country_code) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcontact->country_code)); + } elseif (empty($targetcontact->country_code) && !empty($targetcompany->country_code) && ($targetcompany->country_code != $sourcecompany->country_code)) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code)); } - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($companytouseforaddress)); - } - // Country - if (!empty($targetcontact->country_code) && $targetcontact->country_code != $sourcecompany->country_code) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcontact->country_code)); - } elseif (empty($targetcontact->country_code) && !empty($targetcompany->country_code) && ($targetcompany->country_code != $sourcecompany->country_code)) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code)); - } - - if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || preg_match('/targetwithdetails/', $mode)) { - // Phone - if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_phone/', $mode)) { - if (!empty($targetcontact->phone_pro) || !empty($targetcontact->phone_mobile)) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Phone").": "; + if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || preg_match('/targetwithdetails/', $mode)) { + // Phone + if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_phone/', $mode)) { + if (!empty($targetcontact->phone_pro) || !empty($targetcontact->phone_mobile)) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Phone").": "; + } + if (!empty($targetcontact->phone_pro)) { + $stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_pro); + } + if (!empty($targetcontact->phone_pro) && !empty($targetcontact->phone_mobile)) { + $stringaddress .= " / "; + } + if (!empty($targetcontact->phone_mobile)) { + $stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_mobile); + } } - if (!empty($targetcontact->phone_pro)) { - $stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_pro); + // Fax + if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_fax/', $mode)) { + if ($targetcontact->fax) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax); + } } - if (!empty($targetcontact->phone_pro) && !empty($targetcontact->phone_mobile)) { - $stringaddress .= " / "; + // EMail + if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_email/', $mode)) { + if ($targetcontact->email) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcontact->email); + } } - if (!empty($targetcontact->phone_mobile)) { - $stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_mobile); - } - } - // Fax - if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_fax/', $mode)) { - if ($targetcontact->fax) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax); - } - } - // EMail - if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_email/', $mode)) { - if ($targetcontact->email) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcontact->email); - } - } - // Web - if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_url/', $mode)) { - if ($targetcontact->url) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcontact->url); + // Web + if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_url/', $mode)) { + if ($targetcontact->url) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcontact->url); + } } } } } else { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($targetcompany)); - // Country - if (!empty($targetcompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code)); - } + if (is_object($targetcompany)) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($targetcompany)); + // Country + if (!empty($targetcompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code)); + } - if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || preg_match('/targetwithdetails/', $mode)) { - // Phone - if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_phone/', $mode)) { - if (!empty($targetcompany->phone) || !empty($targetcompany->phone_mobile)) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Phone").": "; + if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || preg_match('/targetwithdetails/', $mode)) { + // Phone + if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_phone/', $mode)) { + if (!empty($targetcompany->phone)) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Phone").": "; + } + if (!empty($targetcompany->phone)) { + $stringaddress .= $outputlangs->convToOutputCharset($targetcompany->phone); + } } - if (!empty($targetcompany->phone)) { - $stringaddress .= $outputlangs->convToOutputCharset($targetcompany->phone); + // Fax + if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_fax/', $mode)) { + if ($targetcompany->fax) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcompany->fax); + } } - if (!empty($targetcompany->phone) && !empty($targetcompany->phone_mobile)) { - $stringaddress .= " / "; + // EMail + if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_email/', $mode)) { + if ($targetcompany->email) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcompany->email); + } } - if (!empty($targetcompany->phone_mobile)) { - $stringaddress .= $outputlangs->convToOutputCharset($targetcompany->phone_mobile); - } - } - // Fax - if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_fax/', $mode)) { - if ($targetcompany->fax) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcompany->fax); - } - } - // EMail - if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_email/', $mode)) { - if ($targetcompany->email) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcompany->email); - } - } - // Web - if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_url/', $mode)) { - if ($targetcompany->url) { - $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcompany->url); + // Web + if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_url/', $mode)) { + if ($targetcompany->url) { + $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcompany->url); + } } } } diff --git a/htdocs/core/modules/asset/modules_asset.php b/htdocs/core/modules/asset/modules_asset.php index e158b5bdfe9..f7f361a10cc 100644 --- a/htdocs/core/modules/asset/modules_asset.php +++ b/htdocs/core/modules/asset/modules_asset.php @@ -37,6 +37,41 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requir */ abstract class ModelePDFAsset extends CommonDocGenerator { + /** + * @var int page_largeur + */ + public $page_largeur; + + /** + * @var int page_hauteur + */ + public $page_hauteur; + + /** + * @var array format + */ + public $format; + + /** + * @var int marge_gauche + */ + public $marge_gauche; + + /** + * @var int marge_droite + */ + public $marge_droite; + + /** + * @var int marge_haute + */ + public $marge_haute; + + /** + * @var int marge_basse + */ + public $marge_basse; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index c5d91f3e2de..907688b4878 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -81,41 +81,6 @@ class pdf_standard extends ModeleExpenseReport */ public $version = 'dolibarr'; - /** - * @var int page_largeur - */ - public $page_largeur; - - /** - * @var int page_hauteur - */ - public $page_hauteur; - - /** - * @var array format - */ - public $format; - - /** - * @var int marge_gauche - */ - public $marge_gauche; - - /** - * @var int marge_droite - */ - public $marge_droite; - - /** - * @var int marge_haute - */ - public $marge_haute; - - /** - * @var int marge_basse - */ - public $marge_basse; - /** * Issuer * @var Societe diff --git a/htdocs/core/modules/expensereport/modules_expensereport.php b/htdocs/core/modules/expensereport/modules_expensereport.php index c4d74d7b6d2..eee2190033e 100644 --- a/htdocs/core/modules/expensereport/modules_expensereport.php +++ b/htdocs/core/modules/expensereport/modules_expensereport.php @@ -28,6 +28,41 @@ abstract class ModeleExpenseReport extends CommonDocGenerator */ public $error = ''; + /** + * @var int page_largeur + */ + public $page_largeur; + + /** + * @var int page_hauteur + */ + public $page_hauteur; + + /** + * @var array format + */ + public $format; + + /** + * @var int marge_gauche + */ + public $marge_gauche; + + /** + * @var int marge_droite + */ + public $marge_droite; + + /** + * @var int marge_haute + */ + public $marge_haute; + + /** + * @var int marge_basse + */ + public $marge_basse; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index b57fa1bf655..95c02af8e73 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -804,11 +804,12 @@ class ImportCsv extends ModeleImports $resql = $this->db->query($sqlSelect); if ($resql) { - $res = $this->db->fetch_object($resql); - if ($resql->num_rows == 1) { + $num_rows = $this->db->num_rows($resql); + if ($num_rows == 1) { + $res = $this->db->fetch_object($resql); $lastinsertid = $res->rowid; $last_insert_id_array[$tablename] = $lastinsertid; - } elseif ($resql->num_rows > 1) { + } elseif ($num_rows > 1) { $this->errors[$error]['lib'] = $langs->trans('MultipleRecordFoundWithTheseFilters', implode(', ', $filters)); $this->errors[$error]['type'] = 'SQL'; $error++; @@ -837,7 +838,7 @@ class ImportCsv extends ModeleImports $resql = $this->db->query($sqlSelect); if ($resql) { $res = $this->db->fetch_object($resql); - if ($resql->num_rows == 1) { + if ($this->db->num_rows($resql) == 1) { // We have a row referencing this last foreign key, continue with UPDATE. } else { // No record found referencing this last foreign key, diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index d9fe3048e2f..7877275b034 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -844,11 +844,12 @@ class ImportXlsx extends ModeleImports $resql = $this->db->query($sqlSelect); if ($resql) { - $res = $this->db->fetch_object($resql); - if ($resql->num_rows == 1) { + $num_rows = $this->db->num_rows($resql); + if ($num_rows == 1) { + $res = $this->db->fetch_object($resql); $lastinsertid = $res->rowid; $last_insert_id_array[$tablename] = $lastinsertid; - } elseif ($resql->num_rows > 1) { + } elseif ($num_rows > 1) { $this->errors[$error]['lib'] = $langs->trans('MultipleRecordFoundWithTheseFilters', implode(', ', $filters)); $this->errors[$error]['type'] = 'SQL'; $error++; @@ -877,7 +878,7 @@ class ImportXlsx extends ModeleImports $resql = $this->db->query($sqlSelect); if ($resql) { $res = $this->db->fetch_object($resql); - if ($resql->num_rows == 1) { + if ($this->db->num_rows($resql) == 1) { // We have a row referencing this last foreign key, continue with UPDATE. } else { // No record found referencing this last foreign key, diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index ffd8fde5f1d..cac9047e56e 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -211,8 +211,8 @@ class modAgenda extends DolibarrModules 'url'=>'/comm/action/index.php', 'langs'=>'agenda', 'position'=>86, - 'perms'=>'$user->rights->agenda->myactions->read', - 'enabled'=>'$conf->agenda->enabled', + 'perms'=>'$user->rights->agenda->myactions->read || $user->rights->resource->read', + 'enabled'=>'$conf->agenda->enabled || $conf->resource->enabled', 'target'=>'', 'user'=>2, ); diff --git a/htdocs/core/modules/modResource.class.php b/htdocs/core/modules/modResource.class.php index da1fdcbf016..2c59b6b3172 100644 --- a/htdocs/core/modules/modResource.class.php +++ b/htdocs/core/modules/modResource.class.php @@ -91,7 +91,7 @@ class modResource extends DolibarrModules // Dependencies // List of modules id that must be enabled if this module is enabled - $this->depends = array(); + $this->depends = array('modResource'); // List of modules id to disable if this one is disabled $this->requiredby = array('modPlace'); // Minimum version of PHP required by module @@ -185,11 +185,11 @@ class modResource extends DolibarrModules // Menus declaration $this->menu[$r] = array( - 'fk_menu'=>'fk_mainmenu=tools', + 'fk_menu'=>'fk_mainmenu=agenda', 'type'=>'left', 'titre'=> 'MenuResourceIndex', 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth em92"'), - 'mainmenu'=>'tools', + 'mainmenu'=>'agenda', 'leftmenu'=> 'resource', 'url'=> '/resource/list.php', 'langs'=> 'resource', @@ -201,10 +201,10 @@ class modResource extends DolibarrModules $r++; $this->menu[$r++] = array( - 'fk_menu'=>'fk_mainmenu=tools,fk_leftmenu=resource', //On utilise les ancres définis dans le menu parent déclaré au dessus + 'fk_menu'=>'fk_mainmenu=agenda,fk_leftmenu=resource', //On utilise les ancres définis dans le menu parent déclaré au dessus 'type'=> 'left', // Toujours un menu gauche 'titre'=> 'MenuResourceAdd', - 'mainmenu'=> 'tools', + 'mainmenu'=> 'agenda', 'leftmenu'=> 'resource_add', 'url'=> '/resource/card.php?action=create', 'langs'=> 'resource', @@ -216,10 +216,10 @@ class modResource extends DolibarrModules ); $this->menu[$r++] = array( - 'fk_menu'=>'fk_mainmenu=tools,fk_leftmenu=resource', //On utilise les ancres définis dans le menu parent déclaré au dessus + 'fk_menu'=>'fk_mainmenu=agenda,fk_leftmenu=resource', //On utilise les ancres définis dans le menu parent déclaré au dessus 'type'=> 'left', // Toujours un menu gauche 'titre'=> 'List', - 'mainmenu'=> 'tools', + 'mainmenu'=> 'agenda', 'leftmenu'=> 'resource_list', 'url'=> '/resource/list.php', 'langs'=> 'resource', diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index b753f93d339..f597f580b47 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -52,6 +52,11 @@ class pdf_standard extends ModelePDFMovement */ public $description; + /** + * @var int Save the name of generated file as the main doc when generating a doc with this template + */ + public $update_main_doc_field; + /** * @var string document type */ @@ -70,42 +75,8 @@ class pdf_standard extends ModelePDFMovement public $version = 'dolibarr'; /** - * @var int page_largeur - */ - public $page_largeur; - - /** - * @var int page_hauteur - */ - public $page_hauteur; - - /** - * @var array format - */ - public $format; - - /** - * @var int marge_gauche - */ - public $marge_gauche; - - /** - * @var int marge_droite - */ - public $marge_droite; - - /** - * @var int marge_haute - */ - public $marge_haute; - - /** - * @var int marge_basse - */ - public $marge_basse; - - /** - * @var Societe Issuer + * Issuer + * @var Societe Object that emits */ public $emetteur; @@ -139,7 +110,7 @@ class pdf_standard extends ModelePDFMovement $this->name = "stdmouvement"; $this->description = $langs->trans("DocumentModelStandardPDF"); - // Page size for A4 format + // Dimension page $this->type = 'pdf'; $formatarray = pdf_getFormat(); $this->page_largeur = $formatarray['width']; @@ -157,7 +128,7 @@ class pdf_standard extends ModelePDFMovement // Get source company $this->emetteur = $mysoc; - if (!$this->emetteur->country_code) { + if (empty($this->emetteur->country_code)) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined } @@ -202,10 +173,12 @@ class pdf_standard extends ModelePDFMovement * @param int $hideref Do not show ref * @return int 1 if OK, <=0 if KO */ - public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0) + public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0) { // phpcs:enable - global $user, $langs, $conf, $mysoc, $db, $hookmanager; + global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblines; + + dol_syslog("write_file outputlangs->defaultlang=".(is_object($outputlangs) ? $outputlangs->defaultlang : 'null')); if (!is_object($outputlangs)) { $outputlangs = $langs; @@ -215,7 +188,7 @@ class pdf_standard extends ModelePDFMovement $outputlangs->charset_output = 'ISO-8859-1'; } - // Load traductions files required by page + // Load traductions files required by the page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "stocks", "orders", "deliveries")); /** @@ -487,7 +460,7 @@ class pdf_standard extends ModelePDFMovement $pdf->useTemplate($tplidx); } $pagenb++; - $this->_pagehead($pdf, $object, 1, $outputlangs); + $top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs); $pdf->SetFont('', '', $default_font_size - 1); $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); @@ -499,7 +472,8 @@ class pdf_standard extends ModelePDFMovement // Show list of product of the MouvementStock - $nexY += 5; + $nexY = $tab_top - 1; + $nexY = $pdf->GetY(); $nexY += 10; diff --git a/htdocs/core/modules/movement/modules_movement.php b/htdocs/core/modules/movement/modules_movement.php index e818f8eee2e..1af966faf22 100644 --- a/htdocs/core/modules/movement/modules_movement.php +++ b/htdocs/core/modules/movement/modules_movement.php @@ -35,6 +35,42 @@ abstract class ModelePDFMovement extends CommonDocGenerator */ public $error = ''; + /** + * @var int page_largeur + */ + public $page_largeur; + + /** + * @var int page_hauteur + */ + public $page_hauteur; + + /** + * @var array format + */ + public $format; + + /** + * @var int marge_gauche + */ + public $marge_gauche; + + /** + * @var int marge_droite + */ + public $marge_droite; + + /** + * @var int marge_haute + */ + public $marge_haute; + + /** + * @var int marge_basse + */ + public $marge_basse; + + public $option_codestockservice; diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index dc01267c0f5..ea52b9c3c70 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -68,41 +68,6 @@ class pdf_standard extends ModelePDFProduct */ public $version = 'dolibarr'; - /** - * @var int page_largeur - */ - public $page_largeur; - - /** - * @var int page_hauteur - */ - public $page_hauteur; - - /** - * @var array format - */ - public $format; - - /** - * @var int marge_gauche - */ - public $marge_gauche; - - /** - * @var int marge_droite - */ - public $marge_droite; - - /** - * @var int marge_haute - */ - public $marge_haute; - - /** - * @var int marge_basse - */ - public $marge_basse; - /** * Issuer * @var Societe diff --git a/htdocs/core/modules/product/modules_product.class.php b/htdocs/core/modules/product/modules_product.class.php index 4b00cbe132e..6c47847ef60 100644 --- a/htdocs/core/modules/product/modules_product.class.php +++ b/htdocs/core/modules/product/modules_product.class.php @@ -38,6 +38,41 @@ abstract class ModelePDFProduct extends CommonDocGenerator */ public $error = ''; + /** + * @var int page_largeur + */ + public $page_largeur; + + /** + * @var int page_hauteur + */ + public $page_hauteur; + + /** + * @var array format + */ + public $format; + + /** + * @var int marge_gauche + */ + public $marge_gauche; + + /** + * @var int marge_droite + */ + public $marge_droite; + + /** + * @var int marge_haute + */ + public $marge_haute; + + /** + * @var int marge_basse + */ + public $marge_basse; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index d51692812be..abd05f63651 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -138,6 +138,14 @@ class pdf_beluga extends ModelePDFProjects */ public $emetteur; + public $posxref; + public $posxdate; + public $posxsociete; + public $posxamountht; + public $posxamountttc; + public $posstatut; + + /** * Constructor * @@ -479,7 +487,7 @@ class pdf_beluga extends ModelePDFProjects } //var_dump("$key, $tablename, $datefieldname, $dates, $datee"); - $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee, $projectField); + $elementarray = $object->get_element_list($key, $tablename, $datefieldname, '', '', $projectField); $num = count($elementarray); if ($num >= 0) { @@ -492,7 +500,7 @@ class pdf_beluga extends ModelePDFProjects $pdf->SetXY($this->posxref, $curY); $pdf->MultiCell($this->posxstatut - $this->posxref, 3, $outputlangs->transnoentities($title), 0, 'L'); - $selectList = $formproject->select_element($tablename, $project->thirdparty->id, '', -2, $projectField); + $selectList = $formproject->select_element($tablename, $object->thirdparty->id, '', -2, $projectField); $nexY = $pdf->GetY() + 1; $curY = $nexY; $pdf->SetXY($this->posxref, $curY); @@ -790,8 +798,6 @@ class pdf_beluga extends ModelePDFProjects */ protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0) { - global $conf, $mysoc; - $heightoftitleline = 10; $default_font_size = pdf_getPDFFontSize($outputlangs); @@ -806,24 +812,6 @@ class pdf_beluga extends ModelePDFProjects $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('', '', $default_font_size); - - $pdf->SetXY($this->posxref, $tab_top + 1); - $pdf->MultiCell($this->posxlabel - $this->posxref, 3, $outputlangs->transnoentities("Tasks"), '', 'L'); - - $pdf->SetXY($this->posxlabel, $tab_top + 1); - $pdf->MultiCell($this->posxworkload - $this->posxlabel, 3, $outputlangs->transnoentities("Description"), 0, 'L'); - - $pdf->SetXY($this->posxworkload, $tab_top + 1); - $pdf->MultiCell($this->posxprogress - $this->posxworkload, 3, $outputlangs->transnoentities("PlannedWorkloadShort"), 0, 'R'); - - $pdf->SetXY($this->posxprogress, $tab_top + 1); - $pdf->MultiCell($this->posxdatestart - $this->posxprogress, 3, '%', 0, 'R'); - - $pdf->SetXY($this->posxdatestart, $tab_top + 1); - $pdf->MultiCell($this->posxdateend - $this->posxdatestart, 3, '', 0, 'C'); - - $pdf->SetXY($this->posxdateend, $tab_top + 1); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxdatestart, 3, '', 0, 'C'); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index 5a902befd8e..ecbeccb5a61 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -70,41 +70,6 @@ class pdf_standard extends ModelePDFStock */ public $version = 'dolibarr'; - /** - * @var int page_largeur - */ - public $page_largeur; - - /** - * @var int page_hauteur - */ - public $page_hauteur; - - /** - * @var array format - */ - public $format; - - /** - * @var int marge_gauche - */ - public $marge_gauche; - - /** - * @var int marge_droite - */ - public $marge_droite; - - /** - * @var int marge_haute - */ - public $marge_haute; - - /** - * @var int marge_basse - */ - public $marge_basse; - /** * Issuer * @var Societe diff --git a/htdocs/core/modules/stock/modules_stock.php b/htdocs/core/modules/stock/modules_stock.php index 2c9f9e82591..73092bb0bf6 100644 --- a/htdocs/core/modules/stock/modules_stock.php +++ b/htdocs/core/modules/stock/modules_stock.php @@ -28,6 +28,41 @@ abstract class ModelePDFStock extends CommonDocGenerator */ public $error = ''; + /** + * @var int page_largeur + */ + public $page_largeur; + + /** + * @var int page_hauteur + */ + public $page_hauteur; + + /** + * @var array format + */ + public $format; + + /** + * @var int marge_gauche + */ + public $marge_gauche; + + /** + * @var int marge_droite + */ + public $marge_droite; + + /** + * @var int marge_haute + */ + public $marge_haute; + + /** + * @var int marge_basse + */ + public $marge_basse; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index f7792676669..4e1027207a7 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -76,41 +76,6 @@ class pdf_standard extends ModelePDFSuppliersPayments */ public $version = 'dolibarr'; - /** - * @var int page_largeur - */ - public $page_largeur; - - /** - * @var int page_hauteur - */ - public $page_hauteur; - - /** - * @var array format - */ - public $format; - - /** - * @var int marge_gauche - */ - public $marge_gauche; - - /** - * @var int marge_droite - */ - public $marge_droite; - - /** - * @var int marge_haute - */ - public $marge_haute; - - /** - * @var int marge_basse - */ - public $marge_basse; - /** * Issuer * @var Societe diff --git a/htdocs/core/modules/supplier_payment/modules_supplier_payment.php b/htdocs/core/modules/supplier_payment/modules_supplier_payment.php index b1b8e999ce9..c5db770bdb4 100644 --- a/htdocs/core/modules/supplier_payment/modules_supplier_payment.php +++ b/htdocs/core/modules/supplier_payment/modules_supplier_payment.php @@ -27,6 +27,41 @@ abstract class ModelePDFSuppliersPayments extends CommonDocGenerator */ public $error = ''; + /** + * @var int page_largeur + */ + public $page_largeur; + + /** + * @var int page_hauteur + */ + public $page_hauteur; + + /** + * @var array format + */ + public $format; + + /** + * @var int marge_gauche + */ + public $marge_gauche; + + /** + * @var int marge_droite + */ + public $marge_droite; + + /** + * @var int marge_haute + */ + public $marge_haute; + + /** + * @var int marge_basse + */ + public $marge_basse; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index 840d6d9c3ba..298ad489764 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -240,7 +240,7 @@ class InterfaceTicketEmail extends DolibarrTriggers unset($linked_contacts); } if ($sendto) { - $this->composeAndSendCustomerMessage($sendto, $subject_customer, $body_customer, $see_ticket_customer, $object, $langs, $conf); + $this->composeAndSendCustomerMessage($sendto, $subject_customer, $body_customer, $see_ticket_customer, $object, $langs); } } $ok = 1; diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index ef1557f4f00..508db07c65e 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1920,7 +1920,7 @@ class EmailCollector extends CommonObject if (count($pj) > 0) { $sql = "SELECT rowid as id FROM " . MAIN_DB_PREFIX . "user WHERE email LIKE '%" . $from . "%'"; $resql = $this->db->query($sql); - if ($resql->num_rows == 0) { + if ($this->db->num_rows($resql) == 0) { $this->errors = 'User Not allowed to add documents'; } $arrayobject = array( diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 7b63e6a3d6d..09e53fbd6f1 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -1494,6 +1494,8 @@ class FichinterLigne extends CommonObjectLine */ public $fk_element = 'fk_fichinter'; + + /** * Constructor * diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php index 4488b4643b8..beb17cd3a67 100644 --- a/htdocs/fichinter/class/fichinterrec.class.php +++ b/htdocs/fichinter/class/fichinterrec.class.php @@ -350,7 +350,7 @@ class FichinterRec extends Fichinter // phpcs:enable $this->lines = array(); - $sql = 'SELECT l.rowid, l.fk_product, l.product_type, l.label as custom_label, l.description, '; + $sql = 'SELECT l.rowid, l.fk_product, l.product_type as product_type, l.label as custom_label, l.description, '; $sql .= ' l.price, l.qty, l.tva_tx, l.remise, l.remise_percent, l.subprice, l.duree, '; $sql .= ' l.total_ht, l.total_tva, l.total_ttc,'; $sql .= ' l.rang, l.special_code,'; @@ -378,7 +378,7 @@ class FichinterRec extends Fichinter $line->product_ref = $objp->product_ref; // Ref product $line->product_label = $objp->product_label; // Label product $line->product_desc = $objp->product_desc; // Description product - $line->fk_product_type = $objp->fk_product_type; // Type of product + $line->fk_product_type = $objp->fk_product_type; // Type in product $line->qty = $objp->qty; $line->duree = $objp->duree; $line->duration = $objp->duree; @@ -401,10 +401,6 @@ class FichinterRec extends Fichinter $line->special_code = $objp->special_code; $line->fk_unit = $objp->fk_unit; - // Ne plus utiliser - $line->price = $objp->price; - $line->remise = $objp->remise; - $this->lines[$i] = $line; $i++; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index b780cbde926..16f7cf8d060 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3751,9 +3751,6 @@ class CommandeFournisseurLigne extends CommonOrderLine if (empty($this->rang)) { $this->rang = 0; } - if (empty($this->remise)) { - $this->remise = 0; - } if (empty($this->remise_percent)) { $this->remise_percent = 0; } diff --git a/htdocs/hrm/evaluation_card.php b/htdocs/hrm/evaluation_card.php index 71d3101e1c7..9c73d8c99b6 100644 --- a/htdocs/hrm/evaluation_card.php +++ b/htdocs/hrm/evaluation_card.php @@ -680,7 +680,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $MAXEVENT = 10; - $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/hrm/evaluation_agenda.php?id='.$object->id); + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/evaluation_agenda.php?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; diff --git a/htdocs/hrm/job_card.php b/htdocs/hrm/job_card.php index 906eb83b945..29493aa9cbd 100644 --- a/htdocs/hrm/job_card.php +++ b/htdocs/hrm/job_card.php @@ -451,7 +451,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $MAXEVENT = 10; - $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/hrm/job_agenda.php?id='.$object->id); + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/job_agenda.php?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; diff --git a/htdocs/hrm/lib/hrm_job.lib.php b/htdocs/hrm/lib/hrm_job.lib.php index f465d934b0f..723aaf14af5 100644 --- a/htdocs/hrm/lib/hrm_job.lib.php +++ b/htdocs/hrm/lib/hrm_job.lib.php @@ -39,17 +39,17 @@ function jobPrepareHead($object) $h = 0; $head = array(); - $head[$h][0] = dol_buildpath("/hrm/job_card.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT."/hrm/job_card.php?id=".$object->id; $head[$h][1] = $langs->trans("JobCard"); $head[$h][2] = 'job_card'; $h++; - $head[$h][0] = dol_buildpath("/hrm/skill_tab.php", 1).'?id='.$object->id.'&objecttype=job'; + $head[$h][0] = DOL_URL_ROOT."/hrm/skill_tab.php?id=".$object->id.'&objecttype=job'; $head[$h][1] = $langs->trans("RequiredSkills"); $head[$h][2] = 'skill_tab'; $h++; - $head[$h][0] = dol_buildpath("/hrm/position.php", 1).'?fk_job='.$object->id; + $head[$h][0] = DOL_URL_ROOT."/hrm/position.php?fk_job=".$object->id; $head[$h][1] = $langs->trans("EmployeesInThisPosition"); $head[$h][2] = 'position'; $h++; diff --git a/htdocs/hrm/position_card.php b/htdocs/hrm/position_card.php index c26d981a324..6e751a9005a 100644 --- a/htdocs/hrm/position_card.php +++ b/htdocs/hrm/position_card.php @@ -348,7 +348,7 @@ function DisplayPositionCard(&$object) // // $MAXEVENT = 10; // -// $morehtmlright = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id); +// $morehtmlright = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id); // // // List of actions on element // include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; @@ -377,7 +377,7 @@ if ($action !== 'edit' && $action !== 'create') { $MAXEVENT = 10; - $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/hrm/position_agenda.php?id='.$object->id); + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/position_agenda.php?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php index 6cac7b4d448..3a27d5898c0 100644 --- a/htdocs/hrm/skill_card.php +++ b/htdocs/hrm/skill_card.php @@ -856,7 +856,7 @@ if ($action != "create" && $action != "edit") { $MAXEVENT = 10; - $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/hrm/skill_agenda.php?id='.$object->id); + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/skill_agenda.php?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; diff --git a/htdocs/hrm/skill_tab.php b/htdocs/hrm/skill_tab.php index 0bbc039152c..faa8fa57f8e 100644 --- a/htdocs/hrm/skill_tab.php +++ b/htdocs/hrm/skill_tab.php @@ -120,10 +120,10 @@ if (empty($reshook)) { $skillAdded->fk_object = $id; $skillAdded->objecttype = $objecttype; $ret = $skillAdded->create($user); - if ($ret < 0) setEventMessage($skillAdded->error, 'errors'); + if ($ret < 0) setEventMessages($skillAdded->error, null, 'errors'); //else unset($TSkillsToAdd); } - if ($ret > 0) setEventMessage($langs->trans("SaveAddSkill")); + if ($ret > 0) setEventMessages($langs->trans("SaveAddSkill"), null); } } elseif ($action == 'saveSkill') { if (!empty($TNote)) { @@ -136,14 +136,14 @@ if (empty($reshook)) { } } } - setEventMessage($langs->trans("SaveLevelSkill")); - header("Location: " . dol_buildpath('/hrm/skill_tab.php', 1) . '?id=' . $id. '&objecttype=job'); + setEventMessages($langs->trans("SaveLevelSkill"), null); + header("Location: " . DOL_URL_ROOT.'/hrm/skill_tab.php?id=' . $id. '&objecttype=job'); exit; } } elseif ($action == 'confirm_deleteskill' && $confirm == 'yes') { $skillToDelete = new SkillRank($db); $ret = $skillToDelete->fetch($lineid); - setEventMessage($langs->trans("DeleteSkill")); + setEventMessages($langs->trans("DeleteSkill"), null); if ($ret > 0) { $skillToDelete->delete($user); } @@ -247,12 +247,67 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; print '
'; + print '
'; - print '
'.$langs->trans("Date").''; - $datep = ($datep ? $datep : (is_null($object->datep) ? '' : $object->datep)); - if (GETPOST('datep', 'int', 1)) { - $datep = dol_stringtotime(GETPOST('datep', 'int', 1), 'tzuser'); - } - $datef = ($datef ? $datef : $object->datef); - if (GETPOST('datef', 'int', 1)) { - $datef = dol_stringtotime(GETPOST('datef', 'int', 1), 'tzuser'); - } - if (empty($datef) && !empty($datep)) { - if (GETPOST("actioncode", 'aZ09') == 'AC_RDV' || empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT)) { - $datef = dol_time_plus_duree($datep, (empty($conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS) ? 1 : $conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS), 'h'); - } - } - - // Date start - print '
'; - print ''.$langs->trans("DateActionStart").''; - print ' - '; - print ''.$langs->trans("DateActionEnd").''; - print ''; - if (GETPOST("afaire") == 1) { - print $form->selectDate($datep, 'ap', 1, 1, 0, "action", 1, 2, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuserrel'); // Empty value not allowed for start date and hours if "todo" - } else { - print $form->selectDate($datep, 'ap', 1, 1, 1, "action", 1, 2, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuserrel'); - } - print '     -     '; - //print ' - '; - if (GETPOST("afaire") == 1) { - print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuserrel'); - } else { - print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuserrel'); - } - print '
'; - print ''.$langs->trans("DateActionEnd").''; - print ''; - if (GETPOST("afaire") == 1) { - print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 2, 0, 'fulldayend'); - } else { - print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 2, 0, 'fulldayend'); - } - print '
'; + //print '
'; + print '        
'; + print img_picto($langs->trans("Recurrence"), 'recurring', 'class="paddingright2"'); print ''; $selectedrecurrulefreq = 'no'; $selectedrecurrulebymonthday = ''; @@ -1120,34 +1084,51 @@ if ($action == 'create') { }); }); '; - print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; - $percent = $complete !=='' ? $complete : -1; - if (GETPOSTISSET('status')) { - $percent = GETPOST('status'); - } elseif (GETPOSTISSET('percentage')) { - $percent = GETPOST('percentage', 'int'); - } else { - if ($complete == '0' || GETPOST("afaire") == 1) { - $percent = '0'; - } elseif ($complete == 100 || GETPOST("afaire") == 2) { - $percent = 100; - } - } - $formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200'); print '
'.$langs->trans("Location").'
'; + /* + print ''.$langs->trans("DateActionStart").''; + print ' - '; + print ''.$langs->trans("DateActionEnd").''; + */ + print ''; + if (GETPOST("afaire") == 1) { + print $form->selectDate($datep, 'ap', 1, 1, 0, "action", 1, 2, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuserrel'); // Empty value not allowed for start date and hours if "todo" + } else { + print $form->selectDate($datep, 'ap', 1, 1, 1, "action", 1, 2, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuserrel'); + } + print '     -     '; + if (GETPOST("afaire") == 1) { + print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuserrel'); + } else { + print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuserrel'); + } + print '
 
'.$langs->trans("ActionAffectedTo").''; + print '
'.$langs->trans("ActionAffectedTo").''; $listofuserid = array(); $listofcontactid = array(); $listofotherid = array(); @@ -1181,6 +1162,29 @@ if ($action == 'create') { print '
'.$langs->trans("Location").'
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; + $percent = $complete !=='' ? $complete : -1; + if (GETPOSTISSET('status')) { + $percent = GETPOST('status'); + } elseif (GETPOSTISSET('percentage')) { + $percent = GETPOST('percentage', 'int'); + } else { + if ($complete == '0' || GETPOST("afaire") == 1) { + $percent = '0'; + } elseif ($complete == 100 || GETPOST("afaire") == 2) { + $percent = 100; + } + } + $formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200'); + print '
'.$langs->trans("Categories").''; @@ -1523,6 +1527,7 @@ if ($id > 0) { if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { print '
'.$langs->trans("Type").''; if ($object->type_code != 'AC_OTH_AUTO') { + print img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"'); print $formactions->select_type_actions(GETPOST("actioncode", 'aZ09') ? GETPOST("actioncode", 'aZ09') : $object->type_code, "actioncode", "systemauto", 0, 0, 0, 1); } else { print ''; @@ -1533,40 +1538,19 @@ if ($id > 0) { } // Title - print '
'.$langs->trans("Title").'
'.$langs->trans("EventOnFullDay").'fulldayevent ? ' checked' : '').'>
'.$langs->trans("Date").'fulldayevent ? ' checked' : '').'>'; + print ''; - // Date start - end - print '
'; - print ''.$langs->trans("DateActionStart").''; - print ' - '; - print 'type_code == 'AC_RDV' ? ' class="fieldrequired"' : '').'>'.$langs->trans("DateActionEnd").''; - print ''; - $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); - if (GETPOST("afaire") == 1) { - print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 0, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel'); - } elseif (GETPOST("afaire") == 2) { - print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel'); - } else { - print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel'); - } - print ' - '; - if (GETPOST("afaire") == 1) { - print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel'); - } elseif (GETPOST("afaire") == 2) { - print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel'); - } else { - print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel'); - } - print '
'; + //print '
'; + print '        
'; + print img_picto($langs->trans("Recurrence"), 'recurring', 'class="paddingright2"'); print ''; $selectedrecurrulefreq = 'no'; $selectedrecurrulebymonthday = ''; @@ -1615,19 +1599,37 @@ if ($id > 0) { }); }); '; - print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; - $percent = GETPOSTISSET("percentage") ? GETPOST("percentage", "int") : $object->percentage; - $formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200'); print '
'.$langs->trans("Location").'
'; + /*print ''.$langs->trans("DateActionStart").''; + print ' - '; + print 'type_code == 'AC_RDV' ? ' class="fieldrequired"' : '').'>'.$langs->trans("DateActionEnd").''; + */ + print ''; + $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); + if (GETPOST("afaire") == 1) { + print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 0, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel'); + } elseif (GETPOST("afaire") == 2) { + print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel'); + } else { + print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel'); } + print '     -     '; + if (GETPOST("afaire") == 1) { + print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel'); + } elseif (GETPOST("afaire") == 2) { + print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel'); + } else { + print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel'); + } + print '
 
'.$langs->trans("Location").'
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; + $percent = GETPOSTISSET("percentage") ? GETPOST("percentage", "int") : $object->percentage; + $formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200'); + print '
'.$langs->trans("Categories").''; @@ -1786,7 +1800,7 @@ if ($id > 0) { print '
'.$langs->trans("Description").''; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('note', $object->note_private, '', 200, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_5, '90%'); + $doleditor = new DolEditor('note', $object->note_private, '', 120, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_4, '90%'); $doleditor->Create(); print '
'; + print ''; print dol_print_date($db->jdate($objp->datec), 'dayhour'); print ''; + print ''; print dol_print_date($db->jdate($objp->tms), 'dayhour'); print '
' . "\n"; + print '
'; + + // Login + print ''; + if (!empty($object->ldap_sid) && $object->statut == 0) { + print ''; + } else { + print ''; + } + print ''."\n"; + $object->fields['label']['visible']=0; // Already in banner - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; + $object->fields['firstname']['visible']=0; // Already in banner + $object->fields['lastname']['visible']=0; // Already in banner + //include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; + + // Ref employee + print ''; + print ''; + print ''."\n"; + + // National Registration Number + print ''; + print ''; + print ''."\n"; + + /*print ''; // Notification for this thirdparty + print '';*/ + print '
'.$langs->trans("Login").''; + print $langs->trans("LoginAccountDisableInDolibarr"); + print ''; + $addadmin = ''; + if (property_exists($object, 'admin')) { + if (!empty($conf->multicompany->enabled) && !empty($object->admin) && empty($object->entity)) { + $addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "redstar", 'class="paddingleft"'); + } elseif (!empty($object->admin)) { + $addadmin .= img_picto($langs->trans("AdministratorDesc"), "star", 'class="paddingleft"'); + } + } + print showValueWithClipboardCPButton($object->login).$addadmin; + print '
'.$langs->trans("RefEmployee").''; + print showValueWithClipboardCPButton($object->ref_employee); + print '
'.$langs->trans("NationalRegistrationNumber").''; + print showValueWithClipboardCPButton($object->national_registration_number); + print '
'.$langs->trans("NbOfActiveNotifications").''; + $nbofrecipientemails=0; + $notify=new Notify($db); + $tmparray = $notify->getNotificationsArray('', 0, null, $object->id, array('user')); + foreach($tmparray as $tmpkey => $tmpval) + { + $nbofrecipientemails++; + } + print $nbofrecipientemails; + print '
'; + print '
'; + print ''; + print '

'; @@ -296,7 +351,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } print ''; if (!is_array($TSkillsJob) || empty($TSkillsJob)) { - print '' . $langs->trans("NoRecordFound") . ''; + print '' . $langs->trans("NoRecordFound") . ''; } else { $sk = new Skill($db); foreach ($TSkillsJob as $skillElement) { diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index d38f6deb2bc..46a14450f3e 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -317,6 +317,7 @@ if ($step == 4 && $action == 'select_model') { } } $_SESSION["dol_array_match_file_to_database"] = $serialized_array_match_file_to_database; + $_SESSION['dol_array_match_file_to_database_select'] = $_SESSION["dol_array_match_file_to_database"]; } } if ($action == 'saveselectorder') { @@ -745,6 +746,7 @@ if ($step == 3 && $datatoimport) { // STEP 4: Page to make matching between source file and database fields if ($step == 4 && $datatoimport) { + //var_dump($_SESSION["dol_array_match_file_to_database_select"]); $serialized_array_match_file_to_database = isset($_SESSION["dol_array_match_file_to_database_select"]) ? $_SESSION["dol_array_match_file_to_database_select"] : ''; $array_match_file_to_database = array(); $fieldsarray = explode(',', $serialized_array_match_file_to_database); @@ -793,7 +795,7 @@ if ($step == 4 && $datatoimport) { $i = 1; foreach ($arrayrecord as $key => $val) { if ($val["type"] != -1) { - $fieldssource[$i]['example1'] = dol_trunc($val['val'], 24); + $fieldssource[$i]['example1'] = dol_trunc($val['val'], 128); $i++; } } @@ -805,6 +807,11 @@ if ($step == 4 && $datatoimport) { $minpos = min(count($fieldssource), count($fieldstarget)); //var_dump($array_match_file_to_database); + $initialloadofstep4 = false; + if (empty($_SESSION['dol_array_match_file_to_database_select'])) { + $initialloadofstep4 = true; + } + // Is it a first time in page (if yes, we must initialize array_match_file_to_database) if (count($array_match_file_to_database) == 0) { // This is first input in screen, we need to define @@ -837,6 +844,7 @@ if ($step == 4 && $datatoimport) { } $array_match_database_to_file = array_flip($array_match_file_to_database); + $fieldstarget_tmp = array(); $arraykeysfieldtarget = array_keys($fieldstarget); $position = 0; @@ -876,6 +884,7 @@ if ($step == 4 && $datatoimport) { //print $serialized_array_match_file_to_database; //print $_SESSION["dol_array_match_file_to_database"]; + //print $_SESSION["dol_array_match_file_to_database_select"]; //var_dump($array_match_file_to_database);exit; // Now $array_match_file_to_database contains fieldnb(1,2,3...)=>fielddatabase(key in $array_match_file_to_database) @@ -903,7 +912,7 @@ if ($step == 4 && $datatoimport) { print '
'; print '
'; - print ''; + print '
'; // Module print ''; @@ -1029,10 +1038,9 @@ if ($step == 4 && $datatoimport) { print '
'."\n"; // List of source fields - $var = true; + $var = false; $lefti = 1; foreach ($fieldssource as $key => $val) { - $var = !$var; show_elem($fieldssource, $key, $val, $var); // key is field number in source file $listofkeys[$key] = 1; $fieldsplaced[$key] = 1; @@ -1051,7 +1059,7 @@ if ($step == 4 && $datatoimport) { print '
'.$langs->trans("Module").''; - // List of target fields + // Set the list of all possible target fields in Dolibarr. $optionsnotused = ""; $optionsall = array(); foreach ($fieldstarget as $code => $line) { @@ -1064,15 +1072,27 @@ if ($step == 4 && $datatoimport) { if (!$line["imported"]) { $optionsnotused .= $text; } - $optionsall[$code] = array('label'=>$langs->trans($line["label"]), 'required'=>(empty($line["required"]) ? 0 : 1)); + $optionsall[$code] = array('label'=>$langs->trans($line["label"]), 'required'=>(empty($line["required"]) ? 0 : 1), 'position'=>$line['position']); } + // $optionsall is an array of all possible fields. key=>array('label'=>..., 'xxx') $height = '32px'; //needs px for css height attribute below $i = 0; $mandatoryfieldshavesource = true; + //var_dump($fieldstarget); + //var_dump($optionsall); + //exit; + /* + var_dump($_SESSION['dol_array_match_file_to_database']); + var_dump($_SESSION['dol_array_match_file_to_database_select']); + var_dump($optionsall); + var_dump($fieldssource); + var_dump($fieldstarget); + */ + print ''; - foreach ($fieldstarget as $code => $line) { + foreach ($fieldssource as $code => $line) { // $fieldssource is an array code=column num, line=content on first line for column in source file. if ($i == $minpos) { break; } @@ -1087,8 +1107,17 @@ if ($step == 4 && $datatoimport) { //print ''; print ''; - print ''; if (isset($fieldssource[$pos]['imported']) && $fieldssource[$pos]['imported'] == false) { print '\n"; print ''; - print ""; // Sell price if (empty($conf->global->PRODUIT_MULTIPRICES)) { diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index b71047a5f47..750d3bbd1e4 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -461,7 +461,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $MAXEVENT = 10; - //$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/product/inventory/inventory_info.php?id='.$object->id); + //$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/product/inventory/inventory_info.php?id='.$object->id); $morehtmlcenter = ''; // List of actions on element diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index db3e8b2ea69..c2f8ddb4470 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -968,7 +968,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete') { $MAXEVENT = 10; $morehtmlcenter = ''; - //$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/product/stock/agenda.php?id='.$object->id); + //$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/product/stock/agenda.php?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 93c963e0065..4271ac5d8c2 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -677,7 +677,7 @@ while ($i < min($num, $limit)) { } } else { $htmltext = $langs->trans("OptionMULTIPRICESIsOn"); - print $form->textwithtooltip($langs->trans("Variable"), $htmltext); + print $form->textwithtooltip(''.$langs->trans("Variable").'', $htmltext); } print ''; if (!$i) { diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php index b6abd4b153a..e77d87aafd3 100644 --- a/htdocs/product/stock/massstockmove.php +++ b/htdocs/product/stock/massstockmove.php @@ -484,7 +484,7 @@ print ''; print '     '; $out = (empty($conf->global->MAIN_UPLOAD_DOC) ? ' disabled' : ''); -print ''; +print ''; $out = ''; if (!empty($conf->global->MAIN_UPLOAD_DOC)) { $max = $conf->global->MAIN_UPLOAD_DOC; // In Kb diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php index e31420b7f21..9dc82c7d09a 100644 --- a/htdocs/product/stock/movement_card.php +++ b/htdocs/product/stock/movement_card.php @@ -1207,7 +1207,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete' && $id > 0) $MAXEVENT = 10; - $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/product/agenda.php?id='.$object->id); + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/product/agenda.php?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; diff --git a/htdocs/product/stock/replenishorders.php b/htdocs/product/stock/replenishorders.php index 1eba8556753..a78694bf830 100644 --- a/htdocs/product/stock/replenishorders.php +++ b/htdocs/product/stock/replenishorders.php @@ -225,10 +225,10 @@ if ($resql) { print ''; - print ''; - print ''; print ''; // Amount - print ''; + print ''; // Date if ($obj->dc) { - $date = dol_print_date($db->jdate($obj->dc), 'dayhour'); + $date = dol_print_date($db->jdate($obj->dc), 'dayhour', 'tzuserrel'); } else { $date = '-'; } - print ''; + print ''; // Statut print ''; diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index 26991915c2f..d4f1bbf4861 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -565,7 +565,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // PMP value print ''; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 98e0bd099fc..23980d8d1df 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -46,6 +46,7 @@ $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); $backtopagejsfields = GETPOST('backtopagejsfields', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $confirm = GETPOST('confirm', 'aZ09'); @@ -620,9 +621,12 @@ if ($action == 'create' && $user->rights->projet->creer) { $url = '/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create'); $newbutton = ''; // TODO @LDR Implement this - //$tmpbacktopagejsfields = 'socid:search_socid'; - //print dolButtonToOpenUrlInDialogPopup('addthirdparty', $langs->transnoentitiesnoconv('AddThirdParty'), $newbutton, $url, '', '', $tmpbacktopagejsfields); - print ' '.$newbutton.''; + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { + $tmpbacktopagejsfields = 'addthirdparty:socid,search_socid'; + print dolButtonToOpenUrlInDialogPopup('addthirdparty', $langs->transnoentitiesnoconv('AddThirdParty'), $newbutton, $url, '', '', $tmpbacktopagejsfields); + } else { + print ' '.$newbutton.''; + } } print ''; } @@ -1399,7 +1403,7 @@ if ($action == 'create' && $user->rights->projet->creer) { $MAXEVENT = 10; - $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/projet/info.php?id='.$object->id); + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/projet/info.php?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index 050528da933..c0dd96537a6 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -247,7 +247,7 @@ if ($user->rights->projet->all->creer || $user->rights->projet->creer) { $linktocreatetask = dolGetButtonTitle($langs->trans('AddTask'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id.'&action=create'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id), '', $linktocreatetaskUserRight, $linktocreatetaskParam); -$linktotasks = dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt paddingleft imgforviewmode', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id, '', 1, array('morecss'=>'reposition')); +$linktotasks = dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars paddingleft imgforviewmode', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id, '', 1, array('morecss'=>'reposition')); $linktotasks .= dolGetButtonTitle($langs->trans('ViewGantt'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/projet/ganttview.php?id='.$object->id.'&withproject=1', '', 1, array('morecss'=>'reposition marginleftonly btnTitleSelected')); //print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'generic', 0, '', '', 0, 1); diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 24f3874301b..737bd94e2a7 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -834,7 +834,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third print ''; $title = $langs->trans("ListOfTasks"); - $linktotasks = dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id, '', 1, array('morecss'=>'reposition btnTitleSelected')); + $linktotasks = dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id, '', 1, array('morecss'=>'reposition btnTitleSelected')); $linktotasks .= dolGetButtonTitle($langs->trans('ViewGantt'), '', 'fa fa-stream imgforviewmode', DOL_URL_ROOT.'/projet/ganttview.php?id='.$object->id.'&withproject=1', '', 1, array('morecss'=>'reposition marginleftonly')); //print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'generic', 0, '', '', 0, 1); diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php index afbee61ce85..22f2eda511b 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php @@ -80,41 +80,6 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio */ public $version = 'dolibarr'; - /** - * @var int page_largeur - */ - public $page_largeur; - - /** - * @var int page_hauteur - */ - public $page_hauteur; - - /** - * @var array format - */ - public $format; - - /** - * @var int marge_gauche - */ - public $marge_gauche; - - /** - * @var int marge_droite - */ - public $marge_droite; - - /** - * @var int marge_haute - */ - public $marge_haute; - - /** - * @var int marge_basse - */ - public $marge_basse; - /** * Issuer * @var Societe Object that emits diff --git a/htdocs/recruitment/core/modules/recruitment/modules_recruitmentjobposition.php b/htdocs/recruitment/core/modules/recruitment/modules_recruitmentjobposition.php index dd9aa49ab10..9efabac2d37 100644 --- a/htdocs/recruitment/core/modules/recruitment/modules_recruitmentjobposition.php +++ b/htdocs/recruitment/core/modules/recruitment/modules_recruitmentjobposition.php @@ -38,6 +38,42 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requir abstract class ModelePDFRecruitmentJobPosition extends CommonDocGenerator { + /** + * @var int page_largeur + */ + public $page_largeur; + + /** + * @var int page_hauteur + */ + public $page_hauteur; + + /** + * @var array format + */ + public $format; + + /** + * @var int marge_gauche + */ + public $marge_gauche; + + /** + * @var int marge_droite + */ + public $marge_droite; + + /** + * @var int marge_haute + */ + public $marge_haute; + + /** + * @var int marge_basse + */ + public $marge_basse; + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return list of active generation modules diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index 186864deb84..93b43c99cc6 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -632,7 +632,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $MAXEVENT = 10; - $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/recruitment/recruitmentcandidature_agenda.php?id='.$object->id); + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/recruitment/recruitmentcandidature_agenda.php?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; diff --git a/htdocs/recruitment/recruitmentjobposition_card.php b/htdocs/recruitment/recruitmentjobposition_card.php index 27b58bad651..65b6f0e8885 100644 --- a/htdocs/recruitment/recruitmentjobposition_card.php +++ b/htdocs/recruitment/recruitmentjobposition_card.php @@ -529,7 +529,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $MAXEVENT = 10; - $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/recruitment/recruitmentjobposition_agenda.php?id='.$object->id); + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/recruitment/recruitmentjobposition_agenda.php?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index 50eca44baf3..cf4bdddb63d 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -428,7 +428,7 @@ print ''; $newcardbutton = ''; $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/^&mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/^&mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/^&mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/recruitment/recruitmentjobposition_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index f4c6f3d3856..6926983915b 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -165,7 +165,7 @@ if (empty($reshook)) { $objstat->errors[] = $objstat->error; } else { if ($db->num_rows($resql) > 0) { - // already in use + // Resource already in use $error++; $objstat->error = $langs->trans('ErrorResourcesAlreadyInUse').' : '; while ($obj = $db->fetch_object($resql)) { @@ -241,7 +241,7 @@ if (empty($reshook)) { $object->errors[] = $object->error; } else { if ($db->num_rows($resql) > 0) { - // already in use + // Resource already in use $error++; $object->error = $langs->trans('ErrorResourcesAlreadyInUse').' : '; while ($obj = $db->fetch_object($resql)) { diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 382503ed430..1ef64555133 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -143,8 +143,8 @@ $form = new Form($db); //$help_url="EN:Module_MyObject|FR:Module_MyObject_FR|ES:Módulo_MyObject"; $help_url = ''; -$pagetitle = $langs->trans('ResourcePageIndex'); -llxHeader('', $pagetitle, $help_url); +$title = $langs->trans('Resources'); +llxHeader('', $title, $help_url); $sql = ''; @@ -219,7 +219,7 @@ if ($ret == -1) { $newcardbutton .= dolGetButtonTitle($langs->trans('MenuResourceAdd'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/resource/card.php?action=create'); } - print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $ret + 1, $nbtotalofrecords, 'object_resource', 0, $newcardbutton, '', $limit, 0, 0, 1); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $ret + 1, $nbtotalofrecords, 'object_resource', 0, $newcardbutton, '', $limit, 0, 0, 1); } $moreforfilter = ''; diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 3a673b0bbd5..e5da198c17f 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -1110,7 +1110,7 @@ if ($id) { $MAXEVENT = 10; - $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id); + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index d29870b413e..51c307c6c6e 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -84,8 +84,8 @@ $error = 0; $errors = array(); $action = (GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -$backtopagejsfields = GETPOST('backtopagejsfields', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); +$backtopagejsfields = GETPOST('backtopagejsfields', 'alpha'); $dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); @@ -689,6 +689,27 @@ if (empty($reshook)) { if ($result >= 0 && !$error) { $db->commit(); + if ($backtopagejsfields) { + llxHeader('', '', ''); + + $tmpbacktopagejsfields = explode(':', $backtopagejsfields); + $dol_openinpopup = $tmpbacktopagejsfields[0]; + + $retstring = ''; + print $retstring; + + llxFooter(); + exit; + } + if (!empty($backtopage)) { $backtopage = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $backtopage); // New method to autoselect project after a New on another form object creation if (preg_match('/\?/', $backtopage)) { @@ -704,14 +725,8 @@ if (empty($reshook)) { $url = DOL_URL_ROOT."/fourn/card.php?socid=".$object->id; } - // TODO @LDR - if ($dol_openinpopup && $backtopagejsfields) { - print 'TODO Set js var of parent with id, then close popup.'; - exit; - } else { - header("Location: ".$url); - exit; - } + header("Location: ".$url); + exit; } } else { $db->rollback(); @@ -2989,7 +3004,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $MAXEVENT = 10; - $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id); + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index 49db54b444f..d411796aba8 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -268,13 +268,13 @@ if (!$rowid) { print "\n"; // Date payment - print '\n"; + print '\n"; // Type print ''; // Amount - print '"; + print '"; // Status print '\n"; // Date payment - print '\n"; + print '\n"; // Date payment - print '\n"; + print '\n"; // Type print ''; // Amount - print '"; + print '"; // Status print "\n"; // Date payment - print '\n"; + print '\n"; // Type print ''; // Amount - print '"; - print '"; + print '"; + print '"; // Status print "'; // URL $src_value = (GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$key) ?GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$key) : (empty($object->conf->$src) ? '' : $object->conf->$src)); - print ''; + print ''; // Offset TZ - $offsettz_value = (GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key) ? GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key) : (empty($object->conf->$offsettz) ? 0 : $object->conf->$offsettz)); + $offsettz_value = (GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key) ? GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key) : (empty($object->conf->$offsettz) ? '' : $object->conf->$offsettz)); print ''; // Color (Possible colors are limited by Google) print '
=> '.img_object('', $entityicon).' '.$langs->trans($entitylang).'=> '; + + $modetoautofillmapping = 'session'; // Use setup in session + if ($initialloadofstep4) { + $modetoautofillmapping = 'guess'; + } + //var_dump($_SESSION['dol_array_match_file_to_database_select']); + //var_dump($modetoautofillmapping); + //var_dump($_SESSION['dol_array_match_file_to_database']); + //var_dump($modetoautofillmapping); + print ''; // The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object //print img_picto($langs->trans("MoveField", $pos), 'grip_title', 'class="boxhandle" style="cursor:move;"'); - print img_picto($langs->trans("Field").' '.$pos, 'file', 'class="pictofixedwith"'); + print img_picto($langs->trans("Column").' '.num2Alpha($pos - 1), 'file', 'class="pictofixedwith"'); print ''; } else { print ''; } - print $langs->trans("Field").' '.$pos; + print $langs->trans("Column").' '.num2Alpha($pos - 1).' (#'.$pos.')'; if (empty($fieldssource[$pos]['example1'])) { $example = $fieldssource[$pos]['label']; } else { @@ -2289,6 +2357,20 @@ function show_elem($fieldssource, $pos, $key, $var, $nostyle = '') } +/** + * Return a numeric into an Excel like column number + * + * @param string $n Numeric value + * @return string Column in Excel format + */ +function num2Alpha($n) +{ + for ($r = ""; $n >= 0; $n = intval($n / 26) - 1) + $r = chr($n%26 + 0x41) . $r; + return $r; +} + + /** * Return not used field number * diff --git a/htdocs/install/mysql/data/llx_c_type_resource.sql b/htdocs/install/mysql/data/llx_c_type_resource.sql index fb93d6ff68b..2ecb837ff15 100644 --- a/htdocs/install/mysql/data/llx_c_type_resource.sql +++ b/htdocs/install/mysql/data/llx_c_type_resource.sql @@ -30,6 +30,6 @@ -- Type resources -- -insert into llx_c_type_resource (code,label,active) values ('RES_ROOMS', 'Rooms', 1); -insert into llx_c_type_resource (code,label,active) values ('RES_CARS', 'Cars', 1); +insert into llx_c_type_resource (code, label, active) values ('RES_ROOMS', 'Rooms', 1); +insert into llx_c_type_resource (code, label, active) values ('RES_CARS', 'Cars', 1); diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql index 6288a6a2e3a..a5a91ca80a3 100644 --- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql +++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql @@ -34,6 +34,9 @@ ALTER TABLE llx_holiday ADD COLUMN nb_open_day double(24,8) DEFAULT NULL; -- Missing in v15 or lower +insert into llx_c_type_resource (code, label, active) values ('RES_ROOMS', 'Rooms', 1); +insert into llx_c_type_resource (code, label, active) values ('RES_CARS', 'Cars', 1); + ALTER TABLE llx_c_actioncomm MODIFY COLUMN libelle varchar(128); ALTER TABLE llx_c_availability MODIFY COLUMN label varchar(128); ALTER TABLE llx_c_barcode_type MODIFY COLUMN libelle varchar(128); diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index fa5a9041674..87e34c0c37e 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -1422,11 +1422,9 @@ function migrate_paiementfourn_facturefourn($db, $langs, $conf) if ($select_resql) { $select_num = $db->num_rows($select_resql); $i = 0; - $var = true; // Pour chaque paiement fournisseur, on insere une ligne dans paiementfourn_facturefourn while (($i < $select_num) && (!$error)) { - $var = !$var; $select_obj = $db->fetch_object($select_resql); // Verifier si la ligne est deja dans la nouvelle table. On ne veut pas inserer de doublons. diff --git a/htdocs/intracommreport/class/intracommreport.class.php b/htdocs/intracommreport/class/intracommreport.class.php index d3f34fc149b..ef13649f8c8 100644 --- a/htdocs/intracommreport/class/intracommreport.class.php +++ b/htdocs/intracommreport/class/intracommreport.class.php @@ -231,7 +231,7 @@ class IntracommReport extends CommonObject if ($resql) { $i = 1; - if (empty($resql->num_rows)) { + if ($this->db->num_rows($resql) <= 0) { $this->errors[] = 'No data for this period'; return 0; } diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index 91f127b0057..0c7ed519042 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -521,7 +521,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $MAXEVENT = 10; - $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/knowledgemanagement/knowledgerecord_agenda.php?id='.$object->id); + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/knowledgemanagement/knowledgerecord_agenda.php?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 8dcd1f9f93d..d122e9ca7d1 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2112,7 +2112,7 @@ ResourceSetup=Configuration of Resource module UseSearchToSelectResource=Use a search form to choose a resource (rather than a drop-down list). DisabledResourceLinkUser=Disable feature to link a resource to users DisabledResourceLinkContact=Disable feature to link a resource to contacts -EnableResourceUsedInEventCheck=Enable feature to check if a resource is in use in an event +EnableResourceUsedInEventCheck=Prohibit the use of the same resource at the same time in the agenda ConfirmUnactivation=Confirm module reset OnMobileOnly=On small screen (smartphone) only DisableProspectCustomerType=Disable the "Prospect + Customer" third party type (so third party must be "Prospect" or "Customer", but can't be both) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index f4137b8b791..e8e32f73d0f 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1367,7 +1367,7 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { if ($dirins && $action == 'initdic' && $module && $dicname) { if (!$error) { $newdicname = $dicname; - if (!preg_match('/^c_/, $newdicname')) { + if (!preg_match('/^c_/', $newdicname)) { $newdicname = 'c_'.$dicname; } diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php index 1a435d3763d..b849389d048 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php @@ -80,41 +80,6 @@ class pdf_standard_myobject extends ModelePDFMyObject */ public $version = 'dolibarr'; - /** - * @var int page_largeur - */ - public $page_largeur; - - /** - * @var int page_hauteur - */ - public $page_hauteur; - - /** - * @var array format - */ - public $format; - - /** - * @var int marge_gauche - */ - public $marge_gauche; - - /** - * @var int marge_droite - */ - public $marge_droite; - - /** - * @var int marge_haute - */ - public $marge_haute; - - /** - * @var int marge_basse - */ - public $marge_basse; - /** * Issuer * @var Societe Object that emits diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/modules_myobject.php b/htdocs/modulebuilder/template/core/modules/mymodule/modules_myobject.php index 8f0d86e3823..c2eeb232219 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/modules_myobject.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/modules_myobject.php @@ -38,6 +38,42 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requir abstract class ModelePDFMyObject extends CommonDocGenerator { + /** + * @var int page_largeur + */ + public $page_largeur; + + /** + * @var int page_hauteur + */ + public $page_hauteur; + + /** + * @var array format + */ + public $format; + + /** + * @var int marge_gauche + */ + public $marge_gauche; + + /** + * @var int marge_droite + */ + public $marge_droite; + + /** + * @var int marge_haute + */ + public $marge_haute; + + /** + * @var int marge_basse + */ + public $marge_basse; + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return list of active generation modules diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 002685415cc..2b38b59b284 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -591,7 +591,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $MAXEVENT = 10; - $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id); + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 48e36831592..48f64b2601c 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -692,7 +692,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $MAXEVENT = 10; - $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/mrp/mo_agenda.php?id='.$object->id); + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/mrp/mo_agenda.php?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php index 9752651ef29..29a70edb8ab 100644 --- a/htdocs/partnership/partnership_card.php +++ b/htdocs/partnership/partnership_card.php @@ -641,7 +641,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $MAXEVENT = 10; - $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/partnership/partnership_agenda.php?id='.$object->id); + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/partnership/partnership_agenda.php?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index c7d26830ebf..3b8b19a335c 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2890,7 +2890,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete') { $MAXEVENT = 10; - $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/product/agenda.php?id='.$object->id); + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/product/agenda.php?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; diff --git a/htdocs/product/index.php b/htdocs/product/index.php index cfdbddc875c..40141fce304 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -360,8 +360,8 @@ if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($us print $product_static->getNomUrl(1, '', 16); print "'.dol_escape_htmltag($objp->label).'"; - print dol_print_date($db->jdate($objp->datem), 'day'); + print 'jdate($objp->datem), 'dayhour', 'tzuserrel')).'">'; + print dol_print_date($db->jdate($objp->datem), 'day', 'tzuserrel'); print "'; print ''; print ''; - print ''; + print ''; + print ''; print ''; + print ''; print $form->selectDate($search_date, 'search_date', 0, 0, 1, '', 1, 0, 0, ''); print ''; @@ -276,7 +276,8 @@ if ($resql) { $param, '', $sortfield, - $sortorder + $sortorder, + 'right ' ); print_liste_field_titre( 'OrderCreation', @@ -286,7 +287,8 @@ if ($resql) { $param, '', $sortfield, - $sortorder + $sortorder, + 'center ' ); print_liste_field_titre( 'Status', @@ -333,15 +335,15 @@ if ($resql) { print ''.$txt.''.price($obj->total_ttc).''.price($obj->total_ttc).''.$date.''.$date.''.$commandestatic->LibStatut($obj->fk_statut, 5).''; if (price2num($objp->estimatedvalue, 'MT')) { - print price(price2num($objp->estimatedvalue, 'MT'), 1); + print ''.price(price2num($objp->estimatedvalue, 'MT'), 1).''; } else { print ''; } @@ -578,7 +578,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { print price(price2num($objp->sellvalue, 'MT'), 1); } else { $htmltext = $langs->trans("OptionMULTIPRICESIsOn"); - print $form->textwithtooltip($langs->trans("Variable"), $htmltext); + print $form->textwithtooltip(''.$langs->trans("Variable").'', $htmltext); } print'
'.dol_print_date($charge->created, '%d/%m/%Y %H:%M')."'.dol_print_date($charge->created, 'dayhour')."'; print $type; print ''.price(($charge->amount - $charge->amount_refunded) / 100, 0, '', 1, - 1, - 1, strtoupper($charge->currency))."'.price(($charge->amount - $charge->amount_refunded) / 100, 0, '', 1, - 1, - 1, strtoupper($charge->currency))."'; print $status; diff --git a/htdocs/stripe/payout.php b/htdocs/stripe/payout.php index 34b4ea1dc4f..8631b4ecd5f 100644 --- a/htdocs/stripe/payout.php +++ b/htdocs/stripe/payout.php @@ -200,13 +200,13 @@ if (!$rowid) { //} //print "'.dol_print_date($payout->created, '%d/%m/%Y %H:%M')."'.dol_print_date($payout->created, 'dayhour')."'.dol_print_date($payout->arrival_date, '%d/%m/%Y %H:%M')."'.dol_print_date($payout->arrival_date, 'dayhour')."'.$payout->description.''.price(($payout->amount) / 100, 0, '', 1, -1, -1, strtoupper($payout->currency))."'.price(($payout->amount) / 100, 0, '', 1, -1, -1, strtoupper($payout->currency)).""; if ($payout->status == 'paid') { diff --git a/htdocs/stripe/transaction.php b/htdocs/stripe/transaction.php index 6bab8459d18..92092ca2ebb 100644 --- a/htdocs/stripe/transaction.php +++ b/htdocs/stripe/transaction.php @@ -207,12 +207,12 @@ if (!$rowid) { //} //print "'.dol_print_date($txn->created, '%d/%m/%Y %H:%M')."'.dol_print_date($txn->created, 'dayhour')."'.$txn->type.''.price(($txn->amount) / 100, 0, '', 1, - 1, - 1, strtoupper($txn->currency))."'.price(($txn->fee) / 100, 0, '', 1, - 1, - 1, strtoupper($txn->currency))."'.price(($txn->amount) / 100, 0, '', 1, - 1, - 1, strtoupper($txn->currency))."'.price(($txn->fee) / 100, 0, '', 1, - 1, - 1, strtoupper($txn->currency)).""; if ($txn->status == 'available') { diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index e755a0bab94..8f0c1d36919 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -331,7 +331,6 @@ class SupplierProposal extends CommonObject $supplier_proposalligne->subprice = -$remise->amount_ht; $supplier_proposalligne->fk_product = 0; // Id produit predefini $supplier_proposalligne->qty = 1; - $supplier_proposalligne->remise = 0; $supplier_proposalligne->remise_percent = 0; $supplier_proposalligne->rang = -1; $supplier_proposalligne->info_bits = 2; @@ -3006,9 +3005,6 @@ class SupplierProposalLine extends CommonObjectLine if (empty($this->rang)) { $this->rang = 0; } - if (empty($this->remise)) { - $this->remise = 0; - } if (empty($this->remise_percent)) { $this->remise_percent = 0; } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index ac7d0fbe8f8..19abdd3ba9b 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1573,7 +1573,7 @@ table[summary="list_of_modules"] .fa-cog { .minheight30 { min-height: 30px; } .minheight40 { min-height: 40px; } .titlefieldcreate { width: 20%; } -.titlefield { /* width: 25%; */ min-width: 250px; } +.titlefield { /* width: 25%; */ min-width: 250px; width: 25%; } .titlefieldmiddle { width: 45%; } .titlefieldmax45 { max-width: 45%; } .imgmaxwidth180 { max-width: 180px; } @@ -3571,12 +3571,12 @@ tr.liste_titre.box_titre td table td, .bordernooddeven tr td { div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar .table-val-border-col { vertical-align: middle; } -div .tdtop { +div .tdtop:not(.tagtdnote) { vertical-align: top !important; /*padding-top: 10px !important; padding-bottom: 2px !important; */ - padding-top: 6px !important; - padding-bottom: 4px !important; + padding-top: 5px !important; + padding-bottom: 0px !important; } table.border td, table.bordernooddeven td, div.border div div.tagtd { @@ -4519,6 +4519,9 @@ table.noborder.boxtable tr td { a.valignmiddle.dashboardlineindicator { line-height: 30px; } +.height30 { + height: 30px !important; +} tr.box_titre { height: 26px; @@ -5047,9 +5050,10 @@ table.dp { vertical-align:middle; cursor: pointer; } -.datenowlink -{ +.datenowlink { color: var(--colortextlink); + font-size: 0.8em; + opacity: 0.7; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index bddb2dd5392..261e89c64be 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1662,7 +1662,7 @@ tr.nobottom td { .minheight30 { min-height: 30px; } .minheight40 { min-height: 40px; } .titlefieldcreate { width: 20%; } -.titlefield { /* width: 25%; */ min-width: 250px; } +.titlefield { /* width: 25%; */ min-width: 250px; width: 25%; } .titlefieldmiddle { width: 50%; } .imgmaxwidth180 { max-width: 180px; } .imgmaxheight50 { max-height: 50px; } @@ -4188,7 +4188,7 @@ div.tabBar .noborder { -webkit-box-shadow: 0px 0px 0px #f4f4f4 !important; box-shadow: 0px 0px 0px #f4f4f4 !important; } -div .tdtop { +div .tdtop:not(.tagtdnote) { vertical-align: top !important; padding-top: 8px !important; padding-bottom: 0px !important; @@ -4382,6 +4382,9 @@ span.dashboardlineko { a.valignmiddle.dashboardlineindicator { line-height: 30px; } +.height30 { + height: 30px !important; +} tr.box_titre { height: 26px !important; @@ -4895,9 +4898,10 @@ table.dp { vertical-align:middle; cursor: pointer; } -.datenowlink -{ +.datenowlink { color: rgb(); + font-size: 0.8em; + opacity: 0.7; } .categtextwhite, .treeview .categtextwhite.hover { diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php index 9a4af31014a..76e136c1fd7 100644 --- a/htdocs/ticket/agenda.php +++ b/htdocs/ticket/agenda.php @@ -239,7 +239,7 @@ if (!empty($object->id)) { $messagingUrl = DOL_URL_ROOT.'/ticket/messaging.php?track_id='.$object->track_id; $morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1); $messagingUrl = DOL_URL_ROOT.'/ticket/agenda.php?track_id='.$object->track_id; - $morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-list-alt imgforviewmode', $messagingUrl, '', 1, array('morecss'=>'btnTitleSelected')); + $morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 1, array('morecss'=>'btnTitleSelected')); // Show link to add a message (if read and not closed) $btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 99913e6c997..a9488e30672 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1268,6 +1268,7 @@ if ($action == 'create' || $action == 'presend') { $companystatic = new Societe($db); $contactstatic = new Contact($db); $userstatic = new User($db); + $var = false; foreach (array('internal', 'external') as $source) { $tmpobject = $object; $tab = $tmpobject->listeContact(-1, $source); @@ -1510,7 +1511,7 @@ if ($action == 'create' || $action == 'presend') { $morehtmlright = ''; $messagingUrl = DOL_URL_ROOT.'/ticket/agenda.php?track_id='.$object->track_id; - $morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-list-alt imgforviewmode', $messagingUrl, '', 1); + $morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 1); // Show link to add a message (if read and not closed) $btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage" && $action != "add_message"; @@ -1551,7 +1552,7 @@ if ($action == 'create' || $action == 'presend') { $morehtmlcenter = '
'; $morehtmlcenter .= dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT.'/ticket/messaging.php?id='.$object->id); $morehtmlcenter .= ' '; - $morehtmlcenter .= dolGetButtonTitle($langs->trans('FullList'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/ticket/agenda.php?id='.$object->id); + $morehtmlcenter .= dolGetButtonTitle($langs->trans('FullList'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/ticket/agenda.php?id='.$object->id); $morehtmlcenter .= '
'; // List of actions on element diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index 292fff329ad..a3bf03467ce 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -238,7 +238,7 @@ if (!empty($object->id)) { $messagingUrl = DOL_URL_ROOT.'/ticket/messaging.php?track_id='.$object->track_id; $morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1, array('morecss'=>'btnTitleSelected')); $messagingUrl = DOL_URL_ROOT.'/ticket/agenda.php?track_id='.$object->track_id; - $morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-list-alt imgforviewmode', $messagingUrl, '', 1); + $morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 1); // Show link to add a message (if read and not closed) diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php index 5921f7d84cd..b7d66d2677c 100644 --- a/htdocs/user/agenda_extsites.php +++ b/htdocs/user/agenda_extsites.php @@ -209,9 +209,9 @@ while ($i <= $MAXAGENDA) { print '
'; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 57b5c11e853..cb76b25cc5a 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -365,8 +365,8 @@ class User extends CommonObject 'rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), 'lastname'=>array('type'=>'varchar(50)', 'label'=>'LastName', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20, 'searchall'=>1), 'firstname'=>array('type'=>'varchar(50)', 'label'=>'FirstName', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1), - 'ref_employee'=>array('type'=>'varchar(50)', 'label'=>'ref_employee', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>30, 'searchall'=>1), - 'national_registration_number'=>array('type'=>'varchar(50)', 'label'=>'national_registration_number', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>40, 'searchall'=>1) + 'ref_employee'=>array('type'=>'varchar(50)', 'label'=>'RefEmployee', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>30, 'searchall'=>1), + 'national_registration_number'=>array('type'=>'varchar(50)', 'label'=>'NationalRegistrationNumber', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>40, 'searchall'=>1) ); diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index b185ea4ce42..fa9a438e350 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -257,7 +257,7 @@ $formfile = new FormFile($db); if ($action == 'create') { print load_fiche_titre($langs->trans("NewGroup"), '', 'object_group'); - print dol_set_focus('#nom'); + dol_set_focus('#nom'); print '
'; print ''; diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index bb1320ecd0b..f92afe53a4f 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -234,6 +234,8 @@ if ($action == 'edit') { dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); + print '
'; + print dol_get_fiche_end(); @@ -339,6 +341,8 @@ if ($action == 'edit') { dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); + print '
'; + print dol_get_fiche_end(); diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 6e28a77b5bc..889599e2fa9 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -253,7 +253,36 @@ if ($user->rights->user->user->lire || $user->admin) { dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); +print '
'; + print '
'; +print ''; + +// Login +print ''; +if (!empty($object->ldap_sid) && $object->statut == 0) { + print ''; +} else { + print ''; +} +print ''."\n"; + +print '
'.$langs->trans("Login").''; + print $langs->trans("LoginAccountDisableInDolibarr"); + print ''; + $addadmin = ''; + if (property_exists($object, 'admin')) { + if (!empty($conf->multicompany->enabled) && !empty($object->admin) && empty($object->entity)) { + $addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "redstar", 'class="paddingleft"'); + } elseif (!empty($object->admin)) { + $addadmin .= img_picto($langs->trans("AdministratorDesc"), "star", 'class="paddingleft"'); + } + } + print showValueWithClipboardCPButton($object->login).$addadmin; + print '
'; + +print '
'; + if ($user->admin) { print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules")); diff --git a/htdocs/variants/class/ProductCombination.class.php b/htdocs/variants/class/ProductCombination.class.php index 63e721c0d37..7f9227fee88 100644 --- a/htdocs/variants/class/ProductCombination.class.php +++ b/htdocs/variants/class/ProductCombination.class.php @@ -169,7 +169,6 @@ class ProductCombination } if (empty($combination_price_levels)) { - /** * for auto retrocompatibility with last behavior */