Fix: Navigation arrows were missing

This commit is contained in:
Laurent Destailleur 2012-03-18 01:25:08 +01:00
parent 763eb8f32c
commit 9ed46d9892
5 changed files with 64 additions and 82 deletions

View File

@ -220,7 +220,7 @@ class Fichinter extends CommonObject
$sql.= " f.tms as datem,"; $sql.= " f.tms as datem,";
$sql.= " f.duree, f.fk_projet, f.note_public, f.note_private, f.model_pdf, f.extraparams"; $sql.= " f.duree, f.fk_projet, f.note_public, f.note_private, f.model_pdf, f.extraparams";
$sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f";
if ($ref) $sql.= " WHERE f.ref='".$ref."'"; if ($ref) $sql.= " WHERE f.ref='".$this->db->escape($ref)."'";
else $sql.= " WHERE f.rowid=".$rowid; else $sql.= " WHERE f.rowid=".$rowid;
dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);

View File

@ -34,6 +34,7 @@ $langs->load("sendings");
$langs->load("companies"); $langs->load("companies");
$id = GETPOST('id','int'); $id = GETPOST('id','int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
// Security check // Security check
@ -41,6 +42,7 @@ if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'ficheinter', $id, 'fichinter'); $result = restrictedArea($user, 'ficheinter', $id, 'fichinter');
$object = new Fichinter($db); $object = new Fichinter($db);
$result = $object->fetch($id,$ref);
/* /*
@ -49,8 +51,6 @@ $object = new Fichinter($db);
if ($action == 'addcontact' && $user->rights->ficheinter->creer) if ($action == 'addcontact' && $user->rights->ficheinter->creer)
{ {
$result = $object->fetch($id);
if ($result > 0 && $id > 0) if ($result > 0 && $id > 0)
{ {
$result = $object->add_contact(GETPOST('contactid','int'), GETPOST('type','int'), GETPOST('source','alpha')); $result = $object->add_contact(GETPOST('contactid','int'), GETPOST('type','int'), GETPOST('source','alpha'));
@ -78,20 +78,12 @@ if ($action == 'addcontact' && $user->rights->ficheinter->creer)
// bascule du statut d'un contact // bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->ficheinter->creer) else if ($action == 'swapstatut' && $user->rights->ficheinter->creer)
{ {
if ($object->fetch($id)) $result=$object->swapContactStatus(GETPOST('ligne','int'));
{
$result=$object->swapContactStatus(GETPOST('ligne','int'));
}
else
{
dol_print_error($db);
}
} }
// Efface un contact // Efface un contact
else if ($action == 'deletecontact' && $user->rights->ficheinter->creer) else if ($action == 'deletecontact' && $user->rights->ficheinter->creer)
{ {
$object->fetch($id);
$result = $object->delete_contact(GETPOST('lineid','int')); $result = $object->delete_contact(GETPOST('lineid','int'));
if ($result >= 0) if ($result >= 0)
@ -109,63 +101,51 @@ else if ($action == 'deletecontact' && $user->rights->ficheinter->creer)
* View * View
*/ */
llxHeader();
$form = new Form($db); $form = new Form($db);
$formcompany = new FormCompany($db); $formcompany = new FormCompany($db);
$contactstatic=new Contact($db); $contactstatic=new Contact($db);
$userstatic=new User($db); $userstatic=new User($db);
llxHeader();
/* *************************************************************************** */
/* */ // Mode vue et edition
/* Mode vue et edition */
/* */
/* *************************************************************************** */
dol_htmloutput_mesg($mesg); dol_htmloutput_mesg($mesg);
if ($id > 0 || ! empty($ref))
if ($id > 0)
{ {
if ($object->fetch($id) > 0) $soc = new Societe($db);
{ $soc->fetch($object->socid);
$soc = new Societe($db);
$soc->fetch($object->socid);
$head = fichinter_prepare_head($object); $head = fichinter_prepare_head($object);
dol_fiche_head($head, 'contact', $langs->trans("InterventionCard"), 0, 'intervention'); dol_fiche_head($head, 'contact', $langs->trans("InterventionCard"), 0, 'intervention');
/* /*
* Fiche intervention synthese pour rappel * Fiche intervention synthese pour rappel
*/ */
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Ref // Ref
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">'; print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $object->ref; print $form->showrefnav($object,'ref','',1,'ref','ref');
print "</td></tr>"; print "</td></tr>";
// Customer // Customer
if ( is_null($object->client) ) if ( is_null($object->client) )
$object->fetch_thirdparty(); $object->fetch_thirdparty();
print "<tr><td>".$langs->trans("Company")."</td>"; print "<tr><td>".$langs->trans("Company")."</td>";
print '<td colspan="3">'.$object->client->getNomUrl(1).'</td></tr>'; print '<td colspan="3">'.$object->client->getNomUrl(1).'</td></tr>';
print "</table>"; print "</table>";
print '</div>'; print '</div>';
print '<br>'; print '<br>';
// Contacts lines // Contacts lines
include(DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php'); include(DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php');
}
else
{
print "ErrorRecordNotFound";
}
} }

