diff --git a/ChangeLog b/ChangeLog index ef33f664d04..e4fbf63e758 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,8 +8,9 @@ For Users: NEW: Stable module: Website NEW: Stable module: WebDAV NEW: Stable module: Module Builder -NEW: Stable module "Skype" has been replaced with module "Social Networks" to support more tools. +NEW: Stable module "Skype" has been replaced with module "Social Networks" to support more services. NEW: Experimental module "TakePos" +NEW: Experimental module "Ticket" NEW: Dolibarr can provide information in page title when multicompany is enabled of not, making Android application like DoliDroid able to provide native features for multicompany module. NEW: Compatibility with PHP 7.3 @@ -22,10 +23,10 @@ For developers: WARNING: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: -* If you use some links like viewimages.php?modulepart=mycompany&file=... in you external modules, you must +* If you use some links like viewimages.php?modulepart=mycompany&file=... in your external modules, you must replace them with links like viewimages.php?modulepart=mycompany&file=logos/... (note that link change only for modulepart=mycompany that now works like others). - +* Hidden option MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT has been renamed into SHIPPING_PDF_DISPLAY_AMOUNT_HT ***** ChangeLog for 8.0.3 compared to 8.0.2 ***** diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index fee1848b925..db6fb35206b 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -907,7 +907,7 @@ else // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''.$langs->trans("Login").' / '.$langs->trans("Id").'login).'">'; + print ''.$langs->trans("Login").' / '.$langs->trans("Id").'login).'" autofocus="autofocus">'; } // Password diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 51e1a8b244e..39d0069ac7c 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -86,7 +86,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('adherent'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 474082b1cfa..4ef43e8f316 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -53,13 +53,15 @@ $pagenext = $page + 1; if (! $sortorder) { $sortorder="DESC"; } if (! $sortfield) { $sortfield="c.dateadh"; } +$object = new Subscription($db); + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('subscriptionlist')); $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('subscription'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 7e69d4fbc98..6261a379049 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -317,7 +317,7 @@ if ($action == 'create') print ''; print ''; - print ''; + print ''; print '
'.$langs->trans("Label").'
'.$langs->trans("Label").'
'.$langs->trans("SubscriptionRequired").''; print $form->selectyesno("subscription",1,1); diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 611f7578193..3280492701e 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -1,6 +1,5 @@ - * Copyright (C) ---Put here your own copyright and developer email--- +/* Copyright (C) 2018 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +16,7 @@ */ /** - * \file htdocs/admin/emailcollectore/emailcollector_card.php + * \file htdocs/admin/emailcollector_card.php * \ingroup emailcollector * \brief Page to create/edit/view emailcollector */ @@ -27,16 +26,18 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php'; -include_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; -include_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; -dol_include_once('/emailcollector/class/emailcollector.class.php'); -dol_include_once('/emailcollector/lib/emailcollector.lib.php'); +include_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +include_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +include_once DOL_DOCUMENT_ROOT.'/emailcollector/class/emailcollector.class.php'; +include_once DOL_DOCUMENT_ROOT.'/emailcollector/class/emailcollectorfilter.class.php'; +include_once DOL_DOCUMENT_ROOT.'/emailcollector/class/emailcollectoraction.class.php'; +include_once DOL_DOCUMENT_ROOT.'/emailcollector/lib/emailcollector.lib.php'; if (!$user->admin) accessforbidden(); // Load traductions files requiredby by page -$langs->loadLangs(array("admin", "other")); +$langs->loadLangs(array("admin", "mails", "other")); // Get parameters $id = GETPOST('id', 'int'); @@ -54,7 +55,7 @@ $diroutputmassaction = $conf->emailcollector->dir_output . '/temp/massgeneration $hookmanager->initHooks(array('emailcollectorcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('emailcollector'); -$search_array_options = $extrafields->getOptionalsFromPost($extralabels, '', 'search_'); +$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Initialize array of search criterias $search_all = trim(GETPOST("search_all", 'alpha')); @@ -121,6 +122,73 @@ if ($action == 'confirm_collect') $action = ''; } +if (GETPOST('addfilter','alpha')) +{ + $emailcollectorfilter = new EmailCollectorFilter($db); + $emailcollectorfilter->type = GETPOST('filtertype','az09'); + $emailcollectorfilter->rulevalue = GETPOST('rulevalue', 'alpha'); + $emailcollectorfilter->fk_emailcollector = $object->id; + $emailcollectorfilter->status = 1; + $result = $emailcollectorfilter->create($user); + + if ($result > 0) + { + $object->fetchFilters(); + } + else + { + setEventMessages($emailcollectorfilter->errors, $emailcollectorfilter->error, 'errors'); + } +} + +if ($action == 'deletefilter') +{ + $emailcollectorfilter = new EmailCollectorFilter($db); + $emailcollectorfilter->fetch(GETPOST('filterid','int')); + $result = $emailcollectorfilter->delete($user); + if ($result > 0) + { + $object->fetchFilters(); + } + else + { + setEventMessages($emailcollectorfilter->errors, $emailcollectorfilter->error, 'errors'); + } +} + +if (GETPOST('addoperation','alpha')) +{ + $emailcollectoroperation = new EmailCollectorAction($db); + $emailcollectoroperation->type = GETPOST('operationtype','az09'); + $emailcollectoroperation->actionparam = GETPOST('actionparam', 'alpha'); + $emailcollectoroperation->fk_emailcollector = $object->id; + $emailcollectoroperation->status = 1; + $result = $emailcollectoroperation->create($user); + + if ($result > 0) + { + $object->fetchActions(); + } + else + { + setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors'); + } +} + +if ($action == 'deleteoperation') +{ + $emailcollectoroperation = new EmailCollectorAction($db); + $emailcollectoroperation->fetch(GETPOST('operationid','int')); + $result = $emailcollectoroperation->delete($user); + if ($result > 0) + { + $object->fetchActions(); + } + else + { + setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors'); + } +} @@ -219,6 +287,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { $res = $object->fetch_optionals(); + $object->fetchFilters(); + $object->fetchActions(); + $head = emailcollectorPrepareHead($object); dol_fiche_head($head, 'card', $langs->trans("EmailCollector"), -1, 'emailcollector'); @@ -318,6 +389,90 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; + + print '
'; + print ''; + print ''; + print ''; + print ''; + + // Filters + print ''; + print ''; + print ''; + print ''; + // Add filter + print ''; + print ''; + print ''; + print ''; + // List filters + foreach($object->filters as $rulefilter) + { + $rulefilterobj=new EmailCollectorFilter($db); + $rulefilterobj->fetch($rulefilter['id']); + + print ''; + print ''; + print ''; + print ''; + print ''; + } + + print ''; + print '
'.$langs->trans("Filters").'
'; + $arrayoftypes=array('from'=>'MailFrom', 'to'=>'MailTo', 'cc'=>'Cc', 'bcc'=>'Bcc', 'subject'=>'Subject', 'body'=>'Body', 'seen'=>'AlreadyRead', 'unseen'=>'NotRead'); + print $form->selectarray('filtertype', $arrayoftypes, '', 1, 0, 0, '', 1); + print ''; + print ''; + print '
'; + print $langs->trans($arrayoftypes[$rulefilter['type']]); + print ''.$rulefilter['rulevalue'].''; + //print $rulefilterobj->getLibStatut(3); + print ' '.img_delete().''; + print '
'; + + print '

