Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2018-10-04 17:57:20 +02:00
commit 31916c94f0
72 changed files with 274 additions and 230 deletions

View File

@ -44,8 +44,7 @@ include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
$langs->load("main");
$langs->load("errors");
$langs->loadLangs(array("main", "errors"));
// Global variables
$version=DOL_VERSION;

View File

@ -307,7 +307,7 @@ if (! $error && $xml)
}
else
{
$out.='<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
$out.='<tr class="oddeven"><td colspan="6" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
$out.='</table>';
$out.='</div>';

View File

@ -65,9 +65,7 @@ $langs->loadLangs(array('orders', 'companies', 'other', 'suppliers', 'supplier_p
$form=new Form($db);
$formpropal=new FormPropal($db);
$langs->load('propal');
$langs->load('other');
$langs->load("companies");
$langs->loadLangs(array('propal', 'other', 'companies'));
if ($mode == 'customer')
{

View File

@ -626,11 +626,16 @@ class FormProjets
if ($num > 0)
{
$sellist = '<select class="flat oppstatus'.($morecss?' '.$morecss:'').'" id="'.$htmlname.'" name="'.$htmlname.'">';
if ($showempty) $sellist.= '<option value="-1">&nbsp;</option>'; // Without &nbsp, strange move of screen when switching value
if ($showallnone) $sellist.= '<option value="all"'.($preselected == 'all'?' selected="selected"':'').'>-- '.$langs->trans("OnlyOpportunitiesShort").' --</option>';
if ($showallnone) $sellist.= '<option value="openedopp"'.($preselected == 'openedopp'?' selected="selected"':'').'>-- '.$langs->trans("OpenedOpportunitiesShort").' --</option>';
if ($showallnone) $sellist.= '<option value="notopenedopp"'.($preselected == 'notopenedopp'?' selected="selected"':'').'>-- '.$langs->trans("NotOpenedOpportunitiesShort").' --</option>';
if ($showallnone) $sellist.= '<option value="none"'.($preselected == 'none'?' selected="selected"':'').'>-- '.$langs->trans("NotAnOpportunityShort").' --</option>';
if ($showempty) {
// Without &nbsp, strange move of screen when switching value
$sellist.= '<option value="-1">&nbsp;</option>';
}
if ($showallnone) {
$sellist.= '<option value="all"'.($preselected == 'all'?' selected="selected"':'').'>-- '.$langs->trans("OnlyOpportunitiesShort").' --</option>';
$sellist.= '<option value="openedopp"'.($preselected == 'openedopp'?' selected="selected"':'').'>-- '.$langs->trans("OpenedOpportunitiesShort").' --</option>';
$sellist.= '<option value="notopenedopp"'.($preselected == 'notopenedopp'?' selected="selected"':'').'>-- '.$langs->trans("NotOpenedOpportunitiesShort").' --</option>';
$sellist.= '<option value="none"'.($preselected == 'none'?' selected="selected"':'').'>-- '.$langs->trans("NotAnOpportunityShort").' --</option>';
}
while ($i < $num)
{
$obj = $this->db->fetch_object($resql);

View File

@ -1285,7 +1285,7 @@ function show_actions_todo($conf,$langs,$db,$filterobj,$objcon='',$noprint=0,$ac
* @param Conf $conf Object conf
* @param Translate $langs Object langs
* @param DoliDB $db Object db
* @param mixed $filterobj Object Adherent|Societe|Project|Product|CommandeFournisseur
* @param mixed $filterobj Object Adherent|Societe|Project|Product|CommandeFournisseur|Dolresource
* @param Contact $objcon Object contact
* @param int $noprint Return string but does not output it
* @param string $actioncode Filter on actioncode
@ -1330,9 +1330,16 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_action";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id";
if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
elseif (is_object($filterobj) && get_class($filterobj) == 'Dolresource') {
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."element_resources as er";
$sql.= " ON er.resource_type = 'dolresource'";
$sql.= " AND er.element_id = a.id";
$sql.= " AND er.resource_id = ".$filterobj->id;
}
elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as o";
elseif (is_object($filterobj) && get_class($filterobj) == 'Product') $sql.= ", ".MAIN_DB_PREFIX."product as o";
$sql.= " WHERE a.entity IN (".getEntity('agenda').")";
if (is_object($filterobj) && get_class($filterobj) == 'Societe' && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id;
elseif (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id;

View File

@ -77,6 +77,16 @@ function resource_prepare_head($object)
$head[$h][2] = 'documents';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/resource/agenda.php?id='.$object->id;
$head[$h][1] = $langs->trans("Events");
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
{
$head[$h][1].= '/';
$head[$h][1].= $langs->trans("Agenda");
}
$head[$h][2] = 'agenda';
$h++;
/*$head[$h][0] = DOL_URL_ROOT.'/resource/info.php?id='.$object->id;
$head[$h][1] = $langs->trans('Info');
$head[$h][2] = 'info';

View File

@ -1126,8 +1126,6 @@ class CommandeFournisseur extends CommonOrder
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Submit a supplier order to supplier
*
@ -1139,7 +1137,6 @@ class CommandeFournisseur extends CommonOrder
*/
public function commande($user, $date, $methode, $comment='')
{
// phpcs:enable
global $langs;
dol_syslog(get_class($this)."::commande");
$error = 0;

View File

@ -1128,7 +1128,7 @@ if ($resql)
// Status
if (! empty($arrayfields['cf.fk_statut']['checked']))
{
print '<td align="right" class="nowrap">'.$objectstatic->LibStatut($obj->fk_statut, 5, $obj->billed, 1).'</td>';
print '<td align="right" class="nowrap">'.$objectstatic->LibStatut($obj->fk_statut, 5, $obj->billed).'</td>';
if (! $i) $totalarray['nbfield']++;
}
// Billed

View File

@ -34,9 +34,7 @@ if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
$langs->load("bills");
$langs->load('other');
$langs->load("companies");
$langs->loadLangs(array("bills", "other", "companies"));
$id = (GETPOST('id','int') ? GETPOST('id','int') : GETPOST('facid','int'));
$ref = GETPOST('ref','alpha');

View File

@ -38,9 +38,7 @@ if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
$langs->load('bills');
$langs->load('other');
$langs->load("companies");
$langs->loadLangs(array('bills', 'other', 'companies'));
$id = GETPOST('facid','int')?GETPOST('facid','int'):GETPOST('id','int');
$action=GETPOST('action','alpha');

View File

@ -33,9 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
if (! $user->rights->fournisseur->facture->lire) accessforbidden();
$langs->load("companies");
$langs->load("bills");
$langs->loadLangs(array("companies", "bills"));
$socid=GETPOST('socid','int');
$option = GETPOST('option');

View File

@ -34,8 +34,7 @@ if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
$langs->load('companies');
$langs->load('bills');
$langs->loadLangs(array("companies", "bills"));
$id = GETPOST("facid",'int')?GETPOST("facid",'int'):GETPOST("id",'int');
$ref = GETPOST("ref",'alpha');

View File

@ -33,8 +33,7 @@ if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
$langs->load('bills');
$langs->load("companies");
$langs->loadLangs(array("bills", "companies"));
$id = (GETPOST('id','int') ? GETPOST('id','int') : GETPOST('facid','int'));
$ref = GETPOST('ref','alpha');

View File

@ -38,10 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$langs->load('companies');
$langs->load('bills');
$langs->load('banks');
$langs->load('compta');
$langs->loadLangs(array('companies', 'bills', 'banks', 'compta'));
// Security check
$action = GETPOST('action','alpha');

View File

@ -28,9 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$langs->load("suppliers");
$langs->load("orders");
$langs->load("companies");
$langs->loadLangs(array("suppliers", "orders", "companies"));
// Security check
$socid = GETPOST("socid", 'int');

View File

@ -32,10 +32,7 @@ require DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
require DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
$langs->load('bills');
$langs->load('banks');
$langs->load('companies');
$langs->load("suppliers");
$langs->loadLangs(array('bills', 'banks', 'companies', 'suppliers'));
$id = GETPOST('id','int');
$action = GETPOST('action','alpha');

View File

@ -28,9 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
$langs->load("bills");
$langs->load("suppliers");
$langs->load("companies");
$langs->loadLangs(array("bills", "suppliers", "companies"));
$id = GETPOST('id','int');

View File

@ -25,8 +25,7 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
$langs->load("admin");
$langs->load("ftp");
$langs->loadLangs(array("admin", "ftp"));
// Security check
if (!$user->admin) accessforbidden();

View File

@ -36,8 +36,7 @@ $err=0;
$setuplang=GETPOST("selectlang",'',3)?GETPOST("selectlang",'',3):(isset($_GET["lang"])?$_GET["lang"]:'auto');
$langs->setDefaultLang($setuplang);
$langs->load("install");
$langs->load("errors");
$langs->loadLangs(array("install", "errors"));
dolibarr_install_syslog("- fileconf: entering fileconf.php page");

View File

@ -36,9 +36,7 @@ $action=GETPOST('action','aZ09')?GETPOST('action','aZ09'):(empty($argv[1])?'':$a
$setuplang=GETPOST('selectlang','aZ09',3)?GETPOST('selectlang','aZ09',3):(empty($argv[2])?'auto':$argv[2]);
$langs->setDefaultLang($setuplang);
$langs->load("admin");
$langs->load("install");
$langs->load("errors");
$langs->loadLangs(array("admin", "install", "errors"));
// Dolibarr pages directory
$main_dir = GETPOST('main_dir')?GETPOST('main_dir'):(empty($argv[3])?'':$argv[3]);

View File

@ -46,8 +46,7 @@ $action=GETPOST('action','aZ09')?GETPOST('action','aZ09'):(empty($argv[1])?'':$a
$setuplang=GETPOST('selectlang','aZ09',3)?GETPOST('selectlang','aZ09',3):(empty($argv[2])?'auto':$argv[2]);
$langs->setDefaultLang($setuplang);
$langs->load("admin");
$langs->load("install");
$langs->loadLangs(array("admin", "install"));
$choix=0;
if ($dolibarr_main_db_type == "mysqli") $choix=1;

View File

@ -35,8 +35,7 @@ global $langs;
$setuplang=GETPOST('selectlang','aZ09',3)?GETPOST('selectlang','aZ09',3):(empty($argv[1])?'auto':$argv[1]);
$langs->setDefaultLang($setuplang);
$langs->load("admin");
$langs->load("install");
$langs->loadLangs(array("admin", "install"));
// Now we load forced value from install.forced.php file.
$useforcedwizard=false;

View File

@ -52,8 +52,7 @@ if (! empty($action) && preg_match('/upgrade/i', $action)) // If it's an old upg
}
}
$langs->load("admin");
$langs->load("install");
$langs->loadLangs(array("admin", "install"));
$login = GETPOST('login', 'alpha')?GETPOST('login', 'alpha'):(empty($argv[5])?'':$argv[5]);
$pass = GETPOST('pass', 'alpha')?GETPOST('pass', 'alpha'):(empty($argv[6])?'':$argv[6]);

View File

@ -66,10 +66,7 @@ $versionto=GETPOST("versionto",'alpha',3)?GETPOST("versionto",'',3):(empty($argv
$dirmodule=((GETPOST("dirmodule",'alpha',3) && GETPOST("dirmodule",'alpha',3) != 'ignoredbversion'))?GETPOST("dirmodule",'alpha',3):((empty($argv[3]) || $argv[3] == 'ignoredbversion')?'':$argv[3]);
$ignoredbversion=(GETPOST('ignoredbversion','alpha',3)=='ignoredbversion')?GETPOST('ignoredbversion','alpha',3):((empty($argv[3]) || $argv[3] != 'ignoredbversion')?'':$argv[3]);
$langs->load("admin");
$langs->load("install");
$langs->load("other");
$langs->load("errors");
$langs->loadLangs(array("admin", "install", "other", "errors"));
if ($dolibarr_main_db_type == "mysqli") $choix=1;
if ($dolibarr_main_db_type == "pgsql") $choix=2;

View File

@ -73,10 +73,7 @@ $versionfrom=GETPOST("versionfrom",'alpha',3)?GETPOST("versionfrom",'alpha',3):(
$versionto=GETPOST("versionto",'alpha',3)?GETPOST("versionto",'alpha',3):(empty($argv[2])?'':$argv[2]);
$enablemodules=GETPOST("enablemodules",'alpha',3)?GETPOST("enablemodules",'alpha',3):(empty($argv[3])?'':$argv[3]);
$langs->load('admin');
$langs->load('install');
$langs->load("bills");
$langs->load("suppliers");
$langs->loadLangs(array("admin", "install", "bills", "suppliers"));
if ($dolibarr_main_db_type == 'mysqli') $choix=1;
if ($dolibarr_main_db_type == 'pgsql') $choix=2;

View File

@ -204,6 +204,7 @@ UnvalidateBill=Unvalidate invoice
NumberOfBills=No. of invoices
NumberOfBillsByMonth=No. of invoices per month
AmountOfBills=Amount of invoices
AmountOfBillsHT=Amount of invoices (net of tax)
AmountOfBillsByMonthHT=Amount of invoices by month (net of tax)
ShowSocialContribution=Show social/fiscal tax
ShowBill=Show invoice

View File

@ -29,10 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php";
$langs->load("admin");
$langs->load("bills");
$langs->load("margins");
$langs->load("stocks");
$langs->loadLangs(array("admin", "bills", "margins", "stocks"));
if (! $user->admin) accessforbidden();

View File

@ -26,10 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$langs->load("companies");
$langs->load("bills");
$langs->load("products");
$langs->load("margins");
$langs->loadLangs(array("companies", "bills", "products", "margins"));
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');

View File

@ -26,10 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$langs->load("companies");
$langs->load("bills");
$langs->load("products");
$langs->load("margins");
$langs->loadLangs(array("companies", "bills", "products", "margins"));
// Security check
$socid = GETPOST('socid','int');

View File

@ -58,9 +58,9 @@ class modMyModule extends DolibarrModules
// Gives the possibility to the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this)
//$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily")));
// Module label (no space allowed), used if translation string 'ModuleMyModuleName' not found (MyModue is name of module).
// Module label (no space allowed), used if translation string 'ModuleMyModuleName' not found (MyModule is name of module).
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description, used if translation string 'ModuleMyModuleDesc' not found (MyModue is name of module).
// Module description, used if translation string 'ModuleMyModuleDesc' not found (MyModule is name of module).
$this->description = "MyModuleDescription";
// Used only if file README.md and README-LL.md not found.
$this->descriptionlong = "MyModuleDescription (Long)";
@ -71,8 +71,8 @@ class modMyModule extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
$this->version = '1.0';
//Url to the file with your last numberversion of this module
$this->url_last_version = 'http://www.example.com/versionmodule.txt';
//Url to the file with your last numberversion of this module
$this->url_last_version = 'http://www.example.com/versionmodule.txt';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Name of image file used for this module.

View File

@ -352,7 +352,7 @@ print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$newcardbutton='';
//if ($user->rights->mymodule->creer)
//{
$newcardbutton='<a class="butActionNew" href="card.php?action=create"><span class="valignmiddle">'.$langs->trans('New').'</span>';
$newcardbutton='<a class="butActionNew" href="card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']).'"><span class="valignmiddle">'.$langs->trans('New').'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
//}

View File

@ -30,8 +30,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$langs->load("project");
$langs->load("admin");
$langs->loadLangs(array("project", "admin"));
$extrafields = new ExtraFields($db);
$form = new Form($db);

View File

@ -548,11 +548,8 @@ if (! $showdatefilter)
// Show balance for whole project
$langs->load("suppliers");
$langs->load("bills");
$langs->load("orders");
$langs->load("proposals");
$langs->load("margins");
$langs->loadLangs(array("suppliers", "bills", "orders", "proposals", "margins"));
if (!empty($conf->stock->enabled)) $langs->load('stocks');
print load_fiche_titre($langs->trans("Profit"), '', 'title_accountancy');

View File

@ -44,8 +44,7 @@ dol_include_once("/cron/class/cronjob.class.php");
global $langs, $conf;
// Language Management
$langs->load("admin");
$langs->load("cron");
$langs->loadLangs(array("admin", "cron"));
/*
* View

View File

@ -30,9 +30,7 @@ define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
require '../../main.inc.php';
require_once '../../core/lib/functions2.lib.php';
$langs->load("main");
$langs->load("install");
$langs->load("other");
$langs->loadLangs(array("main", "install", "other"));
$conf->dol_hide_topmenu=GETPOST('dol_hide_topmenu','int');
$conf->dol_hide_leftmenu=GETPOST('dol_hide_leftmenu','int');

View File

@ -53,8 +53,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
global $user, $conf, $langs;
$langs->load("main");
$langs->load("mails");
$langs->loadLangs(array("main", "mails"));
$tag=GETPOST('tag');
$unsuscrib=GETPOST('unsuscrib');

View File

@ -43,10 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
if (empty($conf->adherent->enabled)) accessforbidden('',0,0,1);
$langs->load("main");
$langs->load("members");
$langs->load("companies");
$langs->load("other");
$langs->loadLangs(array("main", "members", "companies", "other"));
$id=GETPOST('id','int');
$object = new Adherent($db);

View File

@ -40,10 +40,7 @@ require '../../main.inc.php';
if (empty($conf->adherent->enabled)) accessforbidden('',0,0,1);
$langs->load("main");
$langs->load("members");
$langs->load("companies");
$langs->load("other");
$langs->loadLangs(array("main", "members", "companies", "other"));
/**

View File

@ -44,13 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
// Security check
// No check on module enabled. Done later according to $validpaymentmethod
$langs->load("main");
$langs->load("other");
$langs->load("dict");
$langs->load("bills");
$langs->load("companies");
$langs->load("errors");
$langs->load("paybox"); // File with generic data
$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox"));
$action=GETPOST('action','alpha');

View File

@ -39,15 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
// Security check
if (empty($conf->paybox->enabled)) accessforbidden('',0,0,1);
$langs->load("main");
$langs->load("other");
$langs->load("dict");
$langs->load("bills");
$langs->load("companies");
$langs->load("paybox");
$langs->load("paypal");
$langs->load("stripe");
$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "paybox", "paypal", "stripe"));
$object = new stdClass(); // For triggers

View File

@ -39,14 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
// Security check
if (empty($conf->paybox->enabled)) accessforbidden('',0,0,1);
$langs->load("main");
$langs->load("other");
$langs->load("dict");
$langs->load("bills");
$langs->load("companies");
$langs->load("paybox");
$langs->load("paypal");
$langs->load("stripe");
$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "paybox", "paypal", "stripe"));
/*$source=GETPOST('source');
$ref=GETPOST('ref');

View File

@ -44,14 +44,7 @@ if (! empty($conf->paypal->enabled))
require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypalfunctions.lib.php';
}
$langs->load("main");
$langs->load("other");
$langs->load("dict");
$langs->load("bills");
$langs->load("companies");
$langs->load("paybox");
$langs->load("paypal");
$langs->load("stripe");
$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "paybox", "paypal", "stripe"));
if (! empty($conf->paypal->enabled))
{

View File

@ -43,14 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
// Security check
if (empty($conf->paypal->enabled)) accessforbidden('',0,0,1);
$langs->load("main");
$langs->load("other");
$langs->load("dict");
$langs->load("bills");
$langs->load("companies");
$langs->load("paybox");
$langs->load("paypal");
$langs->load("stripe");
$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "paybox", "paypal", "stripe"));
$PAYPALTOKEN=GETPOST('TOKEN');
if (empty($PAYPALTOKEN)) $PAYPALTOKEN=GETPOST('token');

View File

@ -36,14 +36,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
$langs->load("main");
$langs->load("other");
$langs->load("dict");
$langs->load("bills");
$langs->load("companies");
$langs->load("paybox");
$langs->load("paypal");
$langs->load("stripe");
$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "paybox", "paypal", "stripe"));
$FULLTAG=GETPOST('FULLTAG');
if (empty($FULLTAG)) $FULLTAG=GETPOST('fulltag');

View File

@ -36,13 +36,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
$langs->load("main");
$langs->load("other");
$langs->load("dict");
$langs->load("bills");
$langs->load("companies");
$langs->load("paybox");
$langs->load("paypal");
$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "paybox", "paypal"));
$FULLTAG=GETPOST('FULLTAG');
if (empty($FULLTAG)) $FULLTAG=GETPOST('fulltag');

175
htdocs/resource/agenda.php Normal file
View File

@ -0,0 +1,175 @@
<?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Brice Davoleau <brice.davoleau@gmail.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Florain Henry <florian.henry@open-concept.pro
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/product/agenda.php
* \ingroup product
* \brief Page of product events
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/resource.lib.php';
require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php';
// Load translation files required by the page
$langs->load("companies");
if (GETPOST('actioncode','array'))
{
$actioncode=GETPOST('actioncode','array',3);
if (! count($actioncode)) $actioncode='0';
}
else
{
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
}
$search_agenda_label=GETPOST('search_agenda_label');
// Security check
$id = GETPOST('id','int');
$ref = GETPOST('ref', 'alpha');
if ($user->societe_id) $id=$user->societe_id;
// Protection if external user
if ($user->socid > 0)
{
accessforbidden();
}
if( ! $user->rights->resource->read)
{
accessforbidden();
}
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortfield) $sortfield='a.datep,a.id';
if (! $sortorder) $sortorder='DESC,DESC';
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('agendaresource'));
/*
* Actions
*/
$parameters=array('id'=>$id);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
// Cancel
if (GETPOST('cancel','alpha') && ! empty($backtopage))
{
header("Location: ".$backtopage);
exit;
}
// Purge search criteria
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
{
$actioncode='';
$search_agenda_label='';
}
}
/*
* View
*/
$contactstatic = new Contact($db);
$form = new Form($db);
if ($id > 0 || $ref)
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$langs->load("companies");
$object = new Dolresource($db);
$result = $object->fetch($id);
$title=$langs->trans("Agenda");
if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/productnameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->ref." - ".$title;
llxHeader('',$title);
if (! empty($conf->notification->enabled)) $langs->load("mails");
$type = $langs->trans('ResourceSingular');
$head = resource_prepare_head($object);
$titre=$langs->trans("ResourceSingular");
dol_fiche_head($head, 'agenda', $titre, -1, $picto);
$linkback = '<a href="'.DOL_URL_ROOT.'/resource/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
$shownav = 1;
if ($user->societe_id && ! in_array('resource', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'id', $linkback, $shownav, 'id');
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '</div>';
dol_fiche_end();
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
{
print '<br>';
$param='&id='.$id;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
print_barre_liste($langs->trans("ActionsOnResource"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlcenter, '', 0, 1, 1);
// List of all actions
$filters=array();
$filters['search_agenda_label']=$search_agenda_label;
// TODO Replace this with same code than into list.php
show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '', $filters, $sortfield, $sortorder);
}
}
// End of page
llxFooter();
$db->close();

View File

@ -28,8 +28,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$langs->load("companies");
$langs->load("admin");
$langs->loadLangs(array("companies", "admin"));
$extrafields = new ExtraFields($db);
$form = new Form($db);

View File

@ -29,8 +29,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
$langs->load("admin");
$langs->load('other');
$langs->loadLangs(array("admin", "other"));
$action=GETPOST('action','alpha');
$value=GETPOST('value','alpha');

View File

@ -28,9 +28,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$langs->load("companies");
$langs->load("admin");
$langs->load("members");
$langs->loadLangs(array("companies", "admin", "members"));
$extrafields = new ExtraFields($db);
$form = new Form($db);

View File

@ -32,9 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
$langs->load("companies");
$langs->load('other');
$langs->loadLangs(array("companies", "other"));
$action=GETPOST('action','aZ09');
$confirm=GETPOST('confirm');

View File

@ -30,10 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Notification.class.php';
$langs->load("companies");
$langs->load("mails");
$langs->load("admin");
$langs->load("other");
$langs->loadLangs(array("companies", "mails", "admin", "other"));
$socid = GETPOST("socid",'int');
$action = GETPOST('action','aZ09');

View File

@ -23,8 +23,7 @@
*/
require '../../main.inc.php';
$langs->load("companies");
$langs->load("banks");
$langs->loadLangs(array("companies", "banks"));
// S<>curit<69> acc<63>s client
if ($user->societe_id > 0)

View File

@ -38,9 +38,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
$prodcustprice = new Productcustomerprice($db);
}
$langs->load("products");
$langs->load("companies");
$langs->load("bills");
$langs->loadLangs(array("products", "companies", "bills"));
$action = GETPOST('action', 'alpha');
$search_prod = GETPOST('search_prod','alpha');

View File

@ -31,8 +31,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$langs->load("companies");
$langs->load("projects");
$langs->loadLangs(array("companies", "projects"));
// Security check
$socid = GETPOST('socid','int');

View File

@ -32,8 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$langs->load("orders");
$langs->load("companies");
$langs->loadLangs(array("orders", "companies"));
$id=GETPOST('id','int')?GETPOST('id','int'):GETPOST('socid','int');
$ref=GETPOST('ref','alpha');

View File

@ -34,9 +34,7 @@ if ($pos == '/') $pos = ''; // si $pos vaut /, on le met a ''
if (! defined('DOL_URL_ROOT'))
define('DOL_URL_ROOT', $pos); // URL racine relative
$langs->load("other");
$langs->load("help");
$langs->loadLangs(array("other", $langs->load("help")));
/*
* View

View File

@ -30,9 +30,7 @@ if ($pos == '/') $pos = ''; // si $pos vaut /, on le met a ''
define('DOL_URL_ROOT', $pos); // URL racine relative
$langs->load("other");
$langs->load("help");
$langs->loadLangs(array("other", "help"));
/*
* View

View File

@ -32,10 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
$langs->load("main");
$langs->load("categories");
$langs->load("takepos");
$langs->load("printing");
$langs->loadLangs(array("main"), "categories", "takepos", "printing");
if (! $user->rights->categorie->lire) accessforbidden();

View File

@ -37,9 +37,7 @@ if (! empty($_REQUEST['CASHDESK_ID_THIRDPARTY_id']))
// Security check
if (!$user->admin) accessforbidden();
$langs->load("admin");
$langs->load("cashdesk");
$langs->loadLangs(array("admin", "cashdesk"));
/*
* Actions

View File

@ -27,8 +27,7 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
require '../main.inc.php'; // Load $user and permissions
$langs->load("bills");
$langs->load("cashdesk");
$langs->loadLangs(array("bills", "cashdesk"));
$place = GETPOST('place','int');

View File

@ -29,8 +29,7 @@ require '../main.inc.php'; // Load $user and permissions
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
$langs->load("bills");
$langs->load("cashdesk");
$langs->loadLangs(array("bills", "cashdesk"));
$id = GETPOST('id','int');
$action = GETPOST('action','alpha');

View File

@ -49,9 +49,7 @@ else{
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
$langs->load("main");
$langs->load("bills");
$langs->load("cashdesk");
$langs->loadLangs(array("main", "bills", "cashdesk"));
?>
<link rel="stylesheet" href="css/pos.css">
<script>

View File

@ -21,9 +21,7 @@
require '../main.inc.php'; // Load $user and permissions
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$langs->load("main");
$langs->load('cashdesk');
$langs->loadLangs(array("main", "cashdesk"));
/*
* View

View File

@ -25,8 +25,7 @@ require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductAttributeValue.class.php'
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination2ValuePair.class.php';
$langs->load("products");
$langs->load("other");
$langs->loadLangs(array("products", "other"));
$var = false;
$id = GETPOST('id', 'int');

View File

@ -24,8 +24,7 @@ require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductAttributeValue.class.php'
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination2ValuePair.class.php';
$langs->load("products");
$langs->load('other');
$langs->loadLangs(array("products", "other"));
$id = GETPOST('id', 'int');
$ref = GETPOST('ref');

View File

@ -29,10 +29,7 @@ require_once $path."../../htdocs/master.inc.php";
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$langs->load("companies");
$langs->load("compta");
$langs->load("main");
$langs->load("accountancy");
$langs->loadLangs(array("companies", "compta", "main", "accountancy"));
// Security check
if (!$user->admin)

View File

@ -53,9 +53,7 @@ $targettype=$argv[2];
require $path."../../htdocs/master.inc.php";
require_once DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php";
$langs->load('main');
$langs->load('contracts');
$langs->loadLangs(array('main', 'contracts'));
// Global variables
$version=DOL_VERSION;

View File

@ -51,9 +51,7 @@ $mode=$argv[1];
require $path."../../htdocs/master.inc.php";
require_once DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php";
$langs->load('main');
$langs->load('contracts');
$langs->loadLangs(array('main', 'contracts'));
// Global variables
$version=DOL_VERSION;

View File

@ -40,9 +40,7 @@ require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php";
require_once DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php";
require_once DOL_DOCUMENT_ROOT."/adherents/class/subscription.class.php";
$langs->load("main");
$langs->load("errors");
$langs->loadLangs(array("main", "errors"));
// Global variables
$version=DOL_VERSION;

View File

@ -41,9 +41,7 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php";
require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php";
require_once DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php";
$langs->load("main");
$langs->load("errors");
$langs->loadLangs(array("main", "errors"));
// Global variables
$version=DOL_VERSION;

View File

@ -41,9 +41,7 @@ require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php";
require_once DOL_DOCUMENT_ROOT."/user/class/user.class.php";
require_once DOL_DOCUMENT_ROOT."/user/class/usergroup.class.php";
$langs->load("main");
$langs->load("errors");
$langs->loadLangs(array("main", "errors"));
// Global variables
$version=DOL_VERSION;

View File

@ -39,9 +39,7 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php";
require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php";
require_once DOL_DOCUMENT_ROOT."/user/class/user.class.php";
$langs->load("main");
$langs->load("errors");
$langs->loadLangs(array("main", "errors"));
// Global variables
$version=DOL_VERSION;