Debug module resource

This commit is contained in:
Laurent Destailleur 2016-06-06 12:29:15 +02:00
parent 9c88eadbe4
commit 681249de8a
8 changed files with 35 additions and 20 deletions

View File

@ -42,8 +42,10 @@ function resource_prepare_head($object)
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{ {
$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
$head[$h][0] = DOL_URL_ROOT.'/resource/contact.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/resource/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans('Contact'); $head[$h][1] = $langs->trans('ContactsAddresses');
if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>';
$head[$h][2] = 'contact'; $head[$h][2] = 'contact';
$h++; $h++;
} }

View File

@ -62,10 +62,15 @@ function shipping_prepare_head($object)
} }
} }
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
$head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$object->id; $head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$object->id;
$head[$h][1] = $langs->trans("ContactsAddresses"); $head[$h][1] = $langs->trans("ContactsAddresses");
if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>';
$head[$h][2] = 'contact'; $head[$h][2] = 'contact';
$h++; $h++;
}
$nbNote = 0; $nbNote = 0;
if (!empty($object->note_private)) $nbNote++; if (!empty($object->note_private)) $nbNote++;

View File

@ -64,11 +64,14 @@ insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) v
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (130, 'fichinter','external', 'BILLING', 'Contact client facturation intervention', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (130, 'fichinter','external', 'BILLING', 'Contact client facturation intervention', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (131, 'fichinter','external', 'CUSTOMER', 'Contact client suivi de l''intervention', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (131, 'fichinter','external', 'CUSTOMER', 'Contact client suivi de l''intervention', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (140,'order_supplier','internal', 'SALESREPFOLL', 'Responsable suivi de la commande', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (140, 'order_supplier','internal', 'SALESREPFOLL', 'Responsable suivi de la commande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (141,'order_supplier','internal', 'SHIPPING', 'Responsable réception de la commande', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (141, 'order_supplier','internal', 'SHIPPING', 'Responsable réception de la commande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (142,'order_supplier','external', 'BILLING', 'Contact fournisseur facturation commande', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (142, 'order_supplier','external', 'BILLING', 'Contact fournisseur facturation commande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (143,'order_supplier','external', 'CUSTOMER', 'Contact fournisseur suivi commande', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (143, 'order_supplier','external', 'CUSTOMER', 'Contact fournisseur suivi commande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (145,'order_supplier','external', 'SHIPPING', 'Contact fournisseur livraison commande', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (145, 'order_supplier','external', 'SHIPPING', 'Contact fournisseur livraison commande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (150, 'dolresource','internal', 'USERINCHARGE', 'In charge of resource', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (151, 'dolresource','external', 'THIRDINCHARGE', 'In charge of resource', 1);
-- All project code must start with 'PROJECT' -- All project code must start with 'PROJECT'
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (160, 'project', 'internal', 'PROJECTLEADER', 'Chef de Projet', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (160, 'project', 'internal', 'PROJECTLEADER', 'Chef de Projet', 1);

View File

@ -39,6 +39,9 @@ ALTER TABLE llx_opensurvey_sondage ADD COLUMN status integer DEFAULT 1 after dat
ALTER TABLE llx_expedition ADD COLUMN billed smallint DEFAULT 0; ALTER TABLE llx_expedition ADD COLUMN billed smallint DEFAULT 0;
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (150, 'dolresource','internal', 'USERINCHARGE', 'In charge of resource', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (151, 'dolresource','external', 'THIRDINCHARGE', 'In charge of resource', 1);
-- DROP TABLE llx_product_lot; -- DROP TABLE llx_product_lot;
CREATE TABLE llx_product_lot ( CREATE TABLE llx_product_lot (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,

View File

@ -173,17 +173,17 @@ if ( $object->fetch($id) > 0 )
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Ref // Ref
print '<tr><td width="20%" class="fieldrequired">'.$langs->trans("ResourceFormLabel_ref").'</td>'; print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("ResourceFormLabel_ref").'</td>';
print '<td><input size="12" name="ref" value="'.(GETPOST('ref') ? GETPOST('ref') : $object->ref).'"></td></tr>'; print '<td><input size="12" name="ref" value="'.(GETPOST('ref') ? GETPOST('ref') : $object->ref).'"></td></tr>';
// Type // Type
print '<tr><td width="20%">'.$langs->trans("ResourceType").'</td>'; print '<tr><td>'.$langs->trans("ResourceType").'</td>';
print '<td>'; print '<td>';
$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);
print '</td></tr>'; print '</td></tr>';
// Description // Description
print '<tr><td valign="top">'.$langs->trans("Description").'</td>'; print '<tr><td class="tdtop">'.$langs->trans("Description").'</td>';
print '<td>'; print '<td>';
print '<textarea name="description" cols="80" rows="'.ROWS_3.'">'.($_POST['description'] ? GETPOST('description','alpha') : $object->description).'</textarea>'; print '<textarea name="description" cols="80" rows="'.ROWS_3.'">'.($_POST['description'] ? GETPOST('description','alpha') : $object->description).'</textarea>';
print '</td></tr>'; print '</td></tr>';
@ -215,7 +215,7 @@ if ( $object->fetch($id) > 0 )
*/ */
print '<table width="100%" class="border">'; print '<table width="100%" class="border">';
print '<tr><td style="width:35%">'.$langs->trans("ResourceFormLabel_ref").'</td><td>'; print '<tr><td class="titlefield">'.$langs->trans("ResourceFormLabel_ref").'</td><td>';
$linkback = $objet->ref.' <a href="list.php">'.$langs->trans("BackToList").'</a>'; $linkback = $objet->ref.' <a href="list.php">'.$langs->trans("BackToList").'</a>';
print $form->showrefnav($object, 'id', $linkback,1,"rowid"); print $form->showrefnav($object, 'id', $linkback,1,"rowid");
print '</td>'; print '</td>';

View File

@ -127,7 +127,7 @@ if ($id > 0 || ! empty($ref))
*/ */
print '<table width="100%" class="border">'; print '<table width="100%" class="border">';
print '<tr><td style="width:35%">'.$langs->trans("ResourceFormLabel_ref").'</td><td>'; print '<tr><td class="titlefield">'.$langs->trans("ResourceFormLabel_ref").'</td><td>';
$linkback = $objet->ref.' <a href="list.php">'.$langs->trans("BackToList").'</a>'; $linkback = $objet->ref.' <a href="list.php">'.$langs->trans("BackToList").'</a>';
print $form->showrefnav($object, 'id', $linkback,1,"rowid"); print $form->showrefnav($object, 'id', $linkback,1,"rowid");
print '</td>'; print '</td>';

View File

@ -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"), 0, 'resource@resource');
// Construit liste des fichiers // Construit liste des fichiers
@ -104,7 +104,7 @@ if ($object->id)
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td style="width:35%">'.$langs->trans("ResourceFormLabel_ref").'</td><td>'; print '<tr><td class="titlefield">'.$langs->trans("ResourceFormLabel_ref").'</td><td>';
$linkback = $objet->ref.' <a href="list.php">'.$langs->trans("BackToList").'</a>'; $linkback = $objet->ref.' <a href="list.php">'.$langs->trans("BackToList").'</a>';
print $form->showrefnav($object, 'id', $linkback,1,"rowid"); print $form->showrefnav($object, 'id', $linkback,1,"rowid");
print '</td>'; print '</td>';

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> /* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2016 Laurent Destailleur <aldy@users.sourceforge.net>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2016 Gilles Poirier <glgpoirier@gmail.com> * Copyright (C) 2016 Gilles Poirier <glgpoirier@gmail.com>
* *
@ -44,6 +45,7 @@ $object->fetch($id,$ref);
$permissionnote=$user->rights->resource->write; // Used by the include of actions_setnotes.inc.php $permissionnote=$user->rights->resource->write; // Used by the include of actions_setnotes.inc.php
/* /*
* Actions * Actions
*/ */