diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index 4d5cc2be274f8..b16e9047b26a6 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -96,6 +96,7 @@ $menu->perms=GETPOST('perms','alpha'); $menu->target=GETPOST('target','alpha'); $menu->user=GETPOST('user','alpha'); + $menu->mainmenu=GETPOST('propertymainmenu','alpha'); if (is_numeric(GETPOST('menuIdParent','alpha'))) { $menu->fk_menu=GETPOST('menuIdParent','alpha'); @@ -123,14 +124,11 @@ setEventMessages($menu->error, $menu->errors, 'errors'); } $action = "edit"; - } - else - { + header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".$menu_handler); exit; } - - if ($_GET['return']) + else { header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".$menu_handler); exit; @@ -215,6 +213,7 @@ $menu->perms=GETPOST('perms','alpha'); $menu->target=GETPOST('target','alpha'); $menu->user=GETPOST('user','alpha'); + $menu->mainmenu=GETPOST('propertymainmenu','alpha'); if (is_numeric(GETPOST('menuId','int'))) { $menu->fk_menu=GETPOST('menuId','int'); @@ -289,10 +288,13 @@ function init_topleft() { jQuery("#menuId").prop("disabled", true); jQuery("#menuId").val(\'\'); + jQuery("#propertymainmenu").removeAttr("disabled"); + jQuery("#propertymainmenu").val(\'\'); } - else + if (jQuery("#topleft").val() == \'left\') { jQuery("#menuId").removeAttr("disabled"); + jQuery("#propertymainmenu").prop("disabled", true); } } init_topleft(); @@ -338,7 +340,7 @@ function init_topleft() print ''; print ''.$langs->trans('DetailMenuHandler').''; - //User + // User print ''.$langs->trans('MenuForUsers').''; print ''; } - // print ''; print ''.$langs->trans('DetailType').''; + // Mainmenu code + print ''.$langs->trans('MainMenuCode').''; + print ''; + print ''; + print $langs->trans("Example").': mytopmenukey'; + print ''; + // MenuId Parent print ''.$langs->trans('MenuIdParent').''; if ($parent_rowid) @@ -373,23 +381,23 @@ function init_topleft() } else { - print ''; + print ''; } print ''.$langs->trans('DetailMenuIdParent'); print ', '.$langs->trans("Example").': fk_mainmenu=abc&fk_leftmenu=def'; print ''; // Title - print ''.$langs->trans('Title').''.$langs->trans('DetailTitre').''; + print ''.$langs->trans('Title').''.$langs->trans('DetailTitre').''; // URL - print ''.$langs->trans('URL').''.$langs->trans('DetailUrl').''; + print ''.$langs->trans('URL').''.$langs->trans('DetailUrl').''; // Langs - print ''.$langs->trans('LangFile').''.$langs->trans('DetailLangs').''; + print ''.$langs->trans('LangFile').''.$langs->trans('DetailLangs').''; // Position - print ''.$langs->trans('Position').''.$langs->trans('DetailPosition').''; + print ''.$langs->trans('Position').''.$langs->trans('DetailPosition').''; // Target print ''.$langs->trans('Target').''.$langs->trans('DetailTarget').''; // Enabled - print ''.$langs->trans('Enabled').''.$langs->trans('DetailEnabled').''; + print ''.$langs->trans('Enabled').''.$langs->trans('DetailEnabled').''; // Perms - print ''.$langs->trans('Rights').''.$langs->trans('DetailRight').''; + print ''.$langs->trans('Rights').''.$langs->trans('DetailRight').''; print ''; @@ -455,13 +463,30 @@ function init_topleft() // Type print ''.$langs->trans('Type').''.$langs->trans(ucfirst($menu->type)).''.$langs->trans('DetailType').''; + // Mainmenu code + if ($menu->type == 'top') + { + print ''.$langs->trans('MainMenuCode').''; + /*if ($parent_rowid) + { + print ''.$parent_rowid.''; + } + else + {*/ + print 'mainmenu).'">'; + //} + print ''; + print $langs->trans("Example").': mytopmenukey'; + print ''; + } + // MenuId Parent print ''.$langs->trans('MenuIdParent'); print ''; $valtouse=$menu->fk_menu; if ($menu->fk_mainmenu) $valtouse='fk_mainmenu='.$menu->fk_mainmenu; if ($menu->fk_leftmenu) $valtouse.='&fk_leftmenu='.$menu->fk_leftmenu; - print ''; + print ''; print ''.$langs->trans('DetailMenuIdParent'); print ', '.$langs->trans("Example").': fk_mainmenu=abc&fk_leftmenu=def'; print ''; @@ -470,16 +495,16 @@ function init_topleft() //print ''.$langs->trans('Level').''.$menu->level.''.$langs->trans('DetailLevel').''; // Title - print ''.$langs->trans('Title').''.$langs->trans('DetailTitre').''; + print ''.$langs->trans('Title').''.$langs->trans('DetailTitre').''; // Url print ''.$langs->trans('URL').''.$langs->trans('DetailUrl').''; // Langs - print ''.$langs->trans('LangFile').''.$langs->trans('DetailLangs').''; + print ''.$langs->trans('LangFile').''.$langs->trans('DetailLangs').''; // Position - print ''.$langs->trans('Position').''.$langs->trans('DetailPosition').''; + print ''.$langs->trans('Position').''.$langs->trans('DetailPosition').''; // Target print ''.$langs->trans('Target').''.$langs->trans('DetailTarget').''; // Enabled - print ''.$langs->trans('Enabled').''.$langs->trans('DetailEnabled'); + print ''.$langs->trans('Enabled').''.$langs->trans('DetailEnabled'); if (! empty($menu->enabled)) print ' ('.$langs->trans("ConditionIsCurrently").': '.yn(dol_eval($menu->enabled,1)).')'; print ''; // Perms - print ''.$langs->trans('Rights').''.$langs->trans('DetailRight'); + print ''.$langs->trans('Rights').''.$langs->trans('DetailRight'); if (! empty($menu->perms)) print ' ('.$langs->trans("ConditionIsCurrently").': '.yn(dol_eval($menu->perms,1)).')'; print ''; diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 57d6adc1ba970..cc920e3d12411 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -329,14 +329,16 @@ // Si le module mailing est qualifie if ($qualified) { + $var = ! $var; + if ($allowaddtarget) { - print '
'; + print ''; print ''; } else { - print '
'; + print '
'; } print '
'; diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index 78439af1134a0..68e029dae4b67 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -76,9 +76,9 @@ class Events // extends CommonObject // List of all Audit/Security events supported by triggers public $eventstolog=array( - /*array('id'=>'USER_LOGIN', 'test'=>1), + array('id'=>'USER_LOGIN', 'test'=>1), array('id'=>'USER_LOGIN_FAILED', 'test'=>1), - array('id'=>'USER_LOGOUT', 'test'=>1),*/ + array('id'=>'USER_LOGOUT', 'test'=>1), array('id'=>'USER_CREATE', 'test'=>1), array('id'=>'USER_MODIFY', 'test'=>1), array('id'=>'USER_NEW_PASSWORD', 'test'=>1), diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 1b6efe568200f..35b3e52d1542a 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -334,7 +334,7 @@ function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24, $out=''; $hideunselectables = false; - if (! empty($conf->global->CONTRACT_HIDE_UNSELECTABLES)) $hideunselectables = true; + if (! empty($conf->global->PROJECT_HIDE_UNSELECTABLES)) $hideunselectables = true; if (empty($projectsListId)) { @@ -346,11 +346,11 @@ function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24, } // Search all projects - $sql = 'SELECT t.rowid, t.ref as tref, t.label as tlabel, p.ref, p.title, p.fk_soc, p.fk_statut, p.public,'; + $sql = 'SELECT t.rowid, t.ref as tref, t.label as tlabel, p.rowid as pid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public,'; $sql.= ' s.nom as name'; $sql.= ' FROM '.MAIN_DB_PREFIX .'projet as p'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON s.rowid = p.fk_soc'; - $sql.= ', '.MAIN_DB_PREFIX.'projet_task as t'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON s.rowid = p.fk_soc,'; + $sql.= ' '.MAIN_DB_PREFIX.'projet_task as t'; $sql.= " WHERE p.entity IN (".getEntity('project').")"; $sql.= " AND t.fk_projet = p.rowid"; if ($projectsListId) $sql.= " AND p.rowid IN (".$projectsListId.")"; @@ -393,7 +393,7 @@ function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24, } else { - if ($discard_closed == 1 && $obj->fk_statut == 2) + if ($discard_closed == 1 && $obj->fk_statut == Project::STATUS_CLOSED) { $i++; continue; @@ -411,12 +411,12 @@ function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24, if ($obj->name) $labeltoshow.=' ('.$obj->name.')'; $disabled=0; - if ($obj->fk_statut == 0) + if ($obj->fk_statut == Project::STATUS_DRAFT) { $disabled=1; $labeltoshow.=' - '.$langs->trans("Draft"); } - else if ($obj->fk_statut == 2) + else if ($obj->fk_statut == Project::STATUS_CLOSED) { if ($discard_closed == 2) $disabled=1; $labeltoshow.=' - '.$langs->trans("Closed"); diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 7f4ab7c6d4a72..86b279483895a 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -589,7 +589,6 @@ function menuLoad($mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu $a = 0; $b = 0; - $oldrowid=0; while ($a < $numa) { //$objm = $this->db->fetch_object($resql); diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 84d3272568237..8b6ca6a5ca35b 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -52,9 +52,44 @@ function project_prepare_head($object) $head[$h][2] = 'contact'; $h++; + if (empty($conf->global->PROJECT_HIDE_TASKS)) + { + // Then tab for sub level of projet, i mean tasks + $head[$h][0] = DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id; + $head[$h][1] = $langs->trans("Tasks"); + + require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; + $taskstatic=new Task($db); + $nbTasks=count($taskstatic->getTasksArray(0, 0, $object->id, 0, 0)); + if ($nbTasks > 0) $head[$h][1].= ' '.($nbTasks).''; + $head[$h][2] = 'tasks'; + $h++; + + $nbTimeSpent=0; + $sql = "SELECT t.rowid"; + //$sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t, ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."user as u"; + //$sql .= " WHERE t.fk_user = u.rowid AND t.fk_task = pt.rowid"; + $sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t, ".MAIN_DB_PREFIX."projet_task as pt"; + $sql .= " WHERE t.fk_task = pt.rowid"; + $sql .= " AND pt.fk_projet =".$object->id; + $resql = $db->query($sql); + if ($resql) + { + $obj = $db->fetch_object($resql); + if ($obj) $nbTimeSpent=1; + } + else dol_print_error($db); + + $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&projectid='.$object->id; + $head[$h][1] = $langs->trans("TimeSpent"); + if ($nbTimeSpent > 0) $head[$h][1].= ' ...'; + $head[$h][2] = 'timespent'; + $h++; + } + if (! empty($conf->fournisseur->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled) - || ! empty($conf->facture->enabled) || ! empty($conf->contrat->enabled) - || ! empty($conf->ficheinter->enabled) || ! empty($conf->agenda->enabled) || ! empty($conf->deplacement->enabled)) + || ! empty($conf->facture->enabled) || ! empty($conf->contrat->enabled) + || ! empty($conf->ficheinter->enabled) || ! empty($conf->agenda->enabled) || ! empty($conf->deplacement->enabled)) { $head[$h][0] = DOL_URL_ROOT.'/projet/element.php?id='.$object->id; $head[$h][1] = $langs->trans("ProjectOverview"); @@ -92,41 +127,6 @@ function project_prepare_head($object) $head[$h][2] = 'document'; $h++; - if (empty($conf->global->PROJECT_HIDE_TASKS)) - { - // Then tab for sub level of projet, i mean tasks - $head[$h][0] = DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id; - $head[$h][1] = $langs->trans("Tasks"); - - require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; - $taskstatic=new Task($db); - $nbTasks=count($taskstatic->getTasksArray(0, 0, $object->id, 0, 0)); - if ($nbTasks > 0) $head[$h][1].= ' '.($nbTasks).''; - $head[$h][2] = 'tasks'; - $h++; - - $nbTimeSpent=0; - $sql = "SELECT t.rowid"; - //$sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t, ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."user as u"; - //$sql .= " WHERE t.fk_user = u.rowid AND t.fk_task = pt.rowid"; - $sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t, ".MAIN_DB_PREFIX."projet_task as pt"; - $sql .= " WHERE t.fk_task = pt.rowid"; - $sql .= " AND pt.fk_projet =".$object->id; - $resql = $db->query($sql); - if ($resql) - { - $obj = $db->fetch_object($resql); - if ($obj) $nbTimeSpent=1; - } - else dol_print_error($db); - - $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&projectid='.$object->id; - $head[$h][1] = $langs->trans("TimeSpent"); - if ($nbTimeSpent > 0) $head[$h][1].= ' ...'; - $head[$h][2] = 'timespent'; - $h++; - } - // Manage discussion if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT)) { @@ -1205,7 +1205,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ { continue; } - + // Break on a new project if ($parent == 0 && $lines[$i]->fk_project != $lastprojectid) { diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 2bf4671504f7b..ce2145d39864e 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -468,6 +468,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu { global $user,$conf,$langs,$dolibarr_main_db_name,$mysoc; + //var_dump($tabMenu); + $newmenu = $menu; $mainmenu=($forcemainmenu?$forcemainmenu:$_SESSION["mainmenu"]); @@ -523,7 +525,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu * We update newmenu with entries found into database * -------------------------------------------------- */ - if ($mainmenu) + if ($mainmenu) // If this is empty, loading hard coded menu and loading personalised menu will fail { /* * Menu HOME @@ -1628,6 +1630,9 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu } } + //var_dump($tabMenu); // + //var_dump($newmenu->liste); + // Build final $menu_array = $menu_array_before +$newmenu->liste + $menu_array_after //var_dump($menu_array_before);exit; //var_dump($menu_array_after);exit; diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php index 049956e82e260..4992fc6d11c21 100644 --- a/htdocs/core/menus/standard/eldy_menu.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -31,7 +31,7 @@ class MenuManager * @var DoliDB Database handler. */ public $db; - + var $type_user; // Put 0 for internal users, 1 for external users var $atarget=""; // To store default target to use onto links var $name="eldy"; @@ -109,6 +109,7 @@ function loadMenu($forcemainmenu='',$forceleftmenu='') $menuArbo = new Menubase($this->db,'eldy'); $menuArbo->menuLoad($mainmenu, $leftmenu, $this->type_user, 'eldy', $tabMenu); $this->tabMenu=$tabMenu; + //var_dump($tabMenu); //if ($forcemainmenu == 'all') { var_dump($this->tabMenu); exit; } } @@ -116,7 +117,7 @@ function loadMenu($forcemainmenu='',$forceleftmenu='') /** * Show menu. - * Module defined in sql tables are stored into this->tabMenu BEFORE this is called. + * Module defined in sql tables were stored into $this->tabMenu BEFORE this is called. * * @param string $mode 'top', 'topnb', 'left', 'jmobile' (used to get full xml ul/li menu) * @param array $moredata An array with more data to output @@ -126,6 +127,8 @@ function showmenu($mode, $moredata=null) { global $conf, $langs, $user; + //var_dump($this->tabMenu); + require_once DOL_DOCUMENT_ROOT.'/core/menus/standard/eldy.lib.php'; if ($this->type_user == 1) diff --git a/htdocs/core/triggers/interface_20_all_Logevents.class.php b/htdocs/core/triggers/interface_20_all_Logevents.class.php index 4d5d7e74280b7..b2100b806fbed 100644 --- a/htdocs/core/triggers/interface_20_all_Logevents.class.php +++ b/htdocs/core/triggers/interface_20_all_Logevents.class.php @@ -70,7 +70,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf $date = dol_now(); // Actions - /*if ($action == 'USER_LOGIN') + if ($action == 'USER_LOGIN') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); @@ -97,7 +97,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf // Initialisation donnees (date,duree,texte,desc) $text="(UserLogoff,".$object->login.")"; $desc="(UserLogoff,".$object->login.")"; - }*/ + } if ($action == 'USER_CREATE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 7cb69ee9a3f9d..b715ba853b7d6 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -623,11 +623,11 @@ } if (! empty($objexport->array_export_examplevalues[0][$code])) { - $htmltext.=$langs->trans("SourceExample").': '.$objexport->array_export_examplevalues[0][$code].'
'; + $htmltext.=''.$langs->trans("SourceExample").': '.$objexport->array_export_examplevalues[0][$code].'
'; } if (! empty($objexport->array_export_TypeFields[0][$code])) { - $htmltext.=$langs->trans("Type").': '.$objexport->array_export_TypeFields[0][$code].'
'; + $htmltext.=''.$langs->trans("Type").': '.$objexport->array_export_TypeFields[0][$code].'
'; } if (isset($array_selected[$code]) && $array_selected[$code]) diff --git a/htdocs/externalsite/frames.php b/htdocs/externalsite/frames.php index 611e84fe9c3ad..c7f9214238192 100644 --- a/htdocs/externalsite/frames.php +++ b/htdocs/externalsite/frames.php @@ -21,8 +21,9 @@ * \ingroup externalsite * \brief Page that build two frames: One for menu, the other for the target page to show * Usage: - * mydomain.com/externalsite/frames.php to show URL set into setup - * mydomain.com/externalsite/frames.php?keyforcontent to show content defined into conf->global->$keyforcontent + * /externalsite/frames.php to show URL set into setup + * /externalsite/frames.php?keyforcontent=EXTERNAL_SITE_CONTENT_abc to show html text defined into $conf->global->EXTERNAL_SITE_CONTENT_abc + * /externalsite/frames.php?keyforcontent=EXTERNAL_SITE_URL_abc to show URL defined into $conf->global->EXTERNAL_SITE_URL_abc */ require '../main.inc.php'; @@ -56,19 +57,58 @@ print '
'; - if (! preg_match('/EXTERNAL_SITE_CONTENT_/', $keyforcontent)) + if (! preg_match('/EXTERNAL_SITE_CONTENT_/', $keyforcontent) + && ! preg_match('/EXTERNAL_SITE_URL_/', $keyforcontent)) { $langs->load("errors"); - print $langs->trans("Variablekeyforcontentmustbenamed", 'EXTERNAL_SITE_CONTENT_'); + print $langs->trans("ErrorBadSyntaxForParamKeyForContent", 'EXTERNAL_SITE_CONTENT_', 'EXTERNAL_SITE_URL_'); } else if (empty($conf->global->$keyforcontent)) { $langs->load("errors"); - print $langs->trans("ErrorNoContentDefinedIntoVar", $keyforcontent); + print $langs->trans("ErrorVariableKeyForContentMustBeSet", 'EXTERNAL_SITE_CONTENT_'.$keyforcontent, 'EXTERNAL_SITE_URL_'.$keyforcontent); } else { - print $conf->global->$keyforcontent; + if (preg_match('/EXTERNAL_SITE_CONTENT_/', $keyforcontent)) + { + print $conf->global->$keyforcontent; + } + elseif (preg_match('/EXTERNAL_SITE_URL_/', $keyforcontent)) + { + /*print " + + + Dolibarr frame for external web site + + + global->MAIN_MENU_INVERT)?"rows":"cols")."=\"".$heightforframes.",*\" border=0 framespacing=0 frameborder=0> + + "; + print ''; + print " + + <body> + + </body> + + + + + <body> + <br><div class=\"center\"> + Sorry, your browser is too old or not correctly configured to view this area.<br> + Your browser must support frames.<br> + </div> + </body> + + + + ";*/ + print ''; + } } print '
'; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 8d6e8e39b0476..d580fa908097a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1844,6 +1844,7 @@ LoadThirdPartyFromNameOrCreate=Load thirdparty from name (create if not found) WithDolTrackingID=Dolibarr Tracking ID found WithoutDolTrackingID=Dolibarr Tracking ID not found FormatZip=Zip +MainMenuCode=Menu entry code (mainmenu) ##### 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/errors.lang b/htdocs/langs/en_US/errors.lang index a5555f85c8259..cb183d12ce299 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -213,6 +213,8 @@ ErrorNoteAlsoThatSubProductCantBeFollowedByLot=Note also that using virtual prod ErrorDescRequiredForFreeProductLines=Description is mandatory for lines with free product ErrorAPageWithThisNameOrAliasAlreadyExists=The page/container %s has the same name or alternative alias that the one your try to use ErrorDuringChartLoad=Error when loading chart of account. If few accounts were not loaded, you can still enter them manually. +ErrorBadSyntaxForParamKeyForContent=Bad syntax for param keyforcontent. Must have a value starting with %s or %s +ErrorVariableKeyForContentMustBeSet=Error, the constant with name %s (with text content to show) or %s (with external url to show) must be set. # Warnings 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. WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined @@ -235,3 +237,4 @@ WarningYourLoginWasModifiedPleaseLogin=Your login was modified. For security pur WarningAnEntryAlreadyExistForTransKey=An entry already exists for the translation key for this language WarningNumberOfRecipientIsRestrictedInMassAction=Warning, number of different recipient is limited to %s when using the mass actions on lists WarningDateOfLineMustBeInExpenseReportRange=Warning, the date of line is not in the range of the expense report +WarningProjectClosed=Project is closed. You must re-open it before. \ No newline at end of file diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index b2dd90608f717..c2421ac11e740 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -225,7 +225,7 @@ AllowToLinkFromOtherCompany=Allow to link project from other company

S LatestProjects=Latest %s projects LatestModifiedProjects=Latest %s modified projects OtherFilteredTasks=Other filtered tasks -NoAssignedTasks=No assigned tasks (assign project/tasks the current user from the top select box to enter time on it) +NoAssignedTasks=No assigned tasks found (assign project/tasks the current user from the top select box to enter time on it) # Comments trans AllowCommentOnTask=Allow user comments on tasks AllowCommentOnProject=Allow user comments on projects diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 06f67a9b79fd8..0f2f8af452e56 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -500,6 +500,17 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type) $_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadValueForCode"); $test=false; + // Call trigger for the "security events" log + $user->trigger_mesg='ErrorBadValueForCode - login='.GETPOST("username","alpha",2); + // Call of triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf); + if ($result < 0) { + $error++; + } + // End Call of triggers + // Hooks on failed login $action=''; $hookmanager->initHooks(array('login')); @@ -568,6 +579,17 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type) // We set a generic message if not defined inside function checkLoginPassEntity or subfunctions if (empty($_SESSION["dol_loginmesg"])) $_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadLoginPassword"); + // Call trigger for the "security events" log + $user->trigger_mesg=$langs->trans("ErrorBadLoginPassword").' - login='.GETPOST("username","alpha",2); + // Call of triggers + include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf,GETPOST("username","alpha",2)); + if ($result < 0) { + $error++; + } + // End Call of triggers + // Hooks on failed login $action=''; $hookmanager->initHooks(array('login')); @@ -604,11 +626,24 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type) $langs->loadLangs(array('main', 'errors')); $_SESSION["dol_loginmesg"]=$langs->trans("ErrorCantLoadUserFromDolibarrDatabase",$login); + + $user->trigger_mesg='ErrorCantLoadUserFromDolibarrDatabase - login='.$login; } if ($resultFetchUser < 0) { $_SESSION["dol_loginmesg"]=$user->error; + + $user->trigger_mesg=$user->error; + } + + // Call triggers for the "security events" log + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf); + if ($result < 0) { + $error++; } + // End call triggers // Hooks on failed login $action=''; @@ -648,12 +683,25 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type) $langs->loadLangs(array('main', 'errors')); $_SESSION["dol_loginmesg"]=$langs->trans("ErrorCantLoadUserFromDolibarrDatabase",$login); + + $user->trigger_mesg='ErrorCantLoadUserFromDolibarrDatabase - login='.$login; } if ($resultFetchUser < 0) { $_SESSION["dol_loginmesg"]=$user->error; + + $user->trigger_mesg=$user->error; } + // Call triggers for the "security events" log + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf); + if ($result < 0) { + $error++; + } + // End call triggers + // Hooks on failed login $action=''; $hookmanager->initHooks(array('login')); @@ -741,6 +789,17 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type) $loginfo = 'TZ='.$_SESSION["dol_tz"].';TZString='.$_SESSION["dol_tz_string"].';Screen='.$_SESSION["dol_screenwidth"].'x'.$_SESSION["dol_screenheight"]; + // Call triggers for the "security events" log + $user->trigger_mesg = $loginfo; + // Call triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('USER_LOGIN',$user,$user,$langs,$conf); + if ($result < 0) { + $error++; + } + // End call triggers + // Hooks on successfull login $action=''; $hookmanager->initHooks(array('login')); @@ -752,7 +811,7 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type) { $db->rollback(); session_destroy(); - dol_print_error($db,'Error in some hooks afterLogin'); + dol_print_error($db,'Error in some triggers USER_LOGIN or in some hooks afterLogin'); exit; } else @@ -1015,7 +1074,7 @@ function llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, if (empty($conf->dol_hide_leftmenu)) { - left_menu('', $help_url, '', '', 1, $title, 1); + left_menu('', $help_url, '', '', 1, $title, 1); // $menumanager is retreived with a global $menumanager inside this function } // main area diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 04605c33065eb..fb2399175c2c8 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -450,108 +450,118 @@ print load_fiche_titre($langs->trans("NewTask"), '', 'title_project'); - print ''; - print ''; - print ''; - print ''; - if (! empty($object->id)) print ''; + if ($object->statut == Project::STATUS_CLOSED) + { + print '
'; + $langs->load("errors"); + print $langs->trans("WarningProjectClosed"); + print '
'; + } + else + { + print ''; + print ''; + print ''; + print ''; + if (! empty($object->id)) print ''; - dol_fiche_head(''); + dol_fiche_head(''); - print ''; + print '
'; - $defaultref=''; - $obj = empty($conf->global->PROJECT_TASK_ADDON)?'mod_task_simple':$conf->global->PROJECT_TASK_ADDON; - if (! empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.".php")) - { - require_once DOL_DOCUMENT_ROOT ."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.'.php'; - $modTask = new $obj; - $defaultref = $modTask->getNextValue($object->thirdparty,null); - } + $defaultref=''; + $obj = empty($conf->global->PROJECT_TASK_ADDON)?'mod_task_simple':$conf->global->PROJECT_TASK_ADDON; + if (! empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.".php")) + { + require_once DOL_DOCUMENT_ROOT ."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.'.php'; + $modTask = new $obj; + $defaultref = $modTask->getNextValue($object->thirdparty,null); + } - if (is_numeric($defaultref) && $defaultref <= 0) $defaultref=''; + if (is_numeric($defaultref) && $defaultref <= 0) $defaultref=''; - // Ref - print ''; + // Ref + print ''; - print ''; + print ''; - // List of projects - print ''; + // List of projects + print ''; - print ''; - - // Date start - print ''; - - // Date end - print ''; - - // Planned workload - print ''; - - // Progress - print ''; - - // Description - print ''; - print ''; - - // Other options - $parameters=array(); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$taskstatic,$action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - if (empty($reshook) && ! empty($extrafields_task->attribute_label)) - { - print $taskstatic->showOptionals($extrafields_task,'edit'); // Do not use $object here that is object of project - } + print ''; + + // Date start + print ''; + + // Date end + print ''; + + // Planned workload + print ''; + + // Progress + print ''; + + // Description + print ''; + print ''; + + // Other options + $parameters=array(); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$taskstatic,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + + if (empty($reshook) && ! empty($extrafields_task->attribute_label)) + { + print $taskstatic->showOptionals($extrafields_task,'edit'); // Do not use $object here that is object of project + } - print '
'.$langs->trans("Ref").''; - if (empty($duplicate_code_error)) - { - print (GETPOSTISSET("ref")?GETPOST("ref",'alpha'):$defaultref); - } - else - { - print $defaultref; - } - print ''; - print '
'.$langs->trans("Ref").''; + if (empty($duplicate_code_error)) + { + print (GETPOSTISSET("ref")?GETPOST("ref",'alpha'):$defaultref); + } + else + { + print $defaultref; + } + print ''; + print '
'.$langs->trans("Label").''; - print ''; - print '
'.$langs->trans("Label").''; + print ''; + print '
'.$langs->trans("ChildOfProjectTask").''; - print $formother->selectProjectTasks(GETPOST('task_parent'), $projectid?$projectid:$object->id, 'task_parent', 0, 0, 1, 1, 0, '0,1', 'maxwidth500'); - print '
'.$langs->trans("ChildOfProjectTask").''; + print $formother->selectProjectTasks(GETPOST('task_parent'), $projectid?$projectid:$object->id, 'task_parent', 0, 0, 1, 1, 0, '0,1', 'maxwidth500'); + print '
'.$langs->trans("AffectedTo").''; - $contactsofproject=(! empty($object->id)?$object->getListContactId('internal'):''); - if (is_array($contactsofproject) && count($contactsofproject)) - { - print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, '', 'maxwidth300'); - } - else - { - print $langs->trans("NoUserAssignedToTheProject"); - } - print '
'.$langs->trans("DateStart").''; - print $form->selectDate(($date_start?$date_start:''), 'dateo', 1, 1, 0, '', 1, 1); - print '
'.$langs->trans("DateEnd").''; - print $form->selectDate(($date_end?$date_end:-1),'datee', -1, 1, 0, '', 1, 1); - print '
'.$langs->trans("PlannedWorkload").''; - print $form->select_duration('planned_workload', $planned_workload?$planned_workload : 0, 0, 'text'); - print '
'.$langs->trans("ProgressDeclared").''; - print $formother->select_percent($progress,'progress',0,5,0,100,1); - print '
'.$langs->trans("Description").''; - print ''; - print '
'.$langs->trans("AffectedTo").''; + $contactsofproject=(! empty($object->id)?$object->getListContactId('internal'):''); + if (is_array($contactsofproject) && count($contactsofproject)) + { + print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, '', 'maxwidth300'); + } + else + { + print $langs->trans("NoUserAssignedToTheProject"); + } + print '
'.$langs->trans("DateStart").''; + print $form->selectDate(($date_start?$date_start:''), 'dateo', 1, 1, 0, '', 1, 1); + print '
'.$langs->trans("DateEnd").''; + print $form->selectDate(($date_end?$date_end:-1),'datee', -1, 1, 0, '', 1, 1); + print '
'.$langs->trans("PlannedWorkload").''; + print $form->select_duration('planned_workload', $planned_workload?$planned_workload : 0, 0, 'text'); + print '
'.$langs->trans("ProgressDeclared").''; + print $formother->select_percent($progress,'progress',0,5,0,100,1); + print '
'.$langs->trans("Description").''; + print ''; + print '
'; + print ''; - dol_fiche_end(); + dol_fiche_end(); - print '
'; - print ''; - print '     '; - print ''; - print '
'; + print '
'; + print ''; + print '     '; + print ''; + print '
'; - print ''; + print ''; + } } else if ($id > 0 || ! empty($ref)) { diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 82c722f24858d..e6de0743d6620 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -326,7 +326,7 @@ dol_fiche_end(); /* - * Lignes de contacts + * Lines of contacts */ /* // Contacts lines (modules that overwrite templates must declare this into descriptor) @@ -340,16 +340,15 @@ /* * Add a new contact line - * Non affiche en mode modification de ligne */ print ''; if ($action != 'editline' && $user->rights->projet->creer) { print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; print ''; print "\n"; @@ -507,7 +506,7 @@ { print ' '; print ''; - print img_delete(); + print img_picto($langs->trans('Unlink'), 'unlink'); print ''; } print ''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 4afac8ac2cc64..05fd488e948f6 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -907,8 +907,9 @@ min-width: 150px; } .thumbstat150 { - /* min-width: 170px; */ - width: 170px; + min-width: 170px; + max-wdith: 171px; + /* width: 170px; If I use with, there is trouble on size of flex boxes solved with min+max that is a little bit higer than min */ } .thumbstat, .thumbstat150 { browser->name == 'ie') { ?> diff --git a/htdocs/user/logout.php b/htdocs/user/logout.php index 3f53a4c67dd82..668ca6fa4dbee 100644 --- a/htdocs/user/logout.php +++ b/htdocs/user/logout.php @@ -41,13 +41,12 @@ global $conf, $langs, $user; -// Appel des triggers -// TODO @deprecated Remove this. Hook must be used, not this trigger. -//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; -//$interface=new Interfaces($db); -//$result=$interface->run_triggers('USER_LOGOUT',$user,$user,$langs,$conf); -//if ($result < 0) { $error++; } -// Fin appel triggers +// Call triggers for the "security events" log +include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; +$interface=new Interfaces($db); +$result=$interface->run_triggers('USER_LOGOUT',$user,$user,$langs,$conf); +if ($result < 0) { $error++; } +// End call triggers // Hooks on logout $action='';
'.$langs->trans("Source").''.$langs->trans("Nature").''.$langs->trans("ThirdParty").''.$langs->trans("TaskContact").''.$langs->trans("Users").''.$langs->trans("ContactType").'