Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
a776b65be0
@ -2130,14 +2130,16 @@ class AccountancyExport
|
||||
//Calcul de la longueur des numéros de comptes
|
||||
$taille_numero = strlen(length_accountg($line->numero_compte));
|
||||
|
||||
//Création du numéro de client générique
|
||||
//Création du numéro de client et fournisseur générique
|
||||
$numero_cpt_client = '411';
|
||||
$numero_cpt_fourn = '401';
|
||||
for ($i = 1; $i <= ($taille_numero - 3); $i++) {
|
||||
$numero_cpt_client .= '0';
|
||||
$numero_cpt_fourn .= '0';
|
||||
}
|
||||
|
||||
//Création des comptes auxiliaire des clients
|
||||
if (length_accountg($line->numero_compte) == $numero_cpt_client) {
|
||||
//Création des comptes auxiliaire des clients et fournisseur
|
||||
if (length_accountg($line->numero_compte) == $numero_cpt_client || length_accountg($line->numero_compte) == $numero_cpt_fourn) {
|
||||
$tab[] = rtrim(length_accounta($line->subledger_account), "0");
|
||||
} else {
|
||||
$tab[] = length_accountg($line->numero_compte);
|
||||
|
||||
@ -65,7 +65,7 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
|
||||
|
||||
$textobject = $langs->transnoentitiesnoconv("Members");
|
||||
|
||||
$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros';
|
||||
$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
|
||||
llxHeader('', $langs->trans("MembersSetup"), $help_url);
|
||||
|
||||
|
||||
|
||||
@ -99,7 +99,7 @@ if ($action == 'update') {
|
||||
$form = new Form($db);
|
||||
|
||||
$title = $langs->trans("MembersSetup");
|
||||
$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros';
|
||||
$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
|
||||
|
||||
@ -71,6 +71,9 @@ $search_agenda_label = GETPOST('search_agenda_label');
|
||||
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||
$objcanvas = null;
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('memberagenda'));
|
||||
|
||||
// Security check
|
||||
$result = restrictedArea($user, 'adherent', $id);
|
||||
|
||||
|
||||
@ -2287,6 +2287,7 @@ class Adherent extends CommonObject
|
||||
global $conf, $langs;
|
||||
|
||||
$datas = [];
|
||||
$langs->loadLangs(['members', 'companies']);
|
||||
|
||||
$nofetch = empty($params['nofetch']) ? false : true;
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
@ -2303,6 +2304,9 @@ class Adherent extends CommonObject
|
||||
|
||||
$datas['divopen'] = '<div class="centpercent">';
|
||||
$datas['picto'] = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("Member").'</u> '.$this->getLibStatut(4);
|
||||
if (!empty($this->morphy)) {
|
||||
$datas['picto'] .= ' ' . $this->getmorphylib('', 1);
|
||||
}
|
||||
if (!empty($this->ref)) {
|
||||
$datas['ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
}
|
||||
|
||||
@ -706,6 +706,18 @@ class AdherentType extends CommonObject
|
||||
if (isset($this->subscription)) {
|
||||
$datas['subscription'] = '<br>'.$langs->trans("SubscriptionRequired").': '.yn($this->subscription);
|
||||
}
|
||||
if (isset($this->vote)) {
|
||||
$datas['vote'] = '<br>'.$langs->trans("VoteAllowed").': '.yn($this->vote);
|
||||
}
|
||||
if (isset($this->duration)) {
|
||||
$datas['duration'] = '<br>'.$langs->trans("Duration").': '.$this->duration_value;
|
||||
if ($this->duration_value > 1) {
|
||||
$dur = array("i"=>$langs->trans("Minutes"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years"));
|
||||
} elseif ($this->duration_value > 0) {
|
||||
$dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year"));
|
||||
}
|
||||
$datas['duration'] .= " " . (!empty($this->duration_unit) && isset($dur[$this->duration_unit]) ? $langs->trans($dur[$this->duration_unit]) : '');
|
||||
}
|
||||
|
||||
return $datas;
|
||||
}
|
||||
@ -733,6 +745,7 @@ class AdherentType extends CommonObject
|
||||
'id' => $this->id,
|
||||
'objecttype' => $this->element,
|
||||
'option' => $option,
|
||||
'nofetch' => 1,
|
||||
];
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
|
||||
@ -77,7 +77,7 @@ $form = new Form($db);
|
||||
// Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb)
|
||||
$resultboxes = FormOther::getBoxesArea($user, "2");
|
||||
|
||||
llxHeader('', $langs->trans("Members"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros');
|
||||
llxHeader('', $langs->trans("Members"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder');
|
||||
|
||||
$staticmember = new Adherent($db);
|
||||
$statictype = new AdherentType($db);
|
||||
|
||||
@ -104,7 +104,7 @@ if ($action == 'dolibarr2ldap') {
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
llxHeader('', $langs->trans("Member"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros');
|
||||
llxHeader('', $langs->trans("Member"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder');
|
||||
|
||||
$head = member_prepare_head($object);
|
||||
|
||||
|
||||
@ -160,7 +160,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('adheren
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros';
|
||||
$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
|
||||
llxHeader('', $langs->trans("SubscriptionCard"), $help_url);
|
||||
|
||||
|
||||
|
||||
@ -249,7 +249,7 @@ if (!empty($date_select)) {
|
||||
$title .= ' ('.$langs->trans("Year").' '.$date_select.')';
|
||||
}
|
||||
|
||||
$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros';
|
||||
$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
$i = 0;
|
||||
|
||||
@ -522,7 +522,7 @@ if ($rowid > 0) {
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Duration").'</td><td colspan="2">'.$object->duration_value.' ';
|
||||
if ($object->duration_value > 1) {
|
||||
$dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years"));
|
||||
$dur = array("i"=>$langs->trans("Minutes"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years"));
|
||||
} elseif ($object->duration_value > 0) {
|
||||
$dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year"));
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ if ($action == "save" && empty($cancel)) {
|
||||
|
||||
// $wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
|
||||
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
|
||||
|
||||
llxHeader('', $langs->trans("AgendaSetup"), $help_url);
|
||||
|
||||
|
||||
@ -72,7 +72,7 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
|
||||
|
||||
$textobject = $langs->transnoentitiesnoconv("Agenda");
|
||||
|
||||
$wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
|
||||
$wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
|
||||
llxHeader('', $langs->trans("AgendaSetup"), $wikihelp);
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
|
||||
@ -185,7 +185,7 @@ $formother = new FormOther($db);
|
||||
$arrayofjs = array();
|
||||
$arrayofcss = array();
|
||||
|
||||
$wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
|
||||
$wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
|
||||
llxHeader('', $langs->trans("AgendaSetup"), $wikihelp, '', 0, 0, $arrayofjs, $arrayofcss);
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
|
||||
@ -182,7 +182,7 @@ if ($action == 'set') {
|
||||
$formactions = new FormActions($db);
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
|
||||
$wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
|
||||
$wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
|
||||
llxHeader('', $langs->trans("AgendaSetup"), $wikihelp);
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
|
||||
@ -70,7 +70,7 @@ if (!isset($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) {
|
||||
$conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY = 100;
|
||||
}
|
||||
|
||||
$wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
|
||||
$wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
|
||||
llxHeader('', $langs->trans("AgendaSetup"), $wikihelp);
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
|
||||
@ -125,7 +125,7 @@ $form = new Form($db);
|
||||
if ($object->id > 0) {
|
||||
$title = $langs->trans("Agenda");
|
||||
//if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
|
||||
$help_url = 'EN:Module_Agenda_En';
|
||||
$help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (isModEnabled('notification')) {
|
||||
|
||||
@ -157,6 +157,11 @@ class Asset extends CommonObject
|
||||
public $status;
|
||||
public $user_cloture_id;
|
||||
|
||||
/**
|
||||
* @var Asset object oldcopy
|
||||
*/
|
||||
public $oldcopy;
|
||||
|
||||
// /**
|
||||
// * @var string Field with ID of parent key if this object has a parent
|
||||
// */
|
||||
|
||||
@ -127,7 +127,7 @@ $form = new Form($db);
|
||||
if ($object->id > 0) {
|
||||
$title = $langs->trans("Agenda");
|
||||
//if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
|
||||
$help_url = 'EN:Module_Agenda_En';
|
||||
$help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (isModEnabled('notification')) {
|
||||
|
||||
@ -138,7 +138,7 @@ $form = new Form($db);
|
||||
if ($object->id > 0) {
|
||||
$title = $langs->trans("Agenda");
|
||||
//if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
|
||||
$help_url = 'EN:Module_Agenda_En';
|
||||
$help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
|
||||
@ -138,7 +138,7 @@ $form = new Form($db);
|
||||
if ($object->id > 0) {
|
||||
$title = $langs->trans("Agenda");
|
||||
//if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
|
||||
$help_url = 'EN:Module_Agenda_En';
|
||||
$help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
|
||||
@ -1114,7 +1114,7 @@ $arrayrecurrulefreq = array(
|
||||
);
|
||||
|
||||
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda|DE:Modul_Terminplanung';
|
||||
llxHeader('', $langs->trans("Agenda"), $help_url);
|
||||
|
||||
if ($action == 'create') {
|
||||
|
||||
@ -109,7 +109,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda|DE:Modul_Terminplanung';
|
||||
|
||||
llxHeader('', $langs->trans("Agenda"), $help_url);
|
||||
|
||||
|
||||
@ -248,7 +248,7 @@ if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
|
||||
llxHeader('', $langs->trans("Agenda"), $help_url);
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
@ -62,7 +62,7 @@ $usercancreate = $user->hasRight('agenda', 'allactions', 'create') || (($object-
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda|DE:Modul_Terminplanung';
|
||||
llxHeader('', $langs->trans("Agenda"), $help_url);
|
||||
|
||||
$object = new ActionComm($db);
|
||||
|
||||
@ -289,7 +289,7 @@ $nav .= ' <input type="submit" name="submitdateselect" class="button" value="'.$
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda|DE:Modul_Terminplanung';
|
||||
$title = $langs->trans("Agenda");
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
|
||||
@ -234,7 +234,7 @@ if ($reshook < 0) {
|
||||
$form = new Form($db);
|
||||
$companystatic = new Societe($db);
|
||||
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
|
||||
llxHeader('', $langs->trans("Agenda"), $help_url);
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
@ -699,7 +699,7 @@ if ($object->id > 0) {
|
||||
$boxstat .= '<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="border boxtable boxtablenobottom boxtablenotop boxtablenomarginbottom centpercent">';
|
||||
$boxstat .= '<tr class="impair nohover"><td colspan="2" class="tdboxstats nohover">';
|
||||
|
||||
if (isModEnabled("propal") && $user->rights->propal->lire) {
|
||||
if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) {
|
||||
// Box proposals
|
||||
$tmp = $object->getOutstandingProposals();
|
||||
$outstandingOpened = $tmp['opened'];
|
||||
@ -720,7 +720,7 @@ if ($object->id > 0) {
|
||||
}
|
||||
}
|
||||
|
||||
if (isModEnabled('commande') && $user->rights->commande->lire) {
|
||||
if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) {
|
||||
// Box commandes
|
||||
$tmp = $object->getOutstandingOrders();
|
||||
$outstandingOpened = $tmp['opened'];
|
||||
@ -741,7 +741,7 @@ if ($object->id > 0) {
|
||||
}
|
||||
}
|
||||
|
||||
if (isModEnabled('facture') && $user->rights->facture->lire) {
|
||||
if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) {
|
||||
// Box factures
|
||||
$tmp = $object->getOutstandingBills('customer', 0);
|
||||
$outstandingOpened = $tmp['opened'];
|
||||
@ -820,7 +820,7 @@ if ($object->id > 0) {
|
||||
/*
|
||||
* Latest proposals
|
||||
*/
|
||||
if (isModEnabled("propal") && $user->rights->propal->lire) {
|
||||
if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) {
|
||||
$langs->load("propal");
|
||||
|
||||
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht";
|
||||
@ -915,7 +915,7 @@ if ($object->id > 0) {
|
||||
/*
|
||||
* Latest orders
|
||||
*/
|
||||
if (isModEnabled('commande') && $user->rights->commande->lire) {
|
||||
if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) {
|
||||
$param ="";
|
||||
|
||||
$sql = "SELECT s.nom, s.rowid";
|
||||
@ -1124,7 +1124,7 @@ if ($object->id > 0) {
|
||||
/*
|
||||
* Latest contracts
|
||||
*/
|
||||
if (isModEnabled('contrat') && $user->rights->contrat->lire) {
|
||||
if (isModEnabled('contrat') && $user->hasRight('contrat', 'lire')) {
|
||||
$sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut as contract_status, c.datec as dc, c.date_contrat as dcon, c.ref_customer as refcus, c.ref_supplier as refsup, c.entity,";
|
||||
$sql .= " c.last_main_doc, c.model_pdf";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c";
|
||||
@ -1232,7 +1232,7 @@ if ($object->id > 0) {
|
||||
/*
|
||||
* Latest interventions
|
||||
*/
|
||||
if (isModEnabled('ficheinter') && $user->rights->ficheinter->lire) {
|
||||
if (isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'lire')) {
|
||||
$sql = "SELECT s.nom, s.rowid, f.rowid as id, f.ref, f.fk_statut, f.duree as duration, f.datei as startdate, f.entity";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f";
|
||||
$sql .= " WHERE f.fk_soc = s.rowid";
|
||||
@ -1318,7 +1318,7 @@ if ($object->id > 0) {
|
||||
/*
|
||||
* Latest invoices templates
|
||||
*/
|
||||
if (isModEnabled('facture') && $user->rights->facture->lire) {
|
||||
if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) {
|
||||
$sql = 'SELECT f.rowid as id, f.titre as ref';
|
||||
$sql .= ', f.total_ht';
|
||||
$sql .= ', f.total_tva';
|
||||
@ -1413,7 +1413,7 @@ if ($object->id > 0) {
|
||||
/*
|
||||
* Latest invoices
|
||||
*/
|
||||
if (isModEnabled('facture') && $user->rights->facture->lire) {
|
||||
if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) {
|
||||
$sql = 'SELECT f.rowid as facid, f.ref, f.type';
|
||||
$sql .= ', f.total_ht';
|
||||
$sql .= ', f.total_tva';
|
||||
@ -1557,12 +1557,12 @@ if ($object->id > 0) {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("ThirdPartyIsClosed").'</a></div>';
|
||||
}
|
||||
|
||||
if (isModEnabled("propal") && $user->rights->propal->creer && $object->status == 1) {
|
||||
if (isModEnabled("propal") && $user->hasRight('propal', 'creer') && $object->status == 1) {
|
||||
$langs->load("propal");
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/propal/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddProp").'</a></div>';
|
||||
}
|
||||
|
||||
if (isModEnabled('commande') && $user->rights->commande->creer && $object->status == 1) {
|
||||
if (isModEnabled('commande') && $user->hasRight('commande', 'creer') && $object->status == 1) {
|
||||
$langs->load("orders");
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddOrder").'</a></div>';
|
||||
}
|
||||
@ -1572,7 +1572,7 @@ if ($object->id > 0) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddContract").'</a></div>';
|
||||
}
|
||||
|
||||
if (isModEnabled('ficheinter') && $user->rights->ficheinter->creer && $object->status == 1) {
|
||||
if (isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'creer') && $object->status == 1) {
|
||||
$langs->load("fichinter");
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddIntervention").'</a></div>';
|
||||
}
|
||||
|
||||
@ -321,7 +321,7 @@ if (isModEnabled('supplier_proposal') && $user->hasRight("supplier_proposal", "l
|
||||
* Draft sales orders
|
||||
*/
|
||||
|
||||
if (isModEnabled('commande') && $user->rights->commande->lire) {
|
||||
if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) {
|
||||
$sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.total_tva, c.total_ttc, c.fk_statut as status";
|
||||
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
@ -1008,7 +1008,7 @@ if (isModEnabled("propal") && $user->hasRight("propal", "lire")) {
|
||||
/*
|
||||
* Opened (validated) order
|
||||
*/
|
||||
if (isModEnabled('commande') && $user->rights->commande->lire) {
|
||||
if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) {
|
||||
$sql = "SELECT c.rowid as commandeid, c.total_ttc, c.total_ht, c.total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed";
|
||||
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
|
||||
@ -726,6 +726,36 @@ class Mailing extends CommonObject
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* getTooltipContentArray
|
||||
*
|
||||
* @param array $params ex option, infologin
|
||||
* @since v18
|
||||
* @return array
|
||||
*/
|
||||
public function getTooltipContentArray($params)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$nofetch = empty($params['nofetch']) ? false : true;
|
||||
$langs->load('mails');
|
||||
|
||||
$datas = [];
|
||||
$datas['picto'] = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("ShowEMailing").'</u>';
|
||||
if (isset($this->statut)) {
|
||||
$datas['picto'] .= ' '.$this->getLibStatut(5);
|
||||
}
|
||||
$datas['ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
if (isset($this->title)) {
|
||||
$datas['title'] .= '<br><b>'.$langs->trans('MailTitle').':</b> '.$this->title;
|
||||
}
|
||||
if (isset($this->sujet)) {
|
||||
$datas['subject'] .= '<br><b>'.$langs->trans('MailTopic').':</b> '.$this->sujet;
|
||||
}
|
||||
|
||||
return $datas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a link to the object card (with optionally the picto)
|
||||
*
|
||||
@ -747,11 +777,20 @@ class Mailing extends CommonObject
|
||||
}
|
||||
|
||||
$result = '';
|
||||
$companylink = '';
|
||||
|
||||
$label = '<u>'.$langs->trans("ShowEMailing").'</u>';
|
||||
$label .= '<br>';
|
||||
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
$params = [
|
||||
'id' => $this->id,
|
||||
'objecttype' => $this->element,
|
||||
'option' => $option,
|
||||
'nofetch' => 1,
|
||||
];
|
||||
$classfortooltip = 'classfortooltip';
|
||||
$dataparams = '';
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = ' data-params='.json_encode($params);
|
||||
// $label = $langs->trans('Loading');
|
||||
}
|
||||
$label = implode($this->getTooltipContentArray($params));
|
||||
|
||||
$url = DOL_URL_ROOT.'/comm/mailing/card.php?id='.$this->id;
|
||||
|
||||
@ -772,8 +811,8 @@ class Mailing extends CommonObject
|
||||
$label = $langs->trans("ShowEMailing");
|
||||
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
|
||||
$linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose .= ' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
|
||||
} else {
|
||||
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
|
||||
}
|
||||
@ -784,7 +823,7 @@ class Mailing extends CommonObject
|
||||
|
||||
$result .= $linkstart;
|
||||
if ($withpicto) {
|
||||
$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
|
||||
$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : $dataparams.' class="'.(($withpicto != 2) ? 'paddingright ' : '').$classfortooltip.'"'), 0, 0, $notooltip ? 0 : 1);
|
||||
}
|
||||
if ($withpicto != 2) {
|
||||
$result .= $this->ref;
|
||||
|
||||
@ -789,7 +789,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'import_lines_from_object'
|
||||
&& $user->rights->propal->creer
|
||||
&& $user->hasRight('propal', 'creer')
|
||||
&& $object->statut == Propal::STATUS_DRAFT
|
||||
) {
|
||||
// add lines from objectlinked
|
||||
|
||||
@ -3795,7 +3795,7 @@ class Propal extends CommonObject
|
||||
}
|
||||
|
||||
$linkclose = '';
|
||||
if (empty($notooltip) && $user->rights->propal->lire) {
|
||||
if (empty($notooltip) && $user->hasRight('propal', 'lire')) {
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
$label = $langs->trans("Proposal");
|
||||
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
|
||||
@ -76,7 +76,7 @@ $usercancreate = $user->hasRight("propal", "creer");
|
||||
* Add a new contact
|
||||
*/
|
||||
|
||||
if ($action == 'addcontact' && $user->rights->propal->creer) {
|
||||
if ($action == 'addcontact' && $user->hasRight('propal', 'creer')) {
|
||||
if ($object->id > 0) {
|
||||
$contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
|
||||
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
|
||||
@ -94,12 +94,12 @@ if ($action == 'addcontact' && $user->rights->propal->creer) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'swapstatut' && $user->rights->propal->creer) {
|
||||
} elseif ($action == 'swapstatut' && $user->hasRight('propal', 'creer')) {
|
||||
// Toggle the status of a contact
|
||||
if ($object->id > 0) {
|
||||
$result = $object->swapContactStatus(GETPOST('ligne', 'int'));
|
||||
}
|
||||
} elseif ($action == 'deletecontact' && $user->rights->propal->creer) {
|
||||
} elseif ($action == 'deletecontact' && $user->hasRight('propal', 'creer')) {
|
||||
// Deletes a contact
|
||||
$result = $object->delete_contact($lineid);
|
||||
|
||||
|
||||
@ -227,7 +227,7 @@ if ($resql) {
|
||||
/*
|
||||
* Open (validated) proposals
|
||||
*/
|
||||
if (isModEnabled("propal") && $user->rights->propal->lire) {
|
||||
if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) {
|
||||
$sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta";
|
||||
$sql .= ", p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
|
||||
@ -119,7 +119,7 @@ if ($resql) {
|
||||
/*
|
||||
* Liste des propal brouillons
|
||||
*/
|
||||
if (isModEnabled("propal") && $user->rights->propal->lire) {
|
||||
if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) {
|
||||
$sql = "SELECT p.rowid, p.ref, p.price, s.nom as sname";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."propal as p";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
@ -177,7 +177,7 @@ if (isModEnabled('agenda')) {
|
||||
/*
|
||||
* Dernieres propales ouvertes
|
||||
*/
|
||||
if (isModEnabled("propal") && $user->rights->propal->lire) {
|
||||
if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) {
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid, s.client, s.canvas,";
|
||||
$sql .= " p.rowid as propalid, p.total_ttc, p.ref, p.datep as dp, c.label as statut, c.id as statutid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
|
||||
@ -3820,7 +3820,7 @@ class Commande extends CommonOrder
|
||||
$label = implode($this->getTooltipContentArray($params));
|
||||
|
||||
$linkclose = '';
|
||||
if (empty($notooltip) && $user->rights->commande->lire) {
|
||||
if (empty($notooltip) && $user->hasRight('commande', 'lire')) {
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
$label = $langs->trans("Order");
|
||||
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
|
||||
@ -56,7 +56,7 @@ $object = new Commande($db);
|
||||
* Ajout d'un nouveau contact
|
||||
*/
|
||||
|
||||
if ($action == 'addcontact' && $user->rights->commande->creer) {
|
||||
if ($action == 'addcontact' && $user->hasRight('commande', 'creer')) {
|
||||
$result = $object->fetch($id);
|
||||
|
||||
if ($result > 0 && $id > 0) {
|
||||
@ -76,14 +76,14 @@ if ($action == 'addcontact' && $user->rights->commande->creer) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'swapstatut' && $user->rights->commande->creer) {
|
||||
} elseif ($action == 'swapstatut' && $user->hasRight('commande', 'creer')) {
|
||||
// bascule du statut d'un contact
|
||||
if ($object->fetch($id)) {
|
||||
$result = $object->swapContactStatus(GETPOST('ligne', 'int'));
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
} elseif ($action == 'deletecontact' && $user->rights->commande->creer) {
|
||||
} elseif ($action == 'deletecontact' && $user->hasRight('commande', 'creer')) {
|
||||
// Efface un contact
|
||||
$object->fetch($id);
|
||||
$result = $object->delete_contact(GETPOST("lineid", 'int'));
|
||||
|
||||
@ -281,15 +281,15 @@ if (empty($reshook)) {
|
||||
|
||||
// Update field
|
||||
// Set condition
|
||||
if ($action == 'setconditions' && $user->rights->facture->creer) {
|
||||
if ($action == 'setconditions' && $user->hasRight('facture', 'creer')) {
|
||||
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
|
||||
} elseif ($action == 'setmode' && $user->rights->facture->creer) {
|
||||
} elseif ($action == 'setmode' && $user->hasRight('facture', 'creer')) {
|
||||
// Set mode
|
||||
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
|
||||
} elseif ($action == 'classin' && $user->rights->facture->creer) {
|
||||
} elseif ($action == 'classin' && $user->hasRight('facture', 'creer')) {
|
||||
// Set project
|
||||
$object->setProject(GETPOST('projectid', 'int'));
|
||||
} elseif ($action == 'setref' && $user->rights->facture->creer) {
|
||||
} elseif ($action == 'setref' && $user->hasRight('facture', 'creer')) {
|
||||
// Set bank account
|
||||
//var_dump(GETPOST('ref', 'alpha'));exit;
|
||||
$result = $object->setValueFrom('titre', $ref, '', null, 'text', '', $user, 'BILLREC_MODIFY');
|
||||
@ -306,31 +306,31 @@ if (empty($reshook)) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'setbankaccount' && $user->rights->facture->creer) {
|
||||
} elseif ($action == 'setbankaccount' && $user->hasRight('facture', 'creer')) {
|
||||
// Set bank account
|
||||
$result = $object->setBankAccount(GETPOST('fk_account', 'int'));
|
||||
} elseif ($action == 'setfrequency' && $user->rights->facture->creer) {
|
||||
} elseif ($action == 'setfrequency' && $user->hasRight('facture', 'creer')) {
|
||||
// Set frequency and unit frequency
|
||||
$object->setFrequencyAndUnit(GETPOST('frequency', 'int'), GETPOST('unit_frequency', 'alpha'));
|
||||
} elseif ($action == 'setdate_when' && $user->rights->facture->creer) {
|
||||
} elseif ($action == 'setdate_when' && $user->hasRight('facture', 'creer')) {
|
||||
// Set next date of execution
|
||||
$date = dol_mktime(GETPOST('date_whenhour'), GETPOST('date_whenmin'), 0, GETPOST('date_whenmonth'), GETPOST('date_whenday'), GETPOST('date_whenyear'));
|
||||
if (!empty($date)) {
|
||||
$object->setNextDate($date);
|
||||
}
|
||||
} elseif ($action == 'setnb_gen_max' && $user->rights->facture->creer) {
|
||||
} elseif ($action == 'setnb_gen_max' && $user->hasRight('facture', 'creer')) {
|
||||
// Set max period
|
||||
$object->setMaxPeriod(GETPOST('nb_gen_max', 'int'));
|
||||
} elseif ($action == 'setauto_validate' && $user->rights->facture->creer) {
|
||||
} elseif ($action == 'setauto_validate' && $user->hasRight('facture', 'creer')) {
|
||||
// Set auto validate
|
||||
$object->setAutoValidate(GETPOST('auto_validate', 'int'));
|
||||
} elseif ($action == 'setgenerate_pdf' && $user->rights->facture->creer) {
|
||||
} elseif ($action == 'setgenerate_pdf' && $user->hasRight('facture', 'creer')) {
|
||||
// Set generate pdf
|
||||
$object->setGeneratepdf(GETPOST('generate_pdf', 'int'));
|
||||
} elseif ($action == 'setmodelpdf' && $user->rights->facture->creer) {
|
||||
} elseif ($action == 'setmodelpdf' && $user->hasRight('facture', 'creer')) {
|
||||
// Set model pdf
|
||||
$object->setModelpdf(GETPOST('modelpdf', 'alpha'));
|
||||
} elseif ($action == 'disable' && $user->rights->facture->creer) {
|
||||
} elseif ($action == 'disable' && $user->hasRight('facture', 'creer')) {
|
||||
// Set status disabled
|
||||
$db->begin();
|
||||
|
||||
@ -347,7 +347,7 @@ if (empty($reshook)) {
|
||||
$db->rollback();
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
} elseif ($action == 'enable' && $user->rights->facture->creer) {
|
||||
} elseif ($action == 'enable' && $user->hasRight('facture', 'creer')) {
|
||||
// Set status enabled
|
||||
$db->begin();
|
||||
|
||||
@ -373,7 +373,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// Delete line
|
||||
if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->facture->creer) {
|
||||
if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->hasRight('facture', 'creer')) {
|
||||
$object->fetch($id);
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
@ -417,7 +417,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// Add a new line
|
||||
if ($action == 'addline' && $user->rights->facture->creer) {
|
||||
if ($action == 'addline' && $user->hasRight('facture', 'creer')) {
|
||||
$langs->load('errors');
|
||||
$error = 0;
|
||||
|
||||
@ -1288,7 +1288,7 @@ if ($action == 'create') {
|
||||
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||
print $langs->trans('PaymentConditionsShort');
|
||||
print '</td>';
|
||||
if ($action != 'editconditions' && $user->rights->facture->creer) {
|
||||
if ($action != 'editconditions' && $user->hasRight('facture', 'creer')) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
@ -1309,7 +1309,7 @@ if ($action == 'create') {
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('PaymentMode');
|
||||
print '</td>';
|
||||
if ($action != 'editmode' && $user->rights->facture->creer) {
|
||||
if ($action != 'editmode' && $user->hasRight('facture', 'creer')) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
@ -1418,7 +1418,7 @@ if ($action == 'create') {
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans('BankAccount');
|
||||
print '<td>';
|
||||
if (($action != 'editbankaccount') && $user->rights->facture->creer && $object->statut == FactureRec::STATUS_DRAFT) {
|
||||
if (($action != 'editbankaccount') && $user->hasRight('facture', 'creer') && $object->statut == FactureRec::STATUS_DRAFT) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
@ -1436,7 +1436,7 @@ if ($action == 'create') {
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans('Model');
|
||||
print '<td>';
|
||||
if (($action != 'editmodelpdf') && $user->rights->facture->creer && $object->statut == FactureRec::STATUS_DRAFT) {
|
||||
if (($action != 'editmodelpdf') && $user->hasRight('facture', 'creer') && $object->statut == FactureRec::STATUS_DRAFT) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmodelpdf&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetModel'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
@ -1482,7 +1482,7 @@ if ($action == 'create') {
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('Frequency');
|
||||
print '</td>';
|
||||
if ($action != 'editfrequency' && $user->rights->facture->creer) {
|
||||
if ($action != 'editfrequency' && $user->hasRight('facture', 'creer')) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editfrequency&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('Edit'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
@ -1639,7 +1639,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
// Form to add new line
|
||||
if ($object->statut == $object::STATUS_DRAFT && $user->rights->facture->creer && $action != 'valid' && $action != 'editline') {
|
||||
if ($object->statut == $object::STATUS_DRAFT && $user->hasRight('facture', 'creer') && $action != 'valid' && $action != 'editline') {
|
||||
if ($action != 'editline') {
|
||||
// Add free products/services
|
||||
|
||||
|
||||
@ -390,7 +390,7 @@ if (empty($reshook)) {
|
||||
if ($result < 0) {
|
||||
dol_print_error($db, $object->error);
|
||||
}
|
||||
} elseif ($action == 'setretainedwarrantyconditions' && $user->rights->facture->creer) {
|
||||
} elseif ($action == 'setretainedwarrantyconditions' && $user->hasRight('facture', 'creer')) {
|
||||
$object->fetch($id);
|
||||
$object->retained_warranty_fk_cond_reglement = 0; // To clean property
|
||||
$result = $object->setRetainedWarrantyPaymentTerms(GETPOST('retained_warranty_fk_cond_reglement', 'int'));
|
||||
@ -410,13 +410,13 @@ if (empty($reshook)) {
|
||||
if ($result < 0) {
|
||||
dol_print_error($db, $object->error);
|
||||
}
|
||||
} elseif ($action == 'setretainedwarranty' && $user->rights->facture->creer) {
|
||||
} elseif ($action == 'setretainedwarranty' && $user->hasRight('facture', 'creer')) {
|
||||
$object->fetch($id);
|
||||
$result = $object->setRetainedWarranty(GETPOST('retained_warranty', 'float'));
|
||||
if ($result < 0) {
|
||||
dol_print_error($db, $object->error);
|
||||
}
|
||||
} elseif ($action == 'setretainedwarrantydatelimit' && $user->rights->facture->creer) {
|
||||
} elseif ($action == 'setretainedwarrantydatelimit' && $user->hasRight('facture', 'creer')) {
|
||||
$object->fetch($id);
|
||||
$result = $object->setRetainedWarrantyDateLimit(GETPOST('retained_warranty_date_limit', 'float'));
|
||||
if ($result < 0) {
|
||||
@ -4682,7 +4682,7 @@ if ($action == 'create') {
|
||||
print '<table id="retained-warranty-table" class="nobordernopadding centpercent"><tr><td>';
|
||||
print $langs->trans('RetainedWarranty');
|
||||
print '</td>';
|
||||
if ($action != 'editretainedwarranty' && $user->rights->facture->creer && $object->statut == Facture::STATUS_DRAFT) {
|
||||
if ($action != 'editretainedwarranty' && $user->hasRight('facture', 'creer') && $object->statut == Facture::STATUS_DRAFT) {
|
||||
print '<td align="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editretainedwarranty&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('setretainedwarranty'), 1).'</a></td>';
|
||||
}
|
||||
|
||||
@ -4705,7 +4705,7 @@ if ($action == 'create') {
|
||||
print '<table id="retained-warranty-cond-reglement-table" class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('PaymentConditionsShortRetainedWarranty');
|
||||
print '</td>';
|
||||
if ($action != 'editretainedwarrantypaymentterms' && $user->rights->facture->creer && $object->statut == Facture::STATUS_DRAFT) {
|
||||
if ($action != 'editretainedwarrantypaymentterms' && $user->hasRight('facture', 'creer') && $object->statut == Facture::STATUS_DRAFT) {
|
||||
print '<td align="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editretainedwarrantypaymentterms&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('setPaymentConditionsShortRetainedWarranty'), 1).'</a></td>';
|
||||
}
|
||||
|
||||
@ -4740,7 +4740,7 @@ if ($action == 'create') {
|
||||
print '<table id="retained-warranty-date-limit-table" class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('RetainedWarrantyDateLimit');
|
||||
print '</td>';
|
||||
if ($action != 'editretainedwarrantydatelimit' && $user->rights->facture->creer && $object->statut == Facture::STATUS_DRAFT) {
|
||||
if ($action != 'editretainedwarrantydatelimit' && $user->hasRight('facture', 'creer') && $object->statut == Facture::STATUS_DRAFT) {
|
||||
print '<td align="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editretainedwarrantydatelimit&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('setretainedwarrantyDateLimit'), 1).'</a></td>';
|
||||
}
|
||||
|
||||
|
||||
@ -65,7 +65,7 @@ $usercancreate = $user->hasRight("facture", "creer");
|
||||
* Add a new contact
|
||||
*/
|
||||
|
||||
if ($action == 'addcontact' && $user->rights->facture->creer) {
|
||||
if ($action == 'addcontact' && $user->hasRight('facture', 'creer')) {
|
||||
if ($result > 0 && $id > 0) {
|
||||
$contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
|
||||
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
|
||||
@ -83,10 +83,10 @@ if ($action == 'addcontact' && $user->rights->facture->creer) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'swapstatut' && $user->rights->facture->creer) {
|
||||
} elseif ($action == 'swapstatut' && $user->hasRight('facture', 'creer')) {
|
||||
// Toggle the status of a contact
|
||||
$result = $object->swapContactStatus(GETPOST('ligne', 'int'));
|
||||
} elseif ($action == 'deletecontact' && $user->rights->facture->creer) {
|
||||
} elseif ($action == 'deletecontact' && $user->hasRight('facture', 'creer')) {
|
||||
// Deletes a contact
|
||||
$result = $object->delete_contact($lineid);
|
||||
|
||||
|
||||
@ -483,7 +483,7 @@ if ($object->id > 0) {
|
||||
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||
print $langs->trans('DateInvoice');
|
||||
print '</td>';
|
||||
if ($object->type != $object::TYPE_CREDIT_NOTE && $action != 'editinvoicedate' && !empty($object->brouillon) && $user->rights->facture->creer) {
|
||||
if ($object->type != $object::TYPE_CREDIT_NOTE && $action != 'editinvoicedate' && !empty($object->brouillon) && $user->hasRight('facture', 'creer')) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editinvoicedate&token='.newToken().'&id='.$object->id.'&type='.urlencode($type).'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
@ -506,7 +506,7 @@ if ($object->id > 0) {
|
||||
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||
print $langs->trans('PaymentConditionsShort');
|
||||
print '</td>';
|
||||
if ($object->type != $object::TYPE_CREDIT_NOTE && $action != 'editconditions' && !empty($object->brouillon) && $user->rights->facture->creer) {
|
||||
if ($object->type != $object::TYPE_CREDIT_NOTE && $action != 'editconditions' && !empty($object->brouillon) && $user->hasRight('facture', 'creer')) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&token='.newToken().'&id='.$object->id.'&type='.urlencode($type).'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
@ -527,7 +527,7 @@ if ($object->id > 0) {
|
||||
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||
print $langs->trans('DateMaxPayment');
|
||||
print '</td>';
|
||||
if ($object->type != $object::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && !empty($object->brouillon) && $user->rights->facture->creer) {
|
||||
if ($object->type != $object::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && !empty($object->brouillon) && $user->hasRight('facture', 'creer')) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editpaymentterm&token='.newToken().'&id='.$object->id.'&type='.urlencode($type).'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
@ -556,7 +556,7 @@ if ($object->id > 0) {
|
||||
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||
print $langs->trans('PaymentMode');
|
||||
print '</td>';
|
||||
if ($action != 'editmode' && !empty($object->brouillon) && $user->rights->facture->creer) {
|
||||
if ($action != 'editmode' && !empty($object->brouillon) && $user->hasRight('facture', 'creer')) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&token='.newToken().'&id='.$object->id.'&type='.urlencode($type).'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
@ -577,7 +577,7 @@ if ($object->id > 0) {
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans('BankAccount');
|
||||
print '<td>';
|
||||
if (($action != 'editbankaccount') && $user->rights->commande->creer && !empty($object->brouillon)) {
|
||||
if (($action != 'editbankaccount') && $user->hasRight('commande', 'creer') && !empty($object->brouillon)) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&token='.newToken().'&id='.$object->id.'&type='.urlencode($type).'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
@ -662,7 +662,7 @@ if ($object->id > 0) {
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('RevenueStamp');
|
||||
print '</td>';
|
||||
if ($action != 'editrevenuestamp' && !empty($object->brouillon) && $user->rights->facture->creer) {
|
||||
if ($action != 'editrevenuestamp' && !empty($object->brouillon) && $user->hasRight('facture', 'creer')) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editrevenuestamp&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetRevenuStamp'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
|
||||
@ -117,7 +117,7 @@ if ($id > 0) {
|
||||
dol_banner_tab($object, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom', '', '', 0, '', '', 1);
|
||||
print dol_get_fiche_end();
|
||||
|
||||
if (isModEnabled('facture') && $user->rights->facture->lire) {
|
||||
if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) {
|
||||
// Invoice list
|
||||
print load_fiche_titre($langs->trans("CustomerPreview"));
|
||||
|
||||
|
||||
@ -156,21 +156,21 @@ print '</td></tr>';
|
||||
|
||||
if ($object->thirdparty->client) {
|
||||
$thirdTypeArray['customer'] = $langs->trans("customer");
|
||||
if (isModEnabled("propal") && $user->rights->propal->lire) {
|
||||
if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) {
|
||||
$elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals');
|
||||
}
|
||||
if (isModEnabled('commande') && $user->rights->commande->lire) {
|
||||
if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) {
|
||||
$elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders');
|
||||
}
|
||||
if (isModEnabled('facture') && $user->rights->facture->lire) {
|
||||
if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) {
|
||||
$elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices');
|
||||
}
|
||||
if (isModEnabled('contrat') && $user->rights->contrat->lire) {
|
||||
if (isModEnabled('contrat') && $user->hasRight('contrat', 'lire')) {
|
||||
$elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts');
|
||||
}
|
||||
}
|
||||
|
||||
if (isModEnabled('ficheinter') && $user->rights->ficheinter->lire) {
|
||||
if (isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'lire')) {
|
||||
$elementTypeArray['fichinter'] = $langs->transnoentitiesnoconv('Interventions');
|
||||
}
|
||||
|
||||
|
||||
@ -214,7 +214,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// Add contract
|
||||
if ($action == 'add' && $user->rights->contrat->creer) {
|
||||
if ($action == 'add' && $user->hasRight('contrat', 'creer')) {
|
||||
// Check
|
||||
if (empty($datecontrat)) {
|
||||
$error++;
|
||||
@ -408,9 +408,9 @@ if (empty($reshook)) {
|
||||
$action = 'create';
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'classin' && $user->rights->contrat->creer) {
|
||||
} elseif ($action == 'classin' && $user->hasRight('contrat', 'creer')) {
|
||||
$object->setProject(GETPOST('projectid'));
|
||||
} elseif ($action == 'addline' && $user->rights->contrat->creer) {
|
||||
} elseif ($action == 'addline' && $user->hasRight('contrat', 'creer')) {
|
||||
// Add a new line
|
||||
// Set if we used free entry or predefined product
|
||||
$predef = '';
|
||||
@ -682,7 +682,7 @@ if (empty($reshook)) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'updateline' && $user->rights->contrat->creer && !GETPOST('cancel', 'alpha')) {
|
||||
} elseif ($action == 'updateline' && $user->hasRight('contrat', 'creer') && !GETPOST('cancel', 'alpha')) {
|
||||
$error = 0;
|
||||
$predef = '';
|
||||
|
||||
@ -795,7 +795,7 @@ if (empty($reshook)) {
|
||||
} else {
|
||||
$db->rollback();
|
||||
}
|
||||
} elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->contrat->creer) {
|
||||
} elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->hasRight('contrat', 'creer')) {
|
||||
$result = $object->deleteline(GETPOST('lineid', 'int'), $user);
|
||||
|
||||
if ($result >= 0) {
|
||||
@ -804,7 +804,7 @@ if (empty($reshook)) {
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
} elseif ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->contrat->creer) {
|
||||
} elseif ($action == 'confirm_valid' && $confirm == 'yes' && $user->hasRight('contrat', 'creer')) {
|
||||
$result = $object->validate($user);
|
||||
|
||||
if ($result > 0) {
|
||||
@ -830,18 +830,18 @@ if (empty($reshook)) {
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
} elseif ($action == 'reopen' && $user->rights->contrat->creer) {
|
||||
} elseif ($action == 'reopen' && $user->hasRight('contrat', 'creer')) {
|
||||
$result = $object->reopen($user);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
} elseif ($action == 'confirm_close' && $confirm == 'yes' && $user->rights->contrat->creer) {
|
||||
} elseif ($action == 'confirm_close' && $confirm == 'yes' && $user->hasRight('contrat', 'creer')) {
|
||||
// Close all lines
|
||||
$result = $object->closeAll($user);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
} elseif ($action == 'confirm_activate' && $confirm == 'yes' && $user->rights->contrat->creer) {
|
||||
} elseif ($action == 'confirm_activate' && $confirm == 'yes' && $user->hasRight('contrat', 'creer')) {
|
||||
$date_start = dol_mktime(12, 0, 0, GETPOST('d_startmonth'), GETPOST('d_startday'), GETPOST('d_startyear'));
|
||||
$date_end = dol_mktime(12, 0, 0, GETPOST('d_endmonth'), GETPOST('d_endday'), GETPOST('d_endyear'));
|
||||
$comment = GETPOST('comment', 'alpha');
|
||||
@ -857,7 +857,7 @@ if (empty($reshook)) {
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
} elseif ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contrat->creer) {
|
||||
} elseif ($action == 'confirm_move' && $confirm == 'yes' && $user->hasRight('contrat', 'creer')) {
|
||||
if (GETPOST('newcid') > 0) {
|
||||
$contractline = new ContratLigne($db);
|
||||
$result = $contractline->fetch(GETPOSTINT('lineid'));
|
||||
@ -995,7 +995,7 @@ if (empty($reshook)) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||
|
||||
|
||||
if (!empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->contrat->creer) {
|
||||
if (!empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->hasRight('contrat', 'creer')) {
|
||||
if ($action == 'addcontact') {
|
||||
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
|
||||
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
|
||||
@ -1351,7 +1351,7 @@ if ($action == 'create') {
|
||||
|
||||
|
||||
// Contract
|
||||
if (!empty($object->brouillon) && $user->rights->contrat->creer) {
|
||||
if (!empty($object->brouillon) && $user->hasRight('contrat', 'creer')) {
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="setremise">';
|
||||
@ -1448,7 +1448,7 @@ if ($action == 'create') {
|
||||
|
||||
print '</div>';
|
||||
|
||||
if (!empty($object->brouillon) && $user->rights->contrat->creer) {
|
||||
if (!empty($object->brouillon) && $user->hasRight('contrat', 'creer')) {
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
@ -1826,7 +1826,7 @@ if ($action == 'create') {
|
||||
/*
|
||||
* Confirmation to delete service line of contract
|
||||
*/
|
||||
if ($action == 'deleteline' && !$_REQUEST["cancel"] && $user->rights->contrat->creer && $object->lines[$cursorline - 1]->id == GETPOST('rowid')) {
|
||||
if ($action == 'deleteline' && !$_REQUEST["cancel"] && $user->hasRight('contrat', 'creer') && $object->lines[$cursorline - 1]->id == GETPOST('rowid')) {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'), $langs->trans("DeleteContractLine"), $langs->trans("ConfirmDeleteContractLine"), "confirm_deleteline", '', 0, 1);
|
||||
if ($ret == 'html') {
|
||||
print '<table class="notopnoleftnoright" width="100%"><tr class="oddeven" height="6"><td></td></tr></table>';
|
||||
@ -1836,7 +1836,7 @@ if ($action == 'create') {
|
||||
/*
|
||||
* Confirmation to move service toward another contract
|
||||
*/
|
||||
if ($action == 'move' && !$_REQUEST["cancel"] && $user->rights->contrat->creer && $object->lines[$cursorline - 1]->id == GETPOST('rowid')) {
|
||||
if ($action == 'move' && !$_REQUEST["cancel"] && $user->hasRight('contrat', 'creer') && $object->lines[$cursorline - 1]->id == GETPOST('rowid')) {
|
||||
$arraycontractid = array();
|
||||
foreach ($arrayothercontracts as $contractcursor) {
|
||||
$arraycontractid[$contractcursor->id] = $contractcursor->ref;
|
||||
|
||||
@ -2062,7 +2062,7 @@ class Contrat extends CommonObject
|
||||
$label = implode($this->getTooltipContentArray($params));
|
||||
|
||||
$linkclose = '';
|
||||
if (empty($notooltip) && $user->rights->contrat->lire) {
|
||||
if (empty($notooltip) && $user->hasRight('contrat', 'lire')) {
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
$label = $langs->trans("ShowContract");
|
||||
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
|
||||
@ -61,7 +61,7 @@ $permissiontoadd = $user->rights->contrat->creer; // Used by the include
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'addcontact' && $user->rights->contrat->creer) {
|
||||
if ($action == 'addcontact' && $user->hasRight('contrat', 'creer')) {
|
||||
$result = $object->fetch($id);
|
||||
|
||||
if ($result > 0 && $id > 0) {
|
||||
@ -86,7 +86,7 @@ if ($action == 'addcontact' && $user->rights->contrat->creer) {
|
||||
}
|
||||
|
||||
// bascule du statut d'un contact
|
||||
if ($action == 'swapstatut' && $user->rights->contrat->creer) {
|
||||
if ($action == 'swapstatut' && $user->hasRight('contrat', 'creer')) {
|
||||
if ($object->fetch($id)) {
|
||||
$result = $object->swapContactStatus(GETPOST('ligne', 'int'));
|
||||
} else {
|
||||
@ -95,7 +95,7 @@ if ($action == 'swapstatut' && $user->rights->contrat->creer) {
|
||||
}
|
||||
|
||||
// Delete contact
|
||||
if ($action == 'deletecontact' && $user->rights->contrat->creer) {
|
||||
if ($action == 'deletecontact' && $user->hasRight('contrat', 'creer')) {
|
||||
$object->fetch($id);
|
||||
$result = $object->delete_contact(GETPOST("lineid", 'int'));
|
||||
|
||||
|
||||
@ -239,7 +239,7 @@ print "</table></div><br>";
|
||||
|
||||
// Draft contracts
|
||||
|
||||
if (isModEnabled('contrat') && $user->rights->contrat->lire) {
|
||||
if (isModEnabled('contrat') && $user->hasRight('contrat', 'lire')) {
|
||||
$sql = "SELECT c.rowid, c.ref,";
|
||||
$sql .= " s.nom as name, s.name_alias, s.logo, s.rowid as socid, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe as s";
|
||||
|
||||
@ -118,7 +118,6 @@ if ($objecttype == 'facture' || $objecttype == 'invoice') {
|
||||
$module = 'contrat';
|
||||
$myobject = 'contrat';
|
||||
} elseif ($objecttype == 'member') {
|
||||
$langs->load('members');
|
||||
$classpath = 'adherents/class';
|
||||
$module = 'adherent';
|
||||
$myobject = 'adherent';
|
||||
|
||||
@ -80,7 +80,7 @@ if (!empty($field) && !empty($element) && !empty($table_element) && !empty($fk_e
|
||||
|
||||
if ($user->rights->$element->lire || $user->rights->$element->read
|
||||
|| (isset($subelement) && ($user->rights->$element->$subelement->lire || $user->rights->$element->$subelement->read))
|
||||
|| ($element == 'payment' && $user->rights->facture->lire)
|
||||
|| ($element == 'payment' && $user->hasRight('facture', 'lire'))
|
||||
|| ($element == 'payment_supplier' && $user->rights->fournisseur->facture->lire)) {
|
||||
if ($type == 'select') {
|
||||
$methodname = 'load_cache_'.$loadmethod;
|
||||
|
||||
@ -74,13 +74,13 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3)
|
||||
|
||||
// Make test on permission
|
||||
$perm = 0;
|
||||
if ($table_element_line == 'propaldet' && $user->rights->propal->creer) {
|
||||
if ($table_element_line == 'propaldet' && $user->hasRight('propal', 'creer')) {
|
||||
$perm = 1;
|
||||
} elseif ($table_element_line == 'commandedet' && $user->rights->commande->creer) {
|
||||
} elseif ($table_element_line == 'commandedet' && $user->hasRight('commande', 'creer')) {
|
||||
$perm = 1;
|
||||
} elseif ($table_element_line == 'facturedet' && $user->rights->facture->creer) {
|
||||
} elseif ($table_element_line == 'facturedet' && $user->hasRight('facture', 'creer')) {
|
||||
$perm = 1;
|
||||
} elseif ($table_element_line == 'facturedet_rec' && $user->rights->facture->creer) {
|
||||
} elseif ($table_element_line == 'facturedet_rec' && $user->hasRight('facture', 'creer')) {
|
||||
$perm = 1;
|
||||
} elseif ($table_element_line == 'emailcollector_emailcollectoraction' && $user->admin) {
|
||||
$perm = 1;
|
||||
|
||||
@ -81,7 +81,7 @@ class box_services_contracts extends ModeleBoxes
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxLastProductsInContract", $max));
|
||||
|
||||
if ($user->rights->service->lire && $user->rights->contrat->lire) {
|
||||
if ($user->rights->service->lire && $user->hasRight('contrat', 'lire')) {
|
||||
$contractstatic = new Contrat($this->db);
|
||||
$contractlinestatic = new ContratLigne($this->db);
|
||||
$thirdpartytmp = new Societe($this->db);
|
||||
|
||||
@ -145,7 +145,11 @@ abstract class CommonDocGenerator
|
||||
'myuser_email'=>$user->email,
|
||||
'myuser_logo'=>$logotouse,
|
||||
'myuser_job'=>$user->job,
|
||||
'myuser_web'=>'' // url not exist in $user object
|
||||
'myuser_web'=>'', // url not exist in $user object
|
||||
'myuser_birth'=>dol_print_date($user->birth, 'day', 'gmt'),
|
||||
'myuser_dateemployment'=>dol_print_date($user->dateemployment, 'day', 'tzuser'),
|
||||
'myuser_dateemploymentend'=>dol_print_date($user->dateemploymentend, 'day', 'tzuser'),
|
||||
'myuser_gender'=>$user->gender,
|
||||
);
|
||||
// Retrieve extrafields
|
||||
if (is_array($user->array_options) && count($user->array_options)) {
|
||||
|
||||
@ -432,7 +432,7 @@ function show_stats_for_company($product, $socid)
|
||||
print '</tr>';
|
||||
|
||||
// Customer proposals
|
||||
if (isModEnabled("propal") && $user->rights->propal->lire) {
|
||||
if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) {
|
||||
$nblines++;
|
||||
$ret = $product->load_stats_propale($socid);
|
||||
if ($ret < 0) {
|
||||
@ -470,7 +470,7 @@ function show_stats_for_company($product, $socid)
|
||||
print '</tr>';
|
||||
}
|
||||
// Sales orders
|
||||
if (isModEnabled('commande') && $user->rights->commande->lire) {
|
||||
if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) {
|
||||
$nblines++;
|
||||
$ret = $product->load_stats_commande($socid);
|
||||
if ($ret < 0) {
|
||||
@ -508,7 +508,7 @@ function show_stats_for_company($product, $socid)
|
||||
print '</tr>';
|
||||
}
|
||||
// Customer invoices
|
||||
if (isModEnabled('facture') && $user->rights->facture->lire) {
|
||||
if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) {
|
||||
$nblines++;
|
||||
$ret = $product->load_stats_facture($socid);
|
||||
if ($ret < 0) {
|
||||
@ -527,7 +527,7 @@ function show_stats_for_company($product, $socid)
|
||||
print '</tr>';
|
||||
}
|
||||
// Customer template invoices
|
||||
if (isModEnabled("facture") && $user->rights->facture->lire) {
|
||||
if (isModEnabled("facture") && $user->hasRight('facture', 'lire')) {
|
||||
$nblines++;
|
||||
$ret = $product->load_stats_facturerec($socid);
|
||||
if ($ret < 0) {
|
||||
@ -566,7 +566,7 @@ function show_stats_for_company($product, $socid)
|
||||
}
|
||||
|
||||
// Contracts
|
||||
if (isModEnabled('contrat') && $user->rights->contrat->lire) {
|
||||
if (isModEnabled('contrat') && $user->hasRight('contrat', 'lire')) {
|
||||
$nblines++;
|
||||
$ret = $product->load_stats_contrat($socid);
|
||||
if ($ret < 0) {
|
||||
|
||||
@ -79,7 +79,7 @@ class modCommande extends DolibarrModules
|
||||
|
||||
$this->const[$r][0] = "COMMANDE_ADDON_PDF";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "einstein";
|
||||
$this->const[$r][2] = "eratosthene";
|
||||
$this->const[$r][3] = 'Name of PDF model of order';
|
||||
$this->const[$r][4] = 0;
|
||||
|
||||
|
||||
@ -945,31 +945,31 @@ class doc_generic_project_odt extends ModelePDFProjects
|
||||
'title' => "ListProposalsAssociatedProject",
|
||||
'class' => 'Propal',
|
||||
'table' => 'propal',
|
||||
'test' => $conf->propal->enabled && $user->rights->propal->lire
|
||||
'test' => isModEnabled('propal') && $user->hasRight('propal', 'lire')
|
||||
),
|
||||
'order' => array(
|
||||
'title' => "ListOrdersAssociatedProject",
|
||||
'class' => 'Commande',
|
||||
'table' => 'commande',
|
||||
'test' => $conf->commande->enabled && $user->rights->commande->lire
|
||||
'test' => isModEnabled('commande') && $user->hasRight('commande', 'lire')
|
||||
),
|
||||
'invoice' => array(
|
||||
'title' => "ListInvoicesAssociatedProject",
|
||||
'class' => 'Facture',
|
||||
'table' => 'facture',
|
||||
'test' => $conf->facture->enabled && $user->rights->facture->lire
|
||||
'test' => isModEnabled('facture') && $user->hasRight('facture', 'lire')
|
||||
),
|
||||
'invoice_predefined' => array(
|
||||
'title' => "ListPredefinedInvoicesAssociatedProject",
|
||||
'class' => 'FactureRec',
|
||||
'table' => 'facture_rec',
|
||||
'test' => $conf->facture->enabled && $user->rights->facture->lire
|
||||
'test' => isModEnabled('facture') && $user->hasRight('facture', 'lire')
|
||||
),
|
||||
'proposal_supplier' => array(
|
||||
'title' => "ListSupplierProposalsAssociatedProject",
|
||||
'class' => 'SupplierProposal',
|
||||
'table' => 'supplier_proposal',
|
||||
'test' => $conf->supplier_proposal->enabled && $user->rights->supplier_proposal->lire
|
||||
'test' => isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->lire
|
||||
),
|
||||
'order_supplier' => array(
|
||||
'title' => "ListSupplierOrdersAssociatedProject",
|
||||
@ -987,14 +987,14 @@ class doc_generic_project_odt extends ModelePDFProjects
|
||||
'title' => "ListContractAssociatedProject",
|
||||
'class' => 'Contrat',
|
||||
'table' => 'contrat',
|
||||
'test' => $conf->contrat->enabled && $user->rights->contrat->lire
|
||||
'test' => isModEnabled('contrat') && $user->hasRight('contrat', 'lire')
|
||||
),
|
||||
'intervention' => array(
|
||||
'title' => "ListFichinterAssociatedProject",
|
||||
'class' => 'Fichinter',
|
||||
'table' => 'fichinter',
|
||||
'disableamount' => 1,
|
||||
'test' => $conf->ficheinter->enabled && $user->rights->ficheinter->lire
|
||||
'test' => $conf->ficheinter->enabled && $user->hasRight('ficheinter', 'lire')
|
||||
),
|
||||
'shipping' => array(
|
||||
'title' => "ListShippingAssociatedProject",
|
||||
|
||||
@ -374,7 +374,7 @@ class pdf_beluga extends ModelePDFProjects
|
||||
'class'=>'Propal',
|
||||
'table'=>'propal',
|
||||
'datefieldname'=>'datep',
|
||||
'test'=>$conf->propal->enabled && $user->rights->propal->lire,
|
||||
'test'=> isModEnabled('propal') && $user->hasRight('propal', 'lire'),
|
||||
'lang'=>'propal'),
|
||||
'order'=>array(
|
||||
'name'=>"CustomersOrders",
|
||||
@ -382,7 +382,7 @@ class pdf_beluga extends ModelePDFProjects
|
||||
'class'=>'Commande',
|
||||
'table'=>'commande',
|
||||
'datefieldname'=>'date_commande',
|
||||
'test'=>$conf->commande->enabled && $user->rights->commande->lire,
|
||||
'test'=> isModEnabled('commande') && $user->hasRight('commande', 'lire'),
|
||||
'lang'=>'orders'),
|
||||
'invoice'=>array(
|
||||
'name'=>"CustomersInvoices",
|
||||
@ -391,7 +391,7 @@ class pdf_beluga extends ModelePDFProjects
|
||||
'margin'=>'add',
|
||||
'table'=>'facture',
|
||||
'datefieldname'=>'datef',
|
||||
'test'=>$conf->facture->enabled && $user->rights->facture->lire,
|
||||
'test'=> isModEnabled('facture') && $user->hasRight('facture', 'lire'),
|
||||
'lang'=>'bills'),
|
||||
'invoice_predefined'=>array(
|
||||
'name'=>"PredefinedInvoices",
|
||||
@ -399,7 +399,7 @@ class pdf_beluga extends ModelePDFProjects
|
||||
'class'=>'FactureRec',
|
||||
'table'=>'facture_rec',
|
||||
'datefieldname'=>'datec',
|
||||
'test'=>$conf->facture->enabled && $user->rights->facture->lire,
|
||||
'test'=> isModEnabled('facture') && $user->hasRight('facture', 'lire'),
|
||||
'lang'=>'bills'),
|
||||
'order_supplier'=>array(
|
||||
'name'=>"SuppliersOrders",
|
||||
@ -424,7 +424,7 @@ class pdf_beluga extends ModelePDFProjects
|
||||
'class'=>'Contrat',
|
||||
'table'=>'contrat',
|
||||
'datefieldname'=>'date_contrat',
|
||||
'test'=>$conf->contrat->enabled && $user->rights->contrat->lire,
|
||||
'test'=> isModEnabled('contrat') && $user->hasRight('contrat', 'lire'),
|
||||
'lang'=>'contract'),
|
||||
'intervention'=>array(
|
||||
'name'=>"Interventions",
|
||||
@ -433,7 +433,7 @@ class pdf_beluga extends ModelePDFProjects
|
||||
'table'=>'fichinter',
|
||||
'datefieldname'=>'date_valid',
|
||||
'disableamount'=>1,
|
||||
'test'=>$conf->ficheinter->enabled && $user->rights->ficheinter->lire,
|
||||
'test'=>$conf->ficheinter->enabled && $user->hasRight('ficheinter', 'lire'),
|
||||
'lang'=>'interventions'),
|
||||
'trip'=>array(
|
||||
'name'=>"TripsAndExpenses",
|
||||
|
||||
@ -90,6 +90,15 @@ class Expedition extends CommonObject
|
||||
*/
|
||||
public $fields = array();
|
||||
|
||||
/**
|
||||
* @var int ID of user author
|
||||
*/
|
||||
public $user_author_id;
|
||||
|
||||
/**
|
||||
* @var int ID of user author
|
||||
*/
|
||||
public $fk_user_author;
|
||||
|
||||
public $socid;
|
||||
|
||||
@ -175,8 +184,35 @@ class Expedition extends CommonObject
|
||||
public $meths;
|
||||
public $listmeths; // List of carriers
|
||||
|
||||
/**
|
||||
* @var int ID of order
|
||||
*/
|
||||
public $commande_id;
|
||||
|
||||
/**
|
||||
* @var Commande order
|
||||
*/
|
||||
public $commande;
|
||||
|
||||
/**
|
||||
* @var ExpeditionLigne[] array of shipping lines
|
||||
*/
|
||||
public $lines = array();
|
||||
|
||||
// Multicurrency
|
||||
/**
|
||||
* @var int Currency ID
|
||||
*/
|
||||
public $fk_multicurrency;
|
||||
|
||||
/**
|
||||
* @var string multicurrency code
|
||||
*/
|
||||
public $multicurrency_code;
|
||||
public $multicurrency_tx;
|
||||
public $multicurrency_total_ht;
|
||||
public $multicurrency_total_tva;
|
||||
public $multicurrency_total_ttc;
|
||||
|
||||
/**
|
||||
* Draft status
|
||||
@ -565,6 +601,7 @@ class Expedition extends CommonObject
|
||||
$this->ref_ext = $obj->ref_ext;
|
||||
$this->statut = $obj->fk_statut;
|
||||
$this->user_author_id = $obj->fk_user_author;
|
||||
$this->fk_user_author = $obj->fk_user_author;
|
||||
$this->date_creation = $this->db->jdate($obj->date_creation);
|
||||
$this->date_valid = $this->db->jdate($obj->date_valid);
|
||||
$this->date = $this->db->jdate($obj->date_expedition); // TODO deprecated
|
||||
@ -1784,6 +1821,30 @@ class Expedition extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getTooltipContentArray
|
||||
*
|
||||
* @param array $params ex option, infologin
|
||||
* @since v18
|
||||
* @return array
|
||||
*/
|
||||
public function getTooltipContentArray($params)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$langs->load('shipping');
|
||||
$nofetch = empty($params['nofetch']) ? false : true;
|
||||
$datas = [];
|
||||
$datas['picto'] = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("Shipment").'</u>';
|
||||
if (isset($this->statut)) {
|
||||
$datas['picto'] .= ' '.$this->getLibStatut(5);
|
||||
}
|
||||
$datas['ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
$datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '.($this->ref_customer ? $this->ref_customer : $this->ref_client);
|
||||
|
||||
return $datas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return clicable link of object (with eventually picto)
|
||||
*
|
||||
@ -1800,9 +1861,20 @@ class Expedition extends CommonObject
|
||||
global $langs, $conf, $hookmanager;
|
||||
|
||||
$result = '';
|
||||
$label = '<u>'.$langs->trans("Shipment").'</u>';
|
||||
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
$label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.($this->ref_customer ? $this->ref_customer : $this->ref_client);
|
||||
$params = [
|
||||
'id' => $this->id,
|
||||
'objecttype' => $this->element,
|
||||
'option' => $option,
|
||||
'nofetch' => 1,
|
||||
];
|
||||
$classfortooltip = 'classfortooltip';
|
||||
$dataparams = '';
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = ' data-params='.json_encode($params);
|
||||
// $label = $langs->trans('Loading');
|
||||
}
|
||||
$label = implode($this->getTooltipContentArray($params));
|
||||
|
||||
$url = DOL_URL_ROOT.'/expedition/card.php?id='.$this->id;
|
||||
|
||||
@ -1827,8 +1899,8 @@ class Expedition extends CommonObject
|
||||
$label = $langs->trans("Shipment");
|
||||
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose .= ' class="classfortooltip"';
|
||||
$linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose .= ' class="'.$classfortooltip.'"';
|
||||
}
|
||||
|
||||
$linkstart = '<a href="'.$url.'"';
|
||||
@ -1837,7 +1909,7 @@ class Expedition extends CommonObject
|
||||
|
||||
$result .= $linkstart;
|
||||
if ($withpicto) {
|
||||
$result .= img_object(($notooltip ? '' : $label), $this->picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
|
||||
$result .= img_object(($notooltip ? '' : $label), $this->picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : $dataparams.' class="'.(($withpicto != 2) ? 'paddingright ' : '').$classfortooltip.'"'), 0, 0, $notooltip ? 0 : 1);
|
||||
}
|
||||
if ($withpicto != 2) {
|
||||
$result .= $this->ref;
|
||||
|
||||
@ -104,7 +104,7 @@ if (empty($reshook)) {
|
||||
if ($action == 'confirm_cloture' && GETPOST('confirm', 'alpha') == 'yes') {
|
||||
$object->fetch($id);
|
||||
$result = $object->cloture($user);
|
||||
} elseif ($action == 'setref_client' && $user->rights->commande->creer) {
|
||||
} elseif ($action == 'setref_client' && $user->hasRight('commande', 'creer')) {
|
||||
// Positionne ref commande client
|
||||
$result = $object->set_ref_client($user, GETPOST('ref_client'));
|
||||
if ($result < 0) {
|
||||
@ -112,7 +112,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setdatedelivery' && $user->rights->commande->creer) {
|
||||
if ($action == 'setdatedelivery' && $user->hasRight('commande', 'creer')) {
|
||||
$datedelivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int'));
|
||||
|
||||
$object->fetch($id);
|
||||
@ -122,7 +122,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
/*
|
||||
if ($action == 'setdeliveryaddress' && $user->rights->commande->creer)
|
||||
if ($action == 'setdeliveryaddress' && $user->hasRight('commande', 'creer'))
|
||||
{
|
||||
$object = new Commande($db);
|
||||
$object->fetch($id);
|
||||
@ -131,7 +131,7 @@ if (empty($reshook)) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
*/
|
||||
if ($action == 'setmode' && $user->rights->commande->creer) {
|
||||
if ($action == 'setmode' && $user->hasRight('commande', 'creer')) {
|
||||
$object->fetch($id);
|
||||
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
|
||||
if ($result < 0) {
|
||||
@ -139,7 +139,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setavailability' && $user->rights->commande->creer) {
|
||||
if ($action == 'setavailability' && $user->hasRight('commande', 'creer')) {
|
||||
$object->fetch($id);
|
||||
$result = $object->availability(GETPOST('availability_id'));
|
||||
if ($result < 0) {
|
||||
@ -147,7 +147,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setdemandreason' && $user->rights->commande->creer) {
|
||||
if ($action == 'setdemandreason' && $user->hasRight('commande', 'creer')) {
|
||||
$object->fetch($id);
|
||||
$result = $object->demand_reason(GETPOST('demand_reason_id'));
|
||||
if ($result < 0) {
|
||||
@ -155,7 +155,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setconditions' && $user->rights->commande->creer) {
|
||||
if ($action == 'setconditions' && $user->hasRight('commande', 'creer')) {
|
||||
$object->fetch($id);
|
||||
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
|
||||
if ($result < 0) {
|
||||
@ -170,7 +170,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// shipping method
|
||||
if ($action == 'setshippingmethod' && $user->rights->commande->creer) {
|
||||
if ($action == 'setshippingmethod' && $user->hasRight('commande', 'creer')) {
|
||||
$object->fetch($id);
|
||||
$result = $object->setShippingMethod(GETPOST('shipping_method_id', 'int'));
|
||||
if ($result < 0) {
|
||||
@ -179,7 +179,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// warehouse
|
||||
if ($action == 'setwarehouse' && $user->rights->commande->creer) {
|
||||
if ($action == 'setwarehouse' && $user->hasRight('commande', 'creer')) {
|
||||
$object->fetch($id);
|
||||
$result = $object->setWarehouse(GETPOST('warehouse_id', 'int'));
|
||||
if ($result < 0) {
|
||||
@ -210,7 +210,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'set_thirdparty' && $user->rights->commande->creer) {
|
||||
if ($action == 'set_thirdparty' && $user->hasRight('commande', 'creer')) {
|
||||
$object->fetch($id);
|
||||
$object->setValueFrom('fk_soc', $socid, '', '', 'date', '', $user, 'ORDER_MODIFY');
|
||||
|
||||
@ -427,7 +427,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td>';
|
||||
print $langs->trans('Warehouse');
|
||||
print '</td>';
|
||||
if ($action != 'editwarehouse' && $user->rights->commande->creer) {
|
||||
if ($action != 'editwarehouse' && $user->hasRight('commande', 'creer')) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editwarehouse&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetWarehouse'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
|
||||
@ -1693,6 +1693,44 @@ class ExpenseReport extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getTooltipContentArray
|
||||
*
|
||||
* @param array $params ex option, infologin
|
||||
* @since v18
|
||||
* @return array
|
||||
*/
|
||||
public function getTooltipContentArray($params)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$langs->load('expensereport');
|
||||
$nofetch = empty($params['nofetch']) ? false : true;
|
||||
$moretitle = $params['moretitle'] ?? '';
|
||||
$datas = [];
|
||||
$datas['picto'] = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("ExpenseReport").'</u>';
|
||||
if (isset($this->status)) {
|
||||
$datas['picto'] .= ' '.$this->getLibStatut(5);
|
||||
}
|
||||
if ($moretitle) {
|
||||
$datas['picto'] .= ' - '.$moretitle;
|
||||
}
|
||||
if (!empty($this->ref)) {
|
||||
$datas['ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
}
|
||||
if (!empty($this->total_ht)) {
|
||||
$datas['total_ht'] = '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
}
|
||||
if (!empty($this->total_tva)) {
|
||||
$datas['total_tva'] = '<br><b>'.$langs->trans('VAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
}
|
||||
if (!empty($this->total_ttc)) {
|
||||
$datas['total_ttc'] = '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
}
|
||||
|
||||
return $datas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return clicable name (with picto eventually)
|
||||
*
|
||||
@ -1717,25 +1755,21 @@ class ExpenseReport extends CommonObject
|
||||
return $url;
|
||||
}
|
||||
|
||||
$label = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("ExpenseReport").'</u>';
|
||||
if (isset($this->status)) {
|
||||
$label .= ' '.$this->getLibStatut(5);
|
||||
}
|
||||
if (!empty($this->ref)) {
|
||||
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
}
|
||||
if (!empty($this->total_ht)) {
|
||||
$label .= '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
}
|
||||
if (!empty($this->total_tva)) {
|
||||
$label .= '<br><b>'.$langs->trans('VAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
}
|
||||
if (!empty($this->total_ttc)) {
|
||||
$label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
}
|
||||
if ($moretitle) {
|
||||
$label .= ' - '.$moretitle;
|
||||
$params = [
|
||||
'id' => $this->id,
|
||||
'objecttype' => $this->element,
|
||||
'option' => $option,
|
||||
'moretitle' => $moretitle,
|
||||
'nofetch' => 1,
|
||||
];
|
||||
$classfortooltip = 'classfortooltip';
|
||||
$dataparams = '';
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = " data-params='".json_encode($params)."'";
|
||||
// $label = $langs->trans('Loading');
|
||||
}
|
||||
$label = implode($this->getTooltipContentArray($params));
|
||||
|
||||
if ($option != 'nolink') {
|
||||
// Add param to save lastsearch_values or not
|
||||
@ -1759,8 +1793,8 @@ class ExpenseReport extends CommonObject
|
||||
$label = $langs->trans("ShowExpenseReport");
|
||||
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose .= ' class="classfortooltip"';
|
||||
$linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose .= ' class="'.$classfortooltip.'"';
|
||||
}
|
||||
|
||||
$linkstart = '<a href="'.$url.'"';
|
||||
@ -1769,7 +1803,7 @@ class ExpenseReport extends CommonObject
|
||||
|
||||
$result .= $linkstart;
|
||||
if ($withpicto) {
|
||||
$result .= img_object(($notooltip ? '' : $label), $this->picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
|
||||
$result .= img_object(($notooltip ? '' : $label), $this->picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : $dataparams.' class="'.(($withpicto != 2) ? 'paddingright ' : '').$classfortooltip.'"'), 0, 0, $notooltip ? 0 : 1);
|
||||
}
|
||||
if ($withpicto != 2) {
|
||||
$result .= ($max ? dol_trunc($ref, $max) : $ref);
|
||||
|
||||
@ -238,18 +238,18 @@ if ($action == 'add') {
|
||||
$id = 0;
|
||||
header('Location: '.$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
} elseif ($action == 'setfrequency' && $user->rights->ficheinter->creer) {
|
||||
} elseif ($action == 'setfrequency' && $user->hasRight('ficheinter', 'creer')) {
|
||||
// Set frequency and unit frequency
|
||||
$object->fetch($id);
|
||||
$object->setFrequencyAndUnit(GETPOST('frequency', 'int'), GETPOST('unit_frequency', 'alpha'));
|
||||
} elseif ($action == 'setdate_when' && $user->rights->ficheinter->creer) {
|
||||
} elseif ($action == 'setdate_when' && $user->hasRight('ficheinter', 'creer')) {
|
||||
// Set next date of execution
|
||||
$object->fetch($id);
|
||||
$date = dol_mktime(GETPOST('date_whenhour'), GETPOST('date_whenmin'), 0, GETPOST('date_whenmonth'), GETPOST('date_whenday'), GETPOST('date_whenyear'));
|
||||
if (!empty($date)) {
|
||||
$object->setNextDate($date);
|
||||
}
|
||||
} elseif ($action == 'setnb_gen_max' && $user->rights->ficheinter->creer) {
|
||||
} elseif ($action == 'setnb_gen_max' && $user->hasRight('ficheinter', 'creer')) {
|
||||
// Set max period
|
||||
$object->fetch($id);
|
||||
$object->setMaxPeriod(GETPOST('nb_gen_max', 'int'));
|
||||
@ -611,7 +611,7 @@ if ($action == 'create') {
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('Frequency');
|
||||
print '</td>';
|
||||
if ($action != 'editfrequency' && $user->rights->ficheinter->creer) {
|
||||
if ($action != 'editfrequency' && $user->hasRight('ficheinter', 'creer')) {
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editfrequency&token='.newToken().'&id='.$id.'">';
|
||||
print img_edit($langs->trans('Edit'), 1).'</a></td>';
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ $result = restrictedArea($user, 'ficheinter', $id, 'fichinter');
|
||||
|
||||
$permissionnote = $user->rights->ficheinter->creer; // Used by the include of actions_setnotes.inc.php
|
||||
$permissiondellink = $user->rights->ficheinter->creer; // Used by the include of actions_dellink.inc.php
|
||||
$permissiontodelete = (($object->statut == Fichinter::STATUS_DRAFT && $user->rights->ficheinter->creer) || $user->rights->ficheinter->supprimer);
|
||||
$permissiontodelete = (($object->statut == Fichinter::STATUS_DRAFT && $user->hasRight('ficheinter', 'creer')) || $user->rights->ficheinter->supprimer);
|
||||
|
||||
|
||||
/*
|
||||
@ -146,7 +146,7 @@ if (empty($reshook)) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once
|
||||
|
||||
// Action clone object
|
||||
if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->ficheinter->creer) {
|
||||
if ($action == 'confirm_clone' && $confirm == 'yes' && $user->hasRight('ficheinter', 'creer')) {
|
||||
if (1 == 0 && !GETPOST('clone_content') && !GETPOST('clone_receivers')) {
|
||||
setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors');
|
||||
} else {
|
||||
@ -167,7 +167,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->ficheinter->creer) {
|
||||
if ($action == 'confirm_validate' && $confirm == 'yes' && $user->hasRight('ficheinter', 'creer')) {
|
||||
$result = $object->setValid($user);
|
||||
|
||||
if ($result >= 0) {
|
||||
@ -193,7 +193,7 @@ if (empty($reshook)) {
|
||||
} else {
|
||||
$mesg = $object->error;
|
||||
}
|
||||
} elseif ($action == 'confirm_modify' && $confirm == 'yes' && $user->rights->ficheinter->creer) {
|
||||
} elseif ($action == 'confirm_modify' && $confirm == 'yes' && $user->hasRight('ficheinter', 'creer')) {
|
||||
$result = $object->setDraft($user);
|
||||
if ($result >= 0) {
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||
@ -218,7 +218,7 @@ if (empty($reshook)) {
|
||||
} else {
|
||||
$mesg = $object->error;
|
||||
}
|
||||
} elseif ($action == 'add' && $user->rights->ficheinter->creer) {
|
||||
} elseif ($action == 'add' && $user->hasRight('ficheinter', 'creer')) {
|
||||
$selectedLines = GETPOST('toselect', 'array');
|
||||
$object->socid = $socid;
|
||||
$object->duration = (int) GETPOST('duration', 'int');
|
||||
@ -437,7 +437,7 @@ if (empty($reshook)) {
|
||||
$action = 'create';
|
||||
$error++;
|
||||
}
|
||||
} elseif ($action == 'update' && $user->rights->ficheinter->creer) {
|
||||
} elseif ($action == 'update' && $user->hasRight('ficheinter', 'creer')) {
|
||||
$object->socid = $socid;
|
||||
$object->fk_project = (int) GETPOST('projectid', 'int');
|
||||
$object->fk_contrat = (int) GETPOST('contratid', 'int');
|
||||
@ -450,19 +450,19 @@ if (empty($reshook)) {
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
} elseif ($action == 'classin' && $user->rights->ficheinter->creer) {
|
||||
} elseif ($action == 'classin' && $user->hasRight('ficheinter', 'creer')) {
|
||||
// Set into a project
|
||||
$result = $object->setProject(GETPOST('projectid', 'int'));
|
||||
if ($result < 0) {
|
||||
dol_print_error($db, $object->error);
|
||||
}
|
||||
} elseif ($action == 'setcontract' && $user->rights->contrat->creer) {
|
||||
} elseif ($action == 'setcontract' && $user->hasRight('contrat', 'creer')) {
|
||||
// Set into a contract
|
||||
$result = $object->set_contrat($user, GETPOST('contratid', 'int'));
|
||||
if ($result < 0) {
|
||||
dol_print_error($db, $object->error);
|
||||
}
|
||||
} elseif ($action == 'setref_client' && $user->rights->ficheinter->creer) {
|
||||
} elseif ($action == 'setref_client' && $user->hasRight('ficheinter', 'creer')) {
|
||||
// Positionne ref client
|
||||
$result = $object->setRefClient($user, GETPOST('ref_client', 'alpha'));
|
||||
if ($result < 0) {
|
||||
@ -476,12 +476,12 @@ if (empty($reshook)) {
|
||||
|
||||
header('Location: '.DOL_URL_ROOT.'/fichinter/list.php?leftmenu=ficheinter&restore_lastsearch_values=1');
|
||||
exit;
|
||||
} elseif ($action == 'setdescription' && $user->rights->ficheinter->creer) {
|
||||
} elseif ($action == 'setdescription' && $user->hasRight('ficheinter', 'creer')) {
|
||||
$result = $object->set_description($user, GETPOST('description'));
|
||||
if ($result < 0) {
|
||||
dol_print_error($db, $object->error);
|
||||
}
|
||||
} elseif ($action == "addline" && $user->rights->ficheinter->creer) {
|
||||
} elseif ($action == "addline" && $user->hasRight('ficheinter', 'creer')) {
|
||||
// Add line
|
||||
if (!GETPOST('np_desc', 'restricthtml') && empty($conf->global->FICHINTER_EMPTY_LINE_DESC)) {
|
||||
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description"));
|
||||
@ -542,7 +542,7 @@ if (empty($reshook)) {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'classifybilled' && $user->rights->ficheinter->creer) {
|
||||
} elseif ($action == 'classifybilled' && $user->hasRight('ficheinter', 'creer')) {
|
||||
// Classify Billed
|
||||
$result = $object->setStatut(Fichinter::STATUS_BILLED);
|
||||
if ($result > 0) {
|
||||
@ -551,7 +551,7 @@ if (empty($reshook)) {
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
} elseif ($action == 'classifyunbilled' && $user->rights->ficheinter->creer) {
|
||||
} elseif ($action == 'classifyunbilled' && $user->hasRight('ficheinter', 'creer')) {
|
||||
// Classify unbilled
|
||||
$result = $object->setStatut(Fichinter::STATUS_VALIDATED);
|
||||
if ($result > 0) {
|
||||
@ -560,7 +560,7 @@ if (empty($reshook)) {
|
||||
} else {
|
||||
$mesg = $object->error;
|
||||
}
|
||||
} elseif ($action == 'classifydone' && $user->rights->ficheinter->creer) {
|
||||
} elseif ($action == 'classifydone' && $user->hasRight('ficheinter', 'creer')) {
|
||||
// Classify Done
|
||||
$result = $object->setStatut(Fichinter::STATUS_CLOSED);
|
||||
if ($result > 0) {
|
||||
@ -569,7 +569,7 @@ if (empty($reshook)) {
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
} elseif ($action == 'confirm_reopen' && $user->rights->ficheinter->creer) {
|
||||
} elseif ($action == 'confirm_reopen' && $user->hasRight('ficheinter', 'creer')) {
|
||||
// Reopen
|
||||
$result = $object->setStatut(Fichinter::STATUS_VALIDATED);
|
||||
if ($result > 0) {
|
||||
@ -578,7 +578,7 @@ if (empty($reshook)) {
|
||||
} else {
|
||||
$mesg = $object->error;
|
||||
}
|
||||
} elseif ($action == 'updateline' && $user->rights->ficheinter->creer && GETPOST('save', 'alpha') == $langs->trans("Save")) {
|
||||
} elseif ($action == 'updateline' && $user->hasRight('ficheinter', 'creer') && GETPOST('save', 'alpha') == $langs->trans("Save")) {
|
||||
// Mise a jour d'une ligne d'intervention
|
||||
$objectline = new FichinterLigne($db);
|
||||
if ($objectline->fetch($lineid) <= 0) {
|
||||
@ -630,7 +630,7 @@ if (empty($reshook)) {
|
||||
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||
exit;
|
||||
} elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->ficheinter->creer) {
|
||||
} elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->hasRight('ficheinter', 'creer')) {
|
||||
// Supprime une ligne d'intervention AVEC confirmation
|
||||
$objectline = new FichinterLigne($db);
|
||||
if ($objectline->fetch($lineid) <= 0) {
|
||||
@ -660,7 +660,7 @@ if (empty($reshook)) {
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||
fichinter_create($db, $object, $object->model_pdf, $outputlangs);
|
||||
}
|
||||
} elseif ($action == 'up' && $user->rights->ficheinter->creer) {
|
||||
} elseif ($action == 'up' && $user->hasRight('ficheinter', 'creer')) {
|
||||
// Set position of lines
|
||||
$object->line_up($lineid);
|
||||
|
||||
@ -683,7 +683,7 @@ if (empty($reshook)) {
|
||||
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.$lineid);
|
||||
exit;
|
||||
} elseif ($action == 'down' && $user->rights->ficheinter->creer) {
|
||||
} elseif ($action == 'down' && $user->hasRight('ficheinter', 'creer')) {
|
||||
$object->line_down($lineid);
|
||||
|
||||
// Define output language
|
||||
@ -743,7 +743,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->ficheinter->creer) {
|
||||
if (!empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->hasRight('ficheinter', 'creer')) {
|
||||
if ($action == 'addcontact') {
|
||||
if ($result > 0 && $id > 0) {
|
||||
$contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
|
||||
@ -1392,7 +1392,7 @@ if ($action == 'create') {
|
||||
print "</td>\n";
|
||||
|
||||
// Icon to edit and delete
|
||||
if ($object->statut == 0 && $user->rights->ficheinter->creer) {
|
||||
if ($object->statut == 0 && $user->hasRight('ficheinter', 'creer')) {
|
||||
print '<td class="center">';
|
||||
print '<a class="editfielda marginrightonly" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editline&token='.newToken().'&line_id='.$objp->rowid.'#'.$objp->rowid.'">';
|
||||
print img_edit();
|
||||
@ -1422,7 +1422,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
// Line in update mode
|
||||
if ($object->statut == 0 && $action == 'editline' && $user->rights->ficheinter->creer && GETPOST('line_id', 'int') == $objp->rowid) {
|
||||
if ($object->statut == 0 && $action == 'editline' && $user->hasRight('ficheinter', 'creer') && GETPOST('line_id', 'int') == $objp->rowid) {
|
||||
print '<tr class="oddeven nohover">';
|
||||
|
||||
// No.
|
||||
@ -1487,7 +1487,7 @@ if ($action == 'create') {
|
||||
$db->free($resql);
|
||||
|
||||
// Add new line
|
||||
if ($object->statut == 0 && $user->rights->ficheinter->creer && $action <> 'editline' && empty($conf->global->FICHINTER_DISABLE_DETAILS)) {
|
||||
if ($object->statut == 0 && $user->hasRight('ficheinter', 'creer') && $action <> 'editline' && empty($conf->global->FICHINTER_DISABLE_DETAILS)) {
|
||||
if (!$num) {
|
||||
print '<br>';
|
||||
print '<table class="noborder centpercent">';
|
||||
@ -1601,7 +1601,7 @@ if ($action == 'create') {
|
||||
if ($action != 'editdescription' && ($action != 'presend')) {
|
||||
// Validate
|
||||
if ($object->statut == Fichinter::STATUS_DRAFT && (count($object->lines) > 0 || !empty($conf->global->FICHINTER_DISABLE_DETAILS))) {
|
||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->creer) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->ficheinter_advance->validate)) {
|
||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('ficheinter', 'creer')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->ficheinter_advance->validate)) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?id='.$object->id.'&action=validate">'.$langs->trans("Validate").'</a></div>';
|
||||
} else {
|
||||
print '<div class="inline-block divButActionRefused"><span class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Validate").'</span></div>';
|
||||
@ -1609,7 +1609,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
// Modify
|
||||
if ($object->statut == Fichinter::STATUS_VALIDATED && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->creer) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->ficheinter_advance->unvalidate))) {
|
||||
if ($object->statut == Fichinter::STATUS_VALIDATED && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('ficheinter', 'creer')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->ficheinter_advance->unvalidate))) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?id='.$object->id.'&action=modify">';
|
||||
if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) {
|
||||
print $langs->trans("Modify");
|
||||
@ -1640,7 +1640,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
// Create intervention model
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 1 && $object->statut == Fichinter::STATUS_DRAFT && $user->rights->ficheinter->creer && (count($object->lines) > 0)) {
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 1 && $object->statut == Fichinter::STATUS_DRAFT && $user->hasRight('ficheinter', 'creer') && (count($object->lines) > 0)) {
|
||||
print '<div class="inline-block divButAction">';
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/card-rec.php?id='.$object->id.'&action=create&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id).'">'.$langs->trans("ChangeIntoRepeatableIntervention").'</a>';
|
||||
print '</div>';
|
||||
|
||||
@ -815,7 +815,7 @@ class Fichinter extends CommonObject
|
||||
$dataparams = '';
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = ' data-params='.json_encode($params);
|
||||
$dataparams = " data-params='".json_encode($params)."'";
|
||||
// $label = $langs->trans('Loading');
|
||||
}
|
||||
$label = implode($this->getTooltipContentArray($params));
|
||||
|
||||
@ -56,7 +56,7 @@ if (!$result) {
|
||||
* Adding a new contact
|
||||
*/
|
||||
|
||||
if ($action == 'addcontact' && $user->rights->ficheinter->creer) {
|
||||
if ($action == 'addcontact' && $user->hasRight('ficheinter', 'creer')) {
|
||||
if ($result > 0 && $id > 0) {
|
||||
$contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
|
||||
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
|
||||
@ -76,10 +76,10 @@ if ($action == 'addcontact' && $user->rights->ficheinter->creer) {
|
||||
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
}
|
||||
} elseif ($action == 'swapstatut' && $user->rights->ficheinter->creer) {
|
||||
} elseif ($action == 'swapstatut' && $user->hasRight('ficheinter', 'creer')) {
|
||||
// Toggle the status of a contact
|
||||
$result = $object->swapContactStatus(GETPOST('ligne', 'int'));
|
||||
} elseif ($action == 'deletecontact' && $user->rights->ficheinter->creer) {
|
||||
} elseif ($action == 'deletecontact' && $user->hasRight('ficheinter', 'creer')) {
|
||||
// Deletes a contact
|
||||
$result = $object->delete_contact(GETPOST('lineid', 'int'));
|
||||
|
||||
|
||||
@ -914,7 +914,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
$dataparams = '';
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = ' data-params='.json_encode($params);
|
||||
$dataparams = " data-params='".json_encode($params)."'";
|
||||
// $label = $langs->trans('Loading');
|
||||
}
|
||||
|
||||
|
||||
@ -2831,7 +2831,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
$dataparams = '';
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = ' data-params='.json_encode($params);
|
||||
$dataparams = " data-params='".json_encode($params)."'";
|
||||
// $label = $langs->trans('Loading');
|
||||
}
|
||||
|
||||
|
||||
@ -1317,7 +1317,7 @@ class Holiday extends CommonObject
|
||||
if (isset($this->statut)) {
|
||||
$datas['picto'] .= ' '.$this->getLibStatut(5);
|
||||
}
|
||||
$datas['label'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
$datas['ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
|
||||
return $datas;
|
||||
}
|
||||
@ -1344,8 +1344,7 @@ class Holiday extends CommonObject
|
||||
$dataparams = '';
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = ' data-params='.json_encode($params);
|
||||
// $label = $langs->trans('Loading');
|
||||
$dataparams = " data-params='".json_encode($params)."'";
|
||||
}
|
||||
$label = implode($this->getTooltipContentArray($params));
|
||||
|
||||
|
||||
@ -138,7 +138,7 @@ $form = new Form($db);
|
||||
if ($object->id > 0) {
|
||||
$title = $langs->trans("Agenda");
|
||||
//if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
|
||||
$help_url = 'EN:Module_Agenda_En';
|
||||
$help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (isModEnabled('notification')) {
|
||||
|
||||
@ -135,7 +135,7 @@ $form = new Form($db);
|
||||
if ($object->id > 0) {
|
||||
$title = $langs->trans("Agenda");
|
||||
//if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
|
||||
$help_url = 'EN:Module_Agenda_En';
|
||||
$help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (isModEnabled('notification')) {
|
||||
|
||||
@ -137,7 +137,7 @@ $form = new Form($db);
|
||||
if ($object->id > 0) {
|
||||
$title = $langs->trans("Agenda");
|
||||
//if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
|
||||
$help_url = 'EN:Module_Agenda_En';
|
||||
$help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (isModEnabled('notification')) {
|
||||
|
||||
@ -136,7 +136,7 @@ $form = new Form($db);
|
||||
if ($object->id > 0) {
|
||||
$title = $langs->trans("Agenda");
|
||||
//if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
|
||||
$help_url = 'EN:Module_Agenda_En';
|
||||
$help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (isModEnabled('notification')) {
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2021 Greg Rastklan <greg.rastklan@atm-consulting.fr>
|
||||
* Copyright (C) 2021 Jean-Pascal BOUDET <jean-pascal.boudet@atm-consulting.fr>
|
||||
* Copyright (C) 2021 Grégory BLEMAND <gregory.blemand@atm-consulting.fr>
|
||||
* Copyright (C) 2023 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -774,16 +775,16 @@ if ($action != "create" && $action != "edit") {
|
||||
// LINE EDITION | SUPPRESSION
|
||||
|
||||
print '<td>';
|
||||
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
|
||||
// print '<td>';
|
||||
// add pencil
|
||||
//@todo change to proper call dol_
|
||||
//print '<a class="timeline-btn" href="' . dol_buildpath("custom/hrm/skilldet_card.php?action=edit&id=" . $objectline->id, 1) . '"><i class="fa fa-pencil" title="' . $langs->trans("Modify") . '" ></i></a>';
|
||||
// add trash
|
||||
//@todo change to proper call dol_
|
||||
//print '<a class="timeline-btn" href="'.dol_buildpath("custom/hrm/skilldet_card.php?action=delete&id=".$objectline->id,1) .'"><i class="fa fa-trash" title="'.$langs->trans("Delete").'" ></i></a>';
|
||||
//print '</td>';
|
||||
// print '</td>';
|
||||
|
||||
|
||||
// Fields from hook
|
||||
@ -807,7 +808,7 @@ if ($action != "create" && $action != "edit") {
|
||||
// If no record found
|
||||
|
||||
if ($num == 0) {
|
||||
$colspan = 1;
|
||||
$colspan = 2;
|
||||
foreach ($arrayfields as $key => $val) {
|
||||
if (!empty($val['checked'])) {
|
||||
$colspan++;
|
||||
|
||||
@ -56,8 +56,8 @@ INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES
|
||||
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'vero', 'Vero', 'https://vero.co/{socialid}', '', 0);
|
||||
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'viadeo', 'Viadeo', 'https://fr.viadeo.com/fr/{socialid}', 'fa-viadeo', 0);
|
||||
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'viber', 'Viber', '{socialid}', '', 0);
|
||||
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'vimeo', 'Vimeo', '{socialid}', '', 0);
|
||||
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'vimeo', 'Vimeo', '{socialid}', 'fa-vimeo', 0);
|
||||
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'whatsapp', 'Whatsapp', '{socialid}', 'fa-whatsapp', 1);
|
||||
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'wikipedia', 'Wikipedia', '{socialid}', '', 0);
|
||||
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'wikipedia', 'Wikipedia', '{socialid}', 'fa-wikipedia-w', 0);
|
||||
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'xing', 'Xing', '{socialid}', 'fa-xing', 0);
|
||||
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'youtube', 'Youtube', 'https://www.youtube.com/{socialid}', 'fa-youtube', 1);
|
||||
|
||||
@ -777,7 +777,7 @@ class KnowledgeRecord extends CommonObject
|
||||
$dataparams = '';
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = ' data-params='.json_encode($params);
|
||||
$dataparams = " data-params='".json_encode($params)."'";
|
||||
}
|
||||
$label = implode($this->getTooltipContentArray($params));
|
||||
|
||||
|
||||
@ -803,7 +803,7 @@ class MyObject extends CommonObject
|
||||
$dataparams = '';
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = ' data-params='.json_encode($params);
|
||||
$dataparams = " data-params='".json_encode($params)."'";
|
||||
// $label = $langs->trans('Loading');
|
||||
}
|
||||
$label = implode($this->getTooltipContentArray($params));
|
||||
|
||||
@ -187,7 +187,7 @@ $form = new Form($db);
|
||||
if ($object->id > 0) {
|
||||
$title = $langs->trans("Agenda");
|
||||
//if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
|
||||
$help_url = 'EN:Module_Agenda_En';
|
||||
$help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (isModEnabled('notification')) {
|
||||
|
||||
@ -1169,7 +1169,7 @@ class Mo extends CommonObject
|
||||
$dataparams = '';
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = ' data-params='.json_encode($params);
|
||||
$dataparams = " data-params='".json_encode($params)."'";
|
||||
// $label = $langs->trans('Loading');
|
||||
}
|
||||
|
||||
|
||||
@ -131,7 +131,7 @@ $formproject = new FormProjets($db);
|
||||
if ($object->id > 0) {
|
||||
$title = $langs->trans("Agenda");
|
||||
//if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Agenda';
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:|DE:Modul_Terminplanung';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (isModEnabled('notification')) {
|
||||
|
||||
@ -474,7 +474,7 @@ class Opensurveysondage extends CommonObject
|
||||
$dataparams = '';
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = ' data-params='.json_encode($params);
|
||||
$dataparams = " data-params='".json_encode($params)."'";
|
||||
// $label = $langs->trans('Loading');
|
||||
}
|
||||
$label = implode($this->getTooltipContentArray($params));
|
||||
|
||||
@ -990,7 +990,7 @@ class Partnership extends CommonObject
|
||||
$dataparams = '';
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = ' data-params='.json_encode($params);
|
||||
$dataparams = " data-params='".json_encode($params)."'";
|
||||
// $label = $langs->trans('Loading');
|
||||
}
|
||||
$label = implode($this->getTooltipContentArray($params));
|
||||
|
||||
@ -72,7 +72,7 @@ if (!$sortorder) {
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('agendathirdparty'));
|
||||
$hookmanager->initHooks(array('productagenda'));
|
||||
|
||||
$object = new Product($db);
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
@ -137,7 +137,7 @@ if ($id > 0 || $ref) {
|
||||
|
||||
$title = $langs->trans("Agenda");
|
||||
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda';
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|DE:Modul_Terminplanung';
|
||||
|
||||
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/productnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
|
||||
$title = $object->name." - ".$title;
|
||||
|
||||
@ -2846,7 +2846,7 @@ if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action ==
|
||||
//print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
|
||||
// Propals
|
||||
if (isModEnabled("propal") && $user->rights->propal->creer) {
|
||||
if (isModEnabled("propal") && $user->hasRight('propal', 'creer')) {
|
||||
$propal = new Propal($db);
|
||||
|
||||
$langs->load("propal");
|
||||
@ -2867,7 +2867,7 @@ if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action ==
|
||||
}
|
||||
|
||||
// Commande
|
||||
if (isModEnabled('commande') && $user->rights->commande->creer) {
|
||||
if (isModEnabled('commande') && $user->hasRight('commande', 'creer')) {
|
||||
$commande = new Commande($db);
|
||||
|
||||
$langs->load("orders");
|
||||
@ -2887,7 +2887,7 @@ if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action ==
|
||||
}
|
||||
|
||||
// Factures
|
||||
if (isModEnabled('facture') && $user->rights->facture->creer) {
|
||||
if (isModEnabled('facture') && $user->hasRight('facture', 'creer')) {
|
||||
$invoice = new Facture($db);
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
@ -5149,7 +5149,7 @@ class Product extends CommonObject
|
||||
$dataparams = '';
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = ' data-params='.json_encode($params);
|
||||
$dataparams = " data-params='".json_encode($params)."'";
|
||||
// $label = $langs->trans('Loading');
|
||||
}
|
||||
|
||||
|
||||
@ -748,7 +748,7 @@ class Entrepot extends CommonObject
|
||||
$dataparams = '';
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = ' data-params='.json_encode($params);
|
||||
$dataparams = " data-params='".json_encode($params)."'";
|
||||
// $label = $langs->trans('Loading');
|
||||
}
|
||||
|
||||
|
||||
@ -641,7 +641,7 @@ class Productlot extends CommonObject
|
||||
$dataparams = '';
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = ' data-params='.json_encode($params);
|
||||
$dataparams = " data-params='".json_encode($params)."'";
|
||||
// $label = $langs->trans('Loading');
|
||||
}
|
||||
|
||||
|
||||
@ -1530,15 +1530,15 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
||||
print'<a style="margin-right: auto;"class="dropdown-toggle butAction" data-toggle="dropdown">'.$langs->trans("Create").'</a>';
|
||||
print '<div class="dropdown-menu">';
|
||||
print '<div class="dropdown-global-search-button-list" >';
|
||||
if (isModEnabled("propal") && $user->rights->propal->creer) {
|
||||
if (isModEnabled("propal") && $user->hasRight('propal', 'creer')) {
|
||||
$langs->load("propal");
|
||||
print dolGetButtonAction('', $langs->trans('AddProp'), 'default', DOL_URL_ROOT.'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true));
|
||||
}
|
||||
if (isModEnabled('commande') && $user->rights->commande->creer) {
|
||||
if (isModEnabled('commande') && $user->hasRight('commande', 'creer')) {
|
||||
$langs->load("orders");
|
||||
print dolGetButtonAction('', $langs->trans('CreateOrder'), 'default', DOL_URL_ROOT.'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true));
|
||||
}
|
||||
if (isModEnabled('facture') && $user->rights->facture->creer) {
|
||||
if (isModEnabled('facture') && $user->hasRight('facture', 'creer')) {
|
||||
$langs->load("bills");
|
||||
print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true));
|
||||
}
|
||||
@ -1554,11 +1554,11 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
||||
$langs->load("suppliers");
|
||||
print dolGetButtonAction('', $langs->trans('AddSupplierInvoice'), 'default', DOL_URL_ROOT.'/fourn/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true));
|
||||
}
|
||||
if (isModEnabled('ficheinter') && $user->rights->ficheinter->creer) {
|
||||
if (isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'creer')) {
|
||||
$langs->load("interventions");
|
||||
print dolGetButtonAction('', $langs->trans('AddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true));
|
||||
}
|
||||
if (isModEnabled('contrat') && $user->rights->contrat->creer) {
|
||||
if (isModEnabled('contrat') && $user->hasRight('contrat', 'creer')) {
|
||||
$langs->load("contracts");
|
||||
print dolGetButtonAction('', $langs->trans('AddContract'), 'default', DOL_URL_ROOT.'/contrat/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true));
|
||||
}
|
||||
|
||||
@ -1323,8 +1323,7 @@ class Project extends CommonObject
|
||||
$dataparams = '';
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = ' data-params='.json_encode($params);
|
||||
// $label = $langs->trans('Loading');
|
||||
$dataparams = " data-params='".json_encode($params)."'";
|
||||
}
|
||||
$label = implode($this->getTooltipContentArray($params));
|
||||
|
||||
|
||||
@ -753,7 +753,7 @@ class Task extends CommonObjectLine
|
||||
$dataparams = '';
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = ' data-params='.json_encode($params);
|
||||
$dataparams = " data-params='".json_encode($params)."'";
|
||||
// $label = $langs->trans('Loading');
|
||||
}
|
||||
$label = implode($this->getTooltipContentArray($params));
|
||||
|
||||
@ -1109,7 +1109,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
//'builddoc'=>$langs->trans("PDFMerge"),
|
||||
);
|
||||
}
|
||||
if ( isModEnabled('ficheinter') && $user->rights->ficheinter->creer) {
|
||||
if ( isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'creer')) {
|
||||
$langs->load("interventions");
|
||||
$arrayofmassactions['generateinter'] = $langs->trans("GenerateInter");
|
||||
}
|
||||
@ -1388,9 +1388,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
print '<input type="hidden" name="action" value="updatesplitline">';
|
||||
} elseif ($action == 'createtime' && $user->rights->projet->time) {
|
||||
print '<input type="hidden" name="action" value="addtimespent">';
|
||||
} elseif ($massaction == 'generateinvoice' && $user->rights->facture->creer) {
|
||||
} elseif ($massaction == 'generateinvoice' && $user->hasRight('facture', 'creer')) {
|
||||
print '<input type="hidden" name="action" value="confirm_generateinvoice">';
|
||||
} elseif ($massaction == 'generateinter' && $user->rights->ficheinter->creer) {
|
||||
} elseif ($massaction == 'generateinter' && $user->hasRight('ficheinter', 'creer')) {
|
||||
print '<input type="hidden" name="action" value="confirm_generateinter">';
|
||||
} else {
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
|
||||
@ -206,7 +206,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
|
||||
$triggersendname = 'TICKET_SENTBYMAIL';
|
||||
$paramname = 'id';
|
||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_TICKET_TO'; // used to know the automatic BCC to add
|
||||
if (!empty($object->id)) $trackid = 'tic'.$object->id;
|
||||
if (!empty($object->dao->id)) $trackid = 'tic'.$object->dao->id;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||
|
||||
|
||||
@ -345,7 +345,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
|
||||
|
||||
$formticket->action = "add_message";
|
||||
$formticket->track_id = $object->dao->track_id;
|
||||
$formticket->id = $object->dao->id;
|
||||
$formticket->trackid = 'tic'.$object->dao->id;
|
||||
|
||||
$formticket->param = array('track_id' => $object->dao->track_id, 'fk_user_create' => '-1',
|
||||
'returnurl' => DOL_URL_ROOT.'/public/ticket/view.php'.(!empty($entity) && isModEnabled('multicompany')?'?entity='.$entity:''));
|
||||
|
||||
@ -128,7 +128,7 @@ $form = new Form($db);
|
||||
if ($object->id > 0) {
|
||||
$title = $object->ref." - ".$langs->trans('Agenda');
|
||||
//if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
|
||||
$help_url = 'Module_Agenda_En';
|
||||
$help_url = 'Module_Agenda_En|DE:Modul_Terminplanung';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if (isModEnabled('notification')) {
|
||||
|
||||
@ -815,7 +815,7 @@ class Dolresource extends CommonObject
|
||||
$dataparams = '';
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = ' data-params='.json_encode($params);
|
||||
$dataparams = " data-params='".json_encode($params)."'";
|
||||
// $label = $langs->trans('Loading');
|
||||
}
|
||||
$label = implode($this->getTooltipContentArray($params));
|
||||
|
||||
@ -539,7 +539,7 @@ class Salary extends CommonObject
|
||||
$dataparams = '';
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = ' data-params='.json_encode($params);
|
||||
$dataparams = " data-params='".json_encode($params)."'";
|
||||
// $label = $langs->trans('Loading');
|
||||
}
|
||||
|
||||
|
||||
@ -615,10 +615,11 @@ class Societe extends CommonObject
|
||||
/**
|
||||
* Duplicate of code_compta_client (for backward compatibility)
|
||||
* @var string
|
||||
* @deprecated
|
||||
* @see $code_compta_client
|
||||
*/
|
||||
public $code_compta;
|
||||
|
||||
|
||||
/**
|
||||
* Accounting code for customer
|
||||
* @var string
|
||||
@ -637,14 +638,12 @@ class Societe extends CommonObject
|
||||
*/
|
||||
public $accountancy_code_supplier;
|
||||
|
||||
|
||||
/**
|
||||
* Accounting code for product (for level 3 of suggestion of prouct accounting account)
|
||||
* @var string
|
||||
*/
|
||||
public $code_compta_product;
|
||||
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @deprecated Note is split in public and private notes
|
||||
@ -2716,25 +2715,28 @@ class Societe extends CommonObject
|
||||
if (!empty($this->code_client) && ($this->client == 1 || $this->client == 3)) {
|
||||
$datas['customercode'] = '<br><b>'.$langs->trans('CustomerCode').':</b> '.$this->code_client;
|
||||
}
|
||||
if (isModEnabled('accounting') && ($this->client == 1 || $this->client == 3)) {
|
||||
$langs->load('compta');
|
||||
$datas['accountancycustomercode'] = '<br><b>'.$langs->trans('CustomerAccountancyCode').':</b> '.($this->code_compta ? $this->code_compta : $this->code_compta_client);
|
||||
}
|
||||
// show categories for this record only in ajax to not overload lists
|
||||
if (!$nofetch && isModEnabled('categorie') && $this->client) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
||||
$form = new Form($this->db);
|
||||
$datas['categories_customer'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_CUSTOMER, 1, 1);
|
||||
}
|
||||
if (!empty($this->code_fournisseur) && $this->fournisseur) {
|
||||
$datas['suppliercode'] = '<br><b>'.$langs->trans('SupplierCode').':</b> '.$this->code_fournisseur;
|
||||
}
|
||||
if (isModEnabled('accounting') && ($this->client == 1 || $this->client == 3)) {
|
||||
$datas['accountancycustomercode'] = '<br><b>'.$langs->trans('CustomerAccountancyCode').':</b> '.($this->code_compta ? $this->code_compta : $this->code_compta_client);
|
||||
}
|
||||
if (isModEnabled('accounting') && $this->fournisseur) {
|
||||
$langs->load('compta');
|
||||
$datas['accountancysuppliercode'] = '<br><b>'.$langs->trans('SupplierAccountancyCode').':</b> '.$this->code_compta_fournisseur;
|
||||
}
|
||||
// show categories for this record only in ajax to not overload lists
|
||||
if (isModEnabled('categorie') && !$nofetch) {
|
||||
if (!$nofetch && isModEnabled('categorie') && $this->fournisseur) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
||||
$form = new Form($this->db);
|
||||
if ($this->client) {
|
||||
$datas['categories_customer'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_CUSTOMER, 1);
|
||||
}
|
||||
if ($this->fournisseur) {
|
||||
$datas['categories_supplier'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_SUPPLIER, 1);
|
||||
}
|
||||
$datas['categories_supplier'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_SUPPLIER, 1, 1);
|
||||
}
|
||||
|
||||
$datas['divclose'] = '</div>';
|
||||
@ -2807,7 +2809,7 @@ class Societe extends CommonObject
|
||||
$dataparams = '';
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = ' data-params='.json_encode($params);
|
||||
$dataparams = " data-params='".json_encode($params)."'";
|
||||
// $label = $langs->trans('Loading');
|
||||
}
|
||||
$label = implode($this->getTooltipContentArray($params));
|
||||
|
||||
@ -435,7 +435,7 @@ class SocieteAccount extends CommonObject
|
||||
'option' => $option,
|
||||
];
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = ' data-params='.json_encode($params);
|
||||
$dataparams = " data-params='".json_encode($params)."'";
|
||||
// $label = $langs->trans('Loading');
|
||||
}
|
||||
if (empty($notooltip)) {
|
||||
|
||||
@ -167,16 +167,16 @@ if ($object->client) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$nbFactsClient = $obj->nb;
|
||||
$thirdTypeArray['customer'] = $langs->trans("customer");
|
||||
if (isModEnabled("propal") && $user->rights->propal->lire) {
|
||||
if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) {
|
||||
$elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals');
|
||||
}
|
||||
if (isModEnabled('commande') && $user->rights->commande->lire) {
|
||||
if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) {
|
||||
$elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders');
|
||||
}
|
||||
if (isModEnabled('facture') && $user->rights->facture->lire) {
|
||||
if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) {
|
||||
$elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices');
|
||||
}
|
||||
if (isModEnabled('contrat') && $user->rights->contrat->lire) {
|
||||
if (isModEnabled('contrat') && $user->hasRight('contrat', 'lire')) {
|
||||
$elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts');
|
||||
}
|
||||
}
|
||||
|
||||
@ -903,16 +903,16 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
||||
$obj = $db->fetch_object($resql);
|
||||
$nbFactsClient = $obj->nb;
|
||||
$thirdTypeArray['customer'] = $langs->trans("customer");
|
||||
if (isModEnabled("propal") && $user->rights->propal->lire) {
|
||||
if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) {
|
||||
$elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals');
|
||||
}
|
||||
if (isModEnabled('commande') && $user->rights->commande->lire) {
|
||||
if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) {
|
||||
$elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders');
|
||||
}
|
||||
if (isModEnabled('facture') && $user->rights->facture->lire) {
|
||||
if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) {
|
||||
$elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices');
|
||||
}
|
||||
if (isModEnabled('contrat') && $user->rights->contrat->lire) {
|
||||
if (isModEnabled('contrat') && $user->hasRight('contrat', 'lire')) {
|
||||
$elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts');
|
||||
}
|
||||
|
||||
@ -964,16 +964,16 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
||||
$obj = $db->fetch_object($resql);
|
||||
$nbFactsClient = $obj->nb;
|
||||
$thirdTypeArray['customer'] = $langs->trans("customer");
|
||||
if (isModEnabled('propal') && $user->rights->propal->lire) {
|
||||
if (isModEnabled('propal') && $user->hasRight('propal', 'lire')) {
|
||||
$elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals');
|
||||
}
|
||||
if (isModEnabled('commande') && $user->rights->commande->lire) {
|
||||
if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) {
|
||||
$elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders');
|
||||
}
|
||||
if (isModEnabled('facture') && $user->rights->facture->lire) {
|
||||
if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) {
|
||||
$elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices');
|
||||
}
|
||||
if (isModEnabled('contrat') && $user->rights->contrat->lire) {
|
||||
if (isModEnabled('contrat') && $user->hasRight('contrat', 'lire')) {
|
||||
$elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts');
|
||||
}
|
||||
}
|
||||
|
||||
@ -2538,7 +2538,7 @@ class SupplierProposal extends CommonObject
|
||||
$dataparams = '';
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = ' data-params='.json_encode($params);
|
||||
$dataparams = " data-params='".json_encode($params)."'";
|
||||
// $label = $langs->trans('Loading');
|
||||
}
|
||||
|
||||
@ -2563,7 +2563,7 @@ class SupplierProposal extends CommonObject
|
||||
}
|
||||
|
||||
$linkclose = '';
|
||||
if (empty($notooltip) && $user->rights->propal->lire) {
|
||||
if (empty($notooltip) && $user->hasRight('propal', 'lire')) {
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
$label = $langs->trans("ShowSupplierProposal");
|
||||
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
|
||||
@ -166,7 +166,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
||||
|
||||
if (empty($reshook)) {
|
||||
// Action to record a payment on a TakePOS invoice
|
||||
if ($action == 'valid' && $user->rights->facture->creer) {
|
||||
if ($action == 'valid' && $user->hasRight('facture', 'creer')) {
|
||||
$bankaccount = 0;
|
||||
$error = 0;
|
||||
|
||||
@ -305,7 +305,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'creditnote' && $user->rights->facture->creer) {
|
||||
if ($action == 'creditnote' && $user->hasRight('facture', 'creer')) {
|
||||
$creditnote = new Facture($db);
|
||||
$creditnote->socid = $invoice->socid;
|
||||
$creditnote->date = dol_now();
|
||||
@ -1692,4 +1692,3 @@ print '</div>';
|
||||
if ((getDolGlobalString('TAKEPOS_PHONE_BASIC_LAYOUT') == 1 && $conf->browser->layout == 'phone') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
|
||||
print '</body></html>';
|
||||
}
|
||||
|
||||
|
||||
@ -137,7 +137,7 @@ $title = $langs->trans("Ticket").' - '.$object->ref.' '.$object->name;
|
||||
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/ticketnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
|
||||
$title = $object->ref.' '.$object->name.' - '.$langs->trans("Info");
|
||||
}
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda';
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|DE:Modul_Terminplanung';
|
||||
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
|
||||
@ -1416,7 +1416,7 @@ if ($action == 'create' || $action == 'presend') {
|
||||
if (!$object->fk_soc && $user->hasRight("ficheinter", "creer")) {
|
||||
print dolGetButtonAction($langs->trans('UnableToCreateInterIfNoSocid'), $langs->trans('TicketAddIntervention'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
|
||||
}
|
||||
if ($object->fk_soc > 0 && isset($object->status) && $object->status < Ticket::STATUS_CLOSED && $user->rights->ficheinter->creer) {
|
||||
if ($object->fk_soc > 0 && isset($object->status) && $object->status < Ticket::STATUS_CLOSED && $user->hasRight('ficheinter', 'creer')) {
|
||||
print dolGetButtonAction('', $langs->trans('TicketAddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&token='.newToken().'&socid='. $object->fk_soc.'&origin=ticket_ticket&originid='. $object->id, '');
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user