Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into
develop_dict Conflicts: htdocs/core/lib/functions.lib.php
This commit is contained in:
commit
3445c9d329
@ -224,13 +224,13 @@ source_file = htdocs/langs/en_US/members.lang
|
||||
source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
[dolibarr.members]
|
||||
[dolibarr.modulebuilder]
|
||||
file_filter = htdocs/langs/<lang>/modulebuilder.lang
|
||||
source_file = htdocs/langs/en_US/modulebuilder.lang
|
||||
source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
[dolibarr.members]
|
||||
[dolibarr.multicurrency]
|
||||
file_filter = htdocs/langs/<lang>/multicurrency.lang
|
||||
source_file = htdocs/langs/en_US/multicurrency.lang
|
||||
source_lang = en_US
|
||||
|
||||
@ -6,8 +6,8 @@ English Dolibarr ChangeLog
|
||||
|
||||
For developers:
|
||||
NEW: Add a lot of API REST: dictionaryevents, memberstypes, ...
|
||||
NEW: Big refactorization of multicompany transverse mode
|
||||
NEW: getEntity function use true $shared value by default
|
||||
NEW: Big refactorization of multicompany transverse mode.
|
||||
NEW: getEntity function use true $shared value by default.
|
||||
|
||||
WARNING:
|
||||
|
||||
@ -17,7 +17,9 @@ Following changes may create regression for some external modules, but were nece
|
||||
* The page societe/soc.php was renamed into societe/card.php to match page naming conventions.
|
||||
* The page compta/facture.php was renamed into compta/facture/card.php to match page naming conventions.
|
||||
* The signature of method ->delete() of class Product and PriceExpression was changed from
|
||||
->delete($id, notrigger) to ->delete(User, notrigger) to match standard dev rules.
|
||||
->delete(id, notrigger) to ->delete(User, notrigger) to match standard dev rules.
|
||||
* The signature of method ->delete() of class Adherent was changed from
|
||||
->delete(id) to ->delete(id, User, notrigger) to match standard dev rules.
|
||||
* Removed CommonObject::displayMarginInfos (was deprecated in 3.8). Use same method into
|
||||
html.formmargin.class.php
|
||||
* Removed Societe::set_commnucation_level (was deprecated in 4.0). Was not used.
|
||||
|
||||
@ -43,7 +43,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||
$includecustom=0;
|
||||
$includeconstants=array();
|
||||
|
||||
if (empty($argv[1]))
|
||||
if (empty($argv[1]))
|
||||
{
|
||||
print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
|
||||
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
|
||||
@ -56,7 +56,7 @@ while ($i < $argc)
|
||||
if (preg_match('/includeconstant=/',$argv[$i]))
|
||||
{
|
||||
$tmp=explode(':', $includeconstant, 3);
|
||||
if (count($tmp) != 3)
|
||||
if (count($tmp) != 3)
|
||||
{
|
||||
print "Error: Bad parameter includeconstant ".$includeconstant."\n";
|
||||
exit -1;
|
||||
@ -85,9 +85,9 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
print "Release : ".$release."\n";
|
||||
print "Include custom : ".$includecustom."\n";
|
||||
print "Include constants: ";
|
||||
print "Release : ".$release."\n";
|
||||
print "Include custom in signature : ".$includecustom."\n";
|
||||
print "Include constants in signature : ";
|
||||
foreach ($includeconstants as $countrycode => $tmp)
|
||||
{
|
||||
foreach($tmp as $constname => $constvalue)
|
||||
|
||||
@ -591,7 +591,7 @@ if ($nboftargetok) {
|
||||
|
||||
print "Remove subdir of custom dir\n";
|
||||
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";
|
||||
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to keep dir
|
||||
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs but not files
|
||||
}
|
||||
|
||||
# Build package for each target
|
||||
@ -972,13 +972,12 @@ if ($nboftargetok) {
|
||||
$ret=`$cmd`;
|
||||
$ret=`chmod 755 $BUILDROOT/$PROJECT.tmp/debian/rules`;
|
||||
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/translation/autotranslator.class.php`;
|
||||
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/modMyModule.class.php`;
|
||||
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_api_class.class.php`;
|
||||
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_card.php`;
|
||||
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_class.class.php`;
|
||||
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_list.php`;
|
||||
$ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_script.php`;
|
||||
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_webservice_server.php`;
|
||||
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/myobject.class.php`;
|
||||
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/myobject_api_class.class.php`;
|
||||
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/core/modules/modMyModule.class.php`;
|
||||
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/myobject_card.php`;
|
||||
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/myobject_list.php`;
|
||||
$ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/scripts/myobject.php`;
|
||||
$cmd="find $BUILDROOT/$PROJECT.tmp/scripts -name '*.php' -type f -exec chmod 755 {} \\; ";
|
||||
$ret=`$cmd`;
|
||||
$cmd="find $BUILDROOT/$PROJECT.tmp/scripts -name '*.sh' -type f -exec chmod 755 {} \\; ";
|
||||
|
||||
@ -194,6 +194,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/loan
|
||||
%_datadir/dolibarr/htdocs/mailmanspip
|
||||
%_datadir/dolibarr/htdocs/margin
|
||||
%_datadir/dolibarr/htdocs/modulebuilder
|
||||
%_datadir/dolibarr/htdocs/multicurrency
|
||||
%_datadir/dolibarr/htdocs/opensurvey
|
||||
%_datadir/dolibarr/htdocs/paybox
|
||||
@ -209,6 +210,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/support
|
||||
%_datadir/dolibarr/htdocs/theme
|
||||
%_datadir/dolibarr/htdocs/user
|
||||
%_datadir/dolibarr/htdocs/variants
|
||||
%_datadir/dolibarr/htdocs/webservices
|
||||
%_datadir/dolibarr/htdocs/websites
|
||||
%_datadir/dolibarr/htdocs/*.ico
|
||||
|
||||
@ -274,6 +274,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/loan
|
||||
%_datadir/dolibarr/htdocs/mailmanspip
|
||||
%_datadir/dolibarr/htdocs/margin
|
||||
%_datadir/dolibarr/htdocs/modulebuilder
|
||||
%_datadir/dolibarr/htdocs/multicurrency
|
||||
%_datadir/dolibarr/htdocs/opensurvey
|
||||
%_datadir/dolibarr/htdocs/paybox
|
||||
@ -289,6 +290,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/support
|
||||
%_datadir/dolibarr/htdocs/theme
|
||||
%_datadir/dolibarr/htdocs/user
|
||||
%_datadir/dolibarr/htdocs/variants
|
||||
%_datadir/dolibarr/htdocs/webservices
|
||||
%_datadir/dolibarr/htdocs/websites
|
||||
%_datadir/dolibarr/htdocs/*.ico
|
||||
|
||||
@ -190,6 +190,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/loan
|
||||
%_datadir/dolibarr/htdocs/mailmanspip
|
||||
%_datadir/dolibarr/htdocs/margin
|
||||
%_datadir/dolibarr/htdocs/modulebuilder
|
||||
%_datadir/dolibarr/htdocs/multicurrency
|
||||
%_datadir/dolibarr/htdocs/opensurvey
|
||||
%_datadir/dolibarr/htdocs/paybox
|
||||
@ -205,6 +206,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/support
|
||||
%_datadir/dolibarr/htdocs/theme
|
||||
%_datadir/dolibarr/htdocs/user
|
||||
%_datadir/dolibarr/htdocs/variants
|
||||
%_datadir/dolibarr/htdocs/webservices
|
||||
%_datadir/dolibarr/htdocs/websites
|
||||
%_datadir/dolibarr/htdocs/*.ico
|
||||
|
||||
@ -202,6 +202,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/loan
|
||||
%_datadir/dolibarr/htdocs/mailmanspip
|
||||
%_datadir/dolibarr/htdocs/margin
|
||||
%_datadir/dolibarr/htdocs/modulebuilder
|
||||
%_datadir/dolibarr/htdocs/multicurrency
|
||||
%_datadir/dolibarr/htdocs/opensurvey
|
||||
%_datadir/dolibarr/htdocs/paybox
|
||||
@ -217,6 +218,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/support
|
||||
%_datadir/dolibarr/htdocs/theme
|
||||
%_datadir/dolibarr/htdocs/user
|
||||
%_datadir/dolibarr/htdocs/variants
|
||||
%_datadir/dolibarr/htdocs/webservices
|
||||
%_datadir/dolibarr/htdocs/websites
|
||||
%_datadir/dolibarr/htdocs/*.ico
|
||||
|
||||
@ -80,7 +80,7 @@ if ($user->societe_id > 0) accessforbidden();
|
||||
if (! $user->rights->accounting->chartofaccount) accessforbidden();
|
||||
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('admin'));
|
||||
|
||||
// This page is a generic page to edit dictionaries
|
||||
|
||||
@ -80,7 +80,7 @@ $pagenext = $page + 1;
|
||||
|
||||
$search_country_id = GETPOST('search_country_id','int');
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('admin'));
|
||||
|
||||
// This page is a generic page to edit dictionaries
|
||||
|
||||
@ -66,7 +66,7 @@ if (empty($sortorder)) $sortorder='ASC';
|
||||
|
||||
$error = 0;
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('admin'));
|
||||
|
||||
// This page is a generic page to edit dictionaries
|
||||
|
||||
@ -115,16 +115,11 @@ if ($conf->use_javascript_ajax)
|
||||
{
|
||||
if (jQuery("#MEMBER_ENABLE_PUBLIC").val()==\'0\')
|
||||
{
|
||||
jQuery("#tramount").hide();
|
||||
jQuery("#tredit").hide();
|
||||
jQuery("#trpayment").hide();
|
||||
jQuery("#tremail").hide();
|
||||
jQuery("#trforcetype, #tramount, #tredit, #trpayment, #tremail").hide();
|
||||
}
|
||||
if (jQuery("#MEMBER_ENABLE_PUBLIC").val()==\'1\')
|
||||
{
|
||||
jQuery("#tramount").show();
|
||||
jQuery("#tredit").show();
|
||||
jQuery("#trpayment").show();
|
||||
jQuery("#trforcetype, #tramount, #tredit, #trpayment").show();
|
||||
if (jQuery("#MEMBER_NEWFORM_PAYONLINE").val()==\'-1\') jQuery("#tremail").hide();
|
||||
else jQuery("#tremail").show();
|
||||
}
|
||||
@ -156,9 +151,9 @@ print "</td></tr>\n";
|
||||
|
||||
// Force Type
|
||||
$adht = new AdherentType($db);
|
||||
print '<tr class="oddeven drag"><td>';
|
||||
print '<tr class="oddeven drag" id="trforcetype"><td>';
|
||||
print $langs->trans("ForceMemberType");
|
||||
print '</td><td width="60" align="center">';
|
||||
print '</td><td width="60" align="right">';
|
||||
$listofval = array(-1 => $langs->trans("Undefined"));
|
||||
$listofval += $adht->liste_array();
|
||||
$forcetype = $conf->global->MEMBER_NEWFORM_FORCETYPE ?: -1;
|
||||
|
||||
@ -182,7 +182,7 @@ abstract class ActionsAdherentCardCommon
|
||||
$this->object->old_name = $_POST["old_name"];
|
||||
$this->object->old_firstname = $_POST["old_firstname"];
|
||||
|
||||
$result = $this->object->delete();
|
||||
$result = $this->object->delete(0, $user, 0);
|
||||
if ($result > 0)
|
||||
{
|
||||
header("Location: list.php");
|
||||
@ -424,7 +424,7 @@ abstract class ActionsAdherentCardCommon
|
||||
if ($resql)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
|
||||
$this->object->country_code = $obj->code;
|
||||
$this->object->country = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle;
|
||||
}
|
||||
|
||||
@ -112,7 +112,7 @@ if ($id)
|
||||
$caneditfieldmember=$user->rights->adherent->creer;
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('membercard','globalcard'));
|
||||
|
||||
|
||||
@ -585,7 +585,7 @@ if (empty($reshook))
|
||||
|
||||
if ($user->rights->adherent->supprimer && $action == 'confirm_delete' && $confirm == 'yes')
|
||||
{
|
||||
$result=$object->delete($id);
|
||||
$result=$object->delete($id, $user);
|
||||
if ($result > 0)
|
||||
{
|
||||
if (! empty($backtopage))
|
||||
|
||||
@ -705,11 +705,13 @@ class Adherent extends CommonObject
|
||||
* Fonction qui supprime l'adherent et les donnees associees
|
||||
*
|
||||
* @param int $rowid Id of member to delete
|
||||
* @param User $user User object
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if KO, 0=nothing to do, >0 if OK
|
||||
*/
|
||||
function delete($rowid)
|
||||
function delete($rowid, $user, $notrigger=0)
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
global $conf, $langs;
|
||||
|
||||
$result = 0;
|
||||
$error=0;
|
||||
@ -720,6 +722,14 @@ class Adherent extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
if (! $error && ! $notrigger)
|
||||
{
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('MEMBER_DELETE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
// Remove category
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_member WHERE fk_member = ".$rowid;
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
@ -787,16 +797,6 @@ class Adherent extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('MEMBER_DELETE',$user);
|
||||
if ($result < 0) { $error++; }
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$this->db->commit();
|
||||
@ -1097,7 +1097,7 @@ class Adherent extends CommonObject
|
||||
$sql.= " WHERE d.fk_adherent_type = t.rowid";
|
||||
if ($rowid) $sql.= " AND d.rowid=".$rowid;
|
||||
elseif ($ref || $fk_soc) {
|
||||
$sql.= " AND d.entity IN (".getEntity().")";
|
||||
$sql.= " AND d.entity IN (".getEntity('adherent').")";
|
||||
if ($ref) $sql.= " AND d.rowid='".$this->db->escape($ref)."'";
|
||||
elseif ($fk_soc > 0) $sql.= " AND d.fk_soc=".$fk_soc;
|
||||
}
|
||||
@ -1592,7 +1592,7 @@ class Adherent extends CommonObject
|
||||
global $conf, $langs;
|
||||
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $withpictoimg) $withpictoimg=0;
|
||||
|
||||
|
||||
$result=''; $label='';
|
||||
$link=''; $linkstart=''; $linkend='';
|
||||
|
||||
@ -1602,7 +1602,7 @@ class Adherent extends CommonObject
|
||||
$label.= Form::showphoto('memberphoto', $this, 80, 0, 0, 'photowithmargin photologintooltip', 'small', 0, 1);
|
||||
$label.= '</div><div style="clear: both;"></div>';
|
||||
}
|
||||
|
||||
|
||||
$label.= '<div class="centpercent">';
|
||||
$label.= '<u>' . $langs->trans("Member") . '</u>';
|
||||
if (! empty($this->ref))
|
||||
@ -1610,7 +1610,7 @@ class Adherent extends CommonObject
|
||||
if (! empty($this->firstname) || ! empty($this->lastname))
|
||||
$label.= '<br><b>' . $langs->trans('Name') . ':</b> ' . $this->getFullName($langs);
|
||||
$label.='</div>';
|
||||
|
||||
|
||||
if ($option == 'card' || $option == 'category')
|
||||
{
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/adherents/card.php?rowid='.$this->id.'"';
|
||||
@ -1619,7 +1619,7 @@ class Adherent extends CommonObject
|
||||
{
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/adherents/subscription.php?rowid='.$this->id.'"';
|
||||
}
|
||||
|
||||
|
||||
$linkclose="";
|
||||
if (empty($notooltip))
|
||||
{
|
||||
@ -1632,10 +1632,10 @@ class Adherent extends CommonObject
|
||||
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose.= ' class="classfortooltip'.($morecss?' '.$morecss:'').'"';
|
||||
}
|
||||
|
||||
|
||||
$link.=$linkclose.'>';
|
||||
$linkend='</a>';
|
||||
|
||||
|
||||
//if ($withpictoimg == -1) $result.='<div class="nowrap">';
|
||||
$result.=$link;
|
||||
if ($withpictoimg)
|
||||
@ -1658,7 +1658,7 @@ class Adherent extends CommonObject
|
||||
}
|
||||
$result.=$linkend;
|
||||
//if ($withpictoimg == -1) $result.='</div>';
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@ -1883,7 +1883,7 @@ class Adherent extends CommonObject
|
||||
$modele = $conf->global->ADHERENT_ADDON_PDF;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$modelpath = "core/modules/member/doc/";
|
||||
|
||||
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
|
||||
@ -250,11 +250,7 @@ class Members extends DolibarrApi
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
// The Adherent::delete() method uses the global variable $user.
|
||||
global $user;
|
||||
$user = DolibarrApiAccess::$user;
|
||||
|
||||
if (! $member->delete($member->id)) {
|
||||
if (! $member->delete($member->id, DolibarrApiAccess::$user)) {
|
||||
throw new RestException(401,'error when deleting member');
|
||||
}
|
||||
|
||||
|
||||
@ -64,8 +64,8 @@ $sql.= " d.statut, count(d.rowid) as somme";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."adherent as d";
|
||||
$sql.= " ON t.rowid = d.fk_adherent_type";
|
||||
$sql.= " AND d.entity IN (".getEntity().")";
|
||||
$sql.= " WHERE t.entity IN (".getEntity().")";
|
||||
$sql.= " AND d.entity IN (".getEntity('adherent').")";
|
||||
$sql.= " WHERE t.entity IN (".getEntity('adherent').")";
|
||||
$sql.= " GROUP BY t.rowid, t.libelle, t.subscription, d.statut";
|
||||
|
||||
dol_syslog("index.php::select nb of members by type", LOG_DEBUG);
|
||||
@ -100,7 +100,7 @@ $now=dol_now();
|
||||
// old rule: uptodate = if type does not need payment, that end date is null, if type need payment that end date is in future)
|
||||
$sql = "SELECT count(*) as somme , d.fk_adherent_type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
|
||||
$sql.= " WHERE d.entity IN (".getEntity().")";
|
||||
$sql.= " WHERE d.entity IN (".getEntity('adherent').")";
|
||||
//$sql.= " AND d.statut = 1 AND ((t.subscription = 0 AND d.datefin IS NULL) OR d.datefin >= '".$db->idate($now)."')";
|
||||
$sql.= " AND d.statut = 1 AND d.datefin >= '".$db->idate($now)."'";
|
||||
$sql.= " AND t.rowid = d.fk_adherent_type";
|
||||
@ -133,7 +133,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
|
||||
{
|
||||
$listofsearchfields['search_member']=array('text'=>'Member');
|
||||
}
|
||||
|
||||
|
||||
if (count($listofsearchfields))
|
||||
{
|
||||
print '<form method="post" action="'.DOL_URL_ROOT.'/core/search.php">';
|
||||
@ -149,7 +149,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
print '</table>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
}
|
||||
@ -211,7 +211,7 @@ $numb=0;
|
||||
|
||||
$sql = "SELECT c.subscription, c.dateadh as dateh";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."subscription as c";
|
||||
$sql.= " WHERE d.entity IN (".getEntity().")";
|
||||
$sql.= " WHERE d.entity IN (".getEntity('adherent').")";
|
||||
$sql.= " AND d.rowid = c.fk_adherent";
|
||||
if(isset($date_select) && $date_select != '')
|
||||
{
|
||||
@ -275,7 +275,7 @@ $sql = "SELECT a.rowid, a.statut, a.lastname, a.firstname, a.societe as company,
|
||||
$sql.= " a.tms as datem, datefin as date_end_subscription,";
|
||||
$sql.= " ta.rowid as typeid, ta.libelle, ta.subscription";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta";
|
||||
$sql.= " WHERE a.entity IN (".getEntity().")";
|
||||
$sql.= " WHERE a.entity IN (".getEntity('adherent').")";
|
||||
$sql.= " AND a.fk_adherent_type = ta.rowid";
|
||||
$sql.= $db->order("a.tms","DESC");
|
||||
$sql.= $db->plimit($max, 0);
|
||||
@ -336,7 +336,7 @@ $sql = "SELECT a.rowid, a.statut, a.lastname, a.firstname, a.societe as company,
|
||||
$sql.= " datefin as date_end_subscription,";
|
||||
$sql.= " c.rowid as cid, c.tms as datem, c.datec as datec, c.dateadh as date_start, c.datef as date_end, c.subscription";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."subscription as c";
|
||||
$sql.= " WHERE a.entity IN (".getEntity().")";
|
||||
$sql.= " WHERE a.entity IN (".getEntity('adherent').")";
|
||||
$sql.= " AND c.fk_adherent = a.rowid";
|
||||
$sql.= $db->order("c.tms","DESC");
|
||||
$sql.= $db->plimit($max, 0);
|
||||
|
||||
@ -31,13 +31,17 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
|
||||
$langs->load("members");
|
||||
$langs->load("companies");
|
||||
$langs->loadLangs(array("members","companies"));
|
||||
|
||||
$action=GETPOST('action','aZ09');
|
||||
$massaction=GETPOST('massaction','alpha');
|
||||
$show_files=GETPOST('show_files','int');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
|
||||
// Security check
|
||||
$result=restrictedArea($user,'adherent');
|
||||
|
||||
$action=GETPOST('action','aZ09');
|
||||
$filter=GETPOST("filter");
|
||||
$statut=GETPOST("statut");
|
||||
$search=GETPOST("search");
|
||||
@ -53,7 +57,7 @@ $search_country=GETPOST("search_country");
|
||||
$search_phone=GETPOST("search_phone");
|
||||
$search_phone_perso=GETPOST("search_phone_perso");
|
||||
$search_phone_mobile=GETPOST("search_phone_mobile");
|
||||
$type=GETPOST("type");
|
||||
$search_type=GETPOST("search_type");
|
||||
$search_email=GETPOST("search_email");
|
||||
$search_categ = GETPOST("search_categ",'int');
|
||||
$catid = GETPOST("catid",'int');
|
||||
@ -73,7 +77,7 @@ $pagenext = $page + 1;
|
||||
if (! $sortorder) { $sortorder=($filter=='outofdate'?"DESC":"ASC"); }
|
||||
if (! $sortfield) { $sortfield=($filter=='outofdate'?"d.datefin":"d.lastname"); }
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('memberlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
@ -155,7 +159,7 @@ if (empty($reshook))
|
||||
$search_firstname="";
|
||||
$search_login="";
|
||||
$search_company="";
|
||||
$type="";
|
||||
$search_type="";
|
||||
$search_email="";
|
||||
$search_address="";
|
||||
$search_zip="";
|
||||
@ -173,6 +177,14 @@ if (empty($reshook))
|
||||
$toselect='';
|
||||
$search_array_options=array();
|
||||
}
|
||||
|
||||
// Mass actions
|
||||
$objectclass='Adherent';
|
||||
$objectlabel='Members';
|
||||
$permtoread = $user->rights->adherent->lire;
|
||||
$permtodelete = $user->rights->adherent->supprimer;
|
||||
$uploaddir = $conf->adherent->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
}
|
||||
|
||||
|
||||
@ -193,8 +205,8 @@ $sql.= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.skype, d.birth, d.pu
|
||||
$sql.= " d.fk_adherent_type as type_id, d.morphy, d.statut, d.datec as date_creation, d.tms as date_update,";
|
||||
$sql.= " t.libelle as type, t.subscription,";
|
||||
$sql.= " state.code_departement as state_code, state.nom as state_name";
|
||||
// Add fields for extrafields
|
||||
foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
|
||||
// Add fields from extrafields
|
||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
||||
// Add fields from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||
@ -212,7 +224,7 @@ if ($search_categ > 0) $sql.= " AND cm.fk_categorie = ".$db->escape($search_ca
|
||||
if ($search_categ == -2) $sql.= " AND cm.fk_categorie IS NULL";
|
||||
$sql.= " AND d.entity IN (".getEntity('adherent').")";
|
||||
if ($sall) $sql.=natural_search(array_keys($fieldstosearchall), $sall);
|
||||
if ($type > 0) $sql.=" AND t.rowid=".$db->escape($type);
|
||||
if ($search_type > 0) $sql.=" AND t.rowid=".$db->escape($search_type);
|
||||
if ($statut != '') $sql.=" AND d.statut in (".$db->escape($statut).")"; // Peut valoir un nombre ou liste de nombre separes par virgules
|
||||
if ($search_ref)
|
||||
{
|
||||
@ -298,10 +310,10 @@ elseif ($action == 'search')
|
||||
$titre=$langs->trans("MembersListQualified");
|
||||
}
|
||||
|
||||
if ($type > 0)
|
||||
if ($search_type > 0)
|
||||
{
|
||||
$membertype=new AdherentType($db);
|
||||
$result=$membertype->fetch(GETPOST("type"));
|
||||
$result=$membertype->fetch(GETPOST("type",'int'));
|
||||
$titre.=" (".$membertype->libelle.")";
|
||||
}
|
||||
|
||||
@ -326,7 +338,7 @@ if ($search_phone != '') $param.= "&search_phone=".urlencode($search_phone);
|
||||
if ($search_phone_perso != '') $param.= "&search_phone_perso=".urlencode($search_phone_perso);
|
||||
if ($search_phone_mobile != '') $param.= "&search_phone_mobile=".urlencode($search_phone_mobile);
|
||||
if ($filter) $param.="&filter=".urlencode($filter);
|
||||
if ($type > 0) $param.="&type=".urlencode($type);
|
||||
if ($search_type > 0) $param.="&search_type=".urlencode($search_type);
|
||||
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
|
||||
// Add $param from extra fields
|
||||
foreach ($search_array_options as $key => $val)
|
||||
@ -346,7 +358,7 @@ if ($user->rights->adherent->supprimer) $arrayofmassactions['delete']=$langs->tr
|
||||
//if ($massaction == 'presend' || $massaction == 'createbills') $arrayofmassactions=array();
|
||||
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
@ -403,32 +415,32 @@ if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
|
||||
}
|
||||
|
||||
// Ref
|
||||
if (! empty($arrayfields['d.ref']['checked']))
|
||||
if (! empty($arrayfields['d.ref']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
if (! empty($arrayfields['d.firstname']['checked']))
|
||||
if (! empty($arrayfields['d.firstname']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).'"></td>';
|
||||
}
|
||||
|
||||
if (! empty($arrayfields['d.lastname']['checked']))
|
||||
if (! empty($arrayfields['d.lastname']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).'"></td>';
|
||||
}
|
||||
|
||||
if (! empty($arrayfields['d.company']['checked']))
|
||||
if (! empty($arrayfields['d.company']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_company" value="'.dol_escape_htmltag($search_company).'"></td>';
|
||||
}
|
||||
|
||||
if (! empty($arrayfields['d.login']['checked']))
|
||||
if (! empty($arrayfields['d.login']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'"></td>';
|
||||
@ -440,26 +452,26 @@ if (! empty($arrayfields['d.morphy']['checked']))
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
if (! empty($arrayfields['t.libelle']['checked']))
|
||||
if (! empty($arrayfields['t.libelle']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
$listetype=$membertypestatic->liste_array();
|
||||
print $form->selectarray("type", $listetype, $type, 1, 0, 0, '', 0, 32);
|
||||
print $form->selectarray("search_type", $listetype, $type, 1, 0, 0, '', 0, 32);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
if (! empty($arrayfields['d.address']['checked']))
|
||||
if (! empty($arrayfields['d.address']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_address" value="'.$search_address.'"></td>';
|
||||
}
|
||||
|
||||
if (! empty($arrayfields['d.zip']['checked']))
|
||||
if (! empty($arrayfields['d.zip']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_zip" value="'.$search_zip.'"></td>';
|
||||
}
|
||||
if (! empty($arrayfields['d.town']['checked']))
|
||||
if (! empty($arrayfields['d.town']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_town" value="'.$search_town.'"></td>';
|
||||
@ -479,31 +491,31 @@ if (! empty($arrayfields['country.code_iso']['checked']))
|
||||
print '</td>';
|
||||
}
|
||||
// Phone pro
|
||||
if (! empty($arrayfields['d.phone']['checked']))
|
||||
if (! empty($arrayfields['d.phone']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_phone" value="'.$search_phone.'"></td>';
|
||||
}
|
||||
// Phone perso
|
||||
if (! empty($arrayfields['d.phone_perso']['checked']))
|
||||
if (! empty($arrayfields['d.phone_perso']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_phone_perso" value="'.$search_phone_perso.'"></td>';
|
||||
}
|
||||
// Phone mobile
|
||||
if (! empty($arrayfields['d.phone_mobile']['checked']))
|
||||
if (! empty($arrayfields['d.phone_mobile']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_phone_mobile" value="'.$search_phone_mobile.'"></td>';
|
||||
}
|
||||
// Email
|
||||
if (! empty($arrayfields['d.email']['checked']))
|
||||
if (! empty($arrayfields['d.email']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_email" value="'.$search_email.'"></td>';
|
||||
}
|
||||
|
||||
if (! empty($arrayfields['d.datefin']['checked']))
|
||||
if (! empty($arrayfields['d.datefin']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '</td>';
|
||||
@ -626,7 +638,7 @@ while ($i < min($num, $limit))
|
||||
$memberstatic->datefin= $datefin;
|
||||
$memberstatic->socid = $obj->fk_soc;
|
||||
$memberstatic->photo = $obj->photo;
|
||||
|
||||
|
||||
if (! empty($obj->fk_soc)) {
|
||||
$memberstatic->fetch_thirdparty();
|
||||
$companyname=$memberstatic->thirdparty->name;
|
||||
@ -635,52 +647,52 @@ while ($i < min($num, $limit))
|
||||
}
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
|
||||
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
|
||||
{
|
||||
print '<td align="center">'.($i+1).'</td>';
|
||||
}
|
||||
|
||||
// Ref
|
||||
if (! empty($arrayfields['d.ref']['checked']))
|
||||
if (! empty($arrayfields['d.ref']['checked']))
|
||||
{
|
||||
print "<td>";
|
||||
print $memberstatic->getNomUrl(-1, 0, 'card', 'ref');
|
||||
print "</td>\n";
|
||||
}
|
||||
}
|
||||
// Firstname
|
||||
if (! empty($arrayfields['d.firstname']['checked']))
|
||||
if (! empty($arrayfields['d.firstname']['checked']))
|
||||
{
|
||||
print "<td>";
|
||||
print $obj->firstname;
|
||||
print "</td>\n";
|
||||
}
|
||||
// Lastname
|
||||
if (! empty($arrayfields['d.lastname']['checked']))
|
||||
if (! empty($arrayfields['d.lastname']['checked']))
|
||||
{
|
||||
print "<td>";
|
||||
print $obj->lastname;
|
||||
print "</td>\n";
|
||||
}
|
||||
// Company
|
||||
if (! empty($arrayfields['d.company']['checked']))
|
||||
if (! empty($arrayfields['d.company']['checked']))
|
||||
{
|
||||
print "<td>";
|
||||
print $companyname;
|
||||
print "</td>\n";
|
||||
}
|
||||
// Login
|
||||
if (! empty($arrayfields['d.login']['checked']))
|
||||
if (! empty($arrayfields['d.login']['checked']))
|
||||
{
|
||||
print "<td>".$obj->login."</td>\n";
|
||||
}
|
||||
// Moral/Physique
|
||||
if (! empty($arrayfields['d.morphy']['checked']))
|
||||
if (! empty($arrayfields['d.morphy']['checked']))
|
||||
{
|
||||
print "<td>".$memberstatic->getmorphylib($obj->morphy)."</td>\n";
|
||||
}
|
||||
// Type label
|
||||
if (! empty($arrayfields['t.libelle']['checked']))
|
||||
if (! empty($arrayfields['t.libelle']['checked']))
|
||||
{
|
||||
$membertypestatic->id=$obj->type_id;
|
||||
$membertypestatic->libelle=$obj->type;
|
||||
@ -727,7 +739,7 @@ while ($i < min($num, $limit))
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Phone pro
|
||||
if (! empty($arrayfields['d.phone']['checked']))
|
||||
if (! empty($arrayfields['d.phone']['checked']))
|
||||
{
|
||||
print '<td class="nocellnopadd">';
|
||||
print $obj->phone;
|
||||
@ -735,7 +747,7 @@ while ($i < min($num, $limit))
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Phone perso
|
||||
if (! empty($arrayfields['d.phone_perso']['checked']))
|
||||
if (! empty($arrayfields['d.phone_perso']['checked']))
|
||||
{
|
||||
print '<td class="nocellnopadd">';
|
||||
print $obj->phone_perso;
|
||||
@ -743,7 +755,7 @@ while ($i < min($num, $limit))
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Phone mobile
|
||||
if (! empty($arrayfields['d.phone_mobile']['checked']))
|
||||
if (! empty($arrayfields['d.phone_mobile']['checked']))
|
||||
{
|
||||
print '<td class="nocellnopadd">';
|
||||
print $obj->phone_mobile;
|
||||
@ -756,7 +768,7 @@ while ($i < min($num, $limit))
|
||||
print "<td>".dol_print_email($obj->email,0,0,1)."</td>\n";
|
||||
}
|
||||
// End of subscription date
|
||||
$datefin=$db->jdate($obj->datefin);
|
||||
$datefin=$db->jdate($obj->datefin);
|
||||
if (! empty($arrayfields['d.datefin']['checked']))
|
||||
{
|
||||
if ($datefin)
|
||||
@ -832,22 +844,15 @@ while ($i < min($num, $limit))
|
||||
}
|
||||
// Action column
|
||||
print '<td align="center">';
|
||||
if ($user->rights->adherent->creer)
|
||||
{
|
||||
print "<a href=\"card.php?rowid=".$obj->rowid."&action=edit&backtopage=1\">".img_edit()."</a>";
|
||||
}
|
||||
print ' ';
|
||||
if ($user->rights->adherent->supprimer && $obj->statut == -1)
|
||||
{
|
||||
print "<a href=\"card.php?rowid=".$obj->rowid."&action=delete&backtopage=1\">".img_picto($langs->trans("Delete"),'disable.png')."</a>";
|
||||
}
|
||||
if ($user->rights->adherent->supprimer && $obj->statut == 1)
|
||||
{
|
||||
print "<a href=\"card.php?rowid=".$obj->rowid."&action=resign&backtopage=1\">".img_picto($langs->trans("Resiliate"),'disable.png')."</a>";
|
||||
}
|
||||
print "</td>";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
{
|
||||
$selected=0;
|
||||
if (in_array($obj->rowid, $arrayofselected)) $selected=1;
|
||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected?' checked="checked"':'').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ $tab='byproperties';
|
||||
$data = array();
|
||||
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, d.morphy as code";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d";
|
||||
$sql.=" WHERE d.entity IN (".getEntity().")";
|
||||
$sql.=" WHERE d.entity IN (".getEntity('adherent').")";
|
||||
$sql.=" AND d.statut = 1";
|
||||
$sql.=" GROUP BY d.morphy";
|
||||
|
||||
|
||||
@ -79,7 +79,7 @@ if ($mode)
|
||||
$data = array();
|
||||
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, c.code, c.label";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid";
|
||||
$sql.=" WHERE d.entity IN (".getEntity().")";
|
||||
$sql.=" WHERE d.entity IN (".getEntity('adherent').")";
|
||||
$sql.=" AND d.statut = 1";
|
||||
$sql.=" GROUP BY c.label, c.code";
|
||||
//print $sql;
|
||||
@ -96,7 +96,7 @@ if ($mode)
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r on c.fk_region = r.code_region";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_country as co on d.country = co.rowid";
|
||||
$sql.=" WHERE d.entity IN (".getEntity().")";
|
||||
$sql.=" WHERE d.entity IN (".getEntity('adherent').")";
|
||||
$sql.=" AND d.statut = 1";
|
||||
$sql.=" GROUP BY co.label, co.code, c.nom";
|
||||
//print $sql;
|
||||
@ -112,7 +112,7 @@ if ($mode)
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r on c.fk_region = r.code_region";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_country as co on d.country = co.rowid";
|
||||
$sql.=" WHERE d.entity IN (".getEntity().")";
|
||||
$sql.=" WHERE d.entity IN (".getEntity('adherent').")";
|
||||
$sql.=" AND d.statut = 1";
|
||||
$sql.=" GROUP BY co.label, co.code, r.nom"; //+
|
||||
//print $sql;
|
||||
@ -127,7 +127,7 @@ if ($mode)
|
||||
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, c.code, c.label, d.town as label2";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid";
|
||||
$sql.=" WHERE d.entity IN (".getEntity().")";
|
||||
$sql.=" WHERE d.entity IN (".getEntity('adherent').")";
|
||||
$sql.=" AND d.statut = 1";
|
||||
$sql.=" GROUP BY c.label, c.code, d.town";
|
||||
//print $sql;
|
||||
|
||||
@ -89,7 +89,7 @@ if ($rowid)
|
||||
$caneditfieldmember=$user->rights->adherent->creer;
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('subscription'));
|
||||
|
||||
// PDF
|
||||
|
||||
@ -53,7 +53,7 @@ $pagenext = $page + 1;
|
||||
if (! $sortorder) { $sortorder="DESC"; }
|
||||
if (! $sortfield) { $sortfield="c.dateadh"; }
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('subscriptionlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
|
||||
@ -79,7 +79,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter_x") || GETP
|
||||
}
|
||||
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('membertypecard','globalcard'));
|
||||
|
||||
|
||||
@ -173,7 +173,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
||||
|
||||
$sql = "SELECT d.rowid, d.libelle as label, d.subscription, d.vote";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
|
||||
$sql.= " WHERE d.entity IN (".getEntity().")";
|
||||
$sql.= " WHERE d.entity IN (".getEntity('adherent').")";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
@ -380,7 +380,7 @@ if ($rowid > 0)
|
||||
$sql.= " t.libelle as type, t.subscription";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
|
||||
$sql.= " WHERE d.fk_adherent_type = t.rowid ";
|
||||
$sql.= " AND d.entity IN (".getEntity().")";
|
||||
$sql.= " AND d.entity IN (".getEntity('adherent').")";
|
||||
$sql.= " AND t.rowid = ".$object->id;
|
||||
if ($sall)
|
||||
{
|
||||
|
||||
@ -182,29 +182,29 @@ $formadmin = new FormAdmin($db);
|
||||
$wikihelp='EN:Setup|FR:Paramétrage|ES:Configuración';
|
||||
llxHeader('',$langs->trans("Setup"),$wikihelp);
|
||||
|
||||
print load_fiche_titre($langs->trans("DefaultValues"),'','title_setup');
|
||||
$param='&mode='.$mode;
|
||||
|
||||
print $langs->trans("DefaultValuesDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
print $langs->trans("EnableDefaultValues").' ';
|
||||
$enabledisablehtml.= $langs->trans("EnableDefaultValues").' ';
|
||||
if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES))
|
||||
{
|
||||
// Button off, click to enable
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setMAIN_ENABLE_DEFAULT_VALUES&value=1">';
|
||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||
print '</a>';
|
||||
$enabledisablehtml.= '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setMAIN_ENABLE_DEFAULT_VALUES&value=1'.$param.'">';
|
||||
$enabledisablehtml.= img_picto($langs->trans("Disabled"),'switch_off');
|
||||
$enabledisablehtml.= '</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
// Button on, click to disable
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setMAIN_ENABLE_DEFAULT_VALUES&value=0">';
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
print '</a>';
|
||||
$enabledisablehtml.= '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setMAIN_ENABLE_DEFAULT_VALUES&value=0'.$param.'">';
|
||||
$enabledisablehtml.= img_picto($langs->trans("Activated"),'switch_on');
|
||||
$enabledisablehtml.= '</a>';
|
||||
}
|
||||
print "<br><br>\n";
|
||||
|
||||
$param='&mode='.$mode;
|
||||
print load_fiche_titre($langs->trans("DefaultValues"), $enabledisablehtml, 'title_setup');
|
||||
|
||||
print $langs->trans("DefaultValuesDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||
|
||||
@ -81,7 +81,7 @@ $pagenext = $page + 1;
|
||||
$search_country_id = GETPOST('search_country_id','int');
|
||||
$search_code = GETPOST('search_code','alpha');
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('admin'));
|
||||
|
||||
// This page is a generic page to edit dictionaries
|
||||
|
||||
@ -29,7 +29,7 @@ $langs->load("companies");
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('homesetup'));
|
||||
|
||||
|
||||
|
||||
@ -100,7 +100,7 @@ $form=new Form($db);
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
dol_fiche_head($head, 'ldap', $langs->trans("LDAPSetup"));
|
||||
dol_fiche_head($head, 'ldap', $langs->trans("LDAPSetup"), -1);
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
@ -127,7 +127,7 @@ print '</td></tr>';
|
||||
// Synchro contact active
|
||||
if (! empty($conf->societe->enabled))
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPDnContactActive").'</td><td>';
|
||||
$arraylist=array();
|
||||
$arraylist['0']=$langs->trans("No");
|
||||
@ -139,7 +139,7 @@ if (! empty($conf->societe->enabled))
|
||||
// Synchro member active
|
||||
if (! empty($conf->adherent->enabled))
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPDnMemberActive").'</td><td>';
|
||||
$arraylist=array();
|
||||
$arraylist['0']=$langs->trans("No");
|
||||
|
||||
@ -39,7 +39,7 @@ if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
$action = GETPOST('action','aZ09');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@ -49,7 +49,7 @@ if ($action == 'setvalue' && $user->admin)
|
||||
$error=0;
|
||||
|
||||
$db->begin();
|
||||
|
||||
|
||||
if (! dolibarr_set_const($db, 'LDAP_CONTACT_DN',GETPOST("contactdn"),'chaine',0,'',$conf->entity)) $error++;
|
||||
if (! dolibarr_set_const($db, 'LDAP_CONTACT_OBJECT_CLASS',GETPOST("objectclass"),'chaine',0,'',$conf->entity)) $error++;
|
||||
|
||||
@ -73,7 +73,7 @@ if ($action == 'setvalue' && $user->admin)
|
||||
$key=GETPOST("key");
|
||||
if ($key) $valkey=$conf->global->$key;
|
||||
if (! dolibarr_set_const($db, 'LDAP_KEY_CONTACTS',$valkey,'chaine',0,'',$conf->entity)) $error++;
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
@ -107,7 +107,7 @@ if (! function_exists("ldap_connect"))
|
||||
setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors');
|
||||
}
|
||||
|
||||
dol_fiche_head($head, 'contacts', $langs->trans("LDAPSetup"));
|
||||
dol_fiche_head($head, 'contacts', $langs->trans("LDAPSetup"), -1);
|
||||
|
||||
|
||||
print $langs->trans("LDAPDescContact").'<br>';
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2005 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
@ -38,7 +38,7 @@ $langs->load("errors");
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
|
||||
$action = GETPOST('action','aZ09');
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ if ($action == 'setvalue' && $user->admin)
|
||||
{
|
||||
$error=0;
|
||||
$db->begin();
|
||||
|
||||
|
||||
if (! dolibarr_set_const($db, 'LDAP_GROUP_DN',GETPOST("group"),'chaine',0,'',$conf->entity)) $error++;
|
||||
if (! dolibarr_set_const($db, 'LDAP_GROUP_OBJECT_CLASS',GETPOST("objectclass"),'chaine',0,'',$conf->entity)) $error++;
|
||||
|
||||
@ -64,7 +64,7 @@ if ($action == 'setvalue' && $user->admin)
|
||||
$key=GETPOST("key");
|
||||
if ($key) $valkey=$conf->global->$key;
|
||||
if (! dolibarr_set_const($db, 'LDAP_KEY_GROUPS',$valkey,'chaine',0,'',$conf->entity)) $error++;
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
@ -96,7 +96,7 @@ if (! function_exists("ldap_connect"))
|
||||
setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors');
|
||||
}
|
||||
|
||||
dol_fiche_head($head, 'groups', $langs->trans("LDAPSetup"));
|
||||
dol_fiche_head($head, 'groups', $langs->trans("LDAPSetup"), -1);
|
||||
|
||||
|
||||
print $langs->trans("LDAPDescGroups").'<br>';
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2005 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
@ -50,7 +50,7 @@ if ($action == 'setvalue' && $user->admin)
|
||||
$error=0;
|
||||
|
||||
$db->begin();
|
||||
|
||||
|
||||
if (! dolibarr_set_const($db, 'LDAP_MEMBER_DN',GETPOST("user"),'chaine',0,'',$conf->entity)) $error++;
|
||||
if (! dolibarr_set_const($db, 'LDAP_MEMBER_OBJECT_CLASS',GETPOST("objectclass"),'chaine',0,'',$conf->entity)) $error++;
|
||||
if (! dolibarr_set_const($db, 'LDAP_MEMBER_FILTER',GETPOST("filterconnection"),'chaine',0,'',$conf->entity)) $error++;
|
||||
@ -126,7 +126,7 @@ if (! function_exists("ldap_connect"))
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
dol_fiche_head($head, 'members', $langs->trans("LDAPSetup"));
|
||||
dol_fiche_head($head, 'members', $langs->trans("LDAPSetup"), -1);
|
||||
|
||||
|
||||
print $langs->trans("LDAPDescMembers").'<br>';
|
||||
|
||||
@ -113,7 +113,7 @@ print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
|
||||
dol_fiche_head($head, 'users', $langs->trans("LDAPSetup"));
|
||||
dol_fiche_head($head, 'users', $langs->trans("LDAPSetup"), -1);
|
||||
|
||||
print $langs->trans("LDAPDescUsers").'<br>';
|
||||
print '<br>';
|
||||
|
||||
@ -71,7 +71,7 @@ $offset = $listlimit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('emailtemplates'));
|
||||
|
||||
// Name of SQL tables of dictionaries
|
||||
|
||||
@ -278,7 +278,7 @@ foreach ($modulesdir as $dir)
|
||||
|
||||
try
|
||||
{
|
||||
$res=include_once $dir.$file; // A class already exists in a different file will send a non catchable fatal error.
|
||||
$res=include_once $dir.$file; // A class already exists in a different file will send a non catchable fatal error.
|
||||
if (class_exists($modName))
|
||||
{
|
||||
try {
|
||||
@ -352,7 +352,7 @@ foreach ($modulesdir as $dir)
|
||||
{
|
||||
$arrayofwarningsext[$modName]=$objMod->warnings_activation_ext;
|
||||
}
|
||||
|
||||
|
||||
$orders[$i] = $familyinfo[$familykey]['position']."_".$familykey."_".$moduleposition."_".$j; // Sort by family, then by module position then number
|
||||
$dirmod[$i] = $dir;
|
||||
//print $i.'-'.$dirmod[$i].'<br>';
|
||||
@ -436,7 +436,7 @@ if ($mode == 'common')
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
|
||||
|
||||
dol_fiche_head($head, $mode, '', -1);
|
||||
|
||||
$moreforfilter = '';
|
||||
@ -473,12 +473,12 @@ if ($mode == 'common')
|
||||
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
print '<div class="clearboth"></div><br>';
|
||||
|
||||
$moreforfilter='';
|
||||
|
||||
|
||||
// Show list of modules
|
||||
|
||||
$oldfamily='';
|
||||
@ -564,13 +564,13 @@ if ($mode == 'common')
|
||||
if ($familykey!=$oldfamily)
|
||||
{
|
||||
if ($oldfamily) print '</table></div><br>';
|
||||
|
||||
|
||||
$familytext=empty($familyinfo[$familykey]['label'])?$familykey:$familyinfo[$familykey]['label'];
|
||||
print_fiche_titre($familytext, '', '');
|
||||
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste" summary="list_of_modules">'."\n";
|
||||
|
||||
|
||||
$atleastoneforfamily=0;
|
||||
}
|
||||
|
||||
@ -582,9 +582,9 @@ if ($mode == 'common')
|
||||
$oldfamily=$familykey;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Version (with picto warning or not)
|
||||
$version=$objMod->getVersion(0);
|
||||
$versiontrans='';
|
||||
@ -592,14 +592,14 @@ if ($mode == 'common')
|
||||
if (preg_match('/experimental/i', $version)) $versiontrans.=img_warning($langs->trans("Experimental"), 'style="float: left"');
|
||||
if (preg_match('/deprecated/i', $version)) $versiontrans.=img_warning($langs->trans("Deprecated"), 'style="float: left"');
|
||||
$versiontrans.=$objMod->getVersion(1);
|
||||
|
||||
|
||||
// Define imginfo
|
||||
$imginfo="info";
|
||||
if ($objMod->isCoreOrExternalModule() == 'external')
|
||||
{
|
||||
$imginfo="info_black";
|
||||
}
|
||||
|
||||
|
||||
print '<tr>'."\n";
|
||||
|
||||
// Picto + Name of module
|
||||
@ -756,32 +756,32 @@ if ($mode == 'common')
|
||||
print "</a>\n";
|
||||
}
|
||||
print "</td>\n";
|
||||
|
||||
|
||||
// Link config
|
||||
print '<td class="tdsetuppicto right valignmiddle" width="60px">'.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').'</td>';
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
|
||||
if ($oldfamily)
|
||||
{
|
||||
print "</table>\n";
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
// Show warning about external users
|
||||
print info_admin(showModulesExludedForExternal($modules))."\n";
|
||||
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
if ($mode == 'marketplace')
|
||||
{
|
||||
dol_fiche_head($head, $mode, '', -1);
|
||||
|
||||
|
||||
// Marketplace
|
||||
print "<table summary=\"list_of_modules\" class=\"noborder\" width=\"100%\">\n";
|
||||
print "<tr class=\"liste_titre\">\n";
|
||||
@ -790,7 +790,7 @@ if ($mode == 'marketplace')
|
||||
print '<td>'.$langs->trans("URL").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\">\n";
|
||||
$url='https://www.dolistore.com';
|
||||
print '<td align="left"><a href="'.$url.'" target="_blank" rel="external"><img border="0" class="imgautosize imgmaxwidth180" src="'.DOL_URL_ROOT.'/theme/dolistore_logo.png"></a></td>';
|
||||
@ -798,7 +798,7 @@ if ($mode == 'marketplace')
|
||||
print '<td><a href="'.$url.'" target="_blank" rel="external">'.$url.'</a></td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\">\n";
|
||||
$url='https://partners.dolibarr.org';
|
||||
print '<td align="left"><a href="'.$url.'" target="_blank" rel="external"><img border="0" class="imgautosize imgmaxwidth180" src="'.DOL_URL_ROOT.'/theme/dolibarr_preferred_partner_int.png"></a></td>';
|
||||
@ -813,23 +813,23 @@ if ($mode == 'marketplace')
|
||||
|
||||
|
||||
// Install external module
|
||||
|
||||
|
||||
if ($mode == 'deploy')
|
||||
{
|
||||
dol_fiche_head($head, $mode, '', -1);
|
||||
|
||||
|
||||
|
||||
$allowonlineinstall=true;
|
||||
$allowfromweb=1;
|
||||
if (dol_is_file($dolibarrdataroot.'/installmodules.lock')) $allowonlineinstall=false;
|
||||
|
||||
|
||||
$fullurl='<a href="'.$urldolibarrmodules.'" target="_blank">'.$urldolibarrmodules.'</a>';
|
||||
$message='';
|
||||
if (! empty($allowonlineinstall))
|
||||
{
|
||||
if (! in_array('/custom',explode(',',$dolibarr_main_url_root_alt)))
|
||||
{
|
||||
$message=info_admin($langs->trans("ConfFileMuseContainCustom", DOL_DOCUMENT_ROOT.'/custom', DOL_DOCUMENT_ROOT));
|
||||
$message=info_admin($langs->trans("ConfFileMustContainCustom", DOL_DOCUMENT_ROOT.'/custom', DOL_DOCUMENT_ROOT));
|
||||
$allowfromweb=-1;
|
||||
}
|
||||
else
|
||||
@ -845,7 +845,7 @@ if ($mode == 'deploy')
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
$message=info_admin($langs->trans("NotExistsDirect",$dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample"));
|
||||
$allowfromweb=0;
|
||||
}
|
||||
@ -856,7 +856,7 @@ if ($mode == 'deploy')
|
||||
$message=info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile",$dolibarrdataroot.'/installmodules.lock'));
|
||||
$allowfromweb=0;
|
||||
}
|
||||
|
||||
|
||||
if ($allowfromweb < 1)
|
||||
{
|
||||
print $langs->trans("SomethingMakeInstallFromWebNotPossible");
|
||||
@ -864,15 +864,15 @@ if ($mode == 'deploy')
|
||||
//print $langs->trans("SomethingMakeInstallFromWebNotPossible2");
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ($allowfromweb >= 0)
|
||||
{
|
||||
if ($allowfromweb == 1)
|
||||
if ($allowfromweb == 1)
|
||||
{
|
||||
//print $langs->trans("ThisIsProcessToFollow").'<br>';
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
print $langs->trans("ThisIsAlternativeProcessToFollow").'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",1).'</b>: ';
|
||||
@ -881,7 +881,7 @@ if ($mode == 'deploy')
|
||||
print $langs->trans("DownloadPackageFromWebSite",$fullurl).'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",3).'</b>: ';
|
||||
}
|
||||
|
||||
|
||||
if ($allowfromweb == 1)
|
||||
{
|
||||
print $langs->trans("UnpackPackageInModulesRoot",$dirins).'<br>';
|
||||
@ -899,12 +899,12 @@ if ($mode == 'deploy')
|
||||
print $langs->trans("SetupIsReadyForUse").'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (! empty($result['return']))
|
||||
{
|
||||
print '<br>';
|
||||
|
||||
|
||||
foreach($result['return'] as $value)
|
||||
{
|
||||
echo $value.'<br>';
|
||||
|
||||
@ -107,7 +107,7 @@ if ($action == 'add' || (GETPOST('add') && $action != 'update'))
|
||||
if (! $error)
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."overwrite_trans(lang, transkey, transvalue, entity) VALUES ('".$db->escape($langcode)."','".$db->escape($transkey)."','".$db->escape($transvalue)."', ".$db->escape($conf->entity).")";
|
||||
$result = $db->query($sql);
|
||||
if ($result > 0)
|
||||
@ -126,7 +126,7 @@ if ($action == 'add' || (GETPOST('add') && $action != 'update'))
|
||||
{
|
||||
setEventMessages($langs->trans("WarningAnEntryAlreadyExistForTransKey"), null, 'warnings');
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
}
|
||||
@ -164,7 +164,25 @@ $formadmin = new FormAdmin($db);
|
||||
$wikihelp='EN:Setup|FR:Paramétrage|ES:Configuración';
|
||||
llxHeader('',$langs->trans("Setup"),$wikihelp);
|
||||
|
||||
print load_fiche_titre($langs->trans("Translation"),'','title_setup');
|
||||
$param='&mode='.$mode;
|
||||
|
||||
$enabledisablehtml = $langs->trans("EnableOverwriteTranslation").' ';
|
||||
if (empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION))
|
||||
{
|
||||
// Button off, click to enable
|
||||
$enabledisablehtml.='<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setMAIN_ENABLE_OVERWRITE_TRANSLATION&value=1'.$param.'">';
|
||||
$enabledisablehtml.=img_picto($langs->trans("Disabled"),'switch_off');
|
||||
$enabledisablehtml.='</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
// Button on, click to disable
|
||||
$enabledisablehtml.='<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setMAIN_ENABLE_OVERWRITE_TRANSLATION&value=0'.$param.'">';
|
||||
$enabledisablehtml.=img_picto($langs->trans("Activated"),'switch_on');
|
||||
$enabledisablehtml.='</a>';
|
||||
}
|
||||
|
||||
print load_fiche_titre($langs->trans("Translation"), $enabledisablehtml, 'title_setup');
|
||||
|
||||
print $langs->trans("TranslationDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
@ -175,25 +193,6 @@ print $langs->trans("CurrentUserLanguage").': <strong>'.$s.' '.$current_language
|
||||
|
||||
print '<br>';
|
||||
|
||||
print $langs->trans("EnableOverwriteTranslation").' ';
|
||||
if (empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION))
|
||||
{
|
||||
// Button off, click to enable
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setMAIN_ENABLE_OVERWRITE_TRANSLATION&value=1">';
|
||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||
print '</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
// Button on, click to disable
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setMAIN_ENABLE_OVERWRITE_TRANSLATION&value=0">';
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
print '</a>';
|
||||
}
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
$param='&mode='.$mode;
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||
@ -225,12 +224,12 @@ if ($mode == 'overwrite')
|
||||
print $langs->trans("TranslationOverwriteDesc",$langs->transnoentitiesnoconv("Language"),$langs->transnoentitiesnoconv("Key"),$langs->transnoentitiesnoconv("NewTranslationStringToShow"))."\n";
|
||||
print ' ('.$langs->trans("TranslationOverwriteDesc2").').'."<br>\n";
|
||||
print '<br>';
|
||||
|
||||
|
||||
|
||||
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" id="action" name="action" value="">';
|
||||
print '<input type="hidden" id="mode" name="mode" value="'.$mode.'">';
|
||||
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Language").' (en_US, es_MX, ...)',$_SERVER["PHP_SELF"],'lang,transkey','',$param,'',$sortfield,$sortorder);
|
||||
@ -239,11 +238,11 @@ if ($mode == 'overwrite')
|
||||
//if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre($langs->trans("Entity"),$_SERVER["PHP_SELF"],'entity,transkey','',$param,'',$sortfield,$sortorder);
|
||||
print '<td align="center"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
|
||||
|
||||
// Line to add new record
|
||||
print "\n";
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $formadmin->select_language(GETPOST('langcode'), 'langcode', 0, null, 1, 0, 0, 'maxwidthonsmartphone', 1);
|
||||
print '</td>'."\n";
|
||||
@ -270,33 +269,33 @@ if ($mode == 'overwrite')
|
||||
print '<input type="submit" class="button"'.$disabled.' value="'.$langs->trans("Add").'" name="add">';
|
||||
print "</td>\n";
|
||||
print '</tr>';
|
||||
|
||||
|
||||
|
||||
|
||||
// Show constants
|
||||
$sql = "SELECT rowid, entity, lang, transkey, transvalue";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."overwrite_trans";
|
||||
$sql.= " WHERE 1 = 1";
|
||||
//$sql.= " AND entity IN (".$user->entity.",".$conf->entity.")";
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
|
||||
|
||||
dol_syslog("translation::select from table", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
|
||||
print "\n";
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
|
||||
print '<td>'.$obj->lang.'</td>'."\n";
|
||||
print '<td>'.$obj->transkey.'</td>'."\n";
|
||||
|
||||
|
||||
// Value
|
||||
print '<td>';
|
||||
/*print '<input type="hidden" name="const['.$i.'][rowid]" value="'.$obj->rowid.'">';
|
||||
@ -306,18 +305,18 @@ if ($mode == 'overwrite')
|
||||
*/
|
||||
print $obj->transvalue;
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td align="center">';
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&action=delete'.((empty($user->entity) && $debug)?'&debug=1':'').'">'.img_delete().'</a>';
|
||||
print '</td>';
|
||||
|
||||
|
||||
print "</tr>\n";
|
||||
print "\n";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
}
|
||||
@ -325,15 +324,15 @@ if ($mode == 'overwrite')
|
||||
if ($mode == 'searchkey')
|
||||
{
|
||||
$langcode=GETPOST('langcode')?GETPOST('langcode'):$langs->defaultlang;
|
||||
|
||||
|
||||
$newlang=new Translate('',$conf);
|
||||
$newlang->setDefaultLang($langcode);
|
||||
|
||||
$newlangfileonly=new Translate('',$conf);
|
||||
$newlangfileonly->setDefaultLang($langcode);
|
||||
|
||||
|
||||
$recordtoshow=array();
|
||||
|
||||
|
||||
$nbempty=0;
|
||||
/*var_dump($langcode);
|
||||
var_dump($transkey);
|
||||
@ -353,9 +352,9 @@ if ($mode == 'searchkey')
|
||||
// Directory of translation files
|
||||
$dir_lang = $searchdir."/langs/".$langcode;
|
||||
$dir_lang_osencoded=dol_osencode($dir_lang);
|
||||
|
||||
|
||||
$filearray=dol_dir_list($dir_lang_osencoded,'files',0,'','',$sortfield,(strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC),1);
|
||||
|
||||
|
||||
foreach($filearray as $file)
|
||||
{
|
||||
$tmpfile=preg_replace('/.lang/i', '', basename($file['name']));
|
||||
@ -364,7 +363,7 @@ if ($mode == 'searchkey')
|
||||
//print 'After loading lang '.$tmpfile.', newlang has '.count($newlang->tab_translate).' records<br>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Now search into translation array
|
||||
foreach($newlang->tab_translate as $key => $val)
|
||||
{
|
||||
@ -373,13 +372,13 @@ if ($mode == 'searchkey')
|
||||
$recordtoshow[$key]=$val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//print '<br>';
|
||||
$nbtotalofrecordswithoutfilters = count($newlang->tab_translate);
|
||||
$nbtotalofrecords = count($recordtoshow);
|
||||
$num = $limit + 1;
|
||||
if (($offset + $num) > $nbtotalofrecords) $num = $limit;
|
||||
|
||||
|
||||
//print 'param='.$param.' $_SERVER["PHP_SELF"]='.$_SERVER["PHP_SELF"].' num='.$num.' page='.$page.' nbtotalofrecords='.$nbtotalofrecords." sortfield=".$sortfield." sortorder=".$sortorder;
|
||||
$title = $langs->trans("TranslationKeySearch");
|
||||
if ($nbtotalofrecords > 0) $title.=' ('.$nbtotalofrecords.' / '.$nbtotalofrecordswithoutfilters.')';
|
||||
@ -419,19 +418,19 @@ if ($mode == 'searchkey')
|
||||
{*/
|
||||
print '<input type="hidden" name="entitysearch" value="'.$conf->entity.'">';
|
||||
//}
|
||||
print '</td>';
|
||||
print '</td>';
|
||||
// Action column
|
||||
print '<td class="liste_titre nowrap" align="right">';
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
if ($sortfield == 'transkey' && strtolower($sortorder) == 'asc') ksort($recordtoshow);
|
||||
if ($sortfield == 'transkey' && strtolower($sortorder) == 'desc') krsort($recordtoshow);
|
||||
if ($sortfield == 'transvalue' && strtolower($sortorder) == 'asc') asort($recordtoshow);
|
||||
if ($sortfield == 'transvalue' && strtolower($sortorder) == 'desc') arsort($recordtoshow);
|
||||
|
||||
|
||||
// Show result
|
||||
$i=0;
|
||||
foreach($recordtoshow as $key => $val)
|
||||
@ -444,7 +443,7 @@ if ($mode == 'searchkey')
|
||||
print '</td><td align="right">';
|
||||
if (! empty($newlangfileonly->tab_translate[$key]))
|
||||
{
|
||||
if ($val != $newlangfileonly->tab_translate[$key])
|
||||
if ($val != $newlangfileonly->tab_translate[$key])
|
||||
{
|
||||
$htmltext = $langs->trans("OriginalValueWas", $newlangfileonly->tab_translate[$key]);
|
||||
print $form->textwithpicto('', $htmltext, 1, 'info');
|
||||
|
||||
@ -59,7 +59,7 @@ $offset = $listlimit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('admin'));
|
||||
|
||||
// This page is a generic page to edit dictionaries
|
||||
|
||||
@ -95,7 +95,7 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
//var_dump($_POST);
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('actioncard','globalcard'));
|
||||
|
||||
|
||||
|
||||
@ -118,7 +118,7 @@ $langs->load("agenda");
|
||||
$langs->load("other");
|
||||
$langs->load("commercial");
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('agenda'));
|
||||
|
||||
|
||||
|
||||
@ -47,12 +47,12 @@ $status=GETPOST("status",'alpha');
|
||||
$type=GETPOST('type');
|
||||
$optioncss = GETPOST('optioncss','alpha');
|
||||
// Set actioncode (this code must be same for setting actioncode into peruser, listacton and index)
|
||||
if (GETPOST('actioncode','array'))
|
||||
if (GETPOST('actioncode','array'))
|
||||
{
|
||||
$actioncode=GETPOST('actioncode','array',3);
|
||||
if (! count($actioncode)) $actioncode='0';
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE));
|
||||
}
|
||||
@ -109,7 +109,7 @@ if (! $user->rights->agenda->allactions->read || $filter=='mine') // If no permi
|
||||
$filtert=$user->id;
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('agendalist'));
|
||||
|
||||
|
||||
@ -337,11 +337,11 @@ if ($resql)
|
||||
if ($pid) $nav.='<input type="hidden" name="projectid" value="'.$pid.'">';
|
||||
if ($usergroup) $nav.='<input type="hidden" name="usergroup" value="'.$usergroup.'">';
|
||||
print $nav;
|
||||
|
||||
|
||||
print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $link, $num, -1 * $nbtotalofrecords, '', 0, $nav, '', $limit);
|
||||
|
||||
$moreforfilter='';
|
||||
|
||||
|
||||
$i = 0;
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
@ -369,11 +369,11 @@ if ($resql)
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"a.id",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Title"),$_SERVER["PHP_SELF"],"a.label",$param,"","",$sortfield,$sortorder);
|
||||
//if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
//if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"c.libelle",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateStart"),$_SERVER["PHP_SELF"],"a.datep",$param,'','align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"a.datep2",$param,'','align="center"',$sortfield,$sortorder);
|
||||
@ -392,7 +392,7 @@ if ($resql)
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
|
||||
$caction=new CActionComm($db);
|
||||
$arraylist=$caction->liste_array(1, 'code', '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0));
|
||||
|
||||
|
||||
$var=true;
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
@ -405,15 +405,13 @@ if ($resql)
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$actionstatic->id=$obj->id;
|
||||
$actionstatic->ref=$obj->id;
|
||||
$actionstatic->type_code=$obj->type_code;
|
||||
$actionstatic->type_label=$obj->type_label;
|
||||
$actionstatic->type_picto=$obj->type_picto;
|
||||
$actionstatic->label=$obj->label;
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Action (type)
|
||||
@ -443,7 +441,7 @@ if ($resql)
|
||||
if (! empty($arraylist[$labeltype])) $labeltype=$arraylist[$labeltype];
|
||||
print dol_trunc($labeltype,28);
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Start date
|
||||
print '<td align="center" class="nowrap">';
|
||||
print dol_print_date($db->jdate($obj->dp),"dayhour");
|
||||
@ -514,7 +512,7 @@ if ($resql)
|
||||
print '<td align="center" class="nowrap">'.$actionstatic->LibStatut($obj->percent,3,1,$datep).'</td>';
|
||||
|
||||
print '<td></td>';
|
||||
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -140,7 +140,7 @@ $langs->load("agenda");
|
||||
$langs->load("other");
|
||||
$langs->load("commercial");
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('agenda'));
|
||||
|
||||
|
||||
|
||||
@ -139,7 +139,7 @@ $langs->load("agenda");
|
||||
$langs->load("other");
|
||||
$langs->load("commercial");
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('agenda'));
|
||||
|
||||
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
|
||||
require '../../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/action/rapport.pdf.php';
|
||||
@ -71,6 +72,8 @@ if ($action == 'builddoc')
|
||||
* View
|
||||
*/
|
||||
|
||||
$formfile=new FormFile($db);
|
||||
|
||||
llxHeader();
|
||||
|
||||
$sql = "SELECT count(*) as cc,";
|
||||
@ -103,7 +106,7 @@ if ($resql)
|
||||
|
||||
$param='';
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -112,23 +115,24 @@ if ($resql)
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
|
||||
|
||||
print_barre_liste($langs->trans("Actions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_agenda', 0, '', '', $limit);
|
||||
|
||||
$moreforfilter='';
|
||||
|
||||
|
||||
$i = 0;
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Date").'</td>';
|
||||
print '<td>'.$langs->trans("Period").'</td>';
|
||||
print '<td align="center">'.$langs->trans("EventsNb").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Action").'</td>';
|
||||
print '<td align="center">'.$langs->trans("PDF").'</td>';
|
||||
print '<td>'.$langs->trans("PDF").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Date").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Size").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$var=true;
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
@ -136,23 +140,47 @@ if ($resql)
|
||||
|
||||
if ($obj)
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Date
|
||||
print "<td>".$obj->df."</td>\n";
|
||||
|
||||
// Nb of events
|
||||
print '<td align="center">'.$obj->cc.'</td>';
|
||||
|
||||
// Button to build doc
|
||||
print '<td align="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=builddoc&page='.$page.'&month='.$obj->month.'&year='.$obj->year.'">'.img_picto($langs->trans('GenerateReport'),'filenew').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=builddoc&page='.$page.'&month='.$obj->month.'&year='.$obj->year.'">'.img_picto($langs->trans('BuildDoc'),'filenew').'</a>';
|
||||
print '</td>';
|
||||
|
||||
$name = "actions-".$obj->month."-".$obj->year.".pdf";
|
||||
$relativepath= $name;
|
||||
$file = $conf->agenda->dir_temp."/".$name;
|
||||
$modulepart = 'actionsreport';
|
||||
$documenturl= DOL_URL_ROOT.'/document.php';
|
||||
if (isset($conf->global->DOL_URL_ROOT_DOCUMENT_PHP)) $documenturl=$conf->global->DOL_URL_ROOT_DOCUMENT_PHP; // To use another wrapper
|
||||
|
||||
if (file_exists($file))
|
||||
{
|
||||
print '<td align="center"><a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?page='.$page.'&file='.urlencode($relativepath).'&modulepart=actionsreport">'.img_pdf().'</a></td>';
|
||||
print '<td class="tdoverflowmax300">';
|
||||
//print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?page='.$page.'&file='.urlencode($relativepath).'&modulepart=actionsreport">'.img_pdf().'</a>';
|
||||
|
||||
$filearray=array('name'=>basename($file),'fullname'=>$file,'type'=>'file');
|
||||
$out='';
|
||||
|
||||
// Show file name with link to download
|
||||
$tmp = $formfile->showPreview($filearray,$modulepart,$relativepath,0,$param);
|
||||
$out.= ($tmp?$tmp.' ':'');
|
||||
$out.= '<a href="'.$documenturl.'?modulepart='.$modulepart.'&file='.urlencode($relativepath).($param?'&'.$param:'').'"';
|
||||
$mime=dol_mimetype($relativepath,'',0);
|
||||
if (preg_match('/text/',$mime)) $out.= ' target="_blank"';
|
||||
$out.= ' target="_blank">';
|
||||
$out.= img_mime($filearray["name"],$langs->trans("File").': '.$filearray["name"]).' '.$filearray["name"];
|
||||
$out.= '</a>'."\n";
|
||||
print $out;
|
||||
|
||||
print '</td>';
|
||||
print '<td align="center">'.dol_print_date(dol_filemtime($file),'dayhour').'</td>';
|
||||
print '<td align="center">'.dol_print_size(dol_filesize($file)).'</td>';
|
||||
}
|
||||
@ -169,7 +197,7 @@ if ($resql)
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
print '</form>';
|
||||
|
||||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
|
||||
@ -80,7 +80,7 @@ $extrafields = new ExtraFields($db);
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('commcard','globalcard'));
|
||||
|
||||
|
||||
@ -175,6 +175,21 @@ if (empty($reshook))
|
||||
$result=$object->update($object->id, $user);
|
||||
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
if ($action == 'update_extras') {
|
||||
$object->fetch($id);
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
|
||||
if ($ret < 0) $error++;
|
||||
if (! $error)
|
||||
{
|
||||
$result = $object->insertExtraFields();
|
||||
if ($result < 0) $error++;
|
||||
}
|
||||
if ($error) $action = 'edit_extras';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -768,7 +768,7 @@ if ($object->fetch($id) >= 0) {
|
||||
$std_soc = new Societe($db);
|
||||
$action_search = 'query';
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
|
||||
$hookmanager = new HookManager($db);
|
||||
$hookmanager->initHooks(array ('thirdpartycard'));
|
||||
|
||||
@ -52,7 +52,7 @@ $extrafields = new ExtraFields($db);
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('mailingcard','globalcard'));
|
||||
|
||||
// Array of possible substitutions (See also file mailing-send.php that should manage same substitutions)
|
||||
|
||||
@ -45,7 +45,7 @@ $sall=GETPOST('sall', 'alphanohtml');
|
||||
$sref=GETPOST("sref", "alpha");
|
||||
$filteremail=GETPOST('filteremail','alpha');
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('mailinglist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
|
||||
@ -107,7 +107,7 @@ if ($id > 0 || ! empty($ref)) {
|
||||
dol_print_error('', $object->error);
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('propalcard','globalcard'));
|
||||
|
||||
$permissionnote = $user->rights->propale->creer; // Used by the include of actions_setnotes.inc.php
|
||||
|
||||
@ -95,7 +95,7 @@ $pagenext = $page + 1;
|
||||
if (! $sortfield) $sortfield='p.ref';
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$contextpage='proposallist';
|
||||
|
||||
// Security check
|
||||
@ -113,7 +113,7 @@ $result = restrictedArea($user, $module, $objectid, $dbtable);
|
||||
|
||||
$diroutputmassaction=$conf->propal->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('propallist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
|
||||
@ -98,7 +98,7 @@ $extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
// Load object
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('ordercard','globalcard'));
|
||||
|
||||
$permissionnote = $user->rights->commande->creer; // Used by the include of actions_setnotes.inc.php
|
||||
|
||||
@ -45,7 +45,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
|
||||
$langs->loadLangs(array("orders",'sendings','deliveries','companies','compta','bills'));
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
$action=GETPOST('action','aZ09');
|
||||
$massaction=GETPOST('massaction','alpha');
|
||||
$show_files=GETPOST('show_files','int');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
@ -96,7 +96,7 @@ if (! $sortorder) $sortorder='DESC';
|
||||
// Initialize technical object to manage context to save list fields
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'orderlist';
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array($contextpage));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
@ -160,7 +160,7 @@ if (empty($reshook))
|
||||
{
|
||||
// Selection of new fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
@ -202,51 +202,51 @@ if (empty($reshook))
|
||||
|
||||
// TODO Move this into mass action include
|
||||
if ($massaction == 'confirm_createbills') {
|
||||
|
||||
|
||||
$orders = GETPOST('toselect');
|
||||
$createbills_onebythird = GETPOST('createbills_onebythird', 'int');
|
||||
$validate_invoices = GETPOST('valdate_invoices', 'int');
|
||||
|
||||
|
||||
$TFact = array();
|
||||
$TFactThird = array();
|
||||
|
||||
|
||||
$nb_bills_created = 0;
|
||||
|
||||
|
||||
$db->begin();
|
||||
|
||||
|
||||
foreach($orders as $id_order) {
|
||||
|
||||
|
||||
$cmd = new Commande($db);
|
||||
if($cmd->fetch($id_order) <= 0) continue;
|
||||
|
||||
|
||||
$object = new Facture($db);
|
||||
if(!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $object = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order.
|
||||
else {
|
||||
|
||||
|
||||
$object->socid = $cmd->socid;
|
||||
$object->type = Facture::TYPE_STANDARD;
|
||||
$object->cond_reglement_id = $cmd->cond_reglement_id;
|
||||
$object->mode_reglement_id = $cmd->mode_reglement_id;
|
||||
$object->fk_project = $cmd->fk_project;
|
||||
|
||||
|
||||
$datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
||||
if (empty($datefacture))
|
||||
{
|
||||
$datefacture = dol_mktime(date("h"), date("M"), 0, date("m"), date("d"), date("Y"));
|
||||
}
|
||||
|
||||
|
||||
$object->date = $datefacture;
|
||||
$object->origin = 'commande';
|
||||
$object->origin_id = $id_order;
|
||||
|
||||
|
||||
$res = $object->create($user);
|
||||
|
||||
|
||||
if($res > 0) $nb_bills_created++;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if($object->id > 0) {
|
||||
|
||||
|
||||
$db->begin();
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element (";
|
||||
$sql.= "fk_source";
|
||||
@ -259,7 +259,7 @@ if (empty($reshook))
|
||||
$sql.= ", ".$object->id;
|
||||
$sql.= ", '".$object->element."'";
|
||||
$sql.= ")";
|
||||
|
||||
|
||||
if ($db->query($sql))
|
||||
{
|
||||
$db->commit();
|
||||
@ -268,17 +268,17 @@ if (empty($reshook))
|
||||
{
|
||||
$db->rollback();
|
||||
}
|
||||
|
||||
|
||||
$lines = $cmd->lines;
|
||||
if (empty($lines) && method_exists($cmd, 'fetch_lines'))
|
||||
{
|
||||
$cmd->fetch_lines();
|
||||
$lines = $cmd->lines;
|
||||
}
|
||||
|
||||
|
||||
$fk_parent_line=0;
|
||||
$num=count($lines);
|
||||
|
||||
|
||||
for ($i=0;$i<$num;$i++)
|
||||
{
|
||||
$desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle);
|
||||
@ -367,43 +367,43 @@ if (empty($reshook))
|
||||
$fk_parent_line = $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
$cmd->classifyBilled($user);
|
||||
|
||||
|
||||
if(!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) $TFactThird[$cmd->socid] = $object;
|
||||
else $TFact[$object->id] = $object;
|
||||
}
|
||||
|
||||
|
||||
// Build doc with all invoices
|
||||
$TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird;
|
||||
$toselect = array();
|
||||
|
||||
|
||||
if(!empty($validate_invoices)) {
|
||||
|
||||
|
||||
$massaction = $action = 'builddoc';
|
||||
|
||||
|
||||
foreach($TAllFact as &$object) {
|
||||
$object->validate($user);
|
||||
$toselect[] = $object->id; // For builddoc action
|
||||
|
||||
|
||||
// Fac builddoc
|
||||
$upload_dir = $conf->facture->dir_output;
|
||||
$permissioncreate=$user->rights->facture->creer;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||
}
|
||||
|
||||
|
||||
$objectclass='Facture';
|
||||
$objectlabel='Invoice';
|
||||
$permtoread = $user->rights->facture->lire;
|
||||
$permtodelete = $user->rights->facture->supprimer;
|
||||
$uploaddir = $conf->facture->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
@ -418,7 +418,7 @@ if (empty($reshook))
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -596,9 +596,9 @@ if ($resql)
|
||||
$title.=' - '.$langs->trans('StatusOrderValidated').', '.(empty($conf->expedition->enabled)?'':$langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill');
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
|
||||
$arrayofselected=is_array($toselect)?$toselect:array();
|
||||
|
||||
|
||||
$param='';
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
@ -629,7 +629,7 @@ if ($resql)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
|
||||
}
|
||||
|
||||
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array(
|
||||
'presend'=>$langs->trans("SendByMail"),
|
||||
@ -653,12 +653,12 @@ if ($resql)
|
||||
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit);
|
||||
|
||||
|
||||
// TODO Move this into an invluce
|
||||
if ($massaction == 'presend')
|
||||
{
|
||||
$langs->load("mails");
|
||||
|
||||
|
||||
if (! GETPOST('cancel'))
|
||||
{
|
||||
$objecttmp=new Commande($db);
|
||||
@ -677,14 +677,14 @@ if ($resql)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print '<input type="hidden" name="massaction" value="confirm_presend">';
|
||||
|
||||
|
||||
dol_fiche_head(null, '', '');
|
||||
|
||||
|
||||
$topicmail="SendOrderRef";
|
||||
$modelmail="order_send";
|
||||
|
||||
|
||||
// Cree l'objet formulaire mail
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
@ -737,23 +737,23 @@ if ($resql)
|
||||
$formmail->substit['__REFCLIENT__']='__REFCLIENT__'; // We want to keep the tag
|
||||
$formmail->substit['__PERSONALIZED__']='';
|
||||
$formmail->substit['__CONTACTCIVNAME__']='';
|
||||
|
||||
|
||||
// Tableau des parametres complementaires du post
|
||||
$formmail->param['action']=$action;
|
||||
$formmail->param['models']=$modelmail;
|
||||
$formmail->param['models_id']=GETPOST('modelmailselected','int');
|
||||
$formmail->param['id']=join(',',$arrayofselected);
|
||||
//$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
|
||||
|
||||
|
||||
print $formmail->get_form();
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
elseif ($massaction == 'createbills')
|
||||
{
|
||||
//var_dump($_REQUEST);
|
||||
print '<input type="hidden" name="massaction" value="confirm_createbills">';
|
||||
|
||||
|
||||
print '<table class="border" width="100%" >';
|
||||
print '<tr>';
|
||||
print '<td class="titlefieldmiddle">';
|
||||
@ -780,7 +780,7 @@ if ($resql)
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '<br>';
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('CreateInvoiceForThisCustomer').'"> ';
|
||||
@ -788,13 +788,13 @@ if ($resql)
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
|
||||
if ($sall)
|
||||
{
|
||||
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
||||
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
|
||||
}
|
||||
|
||||
|
||||
$moreforfilter='';
|
||||
|
||||
// If the user can view prospects other than his'
|
||||
@ -828,7 +828,7 @@ if ($resql)
|
||||
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
|
||||
else $moreforfilter = $hookmanager->resPrint;
|
||||
|
||||
|
||||
if (! empty($moreforfilter))
|
||||
{
|
||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||
@ -839,27 +839,27 @@ if ($resql)
|
||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
|
||||
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
print '<tr class="liste_titre_filter">';
|
||||
// Ref
|
||||
if (! empty($arrayfields['c.ref']['checked']))
|
||||
if (! empty($arrayfields['c.ref']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" size="6" type="text" name="search_ref" value="'.$search_ref.'">';
|
||||
print '</td>';
|
||||
}
|
||||
// Ref customer
|
||||
if (! empty($arrayfields['c.ref_client']['checked']))
|
||||
if (! empty($arrayfields['c.ref_client']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" size="6" name="search_ref_customer" value="'.$search_ref_customer.'">';
|
||||
print '</td>';
|
||||
}
|
||||
// Thirpdarty
|
||||
if (! empty($arrayfields['s.nom']['checked']))
|
||||
if (! empty($arrayfields['s.nom']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_company" value="'.$search_company.'">';
|
||||
@ -899,7 +899,7 @@ if ($resql)
|
||||
$formother->select_year($orderyear?$orderyear:-1,'orderyear',1, 20, 5);
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['c.date_delivery']['checked']))
|
||||
if (! empty($arrayfields['c.date_delivery']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="center">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="deliveryday" value="'.$deliveryday.'">';
|
||||
@ -972,10 +972,10 @@ if ($resql)
|
||||
{
|
||||
print '<td class="liste_titre maxwidthonsmartphone" align="right">';
|
||||
$liststatus=array(
|
||||
Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraftShort"),
|
||||
Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"),
|
||||
Commande::STATUS_ACCEPTED=>$langs->trans("StatusOrderSentShort"),
|
||||
Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"),
|
||||
Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraftShort"),
|
||||
Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"),
|
||||
Commande::STATUS_ACCEPTED=>$langs->trans("StatusOrderSentShort"),
|
||||
Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"),
|
||||
Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceledShort")
|
||||
);
|
||||
print $form->selectarray('viewstatut', $liststatus, $viewstatut, -4);
|
||||
@ -993,7 +993,7 @@ if ($resql)
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
// Fields title
|
||||
@ -1014,9 +1014,9 @@ if ($resql)
|
||||
// Extra fields
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
{
|
||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||
{
|
||||
$align=$extrafields->getAlignFlag($key);
|
||||
print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||
@ -1033,20 +1033,20 @@ if ($resql)
|
||||
if (! empty($arrayfields['c.facture']['checked'])) print_liste_field_titre($arrayfields['c.facture']['label'],$_SERVER["PHP_SELF"],'c.facture','',$param,'align="center"',$sortfield,$sortorder,'');
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print '</tr>'."\n";
|
||||
|
||||
|
||||
$total=0;
|
||||
$subtotal=0;
|
||||
$productstat_cache=array();
|
||||
|
||||
|
||||
$generic_commande = new Commande($db);
|
||||
$generic_product = new Product($db);
|
||||
|
||||
|
||||
$i=0;
|
||||
$totalarray=array();
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
$notshippable=0;
|
||||
@ -1054,7 +1054,7 @@ if ($resql)
|
||||
$text_info='';
|
||||
$text_warning='';
|
||||
$nbprod=0;
|
||||
|
||||
|
||||
// Ref
|
||||
if (! empty($arrayfields['c.ref']['checked']))
|
||||
{
|
||||
@ -1070,12 +1070,12 @@ if ($resql)
|
||||
$generic_commande->total_ttc = $obj->total_ttc;
|
||||
$generic_commande->lines=array();
|
||||
$generic_commande->getLinesArray();
|
||||
|
||||
|
||||
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
||||
print '<td class="nobordernopadding nowrap">';
|
||||
print $generic_commande->getNomUrl(1,($viewstatut != 2?0:$obj->fk_statut));
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Show shippable Icon (create subloop, so may be slow)
|
||||
if ($conf->stock->enabled)
|
||||
{
|
||||
@ -1083,7 +1083,7 @@ if ($resql)
|
||||
if (($obj->fk_statut > 0) && ($obj->fk_statut < 3))
|
||||
{
|
||||
$numlines = count($generic_commande->lines); // Loop on each line of order
|
||||
for ($lig=0; $lig < $numlines; $lig++)
|
||||
for ($lig=0; $lig < $numlines; $lig++)
|
||||
{
|
||||
if ($generic_commande->lines[$lig]->product_type == 0 && $generic_commande->lines[$lig]->fk_product > 0) // If line is a product and not a service
|
||||
{
|
||||
@ -1107,8 +1107,8 @@ if ($resql)
|
||||
$text_info .= ' - '.$langs->trans("Stock").': '.$generic_product->stock_reel;
|
||||
$text_info .= ' - '.$langs->trans("VirtualStock").': '.$generic_product->stock_theorique;
|
||||
$text_info .= '<br>';
|
||||
|
||||
if ($generic_commande->lines[$lig]->qty > $generic_product->stock_reel)
|
||||
|
||||
if ($generic_commande->lines[$lig]->qty > $generic_product->stock_reel)
|
||||
{
|
||||
$notshippable++;
|
||||
}
|
||||
@ -1168,7 +1168,7 @@ if ($resql)
|
||||
$text_info = $langs->trans('NonShippable').'<br>'.$text_info;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print '<td>';
|
||||
if ($nbprod)
|
||||
{
|
||||
@ -1179,7 +1179,7 @@ if ($resql)
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
|
||||
// Warning late icon and note
|
||||
print '<td class="nobordernopadding nowrap">';
|
||||
if ($generic_commande->hasDelay()) {
|
||||
@ -1192,7 +1192,7 @@ if ($resql)
|
||||
print '</span>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
@ -1200,11 +1200,11 @@ if ($resql)
|
||||
print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir);
|
||||
print '</td>';
|
||||
print '</tr></table>';
|
||||
|
||||
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
|
||||
// Ref customer
|
||||
if (! empty($arrayfields['c.ref_client']['checked']))
|
||||
{
|
||||
@ -1222,7 +1222,7 @@ if ($resql)
|
||||
{
|
||||
print '<td class="tdoverflowmax200">';
|
||||
print $companystatic->getNomUrl(1,'customer');
|
||||
|
||||
|
||||
// If module invoices enabled and user with invoice creation permissions
|
||||
if (! empty($conf->facture->enabled) && ! empty($conf->global->ORDER_BILLING_ALL_CUSTOMER))
|
||||
{
|
||||
@ -1278,7 +1278,7 @@ if ($resql)
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
|
||||
// Order date
|
||||
if (! empty($arrayfields['c.date_commande']['checked']))
|
||||
{
|
||||
@ -1319,7 +1319,7 @@ if ($resql)
|
||||
if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalttc'] += $obj->total_ttc;
|
||||
}
|
||||
|
||||
|
||||
// Extra fields
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
{
|
||||
@ -1370,7 +1370,7 @@ if ($resql)
|
||||
print '<td align="center">'.yn($obj->billed).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
|
||||
// Action column
|
||||
print '<td class="nowrap" align="center">';
|
||||
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
@ -1381,9 +1381,9 @@ if ($resql)
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
$total+=$obj->total_ht;
|
||||
$subtotal+=$obj->total_ht;
|
||||
$i++;
|
||||
@ -1416,14 +1416,14 @@ if ($resql)
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
|
||||
|
||||
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
|
||||
print '</table>'."\n";
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '</form>'."\n";
|
||||
|
||||
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files)
|
||||
@ -1433,18 +1433,18 @@ if ($resql)
|
||||
*/
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
|
||||
$urlsource.=str_replace('&','&',$param);
|
||||
|
||||
|
||||
$filedir=$diroutputmassaction;
|
||||
$genallowed=$user->rights->commande->lire;
|
||||
$delallowed=$user->rights->commande->supprimer;
|
||||
|
||||
|
||||
print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<br><a name="show_files"></a><a href="'.$_SERVER["PHP_SELF"].'?show_files=1'.$param.'#show_files">'.$langs->trans("ShowTempMassFilesArea").'</a>';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -89,7 +89,7 @@ if ($action == 'create')
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager=new HookManager($db);
|
||||
$hookmanager->initHooks(array('orderstoinvoice'));
|
||||
|
||||
@ -131,7 +131,7 @@ if ($id > 0 || ! empty($ref))
|
||||
$contextpage='banktransactionlist'.(empty($object->ref)?'':'-'.$object->id);
|
||||
//var_dump($contextpage);
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('banktransactionlist', $contextpage));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
|
||||
@ -69,7 +69,7 @@ if (! $sortorder) $sortorder='ASC';
|
||||
// Initialize technical object to manage context to save list fields
|
||||
$contextpage='bankaccountlist';
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array($contextpage));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ $result = restrictedArea($user, 'banque', '', '', '');
|
||||
|
||||
$object = new PaymentVarious($db);
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('variouscard','globalcard'));
|
||||
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ $confirm = GETPOST('confirm','alpha');
|
||||
|
||||
$object = new Deplacement($db);
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('tripsandexpensescard','globalcard'));
|
||||
|
||||
$permissionnote=$user->rights->deplacement->creer; // Used by the include of actions_setnotes.inc.php
|
||||
|
||||
@ -114,7 +114,7 @@ if ($id > 0 || ! empty($ref)) {
|
||||
$ret = $object->fetch($id, $ref, '', '', $conf->global->INVOICE_USE_SITUATION);
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('invoicecard','globalcard'));
|
||||
|
||||
$permissionnote = $user->rights->facture->creer; // Used by the include of actions_setnotes.inc.php
|
||||
|
||||
@ -93,7 +93,7 @@ if (($id > 0 || $ref) && $action != 'create' && $action != 'add')
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('invoicereccard','globalcard'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
|
||||
@ -110,7 +110,7 @@ if (! $sortfield) $sortfield='f.datef';
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$contextpage='invoicelist';
|
||||
|
||||
// Security check
|
||||
@ -124,7 +124,7 @@ $object=new Facture($db);
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('invoicelist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ $result = restrictedArea($user, 'tax', '', '', 'charges');
|
||||
|
||||
$localtax = new Localtax($db);
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('localtaxvatcard','globalcard'));
|
||||
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ $pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="p.rowid";
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('paymentlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ $result = restrictedArea($user, 'salaries', '', '', '');
|
||||
|
||||
$object = new PaymentSalary($db);
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('salarycard','globalcard'));
|
||||
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@ $result = restrictedArea($user, 'tax', '', '', 'charges');
|
||||
|
||||
$object = new Tva($db);
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('taxvatcard','globalcard'));
|
||||
|
||||
|
||||
|
||||
@ -100,7 +100,7 @@ $pagenext = $page + 1;
|
||||
if (! $sortfield) $sortfield='a.datep, a.id';
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('contactcard','globalcard'));
|
||||
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@ if (! empty($canvas))
|
||||
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
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('contactcard','globalcard'));
|
||||
|
||||
|
||||
|
||||
@ -114,7 +114,7 @@ else if ($type == "o")
|
||||
$urlfiche="";
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array($contextpage));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ $usehm=(! empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?$conf->global->MA
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'contrat',$id);
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('contractcard','globalcard'));
|
||||
|
||||
$object = new Contrat($db);
|
||||
|
||||
@ -86,10 +86,10 @@ $staticcontratligne=new ContratLigne($db);
|
||||
|
||||
if ($search_status == '') $search_status=1;
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$contextpage='contractlist';
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array($contextpage));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
|
||||
@ -77,7 +77,7 @@ $filter_opcloture=GETPOST('filter_opcloture');
|
||||
// Initialize context for list
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'servicelist'.$mode;
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array($contextpage));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
|
||||
@ -536,7 +536,7 @@ if (! $error && $massaction == 'delete' && $permtodelete)
|
||||
$result=$objecttmp->fetch($toselectid);
|
||||
if ($result > 0)
|
||||
{
|
||||
if ($objecttmp->element == 'societe') $result = $objecttmp->delete($objecttmp->id, $user, 1);
|
||||
if (in_array($objecttmp->element, array('societe','member'))) $result = $objecttmp->delete($objecttmp->id, $user, 1);
|
||||
else $result = $objecttmp->delete($user);
|
||||
if ($result <= 0)
|
||||
{
|
||||
|
||||
@ -156,8 +156,8 @@ class box_actions extends ModeleBoxes
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'align' => 'left',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -191,7 +191,7 @@ class box_actions extends ModeleBoxes
|
||||
// on affiche que les évènement du jours ou passé
|
||||
// qui ne sont pas à 100%
|
||||
$actioncejour=true;
|
||||
|
||||
|
||||
// TR
|
||||
$logo=$contents[$line][0]['logo'];
|
||||
$label=$contents[$line][1]['text'];
|
||||
|
||||
@ -124,8 +124,8 @@ class box_bookmarks extends ModeleBoxes
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'align' => 'left',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -146,8 +146,10 @@ class box_clients extends ModeleBoxes
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array('align' => 'left',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"));
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -165,8 +165,8 @@ class box_commandes extends ModeleBoxes
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'align' => 'left',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -158,8 +158,8 @@ class box_comptes extends ModeleBoxes
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -151,8 +151,8 @@ class box_contacts extends ModeleBoxes
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'align' => 'left',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -134,7 +134,7 @@ class box_contracts extends ModeleBoxes
|
||||
|
||||
if ($num==0)
|
||||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'align="center"',
|
||||
'td' => 'align="center opacitymedium"',
|
||||
'text'=>$langs->trans("NoRecordedContracts"),
|
||||
);
|
||||
|
||||
@ -148,8 +148,8 @@ class box_contracts extends ModeleBoxes
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -169,8 +169,8 @@ class box_factures extends ModeleBoxes
|
||||
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -178,8 +178,8 @@ class box_factures_fourn extends ModeleBoxes
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'text' => $langs->transnoentities("ReadPermissionNotAllowed"),
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->transnoentities("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -168,8 +168,8 @@ class box_factures_fourn_imp extends ModeleBoxes
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -172,8 +172,8 @@ class box_factures_imp extends ModeleBoxes
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -134,8 +134,10 @@ class box_ficheinter extends ModeleBoxes
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->info_box_contents[0][0] = array('td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"));
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -127,8 +127,8 @@ class box_fournisseurs extends ModeleBoxes
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@ class box_goodcustomers extends ModeleBoxes
|
||||
|
||||
// disable box for such cases
|
||||
if (! empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) $this->enabled=0; // disabled by this option
|
||||
if (empty($conf->global->MAIN_BOX_ENABLE_BEST_CUSTOMERS)) $this->enabled=0; // not enabled by default. Very slow on large database
|
||||
if (empty($conf->global->MAIN_BOX_ENABLE_BEST_CUSTOMERS)) $this->enabled=0; // not enabled by default. Very slow on large database
|
||||
}
|
||||
|
||||
/**
|
||||
@ -148,8 +148,10 @@ class box_goodcustomers extends ModeleBoxes
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array('align' => 'left',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"));
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
||||
if (! $mesg)
|
||||
{
|
||||
$langs->load("bills");
|
||||
|
||||
|
||||
$px1->SetData($data1);
|
||||
unset($data1);
|
||||
$px1->SetPrecisionY(0);
|
||||
@ -255,8 +255,10 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
||||
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array('td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"));
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -132,7 +132,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
||||
if (! $mesg)
|
||||
{
|
||||
$langs->load("bills");
|
||||
|
||||
|
||||
$px1->SetData($data1);
|
||||
unset($data1);
|
||||
$px1->SetPrecisionY(0);
|
||||
@ -254,8 +254,10 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
||||
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array('td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"));
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -253,8 +253,10 @@ class box_graph_orders_permonth extends ModeleBoxes
|
||||
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array('td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"));
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -252,8 +252,10 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
||||
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array('td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"));
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -99,6 +99,10 @@ class box_graph_product_distribution extends ModeleBoxes
|
||||
$nowarray=dol_getdate(dol_now(),true);
|
||||
if (empty($year)) $year=$nowarray['year'];
|
||||
|
||||
$nbofgraph=0;
|
||||
if ($showinvoicenb) $nbofgraph++;
|
||||
if ($showpropalnb) $nbofgraph++;
|
||||
if ($showordernb) $nbofgraph++;
|
||||
|
||||
$text = $langs->trans("BoxProductDistribution",$max).' - '.$langs->trans("Year").': '.$year;
|
||||
$this->info_box_head = array(
|
||||
@ -113,11 +117,6 @@ class box_graph_product_distribution extends ModeleBoxes
|
||||
);
|
||||
|
||||
|
||||
$nbofgraph=0;
|
||||
if ($showinvoicenb) $nbofgraph++;
|
||||
if ($showpropalnb) $nbofgraph++;
|
||||
if ($showordernb) $nbofgraph++;
|
||||
|
||||
$paramtitle=$langs->transnoentitiesnoconv("Products").'/'.$langs->transnoentitiesnoconv("Services");
|
||||
if (empty($conf->produit->enabled)) $paramtitle=$langs->transnoentitiesnoconv("Services");
|
||||
if (empty($conf->service->enabled)) $paramtitle=$langs->transnoentitiesnoconv("Products");
|
||||
@ -250,7 +249,7 @@ class box_graph_product_distribution extends ModeleBoxes
|
||||
if (! empty($conf->commande->enabled) && ! empty($user->rights->commande->lire))
|
||||
{
|
||||
$langs->load("orders");
|
||||
|
||||
|
||||
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||
if ($showordernb)
|
||||
{
|
||||
@ -309,6 +308,11 @@ class box_graph_product_distribution extends ModeleBoxes
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($nbofgraph))
|
||||
{
|
||||
$langs->load("errors");
|
||||
$mesg=$langs->trans("ReadPermissionNotAllowed");
|
||||
}
|
||||
if (empty($conf->use_javascript_ajax))
|
||||
{
|
||||
$langs->load("errors");
|
||||
@ -380,9 +384,11 @@ class box_graph_product_distribution extends ModeleBoxes
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->info_box_contents[0][0] = array( 'td' => 'align="left" class="nohover"',
|
||||
'maxlength'=>500,
|
||||
'text' => $mesg);
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'maxlength'=>500,
|
||||
'text' => $mesg
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -254,8 +254,10 @@ class box_graph_propales_permonth extends ModeleBoxes
|
||||
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array('td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"));
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -157,8 +157,8 @@ class box_members extends ModeleBoxes
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'align' => 'left',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -113,7 +113,7 @@ class box_produits extends ModeleBoxes
|
||||
$productstatic->entity = $objp->entity;
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => '',
|
||||
'td' => 'class="tdoverflowmax100 maxwidth100onsmartphone"',
|
||||
'text' => $productstatic->getNomUrl(1),
|
||||
'asis' => 1,
|
||||
);
|
||||
@ -188,8 +188,8 @@ class box_produits extends ModeleBoxes
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -195,8 +195,8 @@ class box_produits_alerte_stock extends ModeleBoxes
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -155,8 +155,8 @@ class box_propales extends ModeleBoxes
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -156,8 +156,8 @@ class box_prospect extends ModeleBoxes
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -161,8 +161,10 @@ class box_services_contracts extends ModeleBoxes
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array('td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"));
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ class box_services_expired extends ModeleBoxes
|
||||
$i = 0;
|
||||
|
||||
$thirdpartytmp = new Societe($this->db);
|
||||
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$late='';
|
||||
@ -140,8 +140,10 @@ class box_services_expired extends ModeleBoxes
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->info_box_contents[0][0] = array('td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"));
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -160,8 +160,8 @@ class box_supplier_orders extends ModeleBoxes
|
||||
else
|
||||
{
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"),
|
||||
'td' => 'align="left" class="nohover opacitymedium"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -759,7 +759,11 @@ class ExtraFields
|
||||
$list=$this->attribute_list[$key];
|
||||
$hidden=$this->attribute_hidden[$key];
|
||||
|
||||
if ($computed) return '<span class="opacitymedium">'.$langs->trans("AutomaticallyCalculated").'</span>';
|
||||
if ($computed)
|
||||
{
|
||||
if ($keysuffix != 'search_') return '<span class="opacitymedium">'.$langs->trans("AutomaticallyCalculated").'</span>';
|
||||
else return '';
|
||||
}
|
||||
|
||||
if (empty($showsize))
|
||||
{
|
||||
|
||||
@ -6085,7 +6085,7 @@ class Form
|
||||
}
|
||||
else
|
||||
{
|
||||
$nophoto='/public/theme/common/nophoto.png';
|
||||
$nophoto='/public/theme/common/nophoto.png';
|
||||
if (in_array($modulepart,array('userphoto','contact'))) // For module that are "physical" users
|
||||
{
|
||||
$nophoto='/public/theme/common/user_anonymous.png';
|
||||
@ -6104,10 +6104,7 @@ class Form
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($conf->browser->layout != 'phone')
|
||||
{
|
||||
$ret.='<img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="No photo" '.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.$nophoto.'">';
|
||||
}
|
||||
$ret.='<img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="No photo" '.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.$nophoto.'">';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -188,9 +188,9 @@ class FormActions
|
||||
print load_fiche_titre($title, $buttontoaddnewevent, '');
|
||||
|
||||
$page=0; $param=''; $sortfield='a.datep';
|
||||
|
||||
$total = 0;
|
||||
|
||||
|
||||
$total = 0;
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="noborder'.($morecss?' '.$morecss:'').'" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -209,12 +209,23 @@ class FormActions
|
||||
{
|
||||
$ref=$action->getNomUrl(1,-1);
|
||||
$label=$action->getNomUrl(0,38);
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$ref.'</td>';
|
||||
print '<td>'.$label.'</td>';
|
||||
print '<td>'.$action->type.'</td>';
|
||||
print '<td>';
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
{
|
||||
if ($action->type_picto) print img_picto('', $action->type_picto);
|
||||
else {
|
||||
if ($action->type_code == 'AC_RDV') print img_picto('', 'object_group').' ';
|
||||
if ($action->type_code == 'AC_TEL') print img_picto('', 'object_phoning').' ';
|
||||
if ($action->type_code == 'AC_FAX') print img_picto('', 'object_phoning_fax').' ';
|
||||
if ($action->type_code == 'AC_EMAIL') print img_picto('', 'object_email').' ';
|
||||
}
|
||||
}
|
||||
print $action->type;
|
||||
print '</td>';
|
||||
print '<td>'.dol_print_date($action->datep,'dayhour');
|
||||
if ($action->datef)
|
||||
{
|
||||
@ -233,7 +244,7 @@ class FormActions
|
||||
$userstatic->id = $action->author->id;
|
||||
$userstatic->firstname = $action->author->firstname;
|
||||
$userstatic->lastname = $action->author->lastname;
|
||||
print $userstatic->getNomUrl(1);
|
||||
print $userstatic->getNomUrl(1, '', 0, 0, 16, 0, '', '');
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
@ -285,22 +296,22 @@ class FormActions
|
||||
if (! empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO)) unset($arraylist['AC_OTH_AUTO']);
|
||||
|
||||
$out='';
|
||||
|
||||
if (! empty($multiselect))
|
||||
|
||||
if (! empty($multiselect))
|
||||
{
|
||||
if (!is_array($selected) && !empty($selected)) $selected = explode(',', $selected);
|
||||
$out.=$form->multiselectarray($htmlname, $arraylist, $selected, 0, 0, 'centpercent', 0, 0);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$out.=$form->selectarray($htmlname, $arraylist, $selected);
|
||||
}
|
||||
|
||||
if ($user->admin && empty($onlyautoornot) && $hideinfohelp <= 0)
|
||||
|
||||
if ($user->admin && empty($onlyautoornot) && $hideinfohelp <= 0)
|
||||
{
|
||||
$out.=info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup").($hideinfohelp == -1 ? ". ".$langs->trans("YouCanSetDefaultValueInModuleSetup") : ''),1);
|
||||
}
|
||||
|
||||
|
||||
if ($nooutput) return $out;
|
||||
else print $out;
|
||||
return '';
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
class FormFile
|
||||
{
|
||||
private $db;
|
||||
|
||||
|
||||
public $error;
|
||||
public $numoffiles;
|
||||
public $infofiles; // Used to return informations by function getDocumentsLink
|
||||
@ -332,11 +332,11 @@ class FormFile
|
||||
jQuery(\'#togglemassfilesarea\').text("('.dol_escape_js($langs->trans("Hide")).')");
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$titletoshow=$langs->trans("Documents");
|
||||
if (! empty($title)) $titletoshow=$title;
|
||||
|
||||
@ -593,7 +593,7 @@ class FormFile
|
||||
if (empty($noform)) $out.= '<form action="'.$urlsource.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc').'" id="'.$forname.'_form" method="post">';
|
||||
$out.= '<input type="hidden" name="action" value="builddoc">';
|
||||
$out.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
|
||||
$out.= load_fiche_titre($titletoshow, '', '');
|
||||
$out.= '<div class="div-table-responsive-no-min">';
|
||||
$out.= '<table class="liste formdoc noborder" summary="listofdocumentstable" width="100%">';
|
||||
@ -682,9 +682,9 @@ class FormFile
|
||||
$sortfield = $sortorder = null;
|
||||
$res = $link->fetchAll($link_list, $object->element, $object->id, $sortfield, $sortorder);
|
||||
}
|
||||
|
||||
|
||||
$out.= '<!-- html.formfile::showdocuments -->'."\n";
|
||||
|
||||
|
||||
// Show title of array if not already shown
|
||||
if ((! empty($file_list) || ! empty($link_list) || preg_match('/^massfilesarea/', $modulepart)) && ! $headershown)
|
||||
{
|
||||
@ -706,8 +706,8 @@ class FormFile
|
||||
$out.= '<tr class="oddeven">';
|
||||
|
||||
$documenturl = DOL_URL_ROOT.'/document.php';
|
||||
if (isset($conf->global->DOL_URL_ROOT_DOCUMENT_PHP)) $documenturl=$conf->global->DOL_URL_ROOT_DOCUMENT_PHP;
|
||||
|
||||
if (isset($conf->global->DOL_URL_ROOT_DOCUMENT_PHP)) $documenturl=$conf->global->DOL_URL_ROOT_DOCUMENT_PHP; // To use another wrapper
|
||||
|
||||
// Show file name with link to download
|
||||
$out.= '<td class="tdoverflowmax300">';
|
||||
$tmp = $this->showPreview($file,$modulepart,$relativepath,0,$param);
|
||||
@ -774,7 +774,7 @@ class FormFile
|
||||
if (is_array($link_list))
|
||||
{
|
||||
$colspan=2;
|
||||
|
||||
|
||||
foreach($link_list as $file)
|
||||
{
|
||||
$out.='<tr class="oddeven">';
|
||||
@ -791,7 +791,7 @@ class FormFile
|
||||
}
|
||||
$this->numoffiles++;
|
||||
}
|
||||
|
||||
|
||||
if (count($file_list) == 0 && count($link_list) == 0 && $headershown)
|
||||
{
|
||||
$out.='<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
@ -835,7 +835,7 @@ class FormFile
|
||||
$this->infofiles=array('nboffiles'=>0,'extensions'=>array(),'files'=>array());
|
||||
|
||||
//if (! empty($conf->dol_use_jmobile)) return '';
|
||||
|
||||
|
||||
$file_list=dol_dir_list($filedir, 'files', 0, preg_quote(basename($modulesubdir),'/').'[^\-]+', '\.meta$|\.png$'); // Get list of files starting with name of ref (but not followed by "-" to discard uploaded files)
|
||||
|
||||
// For ajax treatment
|
||||
@ -876,7 +876,7 @@ class FormFile
|
||||
$tmparray = getAdvancedPreviewUrl($modulepart, $relativepath, 1, '&entity='.$entity);
|
||||
if ($tmparray && $tmparray['url']) $tmpout.= '<li><a href="'.$tmparray['url'].'"'.($tmparray['css']?' class="'.$tmparray['css'].'"':'').($tmparray['mime']?' mime="'.$tmparray['mime'].'"':'').($tmparray['target']?' target="'.$tmparray['target'].'"':'').'>'.img_picto('','detail').' '.$langs->trans("Preview").' '.$ext.'</a></li>';
|
||||
}
|
||||
|
||||
|
||||
// Download
|
||||
$tmpout.= '<li><a class="pictopreview" href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'"';
|
||||
$mime=dol_mimetype($relativepath,'',0);
|
||||
@ -946,7 +946,7 @@ class FormFile
|
||||
if ($upload_dir)
|
||||
{
|
||||
$relativedir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $upload_dir);
|
||||
$relativedir = preg_replace('/^[\\/]/','',$relativedir);
|
||||
$relativedir = preg_replace('/^[\\/]/','',$relativedir);
|
||||
}
|
||||
|
||||
$hookmanager->initHooks(array('formfile'));
|
||||
@ -983,7 +983,7 @@ class FormFile
|
||||
if ($user->rights->service->creer && $object->type == Product::TYPE_SERVICE) $permtoeditline=1;
|
||||
}
|
||||
}
|
||||
if (empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
if (empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
$permtoeditline=0;
|
||||
$permonobject=0;
|
||||
@ -992,7 +992,7 @@ class FormFile
|
||||
// Show list of existing files
|
||||
if (empty($useinecm)) print load_fiche_titre($title?$title:$langs->trans("AttachedFiles"));
|
||||
if (empty($url)) $url=$_SERVER["PHP_SELF"];
|
||||
|
||||
|
||||
print '<!-- html.formfile::list_of_documents -->'."\n";
|
||||
if (GETPOST('action','aZ09') == 'editfile' && $permtoeditline)
|
||||
{
|
||||
@ -1003,7 +1003,7 @@ class FormFile
|
||||
}
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table width="100%" id="tablelines" class="'.($useinecm?'liste noborder':'liste').'">'."\n";
|
||||
|
||||
|
||||
print '<tr class="liste_titre nodrag nodrop">';
|
||||
print_liste_field_titre($langs->trans("Documents2"),$url,"name","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Size"),$url,"size","",$param,'align="right"',$sortfield,$sortorder);
|
||||
@ -1017,10 +1017,10 @@ class FormFile
|
||||
if ($relativedir)
|
||||
{
|
||||
$filearrayindatabase = dol_dir_list_in_database($relativedir, '', null, 'name', SORT_ASC);
|
||||
|
||||
|
||||
//var_dump($filearray);
|
||||
//var_dump($filearrayindatabase);
|
||||
|
||||
|
||||
// Complete filearray with properties found into $filearrayindatabase
|
||||
foreach($filearray as $key => $val)
|
||||
{
|
||||
@ -1040,7 +1040,7 @@ class FormFile
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (! $found) // This happen in transition towerd version 6, or if files were added manually into os dir.
|
||||
{
|
||||
$filearray[$key]['position']='999999'; // File not indexed are at end. So if we add a file, it will not replace an existing position
|
||||
@ -1053,13 +1053,13 @@ class FormFile
|
||||
dol_syslog("list_of_documents We found a file called '".$filearray[$key]['name']."' not indexed into database. We add it");
|
||||
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
|
||||
$ecmfile=new EcmFiles($this->db);
|
||||
|
||||
|
||||
// Add entry into database
|
||||
$filename = basename($rel_filename);
|
||||
$rel_dir = dirname($rel_filename);
|
||||
$rel_dir = preg_replace('/[\\/]$/', '', $rel_dir);
|
||||
$rel_dir = preg_replace('/^[\\/]/', '', $rel_dir);
|
||||
|
||||
|
||||
$ecmfile->filepath = $rel_dir;
|
||||
$ecmfile->filename = $filename;
|
||||
$ecmfile->label = md5_file(dol_osencode($filearray[$key]['fullname'])); // $destfile is a full path to file
|
||||
@ -1083,21 +1083,21 @@ class FormFile
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*var_dump($filearray);
|
||||
var_dump($sortfield);
|
||||
var_dump($sortorder);*/
|
||||
|
||||
|
||||
if ($sortfield && $sortorder)
|
||||
{
|
||||
$filearray=dol_sort_array($filearray, $sortfield, $sortorder);
|
||||
}
|
||||
//var_dump($filearray);
|
||||
}
|
||||
|
||||
|
||||
$nboffiles=count($filearray);
|
||||
if ($nboffiles > 0) include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||
|
||||
|
||||
$var=true; $i=0; $nboflines = 0; $lastrowid=0;
|
||||
foreach($filearray as $key => $file) // filearray must be only files here
|
||||
{
|
||||
@ -1105,10 +1105,10 @@ class FormFile
|
||||
&& $file['name'] != '..'
|
||||
&& ! preg_match('/\.meta$/i',$file['name']))
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
if ($filearray[$key]['rowid'] > 0) $lastrowid = $filearray[$key]['rowid'];
|
||||
|
||||
|
||||
$editline=0;
|
||||
$nboflines++;
|
||||
print '<!-- Line list_of_documents '.$key.' relativepath = '.$relativepath.' -->'."\n";
|
||||
@ -1116,11 +1116,11 @@ class FormFile
|
||||
print '<!-- In database: position='.$filearray[$key]['position'].' -->'."\n";
|
||||
print '<tr id="row-'.($filearray[$key]['rowid']>0?$filearray[$key]['rowid']:'-AFTER'.$lastrowid.'POS'.($i+1)).'" '.$bcdd[$var].'>';
|
||||
print '<td class="tdoverflowmax300">';
|
||||
|
||||
|
||||
$filepath=$relativepath.$file['name'];
|
||||
|
||||
|
||||
if (! $editline) print $this->showPreview($file,$modulepart,$filepath);
|
||||
|
||||
|
||||
//print "XX".$file['name']; //$file['name'] must be utf8
|
||||
print '<a class="paddingleft" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart;
|
||||
if ($forcedownload) print '&attachment=1';
|
||||
@ -1143,13 +1143,13 @@ class FormFile
|
||||
print $file['name'];
|
||||
print '</a>';
|
||||
}
|
||||
|
||||
|
||||
print "</td>\n";
|
||||
|
||||
|
||||
print '<td align="right" width="80px">'.dol_print_size($file['size'],1,1).'</td>';
|
||||
|
||||
|
||||
print '<td align="center" width="130px">'.dol_print_date($file['date'],"dayhour","tzuser").'</td>';
|
||||
|
||||
|
||||
// Preview
|
||||
if (empty($useinecm))
|
||||
{
|
||||
@ -1175,7 +1175,7 @@ class FormFile
|
||||
// Delete or view link
|
||||
// ($param must start with &)
|
||||
print '<td class="valignmiddle right"><!-- action on files -->';
|
||||
if ($useinecm)
|
||||
if ($useinecm)
|
||||
{
|
||||
print '<a href="'.DOL_URL_ROOT.'/ecm/docfile.php?urlfile='.urlencode($file['name']).$param.'" class="editfilelink" rel="'.urlencode($file['name']).'">'.img_view('default', 0, 'class="paddingrightonly"').'</a>';
|
||||
}
|
||||
@ -1183,10 +1183,10 @@ class FormFile
|
||||
{
|
||||
$newmodulepart=$modulepart;
|
||||
if (in_array($modulepart, array('product','produit','service'))) $newmodulepart='produit|service';
|
||||
|
||||
$disablecrop=1;
|
||||
|
||||
$disablecrop=1;
|
||||
if (in_array($modulepart, array('product','produit','service','expensereport','holiday','project','user'))) $disablecrop=0;
|
||||
|
||||
|
||||
if (! $disablecrop && image_format_supported($file['name']) > 0)
|
||||
{
|
||||
if ($permtoeditline)
|
||||
@ -1195,7 +1195,7 @@ class FormFile
|
||||
print '<a href="'.DOL_URL_ROOT.'/core/photos_resize.php?modulepart='.urlencode($newmodulepart).'&id='.$object->id.'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension'])).'" title="'.dol_escape_htmltag($langs->trans("Resize")).'">'.img_picto($langs->trans("Resize"),DOL_URL_ROOT.'/theme/common/transform-crop-and-resize','class="paddingrightonly"',1).'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($permtoeditline)
|
||||
{
|
||||
print '<a href="'.(($useinecm && $useajax)?'#':$url.'?action=editfile&urlfile='.urlencode($filepath).$param).'" class="editfilelink" rel="'.$filepath.'">'.img_edit('default',0,'class="paddingrightonly"').'</a>';
|
||||
@ -1213,15 +1213,15 @@ class FormFile
|
||||
if (! empty($conf->dol_use_jmobile)) $useajax=0;
|
||||
if (empty($conf->use_javascript_ajax)) $useajax=0;
|
||||
if (! empty($conf->global->MAIN_ECM_DISABLE_JS)) $useajax=0;
|
||||
|
||||
|
||||
print '<a href="'.(($useinecm && $useajax)?'#':$url.'?action=delete&urlfile='.urlencode($filepath).$param).'" class="deletefilelink" rel="'.$filepath.'">'.img_delete().'</a>';
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
if (empty($disablemove))
|
||||
{
|
||||
if ($nboffiles > 1 && empty($conf->browser->phone)) {
|
||||
print '<td align="center" class="linecolmove tdlineupdown">';
|
||||
if ($nboffiles > 1 && empty($conf->browser->phone)) {
|
||||
print '<td align="center" class="linecolmove tdlineupdown">';
|
||||
if ($i > 0) {
|
||||
print '<a class="lineupdown" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&action=up&rowid='.$line->id.'">'.img_up('default',0,'imgupforline').'</a>';
|
||||
}
|
||||
@ -1245,7 +1245,7 @@ class FormFile
|
||||
if (empty($disablemove)) print '<td class="right"></td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
@ -1260,19 +1260,19 @@ class FormFile
|
||||
}
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
if (! $editline && $nboflines > 1) {
|
||||
|
||||
if (! $editline && $nboflines > 1) {
|
||||
if (! empty($conf->use_javascript_ajax) && $permtoeditline) {
|
||||
$table_element_line = 'ecm_files';
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (GETPOST('action','aZ09') == 'editfile' && $permtoeditline)
|
||||
{
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
|
||||
return $nboffiles;
|
||||
}
|
||||
}
|
||||
@ -1449,19 +1449,19 @@ class FormFile
|
||||
|
||||
if (! $found > 0 || ! is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) continue; // We do not show orphelins files
|
||||
|
||||
|
||||
|
||||
print '<!-- Line list_of_autoecmfiles '.$key.' -->'."\n";
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
if ($found > 0 && is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) print $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]->getNomUrl(1,'document');
|
||||
else print $langs->trans("ObjectDeleted",($id?$id:$ref));
|
||||
|
||||
|
||||
$filename=dol_sanitizeFileName($ref);
|
||||
//$filedir=$conf->$modulepart->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$file['path'];
|
||||
//$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
//print $formfile->getDocumentsLink($modulepart, $filename, $filedir);
|
||||
|
||||
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
//print "XX".$file['name']; //$file['name'] must be utf8
|
||||
@ -1471,9 +1471,9 @@ class FormFile
|
||||
print img_mime($file['name'],$file['name'].' ('.dol_print_size($file['size'],0,0).')').' ';
|
||||
print dol_trunc($file['name'],$maxlength,'middle');
|
||||
print '</a>';
|
||||
|
||||
|
||||
print $this->getDocumentsLink($modulepart, $filename, $filedir);
|
||||
|
||||
|
||||
print "</td>\n";
|
||||
print '<td align="right">'.dol_print_size($file['size'],1,1).'</td>';
|
||||
print '<td align="center">'.dol_print_date($file['date'],"dayhour").'</td>';
|
||||
@ -1668,11 +1668,11 @@ class FormFile
|
||||
|
||||
return $nboflinks;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Show detail icon with link for preview
|
||||
*
|
||||
*
|
||||
* @param array $file File
|
||||
* @param string $modulepart propal, facture, facture_fourn, ...
|
||||
* @param string $relativepath Relative path of docs
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user