diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index 65a03adc4f1..c3b9b372915 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -28,14 +28,26 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php'; -if (!$user->admin) -accessforbidden(); +if (!$user->admin) { + accessforbidden(); +} // Load translation files required by the page $langs->loadLangs(array("users", "admin", "other")); $action = GETPOST('action', 'aZ09'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +// Load variable for pagination +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST('sortfield', 'alpha'); +$sortorder = GETPOST('sortorder', 'alpha'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; $securityevent = new Events($db); $eventstolog = $securityevent->eventstolog; @@ -44,6 +56,7 @@ $eventstolog = $securityevent->eventstolog; /* * Actions */ + if ($action == "save") { $i = 0; @@ -67,6 +80,12 @@ if ($action == "save") * View */ +$form = new Form($db); + +$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; +$selectedfields = ''; +$selectedfields .= $form->showCheckAddButtons('checkforselect', 1); + $wikihelp = 'EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad'; llxHeader('', $langs->trans("Audit"), $wikihelp); @@ -85,9 +104,10 @@ $head = security_prepare_head(); dol_fiche_head($head, 'audit', $langs->trans("Security"), -1); -print ""; +print '
'; print ""; -print ""; +print getTitleFieldOfList("LogEvents", 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, '')."\n"; +print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; print "\n"; // Loop on each event type foreach ($eventstolog as $key => $arr) @@ -96,10 +116,10 @@ foreach ($eventstolog as $key => $arr) { print ''; print ''; - print ''."\n"; } } @@ -109,7 +129,7 @@ dol_fiche_end(); print '
'; print "trans("Save")."\">"; -print "
"; +print ''; print "\n"; diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 0bb16b3cbd6..ab67974c920 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -154,8 +154,10 @@ if ($action == 'update') //dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", GETPOST("MAIN_DISABLE_JAVASCRIPT", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", GETPOST("MAIN_BUTTON_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_START_WEEK", GETPOST("MAIN_START_WEEK", 'int'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'int'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'int'), 'chaine', 0, '', $conf->entity); + + dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", GETPOST('MAIN_HELPCENTER_DISABLELINK', 'aZ09'), 'chaine', 0, '', 0); // Param for all entities diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index 60bd157d283..0486edebeec 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -203,7 +203,7 @@ if ($result) // Show break line print ''; print ''; print ''; @@ -218,8 +218,6 @@ if ($result) // Picto and label of module print ''; // Tick diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index db9a893ff9f..ce21c1f3ad8 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -401,7 +401,7 @@ function getTableColumnFunction(array $functions) * @param array $loaded A list with all loaded PHP extensions * @param array $functions A list with all PHP functions to check * - * @return array + * @return string */ function getResultColumn($name, array $activated, array $loaded, array $functions) { diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 1ca0c512815..31c280714b7 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -903,40 +903,32 @@ class ActionComm extends CommonObject $this->db->begin(); // remove categorie association - $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_actioncomm"; - $sql .= " WHERE fk_actioncomm=".$this->id; - - $res = $this->db->query($sql); - if ($res < 0) { - $this->error = $this->db->lasterror(); - $error++; - } - // remove actioncomm if (!$error) { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm"; - $sql .= " WHERE id=".$this->id; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_actioncomm"; + $sql .= " WHERE fk_actioncomm=".$this->id; - $res = $this->db->query($sql); - if ($res < 0) { - $this->error = $this->db->lasterror(); - $error++; - } + $res = $this->db->query($sql); + if (!$res) { + $this->error = $this->db->lasterror(); + $error++; + } } - + + // remove actioncomm_resources if (!$error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources"; $sql .= " WHERE fk_actioncomm=".$this->id; $res = $this->db->query($sql); - if ($res < 0) { - $this->error = $this->db->lasterror(); + if (!$res) { + $this->error=$this->db->lasterror(); $error++; } } // Removed extrafields if (!$error) { - $result = $this->deleteExtraFields(); + $result = $this->deleteExtraFields(); if ($result < 0) { $error++; @@ -944,6 +936,18 @@ class ActionComm extends CommonObject } } + // remove actioncomm + if (!$error) { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm"; + $sql .= " WHERE id=".$this->id; + + $res = $this->db->query($sql); + if (!$res) { + $this->error = $this->db->lasterror(); + $error++; + } + } + if (!$error) { if (!$notrigger) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index cba83d8f015..d8b4424661a 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -214,6 +214,76 @@ class Account extends CommonObject */ public $date_solde; + + /** + * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'enabled' is a condition when the field must be managed. + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' is the CSS style to use on field. For example: 'maxwidth200' + * 'help' is a string visible as a tooltip on field + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + + // BEGIN MODULEBUILDER PROPERTIES + /** + * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields=array( + 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), + 'ref' =>array('type'=>'varchar(12)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>25), + 'label' =>array('type'=>'varchar(30)', 'label'=>'Label', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>30), + 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>35, 'index'=>1), + 'bank' =>array('type'=>'varchar(60)', 'label'=>'Bank', 'enabled'=>1, 'visible'=>-1, 'position'=>40), + 'code_banque' =>array('type'=>'varchar(128)', 'label'=>'Code banque', 'enabled'=>1, 'visible'=>-1, 'position'=>45), + 'code_guichet' =>array('type'=>'varchar(6)', 'label'=>'Code guichet', 'enabled'=>1, 'visible'=>-1, 'position'=>50), + 'number' =>array('type'=>'varchar(255)', 'label'=>'Number', 'enabled'=>1, 'visible'=>-1, 'position'=>55), + 'cle_rib' =>array('type'=>'varchar(5)', 'label'=>'Cle rib', 'enabled'=>1, 'visible'=>-1, 'position'=>60), + 'bic' =>array('type'=>'varchar(11)', 'label'=>'Bic', 'enabled'=>1, 'visible'=>-1, 'position'=>65), + 'iban_prefix' =>array('type'=>'varchar(34)', 'label'=>'Iban prefix', 'enabled'=>1, 'visible'=>-1, 'position'=>70), + 'country_iban' =>array('type'=>'varchar(2)', 'label'=>'Country iban', 'enabled'=>1, 'visible'=>-1, 'position'=>75), + 'cle_iban' =>array('type'=>'varchar(2)', 'label'=>'Cle iban', 'enabled'=>1, 'visible'=>-1, 'position'=>80), + 'domiciliation' =>array('type'=>'varchar(255)', 'label'=>'Domiciliation', 'enabled'=>1, 'visible'=>-1, 'position'=>85), + 'state_id' =>array('type'=>'integer', 'label'=>'State id', 'enabled'=>1, 'visible'=>-1, 'position'=>90), + 'fk_pays' =>array('type'=>'integer', 'label'=>'Fk pays', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>95), + 'proprio' =>array('type'=>'varchar(60)', 'label'=>'Proprio', 'enabled'=>1, 'visible'=>-1, 'position'=>100), + 'owner_address' =>array('type'=>'text', 'label'=>'Owner address', 'enabled'=>1, 'visible'=>-1, 'position'=>105), + 'courant' =>array('type'=>'smallint(6)', 'label'=>'Courant', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>110), + 'clos' =>array('type'=>'smallint(6)', 'label'=>'Clos', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>115), + 'rappro' =>array('type'=>'smallint(6)', 'label'=>'Rappro', 'enabled'=>1, 'visible'=>-1, 'position'=>120), + 'url' =>array('type'=>'varchar(128)', 'label'=>'Url', 'enabled'=>1, 'visible'=>-1, 'position'=>125), + 'account_number' =>array('type'=>'varchar(32)', 'label'=>'Account number', 'enabled'=>1, 'visible'=>-1, 'position'=>130), + 'accountancy_journal' =>array('type'=>'varchar(20)', 'label'=>'Accountancy journal', 'enabled'=>1, 'visible'=>-1, 'position'=>135), + 'currency_code' =>array('type'=>'varchar(3)', 'label'=>'Currency code', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>140), + 'min_allowed' =>array('type'=>'integer', 'label'=>'Min allowed', 'enabled'=>1, 'visible'=>-1, 'position'=>145), + 'min_desired' =>array('type'=>'integer', 'label'=>'Min desired', 'enabled'=>1, 'visible'=>-1, 'position'=>150), + 'comment' =>array('type'=>'text', 'label'=>'Comment', 'enabled'=>1, 'visible'=>-1, 'position'=>155), + 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>156), + 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>157), + 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>160), + 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>165), + 'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>170), + 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>175), + 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>180), + 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>185), + 'fk_accountancy_journal' =>array('type'=>'integer', 'label'=>'Fk accountancy journal', 'enabled'=>1, 'visible'=>-1, 'position'=>190), + ); + // END MODULEBUILDER PROPERTIES + /** * Current account */ diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 762ebe0fbcf..5831467ce63 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -239,6 +239,7 @@ if ($modecompta == 'CREANCES-DETTES') } $sql .= " WHERE l.fk_facture = f.rowid"; $sql .= " AND f.fk_statut in (1,2)"; + $sql .= " AND l.product_type in (0,1)"; if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (0,1,2,5)"; } else { diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 8d880226ff4..9cad793ba3d 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1348,7 +1348,7 @@ class Contact extends CommonObject } $result .= $linkstart; - if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip valigntextbottom"'), 0, 0, $notooltip ? 0 : 1); + 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 .= ($maxlen ?dol_trunc($this->getFullName($langs), $maxlen) : $this->getFullName($langs)); $result .= $linkend; diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index bffbfec9c50..e24bce5e247 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -149,7 +149,7 @@ class HookManager $parameters['context'] = join(':', $this->contextarray); //dol_syslog(get_class($this).'::executeHooks method='.$method." action=".$action." context=".$parameters['context']); - // Define type of hook ('output' or 'addreplace'. 'returnvalue' is deprecated because a 'addreplace' hook can also return resPrint and resArray). + // Define type of hook ('output' or 'addreplace'). Type 'returnvalue' is deprecated because a 'addreplace' hook can also return resPrint and resArray). $hooktype = 'output'; if (in_array( $method, @@ -199,6 +199,7 @@ class HookManager 'pdf_getlinetotalwithtax', 'paymentsupplierinvoices', 'printAddress', + 'printEmail', 'printSearchForm', 'printTabsHead', 'printObjectLine', diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 965bca72824..20f36998174 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6117,6 +6117,12 @@ class Form } if ($tmpfieldstoshow) $fieldstoshow = $tmpfieldstoshow; } + else + { + // For backward compatibility + $objecttmp->fields['ref']=array('type'=>'varchar(30)', 'label'=>'Ref', 'showoncombobox'=>1); + } + if (empty($fieldstoshow)) { if (isset($objecttmp->fields['ref'])) { @@ -7788,7 +7794,7 @@ class Form $(document).ready(function() { $("#checkallactions'.$id.'").click(function() { if($(this).is(\':checked\')){ - console.log("We check all"); + console.log("We check all '.$cssclass.'"); $(".'.$cssclass.'").prop(\'checked\', true).trigger(\'change\'); } else diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index de8c73db44a..092e36cef72 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2269,10 +2269,15 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64, } } - $rep = '
'.($withpicto ?img_picto($langs->trans("EMail").' : '.$email, 'object_email.png').' ' : '').$newemail.'
'; + //$rep = '
'; + $rep .= ($withpicto ?img_picto($langs->trans("EMail").' : '.$email, 'object_email.png').' ' : '').$newemail; + //$rep .= '
'; if ($hookmanager) { $parameters = array('cid' => $cid, 'socid' => $socid, 'addlink' => $addlink, 'picto' => $withpicto); $reshook = $hookmanager->executeHooks('printEmail', $parameters, $email); + if ($reshook > 0) { + $rep = ''; + } $rep .= $hookmanager->resPrint; } @@ -3134,13 +3139,14 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ if (empty($srconly) && in_array($pictowithouttext, array( '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', - 'address', 'bank_account', 'barcode', 'bank', 'bookmark', 'building', 'cash-register', 'check', 'close_title', 'cubes', 'delete', 'dolly', 'edit', 'ellipsis-h', + 'address', 'bank_account', 'barcode', 'bank', 'bookmark', 'building', 'cash-register', 'check', 'close_title', 'company', 'contact', 'cubes', + 'delete', 'dolly', 'edit', 'ellipsis-h', 'filter', 'file-code', 'folder', 'folder-open', 'grip', 'grip_title', 'help', 'language', 'list', 'listlight', 'note', 'object_action', 'object_account', 'object_barcode', 'object_phoning', 'object_phoning_fax', 'object_email', - 'object_bookmark', 'object_bug', 'object_generic', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', - 'object_cash-register', 'object_holiday', 'object_hrm', 'object_accounting', 'object_category', 'object_multicurrency', - 'object_printer', 'object_resource', 'object_technic', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_other', - 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'stats', 'trip', + 'object_accounting', 'object_category', 'object_bookmark', 'object_bug', 'object_generic', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', + 'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_holiday', 'object_hrm', 'object_multicurrency', 'object_payment', + 'object_paragraph', 'object_printer', 'object_resource', 'object_rss', 'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_other', + 'off', 'on', 'paiment', 'play', 'playdisabled', 'printer', 'resize', 'stats', 'trip', 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', 'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', @@ -3163,6 +3169,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $arrayconvpictotofa = array( 'account'=>'university', 'action'=>'calendar-alt', 'address'=> 'address-book', 'bank_account'=>'university', + 'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accountancy'=>'money-check-alt', 'accounting'=>'chart-line', 'category'=>'tag', 'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', @@ -3175,7 +3182,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table', 'multicurrency'=>'dollar-sign', 'other'=>'square', 'resource'=>'laptop-house', 'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle', - 'phoning'=>'phone', 'phoning_fax'=>'fax', 'printer'=>'print', 'technic'=>'cogs', + 'payment'=>'money-bill-alt', 'phoning'=>'phone', 'phoning_fax'=>'fax', 'printer'=>'print', 'technic'=>'cogs', 'ticket'=>'ticket-alt', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt', 'playdisabled'=>'play', 'preview'=>'binoculars', 'project'=>'sitemap', 'resize'=>'crop', @@ -3229,13 +3236,14 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ // Add CSS $arrayconvpictotomorcess = array( 'action'=>'bg-infoxbox-action', 'account'=>'bg-infoxbox-bank_account', 'bank_account'=>'bg-infoxbox-bank_account', 'cash-register'=>'bg-infoxbox-bank_account', + 'contract'=>'bg-infoxbox-contrat', 'multicurrency'=>'bg-infoxbox-bank_account', 'check'=>'font-status4', 'hrm'=>'bg-infoxbox-adherent', 'group'=>'bg-infoxbox-adherent', 'members'=>'bg-infoxbox-adherent', 'member'=>'bg-infoxbox-adherent', 'user'=>'bg-infoxbox-adherent', 'users'=>'bg-infoxbox-adherent', 'error'=>'pictoerror', 'warning'=>'pictowarning', 'switch_on'=>'font-status4', - 'holiday'=>'bg-infoxbox-holiday', 'project'=>'bg-infoxbox-project', 'resource'=>'bg-infoxbox-action', 'title_hrm'=>'bg-infoxbox-holiday', 'trip'=>'bg-infoxbox-expensereport', - 'title_agenda'=>'bg-infoxbox-action', + 'holiday'=>'bg-infoxbox-holiday', 'payment'=>'bg-infoxbox-bank_account', 'project'=>'bg-infoxbox-project', 'resource'=>'bg-infoxbox-action', + 'ticket'=>'bg-infoxbox-contrat', 'title_hrm'=>'bg-infoxbox-holiday', 'trip'=>'bg-infoxbox-expensereport', 'title_agenda'=>'bg-infoxbox-action', 'list-alt'=>'imgforviewmode', 'calendar'=>'imgforviewmode', 'calendarweek'=>'imgforviewmode', 'calendarmonth'=>'imgforviewmode', 'calendarday'=>'imgforviewmode', 'calendarperuser'=>'imgforviewmode' ); if (!empty($arrayconvpictotomorcess[$pictowithouttext])) { @@ -3244,9 +3252,9 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ // Define $color $arrayconvpictotocolor = array( - 'edit'=>'#444', 'note'=>'#999', 'error'=>'', 'listlight'=>'#999', + 'address'=>'#37a', 'building'=>'#37a', 'companies'=>'#37a', 'company'=>'#37a', 'contact'=>'#37a', 'edit'=>'#444', 'note'=>'#999', 'error'=>'', 'listlight'=>'#999', 'other'=>'#ddd', - 'playdisabled'=>'#ccc', 'printer'=>'#444', 'resize'=>'#444', + 'playdisabled'=>'#ccc', 'printer'=>'#444', 'resize'=>'#444', 'rss'=>'#cba', 'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'warning'=>'' ); if (isset($arrayconvpictotocolor[$pictowithouttext])) { diff --git a/htdocs/core/modules/modFckeditor.class.php b/htdocs/core/modules/modFckeditor.class.php index 541615065bb..8f2d164e9ca 100644 --- a/htdocs/core/modules/modFckeditor.class.php +++ b/htdocs/core/modules/modFckeditor.class.php @@ -54,7 +54,7 @@ class modFckeditor extends DolibarrModules $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Name of png file (without png) used for this module. // Png file must be in theme/yourtheme/img directory under name object_pictovalue.png. - $this->picto = 'list'; + $this->picto = 'paragraph'; // Data directories to create when module is enabled $this->dirs = array("/medias/temp", "/medias/image"); diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php index 0a3ff8f5591..7159ca634d5 100644 --- a/htdocs/core/modules/modSalaries.class.php +++ b/htdocs/core/modules/modSalaries.class.php @@ -62,7 +62,7 @@ class modSalaries extends DolibarrModules $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); - $this->picto = 'bill'; + $this->picto = 'payment'; // Data directories to create when module is enabled $this->dirs = array("/salaries/temp"); diff --git a/htdocs/fichinter/class/api_interventions.class.php b/htdocs/fichinter/class/api_interventions.class.php index 7dd6045b19b..4f81930355e 100644 --- a/htdocs/fichinter/class/api_interventions.class.php +++ b/htdocs/fichinter/class/api_interventions.class.php @@ -21,7 +21,7 @@ require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; /** - * API class for fichinters + * API class for Interventions * * @access protected * @class DolibarrApiAccess {@requires user,external} diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 118e21a841c..ff88847140b 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -202,7 +202,7 @@ class Fichinter extends CommonObject { while ($obj = $this->db->fetch_object($resql)) { - $this->nb["fichinters"] = $obj->nb; + $this->nb["interventions"] = $obj->nb; } $this->db->free($resql); return 1; diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php index 787a0379cfa..679d231d6a8 100644 --- a/htdocs/fichinter/class/fichinterrec.class.php +++ b/htdocs/fichinter/class/fichinterrec.class.php @@ -43,6 +43,11 @@ class FichinterRec extends Fichinter public $table_element_line = 'fichinter_rec'; public $fk_element = 'fk_fichinter'; + /** + * {@inheritdoc} + */ + protected $table_ref_field = 'titre'; + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 515a86a9331..bc86076644c 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1085,7 +1085,7 @@ if (empty($reshook)) if ($action == 'add' && $user->rights->fournisseur->commande->creer) { $error = 0; - + $selectedLines = GETPOST('toselect', 'array'); if ($socid < 1) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('Supplier')), null, 'errors'); @@ -1177,7 +1177,7 @@ if (empty($reshook)) for ($i = 0; $i < $num; $i++) { - if (empty($lines[$i]->subprice) || $lines[$i]->qty <= 0) + if (empty($lines[$i]->subprice) || $lines[$i]->qty <= 0 || !in_array($lines[$i]->id, $selectedLines)) continue; $label = (!empty($lines[$i]->label) ? $lines[$i]->label : ''); @@ -1755,7 +1755,7 @@ if ($action == 'create') print ''; print ''; - print "\n"; + // Show origin lines if (!empty($origin) && !empty($originid) && is_object($objectsrc)) @@ -1765,10 +1765,11 @@ if ($action == 'create') print '
".$langs->trans("LogEvents")."
'.$arr['id'].''; + print ''; $key = 'MAIN_LOGEVENTS_'.$arr['id']; $value = $conf->global->$key; - print ''; + print ''; print '
'; - print img_object('', $picto, 'class="pictoobjectwidth"').' '.$objMod->getName(); + print img_object('', $picto, 'class="pictoobjectwidth paddingright"').' '.$objMod->getName(); print ''; print ' '; - //print img_object('', $picto, 'class="pictoobjectwidth"').' '.$objMod->getName(); - //print ' '; print '
'; - $objectsrc->printOriginLinesList(); + $objectsrc->printOriginLinesList('', $selectedLines); print '
'; } + print "\n"; } elseif (!empty($object->id)) { diff --git a/htdocs/index.php b/htdocs/index.php index 110de972f2b..24330736287 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -108,7 +108,6 @@ if (!empty($conf->global->MAIN_MOTD)) * Hidden for external users */ - $boxstatItems = array(); $boxstatFromHook = ''; @@ -128,26 +127,27 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) { // Condition to be checked for each display line dashboard $conditions = array( - $user->rights->user->user->lire, - !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS), - !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS), - !empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS), - !empty($conf->societe->enabled) && $user->rights->societe->contact->lire, - !empty($conf->adherent->enabled) && $user->rights->adherent->lire, - !empty($conf->product->enabled) && $user->rights->produit->lire, - !empty($conf->service->enabled) && $user->rights->service->lire, - !empty($conf->propal->enabled) && $user->rights->propale->lire, - !empty($conf->commande->enabled) && $user->rights->commande->lire, - !empty($conf->facture->enabled) && $user->rights->facture->lire, - !empty($conf->contrat->enabled) && $user->rights->contrat->lire, - !empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire, - !empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS), - !empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS), - !empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS), - !empty($conf->projet->enabled) && $user->rights->projet->lire, - !empty($conf->expensereport->enabled) && $user->rights->expensereport->lire, - !empty($conf->holiday->enabled) && $user->rights->holiday->read, - !empty($conf->don->enabled) && $user->rights->don->lire + $user->rights->user->user->lire, + !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS), + !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS), + !empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS), + !empty($conf->societe->enabled) && $user->rights->societe->contact->lire, + !empty($conf->adherent->enabled) && $user->rights->adherent->lire, + !empty($conf->product->enabled) && $user->rights->produit->lire, + !empty($conf->service->enabled) && $user->rights->service->lire, + !empty($conf->propal->enabled) && $user->rights->propale->lire, + !empty($conf->commande->enabled) && $user->rights->commande->lire, + !empty($conf->facture->enabled) && $user->rights->facture->lire, + !empty($conf->contrat->enabled) && $user->rights->contrat->lire, + !empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire, + !empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS), + !empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS), + !empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS), + !empty($conf->projet->enabled) && $user->rights->projet->lire, + !empty($conf->expensereport->enabled) && $user->rights->expensereport->lire, + !empty($conf->holiday->enabled) && $user->rights->holiday->read, + !empty($conf->don->enabled) && $user->rights->don->lire, + !empty($conf->ticket->enabled) && $user->rights->ticket->read ); // Class file containing the method load_state_board for each line $includes = array( @@ -170,7 +170,8 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) DOL_DOCUMENT_ROOT."/projet/class/project.class.php", DOL_DOCUMENT_ROOT."/expensereport/class/expensereport.class.php", DOL_DOCUMENT_ROOT."/holiday/class/holiday.class.php", - DOL_DOCUMENT_ROOT."/don/class/don.class.php" + DOL_DOCUMENT_ROOT."/don/class/don.class.php", + DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php" ); // Name class containing the method load_state_board for each line $classes = array('User', @@ -192,7 +193,8 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) 'Project', 'ExpenseReport', 'Holiday', - 'Don' + 'Don', + 'Ticket', ); // Cle array returned by the method load_state_board for each line $keys = array('users', @@ -206,15 +208,16 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) 'proposals', 'orders', 'invoices', - 'Contracts', - 'fichinters', + 'contracts', + 'interventions', 'supplier_orders', 'supplier_invoices', 'askprice', 'projects', 'expensereports', 'holidays', - 'donations' + 'donations', + 'ticket' ); // Dashboard Icon lines $icons = array('user', @@ -228,15 +231,16 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) 'propal', 'order', 'bill', - 'order', - 'order', + 'contract', + 'intervention', 'order', 'bill', 'propal', 'projectpub', 'trip', 'holiday', - 'generic' + 'generic', + 'ticket', ); // Translation keyword $titres = array("Users", @@ -258,7 +262,8 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) "Projects", "ExpenseReports", "Holidays", - "Donations" + "Donations", + "Ticket", ); // Dashboard Link lines $links = array( @@ -282,7 +287,8 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) DOL_URL_ROOT.'/projet/list.php?mainmenu=project', DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&leftmenu=expensereport', DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm&leftmenu=holiday', - DOL_URL_ROOT.'/don/list.php?leftmenu=donations' + DOL_URL_ROOT.'/don/list.php?leftmenu=donations', + DOL_URL_ROOT.'/ticket/list.php?leftmenu=ticket' ); // Translation lang files $langfile = array( @@ -306,12 +312,13 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) "trips", "holiday", "donations", + "ticket" ); // Loop and displays each line of table $boardloaded = array(); - foreach ($keys as $key=>$val) + foreach ($keys as $key => $val) { if ($conditions[$key]) { @@ -331,7 +338,6 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) $board = $boardloaded[$classe]; } - if (!empty($langfile[$key])) $langs->load($langfile[$key]); $text = $langs->trans($titres[$key]); $boxstatItem .= ''; @@ -415,7 +421,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $dashboardlines[$board->element.'_awaiting'] = $board->load_board($user, 'awaiting'); } - // Number of services enabled (delayed) + // Number of contract / services enabled (delayed) if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; $board = new Contrat($db); @@ -423,6 +429,16 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { // Number of active services (expired) $dashboardlines[$board->element.'_active'] = $board->load_board($user, "active"); } + + // Number of tickets open + if (!empty($conf->ticket->enabled) && $user->rights->ticket->read) { + include_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; + $board = new Ticket($db); + $dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened"); + // Number of active services (expired) + //$dashboardlines[$board->element.'_active'] = $board->load_board($user, "active"); + } + // Number of invoices customers (has paid) if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; @@ -526,13 +542,6 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { 'stats' => array('facture'), ), - 'contrat' => - array( - 'groupName' => 'Contracts', - 'globalStatsKey' => 'Contracts', - 'stats' => - array('contrat_inactive', 'contrat_active'), - ), 'supplier_proposal' => array( 'groupName' => 'SupplierProposals', @@ -554,7 +563,21 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { 'stats' => array('invoice_supplier'), ), - 'bank_account' => + 'contrat' => + array( + 'groupName' => 'Contracts', + 'globalStatsKey' => 'Contracts', + 'stats' => + array('contrat_inactive', 'contrat_active'), + ), + 'ticket' => + array( + 'groupName' => 'Tickets', + 'globalStatsKey' => 'OpenTickets', + 'stats' => + array('ticket_opened'), + ), + 'bank_account' => array( 'groupName' => 'BankAccount', 'stats' => @@ -587,8 +610,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $parameters = array( 'dashboardgroup' => $dashboardgroup ); - $reshook = $hookmanager->executeHooks('addOpenElementsDashboardGroup', $parameters, $object, - $action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('addOpenElementsDashboardGroup', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook == 0) { $dashboardgroup = array_merge($dashboardgroup, $hookmanager->resArray); } diff --git a/htdocs/install/mysql/tables/llx_blockedlog.sql b/htdocs/install/mysql/tables/llx_blockedlog.sql index 80a4c150150..889b28d7a73 100644 --- a/htdocs/install/mysql/tables/llx_blockedlog.sql +++ b/htdocs/install/mysql/tables/llx_blockedlog.sql @@ -33,7 +33,7 @@ CREATE TABLE llx_blockedlog signature varchar(100) NOT NULL, signature_line varchar(100) NOT NULL, object_data mediumtext, - object_version varchar(32) DEFAULT ''; + object_version varchar(32) DEFAULT '', certified integer ) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_categorie_website_page.key.sql b/htdocs/install/mysql/tables/llx_categorie_website_page.key.sql index b2af52d8fe9..f819663fd31 100644 --- a/htdocs/install/mysql/tables/llx_categorie_website_page.key.sql +++ b/htdocs/install/mysql/tables/llx_categorie_website_page.key.sql @@ -16,9 +16,9 @@ -- -- ============================================================================ -ALTER TABLE llx_categorie_website_page ADD PRIMARY KEY pk_categorie_website_page (fk_categorie, fk_websitepage); +ALTER TABLE llx_categorie_website_page ADD PRIMARY KEY pk_categorie_website_page (fk_categorie, fk_website_page); ALTER TABLE llx_categorie_website_page ADD INDEX idx_categorie_website_page_fk_categorie (fk_categorie); -ALTER TABLE llx_categorie_website_page ADD INDEX idx_categorie_website_page_fk_website_page (fk_websitepage); +ALTER TABLE llx_categorie_website_page ADD INDEX idx_categorie_website_page_fk_website_page (fk_website_page); ALTER TABLE llx_categorie_website_page ADD CONSTRAINT fk_categorie_websitepage_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid); ALTER TABLE llx_categorie_website_page ADD CONSTRAINT fk_categorie_websitepage_website_page_rowid FOREIGN KEY (fk_website_page) REFERENCES llx_website_page (rowid); diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index c569a48c84a..609ea0efdf2 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -325,7 +325,6 @@ CompanyDeleted=Company "%s" deleted from database. ListOfContacts=List of contacts/addresses ListOfContactsAddresses=List of contacts/addresses ListOfThirdParties=List of Third Parties -ShowCompany=Show Third Party ShowContact=Show contact ContactsAllShort=All (No filter) ContactType=Contact type diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 88e18c62943..0ea2940911b 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -236,6 +236,7 @@ ErrorBatchNoFoundForProductInWarehouse=No lot/serial found for product "%s" in w ErrorBatchNoFoundEnoughQuantityForProductInWarehouse=No enough quantity for this lot/serial for product "%s" in warehouse "%s". ErrorOnlyOneFieldForGroupByIsPossible=Only 1 field for the 'Group by' is possible (others are discarded) ErrorTooManyDifferentValueForSelectedGroupBy=Found too many different value (more than %s) for the field '%s', so we can't user it as a 'Group by' for graphics. The field 'Group By' has been removed. May be you wanted to use it as an X-Axis ? +ErrorReplaceStringEmpty=Error, the string to replace into is empty # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user. diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 7a9a00cd3c2..58ea57dd3ad 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -317,6 +317,7 @@ if ($id > 0 || !empty($ref)) print load_fiche_titre($langs->trans("ProductAssociationList"), '', ''); print '
'; + print ''; print ''; print ''; diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index 4b3d181517d..8c022457f88 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -215,7 +215,7 @@ if ($action == "view_ticketlist") 't.date_close' => array('label' => $langs->trans("TicketCloseOn"), 'checked' => 0), 't.ref' => array('label' => $langs->trans("Ref"), 'checked' => 1), //'t.track_id' => array('label' => $langs->trans("IDTracking"), 'checked' => 0), - 't.fk_statut' => array('label' => $langs->trans("Statut"), 'checked' => 1), + 't.fk_statut' => array('label' => $langs->trans("Status"), 'checked' => 1), 't.subject' => array('label' => $langs->trans("Subject"), 'checked' => 1), 'type.code' => array('label' => $langs->trans("Type"), 'checked' => 1), 'category.code' => array('label' => $langs->trans("Category"), 'checked' => 1), diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 6426d9ab98b..6c5889b89fe 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2407,7 +2407,7 @@ class Societe extends CommonObject // By default if (empty($linkstart)) { - $label .= ''.$langs->trans("ShowCompany").''; + $label .= ''.$langs->trans("ThirdParty").''; $linkstart = 'picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); if ($withpicto != 2) $result .= ($maxlen ?dol_trunc($name, $maxlen) : $name); $result .= $linkend; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index a1ca78fe67a..3d72fb1cdd3 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1148,7 +1148,7 @@ while ($i < min($num, $limit)) } if (!empty($arrayfields['s.email']['checked'])) { - print "".dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 18)."\n"; + print ''.dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 0, 0, 1)."\n"; if (!$i) $totalarray['nbfield']++; } if (!empty($arrayfields['s.phone']['checked'])) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 2f7d4b39cf3..21c7ea4c6dc 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2436,7 +2436,7 @@ class SupplierProposal extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Charge indicateurs this->nb de tableau de bord + * Load indicator this->nb of global stats widget * * @return int <0 if ko, >0 if ok */ diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php index 79d6277c761..83b31569a7b 100644 --- a/htdocs/takepos/admin/receipt.php +++ b/htdocs/takepos/admin/receipt.php @@ -155,7 +155,7 @@ print "\n"; if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { print ''; - print $langs->trans("IPAddress").' ('.$langs->trans("TakeposConnectorNecesary").')'; + print $langs->trans("URL")." / ".$langs->trans("IPAddress").' ('.$langs->trans("TakeposConnectorNecesary").')'; print ''; print ''; print ''; diff --git a/htdocs/takepos/css/colorful.css b/htdocs/takepos/css/colorful.css index 298a29ce4cf..4df43a70334 100644 --- a/htdocs/takepos/css/colorful.css +++ b/htdocs/takepos/css/colorful.css @@ -31,3 +31,7 @@ tr.selected, tr.selected td { .topnav{ background: rgb(0,0,0) !important; } + +.fa-trash { + color: #fff !important; +} diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 4f5ef29bc70..f9a3c725032 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -648,14 +648,14 @@ function MoreActions(totalactions){ if (pageactions==0){ pageactions=1; for (i = 0; i <= totalactions; i++){ - if (i<9) $("#action"+i).hide(); + if (i<12) $("#action"+i).hide(); else $("#action"+i).show(); } } else if (pageactions==1){ pageactions=0; for (i = 0; i <= totalactions; i++){ - if (i<9) $("#action"+i).show(); + if (i<12) $("#action"+i).show(); else $("#action"+i).hide(); } } @@ -874,7 +874,8 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) if ($conf->global->TAKEPOS_BAR_RESTAURANT) { if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { - $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'TakeposPrinting(placeid);'); + if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'TakeposConnector(placeid);'); + else $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'TakeposPrinting(placeid);'); } elseif ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { $menus[$r++] = array('title'=>'
'.$langs->trans("Receipt").'
', 'action'=>'DolibarrTakeposPrinting(placeid);'); } else { @@ -935,12 +936,12 @@ if (!empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { foreach ($menus as $menu) { $i++; - if (count($menus) > 9 and $i == 9) + if (count($menus) > 12 and $i == 12) { echo ''; echo ''; } - elseif ($i > 9) echo ''; + elseif ($i > 12) echo ''; else echo ''; } diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 95766802b76..e925c5aae9b 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -344,7 +344,7 @@ if ($action == "addline") $idoflineadded = $invoice->addline($prod->description, $price, 1, $tva_tx, $localtax1_tx, $localtax2_tx, $idproduct, $customer->remise_percent, '', 0, 0, 0, '', $price_base_type, $price_ttc, $prod->type, -1, 0, '', 0, $parent_line, null, '', '', 0, 100, '', null, 0); } - $invoice->fetch($placeid); + $invoice->fetch($placeid); } if ($action == "freezone") { @@ -590,7 +590,8 @@ if ($action == "valid" || $action == "history") } $sectionwithinvoicelink .= ''; if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { - $sectionwithinvoicelink .= ' '; + if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) $sectionwithinvoicelink .= ' '; + else $sectionwithinvoicelink .= ' '; } elseif ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { $sectionwithinvoicelink .= ' '; } else { @@ -708,6 +709,20 @@ function TakeposPrinting(id){ }); }); } + +function TakeposConnector(id){ + var invoice=''; + $.ajax({ + type: "POST", + url: 'global->TAKEPOS_PRINT_SERVER; ?>/print.php', + data: 'invoice='+invoice + }); +} + function DolibarrTakeposPrinting(id) { console.log('Printing invoice ticket ' + id) $.ajax({ diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 4e77fc7fe2d..3bf20f74c4e 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1573,7 +1573,7 @@ div.nopadding { td.nobordernopadding.widthpictotitle.col-picto { color: var(--colortexttitlenotab); - opacity: 0.7; + opacity: 0.85; } .pictotitle { margin-: 8px; @@ -3826,8 +3826,8 @@ div.boximport { .fieldrequired { font-weight: bold; color: var(--fieldrequiredcolor); } -.widthpictotitle { width: 32px; text-align: ; } -span.widthpictotitle { font-size: 2em; }; +.widthpictotitle { width: 26px; text-align: ; } +span.widthpictotitle { font-size: 1.7em; }; .dolgraphtitle { margin-top: 6px; margin-bottom: 4px; } .dolgraphtitlecssboxes { /* margin: 0px; */ } diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 9f958943080..312521fe829 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -77,7 +77,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> max-width: 100%; } .info-box-module .info-box-icon > img { - max-width: 50%; + max-width: 55%; } .info-box-icon-text{ @@ -220,11 +220,11 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES .bg-infoxbox-order_supplier{ color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; } -.bg-infoxbox-contrat{ - color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; +.bg-infoxbox-contrat, .bg-infoxbox-ticket{ + color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; } .bg-infoxbox-bank_account{ - color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; + color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; } .bg-infoxbox-adherent{ color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; @@ -258,6 +258,9 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES .fa-dol-contrat:before { content: "\f1e6"; } +.fa-dol-ticket:before { + content: "\f3ff"; +} .fa-dol-bank_account:before { content: "\f19c"; } @@ -297,37 +300,6 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES color : #b91f1f; } -/* USING IMAGES FOR WEATHER INTEAD OF FONT AWESOME */ -/* For other themes just uncomment this part */ -/*.info-box-weather-level0, -.info-box-weather-level1, -.info-box-weather-level2, -.info-box-weather-level3, -.info-box-weather-level4 { - background-position: 15px 50%; - background-repeat: no-repeat; -} - -.info-box-weather .info-box-icon{ - display: none !important; -} -.info-box-weather-level0 { - background-image: url("img/weather/weather-clear.png"); -} -.info-box-weather-level1 { - background-image: url("img/weather/weather-few-clouds.png"); -} -.info-box-weather-level2 { - background-image: url("img/weather/weather-clouds.png"); -} -.info-box-weather-level3 { - background-image: url("img/weather/weather-many-clouds.png"); -} -.info-box-weather-level4 { - background-image: url("img/weather/weather-storm.png"); -}*/ - - .box-flex-container{ display: flex; /* or inline-flex */ diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php index 6104c623c00..ad1f037ab1e 100644 --- a/htdocs/theme/md/info-box.inc.php +++ b/htdocs/theme/md/info-box.inc.php @@ -61,7 +61,7 @@ span.info-box-icon-text { /* hide box text number due to problems */ max-width: 100%; } .info-box-module .info-box-icon > img { - max-width: 50%; + max-width: 55%; } .info-box-content { padding: 5px 10px; @@ -126,11 +126,11 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES .bg-infoxbox-order_supplier i.fa{ color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; } -.bg-infoxbox-contrat i.fa{ +.bg-infoxbox-contrat i.fa, .bg-infoxbox-ticket i.fa{ color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; } .bg-infoxbox-bank_account i.fa{ - color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; + color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; } .bg-infoxbox-adherent i.fa{ color: global->THEME_AGRESSIVENESS_RATIO); ?> !important; diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index d59581fa914..8b8ba741ad3 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -742,7 +742,9 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd $head = societe_prepare_head($object->thirdparty); dol_fiche_head($head, 'ticket', $langs->trans("ThirdParty"), 0, 'company'); + dol_banner_tab($object->thirdparty, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom'); + dol_fiche_end(); } @@ -790,7 +792,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd if (!empty($conf->projet->enabled)) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project'); + $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->ticket->write) { if ($action != 'classify') diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index d4f080bc3e2..8ee299f6f78 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2781,6 +2781,122 @@ class Ticket extends CommonObject setEventMessages($langs->trans('ErrorMailRecipientIsEmptyForSendTicketMessage'), null, 'warnings'); } } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load indicators for dashboard (this->nbtodo and this->nbtodolate) + * + * @param User $user Object user + * @param int $mode "opened" for askprice to close, "signed" for proposal to invoice + * @return int <0 if KO, >0 if OK + */ + public function load_board($user, $mode) + { + // phpcs:enable + global $conf, $user, $langs; + + $now = dol_now(); + + $this->nbtodo = $this->nbtodolate = 0; + $clause = " WHERE"; + + $sql = "SELECT p.rowid, p.ref, p.datec as datec"; + $sql .= " FROM ".MAIN_DB_PREFIX."ticket as p"; + if (!$user->rights->societe->client->voir && !$user->socid) + { + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON p.fk_soc = sc.fk_soc"; + $sql .= " WHERE sc.fk_user = ".$user->id; + $clause = " AND"; + } + $sql .= $clause." p.entity IN (".getEntity('ticket').")"; + if ($mode == 'opened') $sql .= " AND p.fk_statut in (".Ticket::STATUS_CLOSED.", ".Ticket::STATUS_CANCELED.")"; + if ($user->socid) $sql .= " AND p.fk_soc = ".$user->socid; + + $resql = $this->db->query($sql); + if ($resql) + { + $label = $labelShort = ''; + $status = ''; + if ($mode == 'opened') { + $status = 'openall'; + //$delay_warning = $conf->ticket->warning_delay; + $delay_warning = 0; + $label = $langs->trans("MenuListNonClosed"); + $labelShort = $langs->trans("MenuListNonClosed"); + } + + $response = new WorkboardResponse(); + $response->warning_delay = $delay_warning / 60 / 60 / 24; + $response->label = $label; + $response->labelShort = $labelShort; + $response->url = DOL_URL_ROOT.'/ticket/list.php?search_fk_statut[]='.$status; + $response->img = img_object('', "ticket"); + + // This assignment in condition is not a bug. It allows walking the results. + while ($obj = $this->db->fetch_object($resql)) + { + $response->nbtodo++; + if ($mode == 'opened') + { + $datelimit = $this->db->jdate($obj->datefin); + if ($datelimit < ($now - $delay_warning)) + { + //$response->nbtodolate++; + } + } + } + return $response; + } + else + { + $this->error = $this->db->lasterror(); + return -1; + } + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load indicator this->nb of global stats widget + * + * @return int <0 if ko, >0 if ok + */ + public function load_state_board() + { + // phpcs:enable + global $conf, $user; + + $this->nb = array(); + $clause = "WHERE"; + + $sql = "SELECT count(p.rowid) as nb"; + $sql .= " FROM ".MAIN_DB_PREFIX."ticket as p"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON p.fk_soc = s.rowid"; + if (!$user->rights->societe->client->voir && !$user->socid) + { + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; + $sql .= " WHERE sc.fk_user = ".$user->id; + $clause = "AND"; + } + $sql .= " ".$clause." p.entity IN (".getEntity('ticket').")"; + + $resql = $this->db->query($sql); + if ($resql) + { + // This assignment in condition is not a bug. It allows walking the results. + while ($obj = $this->db->fetch_object($resql)) + { + $this->nb["ticket"] = $obj->nb; + } + $this->db->free($resql); + return 1; + } + else + { + dol_print_error($this->db); + $this->error = $this->db->lasterror(); + return -1; + } + } } diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 8201e673d9f..15e019dd311 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -787,8 +787,8 @@ if (!empty($id) || !empty($ref)) print ''.$prodstatic->getLibStatut(2, 0).''; print ''.$prodstatic->getLibStatut(2, 1).''; print ''; - print ''.img_edit().''; - print ''.img_delete().''; + print 'id.'">'.img_edit().''; + print 'id.'">'.img_delete().''; print ''; print ''; if ($productCombinations || $massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 629e4b91584..c724ab4e3cf 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -369,7 +369,11 @@ if (($action == 'replacesite' || $action == 'replacesiteconfirm') && ! $searchke if ($massaction == 'replace') { $replacestring = GETPOST('replacestring', 'alphanohtml'); - if (! $replacestring) { + + if (empty($user->rights->website->writephp)) { + setEventMessages("NotAllowedToAddDynamicContent", null, 'errors'); + } + elseif (! $replacestring) { setEventMessages("ErrorReplaceStringEmpty", null, 'errors'); } else { @@ -3531,12 +3535,8 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = $permissiontodelete = 0; // List of mass actions available - $arrayofmassactions = array( - //'validate'=>$langs->trans("Validate"), - //'generate_doc'=>$langs->trans("ReGeneratePDF"), - //'builddoc'=>$langs->trans("PDFMerge"), - 'replace'=>$langs->trans("Replace"), - ); + $arrayofmassactions = array(); + if ($user->rights->website->writephp) $arrayofmassactions['replace'] = $langs->trans("Replace"); if ($permissiontodelete) $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); $massactionbutton = $form->selectMassAction('', $arrayofmassactions);