Merge remote-tracking branch 'Upstream/develop' into 5.0-p32
Conflicts: htdocs/core/menus/standard/eldy.lib.php
This commit is contained in:
commit
883446c5bb
@ -93,12 +93,12 @@ class SkeletonApi extends DolibarrApi
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
*
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101') or (t.import_key:=:'20160101')"
|
||||
* @return array Array of skeleton objects
|
||||
*
|
||||
* @url GET /skeletons/
|
||||
*/
|
||||
function getList($mode, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) {
|
||||
function index($mode, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0, $sqlfilters = '') {
|
||||
global $db, $conf;
|
||||
|
||||
$obj_ret = array();
|
||||
@ -124,18 +124,19 @@ class SkeletonApi extends DolibarrApi
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND s.fk_soc = sc.fk_soc";
|
||||
if ($socid) $sql.= " AND s.fk_soc = ".$socid;
|
||||
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
|
||||
|
||||
// Insert sale filter
|
||||
if ($search_sale > 0)
|
||||
{
|
||||
$sql .= " AND sc.fk_user = ".$search_sale;
|
||||
}
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
if ($sqlfilters)
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (! DolibarrApi::_checkFilters($sqlfilters))
|
||||
{
|
||||
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
|
||||
}
|
||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
|
||||
@ -454,33 +454,49 @@ class Skeleton_Class extends CommonObject
|
||||
* @param integer $notooltip 1=Disable tooltip
|
||||
* @param int $maxlen Max length of visible user name
|
||||
* @param string $morecss Add more css on link
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0, $option='', $notooltip=0, $maxlen=24, $morecss='')
|
||||
function getNomUrl($withpicto=0, $option='', $notooltip=0, $maxlen=24, $morecss='', $notooltip=0)
|
||||
{
|
||||
global $langs, $conf, $db;
|
||||
global $db, $conf, $langs;
|
||||
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
||||
global $menumanager;
|
||||
|
||||
|
||||
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
|
||||
|
||||
$result = '';
|
||||
$companylink = '';
|
||||
|
||||
$label = '<u>' . $langs->trans("MyModule") . '</u>';
|
||||
$label.= '<div width="100%">';
|
||||
$label.= '<br>';
|
||||
$label.= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
|
||||
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/mymodule/'.$this->table_name.'_card.php?id='.$this->id.'"';
|
||||
$link.= ($notooltip?'':' title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip'.($morecss?' '.$morecss:'').'"');
|
||||
$link.= '>';
|
||||
$url = DOL_URL_ROOT.'/mymodule/'.$this->table_name.'_card.php?id='.$this->id;
|
||||
|
||||
$linkclose='';
|
||||
if (empty($notooltip))
|
||||
{
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$label=$langs->trans("ShowProject");
|
||||
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose.=' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose.=' class="classfortooltip'.($morecss?' '.$morecss:'').'"';
|
||||
}
|
||||
else $linkclose = ($morecss?' class="'.$morecss.'"':'');
|
||||
|
||||
$linkstart = '<a href="'.$url.'"';
|
||||
$linkstart.=$linkclose.'>';
|
||||
$linkend='</a>';
|
||||
|
||||
if ($withpicto)
|
||||
{
|
||||
$result.=($link.img_object(($notooltip?'':$label), 'label', ($notooltip?'':'class="classfortooltip"')).$linkend);
|
||||
$result.=($linkstart.img_object(($notooltip?'':$label), 'label', ($notooltip?'':'class="classfortooltip"')).$linkend);
|
||||
if ($withpicto != 2) $result.=' ';
|
||||
}
|
||||
$result.= $link . $this->ref . $linkend;
|
||||
$result.= $linkstart . $this->ref . $linkend;
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@ -84,13 +84,12 @@ class Members extends DolibarrApi
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $typeid ID of the type of member
|
||||
* @param string $login To filter the members by login
|
||||
* @param string $name To filter the members by name (firstname, lastname or company name matching the filter)
|
||||
* @return array Array of member objects
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @return array Array of member objects
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
function index($sortfield = "a.rowid", $sortorder = 'ASC', $limit = 0, $page = 0, $typeid = '', $login = '', $name = '') {
|
||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 0, $page = 0, $typeid = '', $login = '', $name = '', $sqlfilters = '') {
|
||||
global $db, $conf;
|
||||
|
||||
$obj_ret = array();
|
||||
@ -99,27 +98,24 @@ class Members extends DolibarrApi
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
$sql = "SELECT a.rowid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a";
|
||||
$sql.= ' WHERE a.entity IN ('.getEntity('adherent', 1).')';
|
||||
$sql = "SELECT t.rowid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as t";
|
||||
$sql.= ' WHERE t.entity IN ('.getEntity('adherent', 1).')';
|
||||
if (!empty($typeid))
|
||||
{
|
||||
$sql.= ' AND a.fk_adherent_type='.$typeid;
|
||||
$sql.= ' AND t.fk_adherent_type='.$typeid;
|
||||
}
|
||||
if (!empty($login)) {
|
||||
$sql .= " AND a.login LIKE '%".$login."%'";
|
||||
}
|
||||
if (!empty($name)) {
|
||||
$sql .= " AND (a.firstname LIKE '%".$name."%' OR a.lastname LIKE '%".$name."%' OR a.societe LIKE '%".$name."%')";
|
||||
}
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
// Add sql filters
|
||||
if ($sqlfilters)
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (! DolibarrApi::_checkFilters($sqlfilters))
|
||||
{
|
||||
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
|
||||
}
|
||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
if ($limit) {
|
||||
if ($page < 0)
|
||||
|
||||
@ -80,11 +80,12 @@ class Subscriptions extends DolibarrApi
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.import_key:<:'20160101')"
|
||||
* @return array Array of subscription objects
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
function index($sortfield = "dateadh", $sortorder = 'ASC', $limit = 0, $page = 0) {
|
||||
function index($sortfield = "dateadh", $sortorder = 'ASC', $limit = 0, $page = 0, $sqlfilters = '') {
|
||||
global $db, $conf;
|
||||
|
||||
$obj_ret = array();
|
||||
@ -94,15 +95,19 @@ class Subscriptions extends DolibarrApi
|
||||
}
|
||||
|
||||
$sql = "SELECT rowid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."subscription";
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."subscription as t";
|
||||
$sql.= ' WHERE 1 = 1';
|
||||
// Add sql filters
|
||||
if ($sqlfilters)
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (! DolibarrApi::_checkFilters($sqlfilters))
|
||||
{
|
||||
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
|
||||
}
|
||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
if ($limit) {
|
||||
if ($page < 0)
|
||||
|
||||
@ -104,7 +104,7 @@ if ($action == 'update')
|
||||
else dolibarr_set_const($db, 'THEME_ELDY_TEXTLINK', implode(',',colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'),array())),'chaine',0,'',$conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_SIZE_SHORTLISTE_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity);
|
||||
@ -225,7 +225,7 @@ if ($action == 'edit') // Edit
|
||||
|
||||
// Max size of short lists on customer card
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMaxSizeShortList").'</td><td><input class="flat" name="main_size_shortliste_limit" size="4" value="' . $conf->global->MAIN_SIZE_SHORTLISTE_LIMIT . '"></td>';
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMaxSizeShortList").'</td><td><input class="flat" name="main_size_shortliste_limit" size="4" value="' . $conf->global->MAIN_SIZE_SHORTLIST_LIMIT . '"></td>';
|
||||
print '<td width="20"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -408,7 +408,7 @@ else // Show
|
||||
print "</tr>";
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMaxSizeShortList").'</td><td>' . $conf->global->MAIN_SIZE_SHORTLISTE_LIMIT . '</td>';
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMaxSizeShortList").'</td><td>' . $conf->global->MAIN_SIZE_SHORTLIST_LIMIT . '</td>';
|
||||
print '<td width="20"> </td>';
|
||||
print "</tr>";
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.org>
|
||||
* Copyright (C) 2005-2016 Laurent Destailleur <eldy@users.sourceforge.org>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
@ -43,8 +43,16 @@ if ($action == 'setproductionmode')
|
||||
|
||||
if (dolibarr_set_const($db, 'API_PRODUCTION_MODE', $status, 'chaine', 0, '', $conf->entity) > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
$result = dol_mkdir($conf->api->dir_temp);
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFaildToCreateDir", $conf->api->dir_temp), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -71,7 +79,7 @@ print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print "<td>".$langs->trans("Parameter")."</td>";
|
||||
print "<td>".$langs->trans("Value")."</td>";
|
||||
print '<td align="center">'.$langs->trans("Value")."</td>";
|
||||
print "<td> </td>";
|
||||
print "</tr>";
|
||||
|
||||
|
||||
@ -162,4 +162,60 @@ class DolibarrApi
|
||||
|
||||
return checkUserAccessToObject(DolibarrApiAccess::$user, $featuresarray,$resource_id,$dbtablename,$feature2,$dbt_keyfield,$dbt_select);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if a $sqlfilters parameter is valid
|
||||
*
|
||||
* @param string $sqlfilters sqlfilter string
|
||||
* @return boolean True if valid, False if not valid
|
||||
*/
|
||||
function _checkFilters($sqlfilters)
|
||||
{
|
||||
//$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
//$tmp=preg_replace_all('/'.$regexstring.'/', '', $sqlfilters);
|
||||
$tmp=$sqlfilters;
|
||||
$ok=0;
|
||||
$i=0; $nb=count($tmp);
|
||||
$counter=0;
|
||||
while ($i < $nb)
|
||||
{
|
||||
if ($tmp[$i]=='(') $counter++;
|
||||
if ($tmp[$i]==')') $counter--;
|
||||
if ($counter < 0)
|
||||
{
|
||||
$error="Bad sqlfilters=".$sqlfilters;
|
||||
dol_syslog($error, LOG_WARNING);
|
||||
return false;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to forge a SQL criteria
|
||||
*
|
||||
* @param array $matches Array of found string by regex search
|
||||
* @return string Forged criteria. Example: "t.field like 'abc%'"
|
||||
*/
|
||||
protected static function _forge_criteria_callback($matches)
|
||||
{
|
||||
global $db;
|
||||
|
||||
//dol_syslog("Convert matches ".$matches[1]);
|
||||
if (empty($matches[1])) return '';
|
||||
$tmp=explode(':',$matches[1]);
|
||||
if (count($tmp) < 3) return '';
|
||||
|
||||
$tmpescaped=$tmp[2];
|
||||
if (preg_match('/^\'(.*)\'$/', $tmpescaped, $regbis))
|
||||
{
|
||||
$tmpescaped = "'".$db->escape($regbis[1])."'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmpescaped = $db->escape($tmpescaped);
|
||||
}
|
||||
return $db->escape($tmp[0]).' '.strtoupper($db->escape($tmp[1]))." ".$tmpescaped;
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,27 +54,31 @@ class DictionnaryCountries extends DolibarrApi
|
||||
* @param int $page Page number (starting from zero)
|
||||
* @param string $filter To filter the countries by name
|
||||
* @param string $lang Code of the language the label of the countries must be translated to
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @return List of countries
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
function index($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $filter = '', $lang = '')
|
||||
function index($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $filter = '', $lang = '', $sqlfilters = '')
|
||||
{
|
||||
$list = array();
|
||||
|
||||
// Note: The filter is not applied in the SQL request because it must
|
||||
// be applied to the translated names, not to the names in database.
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."c_country";
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."c_country as t";
|
||||
$sql.=" WHERE 1 = 1";
|
||||
// Add sql filters
|
||||
if ($sqlfilters)
|
||||
{
|
||||
$result = $this->db->query($sql);
|
||||
$nbtotalofrecords = $this->db->num_rows($result);
|
||||
if (! DolibarrApi::_checkFilters($sqlfilters))
|
||||
{
|
||||
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
|
||||
}
|
||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
$sql.= $this->db->order($sortfield, $sortorder);
|
||||
|
||||
|
||||
if ($limit) {
|
||||
if ($page < 0) {
|
||||
|
||||
@ -47,27 +47,32 @@ class DictionnaryTowns extends DolibarrApi
|
||||
* @param int $page Page number (starting from zero)
|
||||
* @param string $zipcode To filter on zipcode
|
||||
* @param string $town To filter on city name
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @return List of towns
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
function index($sortfield = "zip,town", $sortorder = 'ASC', $limit = 100, $page = 0, $zipcode = '', $town = '')
|
||||
function index($sortfield = "zip,town", $sortorder = 'ASC', $limit = 100, $page = 0, $zipcode = '', $town = '', $sqlfilters = '')
|
||||
{
|
||||
$list = array();
|
||||
|
||||
$sql = "SELECT rowid AS id, zip, town, fk_county, fk_pays AS fk_country";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_ziptown";
|
||||
$sql.= " WHERE active = 1";
|
||||
if ($zipcode) $sql.=" AND zip LIKE '%" . $this->db->escape($zipcode) . "%'";
|
||||
if ($town) $sql.=" AND town LIKE '%" . $this->db->escape($town) . "%'";
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_ziptown as t";
|
||||
$sql.= " WHERE t.active = 1";
|
||||
if ($zipcode) $sql.=" AND t.zip LIKE '%" . $this->db->escape($zipcode) . "%'";
|
||||
if ($town) $sql.=" AND t.town LIKE '%" . $this->db->escape($town) . "%'";
|
||||
// Add sql filters
|
||||
if ($sqlfilters)
|
||||
{
|
||||
$result = $this->db->query($sql);
|
||||
$nbtotalofrecords = $this->db->num_rows($result);
|
||||
if (! DolibarrApi::_checkFilters($sqlfilters))
|
||||
{
|
||||
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
|
||||
}
|
||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
|
||||
$sql.= $this->db->order($sortfield, $sortorder);
|
||||
|
||||
if ($limit) {
|
||||
|
||||
@ -98,11 +98,12 @@ class Categories extends DolibarrApi
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact')
|
||||
* @return array Array of category objects
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @return array Array of category objects
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
function index($sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0, $type = '') {
|
||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 0, $page = 0, $type = '', $sqlfilters = '') {
|
||||
global $db, $conf;
|
||||
|
||||
$obj_ret = array();
|
||||
@ -111,21 +112,24 @@ class Categories extends DolibarrApi
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
$sql = "SELECT s.rowid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as s";
|
||||
$sql.= ' WHERE s.entity IN ('.getEntity('categorie', 1).')';
|
||||
$sql = "SELECT t.rowid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as t";
|
||||
$sql.= ' WHERE t.entity IN ('.getEntity('categorie', 1).')';
|
||||
if (!empty($type))
|
||||
{
|
||||
$sql.= ' AND s.type='.array_search($type,Categories::$TYPES);
|
||||
$sql.= ' AND t.type='.array_search($type,Categories::$TYPES);
|
||||
}
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
// Add sql filters
|
||||
if ($sqlfilters)
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (! DolibarrApi::_checkFilters($sqlfilters))
|
||||
{
|
||||
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
|
||||
}
|
||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
if ($limit) {
|
||||
if ($page < 0)
|
||||
|
||||
@ -1472,7 +1472,7 @@ if ($id > 0)
|
||||
|
||||
$var=true;
|
||||
|
||||
$somethingshown=$formfile->show_documents('agenda',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,0,0,'','','',$object->default_lang);
|
||||
print $formfile->showdocuments('agenda',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,0,0,'','','',$object->default_lang);
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
@ -1102,13 +1102,17 @@ class ActionComm extends CommonObject
|
||||
* @param string $classname Force style class on a link
|
||||
* @param string $option ''=Link to action, 'birthday'=Link to contact
|
||||
* @param int $overwritepicto 1=Overwrite picto
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$maxlength=0,$classname='',$option='',$overwritepicto=0)
|
||||
function getNomUrl($withpicto=0,$maxlength=0,$classname='',$option='',$overwritepicto=0, $notooltip=0)
|
||||
{
|
||||
global $conf,$langs, $hookmanager;
|
||||
global $conf, $langs, $user, $hookmanager;
|
||||
|
||||
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
|
||||
|
||||
$result='';
|
||||
|
||||
$tooltip = '<u>' . $langs->trans('ShowAction'.$objp->code) . '</u>';
|
||||
if (! empty($this->ref))
|
||||
$tooltip .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
|
||||
@ -1118,27 +1122,43 @@ class ActionComm extends CommonObject
|
||||
$tooltip .= '<br><b>' . $langs->trans('Title') . ':</b> ' . $label;
|
||||
if (! empty($this->location))
|
||||
$tooltip .= '<br><b>' . $langs->trans('Location') . ':</b> ' . $this->location;
|
||||
|
||||
|
||||
$linkclose='';
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE) && $this->type_color)
|
||||
$linkclose = ' style="background-color:#'.$this->type_color.'" class="'.$classname.' classfortooltip" title="'.dol_escape_htmltag($tooltip, 1).'">';
|
||||
else
|
||||
$linkclose = ' class="'.$classname.' classfortooltip" title="'.dol_escape_htmltag($tooltip, 1).'">';
|
||||
$linkclose = ' style="background-color:#'.$this->type_color.'"';
|
||||
|
||||
if (! is_object($hookmanager))
|
||||
if (empty($notooltip) && $user->rights->propal->lire)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager=new HookManager($this->db);
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$label=$langs->trans("ShowSupplierProposal");
|
||||
$linkclose.=' alt="'.dol_escape_htmltag($tooltip, 1).'"';
|
||||
}
|
||||
$linkclose.=' title="'.dol_escape_htmltag($tooltip, 1).'"';
|
||||
$linkclose.=' class="'.$classname.' classfortooltip"';
|
||||
|
||||
if (! is_object($hookmanager))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager=new HookManager($this->db);
|
||||
}
|
||||
$hookmanager->initHooks(array('actiondao'));
|
||||
$parameters=array('id'=>$this->id);
|
||||
$reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||
$linkclose = ($hookmanager->resPrint ? $hookmanager->resPrint : $linkclose);
|
||||
}
|
||||
$hookmanager->initHooks(array('actiondao'));
|
||||
$parameters=array('id'=>$this->id);
|
||||
$reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||
$linkclose = ($hookmanager->resPrint ? $hookmanager->resPrint : $linkclose);
|
||||
|
||||
else $linkclose.=' class="'.$classname.'"';
|
||||
|
||||
$url='';
|
||||
if ($option=='birthday')
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/contact/perso.php?id='.$this->id.'"'.$linkclose;
|
||||
$url = DOL_URL_ROOT.'/contact/perso.php?id='.$this->id;
|
||||
else
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?id='.$this->id.'"'.$linkclose;
|
||||
$url = DOL_URL_ROOT.'/comm/action/card.php?id='.$this->id;
|
||||
|
||||
$linkstart = '<a href="'.$url.'"';
|
||||
$linkstart.=$linkclose.'>';
|
||||
$linkend='</a>';
|
||||
|
||||
//print 'rrr'.$this->libelle.'-'.$withpicto;
|
||||
|
||||
if ($withpicto == 2)
|
||||
@ -1161,10 +1181,10 @@ class ActionComm extends CommonObject
|
||||
{
|
||||
$libelle.=(($this->type_code && $libelle!=$langs->transnoentities("Action".$this->type_code) && $langs->transnoentities("Action".$this->type_code)!="Action".$this->type_code)?' ('.$langs->transnoentities("Action".$this->type_code).')':'');
|
||||
}
|
||||
$result.=$link.img_object($langs->trans("ShowAction").': '.$libelle, ($overwritepicto?$overwritepicto:'action'), 'class="classfortooltip"').$linkend;
|
||||
$result.=$linkstart.img_object(($notooltip?'':$langs->trans("ShowAction").': '.$libelle), ($overwritepicto?$overwritepicto:'action'), ($notooltip?'':'class="classfortooltip"')).$linkend;
|
||||
}
|
||||
if ($withpicto==1) $result.=' ';
|
||||
$result.=$link.$libelleshort.$linkend;
|
||||
$result.=$linkstart.$libelleshort.$linkend;
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@ -94,10 +94,10 @@ class AgendaEvents extends DolibarrApi
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $user_ids User ids filter field (owners of event). Example: '1' or '1,2,3' {@pattern /^[0-9,]*$/i}
|
||||
*
|
||||
* @return array Array of Agenda Events objects
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @return array Array of Agenda Events objects
|
||||
*/
|
||||
function index($sortfield = "t.id", $sortorder = 'ASC', $limit = 0, $page = 0, $user_ids = 0) {
|
||||
function index($sortfield = "t.id", $sortorder = 'ASC', $limit = 0, $page = 0, $user_ids = 0, $sqlfilters = '') {
|
||||
global $db, $conf;
|
||||
|
||||
$obj_ret = array();
|
||||
@ -108,21 +108,23 @@ class AgendaEvents extends DolibarrApi
|
||||
$sql = "SELECT t.id as rowid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as t";
|
||||
$sql.= ' WHERE t.entity IN ('.getEntity('actioncomm', 1).')';
|
||||
if ($user_ids) $sql.=" AND ar.fk_user_action IN (".$user_ids.")";
|
||||
|
||||
if ($user_ids) $sql.=" AND t.fk_user_action IN (".$user_ids.")";
|
||||
// Insert sale filter
|
||||
if ($search_sale > 0)
|
||||
{
|
||||
$sql .= " AND sc.fk_user = ".$search_sale;
|
||||
}
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
// Add sql filters
|
||||
if ($sqlfilters)
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (! DolibarrApi::_checkFilters($sqlfilters))
|
||||
{
|
||||
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
|
||||
}
|
||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
if ($limit) {
|
||||
if ($page < 0)
|
||||
|
||||
@ -217,14 +217,14 @@ if ($id > 0)
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Prospect/Customer
|
||||
print '<tr><td width="30%">'.$langs->trans('ProspectCustomer').'</td><td width="70%" colspan="3">';
|
||||
print '<tr><td class="titlefield">'.$langs->trans('ProspectCustomer').'</td><td>';
|
||||
print $object->getLibCustProspStatut();
|
||||
print '</td></tr>';
|
||||
|
||||
// Prefix
|
||||
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Prefix").'</td><td colspan="3">';
|
||||
print '<tr><td>'.$langs->trans("Prefix").'</td><td>';
|
||||
print ($object->prefix_comm?$object->prefix_comm:' ');
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -234,7 +234,7 @@ if ($id > 0)
|
||||
$langs->load("compta");
|
||||
|
||||
print '<tr><td>';
|
||||
print $langs->trans('CustomerCode').'</td><td colspan="3">';
|
||||
print $langs->trans('CustomerCode').'</td><td>';
|
||||
print $object->code_client;
|
||||
if ($object->check_codeclient() <> 0) print ' <font class="error">('.$langs->trans("WrongCustomerCode").')</font>';
|
||||
print '</td></tr>';
|
||||
@ -242,7 +242,7 @@ if ($id > 0)
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print $form->editfieldkey("CustomerAccountancyCode",'customeraccountancycode',$object->code_compta,$object,$user->rights->societe->creer);
|
||||
print '</td><td colspan="3">';
|
||||
print '</td><td>';
|
||||
print $form->editfieldval("CustomerAccountancyCode",'customeraccountancycode',$object->code_compta,$object,$user->rights->societe->creer);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@ -251,12 +251,12 @@ if ($id > 0)
|
||||
// Skype
|
||||
if (! empty($conf->skype->enabled))
|
||||
{
|
||||
print '<td>'.$langs->trans('Skype').'</td><td colspan="3">'.dol_print_skype($object->skype,0,$object->id,'AC_SKYPE').'</td></tr>';
|
||||
print '<td>'.$langs->trans('Skype').'</td><td>'.dol_print_skype($object->skype,0,$object->id,'AC_SKYPE').'</td></tr>';
|
||||
}
|
||||
|
||||
// Assujeti a TVA ou pas
|
||||
print '<tr>';
|
||||
print '<td class="nowrap">'.$langs->trans('VATIsUsed').'</td><td colspan="3">';
|
||||
print '<td class="nowrap">'.$langs->trans('VATIsUsed').'</td><td>';
|
||||
print yn($object->tva_assuj);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@ -264,20 +264,20 @@ if ($id > 0)
|
||||
// Local Taxes
|
||||
if ($mysoc->useLocalTax(1))
|
||||
{
|
||||
print '<tr><td class="nowrap">'.$langs->trans("LocalTax1IsUsedES").'</td><td colspan="3">';
|
||||
print '<tr><td class="nowrap">'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td>';
|
||||
print yn($object->localtax1_assuj);
|
||||
print '</td></tr>';
|
||||
}
|
||||
if ($mysoc->useLocalTax(2))
|
||||
{
|
||||
print '<tr><td class="nowrap">'.$langs->trans("LocalTax2IsUsedES").'</td><td colspan="3">';
|
||||
print '<tr><td class="nowrap">'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td>';
|
||||
print yn($object->localtax2_assuj);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// TVA Intra
|
||||
print '<tr><td class="nowrap">'.$langs->trans('VATIntra').'</td><td colspan="3">';
|
||||
print '<tr><td class="nowrap">'.$langs->trans('VATIntra').'</td><td>';
|
||||
print $object->tva_intra;
|
||||
print '</td></tr>';
|
||||
|
||||
@ -289,7 +289,7 @@ if ($id > 0)
|
||||
print '<td>';
|
||||
if (($action != 'editconditions') && $user->rights->societe->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editconditions&socid='.$object->id.'">'.img_edit($langs->trans('SetConditions'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
print '</td><td>';
|
||||
if ($action == 'editconditions')
|
||||
{
|
||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id',1);
|
||||
@ -308,7 +308,7 @@ if ($id > 0)
|
||||
print '<td>';
|
||||
if (($action != 'editmode') && $user->rights->societe->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmode&socid='.$object->id.'">'.img_edit($langs->trans('SetMode'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
print '</td><td>';
|
||||
if ($action == 'editmode')
|
||||
{
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->mode_reglement_id,'mode_reglement_id');
|
||||
@ -323,11 +323,11 @@ if ($id > 0)
|
||||
// Compte bancaire par défaut
|
||||
print '<tr><td class="nowrap">';
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans('BankAccount');
|
||||
print $langs->trans('PaymentBankAccount');
|
||||
print '<td>';
|
||||
if (($action != 'editbankaccount') && $user->rights->societe->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&socid='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
print '</td><td>';
|
||||
if ($action == 'editbankaccount')
|
||||
{
|
||||
$form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_account,'fk_account',1);
|
||||
@ -350,7 +350,7 @@ if ($id > 0)
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||
}
|
||||
print '</td></tr></table>';
|
||||
print '</td><td colspan="3">'.($object->remise_percent?'<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'">'.$object->remise_percent.'%</a>':'').'</td>';
|
||||
print '</td><td>'.($object->remise_percent?'<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'">'.$object->remise_percent.'%</a>':'').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Absolute discounts (Discounts-Drawbacks-Rebates)
|
||||
@ -365,7 +365,7 @@ if ($id > 0)
|
||||
}
|
||||
print '</td></tr></table>';
|
||||
print '</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<td>';
|
||||
$amount_discount=$object->getAvailableDiscounts();
|
||||
if ($amount_discount < 0) dol_print_error($db,$object->error);
|
||||
if ($amount_discount > 0) print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.price($amount_discount,1,$langs,1,-1,-1,$conf->currency).'</a>';
|
||||
@ -373,20 +373,6 @@ if ($id > 0)
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
if ($object->client)
|
||||
{
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print $form->editfieldkey("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer);
|
||||
print '</td><td colspan="3">';
|
||||
$limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount';
|
||||
print $form->editfieldval("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer,$limit_field_type,($object->outstanding_limit != '' ? price($object->outstanding_limit) : ''));
|
||||
//if (empty($object->outstanding_limit)) print $langs->trans("NoLimit");
|
||||
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Multiprice level
|
||||
if (! empty($conf->global->PRODUIT_MULTIPRICES))
|
||||
{
|
||||
@ -399,7 +385,7 @@ if ($id > 0)
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/multiprix.php?id='.$object->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||
}
|
||||
print '</td></tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
print '</td><td>';
|
||||
print $object->price_level;
|
||||
$keyforlabel='PRODUIT_MULTIPRICES_LABEL'.$object->price_level;
|
||||
if (! empty($conf->global->$keyforlabel)) print ' - '.$langs->trans($conf->global->$keyforlabel);
|
||||
@ -407,36 +393,6 @@ if ($id > 0)
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if ($object->client == 2 || $object->client == 3)
|
||||
{
|
||||
// Level of prospect
|
||||
print '<tr><td class="nowrap">';
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans('ProspectLevel');
|
||||
print '<td>';
|
||||
if ($action != 'editlevel' && $user->rights->societe->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editlevel&socid='.$object->id.'">'.img_edit($langs->trans('Modify'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
if ($action == 'editlevel')
|
||||
$formcompany->form_prospect_level($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_prospectlevel,'prospect_level_id',1);
|
||||
else
|
||||
print $object->getLibProspLevel();
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
|
||||
// Status
|
||||
$object->loadCacheOfProspStatus();
|
||||
print '<tr><td>'.$langs->trans("StatusProsp").'</td><td colspan="3">'.$object->getLibProspCommStatut(4, $object->cacheprospectstatus[$object->stcomm_id]['label']);
|
||||
print ' <div class="floatright">';
|
||||
foreach($object->cacheprospectstatus as $key => $val)
|
||||
{
|
||||
$titlealt='default';
|
||||
if (! empty($val['code']) && ! in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) $titlealt=$val['label'];
|
||||
if ($object->stcomm_id != $val['id']) print '<a class="pictosubstatus" href="'.$_SERVER["PHP_SELF"].'?socid='.$object->id.'&stcomm='.$val['code'].'&action=setstcomm">'.img_action($titlealt,$val['code']).'</a>';
|
||||
}
|
||||
print '</div></td></tr>';
|
||||
}
|
||||
|
||||
// Preferred shipping Method
|
||||
if (! empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD)) {
|
||||
print '<tr><td class="nowrap">';
|
||||
@ -445,7 +401,7 @@ if ($id > 0)
|
||||
print '<td>';
|
||||
if (($action != 'editshipping') && $user->rights->societe->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editshipping&socid='.$object->id.'">'.img_edit($langs->trans('SetMode'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
print '</td><td>';
|
||||
if ($action == 'editshipping')
|
||||
{
|
||||
$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->shipping_method_id,'shipping_method_id');
|
||||
@ -462,7 +418,7 @@ if ($id > 0)
|
||||
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
||||
$langs->load("categories");
|
||||
print '<tr><td>' . $langs->trans("CustomersCategoriesShort") . '</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<td>';
|
||||
print $form->showCategories( $object->id, 'customer', 1 );
|
||||
print "</td></tr>";
|
||||
}
|
||||
@ -484,8 +440,8 @@ if ($id > 0)
|
||||
{
|
||||
$langs->load("members");
|
||||
$langs->load("users");
|
||||
print '<tr><td width="25%">'.$langs->trans("LinkedToDolibarrMember").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<tr><td>'.$langs->trans("LinkedToDolibarrMember").'</td>';
|
||||
print '<td>';
|
||||
$adh=new Adherent($db);
|
||||
$result=$adh->fetch('','',$object->id);
|
||||
if ($result > 0)
|
||||
@ -503,12 +459,47 @@ if ($id > 0)
|
||||
|
||||
print "</table>";
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
if ($object->client == 2 || $object->client == 3)
|
||||
{
|
||||
// Level of prospect
|
||||
print '<tr><td class="titlefield nowrap">';
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans('ProspectLevel');
|
||||
print '<td>';
|
||||
if ($action != 'editlevel' && $user->rights->societe->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editlevel&socid='.$object->id.'">'.img_edit($langs->trans('Modify'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editlevel')
|
||||
$formcompany->form_prospect_level($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_prospectlevel,'prospect_level_id',1);
|
||||
else
|
||||
print $object->getLibProspLevel();
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
|
||||
// Status
|
||||
$object->loadCacheOfProspStatus();
|
||||
print '<tr><td>'.$langs->trans("StatusProsp").'</td><td colspan="3">'.$object->getLibProspCommStatut(4, $object->cacheprospectstatus[$object->stcomm_id]['label']);
|
||||
print ' <div class="floatright">';
|
||||
foreach($object->cacheprospectstatus as $key => $val)
|
||||
{
|
||||
$titlealt='default';
|
||||
if (! empty($val['code']) && ! in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) $titlealt=$val['label'];
|
||||
if ($object->stcomm_id != $val['id']) print '<a class="pictosubstatus" href="'.$_SERVER["PHP_SELF"].'?socid='.$object->id.'&stcomm='.$val['code'].'&action=setstcomm">'.img_action($titlealt,$val['code']).'</a>';
|
||||
}
|
||||
print '</div></td></tr>';
|
||||
}
|
||||
print "</table>";
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
// Nbre max d'elements des petites listes
|
||||
$MAXLIST=$conf->global->MAIN_SIZE_SHORTLISTE_LIMIT;
|
||||
$MAXLIST=$conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
|
||||
|
||||
// Lien recap
|
||||
$outstandingBills = $object->get_OutstandingBill();
|
||||
@ -519,14 +510,33 @@ if ($id > 0)
|
||||
}
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Summary").'</td>';
|
||||
print '<td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/compta/recap-compta.php?socid='.$object->id.'">'.$langs->trans("ShowCustomerPreview").'</a></td>';
|
||||
print '</tr>';
|
||||
print '<tr class="impair">';
|
||||
|
||||
// Max outstanding bill
|
||||
if ($object->client)
|
||||
{
|
||||
print '<tr class="impair">';
|
||||
print '<td>';
|
||||
print $form->editfieldkey("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer);
|
||||
print '</td><td>';
|
||||
$limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount';
|
||||
print $form->editfieldval("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer,$limit_field_type,($object->outstanding_limit != '' ? price($object->outstanding_limit) : ''));
|
||||
//if (empty($object->outstanding_limit)) print $langs->trans("NoLimit");
|
||||
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Outstanding bill
|
||||
print '<tr class="pair">';
|
||||
print '<td>'.$langs->trans("CurrentOutstandingBill").'</td>';
|
||||
print '<td align="right">'.price($outstandingBills).$warn.'</td>';
|
||||
print '<td>'.price($outstandingBills).$warn.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
@ -2340,8 +2340,6 @@ if ($action == 'create')
|
||||
if ($action != 'presend')
|
||||
{
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
// print '<table width="100%"><tr><td width="50%" valign="top">';
|
||||
// print '<a name="builddoc"></a>'; // ancre
|
||||
|
||||
/*
|
||||
* Documents generes
|
||||
@ -2354,7 +2352,7 @@ if ($action == 'create')
|
||||
|
||||
$var = true;
|
||||
|
||||
$somethingshown = $formfile->show_documents('propal', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang);
|
||||
print $formfile->showdocuments('propal', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang);
|
||||
|
||||
// Show links to link elements
|
||||
$linktoelem = $form->showLinkToObjectBlock($object, null, array('propal'));
|
||||
@ -2362,14 +2360,12 @@ if ($action == 'create')
|
||||
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
// print '</td><td valign="top" width="50%">';
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, 'propal', $socid);
|
||||
|
||||
// print '</td></tr></table>';
|
||||
print '</div></div></div>';
|
||||
}
|
||||
|
||||
|
||||
@ -90,10 +90,10 @@ class Proposals extends DolibarrApi
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter commercial proposal of. Example: '1' or '1,2,3' {@pattern /^[0-9,]*$/i}
|
||||
*
|
||||
* @return array Array of order objects
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @return array Array of order objects
|
||||
*/
|
||||
function index($sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0, $thirdparty_ids = '') {
|
||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 0, $page = 0, $thirdparty_ids = '', $sqlfilters = '') {
|
||||
global $db, $conf;
|
||||
|
||||
$obj_ret = array();
|
||||
@ -103,30 +103,32 @@ class Proposals extends DolibarrApi
|
||||
// If the internal user must only see his customers, force searching by him
|
||||
if (! DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) $search_sale = DolibarrApiAccess::$user->id;
|
||||
|
||||
$sql = "SELECT s.rowid";
|
||||
$sql = "SELECT t.rowid";
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."propal as s";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."propal as t";
|
||||
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
|
||||
|
||||
$sql.= ' WHERE s.entity IN ('.getEntity('propal', 1).')';
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= " AND s.fk_soc = sc.fk_soc";
|
||||
if ($socids) $sql.= " AND s.fk_soc IN (".$socids.")";
|
||||
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
|
||||
|
||||
$sql.= ' WHERE t.entity IN ('.getEntity('propal', 1).')';
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= " AND t.fk_soc = sc.fk_soc";
|
||||
if ($socids) $sql.= " AND t.fk_soc IN (".$socids.")";
|
||||
if ($search_sale > 0) $sql.= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
|
||||
// Insert sale filter
|
||||
if ($search_sale > 0)
|
||||
{
|
||||
$sql .= " AND sc.fk_user = ".$search_sale;
|
||||
}
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
// Add sql filters
|
||||
if ($sqlfilters)
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (! DolibarrApi::_checkFilters($sqlfilters))
|
||||
{
|
||||
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
|
||||
}
|
||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
if ($limit) {
|
||||
if ($page < 0)
|
||||
|
||||
@ -3214,44 +3214,67 @@ class Propal extends CommonObject
|
||||
* @param int $withpicto Add picto into link
|
||||
* @param string $option Where point the link ('expedition', 'document', ...)
|
||||
* @param string $get_params Parametres added to url
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option='', $get_params='')
|
||||
function getNomUrl($withpicto=0,$option='', $get_params='', $notooltip=0)
|
||||
{
|
||||
global $langs, $conf;
|
||||
global $langs, $conf, $user;
|
||||
|
||||
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
|
||||
|
||||
$result='';
|
||||
$label = '<u>' . $langs->trans("ShowPropal") . '</u>';
|
||||
if (! empty($this->ref))
|
||||
$label.= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
if (! empty($this->ref_client))
|
||||
$label.= '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_client;
|
||||
if (! empty($this->total_ht))
|
||||
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if (! empty($this->total_tva))
|
||||
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if (! empty($this->total_ttc))
|
||||
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
if ($option == '') {
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/comm/propal/card.php?id='.$this->id. $get_params .$linkclose;
|
||||
$label='';
|
||||
$url='';
|
||||
|
||||
if ($user->rights->propal->lire)
|
||||
{
|
||||
$label = '<u>' . $langs->trans("ShowPropal") . '</u>';
|
||||
if (! empty($this->ref))
|
||||
$label.= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
if (! empty($this->ref_client))
|
||||
$label.= '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_client;
|
||||
if (! empty($this->total_ht))
|
||||
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if (! empty($this->total_tva))
|
||||
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if (! empty($this->total_ttc))
|
||||
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if ($option == '') {
|
||||
$url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$this->id. $get_params;
|
||||
}
|
||||
if ($option == 'compta') { // deprecated
|
||||
$url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$this->id. $get_params;
|
||||
}
|
||||
if ($option == 'expedition') {
|
||||
$url = DOL_URL_ROOT.'/expedition/propal.php?id='.$this->id. $get_params;
|
||||
}
|
||||
if ($option == 'document') {
|
||||
$url = DOL_URL_ROOT.'/comm/propal/document.php?id='.$this->id. $get_params;
|
||||
}
|
||||
}
|
||||
if ($option == 'compta') { // deprecated
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/comm/propal/card.php?id='.$this->id. $get_params .$linkclose;
|
||||
}
|
||||
if ($option == 'expedition') {
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/expedition/propal.php?id='.$this->id. $get_params .$linkclose;
|
||||
}
|
||||
if ($option == 'document') {
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/comm/propal/document.php?id='.$this->id. $get_params .$linkclose;
|
||||
|
||||
$linkclose='';
|
||||
if (empty($notooltip) && $user->rights->propal->lire)
|
||||
{
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$label=$langs->trans("ShowPropal");
|
||||
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose.=' class="classfortooltip"';
|
||||
}
|
||||
|
||||
$linkstart = '<a href="'.$url.'"';
|
||||
$linkstart.=$linkclose.'>';
|
||||
$linkend='</a>';
|
||||
|
||||
if ($withpicto)
|
||||
$result.=($link.img_object($label, $this->picto, 'class="classfortooltip"').$linkend);
|
||||
$result.=($linkstart.img_object(($notooltip?'':$label), $this->picto, ($notooltip?'':'class="classfortooltip"')).$linkend);
|
||||
if ($withpicto && $withpicto != 2)
|
||||
$result.=' ';
|
||||
$result.=$link.$this->ref.$linkend;
|
||||
$result.=$linkstart.$this->ref.$linkend;
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@ -2563,7 +2563,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
||||
$genallowed = $user->rights->commande->creer;
|
||||
$delallowed = $user->rights->commande->supprimer;
|
||||
$somethingshown = $formfile->show_documents('commande', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
|
||||
print $formfile->showdocuments('commande', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
|
||||
|
||||
|
||||
// Show links to link elements
|
||||
|
||||
@ -80,20 +80,22 @@ class Orders extends DolibarrApi
|
||||
return $this->_cleanObjectDatas($this->commande);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* List orders
|
||||
*
|
||||
* Get a list of orders
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter orders of. Example: '1' or '1,2,3' {@pattern /^[0-9,]*$/i}
|
||||
*
|
||||
* @return array Array of order objects
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $thirdparty_ids Thirdparty ids to filter orders of. {@example '1' or '1,2,3'} {@pattern /^[0-9,]*$/i}
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @return array Array of order objects
|
||||
*/
|
||||
function index($sortfield = "s.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '') {
|
||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '') {
|
||||
global $db, $conf;
|
||||
|
||||
$obj_ret = array();
|
||||
@ -103,30 +105,32 @@ class Orders extends DolibarrApi
|
||||
// If the internal user must only see his customers, force searching by him
|
||||
if (! DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) $search_sale = DolibarrApiAccess::$user->id;
|
||||
|
||||
$sql = "SELECT s.rowid";
|
||||
$sql = "SELECT t.rowid";
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande as s";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande as t";
|
||||
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
|
||||
|
||||
$sql.= ' WHERE s.entity IN ('.getEntity('commande', 1).')';
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= " AND s.fk_soc = sc.fk_soc";
|
||||
if ($socids) $sql.= " AND s.fk_soc IN (".$socids.")";
|
||||
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
|
||||
|
||||
$sql.= ' WHERE t.entity IN ('.getEntity('commande', 1).')';
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= " AND t.fk_soc = sc.fk_soc";
|
||||
if ($socids) $sql.= " AND t.fk_soc IN (".$socids.")";
|
||||
if ($search_sale > 0) $sql.= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
|
||||
// Insert sale filter
|
||||
if ($search_sale > 0)
|
||||
{
|
||||
$sql .= " AND sc.fk_user = ".$search_sale;
|
||||
}
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
// Add sql filters
|
||||
if ($sqlfilters)
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (! DolibarrApi::_checkFilters($sqlfilters))
|
||||
{
|
||||
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
|
||||
}
|
||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
if ($limit) {
|
||||
if ($page < 0)
|
||||
@ -138,6 +142,7 @@ class Orders extends DolibarrApi
|
||||
$sql.= $db->plimit($limit + 1, $offset);
|
||||
}
|
||||
|
||||
dol_syslog("API Rest request");
|
||||
$result = $db->query($sql);
|
||||
|
||||
if ($result)
|
||||
|
||||
@ -3326,12 +3326,15 @@ class Commande extends CommonOrder
|
||||
* @param int $option Where point the link (0=> main card, 1,2 => shipment)
|
||||
* @param int $max Max length to show
|
||||
* @param int $short Use short labels
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option=0,$max=0,$short=0)
|
||||
function getNomUrl($withpicto=0,$option=0,$max=0,$short=0,$notooltip=0)
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
|
||||
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
|
||||
|
||||
$result='';
|
||||
|
||||
if (! empty($conf->expedition->enabled) && ($option == 1 || $option == 2)) $url = DOL_URL_ROOT.'/expedition/shipment.php?id='.$this->id;
|
||||
@ -3351,23 +3354,33 @@ class Commande extends CommonOrder
|
||||
$label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_client;
|
||||
}
|
||||
if (!empty($this->total_ht)) {
|
||||
$label .= '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1,
|
||||
$conf->currency);
|
||||
$label .= '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
}
|
||||
if (!empty($this->total_tva)) {
|
||||
$label .= '<br><b>'.$langs->trans('VAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1,
|
||||
$conf->currency);
|
||||
$label .= '<br><b>'.$langs->trans('VAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
}
|
||||
if (!empty($this->total_ttc)) {
|
||||
$label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1,
|
||||
$conf->currency);
|
||||
$label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
}
|
||||
}
|
||||
|
||||
$linkstart = '<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
$linkclose='';
|
||||
if (empty($notooltip) && $user->rights->commande->lire)
|
||||
{
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$label=$langs->trans("ShowOrder");
|
||||
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose.=' class="classfortooltip"';
|
||||
}
|
||||
|
||||
$linkstart = '<a href="'.$url.'"';
|
||||
$linkstart.=$linkclose.'>';
|
||||
$linkend='</a>';
|
||||
|
||||
if ($withpicto) $result.=($linkstart.img_object($label, $picto, 'class="classfortooltip"').$linkend);
|
||||
if ($withpicto) $result.=($linkstart.img_object(($notooltip?'':$label), $picto, ($notooltip?'':'class="classfortooltip"')).$linkend);
|
||||
if ($withpicto && $withpicto != 2) $result.=' ';
|
||||
$result.=$linkstart.$this->ref.$linkend;
|
||||
return $result;
|
||||
|
||||
@ -56,11 +56,12 @@ class BankAccounts extends DolibarrApi
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @return array List of account objects
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.import_key:<:'20160101')"
|
||||
* @return array List of account objects
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
function index($sortfield = "rowid", $sortorder = 'ASC', $limit = 0, $page = 0)
|
||||
function index($sortfield = "rowid", $sortorder = 'ASC', $limit = 0, $page = 0, $sqlfilters = '')
|
||||
{
|
||||
$list = array();
|
||||
|
||||
@ -68,13 +69,17 @@ class BankAccounts extends DolibarrApi
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."bank_account";
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."bank_account as t";
|
||||
$sql.= ' WHERE t.entity IN ('.getEntity('banque', 1).')';
|
||||
// Add sql filters
|
||||
if ($sqlfilters)
|
||||
{
|
||||
$result = $this->db->query($sql);
|
||||
$nbtotalofrecords = $this->db->num_rows($result);
|
||||
if (! DolibarrApi::_checkFilters($sqlfilters))
|
||||
{
|
||||
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
|
||||
}
|
||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
$sql.= $this->db->order($sortfield, $sortorder);
|
||||
@ -88,6 +93,7 @@ class BankAccounts extends DolibarrApi
|
||||
$sql.= $this->db->plimit($limit + 1, $offset);
|
||||
}
|
||||
|
||||
dol_syslog("API Rest request");
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
if ($result) {
|
||||
@ -100,7 +106,7 @@ class BankAccounts extends DolibarrApi
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new RestException(503, 'Error when retrieving list of accounts: ' . $account->error);
|
||||
throw new RestException(503, 'Error when retrieving list of accounts: ' . $this->db->lasterror());
|
||||
}
|
||||
|
||||
return $list;
|
||||
|
||||
@ -89,11 +89,12 @@ class Invoices extends DolibarrApi
|
||||
* @param int $page Page number
|
||||
* @param int $socid Filter list with thirdparty ID
|
||||
* @param string $status Filter by invoice status : draft | unpaid | paid | cancelled
|
||||
* @return array Array of invoice objects
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @return array Array of invoice objects
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
function index($sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0, $socid=0, $status='') {
|
||||
function index($sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0, $socid=0, $status='', $sqlfilters = '') {
|
||||
global $db, $conf;
|
||||
|
||||
$obj_ret = array();
|
||||
@ -103,38 +104,38 @@ class Invoices extends DolibarrApi
|
||||
// If the internal user must only see his customers, force searching by him
|
||||
if (! DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) $search_sale = DolibarrApiAccess::$user->id;
|
||||
|
||||
$sql = "SELECT s.rowid";
|
||||
$sql = "SELECT t.rowid";
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture as s";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture as t";
|
||||
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
|
||||
|
||||
$sql.= ' WHERE s.entity IN ('.getEntity('facture', 1).')';
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND s.fk_soc = sc.fk_soc";
|
||||
if ($socid) $sql.= " AND s.fk_soc = ".$socid;
|
||||
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
|
||||
|
||||
$sql.= ' WHERE t.entity IN ('.getEntity('facture', 1).')';
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND t.fk_soc = sc.fk_soc";
|
||||
if ($socid) $sql.= " AND t.fk_soc = ".$socid;
|
||||
if ($search_sale > 0) $sql.= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
|
||||
|
||||
// Filter by status
|
||||
if ($status == 'draft') $sql.= " AND s.fk_statut IN (0)";
|
||||
if ($status == 'unpaid') $sql.= " AND s.fk_statut IN (1)";
|
||||
if ($status == 'paid') $sql.= " AND s.fk_statut IN (2)";
|
||||
if ($status == 'cancelled') $sql.= " AND s.fk_statut IN (3)";
|
||||
|
||||
if ($status == 'draft') $sql.= " AND t.fk_statut IN (0)";
|
||||
if ($status == 'unpaid') $sql.= " AND t.fk_statut IN (1)";
|
||||
if ($status == 'paid') $sql.= " AND t.fk_statut IN (2)";
|
||||
if ($status == 'cancelled') $sql.= " AND t.fk_statut IN (3)";
|
||||
// Insert sale filter
|
||||
if ($search_sale > 0)
|
||||
{
|
||||
$sql .= " AND sc.fk_user = ".$search_sale;
|
||||
}
|
||||
|
||||
// TODO remove this, useless for WS
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
// Add sql filters
|
||||
if ($sqlfilters)
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (! DolibarrApi::_checkFilters($sqlfilters))
|
||||
{
|
||||
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
|
||||
}
|
||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
if ($limit) {
|
||||
if ($page < 0)
|
||||
|
||||
@ -998,12 +998,15 @@ class Facture extends CommonInvoice
|
||||
* @param int $max Maxlength of ref
|
||||
* @param int $short 1=Return just URL
|
||||
* @param string $moretitle Add more text to title tooltip
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option='',$max=0,$short=0,$moretitle='')
|
||||
function getNomUrl($withpicto=0,$option='',$max=0,$short=0,$moretitle='',$notooltip=0)
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
|
||||
|
||||
$result='';
|
||||
|
||||
if ($option == 'withdraw') $url = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$this->id;
|
||||
@ -1015,28 +1018,44 @@ class Facture extends CommonInvoice
|
||||
if ($this->type == self::TYPE_REPLACEMENT) $picto.='r'; // Replacement invoice
|
||||
if ($this->type == self::TYPE_CREDIT_NOTE) $picto.='a'; // Credit note
|
||||
if ($this->type == self::TYPE_DEPOSIT) $picto.='d'; // Deposit invoice
|
||||
|
||||
$label = '<u>' . $langs->trans("ShowInvoice") . '</u>';
|
||||
if (! empty($this->ref))
|
||||
$label .= '<br><b>'.$langs->trans('Ref') . ':</b> ' . $this->ref;
|
||||
if (! empty($this->ref_client))
|
||||
$label .= '<br><b>' . $langs->trans('RefCustomer') . ':</b> ' . $this->ref_client;
|
||||
if (! empty($this->total_ht))
|
||||
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if (! empty($this->total_tva))
|
||||
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if (! empty($this->total_ttc))
|
||||
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if ($this->type == self::TYPE_REPLACEMENT) $label=$langs->transnoentitiesnoconv("ShowInvoiceReplace").': '.$this->ref;
|
||||
if ($this->type == self::TYPE_CREDIT_NOTE) $label=$langs->transnoentitiesnoconv("ShowInvoiceAvoir").': '.$this->ref;
|
||||
if ($this->type == self::TYPE_DEPOSIT) $label=$langs->transnoentitiesnoconv("ShowInvoiceDeposit").': '.$this->ref;
|
||||
if ($this->type == self::TYPE_SITUATION) $label=$langs->transnoentitiesnoconv("ShowInvoiceSituation").': '.$this->ref;
|
||||
if ($moretitle) $label.=' - '.$moretitle;
|
||||
|
||||
$linkstart='<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
$label='';
|
||||
|
||||
if ($user->rights->facture->lire) {
|
||||
$label = '<u>' . $langs->trans("ShowInvoice") . '</u>';
|
||||
if (! empty($this->ref))
|
||||
$label .= '<br><b>'.$langs->trans('Ref') . ':</b> ' . $this->ref;
|
||||
if (! empty($this->ref_client))
|
||||
$label .= '<br><b>' . $langs->trans('RefCustomer') . ':</b> ' . $this->ref_client;
|
||||
if (! empty($this->total_ht))
|
||||
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if (! empty($this->total_tva))
|
||||
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if (! empty($this->total_ttc))
|
||||
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if ($this->type == self::TYPE_REPLACEMENT) $label=$langs->transnoentitiesnoconv("ShowInvoiceReplace").': '.$this->ref;
|
||||
if ($this->type == self::TYPE_CREDIT_NOTE) $label=$langs->transnoentitiesnoconv("ShowInvoiceAvoir").': '.$this->ref;
|
||||
if ($this->type == self::TYPE_DEPOSIT) $label=$langs->transnoentitiesnoconv("ShowInvoiceDeposit").': '.$this->ref;
|
||||
if ($this->type == self::TYPE_SITUATION) $label=$langs->transnoentitiesnoconv("ShowInvoiceSituation").': '.$this->ref;
|
||||
if ($moretitle) $label.=' - '.$moretitle;
|
||||
}
|
||||
|
||||
$linkclose='';
|
||||
if (empty($notooltip) && $user->rights->facture->lire)
|
||||
{
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$label=$langs->trans("ShowInvoice");
|
||||
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose.=' class="classfortooltip"';
|
||||
}
|
||||
|
||||
$linkstart='<a href="'.$url.'"';
|
||||
$linkstart.=$linkclose.'>';
|
||||
$linkend='</a>';
|
||||
|
||||
if ($withpicto) $result.=($linkstart.img_object(($max?dol_trunc($label,$max):$label), $picto, 'class="classfortooltip"').$linkend);
|
||||
if ($withpicto) $result.=($linkstart.img_object(($notooltip?'':$label), $picto, ($notooltip?'':'class="classfortooltip"')).$linkend);
|
||||
if ($withpicto && $withpicto != 2) $result.=' ';
|
||||
if ($withpicto != 2) $result.=$linkstart.($max?dol_trunc($this->ref,$max):$this->ref).$linkend;
|
||||
return $result;
|
||||
|
||||
@ -801,7 +801,7 @@ if ($action != 'new')
|
||||
$filedir=$dir.get_exdir($object->ref,0,1,0,$object,'cheque') . dol_sanitizeFileName($object->ref);
|
||||
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||
|
||||
$formfile->show_documents('remisecheque', $filename, $filedir, $urlsource, 1, 1);
|
||||
print $formfile->showdocuments('remisecheque', $filename, $filedir, $urlsource, 1, 1);
|
||||
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
@ -54,7 +54,6 @@ $confirm = GETPOST('confirm','alpha');
|
||||
$backtopage = GETPOST('backtopage','alpha');
|
||||
$id = GETPOST('id','int');
|
||||
$socid = GETPOST('socid','int');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
|
||||
$object = new Contact($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
@ -74,6 +73,7 @@ if (! empty($canvas))
|
||||
}
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', $objcanvas); // If we create a contact with no company (shared contacts), no check on write permission
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
|
||||
@ -37,9 +37,22 @@ $id = GETPOST('id','int');
|
||||
$action = GETPOST("action");
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
|
||||
$object = new Contact($db);
|
||||
|
||||
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||
$object->getCanvas($id);
|
||||
$objcanvas=null;
|
||||
$canvas = (! empty($object->canvas)?$object->canvas:GETPOST("canvas"));
|
||||
if (! empty($canvas))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php';
|
||||
$objcanvas = new Canvas($db, $action);
|
||||
$objcanvas->getCanvas('contact', 'contactcard', $canvas);
|
||||
}
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'contact', $id, '','');
|
||||
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', $objcanvas); // If we create a contact with no company (shared contacts), no check on write permission
|
||||
|
||||
// Get parameters
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
@ -54,7 +67,6 @@ $pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="name";
|
||||
|
||||
$object = new Contact($db);
|
||||
if ($id > 0) $object->fetch($id);
|
||||
|
||||
$upload_dir = $conf->societe->dir_output.'/contact/'.dol_sanitizeFileName($object->ref);
|
||||
|
||||
@ -2038,7 +2038,7 @@ else
|
||||
|
||||
$var = true;
|
||||
|
||||
$somethingshown = $formfile->show_documents('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang);
|
||||
print $formfile->showdocuments('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang);
|
||||
|
||||
|
||||
// Show links to link elements
|
||||
|
||||
@ -81,7 +81,7 @@ class DolEditor
|
||||
|
||||
// Check if extended editor is ok. If not we force textarea
|
||||
if (empty($conf->fckeditor->enabled) || ! $okforextendededitor) $this->tool = 'textarea';
|
||||
//if ($conf->browser->phone) $this->tool = 'textarea';
|
||||
if ($conf->dol_use_jmobile) $this->tool = 'textarea'; // TODO ckeditor ko with jmobile
|
||||
|
||||
// Define content and some properties
|
||||
if ($this->tool == 'ckeditor')
|
||||
|
||||
@ -512,15 +512,16 @@ class Form
|
||||
if (count($arrayofaction) == 0) return;
|
||||
|
||||
$disabled=0;
|
||||
$ret='<div class="centpercent center"><select class="flat hideobject massaction massactionselect" name="massaction"'.($disabled?' disabled="disabled"':'').'>';
|
||||
$ret='<div class="centpercent center">';
|
||||
$ret.='<select data-role="none" class="flat hideobject massaction massactionselect" name="massaction"'.($disabled?' disabled="disabled"':'').'>';
|
||||
$ret.='<option value="0"'.($disabled?' disabled="disabled"':'').'>-- '.$langs->trans("SelectAction").' --</option>';
|
||||
foreach($arrayofaction as $code => $label)
|
||||
{
|
||||
$ret.='<option value="'.$code.'"'.($disabled?' disabled="disabled"':'').'>'.$label.'</option>';
|
||||
}
|
||||
$ret.='</select>';
|
||||
// Warning: if you set submit button to disabled, post using Enter will no more work
|
||||
$ret.='<input type="submit" name="confirmmassaction" class="button hideobject massaction massactionconfirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
|
||||
// Warning: if you set submit button to disabled, post using 'Enter' will no more work.
|
||||
$ret.='<input type="submit" data-role="none" name="confirmmassaction" class="button hideobject massaction massactionconfirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
|
||||
$ret.='</div>';
|
||||
|
||||
$ret.='<!-- JS CODE TO ENABLE mass action select -->
|
||||
@ -1615,9 +1616,11 @@ class Form
|
||||
* @param int $hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after)
|
||||
* @param array $ajaxoptions Options for ajax_autocompleter
|
||||
* @param int $socid Thirdparty Id (to get also price dedicated to this customer)
|
||||
* @param string $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text.
|
||||
* @param int $forcecombo Force to use combo box
|
||||
* @return void
|
||||
*/
|
||||
function select_produits($selected='', $htmlname='productid', $filtertype='', $limit=20, $price_level=0, $status=1, $finished=2, $selected_input_value='', $hidelabel=0, $ajaxoptions=array(), $socid=0)
|
||||
function select_produits($selected='', $htmlname='productid', $filtertype='', $limit=20, $price_level=0, $status=1, $finished=2, $selected_input_value='', $hidelabel=0, $ajaxoptions=array(), $socid=0, $showempty='1', $forcecombo=0)
|
||||
{
|
||||
global $langs,$conf;
|
||||
|
||||
@ -1650,14 +1653,14 @@ class Form
|
||||
print img_picto($langs->trans("Search"), 'search');
|
||||
}
|
||||
}
|
||||
print '<input type="text" size="20" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
|
||||
print '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
|
||||
if ($hidelabel == 3) {
|
||||
print img_picto($langs->trans("Search"), 'search');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->select_produits_list($selected,$htmlname,$filtertype,$limit,$price_level,'',$status,$finished,0,$socid);
|
||||
print $this->select_produits_list($selected,$htmlname,$filtertype,$limit,$price_level,'',$status,$finished,0,$socid,$showempty,$forcecombo);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1674,9 +1677,11 @@ class Form
|
||||
* @param int $finished Filter on finished field: 2=No filter
|
||||
* @param int $outputmode 0=HTML select string, 1=Array
|
||||
* @param int $socid Thirdparty Id (to get also price dedicated to this customer)
|
||||
* @param string $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text.
|
||||
* @param int $forcecombo Force to use combo box
|
||||
* @return array Array of keys for json
|
||||
*/
|
||||
function select_produits_list($selected='',$htmlname='productid',$filtertype='',$limit=20,$price_level=0,$filterkey='',$status=1,$finished=2,$outputmode=0,$socid=0)
|
||||
function select_produits_list($selected='',$htmlname='productid',$filtertype='',$limit=20,$price_level=0,$filterkey='',$status=1,$finished=2,$outputmode=0,$socid=0,$showempty='1',$forcecombo=0)
|
||||
{
|
||||
global $langs,$conf,$user,$db;
|
||||
|
||||
@ -1767,8 +1772,27 @@ class Form
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
$out.='<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">';
|
||||
$out.='<option value="0" selected> </option>';
|
||||
$events=null;
|
||||
|
||||
if ($conf->use_javascript_ajax && ! $forcecombo)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||
$comboenhancement =ajax_combobox($htmlname, $events, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT);
|
||||
$out.= $comboenhancement;
|
||||
$nodatarole=($comboenhancement?' data-role="none"':'');
|
||||
}
|
||||
|
||||
$out.='<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'"'.$nodatarole.'>';
|
||||
|
||||
$textifempty='';
|
||||
// Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'.
|
||||
//if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty='';
|
||||
if (! empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT))
|
||||
{
|
||||
if ($showempty && ! is_numeric($showempty)) $textifempty=$langs->trans($showempty);
|
||||
else $textifempty.=$langs->trans("All");
|
||||
}
|
||||
if ($showempty) $out.='<option value="0" selected>'.$textifempty.'</option>';
|
||||
|
||||
$i = 0;
|
||||
while ($num && $i < $num)
|
||||
@ -3274,7 +3298,7 @@ class Form
|
||||
* @param string $selectedchoice "" or "no" or "yes"
|
||||
* @param int $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx
|
||||
* @param int $height Force height of box
|
||||
* @param int $width Force width of bow
|
||||
* @param int $width Force width of box ('999' or '90%'). Ignored and forced to 90% on smartphones.
|
||||
* @return string HTML ajax code if a confirm ajax popup is required, Pure HTML code if it's an html form
|
||||
*/
|
||||
function formconfirm($page, $title, $question, $action, $formquestion='', $selectedchoice="", $useajax=0, $height=200, $width=500)
|
||||
@ -3289,7 +3313,8 @@ class Form
|
||||
|
||||
// Clean parameters
|
||||
$newselectedchoice=empty($selectedchoice)?"no":$selectedchoice;
|
||||
|
||||
if ($conf->browser->layout == 'phone') $width='95%';
|
||||
|
||||
if (is_array($formquestion) && ! empty($formquestion))
|
||||
{
|
||||
// First add hidden fields and value
|
||||
@ -4517,7 +4542,7 @@ class Form
|
||||
}
|
||||
}
|
||||
|
||||
if ($d && $h) $retstring.=' ';
|
||||
if ($d && $h) $retstring.=($h==2?'<br>':' ');
|
||||
|
||||
if ($h)
|
||||
{
|
||||
@ -4684,7 +4709,7 @@ class Form
|
||||
}
|
||||
elseif ($typehour=='text')
|
||||
{
|
||||
$retstring.='<input type="text" size="2" name="'.$prefix.'hour"'.($disabled?' disabled':'').' class="flat" value="'.($hourSelected?((int) $hourSelected):'').'">';
|
||||
$retstring.='<input type="text" size="1" name="'.$prefix.'hour"'.($disabled?' disabled':'').' class="flat" value="'.($hourSelected?((int) $hourSelected):'').'">';
|
||||
}
|
||||
else return 'BadValueForParameterTypeHour';
|
||||
|
||||
@ -4707,7 +4732,7 @@ class Form
|
||||
}
|
||||
elseif ($typehour=='text')
|
||||
{
|
||||
$retstring.='<input type="text" size="2" name="'.$prefix.'min"'.($disabled?' disabled':'').' class="flat" value="'.($minSelected?((int) $minSelected):'').'">';
|
||||
$retstring.='<input type="text" size="1" name="'.$prefix.'min"'.($disabled?' disabled':'').' class="flat" value="'.($minSelected?((int) $minSelected):'').'">';
|
||||
}
|
||||
$retstring.=' '.$langs->trans('MinuteShort');
|
||||
$retstring.=" ";
|
||||
@ -5523,7 +5548,11 @@ class Form
|
||||
//print "xx".$previous_ref."x".$next_ref;
|
||||
$ret.='<div style="vertical-align: middle">';
|
||||
|
||||
if ($morehtmlleft) $ret.='<div class="inline-block floatleft">'.$morehtmlleft.'</div>';
|
||||
if ($morehtmlleft)
|
||||
{
|
||||
if ($conf->browser->layout == 'phone') $ret.='<div class="center">'.$morehtmlleft.'</div>';
|
||||
else $ret.='<div class="inline-block floatleft">'.$morehtmlleft.'</div>';
|
||||
}
|
||||
|
||||
$ret.='<div class="inline-block floatleft valignmiddle refid'.(($shownav && ($previous_ref || $next_ref))?' refidpadding':'').'">';
|
||||
|
||||
@ -5727,7 +5756,10 @@ class Form
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret.='<img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.$nophoto.'">';
|
||||
if ($conf->browser->layout != 'phone')
|
||||
{
|
||||
$ret.='<img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.$nophoto.'">';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1454,13 +1454,16 @@ class FormFile
|
||||
global $langs, $conf;
|
||||
|
||||
$out='';
|
||||
$urladvancedpreview=getAdvancedPreviewUrl($modulepart, $relativepath);
|
||||
if ($urladvancedpreview)
|
||||
if ($conf->browser->layout != 'phone')
|
||||
{
|
||||
$out.= '<a data-ajax="false" class="pictopreview" href="'.$urladvancedpreview.'">';
|
||||
if (empty($ruleforpicto)) $out.= img_picto($langs->trans('Preview').' '.$file['name'], 'detail');
|
||||
else $out.= img_mime($relativepath, $langs->trans('Preview').' '.$file['name']);
|
||||
$out.= '</a>';
|
||||
$urladvancedpreview=getAdvancedPreviewUrl($modulepart, $relativepath); // Return if a file is qualified for preview
|
||||
if ($urladvancedpreview)
|
||||
{
|
||||
$out.= '<a data-ajax="false" class="pictopreview" href="'.$urladvancedpreview.'">';
|
||||
if (empty($ruleforpicto)) $out.= img_picto($langs->trans('Preview').' '.$file['name'], 'detail');
|
||||
else $out.= img_mime($relativepath, $langs->trans('Preview').' '.$file['name']);
|
||||
$out.= '</a>';
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
@ -944,7 +944,6 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
|
||||
if ($object->element == 'user') $modulepart='userphoto';
|
||||
if ($object->element == 'product') $modulepart='product';
|
||||
|
||||
print '<div class="'.($onlybanner?'':'arearef ').'heightref valignmiddle" width="100%">';
|
||||
if ($object->element == 'product')
|
||||
{
|
||||
$width=80; $cssclass='photoref';
|
||||
@ -958,7 +957,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
|
||||
$nophoto='';
|
||||
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref"></div>';
|
||||
}
|
||||
else {
|
||||
elseif ($conf->browser->layout != 'phone') { // Show no photo link
|
||||
$nophoto='/public/theme/common/nophoto.png';
|
||||
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.$nophoto.'"></div>';
|
||||
}
|
||||
@ -969,21 +968,33 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
|
||||
{
|
||||
if ($showimage)
|
||||
{
|
||||
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">';
|
||||
if ($modulepart != 'unknown') $morehtmlleft.=$form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos);
|
||||
else if ($object->element == 'action')
|
||||
if ($modulepart != 'unknown')
|
||||
{
|
||||
$cssclass='photorefcenter';
|
||||
$nophoto=img_picto('', 'title_agenda', '', false, 1);
|
||||
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.$nophoto.'"></div></div>';
|
||||
$phototoshow = $form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos);
|
||||
if ($phototoshow)
|
||||
{
|
||||
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">';
|
||||
$morehtmlleft.=$phototoshow;
|
||||
$morehtmlleft.='</div>';
|
||||
}
|
||||
}
|
||||
else
|
||||
elseif ($conf->browser->layout != 'phone') // Show no photo link
|
||||
{
|
||||
$width=14; $cssclass='photorefcenter';
|
||||
$nophoto=img_picto('', 'object_'.$object->picto, '', false, 1);
|
||||
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.$nophoto.'"></div></div>';
|
||||
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">';
|
||||
if ($object->element == 'action')
|
||||
{
|
||||
$cssclass='photorefcenter';
|
||||
$nophoto=img_picto('', 'title_agenda', '', false, 1);
|
||||
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.$nophoto.'"></div></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$width=14; $cssclass='photorefcenter';
|
||||
$nophoto=img_picto('', 'object_'.$object->picto, '', false, 1);
|
||||
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.$nophoto.'"></div></div>';
|
||||
}
|
||||
$morehtmlleft.='</div>';
|
||||
}
|
||||
$morehtmlleft.='</div>';
|
||||
}
|
||||
}
|
||||
if ($showbarcode) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showbarcode($object).'</div>';
|
||||
@ -1035,6 +1046,8 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
|
||||
$morehtmlref.=$langs->trans("TechnicalID").': '.$object->id;
|
||||
$morehtmlref.='</div>';
|
||||
}
|
||||
|
||||
print '<div class="'.($onlybanner?'':'arearef ').'heightref valignmiddle" width="100%">';
|
||||
print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlright);
|
||||
print '</div>';
|
||||
print '<div class="underrefbanner clearboth"></div>';
|
||||
|
||||
@ -406,14 +406,14 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
// Title of task
|
||||
print "<td>";
|
||||
if ($showlineingray) print '<i>';
|
||||
else print '<a href="'.DOL_URL_ROOT.'/projet/tasks/task.php?id='.$lines[$i]->id.'&withproject=1">';
|
||||
//else print '<a href="'.DOL_URL_ROOT.'/projet/tasks/task.php?id='.$lines[$i]->id.'&withproject=1">';
|
||||
for ($k = 0 ; $k < $level ; $k++)
|
||||
{
|
||||
print " ";
|
||||
}
|
||||
print $lines[$i]->label;
|
||||
if ($showlineingray) print '</i>';
|
||||
else print '</a>';
|
||||
//else print '</a>';
|
||||
print "</td>\n";
|
||||
|
||||
// Date start
|
||||
@ -840,7 +840,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
|
||||
{
|
||||
// Thirdparty
|
||||
print '<td class="nowrap">';
|
||||
$thirdpartystatic->id=$lines[$i]->socid;
|
||||
$thirdpartystatic->id=$lines[$i]->thirdparty_id;
|
||||
$thirdpartystatic->name=$lines[$i]->thirdparty_name;
|
||||
print $thirdpartystatic->getNomUrl(1, 'project', 10);
|
||||
print '</td>';
|
||||
|
||||
@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
|
||||
*/
|
||||
function shipping_prepare_head($object)
|
||||
{
|
||||
global $langs, $conf, $user;
|
||||
global $db, $langs, $conf, $user;
|
||||
|
||||
$langs->load("sendings");
|
||||
$langs->load("deliveries");
|
||||
@ -64,7 +64,13 @@ function shipping_prepare_head($object)
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
|
||||
{
|
||||
$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
|
||||
$objectsrc = $object;
|
||||
if ($object->origin == 'commande' && $object->origin_id > 0)
|
||||
{
|
||||
$objectsrc = new Commande($db);
|
||||
$objectsrc->fetch($object->origin_id);
|
||||
}
|
||||
$nbContact = count($objectsrc->liste_contact(-1,'internal')) + count($objectsrc->liste_contact(-1,'external'));
|
||||
$head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$object->id;
|
||||
$head[$h][1] = $langs->trans("ContactsAddresses");
|
||||
if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>';
|
||||
|
||||
@ -942,52 +942,52 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
$newmenu->add("/accountancy/index.php?leftmenu=accountancy",$langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy');
|
||||
|
||||
// Chart of account
|
||||
if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"),1,$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin', 1);
|
||||
if (preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chartmodel', 10);
|
||||
if (preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 20);
|
||||
if (preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 40);
|
||||
if (empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"),1,$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin', 1);
|
||||
if (empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chartmodel', 10);
|
||||
if (empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 20);
|
||||
if (empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 40);
|
||||
if (! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
if (preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 30);
|
||||
if (empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 30);
|
||||
}
|
||||
if (! empty($conf->tax->enabled))
|
||||
{
|
||||
if (preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/admin/dict.php?id=7&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 30);
|
||||
if (empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/admin/dict.php?id=7&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 30);
|
||||
}
|
||||
if (! empty($conf->loan->enabled))
|
||||
{
|
||||
if (preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/admin/loan.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuLoanAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_loan', 45);
|
||||
if (empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/admin/loan.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuLoanAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_loan', 45);
|
||||
}
|
||||
/* not required yet, already supported by default account
|
||||
if (! empty($conf->don->enabled))
|
||||
{
|
||||
if (preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/don/admin/donation.php?from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDonationAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_donation', 47);
|
||||
}*/
|
||||
if (preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 50);
|
||||
|
||||
if (empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 50);
|
||||
|
||||
// Binding
|
||||
if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy",$langs->trans("CustomersVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer');
|
||||
if (preg_match('/accountancy_dispatch_customer/',$leftmenu)) $newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write);
|
||||
if (preg_match('/accountancy_dispatch_customer/',$leftmenu)) $newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("Binded"),2,$user->rights->accounting->bind->write);
|
||||
if (empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy",$langs->trans("CustomersVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer');
|
||||
if (empty($leftmenu) || preg_match('/accountancy_dispatch_customer/',$leftmenu)) $newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write);
|
||||
if (empty($leftmenu) || preg_match('/accountancy_dispatch_customer/',$leftmenu)) $newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("Binded"),2,$user->rights->accounting->bind->write);
|
||||
|
||||
if (! empty($conf->supplier_invoice->enabled))
|
||||
{
|
||||
if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy",$langs->trans("SuppliersVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_supplier');
|
||||
if (preg_match('/accountancy_dispatch_supplier/',$leftmenu)) $newmenu->add("/accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write);
|
||||
if (preg_match('/accountancy_dispatch_supplier/',$leftmenu)) $newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier",$langs->trans("Binded"),2,$user->rights->accounting->bind->write);
|
||||
if (empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy",$langs->trans("SuppliersVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_supplier');
|
||||
if (empty($leftmenu) || preg_match('/accountancy_dispatch_supplier/',$leftmenu)) $newmenu->add("/accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write);
|
||||
if (empty($leftmenu) || preg_match('/accountancy_dispatch_supplier/',$leftmenu)) $newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier",$langs->trans("Binded"),2,$user->rights->accounting->bind->write);
|
||||
}
|
||||
|
||||
if (! empty($conf->expensereport->enabled))
|
||||
{
|
||||
if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy",$langs->trans("ExpenseReportsVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_expensereport');
|
||||
if (preg_match('/accountancy_dispatch_expensereport/',$leftmenu)) $newmenu->add("/accountancy/expensereport/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write);
|
||||
if (preg_match('/accountancy_dispatch_expensereport/',$leftmenu)) $newmenu->add("/accountancy/expensereport/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport",$langs->trans("Binded"),2,$user->rights->accounting->bind->write);
|
||||
if (empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy",$langs->trans("ExpenseReportsVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_expensereport');
|
||||
if (empty($leftmenu) || preg_match('/accountancy_dispatch_expensereport/',$leftmenu)) $newmenu->add("/accountancy/expensereport/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write);
|
||||
if (empty($leftmenu) || preg_match('/accountancy_dispatch_expensereport/',$leftmenu)) $newmenu->add("/accountancy/expensereport/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport",$langs->trans("Binded"),2,$user->rights->accounting->bind->write);
|
||||
}
|
||||
|
||||
// Journals
|
||||
if(! empty($conf->accounting->enabled) && ! empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy')
|
||||
{
|
||||
if (preg_match('/accountancy/',$leftmenu)) $newmenu->add('',$langs->trans("Journalization"),1,$user->rights->accounting->comptarapport->lire);
|
||||
if (empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add('',$langs->trans("Journalization"),1,$user->rights->accounting->comptarapport->lire);
|
||||
|
||||
$sql = "SELECT rowid, label, accountancy_journal";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
|
||||
@ -1005,7 +1005,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
while ($i < $numr)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
if (preg_match('/accountancy/',$leftmenu)) $newmenu->add('/accountancy/journal/bankjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_account='.$objp->rowid,$langs->trans("Journal").' - '.dol_trunc($objp->label,10),2,$user->rights->accounting->comptarapport->lire);
|
||||
if (empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add('/accountancy/journal/bankjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_account='.$objp->rowid,$langs->trans("Journal").' - '.dol_trunc($objp->label,10),2,$user->rights->accounting->comptarapport->lire);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
@ -1013,34 +1013,34 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
$db->free($resql);
|
||||
|
||||
// Add other journal
|
||||
if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/journal/sellsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal",$langs->trans("SellsJournal"),2,$user->rights->accounting->comptarapport->lire);
|
||||
if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/journal/purchasesjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal",$langs->trans("PurchasesJournal"),2,$user->rights->accounting->comptarapport->lire);
|
||||
if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/journal/expensereportsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal",$langs->trans("ExpenseReportsJournal"),2,$user->rights->accounting->comptarapport->lire);
|
||||
if (empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/journal/sellsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal",$langs->trans("SellsJournal"),2,$user->rights->accounting->comptarapport->lire);
|
||||
if (empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/journal/purchasesjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal",$langs->trans("PurchasesJournal"),2,$user->rights->accounting->comptarapport->lire);
|
||||
if (empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/journal/expensereportsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal",$langs->trans("ExpenseReportsJournal"),2,$user->rights->accounting->comptarapport->lire);
|
||||
}
|
||||
|
||||
// General Ledger
|
||||
if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy",$langs->trans("Bookkeeping"),1,$user->rights->accounting->mouvements->lire);
|
||||
if (empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_generalledger",$langs->trans("Bookkeeping"),1,$user->rights->accounting->mouvements->lire);
|
||||
|
||||
// Balance
|
||||
if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy",$langs->trans("AccountBalance"),1,$user->rights->accounting->mouvements->lire);
|
||||
if (empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_balance",$langs->trans("AccountBalance"),1,$user->rights->accounting->mouvements->lire);
|
||||
|
||||
// Reports
|
||||
$langs->load("compta");
|
||||
|
||||
if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/report/result.php?leftmenu=accountancy_report&mainmenu=accountancy",$langs->trans("Reportings"),1,$user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca');
|
||||
if (empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/report/result.php?mainmenu=accountancy&leftmenu=accountancy_report",$langs->trans("Reportings"),1,$user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca');
|
||||
|
||||
if (preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/accountancy/report/result.php?leftmenu=accountancy_report",$langs->trans("ReportInOut"),2,$user->rights->accounting->comptarapport->lire);
|
||||
if (preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report",$langs->trans("ByExpenseIncome"),3,$user->rights->accounting->comptarapport->lire);
|
||||
if (preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report",$langs->trans("ByCompanies"),3,$user->rights->accounting->comptarapport->lire);
|
||||
if (preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report",$langs->trans("ReportTurnover"),2,$user->rights->accounting->comptarapport->lire);
|
||||
if (preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report",$langs->trans("ByCompanies"),3,$user->rights->accounting->comptarapport->lire);
|
||||
if (preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report",$langs->trans("ByUsers"),3,$user->rights->accounting->comptarapport->lire);
|
||||
if (preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report", $langs->trans("ByProductsAndServices"),3,$user->rights->accounting->comptarapport->lire);
|
||||
if (empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/accountancy/report/result.php?leftmenu=accountancy_report",$langs->trans("ReportInOut"),2,$user->rights->accounting->comptarapport->lire);
|
||||
if (empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report",$langs->trans("ByExpenseIncome"),3,$user->rights->accounting->comptarapport->lire);
|
||||
if (empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report",$langs->trans("ByCompanies"),3,$user->rights->accounting->comptarapport->lire);
|
||||
if (empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report",$langs->trans("ReportTurnover"),2,$user->rights->accounting->comptarapport->lire);
|
||||
if (empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report",$langs->trans("ByCompanies"),3,$user->rights->accounting->comptarapport->lire);
|
||||
if (empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report",$langs->trans("ByUsers"),3,$user->rights->accounting->comptarapport->lire);
|
||||
if (empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report", $langs->trans("ByProductsAndServices"),3,$user->rights->accounting->comptarapport->lire);
|
||||
|
||||
// Fiscal year
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL > 0) // Not yet used. In a future will lock some periods.
|
||||
{
|
||||
if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"),1,$user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear');
|
||||
if (empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"),1,$user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -152,9 +152,10 @@ class MenuManager
|
||||
|
||||
if ($mode == 'jmobile')
|
||||
{
|
||||
|
||||
print_eldy_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu,1,$mode); // Fill this->menu that is empty with top menu
|
||||
|
||||
|
||||
// $this->menu->liste is top menu
|
||||
//var_dump($this->menu->liste);exit;
|
||||
print '<!-- Generate menu list from menu handler '.$this->name.' -->'."\n";
|
||||
foreach($this->menu->liste as $key => $val) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
|
||||
{
|
||||
@ -168,14 +169,15 @@ class MenuManager
|
||||
$relurl=preg_replace('/__USERID__/',$user->id,$relurl);
|
||||
|
||||
print '<a class="alilevel0" href="#">'.$val['titre'].'</a>'."\n";
|
||||
// Search submenu fot this entry
|
||||
// Search submenu fot this mainmenu entry
|
||||
$tmpmainmenu=$val['mainmenu'];
|
||||
$tmpleftmenu='all';
|
||||
$submenu=new Menu();
|
||||
print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$submenu,1,$tmpmainmenu,$tmpleftmenu); // Fill $submenu (example with tmpmainmenu='home' tmpleftmenu='all', return left menu tree of Home)
|
||||
//if ($tmpmainmenu.'-'.$tmpleftmenu == 'home-all') { var_dump($submenu);exit; }
|
||||
//if ($tmpmainmenu.'-'.$tmpleftmenu == 'home-all') { var_dump($submenu); exit; }
|
||||
//if ($tmpmainmenu=='accountancy') { var_dump($submenu->liste); exit; }
|
||||
$nexturl=dol_buildpath($submenu->liste[0]['url'],1);
|
||||
|
||||
|
||||
$canonrelurl=preg_replace('/\?.*$/','',$relurl);
|
||||
$canonnexturl=preg_replace('/\?.*$/','',$nexturl);
|
||||
//var_dump($canonrelurl);
|
||||
|
||||
@ -805,7 +805,7 @@ if (! empty($id) && $action != 'edit')
|
||||
print "</div>";
|
||||
|
||||
|
||||
print '<table width="100%"><tr><td width="50%" valign="top">';
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
|
||||
/*
|
||||
* Documents generes
|
||||
@ -818,13 +818,11 @@ if (! empty($id) && $action != 'edit')
|
||||
|
||||
$var=true;
|
||||
|
||||
print '<br>';
|
||||
$formfile->show_documents('donation',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf);
|
||||
|
||||
print '</td><td> </td>';
|
||||
|
||||
print '</tr></table>';
|
||||
print $formfile->showdocuments('donation',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf);
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
print '</div></div></div>';
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
@ -1295,7 +1295,7 @@ else if ($id || $ref)
|
||||
$totalVolume=$tmparray['volume'];
|
||||
|
||||
|
||||
// Warehouse card
|
||||
// Shipment card
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expedition/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
@ -1348,18 +1348,6 @@ else if ($id || $ref)
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
/*
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
|
||||
print '</td></tr>';
|
||||
|
||||
// Customer
|
||||
print '<tr><td width="20%">'.$langs->trans("Customer").'</td>';
|
||||
print '<td colspan="3">'.$soc->getNomUrl(1).'</td>';
|
||||
print "</tr>";*/
|
||||
|
||||
// Linked documents
|
||||
if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled))
|
||||
{
|
||||
@ -1909,7 +1897,7 @@ else if ($id || $ref)
|
||||
$genallowed=$user->rights->expedition->lire;
|
||||
$delallowed=$user->rights->expedition->supprimer;
|
||||
|
||||
$somethingshown=$formfile->show_documents('expedition',$objectref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang);
|
||||
print $formfile->showdocuments('expedition',$objectref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang);
|
||||
|
||||
|
||||
// Show links to link elements
|
||||
|
||||
@ -155,83 +155,99 @@ if ($id > 0 || ! empty($ref))
|
||||
dol_fiche_head($head, 'contact', $langs->trans("Shipment"), 0, 'sending');
|
||||
|
||||
|
||||
/*
|
||||
* Facture synthese pour rappel
|
||||
*/
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Shipment card
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expedition/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Ref customer shipment
|
||||
$morehtmlref.=$form->editfieldkey("RefCustomer", '', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', 0, 1);
|
||||
$morehtmlref.=$form->editfieldval("RefCustomer", '', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
|
||||
// Project
|
||||
/*
|
||||
if (! empty($conf->projet->enabled)) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>' . $langs->trans('Project') . ' ';
|
||||
if ($user->rights->supplier_proposal->creer) {
|
||||
if ($action != 'classify') {
|
||||
$morehtmlref .= '<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
// $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$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 .= '<input type="submit" class="button" value="' . $langs->trans("Modify") . '">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= '<a href="' . DOL_URL_ROOT . '/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
||||
$morehtmlref .= $proj->ref;
|
||||
$morehtmlref .= '</a>';
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}*/
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
//print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="18%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
|
||||
print "</td></tr>";
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
// Customer
|
||||
print '<tr><td width="20%">'.$langs->trans("Customer").'</td>';
|
||||
print '<td colspan="3">'.$object->thirdparty->getNomUrl(1).'</td>';
|
||||
print "</tr>";
|
||||
|
||||
// Linked documents
|
||||
// Linked documents
|
||||
if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled))
|
||||
{
|
||||
print '<tr><td>';
|
||||
$objectsrc=new Commande($db);
|
||||
$objectsrc->fetch($object->$typeobject->id);
|
||||
print $langs->trans("RefOrder").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $objectsrc->getNomUrl(1,'commande');
|
||||
print "</td>\n";
|
||||
print '</tr>';
|
||||
print '<tr><td class="titlefield">';
|
||||
$objectsrc=new Commande($db);
|
||||
$objectsrc->fetch($object->$typeobject->id);
|
||||
print $langs->trans("RefOrder").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $objectsrc->getNomUrl(1,'commande');
|
||||
print "</td>\n";
|
||||
print '</tr>';
|
||||
}
|
||||
if ($typeobject == 'propal' && $object->$typeobject->id && ! empty($conf->propal->enabled))
|
||||
{
|
||||
print '<tr><td>';
|
||||
$objectsrc=new Propal($db);
|
||||
$objectsrc->fetch($object->$typeobject->id);
|
||||
print $langs->trans("RefProposal").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $objectsrc->getNomUrl(1,'expedition');
|
||||
print "</td>\n";
|
||||
print '</tr>';
|
||||
print '<tr><td class="titlefield">';
|
||||
$objectsrc=new Propal($db);
|
||||
$objectsrc->fetch($object->$typeobject->id);
|
||||
print $langs->trans("RefProposal").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $objectsrc->getNomUrl(1,'expedition');
|
||||
print "</td>\n";
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Ref expedition client
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
|
||||
print $langs->trans('RefCustomer').'</td><td align="left">';
|
||||
print '</td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
print $objectsrc->ref_client;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Delivery address
|
||||
if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT))
|
||||
{
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('DeliveryAddress');
|
||||
print '</td>';
|
||||
|
||||
if ($action != 'editdelivery_address' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdelivery_address&socid='.$object->socid.'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryAddress'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
|
||||
if ($action == 'editdelivery_address')
|
||||
{
|
||||
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->socid,'fk_address','shipping',$object->id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->socid,'none','shipping',$object->id);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
//print '</div>';
|
||||
//print '<div class="fichehalfright">';
|
||||
//print '<div class="ficheaddleft">';
|
||||
//print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
//print '</div>';
|
||||
//print '</div>';
|
||||
print '</div>';
|
||||
|
||||
print '<div class="clearboth"></div>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
// Lignes de contacts
|
||||
|
||||
@ -20,9 +20,9 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/expedition/note.php
|
||||
* \ingroup expedition
|
||||
* \brief Note card expedition
|
||||
*/
|
||||
* \ingroup expedition
|
||||
* \brief Note card expedition
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
|
||||
@ -99,65 +99,57 @@ if ($id > 0 || ! empty($ref))
|
||||
$head=shipping_prepare_head($object);
|
||||
dol_fiche_head($head, 'note', $langs->trans("Shipment"), 0, 'sending');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expedition/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
|
||||
print '</td></tr>';
|
||||
|
||||
// Customer
|
||||
print '<tr><td width="20%">'.$langs->trans("Customer").'</td>';
|
||||
print '<td colspan="3">'.$soc->getNomUrl(1).'</td>';
|
||||
print "</tr>";
|
||||
|
||||
// Linked documents
|
||||
if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled))
|
||||
{
|
||||
print '<tr><td>';
|
||||
$objectsrc=new Commande($db);
|
||||
$objectsrc->fetch($object->$typeobject->id);
|
||||
print $langs->trans("RefOrder").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $objectsrc->getNomUrl(1,'commande');
|
||||
print "</td>\n";
|
||||
print '</tr>';
|
||||
}
|
||||
if ($typeobject == 'propal' && $object->$typeobject->id && ! empty($conf->propal->enabled))
|
||||
{
|
||||
print '<tr><td>';
|
||||
$objectsrc=new Propal($db);
|
||||
$objectsrc->fetch($object->$typeobject->id);
|
||||
print $langs->trans("RefProposal").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $objectsrc->getNomUrl(1,'expedition');
|
||||
print "</td>\n";
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Ref customer
|
||||
print '<tr><td>'.$langs->trans("RefCustomer").'</td>';
|
||||
print '<td colspan="3">'.$object->ref_customer."</a></td>\n";
|
||||
print '</tr>';
|
||||
|
||||
// Date creation
|
||||
print '<tr><td>'.$langs->trans("DateCreation").'</td>';
|
||||
print '<td colspan="3">'.dol_print_date($object->date_creation,"day")."</td>\n";
|
||||
print '</tr>';
|
||||
|
||||
// Delivery date planed
|
||||
print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>';
|
||||
print '<td colspan="3">'.dol_print_date($object->date_delivery,"dayhourtext")."</td>\n";
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
$colwidth=20;
|
||||
|
||||
// Shipment card
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expedition/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Ref customer shipment
|
||||
$morehtmlref.=$form->editfieldkey("RefCustomer", '', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', 0, 1);
|
||||
$morehtmlref.=$form->editfieldval("RefCustomer", '', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
|
||||
// Project
|
||||
/*
|
||||
if (! empty($conf->projet->enabled)) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>' . $langs->trans('Project') . ' ';
|
||||
if ($user->rights->supplier_proposal->creer) {
|
||||
if ($action != 'classify') {
|
||||
$morehtmlref .= '<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
// $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$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 .= '<input type="submit" class="button" value="' . $langs->trans("Modify") . '">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= '<a href="' . DOL_URL_ROOT . '/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
||||
$morehtmlref .= $proj->ref;
|
||||
$morehtmlref .= '</a>';
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}*/
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
$cssclass='titlefield';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -234,7 +234,8 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
// Show filter box
|
||||
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
// Company
|
||||
print '<tr><td align="left">'.$langs->trans("ThirdParty").'</td><td align="left">';
|
||||
@ -259,8 +260,8 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
print '<br><br>';
|
||||
//}
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr height="24">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre" height="24">';
|
||||
print '<td align="center">'.$langs->trans("Year").'</td>';
|
||||
print '<td align="center">'.$langs->trans("NbOfSendings").'</td>';
|
||||
/*print '<td align="center">'.$langs->trans("AmountTotal").'</td>';
|
||||
@ -268,13 +269,16 @@ print '<td align="center">'.$langs->trans("AmountAverage").'</td>';*/
|
||||
print '</tr>';
|
||||
|
||||
$oldyear=0;
|
||||
$var=true;
|
||||
foreach ($data as $val)
|
||||
{
|
||||
$year = $val['year'];
|
||||
while (! empty($year) && $oldyear > $year+1)
|
||||
{ // If we have empty year
|
||||
$oldyear--;
|
||||
print '<tr height="24">';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].' height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&mode='.$mode.'">'.$oldyear.'</a></td>';
|
||||
|
||||
print '<td align="right">0</td>';
|
||||
@ -283,7 +287,8 @@ foreach ($data as $val)
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '<tr height="24">';
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].' height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&mode='.$mode.'">'.$year.'</a></td>';
|
||||
print '<td align="right">'.$val['nb'].'</td>';
|
||||
/*print '<td align="right">'.price(price2num($val['total'],'MT'),1).'</td>';
|
||||
|
||||
@ -91,10 +91,10 @@ class ExpenseReports extends DolibarrApi
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $user_ids User ids filter field. Example: '1' or '1,2,3' {@pattern /^[0-9,]*$/i}
|
||||
*
|
||||
* @return array Array of Expense Report objects
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @return array Array of Expense Report objects
|
||||
*/
|
||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 0, $page = 0, $user_ids = 0) {
|
||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 0, $page = 0, $user_ids = 0, $sqlfilters = '') {
|
||||
global $db, $conf;
|
||||
|
||||
$obj_ret = array();
|
||||
@ -112,14 +112,17 @@ class ExpenseReports extends DolibarrApi
|
||||
{
|
||||
$sql .= " AND sc.fk_user = ".$search_sale;
|
||||
}
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
// Add sql filters
|
||||
if ($sqlfilters)
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (! DolibarrApi::_checkFilters($sqlfilters))
|
||||
{
|
||||
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
|
||||
}
|
||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
if ($limit) {
|
||||
if ($page < 0)
|
||||
|
||||
@ -1170,6 +1170,7 @@ if ($step == 5 && $datatoexport)
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '<table width="100%">';
|
||||
|
||||
if ($sqlusedforexport && $user->admin)
|
||||
@ -1180,17 +1181,18 @@ if ($step == 5 && $datatoexport)
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
print '<table width="100%"><tr><td width="50%">';
|
||||
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
|
||||
if (! is_dir($conf->export->dir_temp)) dol_mkdir($conf->export->dir_temp);
|
||||
|
||||
// Affiche liste des documents
|
||||
// NB: La fonction show_documents rescanne les modules qd genallowed=1, sinon prend $liste
|
||||
$formfile->show_documents('export','',$upload_dir,$_SERVER["PHP_SELF"].'?step=5&datatoexport='.$datatoexport,$liste,1,(! empty($_POST['model'])?$_POST['model']:'csv'),1,1);
|
||||
|
||||
print '</td><td width="50%"> </td></tr>';
|
||||
print '</table>';
|
||||
print $formfile->showdocuments('export','',$upload_dir,$_SERVER["PHP_SELF"].'?step=5&datatoexport='.$datatoexport,$liste,1,(! empty($_POST['model'])?$_POST['model']:'csv'),1,1);
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
print '</div></div></div>';
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
|
||||
@ -1773,7 +1773,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
$var=true;
|
||||
|
||||
//print "<br>\n";
|
||||
$somethingshown=$formfile->show_documents('ficheinter',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang);
|
||||
print $somethingshown=$formfile->showdocuments('ficheinter',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang);
|
||||
|
||||
|
||||
// Show links to link elements
|
||||
|
||||
@ -280,7 +280,7 @@ if ($object->id > 0)
|
||||
|
||||
$var=true;
|
||||
|
||||
$MAXLIST=5;
|
||||
$MAXLIST=$conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
|
||||
|
||||
// Lien recap
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
@ -1483,7 +1483,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
$line->qty = $qty;
|
||||
$line->remise_percent = $remise_percent;
|
||||
|
||||
$this->line->vat_src_code=$vat_src_code;
|
||||
$line->vat_src_code=$vat_src_code;
|
||||
$line->tva_tx = $vatrate;
|
||||
$line->localtax1_tx = $txlocaltax1;
|
||||
$line->localtax2_tx = $txlocaltax2;
|
||||
|
||||
@ -2030,24 +2030,6 @@ else
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
/*
|
||||
print '<tr><td class="titlefield nowrap">'.$langs->trans("Ref").'</td><td colspan="4">';
|
||||
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Ref supplier
|
||||
print '<tr><td>'.$form->editfieldkey("RefSupplier",'ref_supplier',$object->ref_supplier,$object,($object->statut<FactureFournisseur::STATUS_CLOSED && $user->rights->fournisseur->facture->creer)).'</td><td colspan="4">';
|
||||
print $form->editfieldval("RefSupplier",'ref_supplier',$object->ref_supplier,$object,($object->statut<FactureFournisseur::STATUS_CLOSED && $user->rights->fournisseur->facture->creer));
|
||||
print '</td></tr>';
|
||||
|
||||
// Third party
|
||||
print '<tr><td>'.$langs->trans('Supplier').'</td><td colspan="4">'.$societe->getNomUrl(1,'supplier');
|
||||
print ' (<a href="'.DOL_URL_ROOT.'/fourn/facture/list.php?socid='.$object->socid.'">'.$langs->trans('OtherBills').'</a>)</td>';
|
||||
print '</tr>';
|
||||
*/
|
||||
|
||||
// Type
|
||||
print '<tr><td class="titlefield">'.$langs->trans('Type').'</td><td>';
|
||||
print $object->getLibType();
|
||||
|
||||
@ -435,7 +435,7 @@ if ($resql)
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
||||
|
||||
print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->name.":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_accountancy',0,'','',$limit);
|
||||
print_barre_liste($langs->trans("BillsSuppliers").($socid?" - $soc->name":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_accountancy',0,'','',$limit);
|
||||
|
||||
if ($search_all)
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -37,7 +37,12 @@ $lastftpentry=0;
|
||||
$action = GETPOST('action','alpha');
|
||||
$entry = GETPOST('numero_entry','alpha');
|
||||
|
||||
// Positionne la variable pour le nombre de rss externes
|
||||
|
||||
/*
|
||||
* Action
|
||||
*/
|
||||
|
||||
// Get value for $lastftpentry
|
||||
$sql ="select MAX(name) as name from ".MAIN_DB_PREFIX."const";
|
||||
$sql.=" WHERE name like 'FTP_SERVER_%'";
|
||||
$result=$db->query($sql);
|
||||
@ -210,8 +215,6 @@ else
|
||||
|
||||
<?php
|
||||
|
||||
print '<table class="noborder" width="100%">'."\n";
|
||||
|
||||
$sql ="select name, value, note from ".MAIN_DB_PREFIX."const";
|
||||
$sql.=" WHERE name like 'FTP_SERVER_%'";
|
||||
$sql.=" ORDER BY name";
|
||||
@ -235,9 +238,13 @@ else
|
||||
|
||||
print "<form name=\"externalrssconfig\" action=\"".$_SERVER["PHP_SELF"]."\" method=\"post\">";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="numero_entry" value="'.$idrss.'">';
|
||||
|
||||
print '<table class="noborder" width="100%">'."\n";
|
||||
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print "<td colspan=\"2\">".$langs->trans("FTP")." ".($idrss)."</td>";
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="fieldtitle">'.$langs->trans("FTP")." ".($idrss)."</td>";
|
||||
print '<td></td>';
|
||||
print "</tr>";
|
||||
|
||||
$var=!$var;
|
||||
@ -281,12 +288,14 @@ else
|
||||
print "<input type=\"submit\" class=\"button\" name=\"modify\" value=\"".$langs->trans("Modify")."\">";
|
||||
print " ";
|
||||
print "<input type=\"submit\" class=\"button\" name=\"delete\" value=\"".$langs->trans("Delete")."\">";
|
||||
print "<input type=\"hidden\" name=\"numero_entry\" value=\"".$idrss."\">";
|
||||
print "</td>";
|
||||
print "</tr>";
|
||||
|
||||
print '</table>';
|
||||
|
||||
print "</form>";
|
||||
|
||||
print '<br>';
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
@ -294,9 +303,6 @@ else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2008-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2008-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -20,7 +20,6 @@
|
||||
* \file htdocs/ftp/index.php
|
||||
* \ingroup ftp
|
||||
* \brief Main page for FTP section area
|
||||
* \author Laurent Destailleur
|
||||
*/
|
||||
|
||||
require('../main.inc.php');
|
||||
@ -418,7 +417,6 @@ else
|
||||
if ($action == 'delete_section')
|
||||
{
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'§ion='.urlencode($_REQUEST["section"]).'&file='.urlencode($_GET["file"]), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1);
|
||||
|
||||
}
|
||||
|
||||
print $langs->trans("Server").': <b>'.$ftp_server.'</b><br>';
|
||||
@ -646,8 +644,21 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
$s_ftp_server='FTP_SERVER_1';
|
||||
if (empty($s_ftp_server))
|
||||
$foundsetup=false;
|
||||
$MAXFTP=20;
|
||||
$i=1;
|
||||
while ($i <= $MAXFTP)
|
||||
{
|
||||
$paramkey='FTP_NAME_'.$i;
|
||||
//print $paramkey;
|
||||
if (! empty($conf->global->$paramkey))
|
||||
{
|
||||
$foundsetup=true;
|
||||
break;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
if (! $foundsetup)
|
||||
{
|
||||
print $langs->trans("SetupOfFTPClientModuleNotComplete");
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_M
|
||||
-- IHM
|
||||
--
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_LISTE_LIMIT','25','chaine','Longueur maximum des listes',0,0);
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_SHORTLISTE_LIMIT','4','chaine','Longueur maximum des listes courtes (fiche client)',0,0);
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_SHORTLIST_LIMIT','3','chaine','Longueur maximum des listes courtes (fiche client)',0,0);
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SHOW_WORKBOARD','1','yesno','Affichage tableau de bord de travail Dolibarr',0,0);
|
||||
|
||||
insert into llx_const (name, value, type, note, visible) values ('MAIN_MENU_STANDARD','eldy_menu.php','chaine','Menu manager for internal users',0);
|
||||
|
||||
@ -61,7 +61,7 @@ update llx_opensurvey_sondage set format = 'D' where format = 'D+';
|
||||
update llx_opensurvey_sondage set format = 'A' where format = 'A+';
|
||||
|
||||
INSERT INTO llx_const (name, value, type, note, visible) values (__ENCRYPT('MAIN_DELAY_EXPENSEREPORTS_TO_PAY')__,__ENCRYPT('31')__,'chaine','Tolérance de retard avant alerte (en jours) sur les notes de frais impayées',0);
|
||||
INSERT INTO llx_const (name, value, type, note, visible) values ('MAIN_SIZE_SHORTLISTE_LIMIT','4','chaine','Longueur maximum des listes courtes (fiche client)',0);
|
||||
INSERT INTO llx_const (name, value, type, note, visible) values ('MAIN_SIZE_SHORTLIST_LIMIT','3','chaine','Max length for small lists (tabs)',0);
|
||||
|
||||
ALTER TABLE llx_accounting_system MODIFY COLUMN pcg_version varchar(32);
|
||||
ALTER TABLE llx_accountingaccount MODIFY COLUMN fk_pcg_version varchar(32);
|
||||
|
||||
@ -165,3 +165,11 @@ create table llx_resource_extrafields
|
||||
) ENGINE=innodb;
|
||||
|
||||
ALTER TABLE llx_resource_extrafields ADD INDEX idx_resource_extrafields (fk_object);
|
||||
|
||||
INSERT INTO llx_const (name, value, type, note, visible) values ('MAIN_SIZE_SHORTLIST_LIMIT','3','chaine','Max length for small lists (tabs)',0);
|
||||
|
||||
|
||||
ALTER TABLE llx_bank_account ADD COLUMN note_public text;
|
||||
ALTER TABLE llx_bank_account ADD COLUMN model_pdf varchar(255);
|
||||
ALTER TABLE llx_bank_account ADD COLUMN import_key varchar(14);
|
||||
|
||||
|
||||
@ -55,5 +55,8 @@ create table llx_bank_account
|
||||
currency_code varchar(3) NOT NULL,
|
||||
min_allowed integer DEFAULT 0,
|
||||
min_desired integer DEFAULT 0,
|
||||
comment text
|
||||
comment text, -- TODO rename in note_private
|
||||
note_public text,
|
||||
model_pdf varchar(255),
|
||||
import_key varchar(14)
|
||||
)ENGINE=innodb;
|
||||
|
||||
@ -58,8 +58,8 @@ ErrorCodeCantContainZero=Code can't contain value 0
|
||||
DisableJavascript=Disable JavaScript and Ajax functions (Recommended for blind person or text browsers)
|
||||
UseSearchToSelectCompanyTooltip=Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant COMPANY_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string.
|
||||
UseSearchToSelectContactTooltip=Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant CONTACT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string.
|
||||
DelaiedFullListToSelectCompany=Wait you press a key before loading content of thirdparties combo list (This may increase performance if you have a large number of thirdparties)
|
||||
DelaiedFullListToSelectContact=Wait you press a key before loading content of contact combo list (This may increase performance if you have a large number of contact)
|
||||
DelaiedFullListToSelectCompany=Wait you press a key before loading content of thirdparties combo list (This may increase performance if you have a large number of thirdparties, but it is less convenient)
|
||||
DelaiedFullListToSelectContact=Wait you press a key before loading content of contact combo list (This may increase performance if you have a large number of contact, but it is less convenient)
|
||||
NumberOfKeyToSearch=Nbr of characters to trigger search: %s
|
||||
NotAvailableWhenAjaxDisabled=Not available when Ajax disabled
|
||||
AllowToSelectProjectFromOtherCompany=On document of a third party, can choose a project linked to another third party
|
||||
@ -1320,7 +1320,7 @@ ViewProductDescInFormAbility=Visualization of product descriptions in the forms
|
||||
MergePropalProductCard=Activate in product/service Attached Files tab an option to merge product PDF document to proposal PDF azur if product/service is in the proposal
|
||||
ViewProductDescInThirdpartyLanguageAbility=Visualization of products descriptions in the third party language
|
||||
UseSearchToSelectProductTooltip=Also if you have a large number of product (> 100 000), you can increase speed by setting constant PRODUCT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string.
|
||||
UseSearchToSelectProduct=Use a search form to choose a product (rather than a drop-down list).
|
||||
UseSearchToSelectProduct=Wait you press a key before loading content of product combo list (This may increase performance if you have a large number of products, but it is less convenient)
|
||||
SetDefaultBarcodeTypeProducts=Default barcode type to use for products
|
||||
SetDefaultBarcodeTypeThirdParties=Default barcode type to use for third parties
|
||||
UseUnits=Define a unit of measure for Quantity during order, proposal or invoice lines edition
|
||||
|
||||
@ -76,7 +76,8 @@ DefaultLang=Language by default
|
||||
VATIsUsed=VAT is used
|
||||
VATIsNotUsed=VAT is not used
|
||||
CopyAddressFromSoc=Fill address with third party address
|
||||
ThirdpartyNotCustomerNotSupplierSoNoRef=Thirdparty neither customer nor supplier, no available refering objects
|
||||
ThirdpartyNotCustomerNotSupplierSoNoRef=Thirdparty neither customer nor supplier, no available refering objects
|
||||
PaymentBankAccount=Payment bank account
|
||||
##### Local Taxes #####
|
||||
LocalTax1IsUsed=Use second tax
|
||||
LocalTax1IsUsedES= RE is used
|
||||
|
||||
@ -50,5 +50,5 @@ ListOfSupplierProposal=List of supplier proposal requests
|
||||
ListSupplierProposalsAssociatedProject=List of supplier proposals associated with project
|
||||
SupplierProposalsToClose=Supplier proposals to close
|
||||
SupplierProposalsToProcess=Supplier proposals to process
|
||||
LastSupplierProposals=Last price requests
|
||||
LastSupplierProposals=Latest %s price requests
|
||||
AllPriceRequests=All requests
|
||||
|
||||
@ -23,7 +23,7 @@ WithdrawalsSetup=Direct debit payment setup
|
||||
WithdrawStatistics=Direct debit payment statistics
|
||||
WithdrawRejectStatistics=Direct debit payment reject statistics
|
||||
LastWithdrawalReceipt=Latest %s direct debit receipts
|
||||
MakeWithdrawRequest=Make a withdraw request
|
||||
MakeWithdrawRequest=Make a direct debit payment request
|
||||
ThirdPartyBankCode=Third party bank code
|
||||
NoInvoiceCouldBeWithdrawed=No invoice withdrawed with success. Check that invoice are on companies with a valid BAN.
|
||||
ClassCredited=Classify credited
|
||||
|
||||
@ -670,7 +670,7 @@ else
|
||||
$genallowed=$user->rights->expedition->livraison->creer;
|
||||
$delallowed=$user->rights->expedition->livraison->supprimer;
|
||||
|
||||
$somethingshown=$formfile->show_documents('livraison',$objectref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang);
|
||||
print $formfile->showdocuments('livraison',$objectref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang);
|
||||
|
||||
/*
|
||||
* Linked object block (of linked shipment)
|
||||
|
||||
@ -225,6 +225,7 @@ if (isset($_SERVER["HTTP_USER_AGENT"]))
|
||||
$conf->browser->tablet=$tmp['tablet']; // TODO deprecated, use ->layout
|
||||
//var_dump($conf->browser);
|
||||
|
||||
if ($conf->browser->layout == 'phone') $conf->dol_no_mouse_hover=1;
|
||||
if ($conf->browser->layout == 'phone') $conf->global->MAIN_TESTMENUHIDER=1;
|
||||
}
|
||||
|
||||
|
||||
@ -94,7 +94,7 @@ dol_fiche_head($head, 'agentMargins', $titre, 0, $picto);
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans('SalesRepresentative').'</td>';
|
||||
print '<td colspan="4">';
|
||||
print '<td class="maxwidthonsmartphone" colspan="4">';
|
||||
print $form->select_dolusers($agentid, 'agentid', 1, '', $user->rights->margins->read->all ? 0 : 1, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -90,7 +90,7 @@ if ($socid > 0) {
|
||||
if ($soc->client)
|
||||
{
|
||||
print '<tr><td class="titlefield">'.$langs->trans('ThirdPartyName').'</td>';
|
||||
print '<td colspan="4">';
|
||||
print '<td class="maxwidthonsmartphone" colspan="4">';
|
||||
print $form->select_company($socid, 'socid', 'client=1 OR client=3', 1, 0, 0);
|
||||
//$form->form_thirdparty($_SERVER['PHP_SELF'].'?socid='.$socid,$socid,'socid','client=1 OR client=3',1,0,1);
|
||||
print '</td></tr>';
|
||||
@ -102,7 +102,7 @@ if ($socid > 0) {
|
||||
}
|
||||
else {
|
||||
print '<tr><td class="titlefield">'.$langs->trans('ThirdPartyName').'</td>';
|
||||
print '<td colspan="4">';
|
||||
print '<td class="maxwidthonsmartphone" colspan="4">';
|
||||
print $form->select_company(null, 'socid', 'client=1 OR client=3', 1, 0, 0);
|
||||
//$form->form_thirdparty($_SERVER['PHP_SELF'],null,'socid','client=1 OR client=3',1,0,1);
|
||||
print '</td></tr>';
|
||||
|
||||
@ -105,20 +105,17 @@ print '<table class="border" width="100%">';
|
||||
if ($id > 0) {
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans('ChooseProduct/Service').'</td>';
|
||||
print '<td colspan="4">';
|
||||
print $form->select_produits($id,'id','',20,0,1,2,'',1);
|
||||
print '<td class="maxwidthonsmartpone" colspan="4">';
|
||||
print $form->select_produits($id,'id','',20,0,1,2,'',1, array(), 0, 'All');
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('AllProducts').'</td>';
|
||||
print '<td colspan="4"><input type="checkbox" id="all" /></td></tr>';
|
||||
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="f.datef";
|
||||
}
|
||||
else {
|
||||
print '<tr><td class="titlefield">'.$langs->trans('ChooseProduct/Service').'</td>';
|
||||
print '<td colspan="4">';
|
||||
print $form->select_produits('','id','',20,0,1,2,'',1);
|
||||
print '<td class="maxwidthonsmartphone" colspan="4">';
|
||||
print $form->select_produits('','id','',20,0,1,2,'',1, array(), 0, 'All');
|
||||
print '</td></tr>';
|
||||
|
||||
}
|
||||
@ -339,10 +336,6 @@ print '
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#all").change(function() {
|
||||
$("#id").val(\'\').change();
|
||||
});
|
||||
|
||||
$("#id").change(function() {
|
||||
$("div.fiche form").submit();
|
||||
});
|
||||
|
||||
@ -138,7 +138,8 @@ if (empty($reshook))
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
/*
|
||||
|
||||
/*
|
||||
* Build doc
|
||||
*/
|
||||
else if ($action == 'builddoc' && $user->rights->produit->creer)
|
||||
@ -197,22 +198,6 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if ($action == 'setaccountancy_code_buy') {
|
||||
|
||||
$result = $object->setAccountancyCode('buy', GETPOST('accountancy_code_buy'));
|
||||
if ($result < 0) setEventMessages(join(',',$object->errors), null, 'errors');
|
||||
$action="";
|
||||
}
|
||||
|
||||
if ($action == 'setaccountancy_code_sell')
|
||||
{
|
||||
$result = $object->setAccountancyCode('sell', GETPOST('accountancy_code_sell'));
|
||||
if ($result < 0) setEventMessages(join(',',$object->errors), null, 'errors');
|
||||
$action="";
|
||||
}
|
||||
*/
|
||||
|
||||
// Add a product or service
|
||||
if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||
{
|
||||
@ -1133,27 +1118,27 @@ else
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
// Accountancy_code_sell
|
||||
print '<tr><td width="20%">'.$langs->trans("ProductAccountancySellCode").'</td>';
|
||||
print '<td>';
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("ProductAccountancySellCode").'</td>';
|
||||
print '<td class="maxwidthonsmartphone">';
|
||||
print $formaccountancy->select_account($object->accountancy_code_sell, 'accountancy_code_sell', 1, '', 0, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Accountancy_code_buy
|
||||
print '<tr><td width="20%">'.$langs->trans("ProductAccountancyBuyCode").'</td>';
|
||||
print '<td>';
|
||||
print '<tr><td>'.$langs->trans("ProductAccountancyBuyCode").'</td>';
|
||||
print '<td class="maxwidthonsmartphone">';
|
||||
print $formaccountancy->select_account($object->accountancy_code_buy, 'accountancy_code_buy', 1, '', 0, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
else // For external software
|
||||
{
|
||||
// Accountancy_code_sell
|
||||
print '<tr><td width="20%">'.$langs->trans("ProductAccountancySellCode").'</td>';
|
||||
print '<td><input name="accountancy_code_sell" size="16" value="'.$object->accountancy_code_sell.'">';
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("ProductAccountancySellCode").'</td>';
|
||||
print '<td class="maxwidthonsmartphone"><input name="accountancy_code_sell" size="16" value="'.$object->accountancy_code_sell.'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Accountancy_code_buy
|
||||
print '<tr><td width="20%">'.$langs->trans("ProductAccountancyBuyCode").'</td>';
|
||||
print '<td><input name="accountancy_code_buy" size="16" value="'.$object->accountancy_code_buy.'">';
|
||||
print '<tr><td>'.$langs->trans("ProductAccountancyBuyCode").'</td>';
|
||||
print '<td class="maxwidthonsmartphone"><input name="accountancy_code_buy" size="16" value="'.$object->accountancy_code_buy.'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
@ -93,49 +93,44 @@ class Products extends DolibarrApi
|
||||
* @param int $page Page number
|
||||
* @param int $mode Use this param to filter list (0 for all, 1 for only product, 2 for only service)
|
||||
* @param int $category Use this param to filter list by category
|
||||
* @param mixed $to_sell Filter products to sell (1) or not to sell (0)
|
||||
* @param mixed $to_buy Filter products to buy (1) or not to buy (0)
|
||||
*
|
||||
* @return array Array of product objects
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.tobuy:=:0) and (t.tosell:=:1)"
|
||||
* @return array Array of product objects
|
||||
*/
|
||||
function index($sortfield = "p.ref", $sortorder = 'ASC', $limit = 0, $page = 0, $mode=0, $category=0, $to_sell='', $to_buy='') {
|
||||
function index($sortfield = "t.ref", $sortorder = 'ASC', $limit = 0, $page = 0, $mode=0, $category=0, $sqlfilters = '') {
|
||||
global $db, $conf;
|
||||
|
||||
$obj_ret = array();
|
||||
|
||||
$socid = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : '';
|
||||
|
||||
$sql = "SELECT rowid, ref, ref_ext";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
$sql = "SELECT t.rowid, t.ref, t.ref_ext";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as t";
|
||||
if ($category > 0)
|
||||
{
|
||||
$sql.= ", ".MAIN_DB_PREFIX."categorie_product as c";
|
||||
}
|
||||
$sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')';
|
||||
|
||||
$sql.= ' WHERE t.entity IN ('.getEntity('product', 1).')';
|
||||
// Select products of given category
|
||||
if ($category > 0)
|
||||
{
|
||||
$sql.= " AND c.fk_categorie = ".$db->escape($category);
|
||||
$sql.= " AND c.fk_product = p.rowid ";
|
||||
$sql.= " AND c.fk_product = t.rowid ";
|
||||
}
|
||||
|
||||
// Show products
|
||||
if ($mode == 1) $sql.= " AND p.fk_product_type = 0";
|
||||
if ($mode == 1) $sql.= " AND t.fk_product_type = 0";
|
||||
// Show services
|
||||
if ($mode == 2) $sql.= " AND p.fk_product_type = 1";
|
||||
// Show product on sell
|
||||
if ($to_sell !== '') $sql.= " AND p.tosell = ".$db->escape($to_sell);
|
||||
// Show product on buy
|
||||
if ($to_buy !== '') $sql.= " AND p.tobuy = ".$db->escape($to_buy);
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
if ($mode == 2) $sql.= " AND t.fk_product_type = 1";
|
||||
// Add sql filters
|
||||
if ($sqlfilters)
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (! DolibarrApi::_checkFilters($sqlfilters))
|
||||
{
|
||||
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
|
||||
}
|
||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
if ($limit) {
|
||||
if ($page < 0)
|
||||
|
||||
@ -105,7 +105,7 @@ class FormProduct
|
||||
|
||||
if(!empty($exclude)) $sql.= ' AND e.rowid NOT IN('.implode(',', $exclude).')';
|
||||
|
||||
if ($sumStock && empty($fk_product)) $sql.= " GROUP BY e.rowid, e.label, e.description";
|
||||
if ($sumStock && empty($fk_product)) $sql.= " GROUP BY e.rowid, e.label, e.description, e.fk_parent";
|
||||
$sql.= " ORDER BY e.label";
|
||||
|
||||
dol_syslog(get_class($this).'::loadWarehouses', LOG_DEBUG);
|
||||
|
||||
@ -205,14 +205,18 @@ if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref');
|
||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', '', '', '', 0, '', '', 1);
|
||||
|
||||
print '<table class="noborder tableforfield" width="100%">';
|
||||
|
||||
if ($object->type!=Product::TYPE_SERVICE || empty($conf->global->PRODUIT_MULTIPRICES))
|
||||
{
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border tableforfield" width="100%">';
|
||||
}
|
||||
|
||||
// Nature
|
||||
if($object->type!=Product::TYPE_SERVICE)
|
||||
if ($object->type!=Product::TYPE_SERVICE)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Nature").'</td><td colspan="2">';
|
||||
print '<tr><td>'.$langs->trans("Nature").'</td><td>';
|
||||
print $object->getLibFinished();
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -244,7 +248,10 @@ if ($id > 0 || ! empty($ref))
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
if ($object->type!=Product::TYPE_SERVICE || empty($conf->global->PRODUIT_MULTIPRICES))
|
||||
{
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
@ -124,7 +124,7 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all')
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref');
|
||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', '', '', '', 0, '', '', 1);
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
|
||||
@ -191,7 +191,7 @@ if ($action == 'create')
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Ref").'</td><td colspan="3"><input name="libelle" size="20" value=""></td></tr>';
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Ref").'</td><td><input name="libelle" size="20" value=""></td></tr>';
|
||||
|
||||
print '<tr><td >'.$langs->trans("LocationSummary").'</td><td colspan="3"><input name="lieu" size="40" value="'.(!empty($object->lieu)?$object->lieu:'').'"></td></tr>';
|
||||
|
||||
@ -201,31 +201,32 @@ if ($action == 'create')
|
||||
print '</td></tr>';
|
||||
|
||||
// Description
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td colspan="3">';
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
// Editeur wysiwyg
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor('desc',(!empty($object->description)?$object->description:''),'',180,'dolibarr_notes','In',false,true,$conf->fckeditor->enabled,5,70);
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('Address').'</td><td colspan="3"><textarea name="address" class="quatrevingtpercent" rows="3" wrap="soft">';
|
||||
print '<tr><td>'.$langs->trans('Address').'</td><td><textarea name="address" class="quatrevingtpercent" rows="3" wrap="soft">';
|
||||
print (!empty($object->address)?$object->address:'');
|
||||
print '</textarea></td></tr>';
|
||||
|
||||
// Zip / Town
|
||||
print '<tr><td>'.$langs->trans('Zip').'</td><td>';
|
||||
print $formcompany->select_ziptown((!empty($object->zip)?$object->zip:''),'zipcode',array('town','selectcountry_id','state_id'),6);
|
||||
print '</td><td>'.$langs->trans('Town').'</td><td>';
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Town').'</td><td>';
|
||||
print $formcompany->select_ziptown((!empty($object->town)?$object->town:''),'town',array('zipcode','selectcountry_id','state_id'));
|
||||
print '</td></tr>';
|
||||
|
||||
// Country
|
||||
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">';
|
||||
print '<tr><td>'.$langs->trans('Country').'</td><td>';
|
||||
print $form->select_country((!empty($object->country_id)?$object->country_id:$mysoc->country_code),'country_id');
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
||||
print '</td></tr>';
|
||||
// Status
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">';
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
||||
print '<select name="statut" class="flat">';
|
||||
foreach ($object->statuts as $key => $value)
|
||||
{
|
||||
@ -295,51 +296,12 @@ else
|
||||
// Warehouse card
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/stock/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
$morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu;
|
||||
/*
|
||||
// Ref supplier
|
||||
//$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1);
|
||||
//$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
//$morehtmlref.=$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
$langs->load("projects");
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
if ($user->rights->supplier_proposal->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$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.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
||||
$morehtmlref.=$proj->ref;
|
||||
$morehtmlref.='</a>';
|
||||
} else {
|
||||
$morehtmlref.='';
|
||||
}
|
||||
}
|
||||
}*/
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'libelle', $morehtmlref);
|
||||
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
@ -347,15 +309,6 @@ else
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
|
||||
// Ref
|
||||
/*
|
||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||
print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'libelle');
|
||||
print '</td>';*/
|
||||
|
||||
//print '<tr><td>'.$langs->trans("LocationSummary").'</td><td colspan="3">'.$object->lieu.'</td></tr>';
|
||||
|
||||
// Parent entrepot
|
||||
$e = new Entrepot($db);
|
||||
if(!empty($object->fk_parent) && $e->fetch($object->fk_parent) > 0) {
|
||||
@ -367,30 +320,7 @@ else
|
||||
}
|
||||
|
||||
// Description
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>'.nl2br($object->description).'</td></tr>';
|
||||
|
||||
// Address
|
||||
/*
|
||||
print '<tr><td>'.$langs->trans('Address').'</td><td>';
|
||||
print $object->address;
|
||||
print '</td></tr>';
|
||||
|
||||
// Town
|
||||
print '<tr><td>'.$langs->trans('Zip').'</td><td>'.$object->zip.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Town').'</td><td>'.$object->town.'</td></tr>';
|
||||
|
||||
// Country
|
||||
print '<tr><td>'.$langs->trans('Country').'</td><td>';
|
||||
if (! empty($object->country_code))
|
||||
{
|
||||
$img=picto_from_langcode($object->country_code);
|
||||
print ($img?$img.' ':'');
|
||||
}
|
||||
print $object->country;
|
||||
print '</td></tr>';*/
|
||||
|
||||
// Status
|
||||
//print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'.$object->getLibStatut(4).'</td></tr>';
|
||||
print '<tr><td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>'.nl2br($object->description).'</td></tr>';
|
||||
|
||||
$calcproductsunique=$object->nb_different_products();
|
||||
$calcproducts=$object->nb_products();
|
||||
@ -415,7 +345,7 @@ else
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
// Value
|
||||
print '<tr><td>'.$langs->trans("EstimatedStockValueShort").'</td><td>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("EstimatedStockValueShort").'</td><td>';
|
||||
print price((empty($calcproducts['value'])?'0':price2num($calcproducts['value'],'MT')), 0, $langs, 0, -1, -1, $conf->currency);
|
||||
print "</td></tr>";
|
||||
|
||||
|
||||
@ -39,18 +39,30 @@ $result=restrictedArea($user,'stock');
|
||||
$help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks';
|
||||
llxHeader("",$langs->trans("Stocks"),$help_url);
|
||||
|
||||
$entrepot = new Entrepot($db);
|
||||
$entrepot->fetch($_GET["id"]);
|
||||
$entrepot->info($_GET["id"]);
|
||||
$object = new Entrepot($db);
|
||||
$object->fetch($_GET["id"]);
|
||||
$object->info($_GET["id"]);
|
||||
|
||||
$head = stock_prepare_head($entrepot);
|
||||
$head = stock_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'info', $langs->trans("Warehouse"), 0, 'stock');
|
||||
|
||||
|
||||
print '<table width="100%"><tr><td>';
|
||||
dol_print_object_info($entrepot);
|
||||
print '</td></tr></table>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/stock/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
$morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu;
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'libelle', $morehtmlref);
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
dol_print_object_info($object);
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
@ -410,8 +410,8 @@ if ($resql)
|
||||
|
||||
if ($id > 0)
|
||||
{
|
||||
$entrepot = new Entrepot($db);
|
||||
$result = $entrepot->fetch($id);
|
||||
$object = new Entrepot($db);
|
||||
$result = $object->fetch($id);
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_print_error($db);
|
||||
@ -430,69 +430,60 @@ if ($resql)
|
||||
*/
|
||||
if ($id)
|
||||
{
|
||||
$head = stock_prepare_head($entrepot);
|
||||
$head = stock_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'movements', $langs->trans("Warehouse"), 0, 'stock');
|
||||
|
||||
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/stock/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
$morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu;
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'libelle', $morehtmlref);
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/stock/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||
print $form->showrefnav($entrepot, 'id', $linkback, 1, 'rowid', 'libelle');
|
||||
print '</td>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("LocationSummary").'</td><td colspan="3">'.$entrepot->lieu.'</td></tr>';
|
||||
|
||||
// Description
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td colspan="3">'.dol_htmlentitiesbr($entrepot->description).'</td></tr>';
|
||||
print '<tr><td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>'.dol_htmlentitiesbr($object->description).'</td></tr>';
|
||||
|
||||
// Address
|
||||
print '<tr><td>'.$langs->trans('Address').'</td><td colspan="3">';
|
||||
print $entrepot->address;
|
||||
print '</td></tr>';
|
||||
|
||||
// Town
|
||||
print '<tr><td width="25%">'.$langs->trans('Zip').'</td><td width="25%">'.$entrepot->zip.'</td>';
|
||||
print '<td width="25%">'.$langs->trans('Town').'</td><td width="25%">'.$entrepot->town.'</td></tr>';
|
||||
|
||||
// Country
|
||||
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">';
|
||||
if (! empty($entrepot->country_code))
|
||||
{
|
||||
$img=picto_from_langcode($entrepot->country_code);
|
||||
print ($img?$img.' ':'');
|
||||
print $entrepot->country;
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Status
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'.$entrepot->getLibStatut(4).'</td></tr>';
|
||||
|
||||
$calcproductsunique=$entrepot->nb_different_products();
|
||||
$calcproducts=$entrepot->nb_products();
|
||||
$calcproductsunique=$object->nb_different_products();
|
||||
$calcproducts=$object->nb_products();
|
||||
|
||||
// Total nb of different products
|
||||
print '<tr><td valign="top">'.$langs->trans("NumberOfDifferentProducts").'</td><td colspan="3">';
|
||||
print '<tr><td>'.$langs->trans("NumberOfDifferentProducts").'</td><td>';
|
||||
print empty($calcproductsunique['nb'])?'0':$calcproductsunique['nb'];
|
||||
print "</td></tr>";
|
||||
|
||||
// Nb of products
|
||||
print '<tr><td valign="top">'.$langs->trans("NumberOfProducts").'</td><td colspan="3">';
|
||||
print '<tr><td>'.$langs->trans("NumberOfProducts").'</td><td>';
|
||||
print empty($calcproducts['nb'])?'0':$calcproducts['nb'];
|
||||
print "</td></tr>";
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
print '<div class="fichehalfright">';
|
||||
print '<div class="ficheaddleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
// Value
|
||||
print '<tr><td valign="top">'.$langs->trans("EstimatedStockValueShort").'</td><td colspan="3">';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("EstimatedStockValueShort").'</td><td>';
|
||||
print price((empty($calcproducts['value'])?'0':price2num($calcproducts['value'],'MT')), 0, $langs, 0, -1, -1, $conf->currency);
|
||||
print "</td></tr>";
|
||||
|
||||
// Last movement
|
||||
$sql = "SELECT MAX(m.datem) as datem";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."stock_mouvement as m";
|
||||
$sql .= " WHERE m.fk_entrepot = '".$entrepot->id."'";
|
||||
$sql .= " WHERE m.fk_entrepot = '".$object->id."'";
|
||||
$resqlbis = $db->query($sql);
|
||||
if ($resqlbis)
|
||||
{
|
||||
@ -504,7 +495,7 @@ if ($resql)
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("LastMovement").'</td><td colspan="3">';
|
||||
print '<tr><td>'.$langs->trans("LastMovement").'</td><td>';
|
||||
if ($lastmovementdate)
|
||||
{
|
||||
print dol_print_date($lastmovementdate,'dayhour');
|
||||
@ -517,6 +508,12 @@ if ($resql)
|
||||
|
||||
print "</table>";
|
||||
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
print '<div class="clearboth"></div>';
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
|
||||
@ -526,7 +523,6 @@ if ($resql)
|
||||
*/
|
||||
if ($action == "correction")
|
||||
{
|
||||
if ($id) $object=$entrepot;
|
||||
include DOL_DOCUMENT_ROOT.'/product/stock/tpl/stockcorrection.tpl.php';
|
||||
print '<br>';
|
||||
}
|
||||
@ -536,7 +532,6 @@ if ($resql)
|
||||
*/
|
||||
if ($action == "transfert")
|
||||
{
|
||||
if ($id) $object=$entrepot;
|
||||
include DOL_DOCUMENT_ROOT.'/product/stock/tpl/stocktransfer.tpl.php';
|
||||
print '<br>';
|
||||
}
|
||||
@ -651,7 +646,7 @@ if ($resql)
|
||||
// Warehouse
|
||||
if (! $id > 0)
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<td class="liste_titre maxwidthonsmartphone" align="left">';
|
||||
//print '<input class="flat" type="text" size="8" name="search_warehouse" value="'.($search_warehouse).'">';
|
||||
print $formproduct->selectWarehouses($search_warehouse, 'search_warehouse', '', 1);
|
||||
print '</td>';
|
||||
|
||||
@ -438,11 +438,15 @@ 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="mode" value="'.$mode.'">';
|
||||
print $langs->trans('Warehouse').' : '.$formproduct->selectWarehouses($fk_entrepot, 'fk_entrepot', '', 1);
|
||||
print '<br />';
|
||||
print $langs->trans('Supplier').' : '.$form->select_company($fk_supplier, 'fk_supplier', 'fournisseur=1', 1);
|
||||
print '<br />';
|
||||
print ' <input class="button" type="submit" name="valid" value="'.$langs->trans('ToFilter').'">';
|
||||
print '<div class="inline-block valignmiddle" style="padding-right: 20px;">';
|
||||
print $langs->trans('Warehouse').' '.$formproduct->selectWarehouses($fk_entrepot, 'fk_entrepot', '', 1);
|
||||
print '</div>';
|
||||
print '<div class="inline-block valignmiddle" style="padding-right: 20px;">';
|
||||
print $langs->trans('Supplier').' '.$form->select_company($fk_supplier, 'fk_supplier', 'fournisseur=1', 1);
|
||||
print '</div>';
|
||||
print '<div class="inline-block valignmiddle">';
|
||||
print '<input class="button" type="submit" name="valid" value="'.$langs->trans('ToFilter').'">';
|
||||
print '</div>';
|
||||
print '</form>';
|
||||
|
||||
if ($sref || $snom || $sall || $salert || GETPOST('search', 'alpha')) {
|
||||
|
||||
@ -494,7 +494,7 @@ if ($action == 'create' && $user->rights->projet->creer)
|
||||
// Thirdparty
|
||||
if ($conf->societe->enabled)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td class="maxwidthonsmartphone">';
|
||||
$filteronlist='';
|
||||
if (! empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) $filteronlist=$conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST;
|
||||
$text=$form->select_thirdparty_list(GETPOST('socid','int'), 'socid', $filteronlist, 'SelectThirdParty', 1, 0, array(), '', 0, 0, 'minwidth300');
|
||||
@ -517,8 +517,8 @@ if ($action == 'create' && $user->rights->projet->creer)
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Public
|
||||
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
||||
// Visibility
|
||||
print '<tr><td>'.$langs->trans("Visibility").'</td><td class="maxwidthonsmartphone">';
|
||||
$array=array();
|
||||
if (empty($conf->global->PROJECT_DISABLE_PRIVATE_PROJECT)) $array[0] = $langs->trans("PrivateProject");
|
||||
if (empty($conf->global->PROJECT_DISABLE_PUBLIC_PROJECT)) $array[1] = $langs->trans("SharedProject");
|
||||
@ -539,13 +539,13 @@ if ($action == 'create' && $user->rights->projet->creer)
|
||||
{
|
||||
// Opportunity status
|
||||
print '<tr><td>'.$langs->trans("OpportunityStatus").'</td>';
|
||||
print '<td>';
|
||||
print '<td class="maxwidthonsmartphone">';
|
||||
print $formproject->selectOpportunityStatus('opp_status', GETPOST('opp_status')?GETPOST('opp_status'):$object->opp_status);
|
||||
print '</tr>';
|
||||
|
||||
// Opportunity probability
|
||||
print '<tr><td>'.$langs->trans("OpportunityProbability").'</td>';
|
||||
print '<td><input size="5" type="text" id="opp_percent" name="opp_percent" value="'.(GETPOST('opp_percent')!=''?price(GETPOST('opp_percent')):'').'"> %';
|
||||
print '<td><input size="5" type="text" id="opp_percent" name="opp_percent" value="'.(GETPOST('opp_percent')!=''?price(GETPOST('opp_percent')):'').'"><span class="hideonsmartphone"> %</span>';
|
||||
print '<input type="hidden" name="opp_percent_not_set" id="opp_percent_not_set" value="'.(GETPOST('opp_percent')!=''?'0':'1').'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@ -1132,7 +1132,7 @@ else
|
||||
|
||||
$var=true;
|
||||
|
||||
$somethingshown=$formfile->show_documents('project',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf);
|
||||
print $formfile->showdocuments('project',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf);
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
@ -889,15 +889,17 @@ class Project extends CommonObject
|
||||
* @param int $addlabel 0=Default, 1=Add label into string, >1=Add first chars into string
|
||||
* @param string $moreinpopup Text to add into popup
|
||||
* @param string $sep Separator between ref and label if option addlabel is set
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0, $option='', $addlabel=0, $moreinpopup='', $sep=' - ')
|
||||
function getNomUrl($withpicto=0, $option='', $addlabel=0, $moreinpopup='', $sep=' - ', $notooltip=0)
|
||||
{
|
||||
global $langs;
|
||||
global $conf, $langs, $user;
|
||||
|
||||
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
|
||||
|
||||
$result = '';
|
||||
$link = '';
|
||||
$linkend = '';
|
||||
|
||||
$label='';
|
||||
if ($option != 'nolink') $label = '<u>' . $langs->trans("ShowProject") . '</u>';
|
||||
if (! empty($this->ref))
|
||||
@ -911,33 +913,44 @@ class Project extends CommonObject
|
||||
if (! empty($this->datee))
|
||||
$label .= ($label?'<br>':'').'<b>' . $langs->trans('DateEnd') . ': </b>' . dol_print_date($this->datee, 'day'); // The space must be after the : to not being explode when showing the title in img_picto
|
||||
if ($moreinpopup) $label.='<br>'.$moreinpopup;
|
||||
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
|
||||
if ($option != 'nolink')
|
||||
{
|
||||
if (preg_match('/\.php$/',$option)) {
|
||||
$link = '<a href="' . dol_buildpath($option,1) . '?id=' . $this->id . $linkclose;
|
||||
$linkend = '</a>';
|
||||
$url = dol_buildpath($option,1) . '?id=' . $this->id;
|
||||
}
|
||||
else if ($option == 'task')
|
||||
{
|
||||
$link = '<a href="' . DOL_URL_ROOT . '/projet/tasks.php?id=' . $this->id . $linkclose;
|
||||
$linkend = '</a>';
|
||||
$url = DOL_URL_ROOT . '/projet/tasks.php?id=' . $this->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$link = '<a href="' . DOL_URL_ROOT . '/projet/card.php?id=' . $this->id . $linkclose;
|
||||
$linkend = '</a>';
|
||||
$url = DOL_URL_ROOT . '/projet/card.php?id=' . $this->id;
|
||||
}
|
||||
}
|
||||
|
||||
$linkclose='';
|
||||
if (empty($notooltip) && $user->rights->propal->lire)
|
||||
{
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$label=$langs->trans("ShowProject");
|
||||
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose.=' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose.=' class="classfortooltip"';
|
||||
}
|
||||
|
||||
$picto = 'projectpub';
|
||||
if (!$this->public) $picto = 'project';
|
||||
|
||||
|
||||
if ($withpicto) $result.=($link . img_object($label, $picto, 'class="classfortooltip"') . $linkend);
|
||||
$linkstart = '<a href="'.$url.'"';
|
||||
$linkstart.=$linkclose.'>';
|
||||
$linkend='</a>';
|
||||
|
||||
if ($withpicto) $result.=($linkstart . img_object(($notooltip?'':$label), $picto, ($notooltip?'':'class="classfortooltip"')) . $linkend);
|
||||
if ($withpicto && $withpicto != 2) $result.=' ';
|
||||
if ($withpicto != 2) $result.=$link . $this->ref . $linkend . (($addlabel && $this->title) ? $sep . dol_trunc($this->title, ($addlabel > 1 ? $addlabel : 0)) : '');
|
||||
if ($withpicto != 2) $result.=$linkstart . $this->ref . $linkend . (($addlabel && $this->title) ? $sep . dol_trunc($this->title, ($addlabel > 1 ? $addlabel : 0)) : '');
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@ -495,12 +495,15 @@ class Task extends CommonObject
|
||||
* @param string $mode Mode 'task', 'time', 'contact', 'note', document' define page to link to.
|
||||
* @param int $addlabel 0=Default, 1=Add label into string, >1=Add first chars into string
|
||||
* @param string $sep Separator between ref and label if option addlabel is set
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option='',$mode='task', $addlabel=0, $sep=' - ')
|
||||
function getNomUrl($withpicto=0,$option='',$mode='task', $addlabel=0, $sep=' - ', $notooltip=0)
|
||||
{
|
||||
global $langs;
|
||||
global $conf, $langs, $user;
|
||||
|
||||
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
|
||||
|
||||
$result='';
|
||||
$label = '<u>' . $langs->trans("ShowTask") . '</u>';
|
||||
if (! empty($this->ref))
|
||||
@ -511,17 +514,30 @@ class Task extends CommonObject
|
||||
{
|
||||
$label .= "<br>".get_date_range($this->date_start,$this->date_end,'',$langs,0);
|
||||
}
|
||||
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
|
||||
$url = DOL_URL_ROOT.'/projet/tasks/'.$mode.'.php?id='.$this->id.($option=='withproject'?'&withproject=1':'');
|
||||
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/projet/tasks/'.$mode.'.php?id='.$this->id.($option=='withproject'?'&withproject=1':'').$linkclose;
|
||||
$linkclose = '';
|
||||
if (empty($notooltip))
|
||||
{
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$label=$langs->trans("ShowTask");
|
||||
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose.=' class="classfortooltip"';
|
||||
}
|
||||
|
||||
$linkstart = '<a href="'.$url.'"';
|
||||
$linkstart.=$linkclose.'>';
|
||||
$linkend='</a>';
|
||||
|
||||
|
||||
$picto='projecttask';
|
||||
|
||||
|
||||
if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
|
||||
if ($withpicto) $result.=($linkstart.img_object(($notooltip?'':$label), $picto, ($notooltip?'':'class="classfortooltip"')).$linkend);
|
||||
if ($withpicto && $withpicto != 2) $result.=' ';
|
||||
if ($withpicto != 2) $result.=$link.$this->ref.$linkend . (($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
|
||||
if ($withpicto != 2) $result.=$linkstart.$this->ref.$linkend . (($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
|
||||
return $result;
|
||||
}
|
||||
|
||||
@ -575,7 +591,7 @@ class Task extends CommonObject
|
||||
$sql = "SELECT p.rowid as projectid, p.ref, p.title as plabel, p.public, p.fk_statut as projectstatus,";
|
||||
$sql.= " t.rowid as taskid, t.ref as taskref, t.label, t.description, t.fk_task_parent, t.duration_effective, t.progress, t.fk_statut as status,";
|
||||
$sql.= " t.dateo as date_start, t.datee as date_end, t.planned_workload, t.rang,";
|
||||
$sql.= " s.nom as thirdparty_name";
|
||||
$sql.= " s.rowid as thirdparty_id, s.nom as thirdparty_name";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON p.fk_soc = s.rowid";
|
||||
if ($mode == 0)
|
||||
@ -692,6 +708,7 @@ class Task extends CommonObject
|
||||
$tasks[$i]->date_end = $this->db->jdate($obj->date_end);
|
||||
$tasks[$i]->rang = $obj->rang;
|
||||
|
||||
$tasks[$i]->thirdparty_id = $obj->thirdparty_id;
|
||||
$tasks[$i]->thirdparty_name = $obj->thirdparty_name;
|
||||
}
|
||||
|
||||
|
||||
@ -137,8 +137,8 @@ if ($object->id > 0)
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Files infos
|
||||
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td>'.count($filearray).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td>'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
|
||||
@ -26,6 +26,7 @@ require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
|
||||
$langs->load("projects");
|
||||
|
||||
@ -71,6 +72,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$title=$langs->trans("Project").' - '.$object->ref.' '.$object->name;
|
||||
if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->ref.' '.$object->name.' - '.$langs->trans("Info");
|
||||
$help_url="EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos";
|
||||
|
||||
@ -562,9 +562,9 @@ if ($id > 0 || ! empty($ref))
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
print '<table width="100%"><tr><td width="50%" valign="top">';
|
||||
print '<a name="builddoc"></a>'; // ancre
|
||||
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
print '<a name="builddoc"></a>'; // ancre
|
||||
|
||||
/*
|
||||
* Documents generes
|
||||
*/
|
||||
@ -576,9 +576,11 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
$var=true;
|
||||
|
||||
$somethingshown=$formfile->show_documents('project_task',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf);
|
||||
print $formfile->showdocuments('project_task',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf);
|
||||
|
||||
print '</td></tr></table>';
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
print '</div></div></div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -510,7 +510,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
|
||||
print '<table class="noborder nohover" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="100">'.$langs->trans("Date").'</td>';
|
||||
print '<td>'.$langs->trans("Date").'</td>';
|
||||
print '<td>'.$langs->trans("By").'</td>';
|
||||
print '<td>'.$langs->trans("Note").'</td>';
|
||||
print '<td>'.$langs->trans("ProgressDeclared").'</td>';
|
||||
@ -520,20 +520,20 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
|
||||
print '<tr '.$bc[false].'>';
|
||||
|
||||
// Date
|
||||
print '<td class="nowrap">';
|
||||
print '<td class="maxwidthonsmartphone">';
|
||||
//$newdate=dol_mktime(12,0,0,$_POST["timemonth"],$_POST["timeday"],$_POST["timeyear"]);
|
||||
$newdate='';
|
||||
print $form->select_date($newdate,'time',1,1,2,"timespent_date",1,0,1);
|
||||
print $form->select_date($newdate, 'time', ($conf->browser->layout == 'phone'?2:1), 1, 2, "timespent_date", 1, 0, 1);
|
||||
print '</td>';
|
||||
|
||||
// Contributor
|
||||
print '<td class="nowrap">';
|
||||
print '<td class="maxwidthonsmartphone">';
|
||||
print img_object('','user','class="hideonsmartphone"');
|
||||
$contactsoftask=$object->getListContactId('internal');
|
||||
if (count($contactsoftask)>0)
|
||||
{
|
||||
$userid=$contactsoftask[0];
|
||||
print $form->select_dolusers((GETPOST('userid')?GETPOST('userid'):$userid), 'userid', 0, '', 0, '', $contactsoftask, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToTheTask"));
|
||||
print $form->select_dolusers((GETPOST('userid')?GETPOST('userid'):$userid), 'userid', 0, '', 0, '', $contactsoftask, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToTheTask"), 'maxwidth200');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -542,8 +542,8 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
|
||||
print '</td>';
|
||||
|
||||
// Note
|
||||
print '<td class="nowrap">';
|
||||
print '<textarea name="timespent_note" width="95%" rows="'.ROWS_2.'">'.($_POST['timespent_note']?$_POST['timespent_note']:'').'</textarea>';
|
||||
print '<td>';
|
||||
print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="'.ROWS_2.'">'.($_POST['timespent_note']?$_POST['timespent_note']:'').'</textarea>';
|
||||
print '</td>';
|
||||
|
||||
// Progress declared
|
||||
@ -582,7 +582,8 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
|
||||
$arrayfields['t.task_date']=array('label'=>$langs->trans("Date"), 'checked'=>1);
|
||||
if ((empty($id) && empty($ref)) || ! empty($projectidforalltimes)) // Not a dedicated task
|
||||
{
|
||||
$arrayfields['t.task_ref']=array('label'=>$langs->trans("Task"), 'checked'=>1);
|
||||
$arrayfields['t.task_ref']=array('label'=>$langs->trans("RefTask"), 'checked'=>1);
|
||||
$arrayfields['t.task_label']=array('label'=>$langs->trans("LabelTask"), 'checked'=>1);
|
||||
}
|
||||
$arrayfields['author']=array('label'=>$langs->trans("By"), 'checked'=>1);
|
||||
$arrayfields['t.note']=array('label'=>$langs->trans("Note"), 'checked'=>1);
|
||||
@ -710,6 +711,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
|
||||
if ((empty($id) && empty($ref)) || ! empty($projectidforalltimes)) // Not a dedicated task
|
||||
{
|
||||
if (! empty($arrayfields['t.task_ref']['checked'])) print_liste_field_titre($arrayfields['t.task_ref']['label'],$_SERVER['PHP_SELF'],'pt.ref','',$params,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['t.task_label']['checked'])) print_liste_field_titre($arrayfields['t.task_label']['label'],$_SERVER['PHP_SELF'],'pt.label','',$params,'',$sortfield,$sortorder);
|
||||
}
|
||||
if (! empty($arrayfields['author']['checked'])) print_liste_field_titre($arrayfields['author']['label'],$_SERVER['PHP_SELF'],'','',$params,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['t.note']['checked'])) print_liste_field_titre($arrayfields['t.note']['label'],$_SERVER['PHP_SELF'],'t.note','',$params,'',$sortfield,$sortorder);
|
||||
@ -742,9 +744,10 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
|
||||
if ((empty($id) && empty($ref)) || ! empty($projectidforalltimes)) // Not a dedicated task
|
||||
{
|
||||
if (! empty($arrayfields['t.task_ref']['checked'])) print '<td class="liste_titre"></td>';
|
||||
if (! empty($arrayfields['t.task_label']['checked'])) print '<td class="liste_titre"></td>';
|
||||
}
|
||||
if (! empty($arrayfields['author']['checked'])) print '<td class="liste_titre"></td>';
|
||||
if (! empty($arrayfields['t.note']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" name="search_note" value="'.$search_note.'" size="10"></td>';
|
||||
if (! empty($arrayfields['t.note']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" name="search_note" value="'.$search_note.'"></td>';
|
||||
if (! empty($arrayfields['t.task_duration']['checked'])) print '<td class="liste_titre right"></td>';
|
||||
if (! empty($arrayfields['value']['checked'])) print '<td class="liste_titre"></td>';
|
||||
// Extra fields
|
||||
@ -812,7 +815,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Task
|
||||
// Task ref
|
||||
if (! empty($arrayfields['t.task_ref']['checked']))
|
||||
{
|
||||
if ((empty($id) && empty($ref)) || ! empty($projectidforalltimes)) // Not a dedicated task
|
||||
@ -827,7 +830,19 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
|
||||
}
|
||||
}
|
||||
|
||||
// User
|
||||
// Task label
|
||||
if (! empty($arrayfields['t.task_label']['checked']))
|
||||
{
|
||||
if ((empty($id) && empty($ref)) || ! empty($projectidforalltimes)) // Not a dedicated task
|
||||
{
|
||||
print '<td class="nowrap">';
|
||||
print $task_time->label;
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// User
|
||||
if (! empty($arrayfields['author']['checked']))
|
||||
{
|
||||
print '<td>';
|
||||
|
||||
@ -260,7 +260,7 @@ $urlsource=$_SERVER["PHP_SELF"]."?socid=".$socid;
|
||||
$genallowed=$user->rights->societe->creer;
|
||||
$delallowed=$user->rights->societe->supprimer;
|
||||
|
||||
$somethingshown=$formfile->show_documents('company',$socid,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$objcanvas->control->object->default_lang);
|
||||
print $formfile->showdocuments('company',$socid,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$objcanvas->control->object->default_lang);
|
||||
?>
|
||||
|
||||
</td>
|
||||
|
||||
@ -204,7 +204,7 @@ $urlsource=$_SERVER["PHP_SELF"]."?socid=".$socid;
|
||||
$genallowed=$user->rights->societe->creer;
|
||||
$delallowed=$user->rights->societe->supprimer;
|
||||
|
||||
$somethingshown=$formfile->show_documents('company',$socid,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$objcanvas->control->object->default_lang);
|
||||
print $formfile->showdocuments('company',$socid,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$objcanvas->control->object->default_lang);
|
||||
?>
|
||||
|
||||
</td>
|
||||
|
||||
@ -89,11 +89,12 @@ class Contacts extends DolibarrApi
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param int $socid ID of thirdparty to filter list
|
||||
* @return array Array of contact objects
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @return array Array of contact objects
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
function index($sortfield = "c.rowid", $sortorder = 'ASC', $limit = 0, $page = 0, $socid = 0) {
|
||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 0, $page = 0, $socid = 0, $sqlfilters = '') {
|
||||
global $db, $conf;
|
||||
|
||||
$obj_ret = array();
|
||||
@ -107,37 +108,36 @@ class Contacts extends DolibarrApi
|
||||
if (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid)
|
||||
$search_sale = DolibarrApiAccess::$user->id;
|
||||
|
||||
$sql = "SELECT c.rowid";
|
||||
$sql.= " FROM " . MAIN_DB_PREFIX . "socpeople as c";
|
||||
$sql = "SELECT t.rowid";
|
||||
$sql.= " FROM " . MAIN_DB_PREFIX . "socpeople as t";
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) {
|
||||
// We need this table joined to the select in order to filter by sale
|
||||
$sql.= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
|
||||
}
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as s ON c.fk_soc = s.rowid";
|
||||
$sql.= ' WHERE c.entity IN (' . getEntity('contact', 1) . ')';
|
||||
if ($socid)
|
||||
$sql.= " AND c.fk_soc = " . $socid;
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as s ON t.fk_soc = s.rowid";
|
||||
$sql.= ' WHERE t.entity IN (' . getEntity('contact', 1) . ')';
|
||||
if ($socid) $sql.= " AND t.fk_soc = " . $socid;
|
||||
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0)
|
||||
$sql.= " AND c.fk_soc = sc.fk_soc";
|
||||
$sql.= " AND t.fk_soc = sc.fk_soc";
|
||||
if ($search_sale > 0)
|
||||
$sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
|
||||
|
||||
|
||||
|
||||
// Insert sale filter
|
||||
if ($search_sale > 0)
|
||||
{
|
||||
$sql .= " AND sc.fk_user = " . $search_sale;
|
||||
}
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
// Add sql filters
|
||||
if ($sqlfilters)
|
||||
{
|
||||
if (! DolibarrApi::_checkFilters($sqlfilters))
|
||||
{
|
||||
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
|
||||
}
|
||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
|
||||
if ($limit)
|
||||
|
||||
@ -94,10 +94,10 @@ class Thirdparties extends DolibarrApi
|
||||
* @param int $mode Set to 1 to show only customers
|
||||
* Set to 2 to show only prospects
|
||||
* Set to 3 to show only those are not customer neither prospect
|
||||
* @param string $email Search by email filter
|
||||
* @return array Array of thirdparty objects
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @return array Array of thirdparty objects
|
||||
*/
|
||||
function index($sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0, $mode=0, $email=NULL) {
|
||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 0, $page = 0, $mode=0, $sqlfilters = '') {
|
||||
global $db, $conf;
|
||||
|
||||
$obj_ret = array();
|
||||
@ -107,35 +107,37 @@ class Thirdparties extends DolibarrApi
|
||||
// If the internal user must only see his customers, force searching by him
|
||||
if (! DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) $search_sale = DolibarrApiAccess::$user->id;
|
||||
|
||||
$sql = "SELECT s.rowid";
|
||||
$sql = "SELECT t.rowid";
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as t";
|
||||
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
|
||||
$sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st";
|
||||
$sql.= " WHERE s.fk_stcomm = st.id";
|
||||
if ($mode == 1) $sql.= " AND s.client IN (1, 3)";
|
||||
if ($mode == 2) $sql.= " AND s.client IN (2, 3)";
|
||||
if ($mode == 3) $sql.= " AND s.client IN (0)";
|
||||
$sql.= ' AND s.entity IN ('.getEntity('societe', 1).')';
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc";
|
||||
if ($email != NULL) $sql.= " AND s.email = \"".$email."\"";
|
||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
|
||||
|
||||
$sql.= " WHERE t.fk_stcomm = st.id";
|
||||
if ($mode == 1) $sql.= " AND t.client IN (1, 3)";
|
||||
if ($mode == 2) $sql.= " AND t.client IN (2, 3)";
|
||||
if ($mode == 3) $sql.= " AND t.client IN (0)";
|
||||
$sql.= ' AND t.entity IN ('.getEntity('societe', 1).')';
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND t.rowid = sc.fk_soc";
|
||||
//if ($email != NULL) $sql.= " AND s.email = \"".$email."\"";
|
||||
if ($socid) $sql.= " AND t.rowid = ".$socid;
|
||||
if ($search_sale > 0) $sql.= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
|
||||
// Insert sale filter
|
||||
if ($search_sale > 0)
|
||||
{
|
||||
$sql .= " AND sc.fk_user = ".$search_sale;
|
||||
}
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
// Add sql filters
|
||||
if ($sqlfilters)
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (! DolibarrApi::_checkFilters($sqlfilters))
|
||||
{
|
||||
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
|
||||
}
|
||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
|
||||
if ($limit) {
|
||||
|
||||
@ -1828,17 +1828,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', 'project')
|
||||
* @param int $maxlen Max length of name
|
||||
* @param integer $notooltip 1=Disable tooltip
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0, $option='', $maxlen=0, $notooltip=0)
|
||||
{
|
||||
global $conf,$langs, $hookmanager;
|
||||
global $conf, $langs, $hookmanager;
|
||||
|
||||
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
|
||||
|
||||
$name=$this->name?$this->name:$this->nom;
|
||||
|
||||
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1;
|
||||
|
||||
if (! empty($conf->global->SOCIETE_ADD_REF_IN_LIST) && (!empty($withpicto)))
|
||||
{
|
||||
if (($this->client) && (! empty ( $this->code_client ))) {
|
||||
@ -1853,46 +1853,46 @@ class Societe extends CommonObject
|
||||
if (!empty($this->name_alias)) $name .= ' ('.$this->name_alias.')';
|
||||
|
||||
$result=''; $label='';
|
||||
$link=''; $linkend='';
|
||||
$linkstart=''; $linkend='';
|
||||
|
||||
$label.= '<div width="100%">';
|
||||
|
||||
if ($option == 'customer' || $option == 'compta' || $option == 'category' || $option == 'category_supplier')
|
||||
{
|
||||
$label.= '<u>' . $langs->trans("ShowCustomer") . '</u>';
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$this->id;
|
||||
$linkstart = '<a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$this->id;
|
||||
}
|
||||
else if ($option == 'prospect' && empty($conf->global->SOCIETE_DISABLE_PROSPECTS))
|
||||
{
|
||||
$label.= '<u>' . $langs->trans("ShowProspect") . '</u>';
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$this->id;
|
||||
$linkstart = '<a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$this->id;
|
||||
}
|
||||
else if ($option == 'supplier')
|
||||
{
|
||||
$label.= '<u>' . $langs->trans("ShowSupplier") . '</u>';
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$this->id;
|
||||
$linkstart = '<a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$this->id;
|
||||
}
|
||||
else if ($option == 'agenda')
|
||||
{
|
||||
$label.= '<u>' . $langs->trans("ShowAgenda") . '</u>';
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/societe/agenda.php?socid='.$this->id;
|
||||
$linkstart = '<a href="'.DOL_URL_ROOT.'/societe/agenda.php?socid='.$this->id;
|
||||
}
|
||||
else if ($option == 'project')
|
||||
{
|
||||
$label.= '<u>' . $langs->trans("ShowProject") . '</u>';
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/societe/project.php?socid='.$this->id;
|
||||
$linkstart = '<a href="'.DOL_URL_ROOT.'/societe/project.php?socid='.$this->id;
|
||||
}
|
||||
else if ($option == 'margin')
|
||||
{
|
||||
$label.= '<u>' . $langs->trans("ShowMargin") . '</u>';
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/margin/tabs/thirdpartyMargins.php?socid='.$this->id.'&type=1';
|
||||
$linkstart = '<a href="'.DOL_URL_ROOT.'/margin/tabs/thirdpartyMargins.php?socid='.$this->id.'&type=1';
|
||||
}
|
||||
|
||||
// By default
|
||||
if (empty($link))
|
||||
if (empty($linkstart))
|
||||
{
|
||||
$label.= '<u>' . $langs->trans("ShowCompany") . '</u>';
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/societe/soc.php?socid='.$this->id;
|
||||
$linkstart = '<a href="'.DOL_URL_ROOT.'/societe/soc.php?socid='.$this->id;
|
||||
}
|
||||
|
||||
if (! empty($this->name))
|
||||
@ -1919,7 +1919,8 @@ class Societe extends CommonObject
|
||||
$label.= '</div>';
|
||||
|
||||
// Add type of canvas
|
||||
$link.=(!empty($this->canvas)?'&canvas='.$this->canvas:'').'"';
|
||||
$linkstart.=(!empty($this->canvas)?'&canvas='.$this->canvas:'').'"';
|
||||
|
||||
$linkclose='';
|
||||
if (empty($notooltip))
|
||||
{
|
||||
@ -1932,22 +1933,21 @@ class Societe extends CommonObject
|
||||
$linkclose.=' class="classfortooltip"';
|
||||
|
||||
if (! is_object($hookmanager))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager=new HookManager($this->db);
|
||||
}
|
||||
$hookmanager->initHooks(array('societedao'));
|
||||
$parameters=array('id'=>$this->id);
|
||||
$reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook > 0) $linkclose = $hookmanager->resPrint;
|
||||
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager=new HookManager($this->db);
|
||||
}
|
||||
$hookmanager->initHooks(array('societedao'));
|
||||
$parameters=array('id'=>$this->id);
|
||||
$reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook > 0) $linkclose = $hookmanager->resPrint;
|
||||
}
|
||||
$link.=$linkclose.'>';
|
||||
$linkstart.=$linkclose.'>';
|
||||
$linkend='</a>';
|
||||
|
||||
if ($withpicto) $result.=($link.img_object(($notooltip?'':$label), 'company', ($notooltip?'':'class="classfortooltip"')).$linkend);
|
||||
if ($withpicto) $result.=($linkstart.img_object(($notooltip?'':$label), 'company', ($notooltip?'':'class="classfortooltip"')).$linkend);
|
||||
if ($withpicto && $withpicto != 2) $result.=' ';
|
||||
if ($withpicto != 2) $result.=$link.($maxlen?dol_trunc($name,$maxlen):$name).$linkend;
|
||||
if ($withpicto != 2) $result.=$linkstart.($maxlen?dol_trunc($name,$maxlen):$name).$linkend;
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@ -1132,7 +1132,7 @@ else
|
||||
}
|
||||
if ($j % 2 == 1) print '<td colspan="2"></td></tr>';
|
||||
|
||||
// Assujeti TVA
|
||||
// Vat is used
|
||||
print '<tr><td>'.fieldLabel('VATIsUsed','assujtva_value').'</td>';
|
||||
print '<td>';
|
||||
print $form->selectyesno('assujtva_value',1,1); // Assujeti par defaut en creation
|
||||
@ -1688,14 +1688,64 @@ else
|
||||
}
|
||||
if ($j % 2 == 1) print '<td colspan="2"></td></tr>';
|
||||
|
||||
// VAT payers
|
||||
print '<tr><td>'.fieldLabel('VATIsUsed','assujtva_value').'</td><td>';
|
||||
// VAT is used
|
||||
print '<tr><td>'.fieldLabel('VATIsUsed','assujtva_value').'</td><td colspan="3">';
|
||||
print $form->selectyesno('assujtva_value',$object->tva_assuj,1);
|
||||
print '</td>';
|
||||
|
||||
// Local Taxes
|
||||
//TODO: Place into a function to control showing by country or study better option
|
||||
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
|
||||
{
|
||||
print '<tr><td>'.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').'</td><td colspan="3">';
|
||||
print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1);
|
||||
if(! isOnlyOneLocalTax(1))
|
||||
{
|
||||
print '<span class="cblt1"> '.$langs->transcountry("Type",$mysoc->country_code).': ';
|
||||
$formcompany->select_localtax(1,$object->localtax1_value, "lt1");
|
||||
print '</span>';
|
||||
}
|
||||
|
||||
print '</td><td>'.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').'</td><td colspan="3">';
|
||||
print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
|
||||
if (! isOnlyOneLocalTax(2))
|
||||
{
|
||||
print '<span class="cblt2"> '.$langs->transcountry("Type",$mysoc->country_code).': ';
|
||||
$formcompany->select_localtax(2,$object->localtax2_value, "lt2");
|
||||
print '</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
}
|
||||
elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1")
|
||||
{
|
||||
print '<tr><td>'.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').'</td><td colspan="3">';
|
||||
print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1);
|
||||
if(! isOnlyOneLocalTax(1))
|
||||
{
|
||||
print '<span class="cblt1"> '.$langs->transcountry("Type",$mysoc->country_code).': ';
|
||||
$formcompany->select_localtax(1,$object->localtax1_value, "lt1");
|
||||
print '</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
}
|
||||
elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1")
|
||||
{
|
||||
print '<tr><td>'.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').'</td><td colspan="3">';
|
||||
print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
|
||||
if(! isOnlyOneLocalTax(2))
|
||||
{
|
||||
print '<span class="cblt2"> '.$langs->transcountry("Type",$mysoc->country_code).': ';
|
||||
$formcompany->select_localtax(2,$object->localtax2_value, "lt2");
|
||||
print '</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// VAT Code
|
||||
print '<td>'.fieldLabel('VATIntra','intra_vat').'</td>';
|
||||
print '<td>';
|
||||
print '<td colspan="3">';
|
||||
$s ='<input type="text" class="flat maxwidthonsmartphone" name="tva_intra" id="intra_vat" maxlength="20" value="'.$object->tva_intra.'">';
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLEVATCHECK))
|
||||
@ -1723,56 +1773,6 @@ else
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Local Taxes
|
||||
//TODO: Place into a function to control showing by country or study better option
|
||||
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
|
||||
{
|
||||
print '<tr><td>'.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').'</td><td>';
|
||||
print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1);
|
||||
if(! isOnlyOneLocalTax(1))
|
||||
{
|
||||
print '<span class="cblt1"> '.$langs->transcountry("Type",$mysoc->country_code).': ';
|
||||
$formcompany->select_localtax(1,$object->localtax1_value, "lt1");
|
||||
print '</span>';
|
||||
}
|
||||
|
||||
print '</td><td>'.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').'</td><td>';
|
||||
print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
|
||||
if (! isOnlyOneLocalTax(2))
|
||||
{
|
||||
print '<span class="cblt2"> '.$langs->transcountry("Type",$mysoc->country_code).': ';
|
||||
$formcompany->select_localtax(2,$object->localtax2_value, "lt2");
|
||||
print '</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
}
|
||||
elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1")
|
||||
{
|
||||
print '<tr><td>'.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').'</td><td colspan="3">';
|
||||
print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1);
|
||||
if(! isOnlyOneLocalTax(1))
|
||||
{
|
||||
print '<span class="cblt1"> '.$langs->transcountry("Type",$mysoc->country_code).': ';
|
||||
$formcompany->select_localtax(1,$object->localtax1_value, "lt1");
|
||||
print '</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
}
|
||||
elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1")
|
||||
{
|
||||
print '<tr><td>'.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').'</td><td colspan="3">';
|
||||
print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
|
||||
if(! isOnlyOneLocalTax(2))
|
||||
{
|
||||
print '<span class="cblt2"> '.$langs->transcountry("Type",$mysoc->country_code).': ';
|
||||
$formcompany->select_localtax(2,$object->localtax2_value, "lt2");
|
||||
print '</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Type - Size
|
||||
print '<tr><td>'.fieldLabel('ThirdPartyType','typent_id').'</td><td class="maxwidthonsmartphone">';
|
||||
print $form->selectarray("typent_id",$formcompany->typent_array(0), $object->typent_id, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT));
|
||||
@ -1931,7 +1931,7 @@ else
|
||||
)
|
||||
);
|
||||
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id, $langs->trans("MergeThirdparties"), $langs->trans("ConfirmMergeThirdparties"), "confirm_merge", $formquestion, 'no', 1, 190);
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id, $langs->trans("MergeThirdparties"), $langs->trans("ConfirmMergeThirdparties"), "confirm_merge", $formquestion, 'no', 1, 200);
|
||||
}
|
||||
|
||||
dol_htmloutput_errors($error,$errors);
|
||||
@ -2027,7 +2027,7 @@ else
|
||||
}
|
||||
//if ($j % 2 == 1) print '<td colspan="2"></td></tr>';
|
||||
|
||||
// VAT payers
|
||||
// VAT is used
|
||||
print '<tr><td>';
|
||||
print $langs->trans('VATIsUsed');
|
||||
print '</td><td>';
|
||||
@ -2035,6 +2035,104 @@ else
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Local Taxes
|
||||
//TODO: Place into a function to control showing by country or study better option
|
||||
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).'</td><td>';
|
||||
print yn($object->localtax1_assuj);
|
||||
print '</td></tr><tr><td>'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).'</td><td>';
|
||||
print yn($object->localtax2_assuj);
|
||||
print '</td></tr>';
|
||||
|
||||
if($object->localtax1_assuj=="1" && (! isOnlyOneLocalTax(1)))
|
||||
{
|
||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?socid='.$object->id.'">';
|
||||
print '<input type="hidden" name="action" value="set_localtax1">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr><td>'.$langs->transcountry("TypeLocaltax1", $mysoc->country_code).' <a href="'.$_SERVER["PHP_SELF"].'?action=editRE&socid='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).'</td>';
|
||||
if($action == 'editRE')
|
||||
{
|
||||
print '<td align="left">';
|
||||
$formcompany->select_localtax(1,$object->localtax1_value, "lt1");
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td>'.$object->localtax1_value.'</td>';
|
||||
}
|
||||
print '</tr></form>';
|
||||
}
|
||||
if($object->localtax2_assuj=="1" && (! isOnlyOneLocalTax(2)))
|
||||
{
|
||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?socid='.$object->id.'">';
|
||||
print '<input type="hidden" name="action" value="set_localtax2">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr><td>'.$langs->transcountry("TypeLocaltax2", $mysoc->country_code).'<a href="'.$_SERVER["PHP_SELF"].'?action=editIRPF&socid='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).'</td>';
|
||||
if($action == 'editIRPF'){
|
||||
print '<td align="left">';
|
||||
$formcompany->select_localtax(2,$object->localtax2_value, "lt2");
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||
}else{
|
||||
print '<td>'.$object->localtax2_value.'</td>';
|
||||
}
|
||||
print '</tr></form>';
|
||||
}
|
||||
}
|
||||
elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1")
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).'</td><td>';
|
||||
print yn($object->localtax1_assuj);
|
||||
print '</td></tr>';
|
||||
if($object->localtax1_assuj=="1" && (! isOnlyOneLocalTax(1)))
|
||||
{
|
||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?socid='.$object->id.'">';
|
||||
print '<input type="hidden" name="action" value="set_localtax1">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr><td> '.$langs->transcountry("TypeLocaltax1", $mysoc->country_code).'<a href="'.$_SERVER["PHP_SELF"].'?action=editRE&socid='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).'</td>';
|
||||
if($action == 'editRE'){
|
||||
print '<td align="left">';
|
||||
$formcompany->select_localtax(1,$object->localtax1_value, "lt1");
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||
}else{
|
||||
print '<td>'.$object->localtax1_value.'</td>';
|
||||
}
|
||||
print '</tr></form>';
|
||||
|
||||
}
|
||||
}
|
||||
elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1")
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).'</td><td>';
|
||||
print yn($object->localtax2_assuj);
|
||||
print '</td></tr>';
|
||||
if($object->localtax2_assuj=="1" && (! isOnlyOneLocalTax(2)))
|
||||
{
|
||||
|
||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?socid='.$object->id.'">';
|
||||
print '<input type="hidden" name="action" value="set_localtax2">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr><td> '.$langs->transcountry("TypeLocaltax2", $mysoc->country_code).' <a href="'.$_SERVER["PHP_SELF"].'?action=editIRPF&socid='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).'</td>';
|
||||
if($action == 'editIRPF'){
|
||||
print '<td align="left">';
|
||||
$formcompany->select_localtax(2,$object->localtax2_value, "lt2");
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||
}else{
|
||||
print '<td>'.$object->localtax2_value.'</td>';
|
||||
}
|
||||
print '</tr></form>';
|
||||
|
||||
}
|
||||
}
|
||||
/*
|
||||
if ($mysoc->country_code=='ES' && $mysoc->localtax2_assuj!="1" && ! empty($conf->fournisseur->enabled) && $object->fournisseur==1)
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).'</td><td colspan="3">';
|
||||
print yn($object->localtax2_assuj);
|
||||
print '</td><tr>';
|
||||
}
|
||||
*/
|
||||
|
||||
// VAT Code
|
||||
print '<tr>';
|
||||
print '<td class="nowrap">'.$langs->trans('VATIntra').'</td><td>';
|
||||
@ -2074,103 +2172,6 @@ else
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Local Taxes
|
||||
//TODO: Place into a function to control showing by country or study better option
|
||||
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).'</td><td>';
|
||||
print yn($object->localtax1_assuj);
|
||||
print '</td></tr><tr><td>'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).'</td><td>';
|
||||
print yn($object->localtax2_assuj);
|
||||
print '</td></tr>';
|
||||
|
||||
if($object->localtax1_assuj=="1" && (! isOnlyOneLocalTax(1)))
|
||||
{
|
||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?socid='.$object->id.'">';
|
||||
print '<input type="hidden" name="action" value="set_localtax1">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr><td>'.$langs->transcountry("TypeLocaltax1", $mysoc->country_code).' <a href="'.$_SERVER["PHP_SELF"].'?action=editRE&socid='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).'</td>';
|
||||
if($action == 'editRE')
|
||||
{
|
||||
print '<td align="left">';
|
||||
$formcompany->select_localtax(1,$object->localtax1_value, "lt1");
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td>'.$object->localtax1_value.'</td>';
|
||||
}
|
||||
print '</tr></form>';
|
||||
}
|
||||
if($object->localtax2_assuj=="1" && (! isOnlyOneLocalTax(2)))
|
||||
{
|
||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?socid='.$object->id.'">';
|
||||
print '<input type="hidden" name="action" value="set_localtax2">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr><td>'.$langs->transcountry("TypeLocaltax2", $mysoc->country_code).'<a href="'.$_SERVER["PHP_SELF"].'?action=editIRPF&socid='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).'</td>';
|
||||
if($action == 'editIRPF'){
|
||||
print '<td align="left">';
|
||||
$formcompany->select_localtax(2,$object->localtax2_value, "lt2");
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||
}else{
|
||||
print '<td>'.$object->localtax2_value.'</td>';
|
||||
}
|
||||
print '</tr></form>';
|
||||
}
|
||||
}
|
||||
elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1")
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).'</td><td>';
|
||||
print yn($object->localtax1_assuj);
|
||||
print '</td><tr>';
|
||||
if($object->localtax1_assuj=="1" && (! isOnlyOneLocalTax(1)))
|
||||
{
|
||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?socid='.$object->id.'">';
|
||||
print '<input type="hidden" name="action" value="set_localtax1">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr><td> '.$langs->transcountry("TypeLocaltax1", $mysoc->country_code).'<a href="'.$_SERVER["PHP_SELF"].'?action=editRE&socid='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).'</td>';
|
||||
if($action == 'editRE'){
|
||||
print '<td align="left">';
|
||||
$formcompany->select_localtax(1,$object->localtax1_value, "lt1");
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||
}else{
|
||||
print '<td>'.$object->localtax1_value.'</td>';
|
||||
}
|
||||
print '</tr></form>';
|
||||
|
||||
}
|
||||
}
|
||||
elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1")
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).'</td><td>';
|
||||
print yn($object->localtax2_assuj);
|
||||
print '</td><tr>';
|
||||
if($object->localtax2_assuj=="1" && (! isOnlyOneLocalTax(2)))
|
||||
{
|
||||
|
||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?socid='.$object->id.'">';
|
||||
print '<input type="hidden" name="action" value="set_localtax2">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr><td> '.$langs->transcountry("TypeLocaltax2", $mysoc->country_code).' <a href="'.$_SERVER["PHP_SELF"].'?action=editIRPF&socid='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).'</td>';
|
||||
if($action == 'editIRPF'){
|
||||
print '<td align="left">';
|
||||
$formcompany->select_localtax(2,$object->localtax2_value, "lt2");
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||
}else{
|
||||
print '<td>'.$object->localtax2_value.'</td>';
|
||||
}
|
||||
print '</tr></form>';
|
||||
|
||||
}
|
||||
}
|
||||
/*
|
||||
if ($mysoc->country_code=='ES' && $mysoc->localtax2_assuj!="1" && ! empty($conf->fournisseur->enabled) && $object->fournisseur==1)
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).'</td><td colspan="3">';
|
||||
print yn($object->localtax2_assuj);
|
||||
print '</td><tr>';
|
||||
}
|
||||
*/
|
||||
// Type + Staff
|
||||
$arr = $formcompany->typent_array(1);
|
||||
$object->typent= $arr[$object->typent_code];
|
||||
@ -2185,6 +2186,26 @@ else
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border tableforfield" width="100%">';
|
||||
|
||||
// Tags / categories
|
||||
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
|
||||
{
|
||||
// Customer
|
||||
if ($object->prospect || $object->client) {
|
||||
print '<tr><td>' . $langs->trans("CustomersCategoriesShort") . '</td>';
|
||||
print '<td>';
|
||||
print $form->showCategories($object->id, 'customer', 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
// Supplier
|
||||
if ($object->fournisseur) {
|
||||
print '<tr><td>' . $langs->trans("SuppliersCategoriesShort") . '</td>';
|
||||
print '<td>';
|
||||
print $form->showCategories($object->id, 'supplier', 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
}
|
||||
|
||||
// Legal
|
||||
print '<tr><td class="titlefield">'.$langs->trans('JuridicalStatus').'</td><td>'.$object->forme_juridique.'</td></tr>';
|
||||
|
||||
@ -2207,26 +2228,6 @@ else
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Tags / categories
|
||||
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
|
||||
{
|
||||
// Customer
|
||||
if ($object->prospect || $object->client) {
|
||||
print '<tr><td>' . $langs->trans("CustomersCategoriesShort") . '</td>';
|
||||
print '<td>';
|
||||
print $form->showCategories($object->id, 'customer', 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
// Supplier
|
||||
if ($object->fournisseur) {
|
||||
print '<tr><td>' . $langs->trans("SuppliersCategoriesShort") . '</td>';
|
||||
print '<td>';
|
||||
print $form->showCategories($object->id, 'supplier', 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
}
|
||||
|
||||
// Incoterms
|
||||
if (!empty($conf->incoterm->enabled))
|
||||
{
|
||||
|
||||
@ -1840,7 +1840,7 @@ if ($action == 'create')
|
||||
|
||||
$var = true;
|
||||
|
||||
$somethingshown = $formfile->show_documents('supplier_proposal', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang);
|
||||
print $formfile->showdocuments('supplier_proposal', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang);
|
||||
|
||||
|
||||
// Show links to link elements
|
||||
|
||||
@ -2368,31 +2368,60 @@ class SupplierProposal extends CommonObject
|
||||
* @param int $withpicto Add picto into link
|
||||
* @param string $option Where point the link ('compta', 'expedition', 'document', ...)
|
||||
* @param string $get_params Parametres added to url
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option='', $get_params='')
|
||||
function getNomUrl($withpicto=0,$option='', $get_params='', $notooltip=0)
|
||||
{
|
||||
global $langs;
|
||||
global $langs, $conf, $user;
|
||||
|
||||
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
|
||||
|
||||
$url='';
|
||||
$result='';
|
||||
$label=$langs->trans("ShowSupplierProposal").': '.$this->ref;
|
||||
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
|
||||
$label='<u>'.$langs->trans("ShowSupplierProposal").'</u>';
|
||||
if (! empty($this->ref))
|
||||
$label.= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
if (! empty($this->ref_fourn))
|
||||
$label.= '<br><b>'.$langs->trans('RefSupplier').':</b> '.$this->ref_fourn;
|
||||
if (! empty($this->total_ht))
|
||||
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if (! empty($this->total_tva))
|
||||
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if (! empty($this->total_ttc))
|
||||
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if ($option == '') {
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/supplier_proposal/card.php?id='.$this->id. $get_params .$linkclose;
|
||||
$url = DOL_URL_ROOT.'/supplier_proposal/card.php?id='.$this->id. $get_params;
|
||||
}
|
||||
if ($option == 'document') {
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/supplier_proposal/document.php?id='.$this->id. $get_params .$linkclose;
|
||||
$url = DOL_URL_ROOT.'/supplier_proposal/document.php?id='.$this->id. $get_params;
|
||||
}
|
||||
|
||||
$linkclose='';
|
||||
if (empty($notooltip) && $user->rights->propal->lire)
|
||||
{
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$label=$langs->trans("ShowSupplierProposal");
|
||||
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose.=' class="classfortooltip"';
|
||||
}
|
||||
|
||||
$linkstart = '<a href="'.$url.'"';
|
||||
$linkstart.=$linkclose.'>';
|
||||
$linkend='</a>';
|
||||
|
||||
$picto='supplier_proposal';
|
||||
|
||||
|
||||
if ($withpicto)
|
||||
$result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
|
||||
$result.=($linkstart.img_object(($notooltip?'':$label), $picto, ($notooltip?'':'class="classfortooltip"')).$linkend);
|
||||
if ($withpicto && $withpicto != 2)
|
||||
$result.=' ';
|
||||
$result.=$link.$this->ref.$linkend;
|
||||
$result.=$linkstart.$this->ref.$linkend;
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@ -2692,8 +2692,6 @@ table.dataTable td {
|
||||
}
|
||||
tr.even td, tr.pair td, tr.odd td, tr.impair td, form.odd div.tagtd, form.impair div.tagtd, form.pair div.tagtd, div.impair div.tagtd, div.pair div.tagtd, div.liste_titre div.tagtd {
|
||||
padding: 5px 2px 5px 3px;
|
||||
}
|
||||
tr.even td, tr.pair td, tr.odd td, tr.impair td, form.odd div.tagtd, form.impair div.tagtd, form.pair div.tagtd, div.impair div.tagtd, div.pair div.tagtd, div.liste_titre div.tagtd {
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
tr.even:last-of-type td, tr.pair:last-of-type td, tr.odd:last-of-type td, tr.impair:last-of-type td {
|
||||
@ -2746,11 +2744,6 @@ tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, tabl
|
||||
}
|
||||
div.liste_titre, tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable thead tr
|
||||
{
|
||||
/* TO MATCH BOOTSTRAP */
|
||||
/*background: #ddd;
|
||||
color: #000 !important;*/
|
||||
|
||||
/* TO MATCH ELDY */
|
||||
<?php if ($usegradienttitle) { ?>
|
||||
background-image: -o-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(<?php echo $colorbacktitle1; ?>,0.4) 100%);
|
||||
background-image: -moz-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(<?php echo $colorbacktitle1; ?>,0.4) 100%);
|
||||
@ -4309,42 +4302,44 @@ ul.ulmenu {
|
||||
|
||||
/* Style for first level menu with jmobile */
|
||||
.ui-li .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li {
|
||||
padding: .9em 15px;
|
||||
padding: 1em 15px;
|
||||
display: block;
|
||||
}
|
||||
.ui-btn-up-c {
|
||||
font-weight: normal;
|
||||
}
|
||||
.ui-bar-b {
|
||||
border: 1px solid #888;
|
||||
text-shadow: none;
|
||||
}
|
||||
.ui-focus, .ui-btn:focus {
|
||||
-moz-box-shadow: none;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
.ui-bar-b, .lilevel0 {
|
||||
/* border: 1px solid #888 !important; */
|
||||
background: rgb(<?php echo $colorbacktitle1; ?>);
|
||||
background-repeat: repeat-x;
|
||||
|
||||
/*
|
||||
background-image: -o-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%);
|
||||
background-image: -moz-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%);
|
||||
background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%);
|
||||
background-image: -ms-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%);
|
||||
background-image: linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%);*/
|
||||
font-weight: bold;
|
||||
|
||||
color: rgb(<?php echo $colortexttitle; ?>) !important;
|
||||
.ui-bar-b {
|
||||
/*border: 1px solid #888;*/
|
||||
border: none;
|
||||
background: none;
|
||||
text-shadow: none;
|
||||
color: rgb(<?php print $colortexttitlenotab; ?>) !important;
|
||||
}
|
||||
.ui-bar-b, .lilevel0 {
|
||||
background-repeat: repeat-x;
|
||||
border: none;
|
||||
background: none;
|
||||
text-shadow: none;
|
||||
color: rgb(<?php print $colortexttitlenotab; ?>) !important;
|
||||
}
|
||||
.alilevel0 {
|
||||
font-weight: normal !important;
|
||||
}
|
||||
|
||||
.ui-li.ui-last-child, .ui-li.ui-field-contain.ui-last-child {
|
||||
border-bottom-width: 0px !important;
|
||||
}
|
||||
.alilevel0 {
|
||||
color: rgb(<?php echo $colortexttitle; ?>) !important;
|
||||
text-shadow: 1px 0px 1px #<?php echo $colorshadowtitle; ?>;
|
||||
}
|
||||
.ulmenu {
|
||||
box-shadow: none !important;
|
||||
border-bottom: 1px solid #444;
|
||||
}
|
||||
.ui-btn-icon-right {
|
||||
border-right: 1px solid #ccc !important;
|
||||
@ -4372,6 +4367,7 @@ ul.ulmenu {
|
||||
div.tabsElem a.tab {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/*.ui-controlgroup-horizontal .ui-btn.ui-first-child {
|
||||
-webkit-border-top-left-radius: 6px;
|
||||
border-top-left-radius: 6px;
|
||||
@ -4380,25 +4376,26 @@ border-top-left-radius: 6px;
|
||||
-webkit-border-top-right-radius: 6px;
|
||||
border-top-right-radius: 6px;
|
||||
}*/
|
||||
|
||||
.alilevel1 {
|
||||
color: rgb(<?php echo $colortexttitle; ?>) !important;
|
||||
text-shadow: 1px 0px 1px #<?php echo $colorshadowtitle; ?>;
|
||||
color: rgb(<?php print $colortexttitlenotab; ?>) !important;
|
||||
}
|
||||
.lilevel1 {
|
||||
background-image: -webkit-gradient(linear,left top,left bottom,from( #ddd ),to( #d1d1d1 )) !important;
|
||||
background-image: -webkit-linear-gradient( #ddd,#d1d1d1 ) !important;
|
||||
background-image: -moz-linear-gradient( #ddd,#d1d1d1 ) !important;
|
||||
background-image: -ms-linear-gradient( #ddd,#d1d1d1 ) !important;
|
||||
background-image: -o-linear-gradient( #ddd,#d1d1d1 ) !important;
|
||||
background-image: linear-gradient( #ddd,#d1d1d1 ) !important;
|
||||
border-top: 2px solid #444;
|
||||
background: #fff ! important;
|
||||
}
|
||||
.lilevel1 div div a {
|
||||
font-weight: bold !important;
|
||||
}
|
||||
.lilevel2
|
||||
{
|
||||
padding-left: 22px;
|
||||
background: #fff ! important;
|
||||
}
|
||||
.lilevel3
|
||||
{
|
||||
padding-left: 54px;
|
||||
background: #fff ! important;
|
||||
}
|
||||
|
||||
|
||||
@ -4574,9 +4571,6 @@ img.demothumb {
|
||||
background-size: 20px auto;
|
||||
margin-top: 2px;
|
||||
}
|
||||
select {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
/* rule to reduce top menu - 3rd reduction */
|
||||
@media only screen and (max-width: <?php echo round($nbtopmenuentries * $fontsize * 3.4, 0) + 8; ?>px)
|
||||
@ -4637,6 +4631,19 @@ img.demothumb {
|
||||
max-width: 100px;
|
||||
min-width: 0 !important;
|
||||
}
|
||||
div.divphotoref {
|
||||
padding-right: 5px;
|
||||
}
|
||||
img.photoref, div.photoref {
|
||||
border: none;
|
||||
-moz-box-shadow: none;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
padding: 4px;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -918,6 +918,11 @@ table.noborder tr.liste_titre td {
|
||||
padding-left: 2px;
|
||||
padding-right: 2px;
|
||||
}
|
||||
.pictostatus {
|
||||
width: 15px;
|
||||
vertical-align: middle;
|
||||
margin-top: -3px
|
||||
}
|
||||
.pictowarning, .pictopreview {
|
||||
padding-<?php echo $left; ?>: 3px;
|
||||
}
|
||||
@ -941,26 +946,34 @@ div.arearef {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
div.heightref {
|
||||
min-height: 74px;
|
||||
min-height: 80px;
|
||||
}
|
||||
div.divphotoref {
|
||||
padding-right: 20px;
|
||||
}
|
||||
div.statusref {
|
||||
float: right;
|
||||
padding-right: 12px;
|
||||
padding-left: 12px;
|
||||
margin-top: 8px;
|
||||
margin-bottom: 10px;
|
||||
clear: both;
|
||||
}
|
||||
img.photoref {
|
||||
height: 80px;
|
||||
width: 80px;
|
||||
img.photoref, div.photoref {
|
||||
border: 1px solid #CCC;
|
||||
-moz-box-shadow: 3px 3px 4px #DDD;
|
||||
-webkit-box-shadow: 3px 3px 4px #DDD;
|
||||
box-shadow: 3px 3px 4px #DDD;
|
||||
padding: 4px;
|
||||
height: 80px;
|
||||
width: 80px;
|
||||
object-fit: contain;
|
||||
}
|
||||
div.photoref {
|
||||
display:table-cell;
|
||||
vertical-align:middle;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
img.photorefnoborder {
|
||||
padding: 2px;
|
||||
height: 48px;
|
||||
@ -2190,10 +2203,15 @@ 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 */
|
||||
}
|
||||
table.borderplus {
|
||||
border: 1px solid #BBB;
|
||||
}
|
||||
|
||||
.border tbody tr, .border tbody tr td {
|
||||
height: 20px;
|
||||
@ -2216,7 +2234,7 @@ td.border, div.tagtable div div.border {
|
||||
}
|
||||
|
||||
.table-key-border-col {
|
||||
width: 25%;
|
||||
/* width: 25%; */
|
||||
vertical-align:top;
|
||||
}
|
||||
.table-val-border-col {
|
||||
@ -2509,8 +2527,6 @@ div.pagination li.paginationafterarrows {
|
||||
{
|
||||
<?php if ($colorbacklinepairhover) { ?>
|
||||
background: rgb(<?php echo $colorbacklinepairhover; ?>) !important;
|
||||
<?php } else { ?>
|
||||
/* background: rgba(0, 0, 0, 0.05) !important; */
|
||||
<?php } ?>
|
||||
}
|
||||
|
||||
@ -2585,7 +2601,7 @@ div.liste_titre {
|
||||
border-top-style: solid;
|
||||
}
|
||||
div.liste_titre_bydiv {
|
||||
border-top-width: <?php echo $borderwith; ?>px;
|
||||
border-top-width: <?php echo $borderwith ?>px;
|
||||
border-top-color: rgb(<?php echo $colortopbordertitle1 ?>);
|
||||
border-top-style: solid;
|
||||
|
||||
@ -2593,7 +2609,7 @@ div.liste_titre_bydiv {
|
||||
border-collapse: collapse;
|
||||
display: table;
|
||||
padding: 2px 0px 2px 0;
|
||||
width: 100%; /* 1px more, i don't know why */
|
||||
width: 100%;
|
||||
}
|
||||
tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable.tr
|
||||
{
|
||||
@ -2601,10 +2617,6 @@ tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, tabl
|
||||
}
|
||||
div.liste_titre, tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable thead tr
|
||||
{
|
||||
/* TO MATCH BOOTSTRAP */
|
||||
/* background: #ddd; */
|
||||
|
||||
/* TO MATCH ELDY */
|
||||
<?php if ($usegradient) { ?>
|
||||
background-image: -o-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(250,250,250,0.3) 100%);
|
||||
background-image: -moz-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(250,250,250,0.3) 100%);
|
||||
@ -2690,6 +2702,7 @@ tr.liste_sub_total, tr.liste_sub_total td {
|
||||
border-top-width: <?php echo $borderwith ?>px !important;
|
||||
border-top-color: rgb(<?php echo $colortopbordertitle1 ?>) !important;
|
||||
border-top-style: solid !important;
|
||||
margin: 0px 0px 0px 0px !important;
|
||||
}
|
||||
.paymenttable tr td:first-child, .margintable tr td:first-child
|
||||
{
|
||||
@ -2818,8 +2831,13 @@ tr.box_pair {
|
||||
|
||||
tr.box_pair td, tr.box_impair td {
|
||||
padding: 4px;
|
||||
}
|
||||
tr.box_pair:not(:last-child) td, tr.box_impair:not(:last-child) td {
|
||||
border-bottom: 1px solid #f4f4f4;
|
||||
}
|
||||
.noborderbottom {
|
||||
border-bottom: none !important;
|
||||
}
|
||||
|
||||
.formboxfilter {
|
||||
vertical-align: middle;
|
||||
@ -3658,7 +3676,7 @@ ul.filedirelem li {
|
||||
border: solid 1px #f4f4f4;
|
||||
}
|
||||
|
||||
ui-layout-north {
|
||||
.ui-layout-north {
|
||||
|
||||
}
|
||||
|
||||
@ -4056,6 +4074,9 @@ li.ui-li-divider .ui-link {
|
||||
a.ui-link, a.ui-link:hover, .ui-btn:hover, span.ui-btn-text:hover, span.ui-btn-inner:hover {
|
||||
text-decoration: none !important;
|
||||
}
|
||||
.ui-body-c {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.ui-btn-inner {
|
||||
min-width: .4em;
|
||||
@ -4090,7 +4111,7 @@ select {
|
||||
/* display: inline-block; */ /* We can't set this. This disable ability to make */
|
||||
/* TODO modified by jmobile, replace jmobile with pure css*/
|
||||
overflow:hidden;
|
||||
white-space: nowrap;
|
||||
white-space: nowrap; /* Enabling this make behaviour strange when selecting the empty value if this empty value is '' instead of ' ' */
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.fiche .ui-controlgroup {
|
||||
@ -4123,7 +4144,7 @@ a.tab span.ui-btn-inner
|
||||
color: rgb(<?php print $colortext; ?>);
|
||||
}
|
||||
.liste_titre .ui-link {
|
||||
color: rgb(<?php echo $colortexttitle; ?>) !important;
|
||||
color: rgb(<?php print $colortexttitle; ?>) !important;
|
||||
}
|
||||
|
||||
a.ui-link {
|
||||
@ -4135,7 +4156,7 @@ a.ui-link {
|
||||
{
|
||||
white-space: normal;
|
||||
overflow: hidden;
|
||||
text-overflow: hidden;
|
||||
text-overflow: clip; /* "hidden" : do not exists as a text-overflow value (https://developer.mozilla.org/fr/docs/Web/CSS/text-overflow) */
|
||||
}
|
||||
|
||||
/* Warning: setting this may make screen not beeing refreshed after a combo selection */
|
||||
@ -4175,23 +4196,45 @@ ul.ulmenu {
|
||||
}
|
||||
|
||||
/* Style for first level menu with jmobile */
|
||||
.ui-li .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li {
|
||||
padding: 1em 15px;
|
||||
display: block;
|
||||
}
|
||||
.ui-btn-up-c {
|
||||
font-weight: normal;
|
||||
}
|
||||
.ui-focus, .ui-btn:focus {
|
||||
-moz-box-shadow: none;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
.ui-bar-b {
|
||||
/*border: 1px solid #888;*/
|
||||
border: none;
|
||||
background: none;
|
||||
text-shadow: none;
|
||||
color: rgb(<?php print $colortexttitlenotab; ?>) !important;
|
||||
}
|
||||
.ui-bar-b, .lilevel0 {
|
||||
border: 1px solid #888 !important;
|
||||
background: rgb(<?php echo $colorbacktitle1; ?>);
|
||||
background-repeat: repeat-x;
|
||||
border: none;
|
||||
background: none;
|
||||
text-shadow: none;
|
||||
color: rgb(<?php print $colortexttitlenotab; ?>) !important;
|
||||
}
|
||||
.alilevel0 {
|
||||
font-weight: normal !important;
|
||||
}
|
||||
|
||||
/*background-image: -o-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%);
|
||||
background-image: -moz-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%);
|
||||
background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%);
|
||||
background-image: -ms-linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%);
|
||||
background-image: linear-gradient(bottom, rgba(0,0,0,0.3) 0%, rgba(250,250,250,0.3) 100%);*/
|
||||
font-weight: bold;
|
||||
|
||||
color: rgb(<?php echo $colortexttitle; ?>) !important;
|
||||
.ui-li.ui-last-child, .ui-li.ui-field-contain.ui-last-child {
|
||||
border-bottom-width: 0px !important;
|
||||
}
|
||||
.alilevel0 {
|
||||
color: rgb(<?php echo $colortexttitle; ?>) !important;
|
||||
text-shadow: 1px 0px 1px #<?php echo $colorshadowtitle; ?>;
|
||||
}
|
||||
.ulmenu {
|
||||
box-shadow: none !important;
|
||||
border-bottom: 1px solid #444;
|
||||
}
|
||||
.ui-btn-icon-right {
|
||||
border-right: 1px solid #ccc !important;
|
||||
@ -4201,7 +4244,7 @@ ul.ulmenu {
|
||||
text-shadow: none;
|
||||
}
|
||||
.ui-btn-up-c, .ui-btn-hover-c {
|
||||
border: 1px solid #ccc;
|
||||
/* border: 1px solid #ccc; */
|
||||
text-shadow: none;
|
||||
}
|
||||
.ui-body-c .ui-link, .ui-body-c .ui-link:visited, .ui-body-c .ui-link:hover {
|
||||
@ -4211,33 +4254,43 @@ ul.ulmenu {
|
||||
color: #<?php echo $colorshadowtitle; ?> !important;
|
||||
text-shadow: none !important;
|
||||
}
|
||||
.ui-controlgroup-horizontal .ui-btn.ui-first-child {
|
||||
/*
|
||||
.ui-btn-up-c {
|
||||
background: transparent;
|
||||
}
|
||||
*/
|
||||
div.tabsElem a.tab {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/*.ui-controlgroup-horizontal .ui-btn.ui-first-child {
|
||||
-webkit-border-top-left-radius: 6px;
|
||||
border-top-left-radius: 6px;
|
||||
}
|
||||
.ui-controlgroup-horizontal .ui-btn.ui-last-child {
|
||||
-webkit-border-top-right-radius: 6px;
|
||||
border-top-right-radius: 6px;
|
||||
}
|
||||
}*/
|
||||
|
||||
.alilevel1 {
|
||||
color: rgb(<?php echo $colortexttitle; ?>) !important;
|
||||
text-shadow: 1px 0px 1px #<?php echo $colorshadowtitle; ?>;
|
||||
color: rgb(<?php print $colortexttitlenotab; ?>) !important;
|
||||
}
|
||||
.lilevel1 {
|
||||
background-image: -webkit-gradient(linear,left top,left bottom,from( #f4f4f4 ),to( #d1d1d1 )) !important;
|
||||
background-image: -webkit-linear-gradient( #f4f4f4,#d1d1d1 ) !important;
|
||||
background-image: -moz-linear-gradient( #f4f4f4,#d1d1d1 ) !important;
|
||||
background-image: -ms-linear-gradient( #f4f4f4,#d1d1d1 ) !important;
|
||||
background-image: -o-linear-gradient( #f4f4f4,#d1d1d1 ) !important;
|
||||
background-image: linear-gradient( #f4f4f4,#d1d1d1 ) !important;
|
||||
border-top: 2px solid #444;
|
||||
background: #fff ! important;
|
||||
}
|
||||
.lilevel1 div div a {
|
||||
font-weight: bold !important;
|
||||
}
|
||||
.lilevel2
|
||||
{
|
||||
padding-left: 22px;
|
||||
background: #fff ! important;
|
||||
}
|
||||
.lilevel3
|
||||
{
|
||||
padding-left: 54px;
|
||||
background: #fff ! important;
|
||||
}
|
||||
|
||||
|
||||
@ -4342,7 +4395,9 @@ img.demothumb {
|
||||
|
||||
|
||||
|
||||
/***** CSS style used for small screen *****/
|
||||
/* ============================================================================== */
|
||||
/* CSS style used for small screen */
|
||||
/* ============================================================================== */
|
||||
|
||||
.imgopensurveywizard
|
||||
{
|
||||
@ -4357,6 +4412,13 @@ img.demothumb {
|
||||
width: <?php print dol_size(350,'width'); ?>px;
|
||||
}
|
||||
|
||||
img.demothumb {
|
||||
box-shadow: 1px 1px 4px #BBB;
|
||||
margin-right: 6px;
|
||||
margin-left: 4px;
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
div.tabBar {
|
||||
padding-left: 0px;
|
||||
padding-right: 0px;
|
||||
@ -4445,6 +4507,25 @@ img.demothumb {
|
||||
position: absolute;
|
||||
width: <?php print dol_size(300,'width'); ?>px;
|
||||
}
|
||||
select {
|
||||
width: 100%;
|
||||
max-width: 100px;
|
||||
min-width: 0 !important;
|
||||
}
|
||||
div.divphotoref {
|
||||
padding-right: 5px;
|
||||
}
|
||||
img.photoref, div.photoref {
|
||||
border: none;
|
||||
-moz-box-shadow: none;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
padding: 4px;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -60,10 +60,10 @@ class Users extends DolibarrApi
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
* @param string $user_ids User ids filter field. Example: '1' or '1,2,3' {@pattern /^[0-9,]*$/i}
|
||||
*
|
||||
* @return array Array of User objects
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @return array Array of User objects
|
||||
*/
|
||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 0, $page = 0, $user_ids = 0) {
|
||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 0, $page = 0, $user_ids = 0, $sqlfilters = '') {
|
||||
global $db, $conf;
|
||||
|
||||
$obj_ret = array();
|
||||
@ -79,14 +79,17 @@ class Users extends DolibarrApi
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as t";
|
||||
$sql.= ' WHERE t.entity IN ('.getEntity('user', 1).')';
|
||||
if ($user_ids) $sql.=" AND t.rowid IN (".$user_ids.")";
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
// Add sql filters
|
||||
if ($sqlfilters)
|
||||
{
|
||||
if (! DolibarrApi::_checkFilters($sqlfilters))
|
||||
{
|
||||
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
|
||||
}
|
||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
if ($limit) {
|
||||
if ($page < 0)
|
||||
|
||||
@ -76,7 +76,6 @@ $object->info($id); // This overwrite ->ref with login instead of id
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user