View File

@ -39,6 +39,7 @@ $langs->load("companies");
$langs->load("interventions"); $langs->load("interventions");
$id = GETPOST('id','int'); $id = GETPOST('id','int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
// Security check // Security check
@ -59,7 +60,7 @@ if (! $sortfield) $sortfield="name";
$object = new Fichinter($db); $object = new Fichinter($db);
$object->fetch($id); $object->fetch($id, $ref);
$upload_dir = $conf->ficheinter->dir_output.'/'.dol_sanitizeFileName($object->ref); $upload_dir = $conf->ficheinter->dir_output.'/'.dol_sanitizeFileName($object->ref);
$modulepart='fichinter'; $modulepart='fichinter';
@ -155,7 +156,9 @@ if ($object->id)
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Ref // Ref
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>'.$object->ref.'</td></tr>'; print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
print $form->showrefnav($object,'ref','',1,'ref','ref');
print '</td></tr>';
// Societe // Societe
print "<tr><td>".$langs->trans("Company")."</td><td>".$object->client->getNomUrl(1)."</td></tr>"; print "<tr><td>".$langs->trans("Company")."</td><td>".$object->client->getNomUrl(1)."</td></tr>";

View File

@ -227,7 +227,7 @@ else if ($action == 'setnote_public' && $user->rights->ficheinter->creer)
else if ($action == 'setnote_private' && $user->rights->ficheinter->creer) else if ($action == 'setnote_private' && $user->rights->ficheinter->creer)
{ {
$object->fetch($id); $object->fetch($id);
$result=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES)); $result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error); if ($result < 0) dol_print_error($db,$object->error);
} }

View File

@ -30,6 +30,7 @@ $langs->load('companies');
$langs->load("interventions"); $langs->load("interventions");
$id = GETPOST('id','int'); $id = GETPOST('id','int');
$ref = GETPOST('ref', 'alpha');
$action=GETPOST('action','alpha'); $action=GETPOST('action','alpha');
// Security check // Security check
@ -37,62 +38,60 @@ if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'ficheinter', $id, 'fichinter'); $result = restrictedArea($user, 'ficheinter', $id, 'fichinter');
$object = new Fichinter($db); $object = new Fichinter($db);
$object->fetch($id,$ref);
/******************************************************************************/ /*
/* Actions */ * Actions
/******************************************************************************/ */
if ($action == 'setnote_public' && $user->rights->ficheinter->creer) if ($action == 'setnote_public' && $user->rights->ficheinter->creer)
{ {
$object->fetch($id);
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES)); $result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error); if ($result < 0) dol_print_error($db,$object->error);
} }
else if ($action == 'setnote' && $user->rights->ficheinter->creer) else if ($action == 'setnote_private' && $user->rights->ficheinter->creer)
{ {
$object->fetch($id); $result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES));
$result=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error); if ($result < 0) dol_print_error($db,$object->error);
} }
/******************************************************************************/ /*
/* Affichage fiche */ * View
/******************************************************************************/ */
llxHeader(); llxHeader();
$form = new Form($db); $form = new Form($db);
if ($id > 0) if ($id > 0 || ! empty($ref))
{ {
if ($mesg) print $mesg; dol_htmloutput_mesg($mesg);
if ($object->fetch($id)) $societe = new Societe($db);
if ($societe->fetch($object->socid))
{ {
$societe = new Societe($db); $head = fichinter_prepare_head($object);
if ($societe->fetch($object->socid)) dol_fiche_head($head, 'note', $langs->trans('InterventionCard'), 0, 'intervention');
{
$head = fichinter_prepare_head($object);
dol_fiche_head($head, 'note', $langs->trans('InterventionCard'), 0, 'intervention');
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">'.$object->ref.'</td></tr>'; print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">';
print $form->showrefnav($object,'ref','',1,'ref','ref');
print '</td></tr>';
// Company // Company
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="3">'.$societe->getNomUrl(1).'</td></tr>'; print '<tr><td>'.$langs->trans('Company').'</td><td colspan="3">'.$societe->getNomUrl(1).'</td></tr>';
print "</table>"; print "</table>";
print '<br>'; print '<br>';
include(DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'); include(DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php');
print '</div>'; print '</div>';
}
} }
} }