From 5ebe71166567ac84835d9b87b0a8f8eb93fefa28 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 May 2017 13:38:48 +0200 Subject: [PATCH] Look and feel v6 --- htdocs/resource/card.php | 39 +++++++++++----- htdocs/resource/class/dolresource.class.php | 51 ++++++++++++++++----- htdocs/resource/contact.php | 31 ++++++++----- htdocs/resource/document.php | 28 +++++++---- htdocs/resource/note.php | 29 ++++++++---- 5 files changed, 125 insertions(+), 53 deletions(-) diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php index d2ec14efd71..7f0a96a7ab4 100644 --- a/htdocs/resource/card.php +++ b/htdocs/resource/card.php @@ -221,29 +221,41 @@ if ( $object->fetch($id) > 0 ) } else { - dol_fiche_head($head, 'resource', $langs->trans("ResourceSingular"),0,'resource'); + dol_fiche_head($head, 'resource', $langs->trans("ResourceSingular"), -1, 'resource'); + $formconfirm = ''; + // Confirm deleting resource line if ($action == 'delete') { - print $form->formconfirm("card.php?&id=".$id,$langs->trans("DeleteResource"),$langs->trans("ConfirmDeleteResource"),"confirm_delete_resource",'','',1); + $formconfirm = $form->formconfirm("card.php?&id=".$id,$langs->trans("DeleteResource"),$langs->trans("ConfirmDeleteResource"),"confirm_delete_resource",'','',1); } - + // Print form confirm + print $formconfirm; + + + $linkback = '' . $langs->trans("BackToList") . ''; + + + $morehtmlref='
'; + $morehtmlref.='
'; + + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref); + + + print '
'; + print '
'; + /*--------------------------------------- * View object */ print ''; - print ''; - print ''; - // Resource type print ''; - print ''; + print ''; print ''; @@ -267,9 +279,14 @@ if ( $object->fetch($id) > 0 ) print ''; print '
'.$langs->trans("ResourceFormLabel_ref").''; - $linkback = $objet->ref.' '.$langs->trans("BackToList").''; - print $form->showrefnav($object, 'id', $linkback,1,"rowid"); - print '
' . $langs->trans("ResourceType") . '' . $langs->trans("ResourceType") . ''; print $object->type_label; print '
'; + + print '
'; + + print '

'; + + dol_fiche_end(); } - print ''; /* * Boutons actions diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 6e418e2e649..51024cfe7ee 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -30,18 +30,19 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php"; */ class Dolresource extends CommonObject { - var $element='dolresource'; //!< Id that identify managed objects - var $table_element='resource'; //!< Name of table without prefix where object is stored - - var $resource_id; - var $resource_type; - var $element_id; - var $element_type; - var $busy; - var $mandatory; - var $fk_user_create; - var $type_label; - var $tms=''; + public $element='dolresource'; //!< Id that identify managed objects + public $table_element='resource'; //!< Name of table without prefix where object is stored + public $picto = 'resource'; + + public $resource_id; + public $resource_type; + public $element_id; + public $element_type; + public $busy; + public $mandatory; + public $fk_user_create; + public $type_label; + public $tms=''; /** * Constructor @@ -974,4 +975,30 @@ class Dolresource extends CommonObject $result.=$link.$this->ref.$linkend; return $result; } + + + /** + * Retourne le libelle du status d'un user (actif, inactif) + * + * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @return string Label of status + */ + function getLibStatut($mode=0) + { + return $this->LibStatut($this->status,$mode); + } + + /** + * Return the status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 5=Long label + Picto + * @return string Label of status + */ + static function LibStatut($status,$mode=0) + { + global $langs; + + return ''; + } } diff --git a/htdocs/resource/contact.php b/htdocs/resource/contact.php index 97dbb0de1be..007ecd8025d 100644 --- a/htdocs/resource/contact.php +++ b/htdocs/resource/contact.php @@ -119,23 +119,30 @@ if ($id > 0 || ! empty($ref)) $head = resource_prepare_head($object); - dol_fiche_head($head, 'contact', $langs->trans("ResourceSingular"), 0, 'resource'); + dol_fiche_head($head, 'contact', $langs->trans("ResourceSingular"), -1, 'resource'); - /* - * Resource synthese pour rappel - */ + $linkback = '' . $langs->trans("BackToList") . ''; + + + $morehtmlref='
'; + $morehtmlref.='
'; + + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref); + + + print '
'; + print '
'; + + + // Object + print ''; - print ''; - print ''; - // Resource type print ''; - print ''; + print ''; print ''; @@ -144,6 +151,8 @@ if ($id > 0 || ! empty($ref)) print '
'.$langs->trans("ResourceFormLabel_ref").''; - $linkback = $objet->ref.' '.$langs->trans("BackToList").''; - print $form->showrefnav($object, 'id', $linkback,1,"rowid"); - print '
' . $langs->trans("ResourceType") . '' . $langs->trans("ResourceType") . ''; print $object->type_label; print '
'; print '
'; + dol_fiche_end(); + print '
'; if (! empty($conf->global->RESOURCE_HIDE_ADD_CONTACT_USER)) $hideaddcontactforuser=1; diff --git a/htdocs/resource/document.php b/htdocs/resource/document.php index 1078e8bb94a..2d8e260d85a 100644 --- a/htdocs/resource/document.php +++ b/htdocs/resource/document.php @@ -89,7 +89,7 @@ if ($object->id) $head=resource_prepare_head($object); - dol_fiche_head($head, 'documents', $langs->trans("ResourceSingular"), 0, 'resource'); + dol_fiche_head($head, 'documents', $langs->trans("ResourceSingular"), -1, 'resource'); // Construit liste des fichiers @@ -100,19 +100,25 @@ if ($object->id) $totalsize+=$file['size']; } - + + $linkback = '' . $langs->trans("BackToList") . ''; + + + $morehtmlref='
'; + $morehtmlref.='
'; + + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref); + + + print '
'; + print '
'; + print ''; - - print ''; - print ''; - // Resource type print ''; - print ''; + print ''; print ''; @@ -124,6 +130,8 @@ if ($object->id) print ''; + dol_fiche_end(); + $modulepart = 'dolresource'; $permission = $user->rights->resource->write; $param = '&id=' . $object->id; diff --git a/htdocs/resource/note.php b/htdocs/resource/note.php index 30e37eba77f..20d96591c7b 100644 --- a/htdocs/resource/note.php +++ b/htdocs/resource/note.php @@ -64,24 +64,35 @@ $form = new Form($db); if ($id > 0 || ! empty($ref)) { $head = resource_prepare_head($object); - dol_fiche_head($head, 'note', $langs->trans('ResourceSingular'), 0, 'resource'); + dol_fiche_head($head, 'note', $langs->trans('ResourceSingular'), -1, 'resource'); + $linkback = '' . $langs->trans("BackToList") . ''; + + + $morehtmlref='
'; + $morehtmlref.='
'; + + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref); + + + print '
'; + print '
'; + print '
'.$langs->trans("ResourceFormLabel_ref").''; - $linkback = $objet->ref.' '.$langs->trans("BackToList").''; - print $form->showrefnav($object, 'id', $linkback,1,"rowid"); - print '
' . $langs->trans("ResourceType") . '' . $langs->trans("ResourceType") . ''; print $object->type_label; print '
'; - print ''; - print ''; // Resource type print ''; - print ''; + print ''; print ''; - print ''; print "
'.$langs->trans("ResourceFormLabel_ref").''; - $linkback = $objet->ref.' '.$langs->trans("BackToList").''; - print $form->showrefnav($object, 'id', $linkback,1,"rowid"); - print '
' . $langs->trans("ResourceType") . '' . $langs->trans("ResourceType") . ''; print $object->type_label; print '
"; + print ''; + + print ""; - print '
'; + print '
'; + $permission=$user->rights->resource->write; $cssclass='titlefield'; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';