'; + + // Operations + print ''; + print ''; + print ''; + print ''; + // Add operation + print ''; + print ''; + print ''; + print ''; + // List operations + foreach($object->actions as $ruleaction) + { + $ruleactionobj=new EmailcollectorAction($db); + $ruleactionobj->fetch($ruleaction['id']); + + print ''; + print ''; + print ''; + print ''; + print ''; + } + + print ''; + print '
'.$langs->trans("EmailcollectorOperations").'
'; + $arrayoftypes=array('recordevent'=>'RecordEvent'); + if ($conf->projet->enabled) $arrayoftypes['project']='CreateLeadAndThirdParty'; + print $form->selectarray('operationtype', $arrayoftypes, '', 0, 0, 0, '', 1); + print ''; + print ''; + print '
'; + print $langs->trans($arrayoftypes[$ruleaction['type']]); + print ''.$ruleaction['actionparam'].''; + //print $ruleactionobj->getLibStatut(3); + print ' '.img_delete().''; + print '
'; + + print '
'; + print ''; print ''; diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 6de67299871..71169ddffb0 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -67,7 +67,7 @@ $diroutputmassaction = $conf->emailcollector->dir_output . '/temp/massgeneration $hookmanager->initHooks(array('emailcollectorlist')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('emailcollector'); -$search_array_options = $extrafields->getOptionalsFromPost($extralabels, '', 'search_'); +$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Default sort order (if not yet defined by previous GETPOST) if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition. diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 4914152f680..280025b3b35 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -61,7 +61,7 @@ $diroutputmassaction=$conf->admin->dir_output . '/temp/massgeneration/'.$user->i $hookmanager->initHooks(array('emailsenderprofilelist')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('emailsenderprofile'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // Default sort order (if not yet defined by previous GETPOST) if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition. diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 3dbedae32bb..09192ea4a36 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -41,6 +41,7 @@ $langs->loadLangs(array("errors","admin","modulebuilder")); $mode=GETPOST('mode', 'alpha'); if (empty($mode)) $mode='common'; $action=GETPOST('action','alpha'); +//var_dump($_POST);exit; $value=GETPOST('value', 'alpha'); $page_y=GETPOST('page_y','int'); $search_keyword=GETPOST('search_keyword','alpha'); @@ -1010,8 +1011,39 @@ if ($mode == 'deploy') print '
'; print ''; print ''; - print $langs->trans("YouCanSubmitFile").' '; + + print $langs->trans("YouCanSubmitFile"); + + $max=$conf->global->MAIN_UPLOAD_DOC; // En Kb + $maxphp=@ini_get('upload_max_filesize'); // En inconnu + if (preg_match('/k$/i',$maxphp)) $maxphp=$maxphp*1; + if (preg_match('/m$/i',$maxphp)) $maxphp=$maxphp*1024; + if (preg_match('/g$/i',$maxphp)) $maxphp=$maxphp*1024*1024; + if (preg_match('/t$/i',$maxphp)) $maxphp=$maxphp*1024*1024*1024; + // Now $max and $maxphp are in Kb + $maxmin = $max; + if ($maxphp > 0) $maxmin=min($max,$maxphp); + + if ($maxmin > 0) + { + print ''."\n"; + // MAX_FILE_SIZE doit précéder le champ input de type file + print ''; + } + + print ' '; + print ''; + print '
'; print '
'; diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index 4f7061aed20..40b2a9365db 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -45,7 +45,7 @@ $diroutputmassaction=$conf->asset->dir_output . '/temp/massgeneration/'.$user->i $hookmanager->initHooks(array('assetcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('asset'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // Initialize array of search criterias $search_all=trim(GETPOST("search_all",'alpha')); diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index fa965aade5b..431276b67a8 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -62,7 +62,7 @@ $diroutputmassaction=$conf->asset->dir_output . '/temp/massgeneration/'.$user->i $hookmanager->initHooks(array('assetlist')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('asset'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // Default sort order (if not yet defined by previous GETPOST) if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition. diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 02d3a16c7f3..b34ba87d7a3 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -74,10 +74,14 @@ $filtert = GETPOST("filtert","int",3); $usergroup = GETPOST("usergroup","int",3); $showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1; +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$object = new ActionComm($db); +$hookmanager->initHooks(array('agendalist')); + $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('actioncomm'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // If not choice done on calendar owner, we filter on user. if (empty($filtert) && empty($conf->global->AGENDA_ALL_CALENDARS)) { @@ -117,10 +121,6 @@ if (! $user->rights->agenda->allactions->read || $filter=='mine') // If no permi $filtert=$user->id; } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$object = new ActionComm($db); -$hookmanager->initHooks(array('agendalist')); - $arrayfields=array( 'a.id'=>array('label'=>"Ref", 'checked'=>1), 'owner'=>array('label'=>"Owner", 'checked'=>1), diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 28e49e9d171..e4f74f5c35f 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -747,7 +747,7 @@ if ($action == 'create') dol_fiche_head(); print ''; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index 133a354723f..eb81649a03e 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -46,20 +46,21 @@ $search_all=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all' $search_ref=GETPOST("search_ref", "alpha") ? GETPOST("search_ref", "alpha") : GETPOST("sref", "alpha"); $filteremail=GETPOST('filteremail','alpha'); +$object = new Mailing($db); + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('mailinglist')); $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('mailing'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( 'm.titre'=>'Ref', ); -$object = new Mailing($db); diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index b0cc04702db..eea0acfbe6b 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -129,7 +129,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('propal'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 2a9e215faa4..c75a754d1ad 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -108,7 +108,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('commande'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 31eaa9e8f6d..bcb7f348bdf 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -129,7 +129,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('banktransaction'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost('banktransaction','','search_'); $arrayfields=array( 'b.rowid'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index 79c26adfa47..3ec4d88db2f 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -74,7 +74,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('bank_account'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index d9ce0137f04..2a9028b5125 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -94,7 +94,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('facture_rec'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); $permissionnote = $user->rights->facture->creer; // Used by the include of actions_setnotes.inc.php $permissiondellink=$user->rights->facture->creer; // Used by the include of actions_dellink.inc.php diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index c61836e1b1b..e077abedbbc 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -108,7 +108,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('facture_rec'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); $permissionnote = $user->rights->facture->creer; // Used by the include of actions_setnotes.inc.php $permissiondellink=$user->rights->facture->creer; // Used by the include of actions_dellink.inc.php diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 553c6c9028a..fb6f769db94 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -134,7 +134,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('facture'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 692849d2fa6..3d6cf735999 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -636,7 +636,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print '
'.$langs->trans("MailTitle").'
'.$langs->trans("MailTitle").'
'.$langs->trans("MailFrom").'
'.$langs->trans("MailErrorsTo").'
'; print ''; - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 4d643536388..94426ed54eb 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -773,7 +773,7 @@ else print ''; - print "\n"; + print "\n"; if ($modecompta == 'CREANCES-DETTES') print ''; print ''; diff --git a/htdocs/compta/salaries/card.php b/htdocs/compta/salaries/card.php index f50d940a51a..76ab712bffd 100644 --- a/htdocs/compta/salaries/card.php +++ b/htdocs/compta/salaries/card.php @@ -174,7 +174,7 @@ if ($action == 'delete') if ($result >= 0) { $db->commit(); - header("Location: ".DOL_URL_ROOT.'/compta/salaries/index.php'); + header("Location: ".DOL_URL_ROOT.'/compta/salaries/list.php'); exit; } else @@ -365,7 +365,7 @@ if ($id) dol_fiche_head($head, 'card', $langs->trans("SalaryPayment"), -1, 'payment'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref='
'; diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index 0be0f4f3694..76a8284daff 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -537,24 +537,73 @@ class PaymentSalary extends CommonObject /** * Send name clicable (with possibly the picto) * - * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto - * @param string $option link option - * @return string Chaine with URL + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param string $option link option + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string Chaine with URL */ - function getNomUrl($withpicto=0,$option='') + function getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1) { - global $langs; + global $db, $conf, $langs, $hookmanager; + global $dolibarr_main_authentication, $dolibarr_main_demo; + global $menumanager; - $result=''; - $label=$langs->trans("ShowSalaryPayment").': '.$this->ref; + if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips - $linkstart = ''; + $result = ''; + + $label = '' . $langs->trans("ShowSalaryPayment") . ''; + $label.= '
'; + $label.= '' . $langs->trans('Ref') . ': ' . $this->ref; + + $url = DOL_URL_ROOT.'/compta/salaries/card.php?id='.$this->id; + + if ($option != 'nolink') + { + // Add param to save lastsearch_values or not + $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; + if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1'; + } + + $linkclose=''; + if (empty($notooltip)) + { + if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $label=$langs->trans("ShowMyObject"); + $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $linkclose.=' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose.=' class="classfortooltip'.($morecss?' '.$morecss:'').'"'; + + /* + $hookmanager->initHooks(array('myobjectdao')); + $parameters=array('id'=>$this->id); + $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) $linkclose = $hookmanager->resPrint; + */ + } + else $linkclose = ($morecss?' class="'.$morecss.'"':''); + + $linkstart = '
'; $linkend=''; $result .= $linkstart; if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1); if ($withpicto != 2) $result.= $this->ref; $result .= $linkend; + //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); + + global $action,$hookmanager; + $hookmanager->initHooks(array('salarypayment')); + $parameters=array('id'=>$this->id, 'getnomurl'=>$result); + $reshook=$hookmanager->executeHooks('getNomUrl',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) $result = $hookmanager->resPrint; + else $result .= $hookmanager->resPrint; return $result; } diff --git a/htdocs/compta/salaries/document.php b/htdocs/compta/salaries/document.php index 1059c765df3..493e0a3c5ee 100644 --- a/htdocs/compta/salaries/document.php +++ b/htdocs/compta/salaries/document.php @@ -99,7 +99,7 @@ if ($object->id) $totalsize+=$file['size']; } - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref='
'; diff --git a/htdocs/compta/salaries/info.php b/htdocs/compta/salaries/info.php index d2f02f3dc8f..87d24ceb406 100644 --- a/htdocs/compta/salaries/info.php +++ b/htdocs/compta/salaries/info.php @@ -54,7 +54,7 @@ $head = salaries_prepare_head($object); dol_fiche_head($head, 'info', $langs->trans("SalaryPayment"), -1, 'payment'); -$linkback = ''.$langs->trans("BackToList").''; +$linkback = ''.$langs->trans("BackToList").''; $morehtmlref='
'; diff --git a/htdocs/compta/salaries/index.php b/htdocs/compta/salaries/list.php similarity index 99% rename from htdocs/compta/salaries/index.php rename to htdocs/compta/salaries/list.php index a8a0b82e7d9..c7f5970723e 100644 --- a/htdocs/compta/salaries/index.php +++ b/htdocs/compta/salaries/list.php @@ -18,7 +18,7 @@ */ /** - * \file htdocs/compta/salaries/index.php + * \file htdocs/compta/salaries/list.php * \ingroup salaries * \brief List of salaries payments */ @@ -231,6 +231,7 @@ if ($result) $salstatic->id=$obj->rowid; $salstatic->ref=$obj->rowid; + // Ref print "
\n"; // Employee diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 4ffa1a2829f..d7d762464ee 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -481,7 +481,7 @@ if ($id > 0) } $morehtmlref.=''; - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index b2f73768e96..6e033bccc80 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -127,7 +127,7 @@ if ($object->id) } $morehtmlref.=''; - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status diff --git a/htdocs/compta/sociales/info.php b/htdocs/compta/sociales/info.php index bd21db108c1..35c00766252 100644 --- a/htdocs/compta/sociales/info.php +++ b/htdocs/compta/sociales/info.php @@ -98,7 +98,7 @@ if (! empty($conf->projet->enabled)) } $morehtmlref.=''; -$linkback = '' . $langs->trans("BackToList") . ''; +$linkback = '' . $langs->trans("BackToList") . ''; $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/list.php similarity index 92% rename from htdocs/compta/sociales/index.php rename to htdocs/compta/sociales/list.php index 6a0250804f1..b25ab142058 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/list.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/compta/sociales/index.php + * \file htdocs/compta/list/index.php * \ingroup tax * \brief Page to list all social contributions */ @@ -55,19 +55,19 @@ if (! $sortorder) $sortorder="DESC"; $year=GETPOST("year",'int'); $filtre=GETPOST("filtre",'int'); -if (empty($_REQUEST['typeid'])) +if (! GETPOSTISSET('search_typeid')) { $newfiltre=str_replace('filtre=','',$filtre); $filterarray=explode('-',$newfiltre); foreach($filterarray as $val) { $part=explode(':',$val); - if ($part[0] == 'cs.fk_type') $typeid=$part[1]; + if ($part[0] == 'cs.fk_type') $search_typeid=$part[1]; } } else { - $typeid=$_REQUEST['typeid']; + $search_typeid=GETPOST('search_typeid','int'); } if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers @@ -76,11 +76,12 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $search_label=""; $search_amount=""; $search_status=''; - $typeid=""; + $search_typeid=""; $year=""; $month=""; } + /* * View */ @@ -118,8 +119,8 @@ if ($filtre) { $filtre=str_replace(":","=",$filtre); $sql .= " AND ".$filtre; } -if ($typeid) { - $sql .= " AND cs.fk_type=".$db->escape($typeid); +if ($search_typeid) { + $sql .= " AND cs.fk_type=".$db->escape($search_typeid); } $sql.= " GROUP BY cs.rowid, cs.fk_type, cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode, c.libelle"; $sql.= $db->order($sortfield,$sortorder); @@ -139,10 +140,14 @@ if ($resql) $i = 0; $param=''; - if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; - if ($year) $param.='&year='.$year; - if ($typeid) $param.='&typeid='.$typeid; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); + if ($search_ref) $param.='&search_ref='.urlencode($search_ref); + if ($search_label) $param.='&search_label='.urlencode($search_label); + if ($search_amount) $param.='&search_amount='.urlencode($search_amount); + if ($search_typeid) $param.='&search_typeid='.urlencode($search_typeid); + if ($search_status != '' && $search_status != '-1') $param.='&search_status='.urlencode($search_status); + if ($year) $param.='&year='.urlencode($year); $newcardbutton=''; if($user->rights->tax->charges->creer) @@ -193,7 +198,7 @@ if ($resql) print ''; // Type print ''; // Period end date print ''; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 52a2c4bbe7f..ed237c215bf 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -133,7 +133,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('contact'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 96f20fdaf67..3631effa7b8 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -100,7 +100,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('contrat'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( 'c.ref'=>'Ref', diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 72b45f49db5..da484b31747 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -84,7 +84,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('contratdet'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // Security check $contratid = GETPOST('id','int'); diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 9ebdbd22836..5cb88c0e2ad 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1941,24 +1941,36 @@ class ExtraFields /** * return array_options array of data of extrafields value of object sent by a search form * - * @param array $extralabels $array of extrafields (@deprecated) - * @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names) - * @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names) - * @return array|int array_options set or 0 if no value + * @param array|string $extrafieldsobjectkey array of extrafields (old usage) or value of object->table_element (new usage) + * @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names) + * @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names) + * @return array|int array_options set or 0 if no value */ - function getOptionalsFromPost($extralabels,$keyprefix='',$keysuffix='') + function getOptionalsFromPost($extrafieldsobjectkey, $keyprefix='', $keysuffix='') { global $_POST; - if (is_array($this->attributes[$object->table_element]['label'])) $extralabels=$this->attributes[$object->table_element]['label']; + if (is_string($extrafieldsobjectkey) && is_array($this->attributes[$extrafieldsobjectkey]['label'])) + { + $extralabels = $this->attributes[$extrafieldsobjectkey]['label']; + } + else + { + $extralabels = $extrafieldsobjectkey; + } - $array_options = array(); if (is_array($extralabels)) { + $array_options = array(); + // Get extra fields foreach ($extralabels as $key => $value) { - $key_type = $this->attributes[$object->table_element]['type'][$key]; + $key_type = ''; + if (is_string($extrafieldsobjectkey)) + { + $key_type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; + } if (in_array($key_type,array('date','datetime'))) { @@ -1987,8 +1999,7 @@ class ExtraFields return $array_options; } - else { - return 0; - } + + return 0; } } diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 5824d2ca5ec..41b74079948 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -132,6 +132,7 @@ class FormFile if ($maxmin > 0) { + // MAX_FILE_SIZE doit précéder le champ input de type file $out .= ''; } @@ -1017,7 +1018,7 @@ class FormFile global $form; $disablecrop=1; - if (in_array($modulepart, array('societe','product','produit','service','expensereport','holiday','member','project','ticket','user'))) $disablecrop=0; + if (in_array($modulepart, array('expensereport','holiday','member','project','product','produit','service','societe','tax','ticket','user'))) $disablecrop=0; // Define relative path used to store the file if (empty($relativepath)) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index bc62ebc7604..a33d77cc9cb 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -317,14 +317,20 @@ class FormProjets * @param string $morecss More css added to the select component * @param string $projectsListId ''=Automatic filter on project allowed. List of id=Filter on project ids. * @param string $showproject 'all' = Show project info, ''=Hide project info + * @param User $usertofilter User object to use for filtering * @return int Nbr of project if OK, <0 if KO */ - function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24, $option_only=0, $show_empty='1', $discard_closed=0, $forcefocus=0, $disabled=0, $morecss='maxwidth500', $projectsListId='', $showproject='all') + function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24, $option_only=0, $show_empty='1', $discard_closed=0, $forcefocus=0, $disabled=0, $morecss='maxwidth500', $projectsListId='', $showproject='all', $usertofilter=null) { global $user,$conf,$langs; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + if (is_null($usertofilter)) + { + $usertofilter = $user; + } + $out=''; $hideunselectables = false; @@ -332,10 +338,10 @@ class FormProjets if (empty($projectsListId)) { - if (empty($user->rights->projet->all->lire)) + if (empty($usertofilter->rights->projet->all->lire)) { $projectstatic=new Project($this->db); - $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1); + $projectsListId = $projectstatic->getProjectsAuthorizedForUser($usertofilter,0,1); } } @@ -381,7 +387,7 @@ class FormProjets { $obj = $this->db->fetch_object($resql); // If we ask to filter on a company and user has no permission to see all companies and project is linked to another company, we hide project. - if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && empty($user->rights->societe->lire)) + if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && empty($usertofilter->rights->societe->lire)) { // Do nothing } diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index fe9d15c8322..bcf8bfe14a8 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -908,7 +908,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') { if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha'); } - $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); + $search_array_options=$extrafields->getOptionalsFromPost($contactstatic->table_element,'','search_'); // Purge search criteria if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 75cc6735fe4..ff5a9fa4776 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7288,7 +7288,8 @@ function dol_getmypid() * If param $mode is 1, can contains an operator <, > or = like "<10" or ">=100.5 < 1000" * If param $mode is 2, can contains a list of int id separated by comma like "1,3,4" * If param $mode is 3, can contains a list of string separated by comma like "a,b,c" - * @param integer $mode 0=value is list of keyword strings, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of id separated with comma (Example '1,3,4') + * @param integer $mode 0=value is list of keyword strings, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of ID separated with comma (Example '1,3,4') + * 3=value is list of string separated with comma (Example 'text 1,text 2'), 4=value is a list of ID separated with comma (Example '1,3,4') for search into a multiselect string ('1,2') * @param integer $nofirstand 1=Do not output the first 'AND' * @return string $res The statement to append to the SQL query */ @@ -7372,11 +7373,9 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0) else if ($mode == 4) { $tmparray=explode(',',trim($crit)); - if (count($tmparray)) { $listofcodes=''; - foreach($tmparray as $val) { if ($val) @@ -7385,7 +7384,7 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0) $newres .= ' OR '. $field . ' = \'' . $db->escape(trim($val)) . '\''; $newres .= ' OR '. $field . ' LIKE \'%,' . $db->escape(trim($val)) . '\''; $newres .= ' OR '. $field . ' LIKE \'%,' . $db->escape(trim($val)) . ',%\''; - $newres .= ')'; + $newres .= ')'; $i2++; } } diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 682746b3412..8792d8b762a 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -205,15 +205,15 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left -- insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2003__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/stats/index.php?leftmenu=donations&mainmenu=billing', 'Statistics', 1, 'donations', '$user->rights->don->lire', '', 2, 2, __ENTITY__); -- Special expenses insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled || $conf->salaries->enabled || $conf->loan->enabled || $conf->banque->enabled', __HANDLER__, 'left', 2200__+MAX_llx_menu__, 'billing', 'tax', 6__+MAX_llx_menu__, '/compta/charges/index.php?leftmenu=tax&mainmenu=billing', 'MenuSpecialExpenses', 0, 'compta', '(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) || (! empty($conf->loan->enabled) && $user->rights->loan->read) || (! empty($conf->banque->enabled) && $user->rights->banque->lire)', '', 0, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'billing', 'tax_sal', 2200__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary&mainmenu=billing', 'Salaries', 1, 'salaries', '$user->rights->salaries->read', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'billing', 'tax_sal', 2200__+MAX_llx_menu__, '/compta/salaries/list.php?leftmenu=tax_salary&mainmenu=billing', 'Salaries', 1, 'salaries', '$user->rights->salaries->read', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2211__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/card.php?leftmenu=tax_salary&action=create', 'NewPayment', 2, 'companies', '$user->rights->salaries->write', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2212__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary', 'Payments', 2, 'companies', '$user->rights->salaries->read', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2212__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/list.php?leftmenu=tax_salary', 'Payments', 2, 'companies', '$user->rights->salaries->read', '', 0, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2213__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/stats/index.php?leftmenu=tax_salary', 'Statistics', 2, 'companies', '$user->rights->salaries->read', '', 0, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled', __HANDLER__, 'left', 2220__+MAX_llx_menu__, 'billing', 'tax_loan', 2200__+MAX_llx_menu__, '/loan/index.php?leftmenu=tax_loan&mainmenu=billing', 'Loans', 1, 'loan', '$user->rights->loan->read', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled', __HANDLER__, 'left', 2220__+MAX_llx_menu__, 'billing', 'tax_loan', 2200__+MAX_llx_menu__, '/loan/list.php?leftmenu=tax_loan&mainmenu=billing', 'Loans', 1, 'loan', '$user->rights->loan->read', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2221__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/card.php?leftmenu=tax_loan&action=create', 'NewLoan', 2, 'loan', '$user->rights->loan->write', '', 0, 2, __ENTITY__); --insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2222__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/payment/list.php?leftmenu=tax_loan', 'Payments', 2, 'companies', '$user->rights->loan->read', '', 0, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan" && ! empty($conf->global->LOAN_SHOW_CALCULATOR)', __HANDLER__, 'left', 2223__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/calc.php?leftmenu=tax_loan', 'Calculator', 2, 'companies', '$user->rights->loan->calc', '', 0, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled', __HANDLER__, 'left', 2250__+MAX_llx_menu__, 'billing', 'tax_social', 2200__+MAX_llx_menu__, '/compta/sociales/index.php?leftmenu=tax_social', 'SocialContributions', 1, '', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled', __HANDLER__, 'left', 2250__+MAX_llx_menu__, 'billing', 'tax_social', 2200__+MAX_llx_menu__, '/compta/sociales/list.php?leftmenu=tax_social', 'SocialContributions', 1, '', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2251__+MAX_llx_menu__, 'billing', '', 2250__+MAX_llx_menu__, '/compta/sociales/card.php?leftmenu=tax_social&action=create', 'MenuNewSocialContribution', 2, '', '$user->rights->tax->charges->creer', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2252__+MAX_llx_menu__, 'billing', '', 2250__+MAX_llx_menu__, '/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing&mode=sconly', 'Payments', 2, '', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS)', __HANDLER__, 'left', 2300__+MAX_llx_menu__, 'billing', 'tax_vat', 2200__+MAX_llx_menu__, '/compta/tva/list.php?leftmenu=tax_vat&mainmenu=billing', 'VAT', 1, 'companies', '$user->rights->tax->charges->lire', '', 0, 7, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index bb13a0c2265..2c2c2d999f7 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -906,9 +906,9 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu // Social contributions if (! empty($conf->tax->enabled)) { - $newmenu->add("/compta/sociales/index.php?leftmenu=tax_social",$langs->trans("MenuSocialContributions"),1,$user->rights->tax->charges->lire); + $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social",$langs->trans("MenuSocialContributions"),1,$user->rights->tax->charges->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/card.php?leftmenu=tax_social&action=create",$langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/index.php?leftmenu=tax_social",$langs->trans("List"),2,$user->rights->tax->charges->lire); + if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social",$langs->trans("List"),2,$user->rights->tax->charges->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing&mode=sconly",$langs->trans("Payments"), 2, $user->rights->tax->charges->lire); // VAT if (empty($conf->global->TAX_DISABLE_VAT_MENUS)) @@ -948,9 +948,9 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->salaries->enabled)) { $langs->load("salaries"); - $newmenu->add("/compta/salaries/index.php?leftmenu=tax_salary&mainmenu=billing",$langs->trans("Salaries"),1,$user->rights->salaries->read, '', $mainmenu, 'tax_salary'); + $newmenu->add("/compta/salaries/list.php?leftmenu=tax_salary&mainmenu=billing",$langs->trans("Salaries"),1,$user->rights->salaries->read, '', $mainmenu, 'tax_salary'); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/card.php?leftmenu=tax_salary&action=create",$langs->trans("NewPayment"),2,$user->rights->salaries->write); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/index.php?leftmenu=tax_salary",$langs->trans("Payments"),2,$user->rights->salaries->read); + if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/list.php?leftmenu=tax_salary",$langs->trans("Payments"),2,$user->rights->salaries->read); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"),2,$user->rights->salaries->read); } @@ -958,7 +958,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->loan->enabled)) { $langs->load("loan"); - $newmenu->add("/loan/index.php?leftmenu=tax_loan&mainmenu=billing",$langs->trans("Loans"),1,$user->rights->loan->read, '', $mainmenu, 'tax_loan'); + $newmenu->add("/loan/list.php?leftmenu=tax_loan&mainmenu=billing",$langs->trans("Loans"),1,$user->rights->loan->read, '', $mainmenu, 'tax_loan'); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_loan/i',$leftmenu)) $newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create",$langs->trans("NewLoan"),2,$user->rights->loan->write); //if (empty($leftmenu) || preg_match('/^tax_loan/i',$leftmenu)) $newmenu->add("/loan/payment/list.php?leftmenu=tax_loan",$langs->trans("Payments"),2,$user->rights->loan->read); } diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index daa8d67e5d1..28ec5935582 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -146,8 +146,7 @@ class pdf_rouget extends ModelePdfExpedition $this->posxqtytoship=$this->page_largeur - $this->marge_droite - 28; $this->posxpuht=$this->page_largeur - $this->marge_droite; - if (!empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT)) { - + if (!empty($conf->global->SHIPPING_PDF_DISPLAY_AMOUNT_HT)) { // Show also the prices $this->posxweightvol=$this->page_largeur - $this->marge_droite - 118; $this->posxqtyordered=$this->page_largeur - $this->marge_droite - 96; $this->posxqtytoship=$this->page_largeur - $this->marge_droite - 68; @@ -173,7 +172,7 @@ class pdf_rouget extends ModelePdfExpedition } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build pdf onto disk * @@ -187,7 +186,7 @@ class pdf_rouget extends ModelePdfExpedition */ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0) { - // phpcs:enable + // phpcs:enable global $user,$conf,$langs,$hookmanager; $object->fetch_thirdparty(); @@ -533,8 +532,11 @@ class pdf_rouget extends ModelePdfExpedition $voltxt=round($object->lines[$i]->volume * $object->lines[$i]->qty_shipped, 5).' '.measuring_units_string($object->lines[$i]->volume_units?$object->lines[$i]->volume_units:0,"volume"); } - $pdf->writeHTMLCell($this->posxqtyordered - $this->posxweightvol + 2, 3, $this->posxweightvol - 1, $curY, $weighttxt.(($weighttxt && $voltxt)?'
':'').$voltxt, 0, 0, false, true, 'C'); - //$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 3, $weighttxt.(($weighttxt && $voltxt)?'
':'').$voltxt,'','C'); + if (empty($conf->global->SHIPPING_PDF_HIDE_WEIGHT_AND_VOLUME)) + { + $pdf->writeHTMLCell($this->posxqtyordered - $this->posxweightvol + 2, 3, $this->posxweightvol - 1, $curY, $weighttxt.(($weighttxt && $voltxt)?'
':'').$voltxt, 0, 0, false, true, 'C'); + //$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 3, $weighttxt.(($weighttxt && $voltxt)?'
':'').$voltxt,'','C'); + } if (empty($conf->global->SHIPPING_PDF_HIDE_ORDERED)) { @@ -542,10 +544,13 @@ class pdf_rouget extends ModelePdfExpedition $pdf->MultiCell(($this->posxqtytoship - $this->posxqtyordered), 3, $object->lines[$i]->qty_asked,'','C'); } - $pdf->SetXY($this->posxqtytoship, $curY); - $pdf->MultiCell(($this->posxpuht - $this->posxqtytoship), 3, $object->lines[$i]->qty_shipped,'','C'); + if (empty($conf->global->SHIPPING_PDF_HIDE_QTYTOSHIP)) + { + $pdf->SetXY($this->posxqtytoship, $curY); + $pdf->MultiCell(($this->posxpuht - $this->posxqtytoship), 3, $object->lines[$i]->qty_shipped,'','C'); + } - if(!empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT)) + if(!empty($conf->global->SHIPPING_PDF_DISPLAY_AMOUNT_HT)) { $pdf->SetXY($this->posxpuht, $curY); $pdf->MultiCell(($this->posxtotalht - $this->posxpuht-1), 3, price($object->lines[$i]->subprice, 0, $outputlangs),'','R'); @@ -653,7 +658,7 @@ class pdf_rouget extends ModelePdfExpedition } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show total to pay * @@ -666,7 +671,7 @@ class pdf_rouget extends ModelePdfExpedition */ function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) { - // phpcs:enable + // phpcs:enable global $conf,$mysoc; $sign=1; @@ -720,11 +725,14 @@ class pdf_rouget extends ModelePdfExpedition $pdf->MultiCell($this->posxqtytoship - $this->posxqtyordered, $tab2_hl, $totalOrdered, 0, 'C', 1); } - $pdf->SetXY($this->posxqtytoship, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($this->posxpuht - $this->posxqtytoship, $tab2_hl, $totalToShip, 0, 'C', 1); - - if(!empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT)) { + if (empty($conf->global->SHIPPING_PDF_HIDE_QTYTOSHIP)) + { + $pdf->SetXY($this->posxqtytoship, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($this->posxpuht - $this->posxqtytoship, $tab2_hl, $totalToShip, 0, 'C', 1); + } + if (!empty($conf->global->SHIPPING_PDF_DISPLAY_AMOUNT_HT)) + { $pdf->SetXY($this->posxpuht, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($this->posxtotalht - $this->posxpuht, $tab2_hl, '', 0, 'C', 1); @@ -732,22 +740,25 @@ class pdf_rouget extends ModelePdfExpedition $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxtotalht, $tab2_hl, price($object->total_ht, 0, $outputlangs), 0, 'C', 1); } - // Total Weight - if ($totalWeighttoshow) + if (empty($conf->global->SHIPPING_PDF_HIDE_WEIGHT_AND_VOLUME)) { - $pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalWeighttoshow, 0, 'C', 1); + // Total Weight + if ($totalWeighttoshow) + { + $pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalWeighttoshow, 0, 'C', 1); - $index++; - } - if ($totalVolumetoshow) - { - $pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalVolumetoshow, 0, 'C', 1); + $index++; + } + if ($totalVolumetoshow) + { + $pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalVolumetoshow, 0, 'C', 1); - $index++; + $index++; + } + if (! $totalWeighttoshow && ! $totalVolumetoshow) $index++; } - if (! $totalWeighttoshow && ! $totalVolumetoshow) $index++; $pdf->SetTextColor(0,0,0); @@ -794,11 +805,14 @@ class pdf_rouget extends ModelePdfExpedition $pdf->MultiCell($this->posxqtyordered - $this->posxdesc, 2, $outputlangs->transnoentities("Description"), '', 'L'); } - $pdf->line($this->posxweightvol-1, $tab_top, $this->posxweightvol-1, $tab_top + $tab_height); - if (empty($hidetop)) + if (empty($conf->global->SHIPPING_PDF_HIDE_WEIGHT_AND_VOLUME)) { - $pdf->SetXY($this->posxweightvol-1, $tab_top+1); - $pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 2, $outputlangs->transnoentities("WeightVolShort"),'','C'); + $pdf->line($this->posxweightvol-1, $tab_top, $this->posxweightvol-1, $tab_top + $tab_height); + if (empty($hidetop)) + { + $pdf->SetXY($this->posxweightvol-1, $tab_top+1); + $pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 2, $outputlangs->transnoentities("WeightVolShort"),'','C'); + } } if (empty($conf->global->SHIPPING_PDF_HIDE_ORDERED)) @@ -811,14 +825,17 @@ class pdf_rouget extends ModelePdfExpedition } } - $pdf->line($this->posxqtytoship-1, $tab_top, $this->posxqtytoship-1, $tab_top + $tab_height); - if (empty($hidetop)) - { - $pdf->SetXY($this->posxqtytoship, $tab_top+1); - $pdf->MultiCell(($this->posxpuht - $this->posxqtytoship), 2, $outputlangs->transnoentities("QtyToShip"),'','C'); - } + if (empty($conf->global->SHIPPING_PDF_HIDE_QTYTOSHIP)) + { + $pdf->line($this->posxqtytoship-1, $tab_top, $this->posxqtytoship-1, $tab_top + $tab_height); + if (empty($hidetop)) + { + $pdf->SetXY($this->posxqtytoship, $tab_top+1); + $pdf->MultiCell(($this->posxpuht - $this->posxqtytoship), 2, $outputlangs->transnoentities("QtyToShip"),'','C'); + } + } - if(!empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT)) { + if (!empty($conf->global->SHIPPING_PDF_DISPLAY_AMOUNT_HT)) { $pdf->line($this->posxpuht-1, $tab_top, $this->posxpuht-1, $tab_top + $tab_height); if (empty($hidetop)) diff --git a/htdocs/core/modules/modEmailCollector.class.php b/htdocs/core/modules/modEmailCollector.class.php index 5bad6e3e135..ef19ff49bf9 100644 --- a/htdocs/core/modules/modEmailCollector.class.php +++ b/htdocs/core/modules/modEmailCollector.class.php @@ -52,7 +52,7 @@ class modEmailCollector extends DolibarrModules // It is used to group modules by family in module setup page $this->family = "interface"; // Module position in the family on 2 digits ('01', '10', '20', ...) - $this->module_position = '75'; + $this->module_position = '12'; // Gives the possibility to the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this) //$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily"))); @@ -70,7 +70,7 @@ class modEmailCollector extends DolibarrModules // Name of image file used for this module. // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue' // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module' - $this->picto='generic'; + $this->picto='email'; // Defined all module parts (triggers, login, substitutions, menus, css, etc...) // for default path (eg: /dav/core/xxxxx) (0=disable, 1=enable) diff --git a/htdocs/core/modules/modGravatar.class.php b/htdocs/core/modules/modGravatar.class.php index 44b4f8a6e80..de85e76e7ff 100644 --- a/htdocs/core/modules/modGravatar.class.php +++ b/htdocs/core/modules/modGravatar.class.php @@ -49,6 +49,8 @@ class modGravatar extends DolibarrModules // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' // It is used to group modules in module setup page $this->family = "interface"; + // Module position in the family on 2 digits ('01', '10', '20', ...) + $this->module_position = '75'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) diff --git a/htdocs/core/modules/modLdap.class.php b/htdocs/core/modules/modLdap.class.php index 90577ae3ccf..9bce79dff1f 100644 --- a/htdocs/core/modules/modLdap.class.php +++ b/htdocs/core/modules/modLdap.class.php @@ -43,6 +43,8 @@ class modLdap extends DolibarrModules $this->numero = 200; $this->family = "interface"; + // Module position in the family on 2 digits ('01', '10', '20', ...) + $this->module_position = '30'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Synchronisation Ldap"; diff --git a/htdocs/core/modules/modMailing.class.php b/htdocs/core/modules/modMailing.class.php index 749369ee8e9..b7d83f8b771 100644 --- a/htdocs/core/modules/modMailing.class.php +++ b/htdocs/core/modules/modMailing.class.php @@ -44,7 +44,12 @@ class modMailing extends DolibarrModules $this->db = $db; $this->numero = 22; - $this->family = "technic"; + // Family can be 'base' (core modules),'crm','financial','hr','projects','products','ecm','technic' (transverse modules),'interface' (link with external tools),'other','...' + // It is used to group modules by family in module setup page + $this->family = "interface"; + // Module position in the family on 2 digits ('01', '10', '20', ...) + $this->module_position = '11'; + // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Gestion des EMailings"; diff --git a/htdocs/core/modules/modMailmanSpip.class.php b/htdocs/core/modules/modMailmanSpip.class.php index e1a8f7c2cd6..d82c8040c02 100644 --- a/htdocs/core/modules/modMailmanSpip.class.php +++ b/htdocs/core/modules/modMailmanSpip.class.php @@ -43,7 +43,11 @@ class modMailmanSpip extends DolibarrModules $this->db = $db; $this->numero = 105; + // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' + // It is used to group modules in module setup page $this->family = "interface"; + // Module position in the family on 2 digits ('01', '10', '20', ...) + $this->module_position = '70'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Mailman or Spip interface for member module"; diff --git a/htdocs/core/modules/modNotification.class.php b/htdocs/core/modules/modNotification.class.php index 9dbd77fae86..21d5f81eb98 100644 --- a/htdocs/core/modules/modNotification.class.php +++ b/htdocs/core/modules/modNotification.class.php @@ -41,7 +41,11 @@ class modNotification extends DolibarrModules $this->db = $db; $this->numero = 600; + // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' + // It is used to group modules in module setup page $this->family = "interface"; + // Module position in the family on 2 digits ('01', '10', '20', ...) + $this->module_position = '01'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "EMail notifications (push) on business Dolibarr events"; diff --git a/htdocs/core/modules/modOauth.class.php b/htdocs/core/modules/modOauth.class.php index f563baa9c92..086dac64bed 100644 --- a/htdocs/core/modules/modOauth.class.php +++ b/htdocs/core/modules/modOauth.class.php @@ -47,7 +47,7 @@ class modOauth extends DolibarrModules // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' // It is used to group modules in module setup page $this->family = "interface"; - $this->module_position = '51'; + $this->module_position = '31'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) diff --git a/htdocs/core/modules/modPaypal.class.php b/htdocs/core/modules/modPaypal.class.php index a11fa41b7a6..106ea412150 100644 --- a/htdocs/core/modules/modPaypal.class.php +++ b/htdocs/core/modules/modPaypal.class.php @@ -107,21 +107,21 @@ class modPaypal extends DolibarrModules // Main menu entries $this->menus = array(); // List of menus to add $r=0; - $this->menu[$r]=array( - 'fk_menu'=>'fk_mainmenu=billing,fk_leftmenu=customers_bills_payment', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'mainmenu'=>'billing', - 'leftmenu'=>'customers_bills_payment_paypal', - 'type'=>'left', // This is a Left menu entry - 'titre'=>'PaypalImportPayment', - 'url'=>'/paypal/importpayments.php', - 'langs'=>'paypal', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>501, - 'enabled'=>'$conf->paypal->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 2', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. - 'perms'=>'$user->rights->banque->consolidate', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2 + /*$this->menu[$r]=array( + 'fk_menu'=>'fk_mainmenu=billing,fk_leftmenu=customers_bills_payment', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'mainmenu'=>'billing', + 'leftmenu'=>'customers_bills_payment_paypal', + 'type'=>'left', // This is a Left menu entry + 'titre'=>'PaypalImportPayment', + 'url'=>'/paypal/importpayments.php', + 'langs'=>'paypal', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>501, + 'enabled'=>'$conf->paypal->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 2', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'$user->rights->banque->consolidate', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules + 'target'=>'', + 'user'=>2 ); // 0=Menu for internal users, 1=external users, 2=both - $r++; + $r++;*/ // Add here entries to declare new menus // Example to declare the Top Menu entry: diff --git a/htdocs/core/modules/modSocialNetworks.class.php b/htdocs/core/modules/modSocialNetworks.class.php index 6aceeff6a70..137547bfb15 100644 --- a/htdocs/core/modules/modSocialNetworks.class.php +++ b/htdocs/core/modules/modSocialNetworks.class.php @@ -46,6 +46,8 @@ class modSocialNetworks extends DolibarrModules // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' // It is used to group modules in module setup page $this->family = "interface"; + // Module position in the family on 2 digits ('01', '10', '20', ...) + $this->module_position = '20'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Enable Social Networks fields into third parties and addresses (skype, twitter, facebook, ...)"; diff --git a/htdocs/core/modules/modStripe.class.php b/htdocs/core/modules/modStripe.class.php index 348b44aaa1d..9a1584da477 100644 --- a/htdocs/core/modules/modStripe.class.php +++ b/htdocs/core/modules/modStripe.class.php @@ -92,7 +92,7 @@ class modStripe extends DolibarrModules // Main menu entries $r=0; - $this->menu[$r]=array( + /* $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=billing,fk_leftmenu=customers_bills_payment', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'mainmenu'=>'billing', 'leftmenu'=>'customers_bills_payment_stripe', @@ -106,7 +106,7 @@ class modStripe extends DolibarrModules 'target'=>'', 'user'=>2 ); // 0=Menu for internal users, 1=external users, 2=both - $r++; + $r++;*/ $this->menu[$r] = array( 'fk_menu'=>'fk_mainmenu=bank', diff --git a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php index 3c0d62be848..222538a8554 100644 --- a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php @@ -247,7 +247,7 @@ class pdf_stdmovement extends ModelePDFMovement // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('movement'); - $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); + $search_array_options=$extrafields->getOptionalsFromPost('movement','','search_'); $productlot=new ProductLot($db); $productstatic=new Product($db); diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php index f4f178031de..b7e774bcd4d 100644 --- a/htdocs/core/photos_resize.php +++ b/htdocs/core/photos_resize.php @@ -83,6 +83,12 @@ elseif ($modulepart == 'societe') if (! $user->rights->societe->lire) accessforbidden(); $accessallowed=1; } +elseif ($modulepart == 'tax') +{ + $result=restrictedArea($user, 'tax', $id, 'chargesociales','charges'); + if (! $user->rights->tax->charges->lire) accessforbidden(); + $accessallowed=1; +} elseif ($modulepart == 'ticket') { $result=restrictedArea($user,'ticket',$id,'ticket'); @@ -177,6 +183,17 @@ elseif ($modulepart == 'expensereport') $dir=$conf->expensereport->dir_output; // By default } } +elseif ($modulepart == 'tax') +{ + require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; + $object = new ChargeSociales($db); + if ($id > 0) + { + $result = $object->fetch($id); + if ($result <= 0) dol_print_error($db,'Failed to load object'); + $dir=$conf->tax->dir_output; // By default + } +} elseif ($modulepart == 'ticket') { require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; @@ -200,7 +217,8 @@ if (empty($backtourl)) else if (in_array($modulepart, array('member'))) $backtourl=DOL_URL_ROOT."/adherents/document.php?id=".$id.'&file='.urldecode($_POST["file"]); else if (in_array($modulepart, array('project'))) $backtourl=DOL_URL_ROOT."/projet/document.php?id=".$id.'&file='.urldecode($_POST["file"]); else if (in_array($modulepart, array('societe'))) $backtourl=DOL_URL_ROOT."/societe/document.php?id=".$id.'&file='.urldecode($_POST["file"]); - else if (in_array($modulepart, array('ticket'))) $backtourl=DOL_URL_ROOT."/ticket/document.php?id=".$id.'&file='.urldecode($_POST["file"]); + else if (in_array($modulepart, array('tax'))) $backtourl=DOL_URL_ROOT."/compta/sociales/document.php?id=".$id.'&file='.urldecode($_POST["file"]); + else if (in_array($modulepart, array('ticket'))) $backtourl=DOL_URL_ROOT."/ticket/document.php?id=".$id.'&file='.urldecode($_POST["file"]); else if (in_array($modulepart, array('user'))) $backtourl=DOL_URL_ROOT."/user/document.php?id=".$id.'&file='.urldecode($_POST["file"]); } @@ -226,6 +244,7 @@ if ($cancel) if ($action == 'confirm_resize' && (isset($_POST["file"]) != "") && (isset($_POST["sizex"]) != "") && (isset($_POST["sizey"]) != "")) { $fullpath=$dir."/".$original_file; + $result=dol_imageResizeOrCrop($fullpath,0,$_POST['sizex'],$_POST['sizey']); if ($result == $fullpath) @@ -294,6 +313,8 @@ if ($action == 'confirm_resize' && (isset($_POST["file"]) != "") && (isset($_POS if ($action == 'confirm_crop') { $fullpath=$dir."/".$original_file; + + //var_dump($_POST['w'].'x'.$_POST['h'].'-'.$_POST['x'].'x'.$_POST['y']);exit; $result=dol_imageResizeOrCrop($fullpath,1,$_POST['w'],$_POST['h'],$_POST['x'],$_POST['y']); if ($result == $fullpath) @@ -419,9 +440,9 @@ if (! empty($conf->use_javascript_ajax)) // If image is too large, we use another scale. if (! empty($_SESSION['dol_screenwidth']) && ($widthforcrop > round($_SESSION['dol_screenwidth']/2))) { - $widthforcrop=round($_SESSION['dol_screenwidth']/2); + $ratioforcrop=2; + $widthforcrop=round($_SESSION['dol_screenwidth'] / $ratioforcrop); $refsizeforcrop='screenwidth'; - $ratioforcrop=1; } print ''."\n"; @@ -448,7 +469,7 @@ if (! empty($conf->use_javascript_ajax)) - +
diff --git a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php index a8e43d6429f..d5b52085059 100644 --- a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php @@ -18,12 +18,17 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_ $tmpkey=preg_replace('/search_options_/','',$key); $typ=$extrafields->attributes[$extrafieldsobjectkey]['type'][$tmpkey]; - $mode_search=0; - if (in_array($typ, array('int','double','real'))) $mode_search=1; // Search on a numeric - if (in_array($typ, array('sellist','link')) && $crit != '0' && $crit != '-1') $mode_search=2; // Search on a foreign key int - if (in_array($typ, array('chkbxlst','checkbox'))) $mode_search=4; // Search on a multiselect field with sql type = text - if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0') && (! in_array($typ, array('link')) || $crit != '-1')) + if ($crit != '' && in_array($typ, array('date', 'datetime', 'timestamp'))) { + $sql .= " AND ef.".$tmpkey." = '".$db->idate($crit)."'"; + } + elseif ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0') && (! in_array($typ, array('link')) || $crit != '-1')) + { + $mode_search=0; + if (in_array($typ, array('int','double','real'))) $mode_search=1; // Search on a numeric + if (in_array($typ, array('sellist','link')) && $crit != '0' && $crit != '-1') $mode_search=2; // Search on a foreign key int + if (in_array($typ, array('chkbxlst','checkbox'))) $mode_search=4; // Search on a multiselect field with sql type = text + $sql .= natural_search('ef.'.$tmpkey, $crit, $mode_search); } } diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index f3367d3e90f..96f6b370b21 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -127,7 +127,7 @@ if ($disablenofollow) echo '';
-
+
global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?> @@ -138,7 +138,7 @@ if ($disablenofollow) echo '';
-
+
global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?> @@ -172,7 +172,7 @@ if ($captcha) { ?>
-
+
'.$langs->trans("ContributionsToPay").($num?' '.$num.'':'').''.$langs->trans("ContributionsToPay").($num?' '.$num.'':'').''.$langs->trans("DateDue").''.$langs->trans("AmountTTC").''.$langs->trans("Paid").'
 ".$langs->trans("Salary")." fk_user."\">".$obj->firstname." ".$obj->lastname."".$langs->trans("Salary")." fk_user."\">".$obj->firstname." ".$obj->lastname."'.price(-$obj->amount).''.price(-$obj->amount).'".$salstatic->getNomUrl(1)."'; - $formsocialcontrib->select_type_socialcontrib($typeid,'typeid',1,0,0,'maxwidth100onsmartphone'); + $formsocialcontrib->select_type_socialcontrib($search_typeid,'search_typeid',1,0,0,'maxwidth100onsmartphone'); print ' 
diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index 101c9ec7e67..df018bac244 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -101,7 +101,7 @@ if ($disablenofollow) echo '';
-
+
@@ -135,7 +135,7 @@ if (! empty($morelogincontent)) { ?>
-
+
diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 1f810132223..f594eb2b383 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -62,15 +62,16 @@ $securitykey = GETPOST('securitykey','alpha'); $diroutputmassaction=$conf->cronjob->dir_output . '/temp/massgeneration/'.$user->id; +$object = new Cronjob($db); + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('cronjoblist')); $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('cronjob'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); -$object = new Cronjob($db); /* diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index f925b271853..e4c0d4f588f 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -155,7 +155,7 @@ class EmailCollector extends CommonObject public $lastresult; // END MODULEBUILDER PROPERTIES - public $rules; + public $filters; public $actions; @@ -523,28 +523,28 @@ class EmailCollector extends CommonObject } elseif ($mode == 2) { - if ($status == 1) return img_picto($this->labelstatus[$status],'statut4').' '.$this->labelstatus[$status]; - elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5').' '.$this->labelstatus[$status]; + if ($status == 1) return img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; + elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; } elseif ($mode == 3) { - if ($status == 1) return img_picto($this->labelstatus[$status],'statut4'); - elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5'); + if ($status == 1) return img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle'); } elseif ($mode == 4) { - if ($status == 1) return img_picto($this->labelstatus[$status],'statut4').' '.$this->labelstatus[$status]; - elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5').' '.$this->labelstatus[$status]; + if ($status == 1) return img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; + elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; } elseif ($mode == 5) { - if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4'); - elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5'); + if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle'); } elseif ($mode == 6) { - if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4'); - elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5'); + if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle'); } } @@ -613,15 +613,15 @@ class EmailCollector extends CommonObject } /** - * Fetch rules + * Fetch filters * * @return int <0 if KO, >0 if OK */ - public function fetch_rules() + public function fetchFilters() { - $this->rules = array(); + $this->filters = array(); - $sql='SELECT type, rulevalue FROM '.MAIN_DB_PREFIX.'emailcollector_emailcollectorfilter WHERE status = 1 AND fk_emailcollector = '.$this->id; + $sql='SELECT rowid, type, rulevalue, status FROM '.MAIN_DB_PREFIX.'emailcollector_emailcollectorfilter WHERE fk_emailcollector = '.$this->id; $resql = $this->db->query($sql); if ($resql) @@ -631,10 +631,12 @@ class EmailCollector extends CommonObject while($i < $num) { $obj=$this->db->fetch_object($resql); - $this->rules[]=array('type'=>$obj->type, 'rulevalue'=>$obj->rulevalue); + $this->filters[$obj->rowid]=array('id'=>$obj->rowid, 'type'=>$obj->type, 'rulevalue'=>$obj->rulevalue, 'status'=>$obj->status); + $i++; } $this->db->free($resql); } + else dol_print_error($this->db); return 1; } @@ -644,11 +646,11 @@ class EmailCollector extends CommonObject * * @return int <0 if KO, >0 if OK */ - public function fetch_actions() + public function fetchActions() { $this->actions = array(); - $sql='SELECT type, actionparam FROM '.MAIN_DB_PREFIX.'emailcollector_emailcollectoraction WHERE status = 1 AND fk_emailcollector = '.$this->id; + $sql='SELECT rowid, type, actionparam, status FROM '.MAIN_DB_PREFIX.'emailcollector_emailcollectoraction WHERE fk_emailcollector = '.$this->id; $resql = $this->db->query($sql); if ($resql) @@ -658,10 +660,12 @@ class EmailCollector extends CommonObject while($i < $num) { $obj=$this->db->fetch_object($resql); - $this->rules[]=array('type'=>$obj->type, 'actionparam'=>$obj->actionparam); + $this->actions[$obj->rowid]=array('id'=>$obj->rowid, 'type'=>$obj->type, 'actionparam'=>$obj->actionparam, 'status'=>$obj->status); + $i++; } $this->db->free($resql); } + else dol_print_error($this->db); } @@ -709,8 +713,8 @@ class EmailCollector extends CommonObject return -2; } - $this->fetch_rules(); - $this->fetch_actions(); + $this->fetchFilters(); + $this->fetchActions(); $sourcedir = $this->source_directory; $targetdir = ($this->target_directory ? $server.$this->target_directory : ''); // Can be '[Gmail]/Trash' or 'mytag' @@ -735,16 +739,18 @@ class EmailCollector extends CommonObject //$search='ALL'; $search='UNDELETED'; - foreach($this->rules as $key => $rulevalue) + foreach($this->filters as $rule) { - if ($key == 'to') $search=($search?' ':'').'TO "'.str_replace('"', '', $rulevalue).'"'; - if ($key == 'bcc') $search=($search?' ':'').'BCC'; - if ($key == 'cc') $search=($search?' ':'').'CC'; - if ($key == 'from') $search=($search?' ':'').'FROM "'.str_replace('"', '', $rulevalue).'"'; - if ($key == 'subject') $search=($search?' ':'').'SUBJECT "'.str_replace('"', '', $rulevalue).'"'; - if ($key == 'body') $search=($search?' ':'').'BODY "'.str_replace('"', '', $rulevalue).'"'; - if ($key == 'seen') $search=($search?' ':'').'SEEN'; - if ($key == 'unseen') $search=($search?' ':'').'UNSEEN'; + if (empty($rule['status'])) continue; + + if ($rule['key'] == 'to') $search=($search?' ':'').'TO "'.str_replace('"', '', $rule['rulevalue']).'"'; + if ($rule['key'] == 'bcc') $search=($search?' ':'').'BCC'; + if ($rule['key'] == 'cc') $search=($search?' ':'').'CC'; + if ($rule['key'] == 'from') $search=($search?' ':'').'FROM "'.str_replace('"', '', $rule['rulevalue']).'"'; + if ($rule['key'] == 'subject') $search=($search?' ':'').'SUBJECT "'.str_replace('"', '', $rule['rulevalue']).'"'; + if ($rule['key'] == 'body') $search=($search?' ':'').'BODY "'.str_replace('"', '', $rule['rulevalue']).'"'; + if ($rule['key'] == 'seen') $search=($search?' ':'').'SEEN'; + if ($rule['key'] == 'unseen') $search=($search?' ':'').'UNSEEN'; } if (empty($targetdir)) // Use last date as filter if there is no targetdir defined. @@ -773,7 +779,7 @@ class EmailCollector extends CommonObject $this->db->begin(); $overview = imap_fetch_overview($connection, $imapemail, 0); - $header = imap_fetchheader($connection ,$imapemail, 0); + $header = imap_fetchheader($connection, $imapemail, 0); $message = imap_body($connection, $imapemail, 0); // imap_fetchstructure($connection, $imapemail, 0); // imap_fetchbody($connection, $imapemail, 1) may be text/plain, 2 may be text/html @@ -783,12 +789,14 @@ class EmailCollector extends CommonObject var_dump($message); */ - // Record email - foreach($this->actions as $actionkey => $actionvalue) + // Do operationss + foreach($this->actions as $operation) { if ($errorforactions) break; + if (empty($operation['status'])) continue; + + // Make Operation - // Make action if (! $errorforactions) diff --git a/htdocs/emailcollector/class/emailcollectoraction.class.php b/htdocs/emailcollector/class/emailcollectoraction.class.php index 5e0e85abdaf..42eecd097bd 100644 --- a/htdocs/emailcollector/class/emailcollectoraction.class.php +++ b/htdocs/emailcollector/class/emailcollectoraction.class.php @@ -50,7 +50,7 @@ class EmailCollectorAction extends CommonObject /** * @var int Does emailcollectoraction support extrafields ? 0=No, 1=Yes */ - public $isextrafieldmanaged = 1; + public $isextrafieldmanaged = 0; /** * @var string String with name of icon for emailcollectoraction. Must be the part after the 'object_' into object_emailcollectoraction.png @@ -181,6 +181,14 @@ class EmailCollectorAction extends CommonObject */ public function create(User $user, $notrigger = false) { + global $langs; + if (empty($this->type)) + { + $langs->load("errors"); + $this->errors[]=$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")); + return -1; + } + return $this->createCommon($user, $notrigger); } @@ -414,28 +422,28 @@ class EmailCollectorAction extends CommonObject } elseif ($mode == 2) { - if ($status == 1) return img_picto($this->labelstatus[$status],'statut4').' '.$this->labelstatus[$status]; - elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5').' '.$this->labelstatus[$status]; + if ($status == 1) return img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; + elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; } elseif ($mode == 3) { - if ($status == 1) return img_picto($this->labelstatus[$status],'statut4'); - elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5'); + if ($status == 1) return img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle'); } elseif ($mode == 4) { - if ($status == 1) return img_picto($this->labelstatus[$status],'statut4').' '.$this->labelstatus[$status]; - elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5').' '.$this->labelstatus[$status]; + if ($status == 1) return img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; + elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; } elseif ($mode == 5) { - if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4'); - elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5'); + if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle'); } elseif ($mode == 6) { - if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4'); - elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5'); + if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle'); } } diff --git a/htdocs/emailcollector/class/emailcollectorfilter.class.php b/htdocs/emailcollector/class/emailcollectorfilter.class.php index deb5bb88824..23c8f7a02b2 100644 --- a/htdocs/emailcollector/class/emailcollectorfilter.class.php +++ b/htdocs/emailcollector/class/emailcollectorfilter.class.php @@ -50,7 +50,7 @@ class EmailCollectorFilter extends CommonObject /** * @var int Does emailcollectorfilter support extrafields ? 0=No, 1=Yes */ - public $isextrafieldmanaged = 1; + public $isextrafieldmanaged = 0; /** * @var string String with name of icon for emailcollectorfilter. Must be the part after the 'object_' into object_emailcollectorfilter.png @@ -152,6 +152,20 @@ class EmailCollectorFilter extends CommonObject */ public function create(User $user, $notrigger = false) { + global $langs; + if (empty($this->type)) + { + $langs->load("errors"); + $this->errors[]=$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")); + return -1; + } + if (empty($this->rulevalue)) + { + $langs->load("errors"); + $this->errors[]=$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("RuleValue")); + return -1; + } + return $this->createCommon($user, $notrigger); } @@ -385,28 +399,28 @@ class EmailCollectorFilter extends CommonObject } elseif ($mode == 2) { - if ($status == 1) return img_picto($this->labelstatus[$status],'statut4').' '.$this->labelstatus[$status]; - elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5').' '.$this->labelstatus[$status]; + if ($status == 1) return img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; + elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; } elseif ($mode == 3) { - if ($status == 1) return img_picto($this->labelstatus[$status],'statut4'); - elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5'); + if ($status == 1) return img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle'); } elseif ($mode == 4) { - if ($status == 1) return img_picto($this->labelstatus[$status],'statut4').' '.$this->labelstatus[$status]; - elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5').' '.$this->labelstatus[$status]; + if ($status == 1) return img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; + elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; } elseif ($mode == 5) { - if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4'); - elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5'); + if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle'); } elseif ($mode == 6) { - if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4'); - elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5'); + if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle'); } } diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index c3632ca57fd..1d29d4d6bff 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -69,13 +69,15 @@ $pagenext = $page + 1; $viewstatut=GETPOST('viewstatut'); +$object = new Expedition($db); + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('shipmentlist')); $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('expedition'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index d328cd21de2..1fae1950f60 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -90,7 +90,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('expensereport'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // List of fields to search into when doing a "search in all" diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 4b8aa9bb43d..e492ef0c794 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -152,7 +152,7 @@ if ($action == 'add') { } } } elseif ($action == 'createfrommodel') { - $newinter = new fichinter($db); + $newinter = new Fichinter($db); // on récupère les enregistrements $object->fetch($id); @@ -176,7 +176,7 @@ if ($action == 'add') { // on créer un nouvelle intervention $extrafields = new ExtraFields($db); $extralabels = $extrafields->fetch_name_optionals_label($newinter->table_element); - $array_options = $extrafields->getOptionalsFromPost($extralabels); + $array_options = $extrafields->getOptionalsFromPost($newinter->table_element); $newinter->array_options = $array_options; $newfichinterid = $newinter->create($user); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 5896a5c5723..fe15141c86c 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -258,7 +258,7 @@ if (empty($reshook)) // Extrafields $extrafields = new ExtraFields($db); $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); - $array_options = $extrafields->getOptionalsFromPost($extralabels); + $array_options = $extrafields->getOptionalsFromPost($object->table_element); $object->array_options = $array_options; @@ -406,7 +406,7 @@ if (empty($reshook)) { // Extrafields $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); - $array_options = $extrafields->getOptionalsFromPost($extralabels); + $array_options = $extrafields->getOptionalsFromPost($object->table_element); $object->array_options = $array_options; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 96a1199255c..1f3686a02ab 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -87,7 +87,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('fichinter'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 7158d7b2c0e..401acab032b 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -113,7 +113,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('commande_fournisseur'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index e1bd120b0b4..b72d89f4b07 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -130,7 +130,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('facture_fourn'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 7946f98cb66..27dc347d9d0 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -89,7 +89,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('paymentsupplier'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost('paymentsupplier','','search_'); $arrayfields=array(); @@ -570,25 +570,25 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie { print ''; } - + // Date Max Payment if ($objp->dlr > 0 ) { print ''; } else { print ''; } - + // Multicurrency if (!empty($conf->multicurrency->enabled)) { diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index f155f513a18..aecdce1ae06 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -78,7 +78,7 @@ $diroutputmassaction=$conf->holiday->dir_output . '/temp/massgeneration/'.$user- $hookmanager->initHooks(array('holidaylist')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('holiday'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // Default sort order (if not yet defined by previous GETPOST) if (! $sortfield) $sortfield="cp.rowid"; diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index d1e2d87b444..05106e475cd 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -206,6 +206,9 @@ ALTER TABLE llx_emailcollector_emailcollectoraction ADD INDEX idx_emailcollector ALTER TABLE llx_emailcollector_emailcollectoraction ADD CONSTRAINT fk_emailcollectoraction_fk_emailcollector FOREIGN KEY (fk_emailcollector) REFERENCES llx_emailcollector_emailcollector(rowid); +ALTER TABLE llx_emailcollector_emailcollectorfilter ADD UNIQUE INDEX uk_emailcollector_emailcollectorfilter (fk_emailcollector, type, rulevalue); +ALTER TABLE llx_emailcollector_emailcollectoraction ADD UNIQUE INDEX uk_emailcollector_emailcollectoraction (fk_emailcollector, type); + diff --git a/htdocs/install/mysql/tables/llx_emailcollector_emailcollectoraction.key.sql b/htdocs/install/mysql/tables/llx_emailcollector_emailcollectoraction.key.sql index 0ef98e90b41..ef8a91b5d31 100644 --- a/htdocs/install/mysql/tables/llx_emailcollector_emailcollectoraction.key.sql +++ b/htdocs/install/mysql/tables/llx_emailcollector_emailcollectoraction.key.sql @@ -19,3 +19,4 @@ ALTER TABLE llx_emailcollector_emailcollectoraction ADD INDEX idx_emailcollector ALTER TABLE llx_emailcollector_emailcollectoraction ADD CONSTRAINT fk_emailcollectoraction_fk_emailcollector FOREIGN KEY (fk_emailcollector) REFERENCES llx_emailcollector_emailcollector(rowid); -- END MODULEBUILDER INDEXES +ALTER TABLE llx_emailcollector_emailcollectoraction ADD UNIQUE INDEX uk_emailcollector_emailcollectoraction (fk_emailcollector, type); diff --git a/htdocs/install/mysql/tables/llx_emailcollector_emailcollectorfilter.key.sql b/htdocs/install/mysql/tables/llx_emailcollector_emailcollectorfilter.key.sql index fb65963b63a..e0eb095fad1 100644 --- a/htdocs/install/mysql/tables/llx_emailcollector_emailcollectorfilter.key.sql +++ b/htdocs/install/mysql/tables/llx_emailcollector_emailcollectorfilter.key.sql @@ -19,3 +19,5 @@ ALTER TABLE llx_emailcollector_emailcollectorfilter ADD INDEX idx_emailcollector ALTER TABLE llx_emailcollector_emailcollectorfilter ADD CONSTRAINT fk_emailcollectorfilter_fk_emailcollector FOREIGN KEY (fk_emailcollector) REFERENCES llx_emailcollector_emailcollector(rowid); -- END MODULEBUILDER INDEXES +ALTER TABLE llx_emailcollector_emailcollectorfilter ADD UNIQUE INDEX uk_emailcollector_emailcollectorfilter (fk_emailcollector, type, rulevalue); + diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 2294d540b22..d9be14b3cb7 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1815,10 +1815,13 @@ EnableFeatureFor=Enable features for %s VATIsUsedIsOff=Note: The option to use sales Tax or VAT has been set to Off in the menu %s - %s, so Sale tax or Vat used will always be 0 for sales. SwapSenderAndRecipientOnPDF=Swap sender and recipient address on PDF FeatureSupportedOnTextFieldsOnly=Warning, feature supported on text fields only +EmailCollector=Email collector +EmailCollectorDescription=Add a scheduled job and a setup page to scan regularly email boxes (using IMAP protocol) and record emails received into your application, at the right place and/or create some record automatically (like leads). NewEmailCollector=New Email Collector EMailHost=Host of email IMAP server MailboxSourceDirectory=Mailbox source directory MailboxTargetDirectory=Mailbox target directory +EmailcollectorOperations=Operations done by collector CollectNow=Collect now DateLastResult=Date last collect LastResult=Last result @@ -1827,6 +1830,8 @@ EmailCollectorConfirmCollect=Do you want to run the collect for this collector n NoNewEmailToProcess=No new email to process NothingProcessed=Nothing done XEmailsDoneYActionsDone=%s emails analyzed, %s record/actions done by collector +RecordEvent=Record event +CreateLeadAndThirdParty=Create lead (and thirdparty if necessary) ##### Resource #### ResourceSetup=Configuration du module Resource UseSearchToSelectResource=Use a search form to choose a resource (rather than a drop-down list). diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index fa74cfa44bc..100a249f418 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -635,6 +635,8 @@ SendMail=Send email EMail=E-mail NoEMail=No email Email=Email +AlreadyRead=Alreay read +NotRead=Not read NoMobilePhone=No mobile phone Owner=Owner FollowingConstantsWillBeSubstituted=The following constants will be replaced with the corresponding value. diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index e2491167ed8..242472aff0a 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -264,7 +264,7 @@ if ($action == 'create') print '
!!!'; print dol_print_date($db->jdate($objp->dlr), 'day'); - + if ($invoice->hasDelay()) { print img_warning($langs->trans('Late')); } - + print '--
'; // Label - print ''; + print ''; // Bank account if (! empty($conf->banque->enabled)) @@ -434,7 +434,7 @@ if ($id > 0) // Loan card - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; $morehtmlref='
'; // Ref loan diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php index 2c762b624d2..553bbc258e8 100644 --- a/htdocs/loan/document.php +++ b/htdocs/loan/document.php @@ -124,7 +124,7 @@ if ($object->id) } $morehtmlref.='
'; - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; $object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status diff --git a/htdocs/loan/info.php b/htdocs/loan/info.php index 3a092e4cb84..cc923b17fea 100644 --- a/htdocs/loan/info.php +++ b/htdocs/loan/info.php @@ -96,7 +96,7 @@ if (! empty($conf->projet->enabled)) { } $morehtmlref.=''; -$linkback = '' . $langs->trans("BackToList") . ''; +$linkback = '' . $langs->trans("BackToList") . ''; $object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status diff --git a/htdocs/loan/index.php b/htdocs/loan/list.php similarity index 99% rename from htdocs/loan/index.php rename to htdocs/loan/list.php index 5b81ebbb023..780d28df081 100644 --- a/htdocs/loan/index.php +++ b/htdocs/loan/list.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/loan/index.php + * \file htdocs/loan/list.php * \ingroup loan * \brief Page to list all loans */ diff --git a/htdocs/loan/note.php b/htdocs/loan/note.php index 2ed8e82f20b..187dbbbd1f9 100644 --- a/htdocs/loan/note.php +++ b/htdocs/loan/note.php @@ -113,7 +113,7 @@ if ($id > 0) } $morehtmlref.=''; - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; $object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php index 919139bd6e3..77d47e66b40 100644 --- a/htdocs/loan/payment/card.php +++ b/htdocs/loan/payment/card.php @@ -58,7 +58,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->loan->del if ($result > 0) { $db->commit(); - header("Location: ".DOL_URL_ROOT."/loan/index.php"); + header("Location: ".DOL_URL_ROOT."/loan/list.php"); exit; } else diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 58dfe5924cf..6e3fc1bd63f 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -357,7 +357,6 @@ class MyObject extends CommonObject if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips $result = ''; - $companylink = ''; $label = '' . $langs->trans("MyObject") . ''; $label.= '
'; @@ -453,28 +452,28 @@ class MyObject extends CommonObject } elseif ($mode == 2) { - if ($status == 1) return img_picto($this->labelstatus[$status],'statut4').' '.$this->labelstatus[$status]; - elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5').' '.$this->labelstatus[$status]; + if ($status == 1) return img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; + elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; } elseif ($mode == 3) { - if ($status == 1) return img_picto($this->labelstatus[$status],'statut4'); - elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5'); + if ($status == 1) return img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle'); } elseif ($mode == 4) { - if ($status == 1) return img_picto($this->labelstatus[$status],'statut4').' '.$this->labelstatus[$status]; - elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5').' '.$this->labelstatus[$status]; + if ($status == 1) return img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; + elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelstatus[$status]; } elseif ($mode == 5) { - if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4'); - elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5'); + if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle'); } elseif ($mode == 6) { - if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4'); - elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5'); + if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4', '', false, 0, 0, '', 'valignmiddle'); + elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5', '', false, 0, 0, '', 'valignmiddle'); } } diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 63d1664e1ff..f9b3db7a99e 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -81,7 +81,7 @@ $diroutputmassaction=$conf->mymodule->dir_output . '/temp/massgeneration/'.$user $hookmanager->initHooks(array('myobjectcard','globalcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // Initialize array of search criterias $search_all=trim(GETPOST("search_all",'alpha')); diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index beb03c183a6..8d0f89104ef 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -93,8 +93,8 @@ $extrafields = new ExtraFields($db); $diroutputmassaction=$conf->mymodule->dir_output . '/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('myobjectlist')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels -$extralabels = $extrafields->fetch_name_optionals_label('myobject'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$extralabels = $extrafields->fetch_name_optionals_label('myobject'); // Load $extrafields->attributes['myobject'] +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // Default sort order (if not yet defined by previous GETPOST) if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition. diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 2784e3c303b..24848ad26c5 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -53,7 +53,7 @@ $diroutputmassaction=$conf->stock->dir_output . '/temp/massgeneration/'.$user->i $hookmanager->initHooks(array('inventorycard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('inventory'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost('inventory','','search_'); // Initialize array of search criterias $search_all=trim(GETPOST("search_all",'alpha')); diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index a5592c87f5d..95bb82aea50 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -59,7 +59,7 @@ $diroutputmassaction=$conf->inventory->dir_output . '/temp/massgeneration/'.$use $hookmanager->initHooks(array('inventorylist')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('inventory'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // Default sort order (if not yet defined by previous GETPOST) if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition. diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 562d09056c7..d05b01d6ae9 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -99,7 +99,7 @@ $form=new Form($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('product'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); if (empty($action)) $action='list'; diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 27c50d075aa..da7a834396a 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -90,7 +90,7 @@ $formfile = new FormFile($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('movement'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); $arrayfields=array( 'm.rowid'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index f72a28dbc90..dff2aa8e0e0 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -1,7 +1,6 @@ +/* Copyright (C) 2007-2018 Laurent Destailleur * Copyright (C) 2018 All-3kcis - * Copyright (C) ---Put here your own copyright and developer email--- * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -317,7 +316,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; $shownav = 1; if ($user->societe_id && ! in_array('batch', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0; diff --git a/htdocs/product/stock/productlot_document.php b/htdocs/product/stock/productlot_document.php index 1ce4f9ba224..b9235b72133 100644 --- a/htdocs/product/stock/productlot_document.php +++ b/htdocs/product/stock/productlot_document.php @@ -131,7 +131,7 @@ if ($object->id) } - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; $shownav = 1; if ($user->societe_id && ! in_array('batch', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0; diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 4d9916bfa9c..6de8be264a9 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -79,7 +79,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('product_lot'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 623838f8149..4d7b8a623c0 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -416,7 +416,7 @@ print '
'; $titleassigntask = $langs->transnoentities("AssignTaskToMe"); if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs)); print '
'; -$formproject->selectTasks($socid?$socid:-1, $taskid, 'taskid', 32, 0, 1, 1); +$formproject->selectTasks($socid?$socid:-1, $taskid, 'taskid', 32, 0, 1, 1, 0, 0, '', '', 'all', $usertoprocess); print '
'; print ' '; print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth150onsmartphone'); diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 214879c7f92..a73ff365f3f 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -418,7 +418,7 @@ print '
'; $titleassigntask = $langs->transnoentities("AssignTaskToMe"); if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs)); print '
'; -$formproject->selectTasks($socid?$socid:-1, $taskid, 'taskid', 32, 0, 1, 1); +$formproject->selectTasks($socid?$socid:-1, $taskid, 'taskid', 32, 0, 1, 1, 0, 0, '', '', 'all', $usertoprocess); print '
'; print ' '; print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth150onsmartphone'); diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 5a13b16560d..87d82ffe03d 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -105,7 +105,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('projet'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 2366ccc738b..2ace542c219 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -79,7 +79,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('projet_task'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // Security check $socid=0; diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index 0d67e983143..f11583ac64d 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -182,7 +182,7 @@ if ($action == "view_ticketlist") // fetch optionals attributes and labels $extrafields = new ExtraFields($db); $extralabels = $extrafields->fetch_name_optionals_label('ticket'); - $search_array_options = $extrafields->getOptionalsFromPost($extralabels, '', 'search_'); + $search_array_options = $extrafields->getOptionalsFromPost('ticket', '', 'search_'); $filter = array(); $param = ''; diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php index 49cad87e990..8fd7f5bcd13 100644 --- a/htdocs/resource/card.php +++ b/htdocs/resource/card.php @@ -250,7 +250,7 @@ if ($action == 'create' || $object->fetch($id) > 0) // Ref print '
'; - print ''; + print ''; // Type print ''; diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 4492d74be65..55dddcc0a48 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -50,7 +50,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); $search_ref=GETPOST("search_ref"); $search_type=GETPOST("search_type"); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 5935a1d01a1..2fc046b5fb8 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -417,8 +417,8 @@ if (empty($reshook)) $object->idprof5 = trim(GETPOST('idprof5', 'alpha')); $object->idprof6 = trim(GETPOST('idprof6', 'alpha')); $object->prefix_comm = GETPOST('prefix_comm', 'alpha'); - $object->code_client = GETPOST('customer_code', 'alpha'); - $object->code_fournisseur = GETPOST('supplier_code', 'alpha'); + $object->code_client = GETPOSTISSET('customer_code')?GETPOST('customer_code', 'alpha'):GETPOST('code_client', 'alpha'); + $object->code_fournisseur = GETPOSTISSET('supplier_code')?GETPOST('supplier_code', 'alpha'):GETPOST('code_fournisseur', 'alpha'); $object->capital = GETPOST('capital', 'alpha'); $object->barcode = GETPOST('barcode', 'alpha'); diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 684f6f8c471..f5513cb6aa3 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -121,7 +121,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('societe'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 760bfef4d27..086a3db6d41 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -63,7 +63,7 @@ $diroutputmassaction=$conf->website->dir_output . '/temp/massgeneration/'.$user- $hookmanager->initHooks(array('websitethirdpartylist')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('thirdpartyaccount'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost('thirdpartyaccount','','search_'); unset($objectwebsiteaccount->fields['fk_soc']); // Remove this field, we are already on the thirdparty diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 2fcb296b433..8a7266a4003 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -117,7 +117,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('supplier_proposal'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // List of fields to search into when doing a "search in all" diff --git a/htdocs/takepos/customers.php b/htdocs/takepos/customers.php index f5bcb8557cf..fc7fbc54d2f 100644 --- a/htdocs/takepos/customers.php +++ b/htdocs/takepos/customers.php @@ -144,7 +144,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('societe'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost('societe','','search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index a58031b2889..ce2d5c28555 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -331,7 +331,7 @@ input, select { } /* Focus definitions must be after standard definition */ -textarea:focus, button:focus { +textarea:focus { /* v6 box-shadow: 0 0 4px #8091BF; */ border: 1px solid #aaa !important; } @@ -1074,6 +1074,9 @@ select.selectarrowonleft option { /* border-bottom: 1px solid #BBB; */ /* max-width: inherit; why this ? */ } + input[type=text], input[type=password] { + max-width: 180px; + } .hideonsmartphone { display: none; } .hideonsmartphoneimp { display: none !important; } @@ -3313,6 +3316,7 @@ ul.noborder li:nth-child(even):not(.liste_titre) { .thumbstat150 { flex: 1 1 110px; margin-bottom: 8px; + width: 160px; } .dashboardlineindicator { float: left; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index a246786a53a..9d5a518c4bf 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -3249,7 +3249,7 @@ div .tdtop { margin: 3px; border: 1px solid #ddd; box-shadow: none; - background: #ddd; + background: #eee; } .thumbstat { flex: 1 1 110px; diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index ef78b5eff45..ab16161e844 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -58,7 +58,7 @@ $object = new Ticket($db); $extrafields = new ExtraFields($db); // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // Initialize array of search criterias $search_all=trim(GETPOST("search_all",'alpha')); diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index 7e8ae39564a..6ee61de76b9 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -258,7 +258,7 @@ class ActionsTicket // Extrafields $extrafields = new ExtraFields($this->db); $extralabels = $extrafields->fetch_name_optionals_label($fichinter->table_element); - $array_options = $extrafields->getOptionalsFromPost($extralabels); + $array_options = $extrafields->getOptionalsFromPost($fichinter->table_element); $fichinter->array_options = $array_options; $id = $fichinter->create($user); diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 1b43d0054b7..545a5fcf1ed 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -77,7 +77,7 @@ else $hookmanager->initHooks(array('ticketlist')); // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('ticket'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // Default sort order (if not yet defined by previous GETPOST) if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition. diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 13b555b6d5c..1cfb8fbb5d5 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -311,7 +311,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco print '
'.$langs->trans("Label").'
'.$langs->trans("Label").'
'.$langs->trans("ResourceFormLabel_ref").'
'.$langs->trans("ResourceType").'
'; print ''; - print '
'; + print ''; print ''; diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 64c63c05426..7d856c52891 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -68,7 +68,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('user'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); $userstatic=new User($db); $companystatic = new Societe($db); diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 4f969851ad4..71b71e241a1 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2735,7 +2735,7 @@ if ($action == 'preview' || $action == 'createfromclone' || $action == 'createpa $out.="\n"; - $out.='
'."\n"; + $out.='
'."\n"; // REPLACEMENT OF LINKS When page called by website editor diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 49965b9009a..24f87678505 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -46,7 +46,7 @@ $diroutputmassaction=$conf->website->dir_output . '/temp/massgeneration/'.$user- $hookmanager->initHooks(array('websiteaccountcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('societeaccount'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // Initialize array of search criterias $search_all=trim(GETPOST("search_all",'alpha'));
'.$langs->trans("LastSalaries",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllSalaries").' '.$num.''; print '
'.$langs->trans("LastSalaries",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllSalaries").' '.$num.'