Skip to content
Snippets Groups Projects
Commit 5ebe7116 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Look and feel v6

parent 71bd69a8
No related branches found
No related tags found
No related merge requests found
...@@ -221,29 +221,41 @@ if ( $object->fetch($id) > 0 ) ...@@ -221,29 +221,41 @@ if ( $object->fetch($id) > 0 )
} }
else 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 // Confirm deleting resource line
if ($action == 'delete') 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 = '<a href="' . DOL_URL_ROOT . '/resource/list.php' . (! empty($socid) ? '?id=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
$morehtmlref='<div class="refidno">';
$morehtmlref.='</div>';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
/*--------------------------------------- /*---------------------------------------
* View object * View object
*/ */
print '<table width="100%" class="border">'; print '<table width="100%" class="border">';
print '<tr><td class="titlefield">'.$langs->trans("ResourceFormLabel_ref").'</td><td>';
$linkback = $objet->ref.' <a href="list.php">'.$langs->trans("BackToList").'</a>';
print $form->showrefnav($object, 'id', $linkback,1,"rowid");
print '</td>';
print '</tr>';
// Resource type // Resource type
print '<tr>'; print '<tr>';
print '<td>' . $langs->trans("ResourceType") . '</td>'; print '<td class="titlefield">' . $langs->trans("ResourceType") . '</td>';
print '<td>'; print '<td>';
print $object->type_label; print $object->type_label;
print '</td>'; print '</td>';
...@@ -267,10 +279,15 @@ if ( $object->fetch($id) > 0 ) ...@@ -267,10 +279,15 @@ if ( $object->fetch($id) > 0 )
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';
}
print '</div>'; print '</div>';
print '<div class="clearboth"></div><br>';
dol_fiche_end();
}
/* /*
* Boutons actions * Boutons actions
*/ */
......
...@@ -30,18 +30,19 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php"; ...@@ -30,18 +30,19 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php";
*/ */
class Dolresource extends CommonObject class Dolresource extends CommonObject
{ {
var $element='dolresource'; //!< Id that identify managed objects public $element='dolresource'; //!< Id that identify managed objects
var $table_element='resource'; //!< Name of table without prefix where object is stored public $table_element='resource'; //!< Name of table without prefix where object is stored
public $picto = 'resource';
var $resource_id;
var $resource_type; public $resource_id;
var $element_id; public $resource_type;
var $element_type; public $element_id;
var $busy; public $element_type;
var $mandatory; public $busy;
var $fk_user_create; public $mandatory;
var $type_label; public $fk_user_create;
var $tms=''; public $type_label;
public $tms='';
/** /**
* Constructor * Constructor
...@@ -974,4 +975,30 @@ class Dolresource extends CommonObject ...@@ -974,4 +975,30 @@ class Dolresource extends CommonObject
$result.=$link.$this->ref.$linkend; $result.=$link.$this->ref.$linkend;
return $result; 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 '';
}
} }
...@@ -119,23 +119,30 @@ if ($id > 0 || ! empty($ref)) ...@@ -119,23 +119,30 @@ if ($id > 0 || ! empty($ref))
$head = resource_prepare_head($object); $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');
/* $linkback = '<a href="' . DOL_URL_ROOT . '/resource/list.php' . (! empty($socid) ? '?id=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
* Resource synthese pour rappel
*/
print '<table width="100%" class="border">';
print '<tr><td class="titlefield">'.$langs->trans("ResourceFormLabel_ref").'</td><td>';
$linkback = $objet->ref.' <a href="list.php">'.$langs->trans("BackToList").'</a>'; $morehtmlref='<div class="refidno">';
print $form->showrefnav($object, 'id', $linkback,1,"rowid"); $morehtmlref.='</div>';
print '</td>';
print '</tr>';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
// Object
print '<table width="100%" class="border">';
// Resource type // Resource type
print '<tr>'; print '<tr>';
print '<td>' . $langs->trans("ResourceType") . '</td>'; print '<td class="titlefield">' . $langs->trans("ResourceType") . '</td>';
print '<td>'; print '<td>';
print $object->type_label; print $object->type_label;
print '</td>'; print '</td>';
...@@ -144,6 +151,8 @@ if ($id > 0 || ! empty($ref)) ...@@ -144,6 +151,8 @@ if ($id > 0 || ! empty($ref))
print '</table>'; print '</table>';
print '</div>'; print '</div>';
dol_fiche_end();
print '<br>'; print '<br>';
if (! empty($conf->global->RESOURCE_HIDE_ADD_CONTACT_USER)) $hideaddcontactforuser=1; if (! empty($conf->global->RESOURCE_HIDE_ADD_CONTACT_USER)) $hideaddcontactforuser=1;
......
...@@ -89,7 +89,7 @@ if ($object->id) ...@@ -89,7 +89,7 @@ if ($object->id)
$head=resource_prepare_head($object); $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 // Construit liste des fichiers
...@@ -101,18 +101,24 @@ if ($object->id) ...@@ -101,18 +101,24 @@ if ($object->id)
} }
print '<table class="border" width="100%">'; $linkback = '<a href="' . DOL_URL_ROOT . '/resource/list.php' . (! empty($socid) ? '?id=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
print '<tr><td class="titlefield">'.$langs->trans("ResourceFormLabel_ref").'</td><td>'; $morehtmlref='<div class="refidno">';
$linkback = $objet->ref.' <a href="list.php">'.$langs->trans("BackToList").'</a>'; $morehtmlref.='</div>';
print $form->showrefnav($object, 'id', $linkback,1,"rowid");
print '</td>';
print '</tr>'; dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">';
// Resource type // Resource type
print '<tr>'; print '<tr>';
print '<td>' . $langs->trans("ResourceType") . '</td>'; print '<td class="titlefield">' . $langs->trans("ResourceType") . '</td>';
print '<td>'; print '<td>';
print $object->type_label; print $object->type_label;
print '</td>'; print '</td>';
...@@ -124,6 +130,8 @@ if ($object->id) ...@@ -124,6 +130,8 @@ if ($object->id)
print '</div>'; print '</div>';
dol_fiche_end();
$modulepart = 'dolresource'; $modulepart = 'dolresource';
$permission = $user->rights->resource->write; $permission = $user->rights->resource->write;
$param = '&id=' . $object->id; $param = '&id=' . $object->id;
......
...@@ -64,24 +64,35 @@ $form = new Form($db); ...@@ -64,24 +64,35 @@ $form = new Form($db);
if ($id > 0 || ! empty($ref)) if ($id > 0 || ! empty($ref))
{ {
$head = resource_prepare_head($object); $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 = '<a href="' . DOL_URL_ROOT . '/resource/list.php' . (! empty($socid) ? '?id=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
$morehtmlref='<div class="refidno">';
$morehtmlref.='</div>';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td class="titlefield">'.$langs->trans("ResourceFormLabel_ref").'</td><td>';
$linkback = $objet->ref.' <a href="list.php">'.$langs->trans("BackToList").'</a>';
print $form->showrefnav($object, 'id', $linkback,1,"rowid");
print '</td>';
print '</tr>';
// Resource type // Resource type
print '<tr>'; print '<tr>';
print '<td>' . $langs->trans("ResourceType") . '</td>'; print '<td class="titlefield">' . $langs->trans("ResourceType") . '</td>';
print '<td>'; print '<td>';
print $object->type_label; print $object->type_label;
print '</td>'; print '</td>';
print '</tr>'; print "</table>"; print '</tr>';
print "</table>";
print '</div>';
print '<br>';
$permission=$user->rights->resource->write; $permission=$user->rights->resource->write;
$cssclass='titlefield'; $cssclass='titlefield';
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment