mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
display fichinter rec link (#31767)
* display fichinter rec link * display fichinter rec link * display fichinter rec link * display fichinter rec link * display fichinter rec link * display fichinter rec link
This commit is contained in:
parent
6c9c177763
commit
273386f52f
|
|
@ -9170,11 +9170,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../../htdocs/core/lib/ftp.lib.php
|
||||
|
||||
-
|
||||
message: "#^Array has 2 duplicate keys with value 6 \\(\\\\LOG_INFO, \\\\LOG_DEBUG\\)\\.$#"
|
||||
count: 1
|
||||
path: ../../htdocs/core/lib/functions.lib.php
|
||||
|
||||
-
|
||||
message: "#^Comparison operation \"\\>\" between int\\<1, max\\> and 0 is always true\\.$#"
|
||||
count: 1
|
||||
|
|
@ -11470,11 +11465,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../../htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php
|
||||
|
||||
-
|
||||
message: "#^Array has 2 duplicate keys with value 6 \\(\\\\LOG_INFO, \\\\LOG_DEBUG\\)\\.$#"
|
||||
count: 1
|
||||
path: ../../htdocs/core/modules/syslog/mod_syslog_file.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$config of class Odf constructor expects string, array\\<string, mixed\\> given\\.$#"
|
||||
count: 1
|
||||
|
|
@ -14205,11 +14195,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../../htdocs/fichinter/index.php
|
||||
|
||||
-
|
||||
message: "#^Variable \\$user might not be defined\\.$#"
|
||||
count: 1
|
||||
path: ../../htdocs/fichinter/index.php
|
||||
|
||||
-
|
||||
message: "#^Ternary operator condition is always false\\.$#"
|
||||
count: 1
|
||||
|
|
@ -17955,11 +17940,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../../htdocs/opensurvey/class/opensurveysondage.class.php
|
||||
|
||||
-
|
||||
message: "#^Unreachable statement \\- code above always terminates\\.$#"
|
||||
count: 1
|
||||
path: ../../htdocs/opensurvey/exportcsv.php
|
||||
|
||||
-
|
||||
message: "#^Empty array passed to foreach\\.$#"
|
||||
count: 1
|
||||
|
|
|
|||
|
|
@ -787,7 +787,6 @@ ShowEmailcollectorFilter
|
|||
ShowEvaluation
|
||||
ShowEvaluationdet
|
||||
ShowFichinter
|
||||
ShowInterventionModel
|
||||
ShowInventory
|
||||
ShowJob
|
||||
ShowKnowledgeRecord
|
||||
|
|
|
|||
|
|
@ -278,6 +278,7 @@ $help_url = '';
|
|||
llxHeader('', $langs->trans("RepeatableIntervention"), $help_url, '', 0, 0, '', '', '', 'mod-fichinter page-card-rec');
|
||||
|
||||
$form = new Form($db);
|
||||
$fichinterrecstatic = new FichinterRec($db);
|
||||
$companystatic = new Societe($db);
|
||||
if (isModEnabled('contract')) {
|
||||
$contratstatic = new Contrat($db);
|
||||
|
|
@ -786,7 +787,7 @@ if ($action == 'create') {
|
|||
} else {
|
||||
// List mode
|
||||
|
||||
$sql = "SELECT f.rowid as fich_rec, s.nom as name, s.rowid as socid, f.rowid as facid, f.title,";
|
||||
$sql = "SELECT f.rowid as id, s.nom as name, s.rowid as socid, f.title,";
|
||||
$sql .= " f.duree, f.fk_contrat, f.fk_projet as fk_project, f.frequency, f.nb_gen_done, f.nb_gen_max,";
|
||||
$sql .= " f.date_last_gen, f.date_when, f.datec, f.status";
|
||||
|
||||
|
|
@ -851,16 +852,17 @@ if ($action == 'create') {
|
|||
print "</tr>\n";
|
||||
|
||||
|
||||
// les filtres à faire ensuite
|
||||
// TODO filters
|
||||
|
||||
if ($num > 0) {
|
||||
while ($i < min($num, $limit)) {
|
||||
$objp = $db->fetch_object($resql);
|
||||
$fichinterrecstatic->id = $objp->id;
|
||||
$fichinterrecstatic->ref = $objp->title;
|
||||
$fichinterrecstatic->title = $objp->title;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td><a href="'.$_SERVER['PHP_SELF'].'?id='.$objp->fich_rec.'">';
|
||||
print img_object($langs->trans("ShowIntervention"), "intervention").' '.$objp->title;
|
||||
print "</a></td>\n";
|
||||
print '<td>'.$fichinterrecstatic->getNomUrl(1)."</td>\n";
|
||||
if ($objp->socid) {
|
||||
$companystatic->id = $objp->socid;
|
||||
$companystatic->name = $objp->name;
|
||||
|
|
@ -919,7 +921,7 @@ if ($action == 'create') {
|
|||
if ($user->hasRight('ficheinter', 'creer')) {
|
||||
if (empty($objp->frequency) || $db->jdate($objp->date_when) <= $today) {
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=createfrommodel';
|
||||
print '&socid='.$objp->socid.'&id='.$objp->fich_rec.'&token='.newToken().'">';
|
||||
print '&socid='.$objp->socid.'&id='.$objp->id.'&token='.newToken().'">';
|
||||
print $langs->trans("NewIntervention").'</a>';
|
||||
} else {
|
||||
print $langs->trans("DateIsNotEnough");
|
||||
|
|
|
|||
|
|
@ -875,7 +875,7 @@ class Fichinter extends CommonObject
|
|||
$langs->load('interventions');
|
||||
|
||||
$datas = [];
|
||||
$datas['picto'] = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("Intervention").'</u>';
|
||||
$datas['picto'] = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("ShowIntervention").'</u>';
|
||||
if (isset($this->status)) {
|
||||
$datas['picto'] .= ' '.$this->getLibStatut(5);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -640,7 +640,7 @@ class FichinterRec extends Fichinter
|
|||
*/
|
||||
public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $moretitle = '')
|
||||
{
|
||||
global $langs, $hookmanager;
|
||||
global $action, $langs, $hookmanager;
|
||||
|
||||
$result = '';
|
||||
$label = $langs->trans("ShowInterventionModel").': '.$this->ref;
|
||||
|
|
@ -651,13 +651,11 @@ class FichinterRec extends Fichinter
|
|||
return $url;
|
||||
}
|
||||
|
||||
$picto = 'intervention';
|
||||
|
||||
$link = '<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
$linkend = '</a>';
|
||||
|
||||
if ($withpicto) {
|
||||
$result .= $link.img_object($label, $picto, 'class="classfortooltip"').$linkend;
|
||||
$result .= $link.img_object($label, $this->picto, 'class="classfortooltip"').$linkend;
|
||||
}
|
||||
if ($withpicto && $withpicto != 2) {
|
||||
$result .= ' ';
|
||||
|
|
@ -665,7 +663,7 @@ class FichinterRec extends Fichinter
|
|||
if ($withpicto != 2) {
|
||||
$result .= $link.$this->ref.$linkend;
|
||||
}
|
||||
global $action;
|
||||
|
||||
$hookmanager->initHooks(array($this->element . 'dao'));
|
||||
$parameters = array('id' => $this->id, 'getnomurl' => &$result);
|
||||
$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
|
|
@ -674,6 +672,7 @@ class FichinterRec extends Fichinter
|
|||
} else {
|
||||
$result .= $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,10 +31,7 @@ require '../main.inc.php';
|
|||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
|
||||
|
||||
if (!$user->hasRight('ficheinter', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
|
|
@ -44,6 +41,10 @@ if (!$user->hasRight('ficheinter', 'lire')) {
|
|||
* @var User $user
|
||||
*/
|
||||
|
||||
if (!$user->hasRight('ficheinter', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->load("interventions");
|
||||
|
||||
|
|
@ -66,6 +67,7 @@ $max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
|
|||
*/
|
||||
|
||||
$fichinterstatic = new Fichinter($db);
|
||||
$companystatic = new Societe($db);
|
||||
$form = new Form($db);
|
||||
$formfile = new FormFile($db);
|
||||
|
||||
|
|
@ -178,7 +180,7 @@ if ($resql) {
|
|||
|
||||
|
||||
/*
|
||||
* Draft orders
|
||||
* Draft interventions
|
||||
*/
|
||||
if (isModEnabled('intervention')) {
|
||||
$sql = "SELECT f.rowid, f.ref, s.nom as name, s.rowid as socid";
|
||||
|
|
@ -209,10 +211,14 @@ if (isModEnabled('intervention')) {
|
|||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$fichinterstatic->id = $obj->rowid;
|
||||
$fichinterstatic->ref = $obj->ref;
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap">';
|
||||
print "<a href=\"card.php?id=".$obj->rowid."\">".img_object($langs->trans("ShowFichinter"), "intervention").' '.$obj->ref."</a></td>";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"), "company").' '.dol_trunc($obj->name, 24).'</a></td></tr>';
|
||||
print '<td class="nowrap">'.$fichinterstatic->getNomUrl(1).'</td>';
|
||||
$companystatic->id = $obj->socid;
|
||||
$companystatic->name = $obj->name;
|
||||
print '<td>'.$companystatic->getNomUrl(1, 'customer').'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
|
@ -283,8 +289,9 @@ if ($resql) {
|
|||
print '</td></tr></table>';
|
||||
|
||||
print '</td>';
|
||||
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"), "company").' '.$obj->name.'</a></td>';
|
||||
$companystatic->id = $obj->socid;
|
||||
$companystatic->name = $obj->name;
|
||||
print '<td>'.$companystatic->getNomUrl(1, 'customer').'</td>';
|
||||
print '<td>'.dol_print_date($db->jdate($obj->datem), 'day').'</td>';
|
||||
print '<td class="right">'.$fichinterstatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
print '</tr>';
|
||||
|
|
@ -355,11 +362,10 @@ if (isModEnabled('intervention')) {
|
|||
print '</td></tr></table>';
|
||||
|
||||
print '</td>';
|
||||
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"), "company").' '.dol_trunc($obj->name, 24).'</a></td>';
|
||||
|
||||
$companystatic->id = $obj->socid;
|
||||
$companystatic->name = $obj->name;
|
||||
print '<td>'.$companystatic->getNomUrl(1, 'customer').'</td>';
|
||||
print '<td class="right">'.$fichinterstatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,3 +85,4 @@ TypeContact_fichinter_internal_INTERVENING=Intervenant
|
|||
TypeContact_fichinter_external_BILLING=Customer contact of intervention billing
|
||||
TypeContact_fichinter_external_CUSTOMER=Customer contact of intervention follow-up
|
||||
NotARecurringInterventionalTemplate=Not a recurring intervention template
|
||||
ShowInterventionModel=Show intervention model
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user