Merge branch 'develop' into NEW_odt_others_objects
This commit is contained in:
commit
d951114c18
2
.github/CONTRIBUTING.md
vendored
2
.github/CONTRIBUTING.md
vendored
@ -6,7 +6,7 @@ Bug reports and feature requests
|
||||
|
||||
<a name="not-a-support-forum"></a>*Note*: Issues are not a support forum. If you need help using the software, please use [the forums](http://www.dolibarr.org/forum).
|
||||
|
||||
Issues are managed on [GitHub](https://github.com/Dolibarr/dolibarr/Issues).
|
||||
Issues are managed on [GitHub](https://github.com/Dolibarr/dolibarr/issues).
|
||||
|
||||
1. Please [use the search engine](https://help.github.com/articles/searching-issues) to check if nobody's already reported your problem.
|
||||
2. [Create an issue](https://help.github.com/articles/creating-an-issue). Choose an appropriate title. Prepend appropriately with Bug or Feature Request.
|
||||
|
||||
@ -91,14 +91,15 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
||||
- Standing orders management (European SEPA)
|
||||
- Bank accounts management
|
||||
- Shared calendar/agenda (with ical and vcal export for third party tools integration)
|
||||
- Opportunities and/or project management (following project benefit including invoices, expense reports, time spent, ...)
|
||||
- Opportunities and/or project management
|
||||
- Projects management
|
||||
- Contracts management
|
||||
- Stock management
|
||||
- Shipping management
|
||||
- Interventions management
|
||||
- Employee's leave requests management
|
||||
- Expense report management
|
||||
- Expense reports
|
||||
- Timesheets
|
||||
- Electronic Document Management (EDM)
|
||||
- Foundations members management
|
||||
- Mass emailing
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
@ -87,7 +87,8 @@ if ($action == 'update') {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
|
||||
foreach ($list as $constname) {
|
||||
foreach ($list as $constname)
|
||||
{
|
||||
$constvalue = GETPOST($constname, 'alpha');
|
||||
|
||||
if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
||||
@ -278,13 +279,17 @@ foreach ($list as $key)
|
||||
$var = ! $var;
|
||||
|
||||
print '<tr ' . $bc[$var] . ' class="value">';
|
||||
|
||||
if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO) && ($key == 'ACCOUNTING_LENGTH_GACCOUNT' || $key == 'ACCOUNTING_LENGTH_AACCOUNT')) continue;
|
||||
|
||||
// Param
|
||||
$label = $langs->trans($key);
|
||||
print '<td>'.$label.'</td>';
|
||||
// Value
|
||||
print '<td align="right">';
|
||||
print '<input type="text" size="20" id="' . $key . '" name="' . $key . '" value="' . $conf->global->$key . '">';
|
||||
print '<input type="text" class="maxwidth100" id="' . $key . '" name="' . $key . '" value="' . $conf->global->$key . '">';
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@ -301,7 +306,7 @@ print '<div class="center"><input type="submit" class="button" value="' . $langs
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
print $langs->trans("AccountancySetupDoneFromAccountancyMenu", $langs->transnoentitiesnoconv("Home").'-'.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy"));
|
||||
print $langs->trans("AccountancySetupDoneFromAccountancyMenu", $langs->transnoentitiesnoconv("Home").'-'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy"));
|
||||
|
||||
print '<br>';
|
||||
print '</form>';
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.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
|
||||
|
||||
@ -516,6 +516,7 @@ if ($mode == 'common')
|
||||
|
||||
// Check filters
|
||||
$modulename=$objMod->getName();
|
||||
$moduletechnicalname=$objMod->name;
|
||||
$moduledesc=$objMod->getDesc();
|
||||
$moduledesclong=$objMod->getDescLong();
|
||||
$moduleauthor=$objMod->getPublisher();
|
||||
@ -525,6 +526,7 @@ if ($mode == 'common')
|
||||
{
|
||||
$qualified=0;
|
||||
if (preg_match('/'.preg_quote($search_keyword).'/i', $modulename)
|
||||
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduletechnicalname)
|
||||
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesc)
|
||||
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesclong)
|
||||
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduleauthor)
|
||||
|
||||
@ -1353,7 +1353,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
print '<ul class="cal_event" style="'.$h.'">'; // always 1 li per ul, 1 ul per event
|
||||
print '<li class="cal_event" style="'.$h.'">';
|
||||
print '<table class="cal_event'.(empty($event->transparency)?'':' cal_event_busy').'" style="'.$h;
|
||||
print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));';
|
||||
print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.dol_color_minus($color, -3).'), to(#'.dol_color_minus($color, -3).'));';
|
||||
//if (! empty($event->transparency)) print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));';
|
||||
//else print 'background-color: transparent !important; background: none; border: 1px solid #bbb;';
|
||||
print ' -moz-border-radius:4px;" width="100%"><tr>';
|
||||
@ -1413,7 +1413,9 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
{
|
||||
$savlabel=$event->libelle;
|
||||
$event->libelle=$daterange;
|
||||
//print '<strong>';
|
||||
print $event->getNomUrl(0);
|
||||
//print '</strong>';
|
||||
$event->libelle=$savlabel;
|
||||
}
|
||||
else
|
||||
@ -1421,7 +1423,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
print $daterange;
|
||||
}
|
||||
//print '</strong> ';
|
||||
print "<br>\n";
|
||||
print " ";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1535,14 +1537,22 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
* Change color with a delta
|
||||
*
|
||||
* @param string $color Color
|
||||
* @param int $minus Delta
|
||||
* @param int $minus Delta (1 = 16 unit)
|
||||
* @param int $minusunit Minus unit
|
||||
* @return string New color
|
||||
*/
|
||||
function dol_color_minus($color, $minus)
|
||||
function dol_color_minus($color, $minus, $minusunit = 16)
|
||||
{
|
||||
$newcolor=$color;
|
||||
$newcolor[0]=((hexdec($newcolor[0])-$minus)<0)?0:dechex((hexdec($newcolor[0])-$minus));
|
||||
$newcolor[2]=((hexdec($newcolor[2])-$minus)<0)?0:dechex((hexdec($newcolor[2])-$minus));
|
||||
$newcolor[4]=((hexdec($newcolor[4])-$minus)<0)?0:dechex((hexdec($newcolor[4])-$minus));
|
||||
if ($minusunit == 16)
|
||||
{
|
||||
$newcolor[0]=dechex(max(min(hexdec($newcolor[0])-$minus, 15), 0));
|
||||
$newcolor[2]=dechex(max(min(hexdec($newcolor[2])-$minus, 15), 0));
|
||||
$newcolor[4]=dechex(max(min(hexdec($newcolor[4])-$minus, 15), 0));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Not yet implemented
|
||||
}
|
||||
return $newcolor;
|
||||
}
|
||||
|
||||
@ -846,11 +846,6 @@ else
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
/* print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $form->showrefnav($object,'id', $linkback);
|
||||
print '</td></tr>';
|
||||
*/
|
||||
// Description
|
||||
print '<tr><td class="titlefield">'.$form->editfieldkey("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string').'</td><td colspan="3">';
|
||||
print $form->editfieldval("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string');
|
||||
@ -865,13 +860,6 @@ else
|
||||
print '<tr><td>'.$form->editfieldkey("MailErrorsTo",'email_errorsto',$object->email_errorsto,$object,$user->rights->mailing->creer && $object->statut < 3,'string').'</td><td colspan="3">';
|
||||
print $form->editfieldval("MailErrorsTo",'email_errorsto',$object->email_errorsto,$object,$user->rights->mailing->creer && $object->statut < 3,'string');
|
||||
print '</td></tr>';
|
||||
|
||||
// Status
|
||||
/*
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'.$object->getLibStatut(4);
|
||||
if ($object->statut == 2) print ' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.')';
|
||||
print'</td></tr>';
|
||||
*/
|
||||
|
||||
// Nb of distinct emails
|
||||
print '<tr><td>';
|
||||
@ -1062,7 +1050,7 @@ else
|
||||
$htmltext.='</i>';
|
||||
|
||||
// Print mail content
|
||||
print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext), 'title_generic');
|
||||
print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext, 1, 'help', '', 0, 2, 'emailsubstitionhelp'), 'title_generic');
|
||||
|
||||
dol_fiche_head('');
|
||||
|
||||
@ -1085,7 +1073,7 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("NoAttachedFiles").'<br>';
|
||||
print '<span class="opacitymedium">'.$langs->trans("NoAttachedFiles").'</span><br>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
@ -1191,7 +1179,7 @@ else
|
||||
$htmltext.='</i>';
|
||||
|
||||
// Print mail content
|
||||
print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext), 'title_generic');
|
||||
print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext, 1, 'help', '', 0, 2, 'emailsubstitionhelp'), 'title_generic');
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
|
||||
@ -125,6 +125,8 @@ if ($socid > 0)
|
||||
|
||||
print load_fiche_titre($langs->trans("NewRelativeDiscount"),'','');
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
// New value
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2016 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
*
|
||||
* 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
|
||||
@ -28,6 +28,11 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
}
|
||||
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
@ -35,6 +40,7 @@ $langs->load("bills");
|
||||
$id=GETPOST('id','int');
|
||||
$action=GETPOST("action");
|
||||
$confirm=GETPOST('confirm');
|
||||
$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0);
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST('socid','int');
|
||||
@ -43,8 +49,6 @@ $result = restrictedArea($user, 'tax', $id, 'chargesociales','charges');
|
||||
|
||||
$object = new ChargeSociales($db);
|
||||
|
||||
|
||||
|
||||
/* *************************************************************************** */
|
||||
/* */
|
||||
/* Actions */
|
||||
@ -122,6 +126,7 @@ if ($action == 'add' && $user->rights->tax->charges->creer)
|
||||
$dateperiod=dol_mktime(GETPOST('periodhour'),GETPOST('periodmin'),GETPOST('periodsec'),GETPOST('periodmonth'),GETPOST('periodday'),GETPOST('periodyear'));
|
||||
$amount=price2num(GETPOST('amount'));
|
||||
$actioncode=GETPOST('actioncode');
|
||||
|
||||
if (! $dateech)
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("DateDue")), null, 'errors');
|
||||
@ -149,13 +154,14 @@ if ($action == 'add' && $user->rights->tax->charges->creer)
|
||||
}
|
||||
else
|
||||
{
|
||||
$object->type=$actioncode;
|
||||
$object->lib=GETPOST('label');
|
||||
$object->date_ech=$dateech;
|
||||
$object->periode=$dateperiod;
|
||||
$object->amount=$amount;
|
||||
$object->mode_reglement_id = GETPOST('mode_reglement_id');
|
||||
$object->fk_account = GETPOST('fk_account', 'int');
|
||||
$object->type = $actioncode;
|
||||
$object->lib = GETPOST('label');
|
||||
$object->date_ech = $dateech;
|
||||
$object->periode = $dateperiod;
|
||||
$object->amount = $amount;
|
||||
$object->mode_reglement_id = GETPOST('mode_reglement_id');
|
||||
$object->fk_account = GETPOST('fk_account', 'int');
|
||||
$object->fk_project = GETPOST('fk_project');
|
||||
|
||||
$id=$object->create($user);
|
||||
if ($id <= 0)
|
||||
@ -172,6 +178,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->cr
|
||||
$dateech=dol_mktime(GETPOST('echhour'),GETPOST('echmin'),GETPOST('echsec'),GETPOST('echmonth'),GETPOST('echday'),GETPOST('echyear'));
|
||||
$dateperiod=dol_mktime(GETPOST('periodhour'),GETPOST('periodmin'),GETPOST('periodsec'),GETPOST('periodmonth'),GETPOST('periodday'),GETPOST('periodyear'));
|
||||
$amount=price2num(GETPOST('amount'));
|
||||
|
||||
if (! $dateech)
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("DateDue")), null, 'errors');
|
||||
@ -196,10 +203,11 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->cr
|
||||
{
|
||||
$result=$object->fetch($id);
|
||||
|
||||
$object->lib=GETPOST('label');
|
||||
$object->date_ech=$dateech;
|
||||
$object->periode=$dateperiod;
|
||||
$object->amount=price2num($amount);
|
||||
$object->lib = GETPOST('label');
|
||||
$object->date_ech = $dateech;
|
||||
$object->periode = $dateperiod;
|
||||
$object->amount = price2num($amount);
|
||||
$object->fk_project = GETPOST("fk_project");
|
||||
|
||||
$result=$object->update($user);
|
||||
if ($result <= 0)
|
||||
@ -325,6 +333,21 @@ if ($action == 'create')
|
||||
print '<td><input type="text" size="6" name="amount" class="flat" value="'.GETPOST('amount').'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
$formproject=new FormProjets($db);
|
||||
|
||||
// Associated project
|
||||
$langs->load("projects");
|
||||
|
||||
print '<tr><td>'.$langs->trans("Project").'</td><td>';
|
||||
|
||||
$numproject=$formproject->select_projects(-1, $projectid,'fk_project',0,0,1,1);
|
||||
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Payment Mode
|
||||
print '<tr><td>' . $langs->trans('PaymentMode') . '</td><td colspan="2">';
|
||||
$form->select_types_paiements($mode_reglement_id, 'mode_reglement_id');
|
||||
@ -485,6 +508,22 @@ if ($id > 0)
|
||||
print '<tr><td>'.$langs->trans("AmountTTC").'</td><td>'.price($object->amount,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';
|
||||
}
|
||||
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled)){
|
||||
print '<tr><td class="nowrap">';
|
||||
print $langs->trans("Project");
|
||||
print '</td><td>';
|
||||
if ($action == 'edit') {
|
||||
$formproject=new FormProjets($db);
|
||||
$numproject=$formproject->select_projects(-1,$object->fk_project,'fk_project',16,0,1,1);
|
||||
} else {
|
||||
$project=new Project($db);
|
||||
$project->fetch($object->fk_project);
|
||||
print $project->getNomUrl(1,'',1);;
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Mode of payment
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2016 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
*
|
||||
* 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
|
||||
@ -52,6 +53,7 @@ class ChargeSociales extends CommonObject
|
||||
var $date_modification;
|
||||
var $date_validation;
|
||||
var $fk_account;
|
||||
var $fk_project;
|
||||
|
||||
|
||||
/**
|
||||
@ -75,7 +77,7 @@ class ChargeSociales extends CommonObject
|
||||
function fetch($id, $ref='')
|
||||
{
|
||||
$sql = "SELECT cs.rowid, cs.date_ech";
|
||||
$sql.= ", cs.libelle as lib, cs.fk_type, cs.amount, cs.paye, cs.periode, cs.import_key";
|
||||
$sql.= ", cs.libelle as lib, cs.fk_type, cs.amount, cs.fk_projet as fk_project, cs.paye, cs.periode, cs.import_key";
|
||||
$sql.= ", cs.fk_account, cs.fk_mode_reglement";
|
||||
$sql.= ", c.libelle";
|
||||
$sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle';
|
||||
@ -93,20 +95,21 @@ class ChargeSociales extends CommonObject
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->ref = $obj->rowid;
|
||||
$this->date_ech = $this->db->jdate($obj->date_ech);
|
||||
$this->lib = $obj->lib;
|
||||
$this->type = $obj->fk_type;
|
||||
$this->type_libelle = $obj->libelle;
|
||||
$this->fk_account = $obj->fk_account;
|
||||
$this->mode_reglement_id = $obj->fk_mode_reglement;
|
||||
$this->mode_reglement_code = $obj->mode_reglement_code;
|
||||
$this->mode_reglement = $obj->mode_reglement_libelle;
|
||||
$this->amount = $obj->amount;
|
||||
$this->paye = $obj->paye;
|
||||
$this->periode = $this->db->jdate($obj->periode);
|
||||
$this->import_key = $this->import_key;
|
||||
$this->id = $obj->rowid;
|
||||
$this->ref = $obj->rowid;
|
||||
$this->date_ech = $this->db->jdate($obj->date_ech);
|
||||
$this->lib = $obj->lib;
|
||||
$this->type = $obj->fk_type;
|
||||
$this->type_libelle = $obj->libelle;
|
||||
$this->fk_account = $obj->fk_account;
|
||||
$this->mode_reglement_id = $obj->fk_mode_reglement;
|
||||
$this->mode_reglement_code = $obj->mode_reglement_code;
|
||||
$this->mode_reglement = $obj->mode_reglement_libelle;
|
||||
$this->amount = $obj->amount;
|
||||
$this->fk_project = $obj->fk_project;
|
||||
$this->paye = $obj->paye;
|
||||
$this->periode = $this->db->jdate($obj->periode);
|
||||
$this->import_key = $this->import_key;
|
||||
|
||||
$this->db->free($resql);
|
||||
|
||||
@ -166,13 +169,15 @@ class ChargeSociales extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, fk_account, fk_mode_reglement, libelle, date_ech, periode, amount, entity, fk_user_author, date_creation)";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, fk_account, fk_mode_reglement, libelle, date_ech, periode, amount, fk_projet, entity, fk_user_author, date_creation)";
|
||||
$sql.= " VALUES (".$this->type;
|
||||
$sql.= ", ".($this->fk_account>0?$this->fk_account:'NULL');
|
||||
$sql.= ", ".($this->mode_reglement_id>0?"'".$this->mode_reglement_id."'":"NULL");
|
||||
$sql.= ", '".$this->db->escape($this->lib)."'";
|
||||
$sql.= ", '".$this->db->idate($this->date_ech)."','".$this->db->idate($this->periode)."'";
|
||||
$sql.= ", '".$this->db->idate($this->date_ech)."'";
|
||||
$sql.= ", '".$this->db->idate($this->periode)."'";
|
||||
$sql.= ", '".price2num($newamount)."'";
|
||||
$sql.= ", ".($this->fk_project>0?$this->fk_project:'NULL');
|
||||
$sql.= ", ".$conf->entity;
|
||||
$sql.= ", ".$user->id;
|
||||
$sql.= ", '".$this->db->idate($now)."'";
|
||||
@ -283,6 +288,7 @@ class ChargeSociales extends CommonObject
|
||||
$sql.= ", date_ech='".$this->db->idate($this->date_ech)."'";
|
||||
$sql.= ", periode='".$this->db->idate($this->periode)."'";
|
||||
$sql.= ", amount='".price2num($this->amount,'MT')."'";
|
||||
$sql.= ", fk_projet='".$this->db->escape($this->fk_project)."'";
|
||||
$sql.= ", fk_user_modif=".$user->id;
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
|
||||
@ -302,7 +308,7 @@ class ChargeSociales extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Enter description here ...
|
||||
* Calculate amount remaining to pay by year
|
||||
*
|
||||
* @param int $year Year
|
||||
* @return number
|
||||
|
||||
@ -73,7 +73,10 @@ if ($boxorder && $zone != '' && $userid > 0)
|
||||
if ($result > 0)
|
||||
{
|
||||
$langs->load("boxes");
|
||||
setEventMessages($langs->trans("BoxAdded"), null);
|
||||
if (! GETPOST('closing'))
|
||||
{
|
||||
setEventMessages($langs->trans("BoxAdded"), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -110,14 +110,14 @@ class box_actions extends ModeleBoxes
|
||||
$label = empty($objp->label)?$objp->type_label:$objp->label;
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $actionstatic->getNomUrl(1),
|
||||
'text2'=> $late,
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => ($societestatic->id > 0 ? $societestatic->getNomUrl(1) : ''),
|
||||
'asis' => 1,
|
||||
);
|
||||
@ -128,7 +128,7 @@ class box_actions extends ModeleBoxes
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => ($objp->percentage>= 0?$objp->percentage.'%':''),
|
||||
);
|
||||
|
||||
@ -149,7 +149,7 @@ class box_actions extends ModeleBoxes
|
||||
$db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
);
|
||||
|
||||
@ -148,19 +148,19 @@ class box_activity extends ModeleBoxes
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][1] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $langs->trans("Bills")." ".$facturestatic->LibStatut(1,$data[$j]->fk_statut,0)." ".$data[$j]->annee,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][2] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0),
|
||||
'text' => $data[$j]->nb,
|
||||
'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills",
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][3] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency)
|
||||
);
|
||||
|
||||
@ -230,19 +230,19 @@ class box_activity extends ModeleBoxes
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][1] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $langs->trans("Bills")." ".$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][2] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => $data[$j]->nb,
|
||||
'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
|
||||
'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills",
|
||||
);
|
||||
$totalnb += $data[$j]->nb;
|
||||
$this->info_box_contents[$line][3] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
|
||||
);
|
||||
$totalMnt += $objp->Mnttot;
|
||||
@ -260,7 +260,7 @@ class box_activity extends ModeleBoxes
|
||||
);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'maxlength'=>500, 'text' => ($db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
@ -323,12 +323,12 @@ class box_activity extends ModeleBoxes
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][1] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' =>$langs->trans("Orders")." ".$commandestatic->LibStatut($data[$j]->fk_statut,0,0),
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][2] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => $data[$j]->nb,
|
||||
'tooltip' => $langs->trans("Orders")." ".$commandestatic->LibStatut($data[$j]->fk_statut,0,0),
|
||||
'url' => DOL_URL_ROOT."/commande/list.php?mainmenu=commercial&leftmenu=orders&viewstatut=".$data[$j]->fk_statut,
|
||||
@ -336,7 +336,7 @@ class box_activity extends ModeleBoxes
|
||||
$totalnb += $data[$j]->nb;
|
||||
|
||||
$this->info_box_contents[$line][3] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
|
||||
);
|
||||
$totalMnt += $data[$j]->Mnttot;
|
||||
@ -413,12 +413,12 @@ class box_activity extends ModeleBoxes
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][1] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0),
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][2] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => $data[$j]->nb,
|
||||
'tooltip' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0),
|
||||
'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&viewstatut=".$data[$j]->fk_statut,
|
||||
@ -426,7 +426,7 @@ class box_activity extends ModeleBoxes
|
||||
$totalnb += $data[$j]->nb;
|
||||
|
||||
$this->info_box_contents[$line][3] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
|
||||
);
|
||||
$totalMnt += $data[$j]->Mnttot;
|
||||
|
||||
@ -94,7 +94,7 @@ class box_bookmarks extends ModeleBoxes
|
||||
'target' => $objp->target?'newtab':'',
|
||||
);
|
||||
$this->info_box_contents[$line][1] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $objp->title,
|
||||
'url' => $objp->url,
|
||||
'tooltip' => $objp->title,
|
||||
@ -117,7 +117,7 @@ class box_bookmarks extends ModeleBoxes
|
||||
$db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
);
|
||||
|
||||
@ -117,13 +117,13 @@ class box_clients extends ModeleBoxes
|
||||
$thirdpartystatic->logo = $objp->logo;
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $thirdpartystatic->getNomUrl(1),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => dol_print_date($datem, "day")
|
||||
);
|
||||
|
||||
@ -140,7 +140,7 @@ class box_clients extends ModeleBoxes
|
||||
$db->free($result);
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array( 'td' => 'align="left"',
|
||||
$this->info_box_contents[0][0] = array( 'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql));
|
||||
}
|
||||
|
||||
@ -115,33 +115,33 @@ class box_commandes extends ModeleBoxes
|
||||
$societestatic->logo = $objp->logo;
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $commandestatic->getNomUrl(1),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $societestatic->getNomUrl(1),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency),
|
||||
);
|
||||
|
||||
if (! empty($conf->global->ORDER_BOX_LAST_ORDERS_SHOW_VALIDATE_USER)) {
|
||||
if ($objp->fk_user_valid > 0) $userstatic->fetch($objp->fk_user_valid);
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => (($objp->fk_user_valid > 0)?$userstatic->getNomUrl(1):''),
|
||||
'asis' => 1,
|
||||
);
|
||||
}
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => dol_print_date($date,'day'),
|
||||
);
|
||||
|
||||
@ -158,7 +158,7 @@ class box_commandes extends ModeleBoxes
|
||||
$db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
);
|
||||
|
||||
@ -111,18 +111,18 @@ class box_comptes extends ModeleBoxes
|
||||
$solde_total[$objp->currency_code] += $solde;
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $account_static->getNomUrl(1),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $objp->number,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => price($solde, 0, $langs, 0, -1, -1, $objp->currency_code)
|
||||
);
|
||||
|
||||
@ -151,14 +151,14 @@ class box_comptes extends ModeleBoxes
|
||||
$db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
);
|
||||
}
|
||||
|
||||
@ -110,19 +110,19 @@ class box_contacts extends ModeleBoxes
|
||||
$societestatic->fournisseur = $objp->fournisseur;
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $contactstatic->getNomUrl(1),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => ($objp->fk_soc > 0 ? $societestatic->getNomUrl(1) : ''),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => dol_print_date($datem, "day"),
|
||||
);
|
||||
|
||||
@ -144,7 +144,7 @@ class box_contacts extends ModeleBoxes
|
||||
$db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
);
|
||||
|
||||
@ -106,25 +106,25 @@ class box_contracts extends ModeleBoxes
|
||||
// if ($objp->fk_statut == 1 && $dateterm < ($now - $conf->contrat->cloture->warning_delay)) { $late = img_warning($langs->trans("Late")); }
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $contractstatic->getNomUrl(1),
|
||||
'text2'=> $late,
|
||||
'asis'=>1
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => 'class="tdoverflowmax100 maxwidth100onsmartphone"',
|
||||
'text' => $thirdpartytmp->getNomUrl(1),
|
||||
'asis'=>1
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => dol_print_date($datec,'day'),
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right" class="nowrap"',
|
||||
'td' => 'class="nowrap right"',
|
||||
'text' => $contractstatic->getLibStatut(6),
|
||||
'asis'=>1,
|
||||
);
|
||||
@ -141,14 +141,14 @@ class box_contracts extends ModeleBoxes
|
||||
$db->free($resql);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
);
|
||||
}
|
||||
|
||||
@ -163,7 +163,7 @@ class box_external_rss extends ModeleBoxes
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][1] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $title,
|
||||
'url' => $href,
|
||||
'tooltip' => $tooltip,
|
||||
|
||||
@ -122,25 +122,25 @@ class box_factures extends ModeleBoxes
|
||||
}
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $facturestatic->getNomUrl(1),
|
||||
'text2'=> $late,
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $societestatic->getNomUrl(1, '', 40),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency),
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => dol_print_date($date,'day'),
|
||||
);
|
||||
|
||||
@ -161,7 +161,7 @@ class box_factures extends ModeleBoxes
|
||||
$db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
);
|
||||
@ -169,7 +169,7 @@ class box_factures extends ModeleBoxes
|
||||
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
);
|
||||
}
|
||||
|
||||
@ -122,32 +122,32 @@ class box_factures_fourn extends ModeleBoxes
|
||||
}
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $facturestatic->getNomUrl(1),
|
||||
'text2'=> $late,
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $objp->ref_supplier,
|
||||
'tooltip' => $langs->trans('SupplierInvoice').': '.($objp->ref?$objp->ref:$objp->facid).'<br>'.$langs->trans('RefSupplier').': '.$objp->ref_supplier,
|
||||
'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $thirdpartytmp->getNomUrl(1, 'supplier'),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency),
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => dol_print_date($date,'day'),
|
||||
);
|
||||
|
||||
@ -171,14 +171,14 @@ class box_factures_fourn extends ModeleBoxes
|
||||
$db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $langs->transnoentities("ReadPermissionNotAllowed"),
|
||||
);
|
||||
}
|
||||
|
||||
@ -119,25 +119,25 @@ class box_factures_fourn_imp extends ModeleBoxes
|
||||
$tooltip = $langs->trans('SupplierInvoice') . ': ' . ($objp->ref?$objp->ref:$objp->facid) . '<br>' . $langs->trans('RefSupplier') . ': ' . $objp->ref_supplier;
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $facturestatic->getNomUrl(1),
|
||||
'text2'=> $late,
|
||||
'asis' => 1
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $thirdpartytmp->getNomUrl(1, '', 40),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency),
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => dol_print_date($datelimite,'day'),
|
||||
);
|
||||
|
||||
@ -161,14 +161,14 @@ class box_factures_fourn_imp extends ModeleBoxes
|
||||
$db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
);
|
||||
}
|
||||
|
||||
@ -126,25 +126,25 @@ class box_factures_imp extends ModeleBoxes
|
||||
}
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $facturestatic->getNomUrl(1),
|
||||
'text2'=> $late,
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $societestatic->getNomUrl(1, '', 44),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency),
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => dol_print_date($datelimite,'day'),
|
||||
);
|
||||
|
||||
@ -163,7 +163,7 @@ class box_factures_imp extends ModeleBoxes
|
||||
else
|
||||
{
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
);
|
||||
@ -171,7 +171,7 @@ class box_factures_imp extends ModeleBoxes
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
);
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ class box_ficheinter extends ModeleBoxes
|
||||
'logo' => $this->boximg,
|
||||
'url' => DOL_URL_ROOT."/fichinter/card.php?id=".$objp->rowid);
|
||||
|
||||
$this->info_box_contents[$i][1] = array('td' => 'align="left"',
|
||||
$this->info_box_contents[$i][1] = array('td' => '',
|
||||
'text' => ($objp->ref?$objp->ref:$objp->rowid), // Some interventions have no ref
|
||||
'url' => DOL_URL_ROOT."/fichinter/card.php?id=".$objp->rowid);
|
||||
|
||||
@ -106,11 +106,11 @@ class box_ficheinter extends ModeleBoxes
|
||||
'logo' => 'company',
|
||||
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
|
||||
|
||||
$this->info_box_contents[$i][3] = array('td' => 'align="left"',
|
||||
$this->info_box_contents[$i][3] = array('td' => '',
|
||||
'text' => dol_trunc($objp->name,40),
|
||||
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
|
||||
|
||||
$this->info_box_contents[$i][4] = array('td' => 'align="right"',
|
||||
$this->info_box_contents[$i][4] = array('td' => 'class="right"',
|
||||
'text' => dol_print_date($datec,'day'));
|
||||
|
||||
$this->info_box_contents[$i][5] = array('td' => 'align="right" class="nowrap"',
|
||||
@ -127,14 +127,14 @@ class box_ficheinter extends ModeleBoxes
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->info_box_contents[0][0] = array( 'td' => 'align="left"',
|
||||
$this->info_box_contents[0][0] = array( 'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->info_box_contents[0][0] = array('td' => 'align="left"',
|
||||
$this->info_box_contents[0][0] = array('td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,13 +94,13 @@ class box_fournisseurs extends ModeleBoxes
|
||||
$thirdpartytmp->logo = $objp->logo;
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $thirdpartytmp->getNomUrl(1, '', 40),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => dol_print_date($datem, "day"),
|
||||
);
|
||||
|
||||
@ -120,14 +120,14 @@ class box_fournisseurs extends ModeleBoxes
|
||||
$db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
);
|
||||
}
|
||||
|
||||
@ -114,18 +114,18 @@ class box_goodcustomers extends ModeleBoxes
|
||||
$nbimpaye = $objp->nbfact - $objp->nbfactpaye;
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $thirdpartystatic->getNomUrl(1),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => dol_print_date($datem, "day")
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => $nbfact.( $nbimpaye != 0 ? ' ('.$nbimpaye.')':'')
|
||||
);
|
||||
|
||||
@ -142,7 +142,7 @@ class box_goodcustomers extends ModeleBoxes
|
||||
$db->free($result);
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array( 'td' => 'align="left"',
|
||||
$this->info_box_contents[0][0] = array( 'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql));
|
||||
}
|
||||
|
||||
@ -255,7 +255,7 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
||||
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array('td' => 'align="left"',
|
||||
$this->info_box_contents[0][0] = array('td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -252,7 +252,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
||||
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array('td' => 'align="left"',
|
||||
$this->info_box_contents[0][0] = array('td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -253,7 +253,7 @@ class box_graph_orders_permonth extends ModeleBoxes
|
||||
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array('td' => 'align="left"',
|
||||
$this->info_box_contents[0][0] = array('td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -252,7 +252,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
||||
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array('td' => 'align="left"',
|
||||
$this->info_box_contents[0][0] = array('td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -254,7 +254,7 @@ class box_graph_propales_permonth extends ModeleBoxes
|
||||
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array('td' => 'align="left"',
|
||||
$this->info_box_contents[0][0] = array('td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,19 +117,19 @@ class box_members extends ModeleBoxes
|
||||
}
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $memberstatic->getNomUrl(1),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $memberstatic->getFullName($langs),
|
||||
'url' => DOL_URL_ROOT."/adherents/card.php?rowid=".$objp->rowid,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => dol_print_date($datem, "day"),
|
||||
);
|
||||
|
||||
@ -150,7 +150,7 @@ class box_members extends ModeleBoxes
|
||||
$db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
);
|
||||
|
||||
@ -106,13 +106,13 @@ class box_produits extends ModeleBoxes
|
||||
$productstatic->entity = $objp->entity;
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $productstatic->getNomUrl(1),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $objp->label,
|
||||
);
|
||||
|
||||
@ -139,7 +139,7 @@ class box_produits extends ModeleBoxes
|
||||
}
|
||||
}
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => $price,
|
||||
);
|
||||
|
||||
@ -149,7 +149,7 @@ class box_produits extends ModeleBoxes
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => dol_print_date($datem,'day'),
|
||||
);
|
||||
|
||||
@ -174,14 +174,14 @@ class box_produits extends ModeleBoxes
|
||||
$db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
);
|
||||
}
|
||||
|
||||
@ -113,13 +113,13 @@ class box_produits_alerte_stock extends ModeleBoxes
|
||||
$productstatic->entity = $objp->entity;
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $productstatic->getNomUrl(1),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $objp->label,
|
||||
);
|
||||
|
||||
@ -148,7 +148,7 @@ class box_produits_alerte_stock extends ModeleBoxes
|
||||
}
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => $price,
|
||||
);
|
||||
|
||||
@ -180,7 +180,7 @@ class box_produits_alerte_stock extends ModeleBoxes
|
||||
else
|
||||
{
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
);
|
||||
@ -188,7 +188,7 @@ class box_produits_alerte_stock extends ModeleBoxes
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
);
|
||||
}
|
||||
|
||||
@ -104,14 +104,14 @@ class box_project extends ModeleBoxes
|
||||
);
|
||||
|
||||
$this->info_box_contents[$i][1] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $objp->ref,
|
||||
'tooltip' => $tooltip,
|
||||
'url' => DOL_URL_ROOT."/projet/card.php?id=".$objp->rowid,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$i][2] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $objp->title,
|
||||
);
|
||||
|
||||
@ -123,20 +123,20 @@ class box_project extends ModeleBoxes
|
||||
if ($resultTask) {
|
||||
$objTask = $db->fetch_object($resultTask);
|
||||
$this->info_box_contents[$i][3] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => number_format($objTask->nb, 0, ',', ' ')." ".$langs->trans("Tasks"),
|
||||
);
|
||||
if ($objTask->nb > 0 )
|
||||
$this->info_box_contents[$i][4] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => number_format(($objTask->totprogress/$objTask->nb), 0, ',', ' ')."%",
|
||||
);
|
||||
else
|
||||
$this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => "N/A ");
|
||||
$this->info_box_contents[$i][4] = array('td' => 'class="right"', 'text' => "N/A ");
|
||||
$totalnbTask += $objTask->nb;
|
||||
} else {
|
||||
$this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => number_format(0, 0, ',', ' '));
|
||||
$this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => "N/A ");
|
||||
$this->info_box_contents[$i][3] = array('td' => 'class="right"', 'text' => number_format(0, 0, ',', ' '));
|
||||
$this->info_box_contents[$i][4] = array('td' => 'class="right"', 'text' => "N/A ");
|
||||
}
|
||||
|
||||
$i++;
|
||||
|
||||
@ -109,25 +109,25 @@ class box_propales extends ModeleBoxes
|
||||
}
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $propalstatic->getNomUrl(1),
|
||||
'text2'=> $late,
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $societestatic->getNomUrl(1,'',40),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency),
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => dol_print_date($date,'day'),
|
||||
);
|
||||
|
||||
@ -148,14 +148,14 @@ class box_propales extends ModeleBoxes
|
||||
$db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
);
|
||||
}
|
||||
|
||||
@ -117,13 +117,13 @@ class box_prospect extends ModeleBoxes
|
||||
$thirdpartystatic->logo = $objp->logo;
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $thirdpartystatic->getNomUrl(1),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => dol_print_date($datem, "day"),
|
||||
);
|
||||
|
||||
@ -149,14 +149,14 @@ class box_prospect extends ModeleBoxes
|
||||
$db->free($resql);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
);
|
||||
}
|
||||
|
||||
@ -155,13 +155,13 @@ class box_services_contracts extends ModeleBoxes
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->info_box_contents[0][0] = array( 'td' => 'align="left"',
|
||||
$this->info_box_contents[0][0] = array( 'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql));
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array('td' => 'align="left"',
|
||||
$this->info_box_contents[0][0] = array('td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"));
|
||||
}
|
||||
|
||||
|
||||
@ -98,7 +98,7 @@ class box_services_expired extends ModeleBoxes
|
||||
'logo' => $this->boximg,
|
||||
'url' => DOL_URL_ROOT."/contrat/card.php?id=".$objp->rowid);
|
||||
|
||||
$this->info_box_contents[$i][1] = array('td' => 'align="left"',
|
||||
$this->info_box_contents[$i][1] = array('td' => '',
|
||||
'text' => ($objp->ref?$objp->ref:$objp->rowid), // Some contracts have no ref
|
||||
'url' => DOL_URL_ROOT."/contrat/card.php?id=".$objp->rowid);
|
||||
|
||||
@ -114,7 +114,7 @@ class box_services_expired extends ModeleBoxes
|
||||
'text' => dol_print_date($dateline,'day'),
|
||||
'text2'=> $late);
|
||||
|
||||
$this->info_box_contents[$i][5] = array('td' => 'align="right"',
|
||||
$this->info_box_contents[$i][5] = array('td' => 'class="right"',
|
||||
'text' => $objp->nb_services);
|
||||
|
||||
|
||||
@ -131,7 +131,7 @@ class box_services_expired extends ModeleBoxes
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->info_box_contents[0][0] = array( 'td' => 'align="left"',
|
||||
$this->info_box_contents[0][0] = array( 'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql));
|
||||
}
|
||||
@ -140,7 +140,7 @@ class box_services_expired extends ModeleBoxes
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->info_box_contents[0][0] = array('td' => 'align="left"',
|
||||
$this->info_box_contents[0][0] = array('td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,25 +112,25 @@ class box_supplier_orders extends ModeleBoxes
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $objp->ref,
|
||||
'tooltip' => $tooltip,
|
||||
'url' => $urlo,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $thirdpartytmp->getNomUrl(1, 'supplier'),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency),
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => dol_print_date($date,'day'),
|
||||
);
|
||||
|
||||
@ -151,7 +151,7 @@ class box_supplier_orders extends ModeleBoxes
|
||||
$db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
);
|
||||
@ -160,7 +160,7 @@ class box_supplier_orders extends ModeleBoxes
|
||||
else
|
||||
{
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
);
|
||||
}
|
||||
|
||||
@ -99,19 +99,19 @@ class box_task extends ModeleBoxes
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
$this->info_box_contents[$i][] = array(
|
||||
'td' => 'align="left"',
|
||||
'td' => '',
|
||||
'text' =>$langs->trans("Task")." ".$taskstatic->LibStatut($objp->fk_statut,0),
|
||||
);
|
||||
|
||||
$this->info_box_contents[$i][] = array(
|
||||
'td' => 'align="right"',
|
||||
'td' => 'class="right"',
|
||||
'text' => $objp->nb." ".$langs->trans("Tasks"),
|
||||
'url' => DOL_URL_ROOT."/projet/tasks/list.php?leftmenu=projects&viewstatut=".$objp->fk_statut,
|
||||
);
|
||||
$totalnb += $objp->nb;
|
||||
$this->info_box_contents[$i][] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->plannedtot,'all',25200,5));
|
||||
$this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => ConvertSecondToTime($objp->plannedtot,'all',25200,5));
|
||||
$totalplannedtot += $objp->plannedtot;
|
||||
$this->info_box_contents[$i][] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->durationtot,'all',25200,5));
|
||||
$this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => ConvertSecondToTime($objp->durationtot,'all',25200,5));
|
||||
$totaldurationtot += $objp->durationtot;
|
||||
|
||||
$this->info_box_contents[$i][] = array('td' => 'align="right" width="18"', 'text' => $taskstatic->LibStatut($objp->fk_statut,3));
|
||||
@ -124,7 +124,7 @@ class box_task extends ModeleBoxes
|
||||
|
||||
|
||||
// Add the sum à the bottom of the boxes
|
||||
$this->info_box_contents[$i][] = array('tr' => 'class="liste_total"', 'td' => 'align="left"', 'text' => $langs->trans("Total")." ".$textHead);
|
||||
$this->info_box_contents[$i][] = array('tr' => 'class="liste_total"', 'td' => '', 'text' => $langs->trans("Total")." ".$textHead);
|
||||
$this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')." ".$langs->trans("Tasks"));
|
||||
$this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5));
|
||||
$this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot,'all',25200,5));
|
||||
|
||||
@ -304,11 +304,13 @@ abstract class CommonDocGenerator
|
||||
|
||||
$now=dol_now('gmt'); // gmt
|
||||
$array_other = array(
|
||||
'current_date'=>dol_print_date($now,'day','tzuser'),
|
||||
'current_datehour'=>dol_print_date($now,'dayhour','tzuser'),
|
||||
// Date in default language
|
||||
'current_date'=>dol_print_date($now,'day','tzuser'),
|
||||
'current_datehour'=>dol_print_date($now,'dayhour','tzuser'),
|
||||
'current_server_date'=>dol_print_date($now,'day','tzserver'),
|
||||
'current_server_datehour'=>dol_print_date($now,'dayhour','tzserver'),
|
||||
'current_date_locale'=>dol_print_date($now,'day','tzuser',$outputlangs),
|
||||
// Date in requested output language
|
||||
'current_date_locale'=>dol_print_date($now,'day','tzuser',$outputlangs),
|
||||
'current_datehour_locale'=>dol_print_date($now,'dayhour','tzuser',$outputlangs),
|
||||
'current_server_date_locale'=>dol_print_date($now,'day','tzserver',$outputlangs),
|
||||
'current_server_datehour_locale'=>dol_print_date($now,'dayhour','tzserver',$outputlangs),
|
||||
@ -377,6 +379,7 @@ abstract class CommonDocGenerator
|
||||
$array_key.'_ref_customer'=>$object->ref_client,
|
||||
$array_key.'_ref_supplier'=>(! empty($object->ref_fournisseur)?$object->ref_fournisseur:''),
|
||||
$array_key.'_source_invoice_ref'=>$invoice_source->ref,
|
||||
// Dates
|
||||
$array_key.'_hour'=>dol_print_date($object->date,'hour'),
|
||||
$array_key.'_date'=>dol_print_date($object->date,'day'),
|
||||
$array_key.'_date_rfc'=>dol_print_date($object->date,'dayrfc'),
|
||||
@ -387,6 +390,7 @@ abstract class CommonDocGenerator
|
||||
$array_key.'_date_validation'=>(! empty($object->date_validation)?dol_print_date($object->date_validation,'dayhour'):''),
|
||||
$array_key.'_date_delivery_planed'=>(! empty($object->date_livraison)?dol_print_date($object->date_livraison,'day'):''),
|
||||
$array_key.'_date_close'=>(! empty($object->date_cloture)?dol_print_date($object->date_cloture,'dayhour'):''),
|
||||
|
||||
$array_key.'_payment_mode_code'=>$object->mode_reglement_code,
|
||||
$array_key.'_payment_mode'=>($outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code)!='PaymentType'.$object->mode_reglement_code?$outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code):$object->mode_reglement),
|
||||
$array_key.'_payment_term_code'=>$object->cond_reglement_code,
|
||||
@ -471,10 +475,13 @@ abstract class CommonDocGenerator
|
||||
'line_price_ht_locale'=>price($line->total_ht, 0, $outputlangs),
|
||||
'line_price_ttc_locale'=>price($line->total_ttc, 0, $outputlangs),
|
||||
'line_price_vat_locale'=>price($line->total_tva, 0, $outputlangs),
|
||||
'line_date_start'=>$line->date_start,
|
||||
'line_date_start_rfc'=>dol_print_date($line->date_start,'dayrfc'),
|
||||
'line_date_end'=>$line->date_end,
|
||||
'line_date_end_rfc'=>dol_print_date($line->date_end,'dayrfc')
|
||||
// Dates
|
||||
'line_date_start'=>dol_print_date($line->date_start, 'day', 'tzuser'),
|
||||
'line_date_start_locale'=>dol_print_date($line->date_start, 'day', 'tzuser', $outputlangs),
|
||||
'line_date_start_rfc'=>dol_print_date($line->date_start, 'dayrfc', 'tzuser'),
|
||||
'line_date_end'=>dol_print_date($line->date_end, 'day', 'tzuser'),
|
||||
'line_date_end_locale'=>dol_print_date($line->date_end, 'day', 'tzuser', $outputlangs),
|
||||
'line_date_end_rfc'=>dol_print_date($line->date_end, 'dayrfc', 'tzuser'),
|
||||
);
|
||||
|
||||
// Retrieve extrafields
|
||||
|
||||
@ -1231,11 +1231,11 @@ abstract class CommonObject
|
||||
* @param int $id To force other object id (should not be used)
|
||||
* @param string $format Data format ('text', 'date'). 'text' is used if not defined
|
||||
* @param string $id_field To force rowid field name. 'rowid' is used if not defined
|
||||
* @param User|string $user Update last update fields also if user object provided
|
||||
* @param User|string $fuser Update the user of last update field with this user. If not provided, current user is used except if value is 'none'
|
||||
* @param string $trigkey Trigger key to run (in most cases something like 'XXX_MODIFY')
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function setValueFrom($field, $value, $table='', $id=null, $format='', $id_field='', $user='', $trigkey='')
|
||||
function setValueFrom($field, $value, $table='', $id=null, $format='', $id_field='', $fuser=null, $trigkey='')
|
||||
{
|
||||
global $user,$langs,$conf;
|
||||
|
||||
@ -1255,7 +1255,8 @@ abstract class CommonObject
|
||||
if ($format == 'text') $sql.= $field." = '".$this->db->escape($value)."'";
|
||||
else if ($format == 'int') $sql.= $field." = ".$this->db->escape($value);
|
||||
else if ($format == 'date') $sql.= $field." = ".($value ? "'".$this->db->idate($value)."'" : "null");
|
||||
if (is_object($user)) $sql.=", fk_user_modif = ".$user->id;
|
||||
if (! empty($fuser) && is_object($fuser)) $sql.=", fk_user_modif = ".$fuser->id;
|
||||
elseif (empty($fuser) || $fuser != 'none') $sql.=", fk_user_modif = ".$user->id;
|
||||
$sql.= " WHERE ".$id_field." = ".$id;
|
||||
|
||||
dol_syslog(get_class($this)."::".__FUNCTION__."", LOG_DEBUG);
|
||||
@ -1264,7 +1265,7 @@ abstract class CommonObject
|
||||
{
|
||||
if ($trigkey)
|
||||
{
|
||||
$result=$this->call_trigger($trigkey, $user); // This may set this->errors
|
||||
$result=$this->call_trigger($trigkey, (! empty($fuser) && is_object($fuser)) ? $fuser : $user); // This may set this->errors
|
||||
if ($result < 0) $error++;
|
||||
}
|
||||
|
||||
|
||||
@ -447,7 +447,7 @@ class Form
|
||||
else $paramfortooltipimg =($extracss?' class="'.$extracss.'"':'').($extrastyle?' style="'.$extrastyle.'"':''); // Attribut to put on td text tag
|
||||
if ($tooltipon == 1 || $tooltipon == 3)
|
||||
{
|
||||
$paramfortooltiptd=' class="'.$classfortooltip.' inline-block'.($extracss?' '.$extracss:'').'" style="padding: 0px;'.($extrastyle?' '.$extrastyle:'').'" ';
|
||||
$paramfortooltiptd=' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss?' '.$extracss:'').'" style="padding: 0px;'.($extrastyle?' '.$extrastyle:'').'" ';
|
||||
if ($tooltiptrigger == '') $paramfortooltiptd.=' title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td tag to store tooltip
|
||||
else $paramfortooltiptd.=' dolid="'.$tooltiptrigger.'"';
|
||||
}
|
||||
@ -524,7 +524,7 @@ class Form
|
||||
elseif ($type == 'warning') $img = img_warning($alt);
|
||||
else $img = img_picto($alt, $type);
|
||||
|
||||
return $this->textwithtooltip($text, $htmltext, 2, $direction, $img, $extracss, $notabs, '', $noencodehtmltext, $tooltiptrigger);
|
||||
return $this->textwithtooltip($text, $htmltext, ($tooltiptrigger?3:2), $direction, $img, $extracss, $notabs, '', $noencodehtmltext, $tooltiptrigger);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -5851,7 +5851,13 @@ class Form
|
||||
{
|
||||
$ret.=dol_htmlentities($object->getFullName($langs));
|
||||
}
|
||||
else if (in_array($object->element, array('action', 'agenda')))
|
||||
{
|
||||
$ret.=$object->ref.'<br>'.$object->label;
|
||||
}
|
||||
else if ($fieldref != 'none') $ret.=dol_htmlentities($object->$fieldref);
|
||||
|
||||
|
||||
if ($morehtmlref)
|
||||
{
|
||||
$ret.=' '.$morehtmlref;
|
||||
|
||||
@ -1046,7 +1046,7 @@ class FormOther
|
||||
if (boxorder==\'A:A-B:B\' && closing == 1) // There is no more boxes on screen, and we are after a delete of a box so we must hide title
|
||||
{
|
||||
jQuery.ajax({
|
||||
url: \''.DOL_URL_ROOT.'/core/ajax/box.php?boxorder=\'+boxorder+\'&zone='.$areacode.'&userid=\'+'.$user->id.',
|
||||
url: \''.DOL_URL_ROOT.'/core/ajax/box.php?closing=\'+closing+\'&boxorder=\'+boxorder+\'&zone='.$areacode.'&userid=\'+'.$user->id.',
|
||||
async: false
|
||||
});
|
||||
// We force reload to be sure to get all boxes into list
|
||||
@ -1055,7 +1055,7 @@ class FormOther
|
||||
else
|
||||
{
|
||||
jQuery.ajax({
|
||||
url: \''.DOL_URL_ROOT.'/core/ajax/box.php?boxorder=\'+boxorder+\'&zone='.$areacode.'&userid=\'+'.$user->id.',
|
||||
url: \''.DOL_URL_ROOT.'/core/ajax/box.php?closing=\'+closing+\'&boxorder=\'+boxorder+\'&zone='.$areacode.'&userid=\'+'.$user->id.',
|
||||
async: true
|
||||
});
|
||||
}
|
||||
|
||||
@ -464,7 +464,7 @@ class FormProjets
|
||||
if ($table_element == 'projet_task') return ''; // Special cas of element we never link to a project (already always done)
|
||||
|
||||
$linkedtothirdparty=false;
|
||||
if (! in_array($table_element, array('don','expensereport_det','expensereport','loan','stock_mouvement'))) $linkedtothirdparty=true;
|
||||
if (! in_array($table_element, array('don','expensereport_det','expensereport','loan','stock_mouvement','chargesociales'))) $linkedtothirdparty=true;
|
||||
|
||||
$sqlfilter='';
|
||||
$projectkey="fk_projet";
|
||||
@ -507,6 +507,7 @@ class FormProjets
|
||||
$sql = 'SELECT t.rowid, t.label as ref';
|
||||
$projectkey='fk_origin';
|
||||
break;
|
||||
case "chargesociales":
|
||||
default:
|
||||
$sql = "SELECT t.rowid, t.ref";
|
||||
break;
|
||||
@ -597,7 +598,7 @@ class FormProjets
|
||||
if ($num > 0)
|
||||
{
|
||||
$sellist = '<select class="flat oppstatus'.($morecss?' '.$morecss:'').'" id="'.$htmlname.'" name="'.$htmlname.'">';
|
||||
if ($showempty) $sellist.= '<option value="-1"></option>';
|
||||
if ($showempty) $sellist.= '<option value="-1"> </option>'; // Without  , strange move of screen when switching value
|
||||
if ($showallnone) $sellist.= '<option value="all"'.($preselected == 'all'?' selected="selected"':'').'>--'.$langs->trans("OnlyOpportunitiesShort").'--</option>';
|
||||
if ($showallnone) $sellist.= '<option value="openedopp"'.($preselected == 'openedopp'?' selected="selected"':'').'>--'.$langs->trans("OpenedOpportunitiesShort").'--</option>';
|
||||
if ($showallnone) $sellist.= '<option value="none"'.($preselected == 'none'?' selected="selected"':'').'>--'.$langs->trans("NotAnOpportunityShort").'--</option>';
|
||||
|
||||
@ -195,7 +195,7 @@ interface Database
|
||||
* Execute a SQL request and return the resultset
|
||||
*
|
||||
* @param string $query SQL query string
|
||||
* @param int $usesavepoint 0=Default mode, 1=Run a savepoint before and a rollbock to savepoint if error (this allow to have some request with errors inside global transactions).
|
||||
* @param int $usesavepoint 0=Default mode, 1=Run a savepoint before and a rollback to savepoint if error (this allow to have some request with errors inside global transactions).
|
||||
* Note that with Mysql, this parameter is not used as Myssql can already commit a transaction even if one request is in error, without using savepoints.
|
||||
* @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...)
|
||||
* @return resource Resultset of answer
|
||||
|
||||
@ -116,8 +116,9 @@ function length_accountg($account)
|
||||
|
||||
if ($account < 0 || empty($account)) return '';
|
||||
|
||||
if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) return $account;
|
||||
|
||||
$g = $conf->global->ACCOUNTING_LENGTH_GACCOUNT;
|
||||
|
||||
if (! empty($g)) {
|
||||
// Clean parameters
|
||||
$i = strlen($account);
|
||||
@ -150,8 +151,9 @@ function length_accounta($accounta)
|
||||
|
||||
if ($accounta < 0 || empty($accounta)) return '';
|
||||
|
||||
if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) return $account;
|
||||
|
||||
$a = $conf->global->ACCOUNTING_LENGTH_AACCOUNT;
|
||||
|
||||
if (! empty($a)) {
|
||||
// Clean parameters
|
||||
$i = strlen($accounta);
|
||||
|
||||
@ -531,10 +531,13 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin
|
||||
|
||||
print "\n";
|
||||
print load_fiche_titre($langs->trans("ProjectsDedicatedToThisThirdParty"),$buttoncreate,'');
|
||||
print '<div class="div-table-responsive">';
|
||||
print "\n".'<table class="noborder" width=100%>';
|
||||
|
||||
$sql = "SELECT p.rowid as id, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status";
|
||||
$sql = "SELECT p.rowid as id, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount";
|
||||
$sql .= ", cls.code as opp_status_code";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls on p.fk_opp_status = cls.rowid";
|
||||
$sql .= " WHERE p.fk_soc = ".$object->id;
|
||||
$sql .= " ORDER BY p.dateo DESC";
|
||||
|
||||
@ -544,8 +547,14 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin
|
||||
$num = $db->num_rows($result);
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Ref").'</td><td>'.$langs->trans("Name").'</td><td align="center">'.$langs->trans("DateStart").'</td><td align="center">'.$langs->trans("DateEnd").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Status").'</td>';
|
||||
print '<td>'.$langs->trans("Ref").'</td>';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
print '<td class="center">'.$langs->trans("DateStart").'</td>';
|
||||
print '<td class="center">'.$langs->trans("DateEnd").'</td>';
|
||||
print '<td class="right">'.$langs->trans("OpportunityAmountShort").'</td>';
|
||||
print '<td class="center">'.$langs->trans("OpportunityStatusShort").'</td>';
|
||||
print '<td class="right">'.$langs->trans("OpportunityProbabilityShort").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Status").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
if ($num > 0)
|
||||
@ -574,9 +583,24 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin
|
||||
// Label
|
||||
print '<td>'.$obj->title.'</td>';
|
||||
// Date start
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->do),"day").'</td>';
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->do),"day").'</td>';
|
||||
// Date end
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->de),"day").'</td>';
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->de),"day").'</td>';
|
||||
// Opp amount
|
||||
print '<td class="right">';
|
||||
if ($obj->opp_status_code)
|
||||
{
|
||||
print price($obj->opp_amount, 1, '', 1, -1, -1, '');
|
||||
}
|
||||
print '</td>';
|
||||
// Opp status
|
||||
print '<td align="center">';
|
||||
if ($obj->opp_status_code) print $langs->trans("OppStatusShort".$obj->opp_status_code);
|
||||
print '</td>';
|
||||
// Opp percent
|
||||
print '<td align="right">';
|
||||
if ($obj->opp_percent) print price($obj->opp_percent, 1, '', 1, 0).'%';
|
||||
print '</td>';
|
||||
// Status
|
||||
print '<td align="right">'.$projecttmp->getLibStatut(5).'</td>';
|
||||
|
||||
@ -597,7 +621,8 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin
|
||||
dol_print_error($db);
|
||||
}
|
||||
print "</table>";
|
||||
|
||||
print '</div>';
|
||||
|
||||
print "<br>\n";
|
||||
}
|
||||
|
||||
|
||||
@ -772,7 +772,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
|
||||
}
|
||||
|
||||
// Security:
|
||||
// On interdit fichiers caches, remontees de repertoire ainsi que les pipes dans les noms de fichiers.
|
||||
// We refuse cache files/dirs, upload using .. and pipes into filenames.
|
||||
if (preg_match('/^\./',$src_file) || preg_match('/\.\./',$src_file) || preg_match('/[<>|]/',$src_file))
|
||||
{
|
||||
dol_syslog("Refused to deliver file ".$src_file, LOG_WARNING);
|
||||
@ -845,6 +845,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
|
||||
* @param int $nohook Disable all hooks
|
||||
* @param object $object Current object in use
|
||||
* @return boolean True if no error (file is deleted or if glob is used and there's nothing to delete), False if error
|
||||
* @see dol_delete_dir
|
||||
*/
|
||||
function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=null)
|
||||
{
|
||||
@ -856,6 +857,14 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n
|
||||
|
||||
dol_syslog("dol_delete_file file=".$file." disableglob=".$disableglob." nophperrors=".$nophperrors." nohook=".$nohook);
|
||||
|
||||
// Security:
|
||||
// We refuse transversal using .. and pipes into filenames.
|
||||
if (preg_match('/\.\./',$file) || preg_match('/[<>|]/',$file))
|
||||
{
|
||||
dol_syslog("Refused to delete file ".$file, LOG_WARNING);
|
||||
return False;
|
||||
}
|
||||
|
||||
if (empty($nohook))
|
||||
{
|
||||
$hookmanager->initHooks(array('fileslib'));
|
||||
@ -943,9 +952,18 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n
|
||||
* @param string $dir Directory to delete
|
||||
* @param int $nophperrors Disable all PHP output errors
|
||||
* @return boolean True if success, false if error
|
||||
* @see dol_delete_file
|
||||
*/
|
||||
function dol_delete_dir($dir,$nophperrors=0)
|
||||
{
|
||||
// Security:
|
||||
// We refuse transversal using .. and pipes into filenames.
|
||||
if (preg_match('/\.\./',$dir) || preg_match('/[<>|]/',$dir))
|
||||
{
|
||||
dol_syslog("Refused to delete dir ".$dir, LOG_WARNING);
|
||||
return False;
|
||||
}
|
||||
|
||||
$dir_osencoded=dol_osencode($dir);
|
||||
return ($nophperrors?@rmdir($dir_osencoded):rmdir($dir_osencoded));
|
||||
}
|
||||
@ -1568,141 +1586,140 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
// find the subdirectory name as the reference
|
||||
if (empty($refname)) $refname=basename(dirname($original_file)."/");
|
||||
|
||||
$relative_original_file = $original_file;
|
||||
|
||||
// Wrapping for some images
|
||||
if ($modulepart == 'companylogo')
|
||||
if ($modulepart == 'companylogo' && !empty($conf->mycompany->dir_output))
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->mycompany->dir_output.'/logos/'.$original_file;
|
||||
}
|
||||
// Wrapping for users photos
|
||||
elseif ($modulepart == 'userphoto')
|
||||
elseif ($modulepart == 'userphoto' && !empty($conf->user->dir_output))
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->user->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping for members photos
|
||||
elseif ($modulepart == 'memberphoto')
|
||||
elseif ($modulepart == 'memberphoto' && !empty($conf->adherent->dir_output))
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->adherent->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les apercu factures
|
||||
elseif ($modulepart == 'apercufacture')
|
||||
elseif ($modulepart == 'apercufacture' && !empty($conf->facture->dir_output))
|
||||
{
|
||||
if ($fuser->rights->facture->lire) $accessallowed=1;
|
||||
$original_file=$conf->facture->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les apercu propal
|
||||
elseif ($modulepart == 'apercupropal')
|
||||
elseif ($modulepart == 'apercupropal' && !empty($conf->propal->dir_output))
|
||||
{
|
||||
if ($fuser->rights->propale->lire) $accessallowed=1;
|
||||
$original_file=$conf->propal->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les apercu commande
|
||||
elseif ($modulepart == 'apercucommande')
|
||||
elseif ($modulepart == 'apercucommande' && !empty($conf->commande->dir_output))
|
||||
{
|
||||
if ($fuser->rights->commande->lire) $accessallowed=1;
|
||||
$original_file=$conf->commande->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les apercu intervention
|
||||
elseif ($modulepart == 'apercufichinter')
|
||||
elseif ($modulepart == 'apercufichinter' && !empty($conf->ficheinter->dir_output))
|
||||
{
|
||||
if ($fuser->rights->ficheinter->lire) $accessallowed=1;
|
||||
$original_file=$conf->ficheinter->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images des stats propales
|
||||
elseif ($modulepart == 'propalstats')
|
||||
elseif ($modulepart == 'propalstats' && !empty($conf->propal->dir_temp))
|
||||
{
|
||||
if ($fuser->rights->propale->lire) $accessallowed=1;
|
||||
$original_file=$conf->propal->dir_temp.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images des stats commandes
|
||||
elseif ($modulepart == 'orderstats')
|
||||
elseif ($modulepart == 'orderstats' && !empty($conf->commande->dir_temp))
|
||||
{
|
||||
if ($fuser->rights->commande->lire) $accessallowed=1;
|
||||
$original_file=$conf->commande->dir_temp.'/'.$original_file;
|
||||
}
|
||||
elseif ($modulepart == 'orderstatssupplier')
|
||||
elseif ($modulepart == 'orderstatssupplier' && !empty($conf->fournisseur->dir_output))
|
||||
{
|
||||
if ($fuser->rights->fournisseur->commande->lire) $accessallowed=1;
|
||||
$original_file=$conf->fournisseur->dir_output.'/commande/temp/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images des stats factures
|
||||
elseif ($modulepart == 'billstats')
|
||||
elseif ($modulepart == 'billstats' && !empty($conf->facture->dir_temp))
|
||||
{
|
||||
if ($fuser->rights->facture->lire) $accessallowed=1;
|
||||
$original_file=$conf->facture->dir_temp.'/'.$original_file;
|
||||
}
|
||||
elseif ($modulepart == 'billstatssupplier')
|
||||
elseif ($modulepart == 'billstatssupplier' && !empty($conf->fournisseur->dir_output))
|
||||
{
|
||||
if ($fuser->rights->fournisseur->facture->lire) $accessallowed=1;
|
||||
$original_file=$conf->fournisseur->dir_output.'/facture/temp/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images des stats expeditions
|
||||
elseif ($modulepart == 'expeditionstats')
|
||||
elseif ($modulepart == 'expeditionstats' && !empty($conf->expedition->dir_temp))
|
||||
{
|
||||
if ($fuser->rights->expedition->lire) $accessallowed=1;
|
||||
$original_file=$conf->expedition->dir_temp.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images des stats expeditions
|
||||
elseif ($modulepart == 'tripsexpensesstats')
|
||||
elseif ($modulepart == 'tripsexpensesstats' && !empty($conf->deplacement->dir_temp))
|
||||
{
|
||||
if ($fuser->rights->deplacement->lire) $accessallowed=1;
|
||||
$original_file=$conf->deplacement->dir_temp.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images des stats expeditions
|
||||
elseif ($modulepart == 'memberstats')
|
||||
elseif ($modulepart == 'memberstats' && !empty($conf->adherent->dir_temp))
|
||||
{
|
||||
if ($fuser->rights->adherent->lire) $accessallowed=1;
|
||||
$original_file=$conf->adherent->dir_temp.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images des stats produits
|
||||
elseif (preg_match('/^productstats_/i',$modulepart))
|
||||
elseif (preg_match('/^productstats_/i',$modulepart) && !empty($conf->product->dir_temp))
|
||||
{
|
||||
if ($fuser->rights->produit->lire || $fuser->rights->service->lire) $accessallowed=1;
|
||||
$original_file=(!empty($conf->product->multidir_temp[$entity])?$conf->product->multidir_temp[$entity]:$conf->service->multidir_temp[$entity]).'/'.$original_file;
|
||||
}
|
||||
// Wrapping for products or services
|
||||
elseif ($modulepart == 'tax')
|
||||
elseif ($modulepart == 'tax' && !empty($conf->tax->dir_output))
|
||||
{
|
||||
if ($fuser->rights->tax->charges->lire) $accessallowed=1;
|
||||
$original_file=$conf->tax->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping for products or services
|
||||
elseif ($modulepart == 'actions')
|
||||
elseif ($modulepart == 'actions' && !empty($conf->agenda->dir_output))
|
||||
{
|
||||
if ($fuser->rights->agenda->myactions->read) $accessallowed=1;
|
||||
$original_file=$conf->agenda->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping for categories
|
||||
elseif ($modulepart == 'category')
|
||||
elseif ($modulepart == 'category' && !empty($conf->categorie->dir_output))
|
||||
{
|
||||
if ($fuser->rights->categorie->lire) $accessallowed=1;
|
||||
$original_file=$conf->categorie->multidir_output[$entity].'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les prelevements
|
||||
elseif ($modulepart == 'prelevement')
|
||||
elseif ($modulepart == 'prelevement' && !empty($conf->prelevement->dir_output))
|
||||
{
|
||||
if ($fuser->rights->prelevement->bons->lire || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
$accessallowed=1;
|
||||
}
|
||||
if ($fuser->rights->prelevement->bons->lire || preg_match('/^specimen/i',$original_file)) $accessallowed=1;
|
||||
$original_file=$conf->prelevement->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les graph energie
|
||||
elseif ($modulepart == 'graph_stock')
|
||||
elseif ($modulepart == 'graph_stock' && !empty($conf->stock->dir_temp))
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->stock->dir_temp.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les graph fournisseurs
|
||||
elseif ($modulepart == 'graph_fourn')
|
||||
elseif ($modulepart == 'graph_fourn' && !empty($conf->fournisseur->dir_temp))
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->fournisseur->dir_temp.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les graph des produits
|
||||
elseif ($modulepart == 'graph_product')
|
||||
elseif ($modulepart == 'graph_product' && !empty($conf->product->dir_temp))
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->product->multidir_temp[$entity].'/'.$original_file;
|
||||
@ -1711,32 +1728,31 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
elseif ($modulepart == 'barcode')
|
||||
{
|
||||
$accessallowed=1;
|
||||
// If viewimage is called for barcode, we try to output an image on the fly,
|
||||
// with not build of file on disk.
|
||||
// If viewimage is called for barcode, we try to output an image on the fly, with no build of file on disk.
|
||||
//$original_file=$conf->barcode->dir_temp.'/'.$original_file;
|
||||
$original_file='';
|
||||
}
|
||||
// Wrapping pour les icones de background des mailings
|
||||
elseif ($modulepart == 'iconmailing')
|
||||
elseif ($modulepart == 'iconmailing' && !empty($conf->mailing->dir_temp))
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->mailing->dir_temp.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les icones de background des mailings
|
||||
elseif ($modulepart == 'scanner_user_temp')
|
||||
// Wrapping pour le scanner
|
||||
elseif ($modulepart == 'scanner_user_temp' && !empty($conf->scanner->dir_temp))
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->scanner->dir_temp.'/'.$fuser->id.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images fckeditor
|
||||
elseif ($modulepart == 'fckeditor')
|
||||
elseif ($modulepart == 'fckeditor' && !empty($conf->fckeditor->dir_output))
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->fckeditor->dir_output.'/'.$original_file;
|
||||
}
|
||||
|
||||
// Wrapping for third parties
|
||||
else if ($modulepart == 'company' || $modulepart == 'societe')
|
||||
else if (($modulepart == 'company' || $modulepart == 'societe') && !empty($conf->societe->dir_output))
|
||||
{
|
||||
if ($fuser->rights->societe->lire || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
@ -1747,7 +1763,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
}
|
||||
|
||||
// Wrapping for contact
|
||||
else if ($modulepart == 'contact')
|
||||
else if ($modulepart == 'contact' && !empty($conf->societe->dir_output))
|
||||
{
|
||||
if ($fuser->rights->societe->lire)
|
||||
{
|
||||
@ -1757,7 +1773,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
}
|
||||
|
||||
// Wrapping for invoices
|
||||
else if ($modulepart == 'facture' || $modulepart == 'invoice')
|
||||
else if (($modulepart == 'facture' || $modulepart == 'invoice') && !empty($conf->facture->dir_output))
|
||||
{
|
||||
if ($fuser->rights->facture->lire || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
@ -1766,7 +1782,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
$original_file=$conf->facture->dir_output.'/'.$original_file;
|
||||
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity;
|
||||
}
|
||||
else if ($modulepart == 'massfilesarea_proposals')
|
||||
else if ($modulepart == 'massfilesarea_proposals' && !empty($conf->propal->dir_output))
|
||||
{
|
||||
if ($fuser->rights->propal->lire || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
@ -1791,8 +1807,8 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
$original_file=$conf->facture->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file;
|
||||
}
|
||||
|
||||
// Wrapping pour les fiches intervention
|
||||
else if ($modulepart == 'ficheinter')
|
||||
// Wrapping for interventions
|
||||
else if (($modulepart == 'fichinter' || $modulepart == 'ficheinter') && !empty($conf->ficheinter->dir_output))
|
||||
{
|
||||
if ($fuser->rights->ficheinter->lire || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
@ -1803,7 +1819,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
}
|
||||
|
||||
// Wrapping pour les deplacements et notes de frais
|
||||
else if ($modulepart == 'deplacement')
|
||||
else if ($modulepart == 'deplacement' && !empty($conf->deplacement->dir_output))
|
||||
{
|
||||
if ($fuser->rights->deplacement->lire || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
@ -1813,7 +1829,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
//$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity;
|
||||
}
|
||||
// Wrapping pour les propales
|
||||
else if ($modulepart == 'propal')
|
||||
else if ($modulepart == 'propal' && !empty($conf->propal->dir_output))
|
||||
{
|
||||
if ($fuser->rights->propale->lire || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
@ -1825,7 +1841,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
}
|
||||
|
||||
// Wrapping pour les commandes
|
||||
else if ($modulepart == 'commande' || $modulepart == 'order')
|
||||
else if (($modulepart == 'commande' || $modulepart == 'order') && !empty($conf->commande->dir_output))
|
||||
{
|
||||
if ($fuser->rights->commande->lire || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
@ -1836,7 +1852,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
}
|
||||
|
||||
// Wrapping pour les projets
|
||||
else if ($modulepart == 'project')
|
||||
else if ($modulepart == 'project' && !empty($conf->projet->dir_output))
|
||||
{
|
||||
if ($fuser->rights->projet->lire || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
@ -1845,7 +1861,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
$original_file=$conf->projet->dir_output.'/'.$original_file;
|
||||
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project', 1).")";
|
||||
}
|
||||
else if ($modulepart == 'project_task')
|
||||
else if ($modulepart == 'project_task' && !empty($conf->projet->dir_output))
|
||||
{
|
||||
if ($fuser->rights->projet->lire || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
@ -1854,19 +1870,9 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
$original_file=$conf->projet->dir_output.'/'.$original_file;
|
||||
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project', 1).")";
|
||||
}
|
||||
// Wrapping for interventions
|
||||
else if ($modulepart == 'fichinter')
|
||||
{
|
||||
if ($fuser->rights->ficheinter->lire || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
$accessallowed=1;
|
||||
}
|
||||
$original_file=$conf->ficheinter->dir_output.'/'.$original_file;
|
||||
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity;
|
||||
}
|
||||
|
||||
// Wrapping pour les commandes fournisseurs
|
||||
else if ($modulepart == 'commande_fournisseur' || $modulepart == 'order_supplier')
|
||||
else if (($modulepart == 'commande_fournisseur' || $modulepart == 'order_supplier') && !empty($conf->fournisseur->commande->dir_output))
|
||||
{
|
||||
if ($fuser->rights->fournisseur->commande->lire || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
@ -1877,7 +1883,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
}
|
||||
|
||||
// Wrapping pour les factures fournisseurs
|
||||
else if ($modulepart == 'facture_fournisseur' || $modulepart == 'invoice_supplier')
|
||||
else if (($modulepart == 'facture_fournisseur' || $modulepart == 'invoice_supplier') && !empty($conf->fournisseur->facture->dir_output))
|
||||
{
|
||||
if ($fuser->rights->fournisseur->facture->lire || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
@ -1898,7 +1904,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
}
|
||||
|
||||
// Wrapping pour les rapport de paiements
|
||||
else if ($modulepart == 'facture_paiement')
|
||||
else if ($modulepart == 'facture_paiement' && !empty($conf->facture->dir_output))
|
||||
{
|
||||
if ($fuser->rights->facture->lire || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
@ -1909,7 +1915,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
}
|
||||
|
||||
// Wrapping for accounting exports
|
||||
else if ($modulepart == 'export_compta')
|
||||
else if ($modulepart == 'export_compta' && !empty($conf->accounting->dir_output))
|
||||
{
|
||||
if ($fuser->rights->accounting->bind->write || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
@ -1919,7 +1925,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
}
|
||||
|
||||
// Wrapping pour les expedition
|
||||
else if ($modulepart == 'expedition')
|
||||
else if ($modulepart == 'expedition' && !empty($conf->expedition->dir_output))
|
||||
{
|
||||
if ($fuser->rights->expedition->lire || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
@ -1929,7 +1935,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
}
|
||||
|
||||
// Wrapping pour les bons de livraison
|
||||
else if ($modulepart == 'livraison')
|
||||
else if ($modulepart == 'livraison' && !empty($conf->livraison->dir_output))
|
||||
{
|
||||
if ($fuser->rights->expedition->livraison->lire || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
@ -1939,7 +1945,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
}
|
||||
|
||||
// Wrapping pour les actions
|
||||
else if ($modulepart == 'actions')
|
||||
else if ($modulepart == 'actions' && !empty($conf->agenda->dir_output))
|
||||
{
|
||||
if ($fuser->rights->agenda->myactions->read || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
@ -1949,7 +1955,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
}
|
||||
|
||||
// Wrapping pour les actions
|
||||
else if ($modulepart == 'actionsreport')
|
||||
else if ($modulepart == 'actionsreport' && !empty($conf->agenda->dir_temp))
|
||||
{
|
||||
if ($fuser->rights->agenda->allactions->read || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
@ -1970,7 +1976,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
}
|
||||
|
||||
// Wrapping pour les contrats
|
||||
else if ($modulepart == 'contract')
|
||||
else if ($modulepart == 'contract' && !empty($conf->contrat->dir_output))
|
||||
{
|
||||
if ($fuser->rights->contrat->lire || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
@ -1981,7 +1987,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
}
|
||||
|
||||
// Wrapping pour les dons
|
||||
else if ($modulepart == 'donation')
|
||||
else if ($modulepart == 'donation' && !empty($conf->donation->dir_output))
|
||||
{
|
||||
if ($fuser->rights->don->lire || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
@ -1991,7 +1997,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
}
|
||||
|
||||
// Wrapping pour les remises de cheques
|
||||
else if ($modulepart == 'remisecheque')
|
||||
else if ($modulepart == 'remisecheque' && !empty($conf->banque->dir_output))
|
||||
{
|
||||
if ($fuser->rights->banque->lire || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
@ -2002,7 +2008,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
}
|
||||
|
||||
// Wrapping for bank
|
||||
else if ($modulepart == 'bank')
|
||||
else if ($modulepart == 'bank' && !empty($conf->bank->dir_output))
|
||||
{
|
||||
if ($fuser->rights->banque->lire)
|
||||
{
|
||||
@ -2012,7 +2018,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
}
|
||||
|
||||
// Wrapping for export module
|
||||
else if ($modulepart == 'export')
|
||||
else if ($modulepart == 'export' && !empty($conf->export->dir_temp))
|
||||
{
|
||||
// Aucun test necessaire car on force le rep de download sur
|
||||
// le rep export qui est propre a l'utilisateur
|
||||
@ -2021,21 +2027,21 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
}
|
||||
|
||||
// Wrapping for import module
|
||||
else if ($modulepart == 'import')
|
||||
else if ($modulepart == 'import' && !empty($conf->import->dir_temp))
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->import->dir_temp.'/'.$original_file;
|
||||
}
|
||||
|
||||
// Wrapping pour l'editeur wysiwyg
|
||||
else if ($modulepart == 'editor')
|
||||
else if ($modulepart == 'editor' && !empty($conf->fckeditor->dir_output))
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->fckeditor->dir_output.'/'.$original_file;
|
||||
}
|
||||
|
||||
// Wrapping for miscellaneous medias files
|
||||
elseif ($modulepart == 'medias')
|
||||
elseif ($modulepart == 'medias' && !empty($dolibarr_main_data_root))
|
||||
{
|
||||
$accessallowed=1;
|
||||
global $dolibarr_main_data_root;
|
||||
@ -2043,25 +2049,21 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
}
|
||||
|
||||
// Wrapping for backups
|
||||
else if ($modulepart == 'systemtools')
|
||||
else if ($modulepart == 'systemtools' && !empty($conf->admin->dir_output))
|
||||
{
|
||||
if ($fuser->admin)
|
||||
{
|
||||
$accessallowed=1;
|
||||
}
|
||||
if ($fuser->admin) $accessallowed=1;
|
||||
$original_file=$conf->admin->dir_output.'/'.$original_file;
|
||||
}
|
||||
|
||||
// Wrapping for upload file test
|
||||
else if ($modulepart == 'admin_temp')
|
||||
else if ($modulepart == 'admin_temp' && !empty($conf->admin->dir_temp))
|
||||
{
|
||||
if ($fuser->admin)
|
||||
$accessallowed=1;
|
||||
if ($fuser->admin) $accessallowed=1;
|
||||
$original_file=$conf->admin->dir_temp.'/'.$original_file;
|
||||
}
|
||||
|
||||
// Wrapping pour BitTorrent
|
||||
else if ($modulepart == 'bittorrent')
|
||||
else if ($modulepart == 'bittorrent' && !empty($conf->bittorrent->dir_output))
|
||||
{
|
||||
$accessallowed=1;
|
||||
$dir='files';
|
||||
@ -2070,7 +2072,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
}
|
||||
|
||||
// Wrapping pour Foundation module
|
||||
else if ($modulepart == 'member')
|
||||
else if ($modulepart == 'member' && !empty($conf->adherent->dir_output))
|
||||
{
|
||||
if ($fuser->rights->adherent->lire || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
@ -2080,7 +2082,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
}
|
||||
|
||||
// Wrapping for Scanner
|
||||
else if ($modulepart == 'scanner_user_temp')
|
||||
else if ($modulepart == 'scanner_user_temp' && !empty($conf->scanner->dir_temp))
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->scanner->dir_temp.'/'.$fuser->id.'/'.$original_file;
|
||||
@ -2093,20 +2095,38 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
// If modulepart=module Allows any module to open a file if file is in directory called DOL_DATA_ROOT/modulepart
|
||||
else
|
||||
{
|
||||
if (preg_match('/^specimen/i',$original_file)) $accessallowed=1; // If link to a file called specimen. Test must be done before changing $original_file int full path.
|
||||
if ($fuser->admin) $accessallowed=1; // If user is admin
|
||||
|
||||
// Define $accessallowed
|
||||
if (preg_match('/^([a-z]+)_user_temp$/i',$modulepart,$reg))
|
||||
{
|
||||
if ($fuser->rights->{$reg[1]}->lire || $fuser->rights->{$reg[1]}->read || ($fuser->rights->{$reg[1]}->download)) $accessallowed=1;
|
||||
if (empty($conf->{$reg[1]}->dir_temp)) // modulepart not supported
|
||||
{
|
||||
dol_print_error('','Error call dol_check_secure_access_document with not supported value for modulepart parameter ('.$modulepart.')');
|
||||
exit;
|
||||
}
|
||||
if ($fuser->rights->{$reg[1]}->lire || $fuser->rights->{$reg[1]}->read || ($fuser->rights->{$reg[1]}->download)) $accessallowed=1;
|
||||
$original_file=$conf->{$reg[1]}->dir_temp.'/'.$fuser->id.'/'.$original_file;
|
||||
}
|
||||
else if (preg_match('/^([a-z]+)_temp$/i',$modulepart,$reg))
|
||||
{
|
||||
if ($fuser->rights->{$reg[1]}->lire || $fuser->rights->{$reg[1]}->read || ($fuser->rights->{$reg[1]}->download)) $accessallowed=1;
|
||||
if (empty($conf->{$reg[1]}->dir_temp)) // modulepart not supported
|
||||
{
|
||||
dol_print_error('','Error call dol_check_secure_access_document with not supported value for modulepart parameter ('.$modulepart.')');
|
||||
exit;
|
||||
}
|
||||
if ($fuser->rights->{$reg[1]}->lire || $fuser->rights->{$reg[1]}->read || ($fuser->rights->{$reg[1]}->download)) $accessallowed=1;
|
||||
$original_file=$conf->{$reg[1]}->dir_temp.'/'.$original_file;
|
||||
}
|
||||
else if (preg_match('/^([a-z]+)_user$/i',$modulepart,$reg))
|
||||
{
|
||||
if ($fuser->rights->{$reg[1]}->lire || $fuser->rights->{$reg[1]}->read || ($fuser->rights->{$reg[1]}->download)) $accessallowed=1;
|
||||
if (empty($conf->{$reg[1]}->dir_output)) // modulepart not supported
|
||||
{
|
||||
dol_print_error('','Error call dol_check_secure_access_document with not supported value for modulepart parameter ('.$modulepart.')');
|
||||
exit;
|
||||
}
|
||||
if ($fuser->rights->{$reg[1]}->lire || $fuser->rights->{$reg[1]}->read || ($fuser->rights->{$reg[1]}->download)) $accessallowed=1;
|
||||
$original_file=$conf->{$reg[1]}->dir_output.'/'.$fuser->id.'/'.$original_file;
|
||||
}
|
||||
else
|
||||
@ -2130,8 +2150,6 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
$original_file=$conf->$modulepart->dir_output.'/'.$original_file;
|
||||
}
|
||||
}
|
||||
if (preg_match('/^specimen/i',$original_file)) $accessallowed=1; // If link to a specimen
|
||||
if ($fuser->admin) $accessallowed=1; // If user is admin
|
||||
|
||||
// For modules who wants to manage different levels of permissions for documents
|
||||
$subPermCategoryConstName = strtoupper($modulepart).'_SUBPERMCATEGORY_FOR_DOCUMENTS';
|
||||
@ -2163,7 +2181,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
||||
}
|
||||
|
||||
/**
|
||||
* Store object in file
|
||||
* Store object in file.
|
||||
*
|
||||
* @param string $directory Directory of cache
|
||||
* @param string $filename Name of filecache
|
||||
@ -2179,7 +2197,7 @@ function dol_filecache($directory, $filename, $object)
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if Refresh needed
|
||||
* Test if Refresh needed.
|
||||
*
|
||||
* @param string $directory Directory of cache
|
||||
* @param string $filename Name of filecache
|
||||
@ -2195,7 +2213,7 @@ function dol_cache_refresh($directory, $filename, $cachetime)
|
||||
}
|
||||
|
||||
/**
|
||||
* Read object from cachefile
|
||||
* Read object from cachefile.
|
||||
*
|
||||
* @param string $directory Directory of cache
|
||||
* @param string $filename Name of filecache
|
||||
|
||||
@ -1047,9 +1047,15 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($showbarcode) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showbarcode($object).'</div>';
|
||||
if ($object->element == 'societe' && ! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
||||
$morehtmlstatus.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased');
|
||||
|
||||
if ($object->element == 'societe')
|
||||
{
|
||||
if (! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE))
|
||||
{
|
||||
$morehtmlstatus.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased');
|
||||
}
|
||||
}
|
||||
elseif ($object->element == 'product')
|
||||
{
|
||||
@ -1099,9 +1105,9 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
|
||||
|
||||
if ($object->element == 'product' || $object->element == 'bank_account')
|
||||
{
|
||||
if(! empty($object->label)) $morehtmlref.='<div class="refidno">'.$object->label.'</div>';
|
||||
if (! empty($object->label)) $morehtmlref.='<div class="refidno">'.$object->label.'</div>';
|
||||
}
|
||||
|
||||
|
||||
if ($object->element != 'product' && $object->element != 'bookmark')
|
||||
{
|
||||
$morehtmlref.='<div class="refidno">';
|
||||
|
||||
@ -47,7 +47,7 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest=
|
||||
{
|
||||
dol_syslog("functions_dolibarr::check_user_password_dolibarr usertotest=".$usertotest." passwordtotest=".preg_replace('/./','*',$passwordtotest)." entitytotest=".$entitytotest);
|
||||
|
||||
// If test username/password asked, we define $test=false and $login var if ok, set $_SESSION["dol_loginmesg"] if ko
|
||||
// If test username/password asked, we define $test=false if ko and $login var to login if ok, set also $_SESSION["dol_loginmesg"] if ko
|
||||
$table = MAIN_DB_PREFIX."user";
|
||||
$usernamecol1 = 'login';
|
||||
$usernamecol2 = 'email';
|
||||
@ -59,6 +59,9 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest=
|
||||
if (preg_match('/@/',$usertotest)) $sql.=' OR '.$usernamecol2." = '".$db->escape($usertotest)."'";
|
||||
$sql.=') AND '.$entitycol." IN (0," . ($entity ? $entity : 1) . ")";
|
||||
$sql.=' AND statut = 1';
|
||||
// Required to first found the user into entity, then the superadmin.
|
||||
// For the case (TODO and that we must avoid) a user has renamed its login with same value than a user in entity 0.
|
||||
$sql.=' ORDER BY entity DESC';
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@ -588,9 +588,9 @@ class ImportCsv extends ModeleImports
|
||||
{
|
||||
$updatedone = false;
|
||||
$insertdone = false;
|
||||
if(!empty($updatekeys)) {
|
||||
if (!empty($updatekeys)) {
|
||||
// We do SELECT to get the rowid, if we already have the rowid, it's to be used below for related tables (extrafields)
|
||||
if(empty($lastinsertid)) {
|
||||
if (empty($lastinsertid)) {
|
||||
$sqlSelect = 'SELECT rowid FROM '.$tablename;
|
||||
|
||||
$data = array_combine($listfields, $listvalues);
|
||||
@ -627,7 +627,7 @@ class ImportCsv extends ModeleImports
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($lastinsertid)) {
|
||||
if (!empty($lastinsertid)) {
|
||||
// Build SQL UPDATE request
|
||||
$sqlstart = 'UPDATE '.$tablename;
|
||||
|
||||
@ -660,7 +660,7 @@ class ImportCsv extends ModeleImports
|
||||
}
|
||||
|
||||
// Update not done, we do insert
|
||||
if(!$error && !$updatedone) {
|
||||
if (!$error && !$updatedone) {
|
||||
// Build SQL INSERT request
|
||||
$sqlstart = 'INSERT INTO '.$tablename.'('.implode(', ', $listfields).', import_key';
|
||||
$sqlend = ') VALUES('.implode(', ', $listvalues).", '".$importid."'";
|
||||
@ -679,10 +679,10 @@ class ImportCsv extends ModeleImports
|
||||
if ($sql)
|
||||
{
|
||||
$resql=$this->db->query($sql);
|
||||
$last_insert_id_array[$tablename] = $this->db->last_insert_id($tablename); // store the last inserted auto_increment id for each table, so that dependent tables can be inserted with the appropriate id. This must be done just after the INSERT request, else we risk losing the id (because another sql query will be issued somewhere in Dolibarr).
|
||||
if ($resql)
|
||||
{
|
||||
$insertdone = true;
|
||||
$last_insert_id_array[$tablename] = $this->db->last_insert_id($tablename); // store the last inserted auto_increment id for each table, so that child tables can be inserted with the appropriate id. This must be done just after the INSERT request, else we risk losing the id (because another sql query will be issued somewhere in Dolibarr).
|
||||
$insertdone = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -32,7 +32,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
/**
|
||||
* Class to describe and enable module Donation
|
||||
*/
|
||||
class modDon extends DolibarrModules
|
||||
class modDon extends DolibarrModules
|
||||
{
|
||||
|
||||
/**
|
||||
|
||||
@ -44,7 +44,7 @@ class modNotification extends DolibarrModules
|
||||
$this->family = "technic";
|
||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||
$this->name = preg_replace('/^mod/i','',get_class($this));
|
||||
$this->description = "Gestion des notifications (par mail) sur evenement Dolibarr";
|
||||
$this->description = "EMail notifications (push) on business Dolibarr events";
|
||||
$this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
|
||||
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
||||
$this->special = 1;
|
||||
|
||||
@ -239,6 +239,23 @@ if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file
|
||||
</div></div>
|
||||
<?php
|
||||
}
|
||||
|
||||
// Add commit strip
|
||||
if (!empty($conf->global->MAIN_EASTER_EGG_COMMITSTRIP)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
||||
if (substr($langs->defaultlang,0,2)=='fr') {
|
||||
$resgetcommitstrip = getURLContent("http://www.commitstrip.com/fr/feed/");
|
||||
} else {
|
||||
$resgetcommitstrip = getURLContent("http://www.commitstrip.com/en/feed/");
|
||||
}
|
||||
if ($resgetcommitstrip && $resgetcommitstrip['http_code'] == '200')
|
||||
{
|
||||
$xml = simplexml_load_string($resgetcommitstrip['content']);
|
||||
$little = $xml->channel->item[0]->children('content',true);
|
||||
print $little->encoded;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php if ($main_home)
|
||||
|
||||
@ -6,9 +6,9 @@ require_once(DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php');
|
||||
$form = new Form($db);
|
||||
$formresources = new FormResource($db);
|
||||
|
||||
$out = '<div class="tagtable centpercent border allwidth nohover">';
|
||||
$out = '<div class="tagtable centpercent noborder allwidth nohover">';
|
||||
|
||||
$out .= '<form class="tagtr '.($var==true?'pair':'impair').'" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
$out .= '<form class="tagtr nohover '.($var==true?'pair':'impair').'" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
$out .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$out .= '<input type="hidden" name="action" value="add_element_resource">';
|
||||
$out .= '<input type="hidden" name="element" value="'.$element.'">';
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2015-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -804,6 +804,39 @@ class Don extends CommonObject
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Charge indicateurs this->nb pour le tableau de bord
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function load_state_board()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$this->nb=array();
|
||||
|
||||
$sql = "SELECT count(d.rowid) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."don as d";
|
||||
$sql.= " WHERE d.fk_statut > 0";
|
||||
$sql.= " AND d.entity IN (".getEntity('don', 1).")";
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$this->nb["donations"]=$obj->nb;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return clicable name (with picto eventually)
|
||||
|
||||
@ -2957,7 +2957,8 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
||||
$sql.= ' cd.info_bits, cd.total_ht, cd.total_tva, cd.total_ttc,';
|
||||
$sql.= ' cd.total_localtax1, cd.total_localtax2,';
|
||||
$sql.= ' p.ref as product_ref, p.label as product_libelle, p.description as product_desc,';
|
||||
$sql.= ' cd.date_start, cd.date_end, cd.fk_unit';
|
||||
$sql.= ' cd.date_start, cd.date_end, cd.fk_unit,';
|
||||
$sql.= ' cd.multicurrency_subprice, cd.multicurrency_total_ht, cd.multicurrency_total_tva, cd.multicurrency_total_ttc';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet as cd';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON cd.fk_product = p.rowid';
|
||||
$sql.= ' WHERE cd.rowid = '.$rowid;
|
||||
@ -2965,6 +2966,7 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
||||
if ($result)
|
||||
{
|
||||
$objp = $this->db->fetch_object($result);
|
||||
|
||||
$this->rowid = $objp->rowid;
|
||||
$this->id = $objp->rowid;
|
||||
$this->fk_commande = $objp->fk_commande;
|
||||
@ -2992,10 +2994,15 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
||||
$this->product_libelle = $objp->product_libelle;
|
||||
$this->product_desc = $objp->product_desc;
|
||||
|
||||
$this->date_start = $this->db->jdate($objp->date_start);
|
||||
$this->date_end = $this->db->jdate($objp->date_end);
|
||||
$this->fk_unit = $objp->fk_unit;
|
||||
|
||||
$this->date_start = $this->db->jdate($objp->date_start);
|
||||
$this->date_end = $this->db->jdate($objp->date_end);
|
||||
$this->fk_unit = $objp->fk_unit;
|
||||
|
||||
$this->multicurrency_subprice = $objp->multicurrency_subprice;
|
||||
$this->multicurrency_total_ht = $objp->multicurrency_total_ht;
|
||||
$this->multicurrency_total_tva = $objp->multicurrency_total_tva;
|
||||
$this->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
|
||||
|
||||
$this->db->free($result);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -2385,8 +2385,9 @@ class SupplierInvoiceLine extends CommonObjectLine
|
||||
{
|
||||
$sql = 'SELECT f.rowid, f.ref as ref_supplier, f.description, f.pu_ht, f.pu_ttc, f.qty, f.remise_percent, f.tva_tx';
|
||||
$sql.= ', f.localtax1_type, f.localtax2_type, f.localtax1_tx, f.localtax2_tx, f.total_localtax1, f.total_localtax2 ';
|
||||
$sql.= ', f.total_ht, f.tva as total_tva, f.total_ttc, f.fk_product, f.product_type, f.info_bits, f.rang, f.special_code, f.fk_parent_line, f.fk_unit';
|
||||
$sql.= ', f.total_ht, f.tva as total_tva, f.total_ttc, f.fk_facture_fourn, f.fk_product, f.product_type, f.info_bits, f.rang, f.special_code, f.fk_parent_line, f.fk_unit';
|
||||
$sql.= ', p.rowid as product_id, p.ref as product_ref, p.label as label, p.description as product_desc';
|
||||
$sql.= ', f.multicurrency_subprice, f.multicurrency_total_ht, f.multicurrency_total_tva, multicurrency_total_ttc';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_det as f';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON f.fk_product = p.rowid';
|
||||
$sql.= ' WHERE f.rowid = '.$rowid;
|
||||
@ -2407,6 +2408,7 @@ class SupplierInvoiceLine extends CommonObjectLine
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->rowid = $obj->rowid;
|
||||
$this->fk_facture_fourn = $obj->fk_facture_fourn;
|
||||
$this->description = $obj->description;
|
||||
$this->product_ref = $obj->product_ref;
|
||||
$this->ref = $obj->product_ref;
|
||||
@ -2439,6 +2441,11 @@ class SupplierInvoiceLine extends CommonObjectLine
|
||||
$this->rang = $obj->rang;
|
||||
$this->fk_unit = $obj->fk_unit;
|
||||
|
||||
$this->multicurrency_subprice = $obj->multicurrency_subprice;
|
||||
$this->multicurrency_total_ht = $obj->multicurrency_total_ht;
|
||||
$this->multicurrency_total_tva = $obj->multicurrency_total_tva;
|
||||
$this->multicurrency_total_ttc = $obj->multicurrency_total_ttc;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@ -1805,7 +1805,7 @@ elseif (! empty($object->id))
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.=$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:-1), $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
|
||||
@ -2053,7 +2053,7 @@ else
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.=$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:-1), $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
@ -2454,6 +2454,7 @@ else
|
||||
print $langs->trans('AlreadyPaid');
|
||||
print ' :</td><td align="right"'.(($totalpaye > 0)?' class="amountalreadypaid"':'').'>' . price($totalpaye) . '</td><td> </td></tr>';
|
||||
|
||||
$resteapayer = $object->total_ttc - $totalpaye;
|
||||
$resteapayeraffiche = $resteapayer;
|
||||
$cssforamountpaymentcomplete = 'amountpaymentcomplete';
|
||||
|
||||
|
||||
@ -158,7 +158,8 @@ if (empty($user->societe_id))
|
||||
! empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS),
|
||||
! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS),
|
||||
! empty($conf->projet->enabled) && $user->rights->projet->lire,
|
||||
! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire
|
||||
! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire,
|
||||
! empty($conf->don->enabled) && $user->rights->don->lire
|
||||
);
|
||||
// Class file containing the method load_state_board for each line
|
||||
$includes=array(
|
||||
@ -179,7 +180,8 @@ if (empty($user->societe_id))
|
||||
DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.facture.class.php",
|
||||
DOL_DOCUMENT_ROOT."/supplier_proposal/class/supplier_proposal.class.php",
|
||||
DOL_DOCUMENT_ROOT."/projet/class/project.class.php",
|
||||
DOL_DOCUMENT_ROOT."/expensereport/class/expensereport.class.php"
|
||||
DOL_DOCUMENT_ROOT."/expensereport/class/expensereport.class.php",
|
||||
DOL_DOCUMENT_ROOT."/don/class/don.class.php"
|
||||
);
|
||||
// Name class containing the method load_state_board for each line
|
||||
$classes=array('User',
|
||||
@ -199,7 +201,8 @@ if (empty($user->societe_id))
|
||||
'FactureFournisseur',
|
||||
'SupplierProposal',
|
||||
'Project',
|
||||
'ExpenseReport'
|
||||
'ExpenseReport',
|
||||
'Don'
|
||||
);
|
||||
// Cle array returned by the method load_state_board for each line
|
||||
$keys=array('users',
|
||||
@ -219,7 +222,8 @@ if (empty($user->societe_id))
|
||||
'supplier_invoices',
|
||||
'askprice',
|
||||
'projects',
|
||||
'expensereports'
|
||||
'expensereports',
|
||||
'donations'
|
||||
);
|
||||
// Dashboard Icon lines
|
||||
$icons=array('user',
|
||||
@ -239,7 +243,8 @@ if (empty($user->societe_id))
|
||||
'bill',
|
||||
'propal',
|
||||
'project',
|
||||
'trip'
|
||||
'trip',
|
||||
'generic'
|
||||
);
|
||||
// Translation keyword
|
||||
$titres=array("Users",
|
||||
@ -259,7 +264,8 @@ if (empty($user->societe_id))
|
||||
"SuppliersInvoices",
|
||||
"SupplierProposalShort",
|
||||
"Projects",
|
||||
"ExpenseReports"
|
||||
"ExpenseReports",
|
||||
"Donations"
|
||||
);
|
||||
// Dashboard Link lines
|
||||
$links=array(
|
||||
@ -280,7 +286,8 @@ if (empty($user->societe_id))
|
||||
DOL_URL_ROOT.'/fourn/facture/list.php',
|
||||
DOL_URL_ROOT.'/supplier_proposal/list.php',
|
||||
DOL_URL_ROOT.'/projet/list.php?mainmenu=project',
|
||||
DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm'
|
||||
DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm',
|
||||
DOL_URL_ROOT.'/don/list.php?leftmenu=donations'
|
||||
);
|
||||
// Translation lang files
|
||||
$langfile=array("users",
|
||||
@ -300,7 +307,8 @@ if (empty($user->societe_id))
|
||||
"bills",
|
||||
"supplier_proposal",
|
||||
"projects",
|
||||
"trips"
|
||||
"trips",
|
||||
"donations"
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -117,8 +117,9 @@ ALTER TABLE llx_product_fournisseur_price ADD COLUMN default_vat_code varchar(10
|
||||
ALTER TABLE llx_user ADD COLUMN model_pdf varchar(255);
|
||||
ALTER TABLE llx_usergroup ADD COLUMN model_pdf varchar(255);
|
||||
|
||||
INSERT INTO `llx_const` (`name`, `entity`, `value`, `type`, `visible`, `note`, `tms`) VALUES
|
||||
('PRODUCT_ADDON_PDF_ODT_PATH', 1, 'DOL_DATA_ROOT/doctemplates/products', 'chaine', 0, '', '2017-03-13 16:54:30'),
|
||||
('CONTRACT_ADDON_PDF_ODT_PATH', 1, 'DOL_DATA_ROOT/doctemplates/contracts', 'chaine', 0, '', '2017-03-13 13:07:27'),
|
||||
('USERGROUP_ADDON_PDF_ODT_PATH', 1, 'DOL_DATA_ROOT/doctemplates/usergroups', 'chaine', 0, '', '2017-03-10 15:25:06'),
|
||||
('USER_ADDON_PDF_ODT_PATH', 1, 'DOL_DATA_ROOT/doctemplates/users', 'chaine', 0, '', '2017-03-10 15:14:14')
|
||||
INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('PRODUCT_ADDON_PDF_ODT_PATH', 1, 'DOL_DATA_ROOT/doctemplates/products', 'chaine', 0, '');
|
||||
INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('CONTRACT_ADDON_PDF_ODT_PATH', 1, 'DOL_DATA_ROOT/doctemplates/contracts', 'chaine', 0, '');
|
||||
INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('USERGROUP_ADDON_PDF_ODT_PATH', 1, 'DOL_DATA_ROOT/doctemplates/usergroups', 'chaine', 0, '');
|
||||
INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('USER_ADDON_PDF_ODT_PATH', 1, 'DOL_DATA_ROOT/doctemplates/users', 'chaine', 0, '');
|
||||
|
||||
ALTER TABLE llx_chargesociales ADD COLUMN fk_projet integer DEFAULT NULL;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
-- ========================================================================
|
||||
-- Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
-- Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
-- Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
--
|
||||
-- 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
|
||||
@ -19,23 +20,24 @@
|
||||
|
||||
create table llx_chargesociales
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
date_ech datetime NOT NULL, -- date echeance
|
||||
libelle varchar(80) NOT NULL,
|
||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||
tms timestamp,
|
||||
date_creation datetime, -- date de creation
|
||||
date_valid datetime, -- date de validation
|
||||
fk_user_author integer, -- user making creation
|
||||
fk_user_modif integer, -- user making last change
|
||||
fk_user_valid integer, -- user validating
|
||||
fk_type integer NOT NULL,
|
||||
fk_account integer, -- bank account
|
||||
fk_mode_reglement integer, -- mode de reglement
|
||||
amount real default 0 NOT NULL,
|
||||
paye smallint default 0 NOT NULL,
|
||||
periode date,
|
||||
import_key varchar(14)
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
date_ech datetime NOT NULL, -- date echeance
|
||||
libelle varchar(80) NOT NULL,
|
||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||
tms timestamp,
|
||||
date_creation datetime, -- date de creation
|
||||
date_valid datetime, -- date de validation
|
||||
fk_user_author integer, -- user making creation
|
||||
fk_user_modif integer, -- user making last change
|
||||
fk_user_valid integer, -- user validating
|
||||
fk_type integer NOT NULL,
|
||||
fk_account integer, -- bank account
|
||||
fk_mode_reglement integer, -- mode de reglement
|
||||
amount real default 0 NOT NULL,
|
||||
paye smallint default 0 NOT NULL,
|
||||
periode date,
|
||||
fk_projet integer DEFAULT NULL,
|
||||
import_key varchar(14)
|
||||
)ENGINE=innodb;
|
||||
|
||||
--
|
||||
|
||||
@ -105,9 +105,9 @@ ACCOUNTING_LIST_SORT_VENTILATION_DONE=Begin the sorting of the page "Binding don
|
||||
|
||||
ACCOUNTING_LENGTH_DESCRIPTION=Truncate product & services description in listings after x chars (Best = 50)
|
||||
ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT=Truncate product & services account description form in listings after x chars (Best = 50)
|
||||
ACCOUNTING_LENGTH_GACCOUNT=Length of the general accounting accounts
|
||||
ACCOUNTING_LENGTH_AACCOUNT=Length of the third party accounting accounts
|
||||
ACCOUNTING_MANAGE_ZERO=Manage the zero at the end of an accounting account. Needed by some countries. Disabled by default. If set to on, you must also set the 2 following parameters (or it is ignored)
|
||||
ACCOUNTING_LENGTH_GACCOUNT=Length of the general accounting accounts (If you set value to 6 here, the account '706' will appear like '706000' on screen)
|
||||
ACCOUNTING_LENGTH_AACCOUNT=Length of the third party accounting accounts (If you set value to 6 here, the account '401' will appear like '401000' on screen)
|
||||
ACCOUNTING_MANAGE_ZERO=Allow to manage different number of zero at the end of an accounting account. Needed by some countries (like switzerland). If keep to off (default), you can set the 2 following parameters to ask application to add virtual zero.
|
||||
BANK_DISABLE_DIRECT_INPUT=Disable direct recording of transaction in bank account
|
||||
|
||||
ACCOUNTING_SELL_JOURNAL=Sell journal
|
||||
|
||||
@ -13,7 +13,7 @@ MenuNewPrivateIndividual=New private individual
|
||||
NewCompany=New company (prospect, customer, supplier)
|
||||
NewThirdParty=New third party (prospect, customer, supplier)
|
||||
CreateDolibarrThirdPartySupplier=Create a third party (supplier)
|
||||
CreateThirdPartyOnly=Create thirdpary
|
||||
CreateThirdPartyOnly=Create third party
|
||||
CreateThirdPartyAndContact=Create a third party + a child contact
|
||||
ProspectionArea=Prospection area
|
||||
IdThirdParty=Id third party
|
||||
|
||||
@ -56,6 +56,7 @@ MenuTaxAndDividends=Taxes and dividends
|
||||
MenuSocialContributions=Social/fiscal taxes
|
||||
MenuNewSocialContribution=New social/fiscal tax
|
||||
NewSocialContribution=New social/fiscal tax
|
||||
AddSocialContribution=Add social/fiscal tax
|
||||
ContributionsToPay=Social/fiscal taxes to pay
|
||||
AccountancyTreasuryArea=Accountancy/Treasury area
|
||||
NewPayment=New payment
|
||||
@ -205,3 +206,4 @@ ImportDataset_tax_contrib=Social/fiscal taxes
|
||||
ImportDataset_tax_vat=Vat payments
|
||||
ErrorBankAccountNotFound=Error: Bank account not found
|
||||
FiscalPeriod=Accounting period
|
||||
ListSocialContributionAssociatedProject=List of social contributions associated with the project
|
||||
|
||||
@ -44,6 +44,7 @@ GoToInterest=%s will go towards INTEREST
|
||||
GoToPrincipal=%s will go towards PRINCIPAL
|
||||
YouWillSpend=You will spend %s in year %s
|
||||
ListLoanAssociatedProject=List of loan associated with the project
|
||||
AddLoan=Create loan
|
||||
# Admin
|
||||
ConfigLoan=Configuration of the module loan
|
||||
LOAN_ACCOUNTING_ACCOUNT_CAPITAL=Accounting account capital by default
|
||||
|
||||
@ -62,16 +62,19 @@ DeStockOnShipment=Decrease real stocks on shipping validation
|
||||
DeStockOnShipmentOnClosing=Decrease real stocks on shipping classification closed
|
||||
ReStockOnBill=Increase real stocks on suppliers invoices/credit notes validation
|
||||
ReStockOnValidateOrder=Increase real stocks on suppliers orders approbation
|
||||
ReStockOnDispatchOrder=Increase real stocks on manual dispatching into warehouses, after supplier order receiving
|
||||
ReStockOnDispatchOrder=Increase real stocks on manual dispatching into warehouses, after supplier order receipt of goods
|
||||
OrderStatusNotReadyToDispatch=Order has not yet or no more a status that allows dispatching of products in stock warehouses.
|
||||
StockDiffPhysicTeoric=Explanation for difference between physical and theoretical stock
|
||||
StockDiffPhysicTeoric=Explanation for difference between physical and virtual stock
|
||||
NoPredefinedProductToDispatch=No predefined products for this object. So no dispatching in stock is required.
|
||||
DispatchVerb=Dispatch
|
||||
StockLimitShort=Limit for alert
|
||||
StockLimit=Stock limit for alert
|
||||
PhysicalStock=Physical stock
|
||||
RealStock=Real Stock
|
||||
RealStockDesc=Physical or real stock is the stock you currently have into your internal warehouses/emplacements.
|
||||
RealStockWillAutomaticallyWhen=The real stock will automatically change according to this rules (see stock module setup to change this):
|
||||
VirtualStock=Virtual stock
|
||||
VirtualStockDesc=Virtual stock is the stock you will get once all opened pending actions that affect stocks will be closed (supplier order received, customer order shipped, ...)
|
||||
IdWarehouse=Id warehouse
|
||||
DescWareHouse=Description warehouse
|
||||
LieuWareHouse=Localisation warehouse
|
||||
|
||||
@ -126,10 +126,7 @@ $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_lot as pl on pl.fk_product = p.rowi
|
||||
if ($search_categ) $sql.= ", ".MAIN_DB_PREFIX."categorie_product as cp";
|
||||
$sql.= " WHERE p.entity IN (".getEntity('product', 1).")";
|
||||
if ($search_categ) $sql.= " AND p.rowid = cp.fk_product"; // Join for the needed table to filter by categ
|
||||
if ($sall)
|
||||
{
|
||||
$sql.= " AND (p.ref LIKE '%".$db->escape($sall)."%' OR p.label LIKE '%".$db->escape($sall)."%' OR p.description LIKE '%".$db->escape($sall)."%' OR p.note LIKE '%".$db->escape($sall)."%')";
|
||||
}
|
||||
if ($sall) $sql.=natural_search(array('p.ref','p.label','p.description','p.note'), $sall);
|
||||
// if the type is not 1, we show all products (type = 0,2,3)
|
||||
if (dol_strlen($type))
|
||||
{
|
||||
@ -163,6 +160,12 @@ $sql.= " pb.batch, pb.eatby, pb.sellby,";
|
||||
$sql.= " pl.eatby, pl.sellby";
|
||||
if ($toolowstock) $sql.= " HAVING SUM(".$db->ifsql('ps.reel IS NULL', '0', 'ps.reel').") < p.seuil_stock_alerte"; // Not used yet
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
$sql.= $db->plimit($limit + 1, $offset);
|
||||
$resql = $db->query($sql);
|
||||
|
||||
@ -193,11 +196,11 @@ if ($resql)
|
||||
|
||||
if ($sref || $snom || $sall || GETPOST('search'))
|
||||
{
|
||||
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], "&sref=".$sref."&snom=".$snom."&sall=".$sall."&tosell=".$tosell."&tobuy=".$tobuy, $sortfield, $sortorder,'',$num, 0, 'title_products');
|
||||
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], "&sref=".$sref."&snom=".$snom."&sall=".$sall."&tosell=".$tosell."&tobuy=".$tobuy, $sortfield, $sortorder,'',$num, $nbtotalofrecords, 'title_products');
|
||||
}
|
||||
else
|
||||
{
|
||||
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":""), $sortfield, $sortorder,'',$num, 0, 'title_products');
|
||||
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":""), $sortfield, $sortorder,'',$num, $nbtotalofrecords, 'title_products');
|
||||
}
|
||||
|
||||
if (! empty($catid))
|
||||
|
||||
@ -277,7 +277,7 @@ class MouvementStock extends CommonObject
|
||||
|
||||
// Check if stock is enough when qty is < 0
|
||||
// Note that qty should be > 0 with type 0 or 3, < 0 with type 1 or 2.
|
||||
if ($qty < 0 && empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER))
|
||||
if ($movestock && $qty < 0 && empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER))
|
||||
{
|
||||
if (! empty($conf->productbatch->enabled) && $product->hasbatch() && ! $skip_batch)
|
||||
{
|
||||
@ -292,6 +292,7 @@ class MouvementStock extends CommonObject
|
||||
}
|
||||
if (! $foundforbatch || $qtyisnotenough)
|
||||
{
|
||||
$langs->load("stocks");
|
||||
$this->error = $langs->trans('qtyToTranferLotIsNotEnough');
|
||||
$this->errors[] = $langs->trans('qtyToTranferLotIsNotEnough');
|
||||
$this->db->rollback();
|
||||
@ -302,6 +303,7 @@ class MouvementStock extends CommonObject
|
||||
{
|
||||
if (empty($product->stock_warehouse[$entrepot_id]->real) || $product->stock_warehouse[$entrepot_id]->real < abs($qty))
|
||||
{
|
||||
$langs->load("stocks");
|
||||
$this->error = $langs->trans('qtyToTranferIsNotEnough');
|
||||
$this->errors[] = $langs->trans('qtyToTranferIsNotEnough');
|
||||
$this->db->rollback();
|
||||
|
||||
@ -438,6 +438,35 @@ class Productlot extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return label of status of object
|
||||
*
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
function getLibStatut($mode=0)
|
||||
{
|
||||
return $this->LibStatut(0,$mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return label of a given status
|
||||
*
|
||||
* @param int $statut Status
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
//$langs->load('stocks');
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return a link to the a lot card (with optionaly the picto)
|
||||
* Use this->id,this->lastname, this->firstname
|
||||
|
||||
@ -95,7 +95,7 @@ $arrayfields=array(
|
||||
'm.batch'=>array('label'=>$langs->trans("BatchNumberShort"), 'checked'=>1, 'enabled'=>(! empty($conf->productbatch->enabled))),
|
||||
'pl.eatby'=>array('label'=>$langs->trans("EatByDate"), 'checked'=>0, 'enabled'=>(! empty($conf->productbatch->enabled))),
|
||||
'pl.sellby'=>array('label'=>$langs->trans("SellByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(! empty($conf->productbatch->enabled))),
|
||||
'm.warehouse'=>array('label'=>$langs->trans("Warehouse"), 'checked'=>1, 'enabled'=>(! $id > 0)), // If we are on specific warehouse, we hide it
|
||||
'e.label'=>array('label'=>$langs->trans("Warehouse"), 'checked'=>1, 'enabled'=>(! $id > 0)), // If we are on specific warehouse, we hide it
|
||||
'm.fk_user_author'=>array('label'=>$langs->trans("Author"), 'checked'=>0),
|
||||
'm.inventorycode'=>array('label'=>$langs->trans("InventoryCodeShort"), 'checked'=>1),
|
||||
'm.label'=>array('label'=>$langs->trans("LabelMovement"), 'checked'=>1),
|
||||
@ -665,6 +665,7 @@ if ($resql)
|
||||
if ($search_inventorycode) $param.='&search_inventorycode='.urlencode($search_inventorycode);
|
||||
if ($search_product_ref) $param.='&search_product_ref='.urlencode($search_product_ref);
|
||||
if ($search_product) $param.='&search_product='.urlencode($search_product);
|
||||
if ($search_batch) $param.='&search_batch='.urlencode($search_batch);
|
||||
if ($search_warehouse > 0) $param.='&search_warehouse='.urlencode($search_warehouse);
|
||||
if (!empty($sref)) $param.='&sref='.urlencode($sref); // FIXME $sref is not defined
|
||||
if (!empty($snom)) $param.='&snom='.urlencode($snom); // FIXME $snom is not defined
|
||||
@ -735,7 +736,7 @@ if ($resql)
|
||||
if (! empty($arrayfields['m.batch']['checked'])) print_liste_field_titre($arrayfields['m.batch']['label'],$_SERVER["PHP_SELF"],'m.batch','',$param,'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['pl.eatby']['checked'])) print_liste_field_titre($arrayfields['pl.eatby']['label'],$_SERVER["PHP_SELF"],'pl.eatby','',$param,'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['pl.sellby']['checked'])) print_liste_field_titre($arrayfields['pl.sellby']['label'],$_SERVER["PHP_SELF"],'pl.sellby','',$param,'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['m.warehouse']['checked'])) print_liste_field_titre($arrayfields['m.warehouse']['label'],$_SERVER["PHP_SELF"], "","",$param,"",$sortfield,$sortorder); // We are on a specific warehouse card, no filter on other should be possible
|
||||
if (! empty($arrayfields['e.label']['checked'])) print_liste_field_titre($arrayfields['e.label']['label'],$_SERVER["PHP_SELF"], "e.label","",$param,"",$sortfield,$sortorder); // We are on a specific warehouse card, no filter on other should be possible
|
||||
if (! empty($arrayfields['m.fk_user_author']['checked'])) print_liste_field_titre($arrayfields['m.fk_user_author']['label'],$_SERVER["PHP_SELF"], "m.fk_user_author","",$param,"",$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['m.inventorycode']['checked'])) print_liste_field_titre($arrayfields['m.inventorycode']['label'],$_SERVER["PHP_SELF"], "m.inventorycode","",$param,"",$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['m.label']['checked'])) print_liste_field_titre($arrayfields['m.label']['label'],$_SERVER["PHP_SELF"], "m.label","",$param,"",$sortfield,$sortorder);
|
||||
@ -799,7 +800,7 @@ if ($resql)
|
||||
// Batch
|
||||
if (! empty($arrayfields['m.batch']['checked']))
|
||||
{
|
||||
print '<td align="center"><input class="flat" type="text" size="5" name="search_batch" value="'.dol_escape_htmltag($search_batch).'"></td>';
|
||||
print '<td class="liste_titre" align="center"><input class="flat" type="text" size="5" name="search_batch" value="'.dol_escape_htmltag($search_batch).'"></td>';
|
||||
}
|
||||
if (! empty($arrayfields['pl.eatby']['checked']))
|
||||
{
|
||||
@ -812,7 +813,7 @@ if ($resql)
|
||||
print '</td>';
|
||||
}
|
||||
// Warehouse
|
||||
if (! empty($arrayfields['m.warehouse']['checked']))
|
||||
if (! empty($arrayfields['e.label']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre maxwidthonsmartphone" align="left">';
|
||||
//print '<input class="flat" type="text" size="8" name="search_warehouse" value="'.($search_warehouse).'">';
|
||||
@ -974,7 +975,7 @@ if ($resql)
|
||||
print '<td align="center">'. dol_print_date($objp->sellby,'day') .'</td>';
|
||||
}
|
||||
// Warehouse
|
||||
if (! empty($arrayfields['m.warehouse']['checked']))
|
||||
if (! empty($arrayfields['e.label']['checked']))
|
||||
{
|
||||
print '<td>';
|
||||
print $warehousestatic->getNomUrl(1);
|
||||
|
||||
@ -110,7 +110,7 @@ $parameters=array('id'=>$id, 'ref'=>$ref, 'objcanvas'=>$objcanvas);
|
||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
if($action == 'addlimitstockwarehouse') {
|
||||
if ($action == 'addlimitstockwarehouse') {
|
||||
|
||||
$seuil_stock_alerte = GETPOST('seuil_stock_alerte');
|
||||
$desiredstock = GETPOST('desiredstock');
|
||||
@ -625,7 +625,8 @@ if ($id > 0 || $ref)
|
||||
print '</td></tr>';
|
||||
|
||||
// Real stock
|
||||
$text_stock_options = '';
|
||||
$text_stock_options = $langs->trans("RealStockDesc").'<br>';
|
||||
$text_stock_options.= $langs->trans("RealStockWillAutomaticallyWhen").'<br>';
|
||||
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)?$langs->trans("DeStockOnShipment").'<br>':'');
|
||||
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER)?$langs->trans("DeStockOnValidateOrder").'<br>':'');
|
||||
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_BILL)?$langs->trans("DeStockOnBill").'<br>':'');
|
||||
@ -642,57 +643,55 @@ if ($id > 0 || $ref)
|
||||
|
||||
$stocktheo = price2num($object->stock_theorique, 'MS');
|
||||
|
||||
$found=0;
|
||||
$helpondiff='<strong>'.$langs->trans("StockDiffPhysicTeoric").':</strong><br>';
|
||||
// Number of customer orders running
|
||||
if (! empty($conf->commande->enabled))
|
||||
{
|
||||
if ($found) $helpondiff.='<br>'; else $found=1;
|
||||
$helpondiff.=$langs->trans("ProductQtyInCustomersOrdersRunning").': '.$object->stats_commande['qty'];
|
||||
$result=$object->load_stats_commande(0,'0');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
$helpondiff.=' ('.$langs->trans("ProductQtyInDraft").': '.$object->stats_commande['qty'].')';
|
||||
}
|
||||
|
||||
// Number of product from customer order already sent (partial shipping)
|
||||
if (! empty($conf->expedition->enabled))
|
||||
{
|
||||
if ($found) $helpondiff.='<br>'; else $found=1;
|
||||
$result=$object->load_stats_sending(0,'2');
|
||||
$helpondiff.=$langs->trans("ProductQtyInShipmentAlreadySent").': '.$object->stats_expedition['qty'];
|
||||
}
|
||||
|
||||
// Number of supplier order running
|
||||
if (! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
if ($found) $helpondiff.='<br>'; else $found=1;
|
||||
$result=$object->load_stats_commande_fournisseur(0,'3,4');
|
||||
$helpondiff.=$langs->trans("ProductQtyInSuppliersOrdersRunning").': '.$object->stats_commande_fournisseur['qty'];
|
||||
$result=$object->load_stats_commande_fournisseur(0,'0,1,2');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
$helpondiff.=' ('.$langs->trans("ProductQtyInDraftOrWaitingApproved").': '.$object->stats_commande_fournisseur['qty'].')';
|
||||
}
|
||||
|
||||
// Number of product from supplier order already received (partial receipt)
|
||||
if (! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
if ($found) $helpondiff.='<br>'; else $found=1;
|
||||
$helpondiff.=$langs->trans("ProductQtyInSuppliersShipmentAlreadyRecevied").': '.$object->stats_reception['qty'];
|
||||
}
|
||||
|
||||
// Calculating a theorical value
|
||||
print '<tr><td>'.$langs->trans("VirtualStock").'</td>';
|
||||
print "<td>".(empty($stocktheo)?0:$stocktheo);
|
||||
print '<tr><td>';
|
||||
print $form->textwithpicto($langs->trans("VirtualStock"), $langs->trans("VirtualStockDesc"));
|
||||
print '</td>';
|
||||
print "<td>";
|
||||
//print (empty($stocktheo)?0:$stocktheo);
|
||||
print $form->textwithpicto((empty($stocktheo)?0:$stocktheo), $helpondiff);
|
||||
if ($object->seuil_stock_alerte != '' && ($object->stock_theorique < $object->seuil_stock_alerte)) print ' '.img_warning($langs->trans("StockLowerThanLimit"));
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td>';
|
||||
print $langs->trans("StockDiffPhysicTeoric");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
|
||||
$found=0;
|
||||
// Number of customer orders running
|
||||
if (! empty($conf->commande->enabled))
|
||||
{
|
||||
if ($found) print '<br>'; else $found=1;
|
||||
print $langs->trans("ProductQtyInCustomersOrdersRunning").': '.$object->stats_commande['qty'];
|
||||
$result=$object->load_stats_commande(0,'0');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
print ' ('.$langs->trans("ProductQtyInDraft").': '.$object->stats_commande['qty'].')';
|
||||
}
|
||||
|
||||
// Number of product from customer order already sent (partial shipping)
|
||||
if (! empty($conf->expedition->enabled))
|
||||
{
|
||||
if ($found) print '<br>'; else $found=1;
|
||||
$result=$object->load_stats_sending(0,'2');
|
||||
print $langs->trans("ProductQtyInShipmentAlreadySent").': '.$object->stats_expedition['qty'];
|
||||
}
|
||||
|
||||
// Number of supplier order running
|
||||
if (! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
if ($found) print '<br>'; else $found=1;
|
||||
$result=$object->load_stats_commande_fournisseur(0,'3,4');
|
||||
print $langs->trans("ProductQtyInSuppliersOrdersRunning").': '.$object->stats_commande_fournisseur['qty'];
|
||||
$result=$object->load_stats_commande_fournisseur(0,'0,1,2');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
print ' ('.$langs->trans("ProductQtyInDraftOrWaitingApproved").': '.$object->stats_commande_fournisseur['qty'].')';
|
||||
}
|
||||
|
||||
// Number of product from supplier order already received (partial receipt)
|
||||
if (! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
if ($found) print '<br>'; else $found=1;
|
||||
print $langs->trans("ProductQtyInSuppliersShipmentAlreadyRecevied").': '.$object->stats_reception['qty'];
|
||||
}
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
// Last movement
|
||||
$sql = "SELECT max(m.datem) as datem";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."stock_mouvement as m";
|
||||
|
||||
@ -270,24 +270,6 @@ llxHeader('','ProductLot','');
|
||||
$form=new Form($db);
|
||||
|
||||
|
||||
// Put here content of your page
|
||||
|
||||
// Example : Adding jquery code
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
function init_myfunc()
|
||||
{
|
||||
jQuery("#myid").removeAttr(\'disabled\');
|
||||
jQuery("#myid").attr(\'disabled\',\'disabled\');
|
||||
}
|
||||
init_myfunc();
|
||||
jQuery("#mybutton").click(function() {
|
||||
init_myfunc();
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
|
||||
|
||||
// Part to create
|
||||
if ($action == 'create')
|
||||
{
|
||||
@ -335,19 +317,18 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print $formconfirm;
|
||||
}
|
||||
|
||||
print '<table class="border centpercent">'."\n";
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/product/stock/productlot_list.php' . '">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
// Ref
|
||||
print '<tr><td class="titlefield">' . $langs->trans('Batch') . '</td>';
|
||||
print '<td colspan="3">';
|
||||
print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'batch');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'batch');
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border centpercent">'."\n";
|
||||
|
||||
// Product
|
||||
print '<tr><td>'.$langs->trans("Product").'</td><td>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Product").'</td><td>';
|
||||
$producttmp = new Product($db);
|
||||
$producttmp->fetch($object->fk_product);
|
||||
print $producttmp->getNomUrl(1, 'stock');
|
||||
@ -356,7 +337,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
// Eat by
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey($langs->trans('Eatby'), 'eatby', $object->eatby, $object, $user->rights->stock->creer, 'datepicker');
|
||||
print '</td><td colspan="5">';
|
||||
print '</td><td>';
|
||||
print $form->editfieldval($langs->trans('Eatby'), 'eatby', $object->eatby, $object, $user->rights->stock->creer, 'datepicker');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@ -364,7 +345,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
// Sell by
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey($langs->trans('Sellby'), 'sellby', $object->sellby, $object, $user->rights->stock->creer, 'datepicker');
|
||||
print '</td><td colspan="5">';
|
||||
print '</td><td>';
|
||||
print $form->editfieldval($langs->trans('Sellby'), 'sellby', $object->sellby, $object, $user->rights->stock->creer, 'datepicker');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@ -375,6 +356,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
|
||||
@ -53,6 +53,8 @@ $type = GETPOST('type','int');
|
||||
$tobuy = GETPOST('tobuy', 'int');
|
||||
$salert = GETPOST('salert', 'alpha');
|
||||
$mode = GETPOST('mode','alpha');
|
||||
$draftorder = GETPOST('draftorder','alpha');
|
||||
|
||||
|
||||
$fourn_id = GETPOST('fourn_id','int');
|
||||
$fk_supplier = GETPOST('fk_supplier','int');
|
||||
@ -96,7 +98,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
|
||||
$snom = '';
|
||||
$sal = '';
|
||||
$salert = '';
|
||||
$draftorder='';
|
||||
}
|
||||
if($draftorder == 'on') $draftchecked = "checked";
|
||||
|
||||
// Create orders
|
||||
if ($action == 'order' && isset($_POST['valid']))
|
||||
@ -421,6 +425,7 @@ print '<input type="hidden" name="action" value="filter">';
|
||||
print '<input type="hidden" name="sref" value="'.$sref.'">';
|
||||
print '<input type="hidden" name="snom" value="'.$snom.'">';
|
||||
print '<input type="hidden" name="salert" value="'.$salert.'">';
|
||||
print '<input type="hidden" name="draftorder" value="'.$draftorder.'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
print '<div class="inline-block valignmiddle" style="padding-right: 20px;">';
|
||||
print $langs->trans('Warehouse').' '.$formproduct->selectWarehouses($fk_entrepot, 'fk_entrepot', '', 1);
|
||||
@ -433,10 +438,11 @@ print '<input class="button" type="submit" name="valid" value="'.$langs->trans('
|
||||
print '</div>';
|
||||
print '</form>';
|
||||
|
||||
if ($sref || $snom || $sall || $salert || GETPOST('search', 'alpha')) {
|
||||
if ($sref || $snom || $sall || $salert || $draftorder || GETPOST('search', 'alpha')) {
|
||||
$filters = '&sref=' . $sref . '&snom=' . $snom;
|
||||
$filters .= '&sall=' . $sall;
|
||||
$filters .= '&salert=' . $salert;
|
||||
$filters .= '&draftorder=' . $draftorder;
|
||||
$filters .= '&mode=' . $mode;
|
||||
$filters .= '&fk_supplier=' . $fk_supplier;
|
||||
$filters .= '&fk_entrepot=' . $fk_entrepot;
|
||||
@ -455,6 +461,7 @@ if ($sref || $snom || $sall || $salert || GETPOST('search', 'alpha')) {
|
||||
$filters .= '&fourn_id=' . $fourn_id;
|
||||
$filters .= (isset($type)?'&type=' . $type:'');
|
||||
$filters .= '&=' . $salert;
|
||||
$filters .= '&draftorder=' . $draftorder;
|
||||
$filters .= '&mode=' . $mode;
|
||||
$filters .= '&fk_supplier=' . $fk_supplier;
|
||||
$filters .= '&fk_entrepot=' . $fk_entrepot;
|
||||
@ -473,7 +480,7 @@ if ($sref || $snom || $sall || $salert || GETPOST('search', 'alpha')) {
|
||||
print '<table class="liste" width="100%">';
|
||||
|
||||
$param = (isset($type)? '&type=' . $type : '');
|
||||
$param .= '&fourn_id=' . $fourn_id . '&snom='. $snom . '&salert=' . $salert;
|
||||
$param .= '&fourn_id=' . $fourn_id . '&snom='. $snom . '&salert=' . $salert . '&draftorder='.$draftorder;
|
||||
$param .= '&sref=' . $sref;
|
||||
$param .= '&mode=' . $mode;
|
||||
$param .= '&fk_supplier=' . $fk_supplier;
|
||||
@ -517,7 +524,7 @@ if (!empty($conf->service->enabled) && $type == 1) print '<td class="liste_titre
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="right"> </td>';
|
||||
print '<td class="liste_titre" align="right">' . $langs->trans('AlertOnly') . ' <input type="checkbox" id="salert" name="salert" ' . (!empty($alertchecked)?$alertchecked:'') . '></td>';
|
||||
print '<td class="liste_titre" align="right"> </td>';
|
||||
print '<td class="liste_titre" align="right">' . $langs->trans('Draft') . ' <input type="checkbox" id="draftorder" name="draftorder" ' . (!empty($draftchecked)?$draftchecked:'') . '></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||
@ -567,7 +574,12 @@ while ($i < ($limit ? min($num, $limit) : $num))
|
||||
}
|
||||
|
||||
// Force call prod->load_stats_xxx to choose status to count (otherwise it is loaded by load_stock function)
|
||||
$result=$prod->load_stats_commande_fournisseur(0,'1,2,3,4');
|
||||
if(isset($draftchecked)){
|
||||
$result=$prod->load_stats_commande_fournisseur(0,'0,1,2,3,4');
|
||||
}else {
|
||||
$result=$prod->load_stats_commande_fournisseur(0,'1,2,3,4');
|
||||
}
|
||||
|
||||
$result=$prod->load_stats_reception(0,'4');
|
||||
|
||||
//print $prod->stats_commande_fournisseur['qty'].'<br>'."\n";
|
||||
@ -654,11 +666,12 @@ print '</table>';
|
||||
|
||||
if ($num > $conf->liste_limit)
|
||||
{
|
||||
if ($sref || $snom || $sall || $salert || GETPOST('search', 'alpha'))
|
||||
if ($sref || $snom || $sall || $salert || $draftorder || GETPOST('search', 'alpha'))
|
||||
{
|
||||
$filters = '&sref=' . $sref . '&snom=' . $snom;
|
||||
$filters .= '&sall=' . $sall;
|
||||
$filters .= '&salert=' . $salert;
|
||||
$filters .= '&draftorder=' . $draftorder;
|
||||
$filters .= '&mode=' . $mode;
|
||||
$filters .= '&fk_supplier=' . $fk_supplier;
|
||||
$filters .= '&fk_entrepot=' . $fk_entrepot;
|
||||
@ -670,6 +683,7 @@ if ($num > $conf->liste_limit)
|
||||
$filters .= '&fourn_id=' . $fourn_id;
|
||||
$filters .= (isset($type)? '&type=' . $type : '');
|
||||
$filters .= '&salert=' . $salert;
|
||||
$filters .= '&draftorder=' . $draftorder;
|
||||
$filters .= '&mode=' . $mode;
|
||||
$filters .= '&fk_supplier=' . $fk_supplier;
|
||||
$filters .= '&fk_entrepot=' . $fk_entrepot;
|
||||
|
||||
@ -21,12 +21,14 @@
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE STOCKCORRECTION.TPL.PHP -->
|
||||
<?php
|
||||
|
||||
$productref = '';
|
||||
if ($object->element == 'product') $productref = $object->ref;
|
||||
|
||||
$langs->load("productbatch");
|
||||
|
||||
if (empty($id)) $id = $object->id;
|
||||
|
||||
if (empty($id)) $id = $object->id;
|
||||
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
@ -46,6 +48,9 @@
|
||||
print load_fiche_titre($langs->trans("StockCorrection"),'','title_generic.png');
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="post">'."\n";
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="correct_stock">';
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
@ -127,12 +132,14 @@
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="save" value="'.dol_escape_htmltag($langs->trans('Save')).'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
?>
|
||||
<!-- END PHP STOCKCORRECTION.TPL.PHP -->
|
||||
|
||||
@ -48,6 +48,9 @@
|
||||
print load_fiche_titre($langs->trans("StockTransfer"),'','title_generic.png');
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="post">'."\n";
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="transfert_stock">';
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
@ -123,6 +126,8 @@
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans('Save')).'">';
|
||||
print ' ';
|
||||
|
||||
@ -244,8 +244,9 @@ if ($action == 'edit')
|
||||
foreach ($object->multilangs as $key => $value)
|
||||
{
|
||||
$s=picto_from_langcode($key);
|
||||
print "<br>".($s?$s.' ':'')." <b>".$langs->trans('Language_'.$key).":</b> ".'<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&langtodelete='.$key.'">'.img_delete('', '')."</a><br>";
|
||||
print "<br>".($s?$s.' ':'')." <b>".$langs->trans('Language_'.$key).":</b> ".'<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&langtodelete='.$key.'">'.img_delete('', 'class="valigntextbottom"')."</a><br>";
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td class="tdtop titlefieldcreate fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle-'.$key.'" size="40" value="'.$object->multilangs[$key]["label"].'"></td></tr>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
|
||||
@ -263,6 +264,8 @@ if ($action == 'edit')
|
||||
}
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
@ -274,17 +277,20 @@ if ($action == 'edit')
|
||||
}
|
||||
else if ($action != 'add')
|
||||
{
|
||||
if ($cnt_trans) print '<div class="underbanner clearboth"></div>';
|
||||
//if ($cnt_trans) print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
if (! empty($object->multilangs))
|
||||
{
|
||||
foreach ($object->multilangs as $key => $value)
|
||||
{
|
||||
$s=picto_from_langcode($key);
|
||||
//print '<tr><td>';
|
||||
print ($s?$s.' ':'')." <b>".$langs->trans('Language_'.$key).":</b> ".'<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&langtodelete='.$key.'">'.img_delete('', 'class="valigntextbottom"').'</a>';
|
||||
//print '</td><td></td></tr>';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="2">'.($s?$s.' ':'')." <b>".$langs->trans('Language_'.$key).":</b> ".'<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&langtodelete='.$key.'">'.img_delete('', '').'</a></td></tr>';
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans('Label').'</td><td>'.$object->multilangs[$key]["label"].'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Description').'</td><td>'.$object->multilangs[$key]["description"].'</td></tr>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>'.$object->multilangs[$key]["description"].'</td></tr>';
|
||||
if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('Other').' ('.$langs->trans("NotUsed").')</td><td>'.$object->multilangs[$key]["other"].'</td></tr>';
|
||||
@ -312,6 +318,8 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service
|
||||
print '<input type="hidden" name="action" value="vadd">';
|
||||
print '<input type="hidden" name="id" value="'.GETPOST("id",'int').'">';
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td class="tdtop titlefieldcreate fieldrequired">'.$langs->trans('Language').'</td><td>';
|
||||
print $formadmin->select_language('','forcelangprod',0,$object->multilangs,1);
|
||||
@ -331,7 +339,9 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
print '<br><div class="center">';
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
|
||||
@ -595,6 +595,7 @@ if ($action == 'create' && $user->rights->projet->creer)
|
||||
// Categories
|
||||
print '<tr><td>'.$langs->trans("Categories").'</td><td colspan="3">';
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1);
|
||||
$arrayselected=GETPOST('categories', 'array');
|
||||
print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, '100%');
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2015-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2016 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||
*
|
||||
@ -34,25 +34,27 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
|
||||
if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
|
||||
if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
if (! empty($conf->supplier_proposal->enabled)) require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
|
||||
if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
||||
if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
||||
if (! empty($conf->ficheinter->enabled)) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
|
||||
if (! empty($conf->deplacement->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';
|
||||
if (! empty($conf->expensereport->enabled)) require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
||||
if (! empty($conf->agenda->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
if (! empty($conf->don->enabled)) require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
|
||||
if (! empty($conf->loan->enabled)) require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php';
|
||||
if (! empty($conf->stock->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
||||
if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
||||
if (! empty($conf->ficheinter->enabled)) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
|
||||
if (! empty($conf->deplacement->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';
|
||||
if (! empty($conf->expensereport->enabled)) require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
||||
if (! empty($conf->agenda->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
if (! empty($conf->don->enabled)) require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
|
||||
if (! empty($conf->loan->enabled)) require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php';
|
||||
if (! empty($conf->stock->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
if (! empty($conf->tax->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
|
||||
|
||||
$langs->load("projects");
|
||||
$langs->load("companies");
|
||||
$langs->load("suppliers");
|
||||
$langs->load("compta");
|
||||
if (! empty($conf->facture->enabled)) $langs->load("bills");
|
||||
if (! empty($conf->commande->enabled)) $langs->load("orders");
|
||||
if (! empty($conf->propal->enabled)) $langs->load("propal");
|
||||
@ -406,7 +408,20 @@ $listofreferent=array(
|
||||
'table'=>'stock_mouvement',
|
||||
'datefieldname'=>'datem',
|
||||
'disableamount'=>0,
|
||||
'test'=>$conf->stock->enabled && $user->rights->stock->mouvement->lire),
|
||||
'test'=>($conf->stock->enabled && $user->rights->stock->mouvement->lire && ! empty($conf->global->STOCK_MOVEMENT_INTO_PROJECT_OVERVIEW))),
|
||||
'chargesociales'=>array(
|
||||
'name'=>"SocialContribution",
|
||||
'title'=>"ListSocialContributionAssociatedProject",
|
||||
'class'=>'ChargeSociales',
|
||||
'margin'=>'add',
|
||||
'table'=>'chargesociales',
|
||||
'datefieldname'=>'date_ech',
|
||||
'disableamount'=>0,
|
||||
'urlnew'=>DOL_URL_ROOT.'/compta/sociales/card.php?action=create&projectid='.$id,
|
||||
'lang'=>'compta',
|
||||
'buttonnew'=>'AddSocialContribution',
|
||||
'testnew'=>$user->rights->tax->charges->lire,
|
||||
'test'=>$conf->tax->enabled && $user->rights->tax->charges->lire)
|
||||
/* No need for this, available on dedicated tab "Agenda/Events"
|
||||
'agenda'=>array(
|
||||
'name'=>"Agenda",
|
||||
@ -539,7 +554,7 @@ foreach ($listofreferent as $key => $value)
|
||||
|
||||
// Special cases
|
||||
if ($tablename != 'expensereport_det' && method_exists($element, 'fetch_thirdparty')) $element->fetch_thirdparty();
|
||||
if ($tablename == 'don') $total_ht_by_line=$element->amount;
|
||||
if ($tablename == 'don' || $tablename == 'chargesociales') $total_ht_by_line=$element->amount;
|
||||
elseif ($tablename == 'stock_mouvement') $total_ht_by_line=$element->price*abs($element->qty);
|
||||
elseif ($tablename == 'projet_task')
|
||||
{
|
||||
@ -564,7 +579,7 @@ foreach ($listofreferent as $key => $value)
|
||||
|
||||
if ($qualifiedfortotal) $total_ht = $total_ht + $total_ht_by_line;
|
||||
|
||||
if ($tablename == 'don') $total_ttc_by_line=$element->amount;
|
||||
if ($tablename == 'don' || $tablename == 'chargesociales') $total_ttc_by_line=$element->amount;
|
||||
elseif ($tablename == 'stock_mouvement') $total_ttc_by_line=$element->price*abs($element->qty);
|
||||
elseif ($tablename == 'projet_task')
|
||||
{
|
||||
@ -865,9 +880,10 @@ foreach ($listofreferent as $key => $value)
|
||||
$date=''; $total_time_by_line = null;
|
||||
if ($tablename == 'expensereport_det') $date = $element->date; // No draft status on lines
|
||||
elseif ($tablename == 'stock_mouvement') $date = $element->datem;
|
||||
if ($tablename == 'chargesociales') $date = $element->date_ech;
|
||||
elseif (! empty($element->status) || ! empty($element->statut) || ! empty($element->fk_status))
|
||||
{
|
||||
if ($tablename=='don') $date = $element->datedon;
|
||||
if ($tablename == 'don') $date = $element->datedon;
|
||||
if ($tablename == 'commande_fournisseur' || $tablename == 'supplier_order')
|
||||
{
|
||||
$date=($element->date_commande?$element->date_commande:$element->date_valid);
|
||||
@ -927,7 +943,7 @@ foreach ($listofreferent as $key => $value)
|
||||
{
|
||||
$total_ht_by_line=null;
|
||||
$othermessage='';
|
||||
if ($tablename == 'don') $total_ht_by_line=$element->amount;
|
||||
if ($tablename == 'don' || $tablename == 'chargesociales') $total_ht_by_line=$element->amount;
|
||||
elseif ($tablename == 'stock_mouvement') $total_ht_by_line=$element->price*abs($element->qty);
|
||||
elseif (in_array($tablename, array('projet_task')))
|
||||
{
|
||||
@ -967,7 +983,7 @@ foreach ($listofreferent as $key => $value)
|
||||
if (empty($value['disableamount']))
|
||||
{
|
||||
$total_ttc_by_line=null;
|
||||
if ($tablename == 'don') $total_ttc_by_line=$element->amount;
|
||||
if ($tablename == 'don' || $tablename == 'chargesociales') $total_ttc_by_line=$element->amount;
|
||||
elseif ($tablename == 'stock_mouvement') $total_ttc_by_line=$element->price*abs($element->qty);
|
||||
elseif ($tablename == 'projet_task')
|
||||
{
|
||||
|
||||
@ -741,7 +741,7 @@ while ($i < min($num,$limit))
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Amount
|
||||
// Opp Amount
|
||||
if (! empty($arrayfields['p.opp_amount']['checked']))
|
||||
{
|
||||
print '<td align="right">';
|
||||
@ -754,6 +754,7 @@ while ($i < min($num,$limit))
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totaloppfield']=$totalarray['nbfield'];
|
||||
}
|
||||
// Opp Status
|
||||
if (! empty($arrayfields['p.fk_opp_status']['checked']))
|
||||
{
|
||||
print '<td align="middle">';
|
||||
@ -761,6 +762,7 @@ while ($i < min($num,$limit))
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Opp percent
|
||||
if (! empty($arrayfields['p.opp_percent']['checked']))
|
||||
{
|
||||
print '<td align="right">';
|
||||
@ -768,6 +770,7 @@ while ($i < min($num,$limit))
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Budget
|
||||
if (! empty($arrayfields['p.budget_amount']['checked']))
|
||||
{
|
||||
print '<td align="right">';
|
||||
|
||||
@ -359,14 +359,16 @@ if ($socid && $action != 'edit' && $action != "create")
|
||||
|
||||
print load_fiche_titre($langs->trans("DefaultRIB"), '', '');
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("LabelRIB").'</td>';
|
||||
print '<td colspan="4">'.$account->label.'</td></tr>';
|
||||
print '<td>'.$account->label.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("BankName").'</td>';
|
||||
print '<td colspan="4">'.$account->bank.'</td></tr>';
|
||||
print '<td>'.$account->bank.'</td></tr>';
|
||||
|
||||
// Show fields of bank account
|
||||
foreach($account->getFieldsToShow(1) as $val)
|
||||
@ -407,24 +409,24 @@ if ($socid && $action != 'edit' && $action != "create")
|
||||
}
|
||||
|
||||
print '<tr><td>'.$langs->trans($val).'</td>';
|
||||
print '<td colspan="4">'.$content.'</td>';
|
||||
print '<td>'.$content.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '<tr><td>'.$langs->trans("BankAccountDomiciliation").'</td><td colspan="4">';
|
||||
print '<tr><td>'.$langs->trans("BankAccountDomiciliation").'</td><td>';
|
||||
print $account->domiciliation;
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr><td>'.$langs->trans("BankAccountOwner").'</td><td colspan="4">';
|
||||
print '<tr><td>'.$langs->trans("BankAccountOwner").'</td><td>';
|
||||
print $account->proprio;
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr><td>'.$langs->trans("BankAccountOwnerAddress").'</td><td colspan="4">';
|
||||
print '<tr><td>'.$langs->trans("BankAccountOwnerAddress").'</td><td>';
|
||||
print $account->owner_address;
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
@ -611,7 +613,7 @@ if ($socid && $action != 'edit' && $action != "create")
|
||||
{
|
||||
$colspan=8;
|
||||
if (! empty($conf->prelevement->enabled)) $colspan+=2;
|
||||
print '<tr '.$bc[0].'><td colspan="'.$colspan.'" align="center">'.$langs->trans("NoBANRecord").'</td></tr>';
|
||||
print '<tr '.$bc[0].'><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoBANRecord").'</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -1514,13 +1514,13 @@ else
|
||||
// Ref/ID
|
||||
if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("ID").'</td><td colspan="3">';
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("ID").'</td><td colspan="3">';
|
||||
print $object->ref;
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Name
|
||||
print '<tr><td class="titlefield">'.fieldLabel('ThirdPartyName','name',1).'</td>';
|
||||
print '<tr><td class="titlefieldcreate">'.fieldLabel('ThirdPartyName','name',1).'</td>';
|
||||
print '<td colspan="3"><input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="'.dol_escape_htmltag($object->name).'" autofocus="autofocus"></td></tr>';
|
||||
|
||||
// Alias names (commercial, trademark or alias names)
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
print '<tr><td>';
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td>';
|
||||
print $langs->trans('SalesRepresentatives');
|
||||
print '<td><td align="right">';
|
||||
print '</td><td align="right">';
|
||||
if ($user->rights->societe->creer && $user->rights->societe->client->voir)
|
||||
print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$object->id.'">'.img_edit('',1).'</a>';
|
||||
else
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 326 B |
@ -100,7 +100,6 @@ $usegradienttop=(isset($conf->global->THEME_ELDY_TOPMENU_BACK1)?0:1);
|
||||
$usegradienttitle=(isset($conf->global->THEME_ELDY_BACKTITLE1)?0:1);
|
||||
$useboldtitle=(isset($conf->global->THEME_ELDY_USEBOLDTITLE)?$conf->global->THEME_ELDY_USEBOLDTITLE:1);
|
||||
$borderwith=2;
|
||||
$noborderline=0;
|
||||
|
||||
// Case of option always editable
|
||||
if (! isset($conf->global->THEME_ELDY_BACKBODY)) $conf->global->THEME_ELDY_BACKBODY=$colorbackbody;
|
||||
@ -261,24 +260,12 @@ input, input.flat, textarea, textarea.flat, form.flat select, select, select.fla
|
||||
background-color: #FFF;
|
||||
}
|
||||
|
||||
textarea:focus, button:focus {
|
||||
/* v6 box-shadow: 0 0 4px #8091BF; */
|
||||
border: 1px solid #aaa !important;
|
||||
}
|
||||
input:focus, select:focus {
|
||||
border-bottom: 1px solid #666;
|
||||
}
|
||||
input.select2-input {
|
||||
border-bottom: none ! important;
|
||||
}
|
||||
.select2-choice {
|
||||
border: none;
|
||||
border-bottom: 1px solid #aaa !important;
|
||||
}
|
||||
|
||||
textarea.cke_source:focus
|
||||
{
|
||||
box-shadow: none;
|
||||
border-bottom: solid 1px rgba(0,0,0,.2) !important; /* required to avoid to lose bottom line when focus is lost on select2. */
|
||||
}
|
||||
|
||||
.liste_titre input[name=month], .liste_titre input[name=month_lim] {
|
||||
@ -289,7 +276,7 @@ input, input.flat, textarea, textarea.flat, form.flat select, select, select.fla
|
||||
font-family: <?php print $fontlist ?>;
|
||||
|
||||
border: none;
|
||||
border-bottom: 1px solid #C0C0C0;
|
||||
border-bottom: solid 1px rgba(0,0,0,.2);
|
||||
outline: none;
|
||||
margin: 0px 0px 0px 0px;
|
||||
}
|
||||
@ -297,17 +284,33 @@ input {
|
||||
line-height: 17px;
|
||||
}
|
||||
input, select {
|
||||
border-bottom: solid 1px rgba(0,0,0,.2);
|
||||
|
||||
padding:4px;
|
||||
padding: 4px;
|
||||
margin-left:0px;
|
||||
margin-bottom:1px;
|
||||
margin-top:1px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Focus definitions must be after standard definition */
|
||||
textarea:focus, button:focus {
|
||||
/* v6 box-shadow: 0 0 4px #8091BF; */
|
||||
border: 1px solid #aaa !important;
|
||||
}
|
||||
input:focus, select:focus {
|
||||
border-bottom: 1px solid #666;
|
||||
}
|
||||
textarea.cke_source:focus
|
||||
{
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
select {
|
||||
/* padding: 4px 4px 2px 1px; */
|
||||
}
|
||||
textarea {
|
||||
border-radius: 0;
|
||||
border: solid 1px rgba(0,0,0,.3);
|
||||
border-top:solid 1px rgba(0,0,0,.3);
|
||||
border-top:solid 1px rgba(0,0,0,.2);
|
||||
border-left:solid 1px rgba(0,0,0,.2);
|
||||
border-right:solid 1px rgba(0,0,0,.2);
|
||||
border-bottom:solid 1px rgba(0,0,0,.2);
|
||||
|
||||
padding:4px;
|
||||
@ -375,7 +378,8 @@ input:-webkit-autofill {
|
||||
::-moz-placeholder { color:#bbb; } /* firefox 19+ */
|
||||
:-ms-input-placeholder { color:#ccc; } /* ie */
|
||||
input:-moz-placeholder { color:#ccc; }
|
||||
|
||||
input[name=weight], input[name=volume], input[name=surface], input[name=sizeheight] { margin-right: 6px; }
|
||||
input[name=surface] { margin-right: 4px; }
|
||||
fieldset { border: 1px solid #AAAAAA !important; }
|
||||
.legendforfieldsetstep { padding-bottom: 10px; }
|
||||
|
||||
@ -384,7 +388,7 @@ fieldset { border: 1px solid #AAAAAA !important; }
|
||||
border-color: #c5c5c5;
|
||||
border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
|
||||
display: inline-block;
|
||||
padding: 4px 14px;
|
||||
padding: 3px 14px;
|
||||
margin-bottom: 0;
|
||||
margin-top: 0;
|
||||
text-align: center;
|
||||
@ -476,6 +480,9 @@ th .button {
|
||||
.valignbottom {
|
||||
vertical-align: bottom;
|
||||
}
|
||||
.valigntextbottom {
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
.centpercent {
|
||||
width: 100%;
|
||||
}
|
||||
@ -919,8 +926,8 @@ div.fiche {
|
||||
|
||||
|
||||
div.fiche {
|
||||
margin-<?php print $left; ?>: <?php print (GETPOST("optioncss") == 'print'?6:($dol_hide_leftmenu?'6':'20')); ?>px;
|
||||
margin-<?php print $right; ?>: <?php print (GETPOST("optioncss") == 'print'?8:(empty($conf->dol_optimize_smallscreen)?'12':'6')); ?>px;
|
||||
margin-<?php print $left; ?>: <?php print (GETPOST("optioncss") == 'print'?6:($dol_hide_leftmenu?'6':'26')); ?>px;
|
||||
margin-<?php print $right; ?>: <?php print (GETPOST("optioncss") == 'print'?8:(empty($conf->dol_optimize_smallscreen)?'16':'6')); ?>px;
|
||||
<?php if (! empty($conf->dol_hide_leftmenu) && ! empty($conf->dol_hide_topmenu)) print 'margin-top: 4px;'."\n"; ?>
|
||||
<?php if (! empty($conf->dol_hide_leftmenu)) print 'margin-bottom: 12px;'."\n"; ?>
|
||||
}
|
||||
@ -1477,10 +1484,6 @@ form#login {
|
||||
-webkit-box-shadow: 0 2px 23px 2px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(60,60,60,0.15);
|
||||
box-shadow: 0 2px 23px 2px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(60,60,60,0.15);
|
||||
|
||||
/*-moz-box-shadow: 3px 2px 20px #CCC;
|
||||
-webkit-box-shadow: 3px 2px 20px #CCC;
|
||||
box-shadow: 3px 2px 20px #CCC;*/
|
||||
|
||||
border-radius: 5px;
|
||||
/*border-top:solid 1px rgba(180,180,180,.4);
|
||||
border-left:solid 1px rgba(180,180,180,.4);
|
||||
@ -2273,9 +2276,6 @@ tr.nocellnopadd td.nobordernopadding, tr.nocellnopadd td.nocellnopadd
|
||||
|
||||
|
||||
table.border, table.dataTable, .table-border, .table-border-col, .table-key-border-col, .table-val-border-col, div.border {
|
||||
<?php if (empty($noborderline)) { ?>
|
||||
border: 1px solid #E0E0E0;
|
||||
<?php } ?>
|
||||
border-collapse: collapse !important;
|
||||
padding: 1px 2px 1px 3px; /* t r b l */
|
||||
}
|
||||
@ -2295,18 +2295,14 @@ div .tdtop {
|
||||
}
|
||||
|
||||
table.border td, div.border div div.tagtd {
|
||||
<?php if (empty($noborderline)) { ?>
|
||||
padding: 2px 2px 2px 2px;
|
||||
border: 1px solid #E0E0E0;
|
||||
<?php } elseif ($noborderline == 1) { ?>
|
||||
padding: 3px 2px 3px 2px;
|
||||
border-bottom: 1px solid #E0E0E0;
|
||||
<?php } elseif ($noborderline == 2) { ?>
|
||||
padding: 3px 2px 3px 2px;
|
||||
/* border: 1px solid #E0E0E0; */
|
||||
<?php } ?>
|
||||
border-collapse: collapse;
|
||||
}
|
||||
div.tabBar .fichecenter table.border>tbody>tr>td, div.tabBar .fichecenter div.border div div.tagtd, div.tabBar div.border div div.tagtd
|
||||
{
|
||||
padding-top: 4px;
|
||||
border-bottom: 1px solid #E0E0E0;
|
||||
}
|
||||
|
||||
td.border, div.tagtable div div.border {
|
||||
border-top: 1px solid #000000;
|
||||
@ -2561,11 +2557,13 @@ div.pagination li.paginationafterarrows {
|
||||
|
||||
|
||||
|
||||
|
||||
/* Set the color for hover lines */
|
||||
.oddeven:hover, .odd:hover, .impair:hover, .even:hover, .pair:hover, .even:hover, .pair:hover, table.dataTable tr.even:hover, table.dataTable tr.odd:hover
|
||||
.oddeven:hover, .odd:hover, .impair:hover, .even:hover, .pair:hover, .even:hover, .pair:hover,
|
||||
table.dataTable tr.even:hover, table.dataTable tr.odd:hover
|
||||
{
|
||||
<?php if ($colorbacklinepairhover) { ?>
|
||||
background: rgb(<?php echo $colorbacklinepairhover; ?>) !important;
|
||||
background: rgb(<?php echo $colorbacklinepairhover; ?>) !important; /* Must be background to be stronger than background of odd or even */
|
||||
<?php } ?>
|
||||
}
|
||||
|
||||
@ -2580,7 +2578,7 @@ div.pagination li.paginationafterarrows {
|
||||
background: #<?php echo colorArrayToHex(colorStringToArray($colorbacklineimpair1)); ?>;
|
||||
}
|
||||
#GanttChartDIV {
|
||||
background: #<?php echo colorArrayToHex(colorStringToArray($colorbacklineimpair1)); ?>;
|
||||
background-color: #<?php echo colorArrayToHex(colorStringToArray($colorbacklineimpair1)); ?>;
|
||||
}
|
||||
|
||||
.oddeven, .even, .pair, .nohover .even:hover, .nohover .pair:hover, tr.even td.nohover, tr.pair td.nohover {
|
||||
@ -2597,7 +2595,7 @@ table.dataTable tr.odd, table.dataTable tr.oddeven {
|
||||
}
|
||||
|
||||
/* For no hover style */
|
||||
td.oddeven, table.nohover tr.impair, table.nohover tr.pair, table.nohover tr.impair td, table.nohover tr.pair td, tr.nohover td {
|
||||
td.oddeven, table.nohover tr.impair, table.nohover tr.pair, table.nohover tr.impair td, table.nohover tr.pair td, tr.nohover td, form.nohover, form.nohover:hover {
|
||||
background-color: #<?php echo colorArrayToHex(colorStringToArray($colorbacklineimpair1)); ?> !important;
|
||||
background: #<?php echo colorArrayToHex(colorStringToArray($colorbacklineimpair1)); ?> !important;
|
||||
}
|
||||
@ -2606,6 +2604,7 @@ tr.nohoverpair td {
|
||||
background: #<?php echo colorArrayToHex(colorStringToArray($colorbacklinepair1)); ?> !important;
|
||||
}
|
||||
|
||||
|
||||
table.dataTable td {
|
||||
padding: 5px 2px 5px 3px !important;
|
||||
}
|
||||
@ -2854,6 +2853,7 @@ span.dashboardlineko {
|
||||
}
|
||||
.boxtable {
|
||||
margin-bottom: 8px !important;
|
||||
border-bottom-width: 0 !important;
|
||||
}
|
||||
.tdboxstats {
|
||||
text-align: center;
|
||||
@ -3910,6 +3910,9 @@ div.dataTables_length select {
|
||||
/* Select2 */
|
||||
/* ============================================================================== */
|
||||
|
||||
.select2-choice, .select2-container .select2-choice {
|
||||
border-bottom: solid 1px rgba(0,0,0,.2);
|
||||
}
|
||||
.select2-container .select2-choice > .select2-chosen {
|
||||
margin-right: 23px;
|
||||
}
|
||||
@ -3936,13 +3939,13 @@ div.dataTables_length select {
|
||||
border-top: none !important;
|
||||
border-left: none !important;
|
||||
border-right: none !important;
|
||||
border-bottom: 1px solid #aaa;
|
||||
}
|
||||
.select2-drop.select2-drop-above {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
.select2-drop.select2-drop-above.select2-drop-active {
|
||||
border-top: 1px solid #ccc;
|
||||
border-bottom: solid 1px rgba(0,0,0,.2);
|
||||
}
|
||||
.select2-container-active .select2-choice, .select2-container-active .select2-choices
|
||||
{
|
||||
@ -3978,8 +3981,6 @@ div.dataTables_length select {
|
||||
}
|
||||
.select2-dropdown-open.select2-drop-above .select2-choice, .select2-dropdown-open.select2-drop-above .select2-choices {
|
||||
background-image: none;
|
||||
border-left: 1px solid #ccc !important;
|
||||
border-right: 1px solid #ccc !important;
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
div.select2-drop-above
|
||||
@ -4023,6 +4024,15 @@ a span.select2-chosen
|
||||
.select2-container-multi .select2-choices .select2-search-choice {
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
.select2-dropdown-open.select2-drop-above .select2-choice, .select2-dropdown-open.select2-drop-above .select2-choices, .select2-container-multi .select2-choices,
|
||||
.select2-container-multi.select2-container-active .select2-choices
|
||||
{
|
||||
border-bottom: none;
|
||||
border-right: none;
|
||||
border-top: none;
|
||||
border-left: 1px solid #ddd;
|
||||
}
|
||||
|
||||
|
||||
/* Special case for the select2 add widget */
|
||||
#addbox .select2-container .select2-choice > .select2-chosen {
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 326 B |
@ -273,7 +273,7 @@ input.select2-input {
|
||||
}
|
||||
.select2-choice {
|
||||
border: none;
|
||||
border-bottom: 1px solid #aaa !important;
|
||||
border-bottom: 1px solid #ccc !important;
|
||||
}
|
||||
|
||||
textarea.cke_source:focus
|
||||
@ -288,24 +288,29 @@ input, input.flat, textarea, textarea.flat, form.flat select, select, select.fla
|
||||
font-size: <?php print $fontsize ?>px;
|
||||
font-family: <?php print $fontlist ?>;
|
||||
border: none;
|
||||
border-bottom: 1px solid #C0C0C0;
|
||||
border-bottom: solid 1px rgba(0,0,0,.1);
|
||||
outline: none;
|
||||
margin: 0px 0px 0px 0px;
|
||||
}
|
||||
|
||||
input, select {
|
||||
border-bottom: solid 1px rgba(0,0,0,.2);
|
||||
border-bottom: solid 1px rgba(0,0,0,.1);
|
||||
|
||||
padding:4px;
|
||||
margin-left:0px;
|
||||
margin-bottom:1px;
|
||||
margin-top:1px;
|
||||
}
|
||||
}
|
||||
input {
|
||||
padding:4px;
|
||||
}
|
||||
select {
|
||||
padding:1px;
|
||||
}
|
||||
|
||||
textarea {
|
||||
border-radius: 0;
|
||||
border: solid 1px rgba(0,0,0,.3);
|
||||
border-top:solid 1px rgba(0,0,0,.3);
|
||||
border-top:solid 1px rgba(0,0,0,.1);
|
||||
border-left:solid 1px rgba(0,0,0,.1);
|
||||
border-right:solid 1px rgba(0,0,0,.1);
|
||||
border-bottom:solid 1px rgba(0,0,0,.2);
|
||||
|
||||
background-color: #FFF;
|
||||
@ -481,6 +486,9 @@ th .button {
|
||||
.valignbottom {
|
||||
vertical-align: bottom;
|
||||
}
|
||||
.valigntextbottom {
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
.centpercent {
|
||||
width: 100%;
|
||||
}
|
||||
@ -1512,9 +1520,6 @@ form#login {
|
||||
-moz-box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15);
|
||||
-webkit-box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15);
|
||||
box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15);
|
||||
/*-moz-box-shadow: 3px 2px 20px #CCC;
|
||||
-webkit-box-shadow: 3px 2px 20px #CCC;
|
||||
box-shadow: 3px 2px 20px #CCC;*/
|
||||
|
||||
border-radius: 4px;
|
||||
border:solid 1px rgba(80,80,80,.4);
|
||||
@ -2184,9 +2189,7 @@ tr.nocellnopadd td.nobordernopadding, tr.nocellnopadd td.nocellnopadd
|
||||
|
||||
|
||||
table.border, table.dataTable, .table-border, .table-border-col, .table-key-border-col, .table-val-border-col, div.border {
|
||||
<?php if (empty($noborderline)) { ?>
|
||||
border: 1px solid #f4f4f4;
|
||||
<?php } ?>
|
||||
border-collapse: collapse !important;
|
||||
padding: 1px 2px 1px 3px; /* t r b l */
|
||||
}
|
||||
@ -2510,7 +2513,7 @@ table.dataTable tr.odd, table.dataTable tr.oddeven {
|
||||
}
|
||||
|
||||
/* For no hover style */
|
||||
td.oddeven, table.nohover tr.impair, table.nohover tr.pair, table.nohover tr.impair td, table.nohover tr.pair td, tr.nohover td {
|
||||
td.oddeven, table.nohover tr.impair, table.nohover tr.pair, table.nohover tr.impair td, table.nohover tr.pair td, tr.nohover td, form.nohover, form.nohover:hover {
|
||||
background-color: #<?php echo colorArrayToHex(colorStringToArray($colorbacklineimpair1)); ?> !important;
|
||||
background: #<?php echo colorArrayToHex(colorStringToArray($colorbacklineimpair1)); ?> !important;
|
||||
}
|
||||
@ -2776,6 +2779,7 @@ span.dashboardlineko {
|
||||
}
|
||||
.boxtable {
|
||||
margin-bottom: 8px !important;
|
||||
border-bottom-width: 0 !important;
|
||||
}
|
||||
.tdboxstats {
|
||||
text-align: center;
|
||||
@ -3856,6 +3860,9 @@ div.dataTables_length select {
|
||||
/* Select2 */
|
||||
/* ============================================================================== */
|
||||
|
||||
.select2-container .select2-choice {
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
.select2-container .select2-choice > .select2-chosen {
|
||||
margin-right: 23px;
|
||||
}
|
||||
@ -3883,13 +3890,14 @@ div.dataTables_length select {
|
||||
border-top: none !important;
|
||||
border-left: none !important;
|
||||
border-right: none !important;
|
||||
border-bottom: 1px solid #aaa;
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
.select2-drop.select2-drop-above {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
.select2-drop.select2-drop-above.select2-drop-active {
|
||||
border-top: 1px solid #ccc;
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
.select2-container-active .select2-choice, .select2-container-active .select2-choices
|
||||
{
|
||||
@ -3925,8 +3933,6 @@ div.dataTables_length select {
|
||||
}
|
||||
.select2-dropdown-open.select2-drop-above .select2-choice, .select2-dropdown-open.select2-drop-above .select2-choices {
|
||||
background-image: none;
|
||||
border-left: 1px solid #ccc !important;
|
||||
border-right: 1px solid #ccc !important;
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
div.select2-drop-above
|
||||
@ -3970,6 +3976,16 @@ a span.select2-chosen
|
||||
.select2-container-multi .select2-choices .select2-search-choice {
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
.select2-dropdown-open.select2-drop-above .select2-choice, .select2-dropdown-open.select2-drop-above .select2-choices, .select2-container-multi .select2-choices,
|
||||
.select2-container-multi.select2-container-active .select2-choices
|
||||
{
|
||||
border-bottom: 1px solid #ccc;
|
||||
border-right: none;
|
||||
border-top: none;
|
||||
border-left: 1px solid #ddd;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Special case for the select2 add widget */
|
||||
#addbox .select2-container .select2-choice > .select2-chosen {
|
||||
|
||||
@ -278,6 +278,7 @@ if (! empty($id) || ! empty($ref)) {
|
||||
dol_fiche_end();
|
||||
}
|
||||
|
||||
// Create or edit a varian
|
||||
if ($action == 'add' || ($action == 'edit')) {
|
||||
|
||||
if ($action == 'add') {
|
||||
@ -311,21 +312,24 @@ if (! empty($id) || ! empty($ref)) {
|
||||
info: []
|
||||
};
|
||||
|
||||
<?php foreach ($productCombination2ValuePairs1 as $pc2v):
|
||||
$prodattr_val->fetch($pc2v->fk_prod_attr_val);
|
||||
<?php
|
||||
foreach ($productCombination2ValuePairs1 as $pc2v) {
|
||||
$prodattr_val->fetch($pc2v->fk_prod_attr_val);
|
||||
?>
|
||||
variants_selected.index.push(<?php echo $pc2v->fk_prod_attr ?>);
|
||||
variants_selected.info[<?php echo $pc2v->fk_prod_attr ?>] = {
|
||||
attribute: variants_available[<?php echo $pc2v->fk_prod_attr ?>],
|
||||
value: {
|
||||
id: <?php echo $pc2v->fk_prod_attr_val ?>,
|
||||
label: '<?php echo $prodattr_val->value ?>'
|
||||
}
|
||||
};
|
||||
<?php endforeach ?>
|
||||
variants_selected.index.push(<?php echo $pc2v->fk_prod_attr ?>);
|
||||
variants_selected.info[<?php echo $pc2v->fk_prod_attr ?>] = {
|
||||
attribute: variants_available[<?php echo $pc2v->fk_prod_attr ?>],
|
||||
value: {
|
||||
id: <?php echo $pc2v->fk_prod_attr_val ?>,
|
||||
label: '<?php echo $prodattr_val->value ?>'
|
||||
}
|
||||
};
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
restoreAttributes = function() {
|
||||
jQuery("select[name=attribute]").empty().append('<option value=""></option>');
|
||||
jQuery("select[name=attribute]").empty().append('<option value="-1"> </option>');
|
||||
|
||||
jQuery.each(variants_available, function (key, val) {
|
||||
if (jQuery.inArray(val.id, variants_selected.index) == -1) {
|
||||
@ -354,12 +358,11 @@ if (! empty($id) || ! empty($ref)) {
|
||||
};
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
jQuery("select#attribute").change(function () {
|
||||
|
||||
console.log("Change of field attribute");
|
||||
var select = jQuery("select#value");
|
||||
|
||||
if (!jQuery(this).val().length) {
|
||||
if (!jQuery(this).val().length || jQuery(this).val() == '-1') {
|
||||
select.empty();
|
||||
return;
|
||||
}
|
||||
@ -375,9 +378,12 @@ if (! empty($id) || ! empty($ref)) {
|
||||
}
|
||||
|
||||
select.empty();
|
||||
/* console.log(data.length); */
|
||||
|
||||
jQuery(data).each(function (key, val) {
|
||||
jQuery("select#value").append('<option value="' + val.id + '">' + val.value + '</option>');
|
||||
keyforoption = val.id
|
||||
valforoption = val.value
|
||||
jQuery("select#value").append('<option value="' + keyforoption + '">' + valforoption + '</option>');
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -429,31 +435,36 @@ if (! empty($id) || ! empty($ref)) {
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php } ?>
|
||||
|
||||
<form method="post" id="combinationform">
|
||||
<?php
|
||||
}
|
||||
|
||||
print '<form method="post" id="combinationform">';
|
||||
print dol_fiche_head();
|
||||
|
||||
?>
|
||||
|
||||
<table class="border" style="width: 100%">
|
||||
<?php if ($action == 'add'): ?>
|
||||
<?php if ($action == 'add') { ?>
|
||||
<tr>
|
||||
<td style="width: 25%"><label for="attribute"><?php echo $langs->trans('ProductAttribute') ?></label></td>
|
||||
<td colspan="2"><select id="attribute" name="attribute">
|
||||
<option value=""></option>
|
||||
<td class="titlefieldcreate fieldrequired"><label for="attribute"><?php echo $langs->trans('ProductAttribute') ?></label></td>
|
||||
<td colspan="2"><select class="flat minwidth100" id="attribute" name="attribute">
|
||||
<option value="-1"> </option>
|
||||
<?php foreach ($prodattr_all as $attr): ?>
|
||||
<option value="<?php echo $attr->id ?>"><?php echo $attr->label ?></option>
|
||||
<?php endforeach ?>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 25%"><label for="value"><?php echo $langs->trans('Value') ?></label></td>
|
||||
<td class="fieldrequired"><label for="value"><?php echo $langs->trans('Value') ?></label></td>
|
||||
<td colspan="2">
|
||||
<select id="value" name="value">
|
||||
<option value=""></option>
|
||||
<select class="flat minwidth100" id="value" name="value">
|
||||
<option value="-1"> </option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<td style="width: 25%" class="fieldrequired"><label for="features"><?php echo $langs->trans('Features') ?></label></td>
|
||||
<td class="titlefieldcreate fieldrequired"><label for="features"><?php echo $langs->trans('Features') ?></label></td>
|
||||
<td><select multiple style="width: 100%" id="features">
|
||||
<?php
|
||||
foreach ($productCombination2ValuePairs1 as $pc2v): ?>
|
||||
@ -468,26 +479,33 @@ if (! empty($id) || ! empty($ref)) {
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 25%"><label for="price_impact"><?php echo $langs->trans('PriceImpact') ?></label></td>
|
||||
<td><label for="price_impact"><?php echo $langs->trans('PriceImpact') ?></label></td>
|
||||
<td colspan="2"><input type="text" id="price_impact" name="price_impact" value="<?php echo price($price_impact) ?>">
|
||||
<input type="checkbox" id="price_impact_percent" name="price_impact_percent" <?php echo $price_impact_percent ? ' checked' : '' ?>> <label for="price_impact_percent"><?php echo $langs->trans('PercentageVariation') ?></label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 25%"><label for="weight_impact"><?php echo $langs->trans('WeightImpact') ?></label></td>
|
||||
<td><label for="weight_impact"><?php echo $langs->trans('WeightImpact') ?></label></td>
|
||||
<td colspan="2"><input type="text" id="weight_impact" name="weight_impact" value="<?php echo price($weight_impact) ?>"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
<div style="text-align: center"><input type="submit" value="<?php echo $action == 'add' ? $langs->trans('Create') : $langs->trans('Save') ?>" class="button"></div>
|
||||
<?php foreach ($productCombination2ValuePairs1 as $pc2v): ?>
|
||||
<?php
|
||||
print dol_fiche_end();
|
||||
?>
|
||||
|
||||
<div style="text-align: center">
|
||||
|
||||
<input type="submit" value="<?php echo $action == 'add' ? $langs->trans('Create') : $langs->trans('Save') ?>" class="button"></div>
|
||||
|
||||
<?php foreach ($productCombination2ValuePairs1 as $pc2v): ?>
|
||||
<input type="hidden" name="features[]" value="<?php echo $pc2v->fk_prod_attr.':'.$pc2v->fk_prod_attr_val ?>">
|
||||
<?php endforeach; ?>
|
||||
</form>
|
||||
<?php endforeach; ?>
|
||||
<?php
|
||||
|
||||
} else {
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($action === 'delete') {
|
||||
|
||||
if ($prodcomb->fetch($valueid) > 0) {
|
||||
@ -565,7 +583,22 @@ if (! empty($id) || ! empty($ref)) {
|
||||
<input type="submit" value="<?php echo $langs->trans("Apply") ?>" class="button">
|
||||
<br>
|
||||
<br>
|
||||
<?php } ?>
|
||||
<?php }
|
||||
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
print ' <div class="inline-block divButAction">';
|
||||
if ($productCombinations) {
|
||||
print '<a href="combinations.php?id='.$id.'&action=copy" class="butAction">'.$langs->trans('Copy').'</a>';
|
||||
}
|
||||
print '<a href="combinations.php?id='.$id.'&action=add" class="butAction">'.$langs->trans('NewProductCombination').'</a>';
|
||||
print '<a href="generator.php?id='.$id.'" class="butAction">'.$langs->trans('ProductCombinationGenerator').'</a>';
|
||||
print ' </div>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<table class="liste">
|
||||
<tr class="liste_titre">
|
||||
@ -582,35 +615,48 @@ if (! empty($id) || ! empty($ref)) {
|
||||
<th class="liste_titre" style="text-align: center;"><?php echo $langs->trans('OnBuy') ?></th>
|
||||
<th class="liste_titre"></th>
|
||||
</tr>
|
||||
<?php foreach ($productCombinations as $currcomb):
|
||||
$prodstatic->fetch($currcomb->fk_product_child); ?>
|
||||
<tr <?php echo $bc[!$var] ?>>
|
||||
<td><input type="checkbox" name="select[<?php echo $prodstatic->id ?>]"></td>
|
||||
<td><?php echo $prodstatic->getNomUrl(1) ?></td>
|
||||
<td>
|
||||
<?php
|
||||
|
||||
$productCombination2ValuePairs = $comb2val->fetchByFkCombination($currcomb->id);
|
||||
$iMax = count($productCombination2ValuePairs);
|
||||
|
||||
for ($i = 0; $i < $iMax; $i++) {
|
||||
echo dol_htmlentities($productCombination2ValuePairs[$i]);
|
||||
|
||||
if ($i !== ($iMax - 1)) {
|
||||
echo ', ';
|
||||
}
|
||||
} ?>
|
||||
</td>
|
||||
<td style="text-align: right"><?php echo ($currcomb->variation_price >= 0 ? '+' : '').price($currcomb->variation_price).($currcomb->variation_price_percentage ? ' %' : '') ?></td>
|
||||
<td style="text-align: right"><?php echo ($currcomb->variation_weight >= 0 ? '+' : '').price($currcomb->variation_weight).' '.measuring_units_string($prodstatic->weight_units, 'weight') ?></td>
|
||||
<td style="text-align: center;"><?php echo $prodstatic->getLibStatut(2, 0) ?></td>
|
||||
<td style="text-align: center;"><?php echo $prodstatic->getLibStatut(2, 1) ?></td>
|
||||
<td style="text-align: right">
|
||||
<a href="<?php echo dol_buildpath('/variants/combinations.php?id='.$id.'&action=edit&valueid='.$currcomb->id, 2) ?>"><?php echo img_edit() ?></a>
|
||||
<a href="<?php echo dol_buildpath('/variants/combinations.php?id='.$id.'&action=delete&valueid='.$currcomb->id, 2) ?>"><?php echo img_delete() ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $var = !$var; endforeach ?>
|
||||
<?php
|
||||
|
||||
if (count($productCombinations))
|
||||
{
|
||||
foreach ($productCombinations as $currcomb) {
|
||||
$prodstatic->fetch($currcomb->fk_product_child);
|
||||
?>
|
||||
<tr <?php echo $bc[!$var] ?>>
|
||||
<td><input type="checkbox" name="select[<?php echo $prodstatic->id ?>]"></td>
|
||||
<td><?php echo $prodstatic->getNomUrl(1) ?></td>
|
||||
<td>
|
||||
<?php
|
||||
|
||||
$productCombination2ValuePairs = $comb2val->fetchByFkCombination($currcomb->id);
|
||||
$iMax = count($productCombination2ValuePairs);
|
||||
|
||||
for ($i = 0; $i < $iMax; $i++) {
|
||||
echo dol_htmlentities($productCombination2ValuePairs[$i]);
|
||||
|
||||
if ($i !== ($iMax - 1)) {
|
||||
echo ', ';
|
||||
}
|
||||
} ?>
|
||||
</td>
|
||||
<td style="text-align: right"><?php echo ($currcomb->variation_price >= 0 ? '+' : '').price($currcomb->variation_price).($currcomb->variation_price_percentage ? ' %' : '') ?></td>
|
||||
<td style="text-align: right"><?php echo ($currcomb->variation_weight >= 0 ? '+' : '').price($currcomb->variation_weight).' '.measuring_units_string($prodstatic->weight_units, 'weight') ?></td>
|
||||
<td style="text-align: center;"><?php echo $prodstatic->getLibStatut(2, 0) ?></td>
|
||||
<td style="text-align: center;"><?php echo $prodstatic->getLibStatut(2, 1) ?></td>
|
||||
<td style="text-align: right">
|
||||
<a href="<?php echo dol_buildpath('/variants/combinations.php?id='.$id.'&action=edit&valueid='.$currcomb->id, 2) ?>"><?php echo img_edit() ?></a>
|
||||
<a href="<?php echo dol_buildpath('/variants/combinations.php?id='.$id.'&action=delete&valueid='.$currcomb->id, 2) ?>"><?php echo img_delete() ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$var = !$var;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td colspan="8"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
<?php if ($productCombinations): ?>
|
||||
@ -618,17 +664,6 @@ if (! empty($id) || ! empty($ref)) {
|
||||
<?php endif ?>
|
||||
|
||||
<?php
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
print ' <div class="inline-block divButAction">';
|
||||
if ($productCombinations) {
|
||||
print ' <a href="combinations.php?id='.$id.'&action=copy" class="butAction">'.$langs->trans('Copy').'</a>';
|
||||
}
|
||||
print ' <a href="generator.php?id='.$id.'" class="butAction">'.$langs->trans('ProductCombinationGenerator').'</a>
|
||||
<a href="combinations.php?id='.$id.'&action=add" class="butAction">'.$langs->trans('NewProductCombination').'</a>';
|
||||
print ' </div>';
|
||||
print '</div>';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user