Merge remote-tracking branch 'origin/Squiz.Scope.MethodScope.Missing' into Squiz.Scope.MethodScope.Missing

This commit is contained in:
Frédéric FRANCE 2019-02-27 17:56:13 +01:00
commit c5d252fa2e
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
15 changed files with 35 additions and 93 deletions

View File

@ -118,11 +118,11 @@ if (empty($reshook))
$error=0;
$permissiontoadd = $user->rights->bom->write;
$permissiontodelete = $user->rights->bom->delete || ($permissiontoadd && $object->status == 0);
$permissiontodelete = $user->rights->bom->delete || ($permissiontoadd && $object->status == 0);
$backurlforlist = dol_buildpath('/bom/bom_list.php', 1);
if (empty($backtopage)) {
if (empty($id)) $backtopage = $backurlforlist;
else $backtopage = dol_buildpath('/bom/bom_card.php', 1).($id > 0 ? $id : '__ID__');
if (empty($backtopage)) {
if (empty($id)) $backtopage = $backurlforlist;
else $backtopage = dol_buildpath('/bom/bom_card.php', 1).($id > 0 ? $id : '__ID__');
}
$triggermodname = 'BILLOFMATERIALS_BILLOFMATERIALS_MODIFY'; // Name of trigger action code to execute when we modify record

View File

@ -1357,7 +1357,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
$sql.= ", p.date_livraison as date_livraison";
$sql.= ", p.model_pdf, p.last_main_doc, p.ref_client, p.extraparams";
$sql.= ", p.note_private, p.note_public";
$sql.= ", p.fk_projet, p.fk_statut";
$sql.= ", p.fk_projet as fk_project, p.fk_statut";
$sql.= ", p.fk_user_author, p.fk_user_valid, p.fk_user_cloture";
$sql.= ", p.fk_delivery_address";
$sql.= ", p.fk_availability";
@ -1412,7 +1412,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
$this->total_localtax2 = $obj->localtax2;
$this->total_ttc = $obj->total;
$this->socid = $obj->fk_soc;
$this->fk_project = $obj->fk_projet;
$this->fk_project = $obj->fk_project;
$this->modelpdf = $obj->model_pdf;
$this->last_main_doc = $obj->last_main_doc;
$this->note = $obj->note_private; // TODO deprecated

View File

@ -247,7 +247,7 @@ class Deplacement extends CommonObject
*/
public function fetch($id, $ref = '')
{
$sql = "SELECT rowid, fk_user, type, fk_statut, km, fk_soc, dated, note_private, note_public, fk_projet, extraparams";
$sql = "SELECT rowid, fk_user, type, fk_statut, km, fk_soc, dated, note_private, note_public, fk_projet as fk_project, extraparams";
$sql.= " FROM ".MAIN_DB_PREFIX."deplacement";
$sql.= " WHERE entity IN (".getEntity('deplacement').")";
if ($ref) $sql.= " AND ref ='".$this->db->escape($ref)."'";
@ -269,7 +269,7 @@ class Deplacement extends CommonObject
$this->statut = $obj->fk_statut;
$this->note_private = $obj->note_private;
$this->note_public = $obj->note_public;
$this->fk_project = $obj->fk_projet;
$this->fk_project = $obj->fk_project;
$this->extraparams = (array) json_decode($obj->extraparams, true);

View File

@ -1159,30 +1159,6 @@ class Facture extends CommonInvoice
else return -1;
}
/**
* Return link to download file from a direct external access
*
* @param int $withpicto Add download picto into link
* @return string HTML link to file
*/
function getDirectExternalLink($withpicto = 0)
{
global $dolibarr_main_url_root;
// Define $urlwithroot
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
// TODO Read into ecmfile table to get entry and hash exists (PS: If not found, add it)
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
$ecmfile=new EcmFiles($this->db);
//$result = $ecmfile->get();
$hashp='todo';
return '<a href="'.$urlwithroot.'/document.php?modulepart=invoice&hashp='.$hashp.'" target="_download" rel="noindex, nofollow">'.$this->ref.'</a>';
}
/**
* Return clicable link of object (with eventually picto)
*

View File

@ -621,7 +621,7 @@ class Contrat extends CommonObject
$sql.= " ref_ext,";
$sql.= " fk_user_mise_en_service, date_contrat as datecontrat,";
$sql.= " fk_user_author, fin_validite, date_cloture,";
$sql.= " fk_projet,";
$sql.= " fk_projet as fk_project,";
$sql.= " fk_commercial_signature, fk_commercial_suivi,";
$sql.= " note_private, note_public, model_pdf, extraparams";
$sql.= " FROM ".MAIN_DB_PREFIX."contrat";
@ -672,8 +672,8 @@ class Contrat extends CommonObject
$this->note_public = $obj->note_public;
$this->modelpdf = $obj->model_pdf;
$this->fk_projet = $obj->fk_projet; // deprecated
$this->fk_project = $obj->fk_projet;
$this->fk_projet = $obj->fk_project; // deprecated
$this->fk_project = $obj->fk_project;
$this->socid = $obj->fk_soc;
$this->fk_soc = $obj->fk_soc;

View File

@ -303,17 +303,6 @@ class EmailSenderProfile extends CommonObject
return $result;
}
/**
* Return link to download file from a direct external access
*
* @param int $withpicto Add download picto into link
* @return string HTML link to file
*/
function getDirectExternalLink($withpicto = 0)
{
return 'todo';
}
/**
* Retourne le libelle du status d'un user (actif, inactif)
*

View File

@ -527,7 +527,7 @@ class Expedition extends CommonObject
// Check parameters
if (empty($id) && empty($ref) && empty($ref_ext) && empty($ref_int)) return -1;
$sql = "SELECT e.rowid, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.ref_int, e.fk_user_author, e.fk_statut, e.fk_projet, e.billed";
$sql = "SELECT e.rowid, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.ref_int, e.fk_user_author, e.fk_statut, e.fk_projet as fk_project, e.billed";
$sql.= ", e.weight, e.weight_units, e.size, e.size_units, e.width, e.height";
$sql.= ", e.date_expedition as date_expedition, e.model_pdf, e.fk_address, e.date_delivery";
$sql.= ", e.fk_shipping_method, e.tracking_number";
@ -575,7 +575,7 @@ class Expedition extends CommonObject
$this->origin = ($obj->origin?$obj->origin:'commande'); // For compatibility
$this->origin_id = $obj->origin_id;
$this->billed = $obj->billed;
$this->fk_project = $obj->fk_projet;
$this->fk_project = $obj->fk_project;
$this->trueWeight = $obj->weight;
$this->weight_units = $obj->weight_units;

View File

@ -379,7 +379,7 @@ class Fichinter extends CommonObject
$sql.= " f.datec, f.dateo, f.datee, f.datet, f.fk_user_author,";
$sql.= " f.date_valid as datev,";
$sql.= " f.tms as datem,";
$sql.= " f.duree, f.fk_projet, f.note_public, f.note_private, f.model_pdf, f.extraparams, fk_contrat";
$sql.= " f.duree, f.fk_projet as fk_project, f.note_public, f.note_private, f.model_pdf, f.extraparams, fk_contrat";
$sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f";
if ($ref) {
$sql.= " WHERE f.entity IN (".getEntity('intervention').")";
@ -407,8 +407,8 @@ class Fichinter extends CommonObject
$this->datet = $this->db->jdate($obj->datet);
$this->datev = $this->db->jdate($obj->datev);
$this->datem = $this->db->jdate($obj->datem);
$this->fk_project = $obj->fk_projet;
$this->note_public = $obj->note_public;
$this->fk_project = $obj->fk_project;
$this->note_public = $obj->note_public;
$this->note_private = $obj->note_private;
$this->modelpdf = $obj->model_pdf;
$this->fk_contrat = $obj->fk_contrat;

View File

@ -2846,7 +2846,7 @@ function migrate_project_task_actors($db, $langs, $conf)
$db->begin();
$sql = "SELECT fk_projet_task, fk_user FROM ".MAIN_DB_PREFIX."projet_task_actors";
$sql = "SELECT fk_projet_task as fk_project_task, fk_user FROM ".MAIN_DB_PREFIX."projet_task_actors";
$resql = $db->query($sql);
if ($resql)
{
@ -2868,7 +2868,7 @@ function migrate_project_task_actors($db, $langs, $conf)
$sql2.= ") VALUES (";
$sql2.= "'".$db->idate(dol_now())."'";
$sql2.= ", '4'";
$sql2.= ", ".$obj->fk_projet_task;
$sql2.= ", ".$obj->fk_project_task;
$sql2.= ", '180'";
$sql2.= ", ".$obj->fk_user;
$sql2.= ")";

View File

@ -238,7 +238,7 @@ class Task extends CommonObject
$sql = "SELECT";
$sql.= " t.rowid,";
$sql.= " t.ref,";
$sql.= " t.fk_projet,";
$sql.= " t.fk_projet as fk_project,";
$sql.= " t.fk_task_parent,";
$sql.= " t.label,";
$sql.= " t.description,";
@ -281,7 +281,7 @@ class Task extends CommonObject
$this->id = $obj->rowid;
$this->ref = $obj->ref;
$this->fk_project = $obj->fk_projet;
$this->fk_project = $obj->fk_project;
$this->fk_task_parent = $obj->fk_task_parent;
$this->label = $obj->label;
$this->description = $obj->description;

View File

@ -838,6 +838,7 @@ if ($source == 'order')
// Debitor
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("ThirdParty");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$order->thirdparty->name.'</b>';
print '</td></tr>'."\n";
// Object
$text='<b>'.$langs->trans("PaymentOrderRef", $order->ref).'</b>';
@ -958,6 +959,7 @@ if ($source == 'invoice')
// Debitor
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("ThirdParty");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$invoice->thirdparty->name.'</b>';
print '</td></tr>'."\n";
// Object
$text='<b>'.$langs->trans("PaymentInvoiceRef", $invoice->ref).'</b>';
@ -1009,15 +1011,6 @@ if ($source == 'invoice')
print '<input type="hidden" name="fulltag" value="'.$fulltag.'">';
print '</td></tr>'."\n";
// Add download link
if ($download > 0)
{
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Document");
print '</td><td class="CTableRow'.($var?'1':'2').'">';
print $invoice->getDirectExternalLink(1);
print '</td></tr>'."\n";
}
// Shipping address
$shipToName=$invoice->thirdparty->name;
$shipToStreet=$invoice->thirdparty->address;
@ -1295,22 +1288,20 @@ if ($source == 'membersubscription')
$fulltag=dol_string_unaccent($fulltag);
// Creditor
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Creditor");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$creditor.'</b>';
print '<input type="hidden" name="creditor" value="'.$creditor.'">';
print '</td></tr>'."\n";
// Debitor
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Member");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>';
if ($member->morphy == 'mor' && ! empty($member->societe)) print $member->societe;
else print $member->getFullName($langs);
print '</b>';
print '</td></tr>'."\n";
// Object
$text='<b>'.$langs->trans("PaymentSubscription").'</b>';
if (GETPOST('desc', 'alpha')) $text='<b>'.$langs->trans(GETPOST('desc', 'alpha')).'</b>';
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Designation");
@ -1343,7 +1334,6 @@ if ($source == 'membersubscription')
}
// Amount
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Amount");
if (empty($amount))
{
@ -1391,7 +1381,6 @@ if ($source == 'membersubscription')
print '</td></tr>'."\n";
// Tag
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("PaymentCode");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b style="word-break: break-all;">'.$fulltag.'</b>';
print '<input type="hidden" name="tag" value="'.$tag.'">';
@ -1463,22 +1452,20 @@ if ($source == 'donation')
$fulltag=dol_string_unaccent($fulltag);
// Creditor
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Creditor");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$creditor.'</b>';
print '<input type="hidden" name="creditor" value="'.$creditor.'">';
print '</td></tr>'."\n";
// Debitor
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("ThirdParty");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>';
if ($don->morphy == 'mor' && ! empty($don->societe)) print $don->societe;
else print $don->getFullName($langs);
print '</b>';
print '</td></tr>'."\n";
// Object
$text='<b>'.$langs->trans("PaymentDonation").'</b>';
if (GETPOST('desc', 'alpha')) $text='<b>'.$langs->trans(GETPOST('desc', 'alpha')).'</b>';
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Designation");
@ -1488,7 +1475,6 @@ if ($source == 'donation')
print '</td></tr>'."\n";
// Amount
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Amount");
if (empty($amount))
{
@ -1536,7 +1522,6 @@ if ($source == 'donation')
print '</td></tr>'."\n";
// Tag
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("PaymentCode");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b style="word-break: break-all;">'.$fulltag.'</b>';
print '<input type="hidden" name="tag" value="'.$tag.'">';

View File

@ -401,17 +401,6 @@ class SocieteAccount extends CommonObject
return $result;
}
/**
* Return link to download file from a direct external access
*
* @param int $withpicto Add download picto into link
* @return string HTML link to file
*/
function getDirectExternalLink($withpicto = 0)
{
return 'todo';
}
/**
* Retourne le libelle du status d'un user (actif, inactif)
*

View File

@ -1226,7 +1226,7 @@ class SupplierProposal extends CommonObject
$sql.= ", p.date_livraison as date_livraison";
$sql.= ", p.model_pdf, p.extraparams";
$sql.= ", p.note_private, p.note_public";
$sql.= ", p.fk_projet, p.fk_statut";
$sql.= ", p.fk_projet as fk_project, p.fk_statut";
$sql.= ", p.fk_user_author, p.fk_user_valid, p.fk_user_cloture";
$sql.= ", p.fk_cond_reglement";
$sql.= ", p.fk_mode_reglement";
@ -1266,7 +1266,7 @@ class SupplierProposal extends CommonObject
$this->total_localtax2 = $obj->localtax2;
$this->total_ttc = $obj->total;
$this->socid = $obj->fk_soc;
$this->fk_project = $obj->fk_projet;
$this->fk_project = $obj->fk_project;
$this->modelpdf = $obj->model_pdf;
$this->note = $obj->note_private; // TODO deprecated
$this->note_private = $obj->note_private;

View File

@ -1591,8 +1591,10 @@ div.tmenudiv {
div.tmenudisabled, a.tmenudisabled {
opacity: 0.6;
}
a.tmenu, a.tmenusel, a.tmenudisabled {
font-weight: 300;
}
a.tmenudisabled:link, a.tmenudisabled:visited, a.tmenudisabled:hover, a.tmenudisabled:active {
font-weight: normal;
padding: 0px 5px 0px 5px;
white-space: nowrap;
color: #<?php echo $colortextbackhmenu; ?>;
@ -1601,14 +1603,12 @@ a.tmenudisabled:link, a.tmenudisabled:visited, a.tmenudisabled:hover, a.tmenudis
}
a.tmenu:link, a.tmenu:visited, a.tmenu:hover, a.tmenu:active {
font-weight: normal;
padding: 0px 4px 0px 4px;
white-space: nowrap;
color: #<?php echo $colortextbackhmenu; ?>;
text-decoration: none;
}
a.tmenusel:link, a.tmenusel:visited, a.tmenusel:hover, a.tmenusel:active {
font-weight: normal;
padding: 0px 4px 0px 4px;
margin: 0px 0px 0px 0px;
white-space: nowrap;
@ -2162,8 +2162,8 @@ input.vmenusearchselectcombo[type=text] {
.searchform input { font-size: 16px; }
a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active, span.vmenu { white-space: nowrap; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; }
font.vmenudisabled { font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; color: #aaa; margin-left: 4px; }
a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active, span.vmenu { white-space: nowrap; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; } /* bold = 600, 500 is ko with Edge on 1200x960 */
font.vmenudisabled { font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; color: #aaa; margin-left: 4px; } /* bold = 600, 500 is ko with Edge on 1200x960 */
a.vmenu:link, a.vmenu:visited { color: #<?php echo $colortextbackvmenu; ?>; }
a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active, span.vsmenu { font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: normal; color: #202020; margin: 1px 1px 1px 6px; }

View File

@ -35,12 +35,15 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
$canreadperms=($user->admin || $user->rights->user->user->lire);
$caneditperms=($user->admin || $user->rights->user->user->creer);
$candisableperms=($user->admin || $user->rights->user->user->supprimer);
$feature2 = 'user';
// Advanced permissions
if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS))
{
$canreadperms=($user->admin || $user->rights->user->group_advance->read);
$caneditperms=($user->admin || $user->rights->user->group_advance->write);
$candisableperms=($user->admin || $user->rights->user->group_advance->delete);
$feature2 = 'group_advance';
}
// Load translation files required by page
@ -55,7 +58,7 @@ $contextpage = GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'groupc
$userid = GETPOST('user', 'int');
// Security check
$result = restrictedArea($user, 'user', $id, 'usergroup&usergroup', 'user');
$result = restrictedArea($user, 'user', $id, 'usergroup&usergroup', $feature2);
// Users/Groups management only in master entity if transverse mode
if (! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)