*
* This program is free software; you can redistribute it and/or modify
@@ -31,7 +31,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php';
$langs->load('companies');
$langs->load("interventions");
+$socid=0;
$id = GETPOST('id','int');
+$ref=GETPOST('ref','alpha');
// Security check
if ($user->societe_id) $socid=$user->societe_id;
@@ -39,9 +41,10 @@ $result = restrictedArea($user, 'ficheinter', $id, 'fichinter');
$object = new Fichinter($db);
-if ($id > 0)
+if (! $object->fetch($id, $ref) > 0)
{
- $object->fetch($id);
+ dol_print_error($db);
+ exit;
}
@@ -51,13 +54,63 @@ if ($id > 0)
llxHeader('',$langs->trans("Intervention"));
-$societe = new Societe($db);
-$societe->fetch($object->socid);
+$object->fetch_thirdparty();
+$object->info($object->id);
$head = fichinter_prepare_head($object);
dol_fiche_head($head, 'info', $langs->trans('InterventionCard'), 0, 'intervention');
-$object->info($object->id);
+// Intervention card
+$linkback = ''.$langs->trans("BackToList").'';
+
+
+$morehtmlref='';
+// Ref customer
+//$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
+//$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
+// Thirdparty
+$morehtmlref.=$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
+// Project
+if (! empty($conf->projet->enabled))
+{
+ $langs->load("projects");
+ $morehtmlref.='
'.$langs->trans('Project') . ' ';
+ if ($user->rights->commande->creer)
+ {
+ if ($action != 'classify')
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ $morehtmlref.=' : ';
+ if ($action == 'classify') {
+ //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
+ $morehtmlref.='
';
+ } else {
+ $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
+ }
+ } else {
+ if (! empty($object->fk_project)) {
+ $proj = new Project($db);
+ $proj->fetch($object->fk_project);
+ $morehtmlref.='
';
+ $morehtmlref.=$proj->ref;
+ $morehtmlref.='';
+ } else {
+ $morehtmlref.='';
+ }
+ }
+}
+$morehtmlref.='
';
+
+dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
+
+print '';
+print '
';
+
+print '
';
print '
| ';
dol_print_object_info($object);
@@ -65,5 +118,7 @@ print ' |
';
print '
';
+dol_fiche_end();
+
llxFooter();
$db->close();
diff --git a/htdocs/fichinter/note.php b/htdocs/fichinter/note.php
index c672d48cb71..1da0b0c425c 100644
--- a/htdocs/fichinter/note.php
+++ b/htdocs/fichinter/note.php
@@ -60,31 +60,67 @@ $form = new Form($db);
if ($id > 0 || ! empty($ref))
{
- $societe = new Societe($db);
- if ($societe->fetch($object->socid))
+ $object->fetch_thirdparty();
+
+ $head = fichinter_prepare_head($object);
+ dol_fiche_head($head, 'note', $langs->trans('InterventionCard'), 0, 'intervention');
+
+ // Intervention card
+ $linkback = ''.$langs->trans("BackToList").'';
+
+
+ $morehtmlref='';
+ // Ref customer
+ //$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
+ //$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
+ // Thirdparty
+ $morehtmlref.=$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
+ // Project
+ if (! empty($conf->projet->enabled))
{
- $head = fichinter_prepare_head($object);
- dol_fiche_head($head, 'note', $langs->trans('InterventionCard'), 0, 'intervention');
-
- print '
';
-
- $linkback = ''.$langs->trans("BackToList").'';
-
- print '| '.$langs->trans('Ref').' | ';
- print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
- print ' |
';
-
- // Company
- print '| '.$langs->trans('Company').' | '.$societe->getNomUrl(1).' |
';
-
- print "
";
-
- print '
';
-
- include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
-
- dol_fiche_end();
+ $langs->load("projects");
+ $morehtmlref.='
'.$langs->trans('Project') . ' ';
+ if ($user->rights->commande->creer)
+ {
+ if ($action != 'classify')
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ $morehtmlref.=' : ';
+ if ($action == 'classify') {
+ //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
+ $morehtmlref.='
';
+ } else {
+ $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
+ }
+ } else {
+ if (! empty($object->fk_project)) {
+ $proj = new Project($db);
+ $proj->fetch($object->fk_project);
+ $morehtmlref.='
';
+ $morehtmlref.=$proj->ref;
+ $morehtmlref.='';
+ } else {
+ $morehtmlref.='';
+ }
+ }
}
+ $morehtmlref.='
';
+
+ dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
+
+ print '';
+ print '
';
+
+ $cssclass="titlefield";
+ include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
+
+ print '
';
+
+ dol_fiche_end();
}
llxFooter();
diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php
index 27451b07973..87354c6fd9d 100644
--- a/htdocs/resource/element_resource.php
+++ b/htdocs/resource/element_resource.php
@@ -28,7 +28,7 @@ $res=@include("../main.inc.php"); // For root dire
if (! $res) $res=@include("../../main.inc.php"); // For "custom" directory
if (! $res) die("Include of main fails");
-require 'class/dolresource.class.php';
+require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
@@ -52,6 +52,7 @@ $object->available_resources = array('dolresource');
// Get parameters
$id = GETPOST('id','int');
+$ref = GETPOST('ref','alpha');
$action = GETPOST('action','alpha');
$mode = GETPOST('mode','alpha');
$lineid = GETPOST('lineid','int');
@@ -79,50 +80,50 @@ if ($socid > 0)
if ($action == 'add_element_resource' && ! $cancel)
{
- $error++;
- $res = 0;
- if (! ($resource_id > 0))
- {
- $error++;
- setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Resource")), null, 'errors');
- $action='';
- }
- else
- {
- $objstat = fetchObjectByElement($element_id, $element);
+ $error++;
+ $res = 0;
+ if (! ($resource_id > 0))
+ {
+ $error++;
+ setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Resource")), null, 'errors');
+ $action='';
+ }
+ else
+ {
+ $objstat = fetchObjectByElement($element_id, $element);
- $res = $objstat->add_element_resource($resource_id, $resource_type, $busy, $mandatory);
- }
- if (! $error && $res > 0)
- {
- setEventMessages($langs->trans('ResourceLinkedWithSuccess'), null, 'mesgs');
- header("Location: ".$_SERVER['PHP_SELF'].'?element='.$element.'&element_id='.$element_id);
- exit;
- }
+ $res = $objstat->add_element_resource($resource_id, $resource_type, $busy, $mandatory);
+ }
+ if (! $error && $res > 0)
+ {
+ setEventMessages($langs->trans('ResourceLinkedWithSuccess'), null, 'mesgs');
+ header("Location: ".$_SERVER['PHP_SELF'].'?element='.$element.'&element_id='.$element_id);
+ exit;
+ }
}
// Update ressource
if ($action == 'update_linked_resource' && $user->rights->resource->write && !GETPOST('cancel') )
{
- $res = $object->fetch_element_resource($lineid);
- if($res)
- {
- $object->busy = $busy;
- $object->mandatory = $mandatory;
+ $res = $object->fetch_element_resource($lineid);
+ if($res)
+ {
+ $object->busy = $busy;
+ $object->mandatory = $mandatory;
- $result = $object->update_element_resource($user);
+ $result = $object->update_element_resource($user);
- if ($result >= 0)
- {
- setEventMessages($langs->trans('RessourceLineSuccessfullyUpdated'), null, 'mesgs');
- header("Location: ".$_SERVER['PHP_SELF']."?element=".$element."&element_id=".$element_id);
- exit;
- }
- else
- {
- setEventMessages($object->error, $object->errors, 'errors');
- }
- }
+ if ($result >= 0)
+ {
+ setEventMessages($langs->trans('RessourceLineSuccessfullyUpdated'), null, 'mesgs');
+ header("Location: ".$_SERVER['PHP_SELF']."?element=".$element."&element_id=".$element_id);
+ exit;
+ }
+ else
+ {
+ setEventMessages($object->error, $object->errors, 'errors');
+ }
+ }
}
// Delete a resource linked to an element
@@ -166,212 +167,236 @@ llxHeader('',$pagetitle,'');
// Load available resource, declared by modules
$ret = count($object->available_resources);
if($ret == -1) {
- dol_print_error($db,$object->error);
- exit;
+ dol_print_error($db,$object->error);
+ exit;
}
if (!$ret) {
- print ''.$langs->trans('NoResourceInDatabase').'
';
+ print ''.$langs->trans('NoResourceInDatabase').'
';
}
else
{
- // Confirmation suppression resource line
- if ($action == 'delete_resource')
- {
- print $form->formconfirm("element_resource.php?element=".$element."&element_id=".$element_id."&id=".$id."&lineid=".$lineid,$langs->trans("DeleteResource"),$langs->trans("ConfirmDeleteResourceElement"),"confirm_delete_linked_resource",'','',1);
- }
+ // Confirmation suppression resource line
+ if ($action == 'delete_resource')
+ {
+ print $form->formconfirm("element_resource.php?element=".$element."&element_id=".$element_id."&id=".$id."&lineid=".$lineid,$langs->trans("DeleteResource"),$langs->trans("ConfirmDeleteResourceElement"),"confirm_delete_linked_resource",'','',1);
+ }
- /*
- * Specific to agenda module
- */
- if ($element_id && $element == 'action')
- {
- require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
+ // Specific to agenda module
+ if ($element_id && $element == 'action')
+ {
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
- $act = fetchObjectByElement($element_id,$element);
- if (is_object($act))
- {
+ $act = fetchObjectByElement($element_id,$element);
+ if (is_object($act))
+ {
- $head=actions_prepare_head($act);
+ $head=actions_prepare_head($act);
- dol_fiche_head($head, 'resources', $langs->trans("Action"),0,'action');
+ dol_fiche_head($head, 'resources', $langs->trans("Action"),0,'action');
- $linkback =img_picto($langs->trans("BackToList"),'object_list','class="hideonsmartphone pictoactionview"');
- $linkback.= ''.$langs->trans("BackToList").'';
+ $linkback =img_picto($langs->trans("BackToList"),'object_list','class="hideonsmartphone pictoactionview"');
+ $linkback.= ''.$langs->trans("BackToList").'';
- // Link to other agenda views
- $out='';
- $out.=img_picto($langs->trans("ViewPerUser"),'object_calendarperuser','class="hideonsmartphone pictoactionview"');
- $out.=''.$langs->trans("ViewPerUser").'';
- $out.='
';
- $out.=img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone pictoactionview"');
- $out.=''.$langs->trans("ViewCal").'';
- $out.=img_picto($langs->trans("ViewWeek"),'object_calendarweek','class="hideonsmartphone pictoactionview"');
- $out.=''.$langs->trans("ViewWeek").'';
- $out.=img_picto($langs->trans("ViewDay"),'object_calendarday','class="hideonsmartphone pictoactionview"');
- $out.=''.$langs->trans("ViewDay").'';
-
- $linkback.=$out;
-
- dol_banner_tab($act, 'element_id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '', "&element=".$element);
-
- print '';
-
- // Ref
- /*print '| '.$langs->trans("Ref").' | ';
- print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
- print ' |
';*/
+ // Link to other agenda views
+ $out='';
+ $out.=img_picto($langs->trans("ViewPerUser"),'object_calendarperuser','class="hideonsmartphone pictoactionview"');
+ $out.=''.$langs->trans("ViewPerUser").'';
+ $out.='
';
+ $out.=img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone pictoactionview"');
+ $out.=''.$langs->trans("ViewCal").'';
+ $out.=img_picto($langs->trans("ViewWeek"),'object_calendarweek','class="hideonsmartphone pictoactionview"');
+ $out.=''.$langs->trans("ViewWeek").'';
+ $out.=img_picto($langs->trans("ViewDay"),'object_calendarday','class="hideonsmartphone pictoactionview"');
+ $out.=''.$langs->trans("ViewDay").'';
- // Affichage fiche action en mode visu
- print '';
+ $linkback.=$out;
- // Type
- if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
- {
- print '| '.$langs->trans("Type").' | '.$act->type.' |
';
- }
+ dol_banner_tab($act, 'element_id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '', "&element=".$element);
- // Full day event
- print '| '.$langs->trans("EventOnFullDay").' | '.yn($act->fulldayevent, 3).' |
';
-
- // Date start
- print '| '.$langs->trans("DateActionStart").' | ';
- if (! $act->fulldayevent) print dol_print_date($act->datep,'dayhour');
- else print dol_print_date($act->datep,'day');
- if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late"));
- print ' | ';
- print '
';
-
- // Date end
- print '| '.$langs->trans("DateActionEnd").' | ';
- if (! $act->fulldayevent) print dol_print_date($act->datef,'dayhour');
- else print dol_print_date($act->datef,'day');
- if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late"));
- print ' |
';
-
- // Status
- /*print '| '.$langs->trans("Status").' / '.$langs->trans("Percentage").' | ';
- print $act->getLibStatut(4);
- print ' |
';*/
-
- // Location
- if (empty($conf->global->AGENDA_DISABLE_LOCATION))
- {
- print '| '.$langs->trans("Location").' | '.$act->location.' |
';
- }
-
- // Assigned to
- print '| '.$langs->trans("ActionAffectedTo").' | ';
- $listofuserid=array();
- if (empty($donotclearsession))
- {
- if ($act->userownerid > 0) $listofuserid[$act->userownerid]=array('id'=>$act->userownerid,'transparency'=>$act->transparency); // Owner first
- if (! empty($act->userassigned)) // Now concat assigned users
- {
- // Restore array with key with same value than param 'id'
- $tmplist1=$act->userassigned; $tmplist2=array();
- foreach($tmplist1 as $key => $val)
- {
- if ($val['id'] && $val['id'] != $act->userownerid) $listofuserid[$val['id']]=$val;
- }
- }
- $_SESSION['assignedtouser']=json_encode($listofuserid);
- }
- else
- {
- if (!empty($_SESSION['assignedtouser']))
- {
- $listofuserid=json_decode($_SESSION['assignedtouser'], true);
- }
- }
- print ' ';
- print $form->select_dolusers_forevent('view', 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
- print ' ';
- if (in_array($user->id,array_keys($listofuserid)))
- {
- print '';
- print $langs->trans("MyAvailability").': '.(($act->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody
- print ' ';
- }
- print ' |
';
-
- print '
';
+ print '';
- dol_fiche_end();
- }
- }
+ // Ref
+ /*print '| '.$langs->trans("Ref").' | ';
+ print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
+ print ' |
';*/
- /*
- * Specific to thirdparty module
- */
- if ($element_id && $element == 'societe')
- {
- $socstatic = fetchObjectByElement($element_id, $element);
- if (is_object($socstatic)) {
- $savobject = $object;
-
- $object = $socstatic;
-
- require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
- $head = societe_prepare_head($socstatic);
-
- dol_fiche_head($head, 'resources', $langs->trans("ThirdParty"), 0, 'company');
-
- dol_banner_tab($socstatic, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom');
-
- print '';
-
- print '
';
- print '
';
-
- // Alias name (commercial, trademark or alias name)
- print '| ' . $langs->trans('AliasNames') . ' | ';
- print $socstatic->name_alias;
- print " |
";
-
- print '
';
-
- print '
';
-
- dol_fiche_end();
-
- $object = $savobject;
- }
- }
+ // Affichage fiche action en mode visu
+ print '';
- /*
- * Specific to fichinter module
- */
+ // Type
+ if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
+ {
+ print '| '.$langs->trans("Type").' | '.$act->type.' |
';
+ }
+
+ // Full day event
+ print '| '.$langs->trans("EventOnFullDay").' | '.yn($act->fulldayevent, 3).' |
';
+
+ // Date start
+ print '| '.$langs->trans("DateActionStart").' | ';
+ if (! $act->fulldayevent) print dol_print_date($act->datep,'dayhour');
+ else print dol_print_date($act->datep,'day');
+ if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late"));
+ print ' | ';
+ print '
';
+
+ // Date end
+ print '| '.$langs->trans("DateActionEnd").' | ';
+ if (! $act->fulldayevent) print dol_print_date($act->datef,'dayhour');
+ else print dol_print_date($act->datef,'day');
+ if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late"));
+ print ' |
';
+
+ // Status
+ /*print '| '.$langs->trans("Status").' / '.$langs->trans("Percentage").' | ';
+ print $act->getLibStatut(4);
+ print ' |
';*/
+
+ // Location
+ if (empty($conf->global->AGENDA_DISABLE_LOCATION))
+ {
+ print '| '.$langs->trans("Location").' | '.$act->location.' |
';
+ }
+
+ // Assigned to
+ print '| '.$langs->trans("ActionAffectedTo").' | ';
+ $listofuserid=array();
+ if (empty($donotclearsession))
+ {
+ if ($act->userownerid > 0) $listofuserid[$act->userownerid]=array('id'=>$act->userownerid,'transparency'=>$act->transparency); // Owner first
+ if (! empty($act->userassigned)) // Now concat assigned users
+ {
+ // Restore array with key with same value than param 'id'
+ $tmplist1=$act->userassigned; $tmplist2=array();
+ foreach($tmplist1 as $key => $val)
+ {
+ if ($val['id'] && $val['id'] != $act->userownerid) $listofuserid[$val['id']]=$val;
+ }
+ }
+ $_SESSION['assignedtouser']=json_encode($listofuserid);
+ }
+ else
+ {
+ if (!empty($_SESSION['assignedtouser']))
+ {
+ $listofuserid=json_decode($_SESSION['assignedtouser'], true);
+ }
+ }
+ print ' ';
+ print $form->select_dolusers_forevent('view', 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
+ print ' ';
+ if (in_array($user->id,array_keys($listofuserid)))
+ {
+ print '';
+ print $langs->trans("MyAvailability").': '.(($act->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody
+ print ' ';
+ }
+ print ' |
';
+
+ print '
';
+
+ dol_fiche_end();
+ }
+ }
+
+ // Specific to thirdparty module
+ if ($element_id && $element == 'societe')
+ {
+ $socstatic = fetchObjectByElement($element_id, $element);
+ if (is_object($socstatic)) {
+
+ $savobject = $object;
+ $object = $socstatic;
+
+ require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
+ $head = societe_prepare_head($socstatic);
+
+ dol_fiche_head($head, 'resources', $langs->trans("ThirdParty"), 0, 'company');
+
+ dol_banner_tab($socstatic, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom');
+
+ print '';
+
+ print '
';
+ print '
';
+
+ // Alias name (commercial, trademark or alias name)
+ print '| ' . $langs->trans('AliasNames') . ' | ';
+ print $socstatic->name_alias;
+ print " |
";
+
+ print '
';
+
+ print '
';
+
+ dol_fiche_end();
+
+ $object = $savobject;
+ }
+ }
+
+ // Specific to fichinter module
if ($element_id && $element == 'fichinter')
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php';
$fichinter = new Fichinter($db);
$fichinter->fetch($element_id);
+ $fichinter->fetch_thirdparty();
+
if (is_object($fichinter))
{
$head=fichinter_prepare_head($fichinter);
dol_fiche_head($head, 'resource', $langs->trans("InterventionCard"),0,'intervention');
- // Affichage fiche action en mode visu
- print '';
-
+ // Intervention card
$linkback = ''.$langs->trans("BackToList").'';
-
- // Ref
- print '| '.$langs->trans("Ref").' | ';
- print $form->showrefnav($fichinter, 'id', $linkback, ($user->societe_id?0:1), 'ref', 'ref', '');
- print ' |
';
-
-
- // Customer
- if ( is_null($fichinter->thirdparty) )
- $fichinter->fetch_thirdparty();
-
- print "| ".$langs->trans("Company")." | ";
- print ''.$fichinter->thirdparty->getNomUrl(1).' |
';
- print "
";
-
+
+
+ $morehtmlref='';
+ // Ref customer
+ //$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
+ //$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
+ // Thirdparty
+ $morehtmlref.=$langs->trans('ThirdParty') . ' : ' . $fichinter->thirdparty->getNomUrl(1);
+ // Project
+ if (! empty($conf->projet->enabled))
+ {
+ $langs->load("projects");
+ $morehtmlref.='
'.$langs->trans('Project') . ' ';
+ if ($user->rights->commande->creer)
+ {
+ if ($action != 'classify')
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ $morehtmlref.=' : ';
+ if ($action == 'classify') {
+ //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $fichinter->id, $fichinter->socid, $fichinter->fk_project, 'projectid', 0, 0, 1, 1);
+ $morehtmlref.='
';
+ } else {
+ $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $fichinter->id, $fichinter->socid, $fichinter->fk_project, 'none', 0, 0, 0, 1);
+ }
+ } else {
+ if (! empty($fichinter->fk_project)) {
+ $proj = new Project($db);
+ $proj->fetch($fichinter->fk_project);
+ $morehtmlref.='
';
+ $morehtmlref.=$proj->ref;
+ $morehtmlref.='';
+ } else {
+ $morehtmlref.='';
+ }
+ }
+ }
+ $morehtmlref.='
';
+
+ dol_banner_tab($fichinter, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
+
dol_fiche_end();
}
}
@@ -383,54 +408,54 @@ else
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
- //print load_fiche_titre($langs->trans('ResourcesLinkedToElement'),'','');
- print '
';
-
+ //print load_fiche_titre($langs->trans('ResourcesLinkedToElement'),'','');
+ print '
';
+
// Show list of resource links
- foreach ($object->available_resources as $modresources => $resources)
- {
- $resources=(array) $resources; // To be sure $resources is an array
- foreach($resources as $resource_obj)
- {
- $element_prop = getElementProperties($resource_obj);
+ foreach ($object->available_resources as $modresources => $resources)
+ {
+ $resources=(array) $resources; // To be sure $resources is an array
+ foreach($resources as $resource_obj)
+ {
+ $element_prop = getElementProperties($resource_obj);
- //print '/'.$modresources.'/class/'.$resource_obj.'.class.php
';
+ //print '/'.$modresources.'/class/'.$resource_obj.'.class.php
';
- $path = '';
- if(strpos($resource_obj,'@'))
- $path .= '/'.$element_prop['module'];
+ $path = '';
+ if(strpos($resource_obj,'@'))
+ $path .= '/'.$element_prop['module'];
- $linked_resources = $object->getElementResources($element,$element_id,$resource_obj);
+ $linked_resources = $object->getElementResources($element,$element_id,$resource_obj);
- // If we have a specific template we use it
- if(file_exists(dol_buildpath($path.'/core/tpl/resource_'.$element_prop['element'].'_add.tpl.php')))
- {
- $res=include dol_buildpath($path.'/core/tpl/resource_'.$element_prop['element'].'_add.tpl.php');
- }
- else
- {
- $res=include DOL_DOCUMENT_ROOT . '/core/tpl/resource_add.tpl.php';
- }
+ // If we have a specific template we use it
+ if(file_exists(dol_buildpath($path.'/core/tpl/resource_'.$element_prop['element'].'_add.tpl.php')))
+ {
+ $res=include dol_buildpath($path.'/core/tpl/resource_'.$element_prop['element'].'_add.tpl.php');
+ }
+ else
+ {
+ $res=include DOL_DOCUMENT_ROOT . '/core/tpl/resource_add.tpl.php';
+ }
- if ($mode != 'add' || $resource_obj != $resource_type)
- {
- //print load_fiche_titre($langs->trans(ucfirst($element_prop['element']).'Singular'));
+ if ($mode != 'add' || $resource_obj != $resource_type)
+ {
+ //print load_fiche_titre($langs->trans(ucfirst($element_prop['element']).'Singular'));
- // If we have a specific template we use it
- if(file_exists(dol_buildpath($path.'/core/tpl/resource_'.$element_prop['element'].'_view.tpl.php')))
- {
- $res=@include dol_buildpath($path.'/core/tpl/resource_'.$element_prop['element'].'_view.tpl.php');
+ // If we have a specific template we use it
+ if(file_exists(dol_buildpath($path.'/core/tpl/resource_'.$element_prop['element'].'_view.tpl.php')))
+ {
+ $res=@include dol_buildpath($path.'/core/tpl/resource_'.$element_prop['element'].'_view.tpl.php');
- }
- else
- {
- $res=include DOL_DOCUMENT_ROOT . '/core/tpl/resource_view.tpl.php';
- }
- }
- }
- }
+ }
+ else
+ {
+ $res=include DOL_DOCUMENT_ROOT . '/core/tpl/resource_view.tpl.php';
+ }
+ }
+ }
+ }
}
llxFooter();