Merge remote branch 'upstream/develop' into tooltip
This commit is contained in:
commit
fb22de1ecd
159
htdocs/contrat/admin/contractdet_extrafields.php
Normal file
159
htdocs/contrat/admin/contractdet_extrafields.php
Normal file
@ -0,0 +1,159 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/contrat/admin/contract_extrafields.php
|
||||
* \ingroup contrat
|
||||
* \brief Page to setup extra fields of contract
|
||||
*/
|
||||
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
|
||||
$langs->load("companies");
|
||||
$langs->load("admin");
|
||||
$langs->load("contracts");
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$form = new Form($db);
|
||||
|
||||
// List of supported format
|
||||
$tmptype2label=ExtraFields::$type2label;
|
||||
$type2label=array('');
|
||||
foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
|
||||
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$attrname=GETPOST('attrname', 'alpha');
|
||||
$elementtype='contratdet'; //Must be the $element of the class that manage extrafield
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
|
||||
llxHeader();
|
||||
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print_fiche_titre($langs->trans("ContractsSetup"),$linkback,'setup');
|
||||
|
||||
print '<br>';
|
||||
$head=contract_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'attributeslines', $langs->trans("Contracts"), 0, 'contract');
|
||||
|
||||
$textobject = $langs->transnoentitiesnoconv('Contracts');
|
||||
|
||||
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
|
||||
print '<br>';
|
||||
|
||||
// Load attribute_label
|
||||
$extrafields->fetch_name_optionals_label($elementtype);
|
||||
|
||||
print "<table summary=\"listofattributes\" class=\"noborder\" width=\"100%\">";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td align="center">'.$langs->trans("Position").'</td>';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
print '<td>'.$langs->trans("AttributeCode").'</td>';
|
||||
print '<td>'.$langs->trans("Type").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Size").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Unique").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Required").'</td>';
|
||||
print '<td width="80"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$var=True;
|
||||
foreach($extrafields->attribute_type as $key => $value)
|
||||
{
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print "<td>".$extrafields->attribute_pos[$key]."</td>\n";
|
||||
print "<td>".$extrafields->attribute_label[$key]."</td>\n";
|
||||
print "<td>".$key."</td>\n";
|
||||
print "<td>".$type2label[$extrafields->attribute_type[$key]]."</td>\n";
|
||||
print '<td align="right">'.$extrafields->attribute_size[$key]."</td>\n";
|
||||
print '<td align="center">'.yn($extrafields->attribute_unique[$key])."</td>\n";
|
||||
print '<td align="center">'.yn($extrafields->attribute_required[$key])."</td>\n";
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&attrname='.$key.'">'.img_edit().'</a>';
|
||||
print " <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=$key\">".img_delete()."</a></td>\n";
|
||||
print "</tr>";
|
||||
// $i++;
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation d'un champ optionnel
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
print "<br>";
|
||||
print_titre($langs->trans('NewAttribute'));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition d'un champ optionnel */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
{
|
||||
print "<br>";
|
||||
print_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
@ -84,6 +84,10 @@ if ($id > 0 || ! empty($ref)) {
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// fetch optionals attributes lines and labels
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelslines=$extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
||||
|
||||
$permissionnote=$user->rights->contrat->creer; // Used by the include of actions_setnotes.inc.php
|
||||
|
||||
|
||||
@ -408,6 +412,18 @@ else if ($action == 'addline' && $user->rights->contrat->creer)
|
||||
$error++;
|
||||
}
|
||||
|
||||
// Extrafields
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_option = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef);
|
||||
// Unset extrafield
|
||||
if (is_array($extralabelsline)) {
|
||||
// Get extra fields
|
||||
foreach ($extralabelsline as $key => $value) {
|
||||
unset($_POST["options_" . $key]);
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Clean parameters
|
||||
@ -520,7 +536,8 @@ else if ($action == 'addline' && $user->rights->contrat->creer)
|
||||
$pu_ttc,
|
||||
$info_bits,
|
||||
$fk_fournprice,
|
||||
$pa_ht
|
||||
$pa_ht,
|
||||
$array_option
|
||||
);
|
||||
}
|
||||
|
||||
@ -617,6 +634,12 @@ else if ($action == 'updateligne' && $user->rights->contrat->creer && ! GETPOST(
|
||||
$objectline->fk_fournprice=$fk_fournprice;
|
||||
$objectline->pa_ht=$pa_ht;
|
||||
|
||||
// Extrafields
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($objectline->table_element);
|
||||
$array_option = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef);
|
||||
$objectline->array_options=$array_option;
|
||||
|
||||
// TODO verifier price_min si fk_product et multiprix
|
||||
|
||||
$result=$objectline->update($user);
|
||||
@ -1391,6 +1414,16 @@ else
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
//Display lines extrafields
|
||||
if (is_array($extralabelslines) && count($extralabelslines)>0) {
|
||||
print '<tr '.$bc[$var].'>';
|
||||
$line = new ContratLigne($db);
|
||||
$line->fetch_optionals($objp->rowid,$extralabelslines);
|
||||
print $line->showOptionals($extrafieldsline, 'view', array('style'=>$bc[$var], 'colspan'=>$colspan));
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
// Ligne en mode update
|
||||
else
|
||||
@ -1448,6 +1481,15 @@ else
|
||||
print '<br>'.$langs->trans("DateEndPlanned").' ';
|
||||
$form->select_date($db->jdate($objp->date_fin),"date_end_update",$usehm,$usehm,($db->jdate($objp->date_fin)>0?0:1),"update");
|
||||
print '</td>';
|
||||
|
||||
if (is_array($extralabelslines) && count($extralabelslines)>0) {
|
||||
print '<tr '.$bc[$var].'>';
|
||||
$line = new ContratLigne($db);
|
||||
$line->fetch_optionals($objp->rowid,$extralabelslines);
|
||||
print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bc[$var], 'colspan'=>$colspan));
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -907,7 +907,8 @@ class Contrat extends CommonObject
|
||||
$modCodeContract = new $module();
|
||||
}
|
||||
|
||||
if (!empty($modCodeContract->code_auto)) {
|
||||
//Commerce Efficace - Debut : Modification r<>f<EFBFBD>rence Contrat
|
||||
/*if (!empty($modCodeContract->code_auto)) {
|
||||
// Mise a jour ref
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."contrat SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id;
|
||||
if ($this->db->query($sql))
|
||||
@ -917,7 +918,8 @@ class Contrat extends CommonObject
|
||||
$this->ref="(PROV".$this->id.")";
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
//Commerce Efficace - Fin : Modification r<>f<EFBFBD>rence Contrat
|
||||
|
||||
// Insert contacts commerciaux ('SALESREPSIGN','contrat')
|
||||
$result=$this->add_contact($this->commercial_signature_id,'SALESREPSIGN','internal');
|
||||
@ -1238,9 +1240,10 @@ class Contrat extends CommonObject
|
||||
* @param int $info_bits Bits de type de lignes
|
||||
* @param int $fk_fournprice Fourn price id
|
||||
* @param int $pa_ht Buying price HT
|
||||
* @param array $array_option extrafields array
|
||||
* @return int <0 si erreur, >0 si ok
|
||||
*/
|
||||
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $date_start, $date_end, $price_base_type='HT', $pu_ttc=0.0, $info_bits=0, $fk_fournprice=null, $pa_ht = 0)
|
||||
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $date_start, $date_end, $price_base_type='HT', $pu_ttc=0.0, $info_bits=0, $fk_fournprice=null, $pa_ht = 0,$array_option=0)
|
||||
{
|
||||
global $user, $langs, $conf, $mysoc;
|
||||
|
||||
@ -1348,17 +1351,33 @@ class Contrat extends CommonObject
|
||||
$result=$this->update_statut($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINECONTRACT_CREATE',$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
// End call triggers
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_option) && count($array_option)>0) // For avoid conflicts if trigger used
|
||||
{
|
||||
$contractline = new ContratLigne($this->db);
|
||||
$contractline->array_options=$array_option;
|
||||
$contractline->id= $this->db->last_insert_id(MAIN_DB_PREFIX.$contractline->table_element);
|
||||
$result=$contractline->insertExtraFields();
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error[]=$contractline->error;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($error)) {
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINECONTRACT_CREATE',$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
// End call triggers
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1399,9 +1418,10 @@ class Contrat extends CommonObject
|
||||
* @param int $info_bits Bits de type de lignes
|
||||
* @param int $fk_fournprice Fourn price id
|
||||
* @param int $pa_ht Buying price HT
|
||||
* @param array $array_option extrafields array
|
||||
* @return int < 0 si erreur, > 0 si ok
|
||||
*/
|
||||
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $tvatx, $localtax1tx=0.0, $localtax2tx=0.0, $date_debut_reel='', $date_fin_reel='', $price_base_type='HT', $info_bits=0, $fk_fournprice=null, $pa_ht = 0)
|
||||
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $tvatx, $localtax1tx=0.0, $localtax2tx=0.0, $date_debut_reel='', $date_fin_reel='', $price_base_type='HT', $info_bits=0, $fk_fournprice=null, $pa_ht = 0,$array_option=0)
|
||||
{
|
||||
global $user, $conf, $langs, $mysoc;
|
||||
|
||||
@ -1501,17 +1521,33 @@ class Contrat extends CommonObject
|
||||
$result=$this->update_statut($user);
|
||||
if ($result >= 0)
|
||||
{
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINECONTRACT_UPDATE',$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
// End call triggers
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_option) && count($array_option)>0) // For avoid conflicts if trigger used
|
||||
{
|
||||
$contractline = new ContratLigne($this->db);
|
||||
$contractline->array_options=$array_option;
|
||||
$contractline->id= $this->db->last_insert_id(MAIN_DB_PREFIX.$contractline->table_element);
|
||||
$result=$contractline->insertExtraFields();
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error[]=$contractline->error;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($error)) {
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('LINECONTRACT_UPDATE',$user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
// End call triggers
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1560,12 +1596,32 @@ class Contrat extends CommonObject
|
||||
if (! $resql)
|
||||
{
|
||||
$this->error="Error ".$this->db->lasterror();
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (empty($error)) {
|
||||
// Remove extrafields
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||
{
|
||||
$contractline = new ContratLigne($this->db);
|
||||
$contractline->id= $idline;
|
||||
$result=$contractline->deleteExtraFields();
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
$this->error="Error ".get_class($this)."::delete deleteExtraFields error -4 ".$contractline->error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($error)) {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
} else {
|
||||
dol_syslog(get_class($this)."::delete ERROR:".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2067,6 +2123,9 @@ class ContratLigne extends CommonObject
|
||||
var $statut; // 0 inactive, 4 active, 5 closed
|
||||
var $label;
|
||||
|
||||
public $element='contratdet';
|
||||
public $table_element='contratdet';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @deprecated Use $label instead
|
||||
@ -2445,10 +2504,21 @@ class ContratLigne extends CommonObject
|
||||
else
|
||||
{
|
||||
$this->error="Error ".$this->db->lasterror();
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
$error++;
|
||||
//return -1;
|
||||
}
|
||||
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options)>0) // For avoid conflicts if trigger used
|
||||
{
|
||||
|
||||
$result=$this->insertExtraFields();
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($error)) {
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Call trigger
|
||||
@ -2456,9 +2526,16 @@ class ContratLigne extends CommonObject
|
||||
if ($result < 0) { $error++; $this->db->rollback(); return -1; }
|
||||
// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($error)) {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
} else {
|
||||
$this->db->rollback();
|
||||
$this->errors[]=$this->error;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -188,7 +188,7 @@ if (file_exists($fullpathselecteddir))
|
||||
$userstatic->lastname=isset($val['login_c'])?$val['login_c']:0;
|
||||
$htmltooltip='<b>'.$langs->trans("ECMSection").'</b>: '.$val['label'].'<br>';
|
||||
$htmltooltip='<b>'.$langs->trans("Type").'</b>: '.$langs->trans("ECMSectionManual").'<br>';
|
||||
$htmltooltip.='<b>'.$langs->trans("ECMCreationUser").'</b>: '.$userstatic->getNomUrl(1).'<br>';
|
||||
$htmltooltip.='<b>'.$langs->trans("ECMCreationUser").'</b>: '.$userstatic->getNomUrl(1, '', false, 1).'<br>';
|
||||
$htmltooltip.='<b>'.$langs->trans("ECMCreationDate").'</b>: '.(isset($val['date_c'])?dol_print_date($val['date_c'],"dayhour"):$langs->trans("NeedRefresh")).'<br>';
|
||||
$htmltooltip.='<b>'.$langs->trans("Description").'</b>: '.$val['description'].'<br>';
|
||||
$htmltooltip.='<b>'.$langs->trans("ECMNbOfFilesInDir").'</b>: '.((isset($val['cachenbofdoc']) && $val['cachenbofdoc'] >= 0)?$val['cachenbofdoc']:$langs->trans("NeedRefresh")).'<br>';
|
||||
|
||||
@ -832,8 +832,9 @@ class Form
|
||||
if ($conf->use_javascript_ajax && ! $forcecombo)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||
$out.= ajax_combobox($htmlname, $events, $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
|
||||
$nodatarole=' data-role="none"';
|
||||
$comboenhancement =ajax_combobox($htmlname, $events, $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
|
||||
$out.= $comboenhancement;
|
||||
$nodatarole=($comboenhancement?' data-role="none"':'');
|
||||
}
|
||||
|
||||
// Construct $out and $outarray
|
||||
@ -1037,8 +1038,9 @@ class Form
|
||||
if ($conf->use_javascript_ajax && ! $forcecombo && ! $options_only)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||
$out.= ajax_combobox($htmlname, $events, $conf->global->CONTACT_USE_SEARCH_TO_SELECT);
|
||||
$nodatarole=' data-role="none"';
|
||||
$comboenhancement = ajax_combobox($htmlname, $events, $conf->global->CONTACT_USE_SEARCH_TO_SELECT);
|
||||
$out.= $comboenhancement;
|
||||
$nodatarole=($comboenhancement?' data-role="none"':'');
|
||||
}
|
||||
|
||||
if ($htmlname != 'none' || $options_only) $out.= '<select class="flat'.($moreclass?' '.$moreclass:'').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$nodatarole.'>';
|
||||
@ -1230,8 +1232,9 @@ class Form
|
||||
/*if ($conf->use_javascript_ajax)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||
$out.= ajax_combobox($htmlname);
|
||||
$nodatarole=' data-role="none"';
|
||||
$comboenhancement = ajax_combobox($htmlname);
|
||||
$out.= $comboenhancement;
|
||||
$nodatarole=($comboenhancement?' data-role="none"':'');
|
||||
}*/
|
||||
|
||||
$out.= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled?' disabled="disabled"':'').$nodatarole.'>';
|
||||
@ -4288,7 +4291,7 @@ class Form
|
||||
|
||||
// Try also magic suggest
|
||||
|
||||
// Add data-role="none" to diable jmobile decoration
|
||||
// Add data-role="none" to disable jmobile decoration
|
||||
$out = '<select data-role="none" id="'.$htmlname.'" class="multiselect" multiple="multiple" name="'.$htmlname.'[]"'.$option.($width?' style="width: '.$width.'px"':'').'>'."\n";
|
||||
if (is_array($array) && ! empty($array))
|
||||
{
|
||||
@ -4503,7 +4506,7 @@ class Form
|
||||
* @param int $width Width of photo
|
||||
* @return string HTML code to output photo
|
||||
*/
|
||||
function showphoto($modulepart,$object,$width=100)
|
||||
static function showphoto($modulepart,$object,$width=100)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -4628,8 +4631,9 @@ class Form
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||
$out.= ajax_combobox($htmlname);
|
||||
$nodatarole=' data-role="none"';
|
||||
$comboenhancement = ajax_combobox($htmlname);
|
||||
$out.= $comboenhancement;
|
||||
$nodatarole=($comboenhancement?' data-role="none"':'');
|
||||
}
|
||||
|
||||
$out.= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled?' disabled="disabled"':'').$nodatarole.'>';
|
||||
|
||||
@ -324,8 +324,9 @@ class FormOther
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||
$moreforfilter.= ajax_combobox('select_categ_'.$htmlname);
|
||||
$nodatarole=' data-role="none"';
|
||||
$comboenhancement = ajax_combobox('select_categ_'.$htmlname);
|
||||
$moreforfilter.=$comboenhancement;
|
||||
$nodatarole=($comboenhancement?' data-role="none"':'');
|
||||
}
|
||||
|
||||
// Print a select with each of them
|
||||
@ -373,8 +374,9 @@ class FormOther
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||
$out.= ajax_combobox($htmlname);
|
||||
$nodatarole=' data-role="none"';
|
||||
$comboenhancement = ajax_combobox($htmlname);
|
||||
$out.=$comboenhancement;
|
||||
$nodatarole=($comboenhancement?' data-role="none"':'');
|
||||
}
|
||||
// Select each sales and print them in a select input
|
||||
$out.='<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'"'.$nodatarole.'>';
|
||||
|
||||
@ -91,8 +91,9 @@ class FormProjets
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||
$out.= ajax_combobox($htmlname, '', 0, $forcefocus);
|
||||
$nodatarole=' data-role="none"';
|
||||
$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
|
||||
$out.=$comboenhancement;
|
||||
$nodatarole=($comboenhancement?' data-role="none"':'');
|
||||
}
|
||||
|
||||
if (empty($option_only)) {
|
||||
|
||||
@ -50,6 +50,8 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
|
||||
global $conf, $user, $langs, $db, $hookmanager;
|
||||
global $begin_h, $end_h, $begin_d, $end_d;
|
||||
|
||||
$langs->load("companies");
|
||||
|
||||
// Filters
|
||||
print '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
||||
@ -114,7 +116,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
|
||||
print '<td class="nowrap">';
|
||||
print $langs->trans("Project").' ';
|
||||
print '</td><td class="nowrap maxwidthonsmartphone">';
|
||||
$formproject->select_projects($socid?$socid:-1, $pid, 'projectid');
|
||||
$formproject->select_projects($socid?$socid:-1, $pid, 'projectid', 0);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -322,7 +322,7 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $
|
||||
global $conf;
|
||||
|
||||
//if (! empty($conf->browser->phone)) return ''; // combobox disabled for smartphones (does not works)
|
||||
//if (! empty($conf->dol_use_jmobile)) return ''; // select2 works with jmobile
|
||||
if (! empty($conf->dol_use_jmobile)) return ''; // select2 works with jmobile but it breaks the autosize feature of jmobile.
|
||||
if (! empty($conf->global->MAIN_DISABLE_AJAX_COMBOX)) return '';
|
||||
if (empty($conf->use_javascript_ajax)) return '';
|
||||
|
||||
|
||||
@ -112,6 +112,11 @@ function contract_admin_prepare_head()
|
||||
$head[$h][2] = 'attributes';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/contrat/admin/contractdet_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsLines");
|
||||
$head[$h][2] = 'attributeslines';
|
||||
$h++;
|
||||
|
||||
|
||||
|
||||
complete_head_from_modules($conf,$langs,null,$head,$h,'contract_admin','remove');
|
||||
|
||||
@ -608,7 +608,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
|
||||
$maskraz=-1;
|
||||
$maskoffset=0;
|
||||
$resetEveryMonth=false;
|
||||
if (dol_strlen($maskcounter) < 3 && empty($conf->global->MAIN_COUNTER_WITH_LESS_3_DIGITS)) return 'CounterMustHaveMoreThan3Digits';
|
||||
if (dol_strlen($maskcounter) < 3 && empty($conf->global->MAIN_COUNTER_WITH_LESS_3_DIGITS)) return 'ErrorCounterMustHaveMoreThan3Digits';
|
||||
|
||||
// Extract value for third party mask counter
|
||||
if (preg_match('/\{(c+)(0*)\}/i',$mask,$regClientRef))
|
||||
|
||||
@ -522,7 +522,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
|
||||
// Get format of bank account according to its country
|
||||
$usedetailedbban=$account->useDetailedBBAN();
|
||||
|
||||
$onlynumber=0; $usedetailedbban=1; // For tests
|
||||
//$onlynumber=0; $usedetailedbban=1; // For tests
|
||||
if ($usedetailedbban)
|
||||
{
|
||||
$savcurx=$curx;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
@ -85,23 +85,19 @@ function project_prepare_head($object)
|
||||
$head[$h][2] = 'document';
|
||||
$h++;
|
||||
|
||||
// Then tab for sub level of projet, i mean tasks
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Tasks");
|
||||
$head[$h][2] = 'tasks';
|
||||
$h++;
|
||||
if (empty($conf->global->PROJECT_HIDE_TASKS))
|
||||
{
|
||||
// Then tab for sub level of projet, i mean tasks
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Tasks");
|
||||
$head[$h][2] = 'tasks';
|
||||
$h++;
|
||||
|
||||
/* Now this is a filter in the Task tab.
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id.'&mode=mine';
|
||||
$head[$h][1] = $langs->trans("MyTasks");
|
||||
$head[$h][2] = 'mytasks';
|
||||
$h++;
|
||||
*/
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/ganttview.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Gantt");
|
||||
$head[$h][2] = 'gantt';
|
||||
$h++;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/ganttview.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Gantt");
|
||||
$head[$h][2] = 'gantt';
|
||||
$h++;
|
||||
}
|
||||
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'project','remove');
|
||||
|
||||
|
||||
@ -1141,17 +1141,20 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
$newmenu->add("/projet/card.php?leftmenu=projects&action=create", $langs->trans("NewProject"), 1, $user->rights->projet->creer && $user->rights->projet->creer);
|
||||
$newmenu->add("/projet/list.php?leftmenu=projects", $langs->trans("List"), 1, $user->rights->projet->lire && $user->rights->projet->lire);
|
||||
|
||||
// Project affected to user
|
||||
$newmenu->add("/projet/activity/index.php?mode=mine", $langs->trans("MyActivities"), 0, $user->rights->projet->lire);
|
||||
$newmenu->add("/projet/tasks.php?action=create&mode=mine", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
|
||||
$newmenu->add("/projet/tasks/index.php?mode=mine", $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
$newmenu->add("/projet/activity/list.php?mode=mine", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer);
|
||||
if (empty($conf->global->PROJECT_HIDE_TASKS))
|
||||
{
|
||||
// Project affected to user
|
||||
$newmenu->add("/projet/activity/index.php?mode=mine", $langs->trans("MyActivities"), 0, $user->rights->projet->lire);
|
||||
$newmenu->add("/projet/tasks.php?action=create&mode=mine", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
|
||||
$newmenu->add("/projet/tasks/index.php?mode=mine", $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
$newmenu->add("/projet/activity/list.php?mode=mine", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer);
|
||||
|
||||
// All project i have permission on
|
||||
$newmenu->add("/projet/activity/index.php", $langs->trans("Activities"), 0, $user->rights->projet->lire && $user->rights->projet->lire);
|
||||
$newmenu->add("/projet/tasks.php?action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer && $user->rights->projet->creer);
|
||||
$newmenu->add("/projet/tasks/index.php", $langs->trans("List"), 1, $user->rights->projet->lire && $user->rights->projet->lire);
|
||||
$newmenu->add("/projet/activity/list.php", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer && $user->rights->projet->creer);
|
||||
// All project i have permission on
|
||||
$newmenu->add("/projet/activity/index.php", $langs->trans("Activities"), 0, $user->rights->projet->lire && $user->rights->projet->lire);
|
||||
$newmenu->add("/projet/tasks.php?action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer && $user->rights->projet->creer);
|
||||
$newmenu->add("/projet/tasks/index.php", $langs->trans("List"), 1, $user->rights->projet->lire && $user->rights->projet->lire);
|
||||
$newmenu->add("/projet/activity/list.php", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer && $user->rights->projet->creer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -560,7 +560,7 @@ class pdf_merou extends ModelePdfExpedition
|
||||
$pdf->SetXY($blSocX-80,$blSocY+17);
|
||||
$pdf->SetFont('','B', $default_font_size - 2);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->MultiCell(50, 8, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date_delivery,'day',false,$outputlangs,true), '', 'L');
|
||||
$pdf->MultiCell(50, 8, $outputlangs->transnoentities("DateDelivery")." : " . dol_print_date($object->date_delivery,'day',false,$outputlangs,true), '', 'L');
|
||||
|
||||
$pdf->SetXY($blSocX-80,$blSocY+20);
|
||||
$pdf->SetFont('','B', $default_font_size - 2);
|
||||
@ -568,7 +568,7 @@ class pdf_merou extends ModelePdfExpedition
|
||||
$pdf->MultiCell(50, 8, $outputlangs->transnoentities("TrackingNumber")." : " . $object->tracking_number, '', 'L');
|
||||
|
||||
// Deliverer
|
||||
$pdf->SetXY($blSocX-80,$blSocY+24);
|
||||
$pdf->SetXY($blSocX-80,$blSocY+23);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
@ -581,8 +581,16 @@ class pdf_merou extends ModelePdfExpedition
|
||||
{
|
||||
// Get code using getLabelFromKey
|
||||
$code=$outputlangs->getLabelFromKey($this->db,$object->shipping_method_id,'c_shipment_mode','rowid','code');
|
||||
$label=$outputlangs->trans("SendingMethod".strtoupper($code))." :";
|
||||
$pdf->writeHTMLCell(50, 8, '', '', $label." ".$object->tracking_url, '', 'L');
|
||||
$label='';
|
||||
$label.=$outputlangs->trans("SendingMethod").": ".$outputlangs->trans("SendingMethod".strtoupper($code));
|
||||
//var_dump($object->tracking_url != $object->tracking_number);exit;
|
||||
if ($object->tracking_url != $object->tracking_number)
|
||||
{
|
||||
$label.=" : ";
|
||||
$label.=$object->tracking_url;
|
||||
}
|
||||
$pdf->SetFont('','B', $default_font_size - 2);
|
||||
$pdf->writeHTMLCell(50, 8, '', '', $label, '', 'L');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -212,10 +212,17 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
{
|
||||
// Get code using getLabelFromKey
|
||||
$code=$outputlangs->getLabelFromKey($this->db,$object->shipping_method_id,'c_shipment_mode','rowid','code');
|
||||
$label=$outputlangs->trans("LinkToTrackYourPackage")."<br>";
|
||||
$label.=$outputlangs->trans("SendingMethod".strtoupper($code))." :";
|
||||
$label='';
|
||||
if ($object->tracking_url != $object->tracking_number) $label.=$outputlangs->trans("LinkToTrackYourPackage")."<br>";
|
||||
$label.=$outputlangs->trans("SendingMethod").": ".$outputlangs->trans("SendingMethod".strtoupper($code));
|
||||
//var_dump($object->tracking_url != $object->tracking_number);exit;
|
||||
if ($object->tracking_url != $object->tracking_number)
|
||||
{
|
||||
$label.=" : ";
|
||||
$label.=$object->tracking_url;
|
||||
}
|
||||
$pdf->SetFont('','B', $default_font_size - 2);
|
||||
$pdf->writeHTMLCell(60, 4, $this->posxdesc-1, $tab_top+6, $label." ".$object->tracking_url, 0, 1, false, true, 'L');
|
||||
$pdf->writeHTMLCell(60, 4, $this->posxdesc-1, $tab_top_alt, $label, 0, 1, false, true, 'L');
|
||||
|
||||
$tab_top_alt = $pdf->GetY();
|
||||
}
|
||||
@ -537,7 +544,7 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
$posy+=4;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->date_creation,"daytext",false,$outputlangs,true), '', 'R');
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->date_livraison,"daytext",false,$outputlangs,true), '', 'R');
|
||||
|
||||
if (! empty($object->client->code_client))
|
||||
{
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2010-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -273,6 +273,9 @@ else {
|
||||
elseif ($this->table_element_line=='facturedet') {
|
||||
$newline = new FactureLigne($this->db);
|
||||
}
|
||||
elseif ($this->table_element_line=='contratdet') {
|
||||
$newline = new ContratLigne($this->db);
|
||||
}
|
||||
if (is_object($newline)) {
|
||||
print $newline->showOptionals($extrafieldsline, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay+8));
|
||||
}
|
||||
|
||||
@ -664,7 +664,7 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti
|
||||
$userstatic->lastname=$val['login_c'];
|
||||
$htmltooltip='<b>'.$langs->trans("ECMSection").'</b>: '.$val['label'].'<br>';
|
||||
$htmltooltip='<b>'.$langs->trans("Type").'</b>: '.$langs->trans("ECMSectionManual").'<br>';
|
||||
$htmltooltip.='<b>'.$langs->trans("ECMCreationUser").'</b>: '.$userstatic->getNomUrl(1).'<br>';
|
||||
$htmltooltip.='<b>'.$langs->trans("ECMCreationUser").'</b>: '.$userstatic->getNomUrl(1, '', false, 1).'<br>';
|
||||
$htmltooltip.='<b>'.$langs->trans("ECMCreationDate").'</b>: '.dol_print_date($val['date_c'],"dayhour").'<br>';
|
||||
$htmltooltip.='<b>'.$langs->trans("Description").'</b>: '.$val['description'].'<br>';
|
||||
$htmltooltip.='<b>'.$langs->trans("ECMNbOfFilesInDir").'</b>: '.$val['cachenbofdoc'].'<br>';
|
||||
|
||||
@ -150,6 +150,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'VEF'
|
||||
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'VND', '[8363]', 1, 'Viet Nam Dong');
|
||||
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XAF', NULL, 1, 'Communaute Financiere Africaine (BEAC) CFA Franc');
|
||||
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XOF', NULL, 1, 'Communaute Financiere Africaine (BCEAO) Franc');
|
||||
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XPF', NULL, 1, 'Franc pacifique (XPF)');
|
||||
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'YER', '[65020]', 1, 'Yemen Rial');
|
||||
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ZWD', '[90,36]', 1, 'Zimbabwe Dollar');
|
||||
|
||||
|
||||
@ -76,3 +76,15 @@ create table llx_bank_account_extrafields
|
||||
import_key varchar(14) -- import key
|
||||
) ENGINE=innodb;
|
||||
|
||||
ALTER TABLE llx_bank_account_extrafields ADD INDEX idx_bank_account_extrafields (fk_object);
|
||||
|
||||
|
||||
create table llx_contratdet_extrafields
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
tms timestamp,
|
||||
fk_object integer NOT NULL, -- object id
|
||||
import_key varchar(14) -- import key
|
||||
)ENGINE=innodb;
|
||||
|
||||
ALTER TABLE llx_contratdet_extrafields ADD INDEX idx_contratdet_extrafields (fk_object);
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
-- ===================================================================
|
||||
-- Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
--
|
||||
-- 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
|
||||
-- the Free Software Foundation; either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- ===================================================================
|
||||
|
||||
|
||||
ALTER TABLE llx_contratdet_extrafields ADD INDEX idx_contratdet_extrafields (fk_object);
|
||||
25
htdocs/install/mysql/tables/llx_contratdet_extrafields.sql
Normal file
25
htdocs/install/mysql/tables/llx_contratdet_extrafields.sql
Normal file
@ -0,0 +1,25 @@
|
||||
-- ===================================================================
|
||||
-- Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
--
|
||||
-- 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
|
||||
-- the Free Software Foundation; either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- ===================================================================
|
||||
|
||||
create table llx_contratdet_extrafields
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
tms timestamp,
|
||||
fk_object integer NOT NULL, -- object id
|
||||
import_key varchar(14) -- import key
|
||||
)ENGINE=innodb;
|
||||
@ -304,6 +304,7 @@ YouCanSubmitFile=Select module:
|
||||
CurrentVersion=Dolibarr current version
|
||||
CallUpdatePage=Go to the page that updates the database structure and datas: %s.
|
||||
LastStableVersion=Last stable version
|
||||
UpdateServerOffline=Update server offline
|
||||
GenericMaskCodes=You may enter any numbering mask. In this mask, the following tags could be used:<br><b>{000000}</b> corresponds to a number which will be incremented on each %s. Enter as many zeros as the desired length of the counter. The counter will be completed by zeros from the left in order to have as many zeros as the mask. <br><b>{000000+000}</b> same as previous but an offset corresponding to the number to the right of the + sign is applied starting on first %s. <br><b>{000000@x}</b> same as previous but the counter is reset to zero when month x is reached (x between 1 and 12, or 0 to use the early months of fiscal year defined in your configuration, or 99 to reset to zero every month). If this option is used and x is 2 or higher, then sequence {yy}{mm} or {yyyy}{mm} is also required. <br><b>{dd}</b> day (01 to 31).<br><b>{mm}</b> month (01 to 12).<br><b>{yy}</b>, <b>{yyyy}</b> or <b>{y}</b> year over 2, 4 or 1 numbers. <br>
|
||||
GenericMaskCodes2=<b>{cccc}</b> the client code on n characters<br><b>{cccc000}</b> the client code on n characters is followed by a counter dedicated for customer. This counter dedicated to customer is reset at same time than global counter.<br><b>{tttt}</b> The code of thirdparty type on n characters (see dictionary-thirdparty types).<br>
|
||||
GenericMaskCodes3=All other characters in the mask will remain intact.<br>Spaces are not allowed.<br>
|
||||
|
||||
@ -1401,43 +1401,6 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
|
||||
$form=new Form($db);
|
||||
|
||||
// Define link to login card
|
||||
/*
|
||||
$loginhtmltext=''; $logintext='';
|
||||
if ($user->societe_id)
|
||||
{
|
||||
$thirdpartystatic=new Societe($db);
|
||||
$thirdpartystatic->fetch($user->societe_id);
|
||||
$companylink=' ('.$thirdpartystatic->getNomUrl('','').')';
|
||||
$company=' ('.$langs->trans("Company").': '.$thirdpartystatic->name.')';
|
||||
}
|
||||
$logintext='<div class="login"><a href="'.DOL_URL_ROOT.'/user/card.php?id='.$user->id.'"';
|
||||
$logintext.=$target?(' target="'.$target.'"'):'';
|
||||
$logintext.='>'.$user->login.'</a>';
|
||||
if ($user->societe_id) $logintext.=$companylink;
|
||||
$logintext.='</div>';
|
||||
$loginhtmltext.='<u>'.$langs->trans("User").'</u>';
|
||||
$loginhtmltext.='<br><b>'.$langs->trans("Name").'</b>: '.$user->getFullName($langs);
|
||||
$loginhtmltext.='<br><b>'.$langs->trans("Login").'</b>: '.$user->login;
|
||||
$loginhtmltext.='<br><b>'.$langs->trans("EMail").'</b>: '.$user->email;
|
||||
$loginhtmltext.='<br><b>'.$langs->trans("Administrator").'</b>: '.yn($user->admin);
|
||||
$type=($user->societe_id?$langs->trans("External").$company:$langs->trans("Internal"));
|
||||
$loginhtmltext.='<br><b>'.$langs->trans("Type").'</b>: '.$type;
|
||||
$loginhtmltext.='<br>';
|
||||
$loginhtmltext.='<br><u>'.$langs->trans("Connection").'</u>';
|
||||
$loginhtmltext.='<br><b>'.$langs->trans("IPAddress").'</b>: '.$_SERVER["REMOTE_ADDR"];
|
||||
if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY)) $loginhtmltext.='<br><b>'.$langs->trans("ConnectedOnMultiCompany").'</b>: '.$conf->entity.' (user entity '.$user->entity.')';
|
||||
$loginhtmltext.='<br><b>'.$langs->trans("AuthenticationMode").'</b>: '.$_SESSION["dol_authmode"].(empty($dolibarr_main_demo)?'':' (demo)');
|
||||
$loginhtmltext.='<br><b>'.$langs->trans("ConnectedSince").'</b>: '.dol_print_date($user->datelastlogin,"dayhour");
|
||||
$loginhtmltext.='<br><b>'.$langs->trans("PreviousConnexion").'</b>: '.dol_print_date($user->datepreviouslogin,"dayhour");
|
||||
$loginhtmltext.='<br><b>'.$langs->trans("CurrentTheme").'</b>: '.$conf->theme;
|
||||
$loginhtmltext.='<br><b>'.$langs->trans("CurrentMenuManager").'</b>: '.$menumanager->name;
|
||||
$s=picto_from_langcode($langs->getDefaultLang());
|
||||
$loginhtmltext.='<br><b>'.$langs->trans("CurrentUserLanguage").'</b>: '.($s?$s.' ':'').$langs->getDefaultLang();
|
||||
$loginhtmltext.='<br><b>'.$langs->trans("Browser").'</b>: '.$conf->browser->name.($conf->browser->version?' '.$conf->browser->version:'').' ('.$_SERVER['HTTP_USER_AGENT'].')';
|
||||
if (! empty($conf->browser->phone)) $loginhtmltext.='<br><b>'.$langs->trans("Phone").'</b>: '.$conf->browser->phone;
|
||||
if (! empty($_SESSION["disablemodules"])) $loginhtmltext.='<br><b>'.$langs->trans("DisabledModules").'</b>: <br>'.join(', ',explode(',',$_SESSION["disablemodules"]));
|
||||
*/
|
||||
|
||||
$appli='Dolibarr';
|
||||
if (! empty($conf->global->MAIN_APPLICATION_TITLE))
|
||||
{
|
||||
@ -1471,7 +1434,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
|
||||
$toprightmenu.='<div class="login_block_user">';
|
||||
// Add login user link
|
||||
//$toprightmenu.=$form->textwithtooltip('',$loginhtmltext,2,1,$logintext,'login_block_elem2',2); // This include div class="login"
|
||||
$toprightmenu.= $user->getNomurl(0, '', 1);
|
||||
$toprightmenu.= $user->getNomurl(0, '', true, 0, 11);
|
||||
$toprightmenu.='</div>';
|
||||
|
||||
$toprightmenu.='<div class="login_block_other">';
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
/**
|
||||
* \file htdocs/product/class/priceexpression.class.php
|
||||
* \ingroup product
|
||||
* \brief Class for accesing price expression table
|
||||
* \brief Class for accessing price expression table
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@ -21,7 +21,6 @@
|
||||
* \brief File of class to calculate prices using expression
|
||||
*/
|
||||
require_once DOL_DOCUMENT_ROOT.'/includes/evalmath/evalmath.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/priceexpression.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
@ -267,7 +266,7 @@ class PriceParser
|
||||
public function parseProductSupplierExpression($product_id, $expression, $quantity = null, $tva_tx = null, $extra_values = array())
|
||||
{
|
||||
//Get the product data
|
||||
$product = new Product($this->db);
|
||||
$product = new ProductFournisseur($this->db);
|
||||
$product->fetch($product_id, '', '', 1);
|
||||
|
||||
//Accessible values by expressions
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
* Copyright (C) 2011-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2014 Henry Florian <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2014 Ion agorria <ion@agorria.com>
|
||||
* Copyright (C) 2014 Ion agorria <ion@agorria.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
|
||||
@ -33,7 +33,6 @@
|
||||
*/
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/priceparser.class.php';
|
||||
|
||||
|
||||
/**
|
||||
@ -167,7 +166,7 @@ class Product extends CommonObject
|
||||
|
||||
//note not visible on orders and invoices
|
||||
var $note;
|
||||
|
||||
|
||||
var $fk_price_expression;
|
||||
|
||||
/**
|
||||
@ -1076,10 +1075,10 @@ class Product extends CommonObject
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
while ( $obj = $this->db->fetch_object($result) )
|
||||
while ($obj = $this->db->fetch_object($result))
|
||||
{
|
||||
//print 'lang='.$obj->lang.' current='.$current_lang.'<br>';
|
||||
if( $obj->lang == $current_lang ) // si on a les traduct. dans la langue courante on les charge en infos principales.
|
||||
if ($obj->lang == $current_lang) // si on a les traduct. dans la langue courante on les charge en infos principales.
|
||||
{
|
||||
$this->label = $obj->label;
|
||||
$this->description = $obj->description;
|
||||
@ -1094,7 +1093,7 @@ class Product extends CommonObject
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error="Error: ".$this->db->error()." - ".$sql;
|
||||
$this->error="Error: ".$this->db->lasterror()." - ".$sql;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -1102,9 +1101,9 @@ class Product extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Ajoute un changement de prix en base dans l'historique des prix
|
||||
* Insert a track that we changed a customer price
|
||||
*
|
||||
* @param User $user Objet utilisateur qui modifie le prix
|
||||
* @param User $user User making change
|
||||
* @param int $level price level to change
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
@ -1118,14 +1117,14 @@ class Product extends CommonObject
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product_price(price_level,date_price,fk_product,fk_user_author,price,price_ttc,price_base_type,tosell,tva_tx,recuperableonly,";
|
||||
$sql.= " localtax1_tx, localtax2_tx, price_min,price_min_ttc,price_by_qty,entity,fk_price_expression) ";
|
||||
$sql.= " VALUES(".($level?$level:1).", '".$this->db->idate($now)."',".$this->id.",".$user->id.",".$this->price.",".$this->price_ttc.",'".$this->price_base_type."',".$this->status.",".$this->tva_tx.",".$this->tva_npr.",";
|
||||
$sql.= " ".$this->localtax1_tx.",".$this->localtax2_tx.",".$this->price_min.",".$this->price_min_ttc.",".$this->price_by_qty.",".$conf->entity.",".$this->fk_price_expression;
|
||||
$sql.= " ".$this->localtax1_tx.",".$this->localtax2_tx.",".$this->price_min.",".$this->price_min_ttc.",".$this->price_by_qty.",".$conf->entity.",".($this->fk_price_expression > 0?$this->fk_price_expression:'null');
|
||||
$sql.= ")";
|
||||
|
||||
dol_syslog(get_class($this)."_log_price", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if(! $resql)
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
$this->error=$this->db->lasterror();
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
@ -1175,7 +1174,6 @@ class Product extends CommonObject
|
||||
*/
|
||||
function get_buyprice($prodfournprice,$qty,$product_id=0,$fourn_ref=0)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/priceparser.class.php';
|
||||
$result = 0;
|
||||
|
||||
// We do select by searching with qty and prodfournprice
|
||||
@ -1192,8 +1190,10 @@ class Product extends CommonObject
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
if ($obj && $obj->quantity > 0) // If found
|
||||
{
|
||||
if (!empty($obj->fk_supplier_price_expression)) {
|
||||
$priceparser = new PriceParser($this->db);
|
||||
if (!empty($obj->fk_supplier_price_expression))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/priceparser.class.php';
|
||||
$priceparser = new PriceParser($this->db);
|
||||
$price_result = $priceparser->parseProductSupplier($obj->fk_product, $obj->fk_supplier_price_expression, $obj->quantity, $obj->tva_tx);
|
||||
if ($price_result >= 0) {
|
||||
$obj->price = $price_result;
|
||||
@ -1225,8 +1225,10 @@ class Product extends CommonObject
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
if ($obj && $obj->quantity > 0) // If found
|
||||
{
|
||||
if (!empty($obj->fk_supplier_price_expression)) {
|
||||
$priceparser = new PriceParser($this->db);
|
||||
if (!empty($obj->fk_supplier_price_expression))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/priceparser.class.php';
|
||||
$priceparser = new PriceParser($this->db);
|
||||
$price_result = $priceparser->parseProductSupplier($obj->fk_product, $obj->fk_supplier_price_expression, $obj->quantity, $obj->tva_tx);
|
||||
if ($result >= 0) {
|
||||
$obj->price = $price_result;
|
||||
@ -1285,7 +1287,7 @@ class Product extends CommonObject
|
||||
// Clean parameters
|
||||
if (empty($this->tva_tx)) $this->tva_tx=0;
|
||||
if (empty($newnpr)) $newnpr=0;
|
||||
|
||||
|
||||
// Check parameters
|
||||
if ($newvat == '') $newvat=$this->tva_tx;
|
||||
if (! empty($newminprice) && ($newminprice > $newprice))
|
||||
@ -1679,11 +1681,12 @@ class Product extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($this->fk_price_expression) && empty($ignore_expression))
|
||||
if (!empty($this->fk_price_expression) && empty($ignore_expression))
|
||||
{
|
||||
$priceparser = new PriceParser($this->db);
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/priceparser.class.php';
|
||||
$priceparser = new PriceParser($this->db);
|
||||
$price_result = $priceparser->parseProduct($this);
|
||||
if ($price_result >= 0)
|
||||
if ($price_result >= 0)
|
||||
{
|
||||
$this->price = $price_result;
|
||||
//Calculate the VAT
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2005 Marc Bariley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||
*
|
||||
* 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 +29,7 @@
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
|
||||
$langs->load('projects');
|
||||
|
||||
@ -64,6 +66,16 @@ $search_label=GETPOST("search_label");
|
||||
$search_societe=GETPOST("search_societe");
|
||||
$search_year=GETPOST("search_year");
|
||||
$search_all=GETPOST("search_all");
|
||||
$search_status=GETPOST("search_status",'int');
|
||||
$search_public=GETPOST("search_public",'int');
|
||||
$search_user=GETPOST('search_user','int');
|
||||
$search_sale=GETPOST('search_sale','int');
|
||||
|
||||
$day = GETPOST('day','int');
|
||||
$month = GETPOST('month','int');
|
||||
$year = GETPOST('year','int');
|
||||
|
||||
|
||||
|
||||
// Purge criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||
@ -73,6 +85,13 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
||||
$search_societe="";
|
||||
$search_year="";
|
||||
$search_all=0;
|
||||
$search_status=1;
|
||||
$search_public="";
|
||||
$search_sale="";
|
||||
$search_user='';
|
||||
$day="";
|
||||
$month="";
|
||||
$year="";
|
||||
}
|
||||
|
||||
/*
|
||||
@ -81,6 +100,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
||||
|
||||
$projectstatic = new Project($db);
|
||||
$socstatic = new Societe($db);
|
||||
$form = new Form($db);
|
||||
$formother = new FormOther($db);
|
||||
|
||||
llxHeader("",$langs->trans("Projects"),"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos");
|
||||
|
||||
@ -92,6 +113,15 @@ $sql.= ", p.datec as date_create, p.dateo as date_start, p.datee as date_end";
|
||||
$sql.= ", s.nom as name, s.rowid as socid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
||||
|
||||
// We'll need this table joined to the select in order to filter by sale
|
||||
if ($search_sale || (! $user->rights->societe->client->voir && ! $socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
if ($search_user > 0)
|
||||
{
|
||||
$sql.=", ".MAIN_DB_PREFIX."element_contact as c";
|
||||
$sql.=", ".MAIN_DB_PREFIX."c_type_contact as tc";
|
||||
}
|
||||
|
||||
$sql.= " WHERE p.entity = ".$conf->entity;
|
||||
if ($mine || ! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")";
|
||||
// No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser
|
||||
@ -109,14 +139,36 @@ if ($search_societe)
|
||||
{
|
||||
$sql .= natural_search('s.nom', $search_societe);
|
||||
}
|
||||
if ($search_year) {
|
||||
$sql .= " AND (p.dateo IS NULL OR p.dateo <= ".$db->idate(dol_get_last_day($search_year,12,false)).")";
|
||||
$sql .= " AND (p.datee IS NULL OR p.datee >= ".$db->idate(dol_get_first_day($search_year,1,false)).")";
|
||||
if ($month > 0)
|
||||
{
|
||||
if ($year > 0 && empty($day))
|
||||
$sql.= " AND p.datee BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'";
|
||||
else if ($year > 0 && ! empty($day))
|
||||
$sql.= " AND p.datee BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'";
|
||||
else
|
||||
$sql.= " AND date_format(p.datee, '%m') = '".$month."'";
|
||||
}
|
||||
else if ($year > 0)
|
||||
{
|
||||
$sql.= " AND p.datee BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
|
||||
}
|
||||
|
||||
if ($search_all)
|
||||
{
|
||||
$sql .= natural_search(array('p.ref','p.title','s.nom'), $search_all);
|
||||
}
|
||||
|
||||
if ($search_status!='') $sql .= " AND p.fk_statut = ".$db->escape($search_status);
|
||||
|
||||
if ($search_public!='') $sql .= " AND p.public = ".$db->escape($search_public);
|
||||
|
||||
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
|
||||
if ($search_user > 0)
|
||||
{
|
||||
$sql.= " AND c.fk_c_type_contact = tc.rowid AND tc.element='project' AND tc.source='internal' AND c.element_id = p.rowid AND c.fk_socpeople = ".$search_user;
|
||||
}
|
||||
|
||||
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||
|
||||
@ -127,11 +179,28 @@ if ($resql)
|
||||
$var=true;
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
$param='';
|
||||
if ($month) $param.='&month='.$month;
|
||||
if ($year) $param.='&year=' .$year;
|
||||
if ($search_ref != '') $param.='&search_ref='.$search_ref;
|
||||
if ($search_label != '') $param.='&search_label='.$search_label;
|
||||
if ($search_societe != '') $param.='&search_societe='.$search_societe;
|
||||
if ($search_status != '') $param.='&search_status='.$search_status;
|
||||
if ($search_public != '') $param.='&search_public='.$search_public;
|
||||
if ($search_user > 0) $param.='&search_user='.$search_user;
|
||||
if ($search_sale > 0) $param.='&search_sale='.$search_sale;
|
||||
|
||||
|
||||
$text=$langs->trans("Projects");
|
||||
if ($mine) $text=$langs->trans('MyProjects');
|
||||
print_barre_liste($text, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num);
|
||||
|
||||
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
|
||||
// Show description of content
|
||||
if ($mine) print $langs->trans("MyProjectsDesc").'<br><br>';
|
||||
else
|
||||
@ -139,16 +208,40 @@ if ($resql)
|
||||
if ($user->rights->projet->all->lire && ! $socid) print $langs->trans("ProjectsDesc").'<br><br>';
|
||||
else print $langs->trans("ProjectsPublicDesc").'<br><br>';
|
||||
}
|
||||
|
||||
// If the user can view prospects other than his'
|
||||
if ($user->rights->societe->client->voir || $socid)
|
||||
{
|
||||
$langs->load("commercial");
|
||||
$moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': ';
|
||||
$moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user);
|
||||
$moreforfilter.=' ';
|
||||
}
|
||||
// If the user can view prospects other than his'
|
||||
|
||||
if (($user->rights->societe->client->voir || $socid) && !$mine)
|
||||
{
|
||||
$moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': ';
|
||||
$moreforfilter.=$form->select_dolusers($search_user,'search_user',1);
|
||||
}
|
||||
if (! empty($moreforfilter))
|
||||
{
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre" colspan="10">';
|
||||
print $moreforfilter;
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"p.ref","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"p.title","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Visibility"),$_SERVER["PHP_SELF"],"p.public","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],'p.fk_statut',"","",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"p.ref","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"p.title","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("SalesRepresentative"),$_SERVER["PHP_SELF"],"","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"p.datee","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Visibility"),$_SERVER["PHP_SELF"],"p.public","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],'p.fk_statut',"",$param,'align="right"',$sortfield,$sortorder);
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -162,6 +255,22 @@ if ($resql)
|
||||
print '<input type="text" class="flat" name="search_societe" value="'.$search_societe.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
|
||||
print '<td class="liste_titre">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.$day.'">';
|
||||
print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
|
||||
$formother->select_year($year?$year:-1,'year',1, 20, 5);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="liste_titre">';
|
||||
$array=array(''=>'',0 => $langs->trans("PrivateProject"),1 => $langs->trans("SharedProject"));
|
||||
print $form->selectarray('search_public',$array,$search_public);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
|
||||
print $form->selectarray('search_status', array(''=>'', '0'=>$langs->trans('Draft'),'1'=>$langs->trans('Opened'),'2'=>$langs->trans('Closed')),$search_status);
|
||||
|
||||
print '</td>';
|
||||
print '<td class="liste_titre nowrap" align="right">';
|
||||
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("RemoveFilter"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
@ -207,6 +316,46 @@ if ($resql)
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Sales Rapresentatives
|
||||
print '<td>';
|
||||
if($objp->socid)
|
||||
{
|
||||
$listsalesrepresentatives=$socstatic->getSalesRepresentatives($user);
|
||||
$nbofsalesrepresentative=count($listsalesrepresentatives);
|
||||
if ($nbofsalesrepresentative > 3) // We print only number
|
||||
{
|
||||
print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$socstatic->id.'">';
|
||||
print $nbofsalesrepresentative;
|
||||
print '</a>';
|
||||
}
|
||||
else if ($nbofsalesrepresentative > 0)
|
||||
{
|
||||
$userstatic=new User($db);
|
||||
$j=0;
|
||||
foreach($listsalesrepresentatives as $val)
|
||||
{
|
||||
$userstatic->id=$val['id'];
|
||||
$userstatic->lastname=$val['lastname'];
|
||||
$userstatic->firstname=$val['firstname'];
|
||||
print $userstatic->getNomUrl(1);
|
||||
$j++;
|
||||
if ($j < $nbofsalesrepresentative) print ', ';
|
||||
}
|
||||
}
|
||||
else print $langs->trans("NoSalesRepresentativeAffected");
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Date end
|
||||
print '<td align="left">';
|
||||
print dol_print_date($db->jdate($objp->date_end),'day');
|
||||
print '</td>';
|
||||
|
||||
// Visibility
|
||||
print '<td align="left">';
|
||||
if ($objp->public) print $langs->trans('SharedProject');
|
||||
|
||||
@ -1700,14 +1700,17 @@ class Societe extends CommonObject
|
||||
* @param int $withpicto Add picto into link (0=No picto, 1=Include picto with link, 2=Picto only)
|
||||
* @param string $option Target of link ('', 'customer', 'prospect', 'supplier')
|
||||
* @param int $maxlen Max length of text
|
||||
* @param string $notooltip 1=Disable tooltip
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option='',$maxlen=0)
|
||||
function getNomUrl($withpicto=0,$option='',$maxlen=0,$notooltip=0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
$name=$this->name?$this->name:$this->nom;
|
||||
|
||||
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1;
|
||||
|
||||
if ($conf->global->SOCIETE_ADD_REF_IN_LIST && (!empty($withpicto))) {
|
||||
if (($this->client) && (! empty ( $this->code_client ))) {
|
||||
$code = $this->code_client . ' - ';
|
||||
@ -1718,11 +1721,10 @@ class Societe extends CommonObject
|
||||
$name =$code.' '.$name;
|
||||
}
|
||||
|
||||
$result='';
|
||||
$lien=$lienfin='';
|
||||
$label = '<table width="100%">';
|
||||
$label.= '<tr>';
|
||||
$label.= '<td valign="top">';
|
||||
$result=''; $label='';
|
||||
$lien=''; $lienfin='';
|
||||
|
||||
$label.= '<div width="100%">';
|
||||
|
||||
if ($option == 'customer' || $option == 'compta')
|
||||
{
|
||||
@ -1764,18 +1766,21 @@ class Societe extends CommonObject
|
||||
if (! empty($this->code_fournisseur))
|
||||
$label.= '<br><b>' . $langs->trans('SupplierCode') . ':</b> '. $this->code_fournisseur;
|
||||
|
||||
$label.= '</td>';
|
||||
if (! empty($this->logo)) {
|
||||
$form = new Form($db);
|
||||
$label .= '<td> </td><td align="right">' . $form->showphoto('societe', $this, 80) . '</td>';
|
||||
if (! empty($this->logo))
|
||||
{
|
||||
$label.= '</div><div style="padding: 10px">';
|
||||
//if (! is_object($form)) $form = new Form($db);
|
||||
$label.= Form::showphoto('societe', $this, 80);
|
||||
}
|
||||
$label.= '</tr></table>';
|
||||
$label.= '</div>';
|
||||
|
||||
// Add type of canvas
|
||||
$lien.=(!empty($this->canvas)?'&canvas='.$this->canvas:'').'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
$lien.=(!empty($this->canvas)?'&canvas='.$this->canvas:'').'"';
|
||||
$lien.=($notooltip?'':' title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip"');
|
||||
$lien.='>';
|
||||
$lienfin='</a>';
|
||||
|
||||
if ($withpicto) $result.=($lien.img_object($label, 'company', 'class="classfortooltip"').$lienfin);
|
||||
if ($withpicto) $result.=($lien.img_object(($notooltip?'':$label), 'company', ($notooltip?'':'class="classfortooltip"')).$lienfin);
|
||||
if ($withpicto && $withpicto != 2) $result.=' ';
|
||||
$result.=$lien.($maxlen?dol_trunc($name,$maxlen):$name).$lienfin;
|
||||
|
||||
|
||||
@ -295,45 +295,26 @@ if ($result)
|
||||
$thirdparty_static->datem=$db->jdate($objp->datem);
|
||||
$thirdparty_static->status=$objp->status;
|
||||
$thirdparty_static->canvas=$objp->canvas;
|
||||
//print $thirdparty_static->getNomUrl(1);
|
||||
//print "</td>\n";
|
||||
print $thirdparty_static->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
// Type
|
||||
//print '<td align="center">';
|
||||
print '<td align="center">';
|
||||
if ($thirdparty_static->client==1 || $thirdparty_static->client==3)
|
||||
{
|
||||
print $thirdparty_static->getNomUrl(1, 'customer');
|
||||
print "</td>\n";
|
||||
// Type
|
||||
print '<td align="center">';
|
||||
print $langs->trans("Customer");
|
||||
}
|
||||
if ($thirdparty_static->client == 3 && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) {
|
||||
print $thirdparty_static->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
// Type
|
||||
print '<td align="center">';
|
||||
print " / ";
|
||||
$thirdparty_static->name=$langs->trans("Customer");
|
||||
print $thirdparty_static->getNomUrl(0,'customer',0,1);
|
||||
}
|
||||
if ($thirdparty_static->client == 3 && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) print " / ";
|
||||
if (($thirdparty_static->client==2 || $thirdparty_static->client==3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS))
|
||||
{
|
||||
print $thirdparty_static->getNomUrl(1, 'prospect');
|
||||
print "</td>\n";
|
||||
// Type
|
||||
print '<td align="center">';
|
||||
print $langs->trans("Prospect");
|
||||
$thirdparty_static->name=$langs->trans("Prospect");
|
||||
print $thirdparty_static->getNomUrl(0,'prospect',0,1);
|
||||
}
|
||||
if (! empty($conf->fournisseur->enabled) && $thirdparty_static->fournisseur)
|
||||
{
|
||||
if (! $thirdparty_static->client) {
|
||||
print $thirdparty_static->getNomUrl(1, 'supplier');
|
||||
print "</td>\n";
|
||||
print '<td align="center">';
|
||||
print $langs->trans("Supplier");
|
||||
} else {
|
||||
// Type
|
||||
print " / ";
|
||||
print $langs->trans("Supplier");
|
||||
}
|
||||
if ($thirdparty_static->client) print " / ";
|
||||
$thirdparty_static->name=$langs->trans("Supplier");
|
||||
print $thirdparty_static->getNomUrl(0,'supplier',0,1);
|
||||
}
|
||||
print '</td>';
|
||||
// Last modified date
|
||||
|
||||
@ -1778,9 +1778,11 @@ class User extends CommonObject
|
||||
* @param int $withpicto Include picto in link (0=No picto, 1=Inclut le picto dans le lien, 2=Picto seul)
|
||||
* @param string $option On what the link point to
|
||||
* @param boolean $infologin Add connection info to the tooltip
|
||||
* @param string $notooltip 1=Disable tooltip
|
||||
* @param int $maxlen Max length of visible user name
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0, $option='', $infologin=0)
|
||||
function getNomUrl($withpicto=0, $option='', $infologin=0, $notooltip=0, $maxlen=24)
|
||||
{
|
||||
global $langs, $conf, $db;
|
||||
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
||||
@ -1790,10 +1792,8 @@ class User extends CommonObject
|
||||
$companylink = '';
|
||||
|
||||
$label = '<u>' . $langs->trans("User") . '</u>';
|
||||
$label.= '<table class="login" width="100%">';
|
||||
$label.= '<tr>';
|
||||
$label.= '<td valign="top">';
|
||||
$label .= '<b>' . $langs->trans('Name') . ':</b> ' . $this->getFullName($langs,'','',24);
|
||||
$label.= '<div width="100%">';
|
||||
$label .= '<b>' . $langs->trans('Name') . ':</b> ' . $this->getFullName($langs,'','');
|
||||
if (! empty($this->login))
|
||||
$label .= '<br><b>' . $langs->trans('Login') . ':</b> ' . $this->login;
|
||||
if (! empty($this->email))
|
||||
@ -1808,14 +1808,17 @@ class User extends CommonObject
|
||||
}
|
||||
$type=($this->societe_id?$langs->trans("External").$company:$langs->trans("Internal"));
|
||||
$label .= '<br><b>' . $langs->trans("Type") . ':</b> ' . $type;
|
||||
if (! empty($this->photo)) {
|
||||
$form = new Form($db);
|
||||
$label .= '<td> </td><td align="right">' . $form->showphoto('userphoto', $this, 80) . '</td>';
|
||||
if (! empty($this->photo))
|
||||
{
|
||||
$label.= '</div><div style="padding: 10px">';
|
||||
//if (! is_object($form)) $form = new Form($db);
|
||||
$label.= Form::showphoto('userphoto', $this, 80);
|
||||
}
|
||||
$label.= '</tr></table>';
|
||||
$label.= '</div>';
|
||||
|
||||
// Info Login
|
||||
if ($infologin) {
|
||||
if ($infologin)
|
||||
{
|
||||
$label.= '<br>';
|
||||
$label.= '<br><u>'.$langs->trans("Connection").'</u>';
|
||||
$label.= '<br><b>'.$langs->trans("IPAddress").'</b>: '.$_SERVER["REMOTE_ADDR"];
|
||||
@ -1833,14 +1836,17 @@ class User extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
$lien = '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
$lien = '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$this->id.'"';
|
||||
$lien.= ($notooltip?'':' title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip"');
|
||||
$lien.= '>';
|
||||
$lienfin='</a>';
|
||||
|
||||
if ($withpicto) {
|
||||
$result.=($lien.img_object($label, 'user', 'class="classfortooltip"').$lienfin);
|
||||
if ($withpicto)
|
||||
{
|
||||
$result.=($lien.img_object(($notooltip?'':$label), 'user', ($notooltip?'':'class="classfortooltip"')).$lienfin);
|
||||
if ($withpicto != 2) $result.=' ';
|
||||
}
|
||||
$result.= $lien . $this->getFullName($langs,'','',24) . $companylink . $lienfin;
|
||||
$result.= $lien . $this->getFullName($langs,'','',$maxlen) . $companylink . $lienfin;
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@ -668,6 +668,25 @@ function updateProductOrService($authentication,$product)
|
||||
{
|
||||
$error++;
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
if ($newobject->price_base_type == 'HT')
|
||||
{
|
||||
$result=$newobject->updatePrice($newobject->price, $newobject->price_base_type,$fuser);
|
||||
if ($result <= 0)
|
||||
{
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
elseif ($newobject->price_base_type == 'TTC')
|
||||
{
|
||||
$result=$newobject->updatePrice($newobject->price_ttc, $newobject->price_base_type);
|
||||
if ($result <= 0)
|
||||
{
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user