diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 3b567c794d5..9ecfc338661 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -335,7 +335,7 @@ $tabrowid[29]= ""; // Condition to show dictionary in setup page $tabcond=array(); -$tabcond[1] = true; +$tabcond[1] = (! empty($conf->societe->enabled)); $tabcond[2] = true; $tabcond[3] = true; $tabcond[4] = true; @@ -345,7 +345,7 @@ $tabcond[7] = ! empty($conf->tax->enabled); $tabcond[8] = ! empty($conf->societe->enabled); $tabcond[9] = true; $tabcond[10]= true; -$tabcond[11]= true; +$tabcond[11]= (! empty($conf->societe->enabled)); $tabcond[12]= (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled)); $tabcond[13]= (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled)); $tabcond[14]= (! empty($conf->product->enabled) && ! empty($conf->ecotax->enabled)); diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 94a642efce3..bc662e4b434 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -240,14 +240,14 @@ class FormActions /** - * Output list of type of event + * Output html select list of type of event * * @param string $selected Type pre-selected (can be 'manual', 'auto' or 'AC_xxx') * @param string $htmlname Nom champ formulaire * @param string $excludetype Type to exclude * @param string $onlyautoornot Group list by auto events or not: We keep only the 2 generic lines (AC_OTH and AC_OTH_AUTO) - * @param int $hideinfohelp 1=Do not show info help - * @param int $multiselect 1=Allow multiselect of action type for filter or search + * @param int $hideinfohelp 1=Do not show info help + * @param int $multiselect 1=Allow multiselect of action type for filter or search * @return void */ function select_type_actions($selected='',$htmlname='actioncode',$excludetype='',$onlyautoornot=0, $hideinfohelp=0, $multiselect=0) @@ -270,9 +270,10 @@ class FormActions if (! empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO)) unset($arraylist['AC_OTH_AUTO']); - if($multiselect==1) { + if ($multiselect==1) + { if(!is_array($selected) && !empty($selected)) $selected = explode(',', $selected); - print $form->multiselectarray($htmlname, $arraylist,$selected,0, 0, '', 0, 200); + print $form->multiselectarray($htmlname, $arraylist, $selected, 0, 0, '', 0, 0); } else { diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 55600543e64..74815f7bdbd 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -82,14 +82,16 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; $formactions=new FormActions($db); + // Type print ''; print ''; print $langs->trans("Type"); print '  '; //select_type_actions($selected='',$htmlname='actioncode',$excludetype='',$onlyautoornot=0, $hideinfohelp=0, $multiselect=true) - print $formactions->select_type_actions($actioncode, "actioncode", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : 0), 0, 1); + print $formactions->select_type_actions($actioncode, "actioncode", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0), 0, (empty($conf->global->AGENDA_USE_EVENT_TYPE)?0:1)); print ''; + // Status print ''; print ''; print $langs->trans("Status"); diff --git a/htdocs/core/modules/modResource.class.php b/htdocs/core/modules/modResource.class.php index 5997f44714b..82d57514623 100644 --- a/htdocs/core/modules/modResource.class.php +++ b/htdocs/core/modules/modResource.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2015 Laurent Destailleur * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -153,10 +154,6 @@ class modResource extends DolibarrModules // 'categories_x' to add a tab in category view // (reresource 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member) - $this->tabs = array( -// 'thirdparty:+resources:Resources:resource:$user->rights->resource->read:/resource/element_resource.php?element=societe&element_id=__ID__' - ); - // Boxes // Add here list of php file(s) stored in core/boxes that contains class to show a box. $this->boxes = array(); // Boxes list @@ -250,6 +247,21 @@ class modResource extends DolibarrModules 'user'=> 0 ); + $this->menu[$r++]=array( + 'fk_menu'=>'fk_mainmenu=tools,fk_leftmenu=resource', //On utilise les ancres définis dans le menu parent déclaré au dessus + 'type'=> 'left', // Toujours un menu gauche + 'titre'=> 'List', + 'mainmenu'=> 'tools', + 'leftmenu'=> '', // On n'indique rien ici car on ne souhaite pas intégrer de sous-menus à ce menu + 'url'=> '/resource/list.php', + 'langs'=> 'resource', + 'position'=> 102, + 'enabled'=> '1', + 'perms'=> '$user->rights->resource->read', + 'target'=> '', + 'user'=> 0 + ); + // Exports $r = 1; diff --git a/htdocs/core/tpl/resource_add.tpl.php b/htdocs/core/tpl/resource_add.tpl.php index 876afd41c72..e2add5fb266 100644 --- a/htdocs/core/tpl/resource_add.tpl.php +++ b/htdocs/core/tpl/resource_add.tpl.php @@ -1,7 +1,6 @@ + select_resource_list('','fk_resource','',1,1,0,$events,'',2); $out .= ''; -$out .= '
'.$form->selectyesno('busy',$linked_resource['busy']?1:0,1).'
'; -$out .= '
'.$form->selectyesno('mandatory',$linked_resource['mandatory']?1:0,1).'
'; +$out .= '
'.$form->selectyesno('busy',(isset($_POST['busy'])?$_POST['busy']:1),1).'
'; +$out .= '
'.$form->selectyesno('mandatory',(isset($_POST['mandatory'])?$_POST['mandatory']:0),1).'
'; $out .= '
'; $out .=''; @@ -33,8 +32,8 @@ $out .= '
'; $out .=''; $out .= ''; -$out .= '
'; +$out .= '
'; print $out; - -// END BEGIN TPL RESOURCE_ADD.TPL.PHP +?> + diff --git a/htdocs/core/tpl/resource_view.tpl.php b/htdocs/core/tpl/resource_view.tpl.php index 3b846e9314c..a5e5ab21919 100644 --- a/htdocs/core/tpl/resource_view.tpl.php +++ b/htdocs/core/tpl/resource_view.tpl.php @@ -1,3 +1,4 @@ + 0) { $var=true; - // TODO: DEBUT DU TPL + print '
'; + if($mode == 'edit' ) - { - print '
'; + { print '
'; - print '
'.$langs->trans('Type').'
'; print '
'.$langs->trans('Resource').'
'; + print '
'.$langs->trans('Type').'
'; print '
'.$langs->trans('Busy').'
'; print '
'.$langs->trans('Mandatory').'
'; print '
'; print '
'; - //print '
'; } else { - print '
'; print '
'; - print '
'.$langs->trans('Type').'
'; print '
'.$langs->trans('Resource').'
'; + print '
'.$langs->trans('Type').'
'; print '
'.$langs->trans('Busy').'
'; print '
'.$langs->trans('Mandatory').'
'; print '
'; print '
'; - //print '
'; } @@ -49,11 +47,11 @@ if( (array) $linked_resources && count($linked_resources) > 0) print ''; print ''; - print '
'.$object_resource->type_label.'
'; print '
'.$object_resource->getNomUrl(1).'
'; + print '
'.$object_resource->type_label.'
'; print '
'.$form->selectyesno('busy',$linked_resource['busy']?1:0,1).'
'; - print '
'.$form->selectyesno('mandatory',$linked_resource['mandatory']?1:0,1).'
'; - print '
'; + print '
'.$form->selectyesno('mandatory',$linked_resource['mandatory']?1:0,1).'
'; + print '
'; print ''; } @@ -65,14 +63,14 @@ if( (array) $linked_resources && count($linked_resources) > 0) print '
'; - print '
'; - print $object_resource->type_label; - print '
'; - print '
'; print $object_resource->getNomUrl(1); print '
'; + print '
'; + print $object_resource->type_label; + print '
'; + print '
'; print yn($linked_resource['busy']); print '
'; @@ -96,14 +94,12 @@ if( (array) $linked_resources && count($linked_resources) > 0) } + print '
'; - - - - } else { print '
'.$langs->trans('NoResourceLinked').'
'; } -// FIN DU TPL \ No newline at end of file +?> + diff --git a/htdocs/langs/en_US/resource.lang b/htdocs/langs/en_US/resource.lang index c89edddec4b..cdff0391c30 100644 --- a/htdocs/langs/en_US/resource.lang +++ b/htdocs/langs/en_US/resource.lang @@ -17,6 +17,7 @@ ResourceFormLabel_description=Resource description ResourcesLinkedToElement=Resources linked to element +ShowResource=Show resource ShowResourcePlanning=Show resource planning GotoDate=Go to date diff --git a/htdocs/resource/add.php b/htdocs/resource/add.php index 3618230a374..f509bc82759 100644 --- a/htdocs/resource/add.php +++ b/htdocs/resource/add.php @@ -1,6 +1,7 @@ * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -111,9 +112,9 @@ if ($action == 'confirm_add_resource') } } + /* * View - * */ $form=new Form($db); @@ -146,7 +147,7 @@ if (! $action) // Type print ''.$langs->trans("ResourceType").''; print ''; - $ret = $formresource->select_types_resource($object->fk_code_type_resource,'fk_code_type_resource','',2); + $ret = $formresource->select_types_resource($object->fk_code_type_resource, 'fk_code_type_resource', '', 2, 1); print ''; // Description @@ -168,7 +169,7 @@ if (! $action) echo '
', '', - '     ', + '   ', '', '
'; diff --git a/htdocs/resource/class/resource.class.php b/htdocs/resource/class/resource.class.php index 08881341429..3cb96dc53a3 100644 --- a/htdocs/resource/class/resource.class.php +++ b/htdocs/resource/class/resource.class.php @@ -79,7 +79,7 @@ class Resource extends CommonObject // Insert request $sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element."("; - $sql.= " entity,"; + $sql.= "entity,"; $sql.= "ref,"; $sql.= "description,"; $sql.= "fk_code_type_resource,"; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index d8bbe966843..899e8340543 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2606,6 +2606,7 @@ div.ok { color: #114466; } +/* Warning message */ div.warning { color: #302020; padding: 0.3em 0.3em 0.3em 0.3em; @@ -2618,14 +2619,7 @@ div.warning { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); } -div.error { - color: #550000; font-weight: bold; - padding: 0.3em 0.3em 0.3em 0.3em; - margin: 0.5em 0em 0.5em 0em; - border: 1px solid #DC9CAB; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; +/* Error message */ background: #EFCFCF; } @@ -2642,6 +2636,9 @@ div.info { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); } +div.warning a, div.info a, div.error a { + color: rgb(); +} /* * Liens Payes/Non payes