Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
368efc77e0
22
.gitattributes
vendored
Normal file
22
.gitattributes
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
# Set default behaviour, in case users don't have core.autocrlf set.
|
||||
* text=auto
|
||||
|
||||
|
||||
# Explicitly declare text files we want to always be normalized and converted
|
||||
# to native line endings on checkout.
|
||||
*.php text eol=lf
|
||||
*.sql text eol=lf
|
||||
*.htm text eol=lf
|
||||
*.html text eol=lf
|
||||
*.js text eol=lf
|
||||
*.css text eol=lf
|
||||
*.lang text eol=lf
|
||||
*.txt text eol=lf
|
||||
*.md text eol=lf
|
||||
|
||||
# Denote all files that are truly binary and should not be modified.
|
||||
*.ico binary
|
||||
*.png binary
|
||||
*.jpg binary
|
||||
*.odt binary
|
||||
*.odf binary
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -14,3 +14,4 @@ doxygen_warnings.log
|
||||
/.project
|
||||
.DS_Store
|
||||
.idea
|
||||
*.iml
|
||||
|
||||
29
ChangeLog
29
ChangeLog
@ -4,16 +4,21 @@ English Dolibarr ChangeLog
|
||||
|
||||
***** ChangeLog for 3.5 compared to 3.4 *****
|
||||
For users:
|
||||
- New: [ task #877 ] Reorganize menus
|
||||
- New: [ task #858 ] Holiday module: note on manual holiday assignation
|
||||
- New: [ task #892 ] Add option in thridparty customer/supplier admin to hide non active in select_company method
|
||||
- New: [ task #531 ] Add a workload on tasks
|
||||
- New: [ task #877 ] Reorganize menus.
|
||||
- New: [ task #858 ] Holiday module: note on manual holiday assignation.
|
||||
- New: [ task #892 ] Add option in thridparty customer/supplier admin to hide non active in select_company method.
|
||||
- New: [ task #531 ] Add a workload on tasks.
|
||||
- New: Add graph of bank account input/output into input-output report page.
|
||||
- New: Add script export-bank-receipts.
|
||||
- New: Add option "filter=bank" onto script rebuild_merge_pdf.php to merge
|
||||
- New: Add option "filter=bank" onto script rebuild_merge_pdf.php to merge.
|
||||
PDF that has one payment on a specific bank account.*
|
||||
- New: [ task #901 ] Add Extrafeild on Fiche Inter
|
||||
- New: Show process id in all command line scripts
|
||||
- New: [ task #901 ] Add Extrafeild on Fiche Inter.
|
||||
- New: Show process id in all command line scripts.
|
||||
- New: Module mailman can subscribe/unsubscribe to ML according to categories of member.
|
||||
|
||||
For translators:
|
||||
- Normalized sort order of all languages files with english ref file.
|
||||
|
||||
For developers:
|
||||
- New: DolGraph can build graph with three lines.
|
||||
|
||||
@ -104,10 +109,12 @@ WARNING: If you used external modules, some of them may need to be upgraded due
|
||||
- If module use hook pdf_writelinedesc, module may have to add return 1 at end of
|
||||
function to keep same behaviour.
|
||||
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 3.3.3 compared to 3.3.2 *****
|
||||
- Fix: [ bug #903 ] Fatal error: Call to undefined function dol_get_first_day() in htdocs/commande/liste.php
|
||||
|
||||
***** ChangeLog for 3.3.2 compared to 3.3.1 *****
|
||||
|
||||
- Fix: Dutch (nl_NL) translation
|
||||
- Generalize fix: file with a specific mask not found, again
|
||||
- Fix: translations and BILL_SUPPLIER_BUILDDOC trigger
|
||||
@ -136,8 +143,8 @@ WARNING: If you used external modules, some of them may need to be upgraded due
|
||||
- Fix: [ bug #788 ] Date of linked interventions are not shown
|
||||
- Fix: external users should not see costprice and margin infos
|
||||
- Fix: [ bug #806 ] Tasks are ordered alphabetically instead of chronological order
|
||||
***** ChangeLog for 3.3.1 compared to 3.3 *****
|
||||
|
||||
***** ChangeLog for 3.3.1 compared to 3.3 *****
|
||||
- Fix: [ bug #733 ] Mass emailing tools do not support <style HTML tag
|
||||
- Fix: Package for launchpad
|
||||
- Fix: [ bug #736 ] Missing column in llx_c_chargesociales
|
||||
@ -145,8 +152,6 @@ WARNING: If you used external modules, some of them may need to be upgraded due
|
||||
- Fix: [ bug #762 ] Bad profit calculation in Reporting
|
||||
- Fix: bug dictionnary with wrong prefix table
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 3.3 compared to 3.2.3 *****
|
||||
For users:
|
||||
- New: Add holiday module, to declare and follow holidays of your employees.
|
||||
|
||||
@ -528,7 +528,7 @@ if ($rowid)
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Name
|
||||
// Lastname
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$object->lastname.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -536,6 +536,9 @@ if ($rowid)
|
||||
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur">'.$object->firstname.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// EMail
|
||||
print '<tr><td>'.$langs->trans("EMail").'</td><td class="valeur">'.dol_print_email($object->email,0,$object->fk_soc,1).'</td></tr>';
|
||||
|
||||
// Status
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td class="valeur">'.$object->getLibStatut(4).'</td></tr>';
|
||||
|
||||
|
||||
@ -1504,7 +1504,7 @@ class Adherent extends CommonObject
|
||||
$langs->load("dict");
|
||||
|
||||
$code=$this->civilite_id;
|
||||
return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civilite", "code", "civilite", $code);
|
||||
return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civilite", "code", "civilite", $code);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1531,11 +1531,11 @@ class Adherent extends CommonObject
|
||||
$lien = '<a href="'.DOL_URL_ROOT.'/adherents/card_subscriptions.php?rowid='.$this->id.'">';
|
||||
$lienfin='</a>';
|
||||
}
|
||||
if ($option == 'category')
|
||||
{
|
||||
$lien = '<a href="'.DOL_URL_ROOT.'/categories/categorie.php?id='.$this->id.'&type=3">';
|
||||
$lienfin='</a>';
|
||||
}
|
||||
if ($option == 'category')
|
||||
{
|
||||
$lien = '<a href="'.DOL_URL_ROOT.'/categories/categorie.php?id='.$this->id.'&type=3">';
|
||||
$lienfin='</a>';
|
||||
}
|
||||
|
||||
$picto='user';
|
||||
$label=$langs->trans("ShowMember");
|
||||
|
||||
@ -49,8 +49,8 @@ $backtopage=GETPOST('backtopage','alpha');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$rowid=GETPOST('rowid','int');
|
||||
$typeid=GETPOST('typeid','int');
|
||||
$userid=GETPOST('userid','int');
|
||||
$socid=GETPOST('socid','int');
|
||||
$userid=GETPOST('userid','int');
|
||||
$socid=GETPOST('socid','int');
|
||||
|
||||
if (! empty($conf->mailmanspip->enabled))
|
||||
{
|
||||
@ -249,16 +249,16 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
|
||||
$lastname=$_POST["lastname"];
|
||||
$firstname=$_POST["firstname"];
|
||||
$morphy=$morphy=$_POST["morphy"];;
|
||||
if ($morphy != 'mor' && empty($lastname)) {
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname"))."<br>\n";
|
||||
}
|
||||
if ($morphy != 'mor' && (!isset($firstname) || $firstname=='')) {
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname"))."<br>\n";
|
||||
}
|
||||
if ($morphy != 'mor' && empty($lastname)) {
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname"))."<br>\n";
|
||||
}
|
||||
if ($morphy != 'mor' && (!isset($firstname) || $firstname=='')) {
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname"))."<br>\n";
|
||||
}
|
||||
|
||||
// Create new object
|
||||
if ($result > 0 && ! $error)
|
||||
@ -383,7 +383,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
|
||||
else
|
||||
{
|
||||
setEventMessage($object->mesgs, 'mesgs');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$rowid=$object->id;
|
||||
@ -715,7 +715,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
||||
{
|
||||
$object = new Adherent($db);
|
||||
$result=$object->fetch($rowid);
|
||||
if ($result <= 0) dol_print_error('',$object->error);
|
||||
if ($result <= 0) dol_print_error('',$object->error);
|
||||
}
|
||||
$objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates
|
||||
$objcanvas->display_canvas($action); // Show template
|
||||
@ -829,6 +829,9 @@ else
|
||||
print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" size="40" value="'.(GETPOST('firstname','alpha')?GETPOST('firstname','alpha'):$object->firstname).'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// EMail
|
||||
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED?'<span class="fieldrequired">':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'</span>':'').'</td><td><input type="text" name="member_email" size="40" value="'.(GETPOST('member_email','alpha')?GETPOST('member_email','alpha'):$object->email).'"></td></tr>';
|
||||
|
||||
// Password
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||
{
|
||||
@ -882,9 +885,6 @@ else
|
||||
// Tel mobile
|
||||
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(GETPOST('phone_mobile','alpha')?GETPOST('phone_mobile','alpha'):$object->phone_mobile).'"></td></tr>';
|
||||
|
||||
// EMail
|
||||
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED?'<span class="fieldrequired">':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'</span>':'').'</td><td><input type="text" name="member_email" size="40" value="'.(GETPOST('member_email','alpha')?GETPOST('member_email','alpha'):$object->email).'"></td></tr>';
|
||||
|
||||
// Birthday
|
||||
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
|
||||
$form->select_date(($object->naiss ? $object->naiss : -1),'naiss','','',1,'formsoc');
|
||||
@ -1076,6 +1076,9 @@ else
|
||||
print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" size="40" value="'.(isset($_POST["firstname"])?$_POST["firstname"]:$object->firstname).'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// EMail
|
||||
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED?'<span class="fieldrequired">':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'</span>':'').'</td><td><input type="text" name="email" size="40" value="'.(isset($_POST["email"])?$_POST["email"]:$object->email).'"></td></tr>';
|
||||
|
||||
// Password
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||
{
|
||||
@ -1118,9 +1121,6 @@ else
|
||||
// Tel mobile
|
||||
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(isset($_POST["phone_mobile"])?$_POST["phone_mobile"]:$object->phone_mobile).'"></td></tr>';
|
||||
|
||||
// EMail
|
||||
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED?'<span class="fieldrequired">':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'</span>':'').'</td><td><input type="text" name="email" size="40" value="'.(isset($_POST["email"])?$_POST["email"]:$object->email).'"></td></tr>';
|
||||
|
||||
// Birthday
|
||||
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
|
||||
$form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
|
||||
@ -1402,13 +1402,16 @@ else
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Name
|
||||
// Lastname
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$object->lastname.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Firstname
|
||||
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur">'.$object->firstname.' </td></tr>';
|
||||
|
||||
// EMail
|
||||
print '<tr><td>'.$langs->trans("EMail").'</td><td class="valeur">'.dol_print_email($object->email,0,$object->fk_soc,1).'</td></tr>';
|
||||
|
||||
// Password
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||
{
|
||||
@ -1442,9 +1445,6 @@ else
|
||||
// Tel mobile
|
||||
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td class="valeur">'.dol_print_phone($object->phone_mobile,$object->country_code,0,$object->fk_soc,1).'</td></tr>';
|
||||
|
||||
// EMail
|
||||
print '<tr><td>'.$langs->trans("EMail").'</td><td class="valeur">'.dol_print_email($object->email,0,$object->fk_soc,1).'</td></tr>';
|
||||
|
||||
// Birthday
|
||||
print '<tr><td>'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth,'day').'</td></tr>';
|
||||
|
||||
|
||||
@ -44,7 +44,8 @@ $year = strftime("%Y", time());
|
||||
$startyear=$year-2;
|
||||
$endyear=$year;
|
||||
|
||||
$langs->load("members");
|
||||
$langs->load("members");
|
||||
$langs->load("companies");
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -23,9 +23,9 @@
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||
|
||||
$graphwidth=DolGraph::getDefaultGraphSizeForStats('width',700);
|
||||
$graphwidth=DolGraph::getDefaultGraphSizeForStats('width',700);
|
||||
$mapratio = 0.5;
|
||||
$graphheight = round($graphwidth * $mapratio);
|
||||
|
||||
@ -44,7 +44,8 @@ $year = strftime("%Y", time());
|
||||
$startyear=$year-2;
|
||||
$endyear=$year;
|
||||
|
||||
$langs->load("members");
|
||||
$langs->load("members");
|
||||
$langs->load("companies");
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -46,7 +46,8 @@ $year = strftime("%Y", time());
|
||||
$startyear=$year-2;
|
||||
$endyear=$year;
|
||||
|
||||
$langs->load("members");
|
||||
$langs->load("members");
|
||||
$langs->load("companies");
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -347,7 +347,7 @@ foreach($boxtoadd as $box)
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel);
|
||||
if (! empty($box->class) && preg_match('/graph_/',$box->class)) print ' ('.$langs->trans("Graph").')';
|
||||
if (! empty($box->class) && preg_match('/graph_/',$box->class)) print ' ('.$langs->trans("Graph").')';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($box->note == '(WarningUsingThisBoxSlowDown)')
|
||||
|
||||
@ -84,11 +84,11 @@ print '<br>';
|
||||
print $langs->trans("ClickToDialUrlDesc").'<br>';
|
||||
print $langs->trans("Example").':<br>http://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__';
|
||||
|
||||
//if (! empty($user->clicktodial_url))
|
||||
//{
|
||||
print '<br>';
|
||||
print info_admin($langs->trans("ValueOverwrittenByUserSetup"));
|
||||
//}
|
||||
//if (! empty($user->clicktodial_url))
|
||||
//{
|
||||
print '<br>';
|
||||
print info_admin($langs->trans("ValueOverwrittenByUserSetup"));
|
||||
//}
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
@ -113,9 +113,9 @@ if (! empty($conf->global->CLICKTODIAL_URL))
|
||||
print '</form>';
|
||||
|
||||
$setupcomplete=1;
|
||||
if (preg_match('/__LOGIN__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_login)) $setupcomplete=0;
|
||||
if (preg_match('/__PASSWORD__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_password)) $setupcomplete=0;
|
||||
if (preg_match('/__PHONEFROM__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_poste)) $setupcomplete=0;
|
||||
if (preg_match('/__LOGIN__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_login)) $setupcomplete=0;
|
||||
if (preg_match('/__PASSWORD__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_password)) $setupcomplete=0;
|
||||
if (preg_match('/__PHONEFROM__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_poste)) $setupcomplete=0;
|
||||
|
||||
if ($setupcomplete)
|
||||
{
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2004 Andre Cianfarani <acianfa@free.fr>
|
||||
@ -44,6 +44,10 @@ if (! $user->admin) accessforbidden();
|
||||
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$type = 'order';
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -114,7 +118,7 @@ else if ($action == 'specimen')
|
||||
}
|
||||
|
||||
// Activate a model
|
||||
else if ($action == 'set')
|
||||
if ($action == 'set')
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
@ -260,14 +264,14 @@ foreach ($dirmodels as $reldir)
|
||||
|
||||
require_once $dir.$file.'.php';
|
||||
|
||||
$module = new $file;
|
||||
$module = new $file($db);
|
||||
|
||||
// Show modules according to features level
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
|
||||
|
||||
if ($module->isEnabled())
|
||||
{
|
||||
// Show modules according to features level
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
|
||||
print $module->info();
|
||||
@ -319,7 +323,7 @@ foreach ($dirmodels as $reldir)
|
||||
print $form->textwithpicto('',$htmltooltip,1,0);
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -327,17 +331,16 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '</table><br>';
|
||||
print "</table><br>\n";
|
||||
|
||||
|
||||
/*
|
||||
* Document templates generators
|
||||
*/
|
||||
|
||||
print_titre($langs->trans("OrdersModelModule"));
|
||||
|
||||
// Load array def with activated templates
|
||||
$type='order';
|
||||
$def = array();
|
||||
$sql = "SELECT nom";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."document_model";
|
||||
|
||||
@ -40,6 +40,9 @@ if (! $user->admin) accessforbidden();
|
||||
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$type='invoice';
|
||||
|
||||
|
||||
/*
|
||||
@ -137,78 +140,40 @@ if ($action == 'setModuleOptions')
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'set')
|
||||
// Activate a model
|
||||
else if ($action == 'set')
|
||||
{
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
|
||||
$type='invoice';
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
|
||||
$sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", ";
|
||||
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
|
||||
$sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null");
|
||||
$sql.= ")";
|
||||
if ($db->query($sql))
|
||||
{
|
||||
|
||||
}
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
|
||||
if ($action == 'del')
|
||||
else if ($action == 'del')
|
||||
{
|
||||
$type='invoice';
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql.= " WHERE nom = '".$db->escape($value)."'";
|
||||
$sql.= " AND type = '".$type."'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
|
||||
if ($db->query($sql))
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
{
|
||||
if ($conf->global->FACTURE_ADDON_PDF == "$value") dolibarr_del_const($db, 'FACTURE_ADDON_PDF',$conf->entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setdoc')
|
||||
// Set default model
|
||||
else if ($action == 'setdoc')
|
||||
{
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
|
||||
$db->begin();
|
||||
|
||||
if (dolibarr_set_const($db, "FACTURE_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||
{
|
||||
$conf->global->FACTURE_ADDON_PDF = $value;
|
||||
}
|
||||
|
||||
// On active le modele
|
||||
$type='invoice';
|
||||
|
||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql_del.= " WHERE nom = '".$db->escape($value)."'";
|
||||
$sql_del.= " AND type = '".$type."'";
|
||||
$sql_del.= " AND entity = ".$conf->entity;
|
||||
dol_syslog("Delete from model table ".$sql_del);
|
||||
$result1=$db->query($sql_del);
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
|
||||
$sql.= " VALUES ('".$value."', '".$type."', ".$conf->entity.", ";
|
||||
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
|
||||
$sql.= (! empty($scandir)?"'".$scandir."'":"null");
|
||||
$sql.= ")";
|
||||
dol_syslog("Insert into model table ".$sql);
|
||||
$result2=$db->query($sql);
|
||||
if ($result1 && $result2)
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog("Error ".$db->lasterror(), LOG_ERR);
|
||||
$db->rollback();
|
||||
}
|
||||
if (dolibarr_set_const($db, "FACTURE_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||
{
|
||||
// La constante qui a ete lue en avant du nouveau set
|
||||
// on passe donc par une variable pour avoir un affichage coherent
|
||||
$conf->global->FACTURE_ADDON_PDF = $value;
|
||||
}
|
||||
|
||||
// On active le modele
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setmod')
|
||||
else if ($action == 'setmod')
|
||||
{
|
||||
// TODO Verifier si module numerotation choisi peut etre active
|
||||
// par appel methode canBeActivated
|
||||
|
||||
@ -22,14 +22,15 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/adherents/admin/mailman.php
|
||||
* \file htdocs/admin/mailman.php
|
||||
* \ingroup mailmanspip
|
||||
* \brief Page to setup the module MailmanSpip (Mailman)
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/mailmanspip.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("members");
|
||||
@ -58,10 +59,10 @@ if ($action == 'update' || $action == 'add')
|
||||
$consttype=$_POST["consttype"][$key];
|
||||
$constnote=$_POST["constnote"][$key];
|
||||
$res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity);
|
||||
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
}
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = '<div class="ok">'.$langs->trans("SetupSaved").'</div>';
|
||||
@ -181,11 +182,12 @@ if (! empty($conf->global->ADHERENT_USE_MAILMAN))
|
||||
print_fiche_titre($langs->trans('MailmanTitle'), $lien,'');
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
// JQuery activity
|
||||
print '<script type="text/javascript">
|
||||
var i1=0;
|
||||
var i2=0;
|
||||
var i3=0;
|
||||
jQuery(document).ready(function(){
|
||||
jQuery("#exampleclick1").click(function(event){
|
||||
if (i1 == 0) { jQuery("#example1").show(); i1=1; }
|
||||
@ -195,7 +197,11 @@ if (! empty($conf->global->ADHERENT_USE_MAILMAN))
|
||||
if (i2 == 0) { jQuery("#example2").show(); i2=1; }
|
||||
else if (i2 == 1) { jQuery("#example2").hide(); i2=0; }
|
||||
});
|
||||
});
|
||||
jQuery("#exampleclick3").click(function(){
|
||||
if (i3 == 0) { jQuery("#example3").show(); i3=1; }
|
||||
else if (i3 == 1) { jQuery("#example3").hide(); i3=0; }
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
|
||||
form_constantes($constantes,1);
|
||||
@ -599,7 +599,7 @@ else
|
||||
|
||||
print '</table>';
|
||||
|
||||
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
|
||||
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA))
|
||||
{
|
||||
print '<br>';
|
||||
/*
|
||||
@ -686,7 +686,7 @@ else
|
||||
$formmail->withtopic=(isset($_POST['subject'])?$_POST['subject']:$langs->trans("Test"));
|
||||
$formmail->withtopicreadonly=0;
|
||||
$formmail->withfile=2;
|
||||
$formmail->withbody=(isset($_POST['message'])?$_POST['message']:($action == 'testhtml'?$langs->trans("PredefinedMailTestHtml"):$langs->trans("PredefinedMailTest")));
|
||||
$formmail->withbody=(isset($_POST['message'])?$_POST['message']:($action == 'testhtml'?$langs->transnoentities("PredefinedMailTestHtml"):$langs->transnoentities("PredefinedMailTest")));
|
||||
$formmail->withbodyreadonly=0;
|
||||
$formmail->withcancel=1;
|
||||
$formmail->withdeliveryreceipt=1;
|
||||
|
||||
@ -193,8 +193,7 @@ if ($action == 'setModuleOptions')
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Activate a model
|
||||
if ($action == 'set')
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
@ -359,16 +358,16 @@ print "</table><br>\n";
|
||||
|
||||
|
||||
/*
|
||||
* Modeles de documents
|
||||
* Document templates generators
|
||||
*/
|
||||
|
||||
print_titre($langs->trans("ProposalsPDFModules"));
|
||||
|
||||
// Defini tableau def de modele propal
|
||||
// Load array def with activated templates
|
||||
$def = array();
|
||||
$sql = "SELECT nom";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql.= " WHERE type = 'propal'";
|
||||
$sql.= " WHERE type = '".$type."'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
@ -390,7 +389,7 @@ else
|
||||
|
||||
print "<table class=\"noborder\" width=\"100%\">\n";
|
||||
print "<tr class=\"liste_titre\">\n";
|
||||
print " <td width=\"140\">".$langs->trans("Name")."</td>\n";
|
||||
print " <td>".$langs->trans("Name")."</td>\n";
|
||||
print " <td>".$langs->trans("Description")."</td>\n";
|
||||
print '<td align="center" width="40">'.$langs->trans("Status")."</td>\n";
|
||||
print '<td align="center" width="40">'.$langs->trans("Default")."</td>\n";
|
||||
|
||||
@ -217,7 +217,7 @@ else
|
||||
{
|
||||
$var=true;
|
||||
|
||||
if (! count($listofmethods)) print '<div class="warning">'.$langs->trans("NoSmsEngine",'<a href="http://www.dolistore.com/search.php?orderby=position&orderway=desc&search_query=smsmanager">DoliStore</a>').'</div>';
|
||||
if (! count($listofmethods)) print '<div class="warning">'.$langs->trans("NoSmsEngine",'<a target="_blank" href="http://www.dolistore.com/search.php?orderby=position&orderway=desc&search_query=smsmanager">DoliStore</a>').'</div>';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
@ -22,14 +22,15 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/adherents/admin/spip.php
|
||||
* \file htdocs/admin/spip.php
|
||||
* \ingroup mailmanspip
|
||||
* \brief Page to setup the module MailmanSpip (SPIP)
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/mailmanspip.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("members");
|
||||
@ -23,8 +23,8 @@
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
$langs->load("admin");
|
||||
|
||||
@ -48,18 +48,18 @@ if (isset($title))
|
||||
|
||||
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
print "\n";
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
print "\n";
|
||||
|
||||
$var=false;
|
||||
|
||||
// Recupere la version de l'OS
|
||||
$phpversion=version_php();
|
||||
print "<tr ".$bc[$var].'><td width="220px">'.$langs->trans("Version")."</td><td>".$phpversion."</td></tr>\n";
|
||||
// Recupere la version de l'OS
|
||||
$phpversion=version_php();
|
||||
print "<tr ".$bc[$var].'><td width="220px">'.$langs->trans("Version")."</td><td>".$phpversion."</td></tr>\n";
|
||||
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
|
||||
|
||||
@ -52,27 +52,27 @@ $template_dir = DOL_DOCUMENT_ROOT.'/core/tpl/';
|
||||
$interfaces = new Interfaces($db);
|
||||
$triggers = $interfaces->getTriggersList(0,'priority');
|
||||
|
||||
print '<table class="noborder">
|
||||
<tr class="liste_titre">
|
||||
<td colspan="2">'.$langs->trans("File").'</td>
|
||||
<td align="center">'.$langs->trans("Active").'</td>
|
||||
<td align="center"> </td>
|
||||
</tr>
|
||||
print '<table class="noborder">
|
||||
<tr class="liste_titre">
|
||||
<td colspan="2">'.$langs->trans("File").'</td>
|
||||
<td align="center">'.$langs->trans("Active").'</td>
|
||||
<td align="center"> </td>
|
||||
</tr>
|
||||
';
|
||||
|
||||
$var=True;
|
||||
foreach ($triggers as $trigger)
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td valign="top" width="14" align="center">'.$trigger['picto'].'</td>';
|
||||
print '<td valign="top">'.$trigger['file'].'</td>';
|
||||
print '<td valign="top" align="center">'.$trigger['status'].'</td>';
|
||||
print '<td valign="top">'.$form->textwithpicto('', $trigger['info']).'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
$var=True;
|
||||
foreach ($triggers as $trigger)
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td valign="top" width="14" align="center">'.$trigger['picto'].'</td>';
|
||||
print '<td valign="top">'.$trigger['file'].'</td>';
|
||||
print '<td valign="top" align="center">'.$trigger['status'].'</td>';
|
||||
print '<td valign="top">'.$form->textwithpicto('', $trigger['info']).'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
llxFooter();
|
||||
|
||||
|
||||
@ -103,7 +103,8 @@ print "</tr>\n";
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
|
||||
print '<td colspan="2">';
|
||||
print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',1,1);
|
||||
//print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',1,1);
|
||||
print $form->select_thirdparty($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',0,array(),1);
|
||||
print '</td></tr>';
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
|
||||
@ -372,19 +372,19 @@ class Categorie
|
||||
* Link an object to the category
|
||||
*
|
||||
* @param Object $obj Object to link to category
|
||||
* @param string $type Type of category
|
||||
* @return int 1 : OK, -1 : erreur SQL, -2 : id non renseign, -3 : Already linked
|
||||
* @param string $type Type of category (member, supplier, product, customer)
|
||||
* @return int 1 : OK, -1 : erreur SQL, -2 : id not defined, -3 : Already linked
|
||||
*/
|
||||
function add_type($obj,$type)
|
||||
{
|
||||
if ($this->id == -1)
|
||||
{
|
||||
return -2;
|
||||
}
|
||||
if ($this->id == -1) return -2;
|
||||
if ($type == 'company') $type='societe';
|
||||
if ($type == 'fournisseur') $type='societe';
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_".$type." (fk_categorie, fk_".($type=='fournisseur'?'societe':$type).")";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_".$type." (fk_categorie, fk_".$type.")";
|
||||
$sql .= " VALUES (".$this->id.", ".$obj->id.")";
|
||||
|
||||
dol_syslog(get_class($this).'::add_type sql='.$sql);
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
return 1;
|
||||
@ -956,36 +956,43 @@ class Categorie
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of categories linked to element of type $type with id $typeid
|
||||
* Return list of categories linked to element of id $id and type $typeid
|
||||
*
|
||||
* @param int $id Id of element
|
||||
* @param int $typeid Type id of link (0,1,2,3...)
|
||||
* @return array List of category objects
|
||||
* @param int $id Id of element
|
||||
* @param int $typeid Type of link (0 or 'product', 1 or 'supplier', 2 or 'customer', 3 or 'member', ...)
|
||||
* @param string $mode 'object'=Get array of categories, 'label'=Get array of category labels
|
||||
* @return mixed Array of category objects or < 0 if KO
|
||||
*/
|
||||
function containing($id,$typeid)
|
||||
function containing($id,$typeid,$mode='object')
|
||||
{
|
||||
$cats = array ();
|
||||
$cats = array();
|
||||
|
||||
$table=''; $type='';
|
||||
if ($typeid == 0) { $table='product'; $type='product'; }
|
||||
if ($typeid == 1) { $table='societe'; $type='fournisseur'; }
|
||||
if ($typeid == 2) { $table='societe'; $type='societe'; }
|
||||
if ($typeid == 3) { $table='member'; $type='member'; }
|
||||
if ($typeid == 0 || $typeid == 'product') { $typeid=0; $table='product'; $type='product'; }
|
||||
else if ($typeid == 1 || $typeid == 'supplier') { $typeid=1; $table='societe'; $type='fournisseur'; }
|
||||
else if ($typeid == 2 || $typeid == 'customer') { $typeid=2; $table='societe'; $type='societe'; }
|
||||
else if ($typeid == 3 || $typeid == 'member') { $typeid=3; $table='member'; $type='member'; }
|
||||
|
||||
$sql = "SELECT ct.fk_categorie";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."categorie_".$type." as ct";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON ct.fk_categorie = c.rowid";
|
||||
$sql.= " WHERE ct.fk_".$table." = ".$id." AND c.type = ".$typeid;
|
||||
$sql = "SELECT ct.fk_categorie, c.label";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."categorie_".$type." as ct, ".MAIN_DB_PREFIX."categorie as c";
|
||||
$sql.= " WHERE ct.fk_categorie = c.rowid AND ct.fk_".$table." = ".$id." AND c.type = ".$typeid;
|
||||
$sql.= " AND c.entity IN (".getEntity('category',1).")";
|
||||
|
||||
dol_syslog(get_class($this).'::containing sql='.$sql);
|
||||
$res = $this->db->query($sql);
|
||||
if ($res)
|
||||
{
|
||||
while ($rec = $this->db->fetch_array($res))
|
||||
while ($obj = $this->db->fetch_object($res))
|
||||
{
|
||||
$cat = new Categorie($this->db);
|
||||
$cat->fetch($rec['fk_categorie']);
|
||||
$cats[] = $cat;
|
||||
if ($mode == 'label')
|
||||
{
|
||||
$cats[] = $obj->label;
|
||||
}
|
||||
else {
|
||||
$cat = new Categorie($this->db);
|
||||
$cat->fetch($obj->fk_categorie);
|
||||
$cats[] = $cat;
|
||||
}
|
||||
}
|
||||
|
||||
return $cats;
|
||||
|
||||
@ -127,7 +127,7 @@ else print ' ';
|
||||
//print '</td></tr></table>';
|
||||
print '</div></div></div>';
|
||||
|
||||
print '<div class="fichecenter"><br>';
|
||||
print '<div class="fichecenter"><br>';
|
||||
|
||||
|
||||
// Charge tableau des categories
|
||||
|
||||
@ -36,7 +36,7 @@ $ref=GETPOST('ref');
|
||||
$type=GETPOST('type');
|
||||
$action=GETPOST('action');
|
||||
$confirm=GETPOST('confirm');
|
||||
$removeelem = GETPOST('removeelem','int');
|
||||
$removeelem = GETPOST('removeelem','int');
|
||||
|
||||
if ($id == "")
|
||||
{
|
||||
@ -62,39 +62,39 @@ $type=$object->type;
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// Remove element from category
|
||||
if ($id > 0 && $removeelem > 0)
|
||||
{
|
||||
if ($type==0 && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
$tmpobject = new Product($db);
|
||||
$result = $tmpobject->fetch($removeelem);
|
||||
$elementtype = 'product';
|
||||
}
|
||||
if ($type==1 && $user->rights->societe->creer)
|
||||
{
|
||||
$tmpobject = new Societe($db);
|
||||
$result = $tmpobject->fetch($removeelem);
|
||||
$elementtype = 'fournisseur';
|
||||
}
|
||||
if ($type==2 && $user->rights->societe->creer)
|
||||
{
|
||||
$tmpobject = new Societe($db);
|
||||
$result = $tmpobject->fetch($removeelem);
|
||||
$elementtype = 'societe';
|
||||
}
|
||||
if ($type == 3 && $user->rights->adherent->creer)
|
||||
// Remove element from category
|
||||
if ($id > 0 && $removeelem > 0)
|
||||
{
|
||||
if ($type==0 && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
$tmpobject = new Adherent($db);
|
||||
$result = $tmpobject->fetch($removeelem);
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
$tmpobject = new Product($db);
|
||||
$result = $tmpobject->fetch($removeelem);
|
||||
$elementtype = 'product';
|
||||
}
|
||||
if ($type==1 && $user->rights->societe->creer)
|
||||
{
|
||||
$tmpobject = new Societe($db);
|
||||
$result = $tmpobject->fetch($removeelem);
|
||||
$elementtype = 'fournisseur';
|
||||
}
|
||||
if ($type==2 && $user->rights->societe->creer)
|
||||
{
|
||||
$tmpobject = new Societe($db);
|
||||
$result = $tmpobject->fetch($removeelem);
|
||||
$elementtype = 'societe';
|
||||
}
|
||||
if ($type == 3 && $user->rights->adherent->creer)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
$tmpobject = new Adherent($db);
|
||||
$result = $tmpobject->fetch($removeelem);
|
||||
$elementtype = 'member';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$result=$object->del_type($tmpobject,$elementtype);
|
||||
if ($result < 0) dol_print_error('',$object->error);
|
||||
}
|
||||
if ($result < 0) dol_print_error('',$object->error);
|
||||
}
|
||||
|
||||
if ($user->rights->categorie->supprimer && $action == 'confirm_delete' && $confirm == 'yes')
|
||||
{
|
||||
@ -312,21 +312,21 @@ if ($object->type == 1)
|
||||
print '<td class="nowrap" valign="top">';
|
||||
print $soc->getNomUrl(1,'category_supplier');
|
||||
print "</td>\n";
|
||||
// Link to delete from category
|
||||
print '<td align="right">';
|
||||
$typeid=$object->type;
|
||||
$permission=0;
|
||||
if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer);
|
||||
if ($typeid == 1) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == 2) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == 3) $permission=$user->rights->adherent->creer;
|
||||
if ($permission)
|
||||
{
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removeelem=".$soc->id."'>";
|
||||
print img_delete($langs->trans("DeleteFromCat")).' ';
|
||||
print $langs->trans("DeleteFromCat")."</a>";
|
||||
}
|
||||
print '</td>';
|
||||
// Link to delete from category
|
||||
print '<td align="right">';
|
||||
$typeid=$object->type;
|
||||
$permission=0;
|
||||
if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer);
|
||||
if ($typeid == 1) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == 2) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == 3) $permission=$user->rights->adherent->creer;
|
||||
if ($permission)
|
||||
{
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removeelem=".$soc->id."'>";
|
||||
print img_delete($langs->trans("DeleteFromCat")).' ';
|
||||
print $langs->trans("DeleteFromCat")."</a>";
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
@ -364,20 +364,20 @@ if($object->type == 2)
|
||||
print '<td class="nowrap" valign="top">';
|
||||
print $soc->getNomUrl(1,'category');
|
||||
print "</td>\n";
|
||||
// Link to delete from category
|
||||
print '<td align="right">';
|
||||
$typeid=$object->type;
|
||||
$permission=0;
|
||||
if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer);
|
||||
if ($typeid == 1) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == 2) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == 3) $permission=$user->rights->adherent->creer;
|
||||
if ($permission)
|
||||
{
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removeelem=".$soc->id."'>";
|
||||
print img_delete($langs->trans("DeleteFromCat")).' ';
|
||||
print $langs->trans("DeleteFromCat")."</a>";
|
||||
}
|
||||
// Link to delete from category
|
||||
print '<td align="right">';
|
||||
$typeid=$object->type;
|
||||
$permission=0;
|
||||
if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer);
|
||||
if ($typeid == 1) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == 2) $permission=$user->rights->societe->creer;
|
||||
if ($typeid == 3) $permission=$user->rights->adherent->creer;
|
||||
if ($permission)
|
||||
{
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&type=".$typeid."&removeelem=".$soc->id."'>";
|
||||
print img_delete($langs->trans("DeleteFromCat")).' ';
|
||||
print $langs->trans("DeleteFromCat")."</a>";
|
||||
}
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
@ -334,7 +334,7 @@ class ActionComm extends CommonObject
|
||||
$this->priority = $obj->priority;
|
||||
$this->fulldayevent = $obj->fulldayevent;
|
||||
$this->location = $obj->location;
|
||||
$this->transparency = $obj->transparency;
|
||||
$this->transparency = $obj->transparency;
|
||||
|
||||
$this->socid = $obj->fk_soc; // To have fetch_thirdparty method working
|
||||
$this->societe->id = $obj->fk_soc;
|
||||
@ -476,7 +476,7 @@ class ActionComm extends CommonObject
|
||||
$sql.= ", priority = '".$this->priority."'";
|
||||
$sql.= ", fulldayevent = '".$this->fulldayevent."'";
|
||||
$sql.= ", location = ".($this->location ? "'".$this->db->escape($this->location)."'":"null");
|
||||
$sql.= ", transparency = '".$this->transparency."'";
|
||||
$sql.= ", transparency = '".$this->transparency."'";
|
||||
$sql.= ", fk_user_mod = '".$user->id."'";
|
||||
$sql.= ", fk_user_action=".($this->usertodo->id > 0 ? "'".$this->usertodo->id."'":"null");
|
||||
$sql.= ", fk_user_done=".($this->userdone->id > 0 ? "'".$this->userdone->id."'":"null");
|
||||
|
||||
@ -523,8 +523,8 @@ if ($action == 'create')
|
||||
|
||||
// Busy
|
||||
print '<tr><td width="30%" class="nowrap">'.$langs->trans("Busy").'</td><td>';
|
||||
print '<input id="transparency" type="checkbox" name="transparency" value="'.$actioncomm->transparency.'">';
|
||||
print '</td></tr>';
|
||||
print '<input id="transparency" type="checkbox" name="transparency" value="'.$actioncomm->transparency.'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Realised by
|
||||
if ($conf->global->AGENDA_ENABLE_DONEBY)
|
||||
@ -764,13 +764,13 @@ if ($id > 0)
|
||||
print '</td></tr>';
|
||||
|
||||
// Busy
|
||||
print '<tr><td class="nowrap">'.$langs->trans("Busy").'</td><td>';
|
||||
print '<tr><td class="nowrap">'.$langs->trans("Busy").'</td><td>';
|
||||
print '<input id="transparency" type="checkbox" name="transparency"'.($act->transparency?' checked="checked"':'').'">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
// Realised by
|
||||
if ($conf->global->AGENDA_ENABLE_DONEBY)
|
||||
{
|
||||
if ($conf->global->AGENDA_ENABLE_DONEBY)
|
||||
{
|
||||
print '<tr><td class="nowrap">'.$langs->trans("ActionDoneBy").'</td><td colspan="3">';
|
||||
print $form->select_dolusers($act->userdone->id> 0?$act->userdone->id:-1,'doneby',1);
|
||||
print '</td></tr>';
|
||||
|
||||
@ -76,7 +76,7 @@ $pid=GETPOST("projectid","int",3);
|
||||
$status=GETPOST("status");
|
||||
$type=GETPOST("type");
|
||||
$maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
|
||||
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=="0"?'':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':''));
|
||||
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=="0"?'':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':''));
|
||||
|
||||
if (GETPOST('viewcal')) {
|
||||
$action='show_month'; $day='';
|
||||
@ -1014,17 +1014,17 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
{
|
||||
// Define color index if not yet defined
|
||||
$idusertouse=($event->usertodo->id?$event->usertodo->id:0);
|
||||
if (isset($colorindexused[$idusertouse]))
|
||||
{
|
||||
$colorindex=$colorindexused[$idusertouse]; // Color already assigned to this user
|
||||
}
|
||||
else
|
||||
{
|
||||
$colorindex=$nextindextouse;
|
||||
$colorindexused[$idusertouse]=$colorindex;
|
||||
if (! empty($theme_datacolor[$nextindextouse+1])) $nextindextouse++; // Prepare to use next color
|
||||
}
|
||||
//print '|'.($color).'='.($idusertouse?$idusertouse:0).'='.$colorindex.'<br>';
|
||||
if (isset($colorindexused[$idusertouse]))
|
||||
{
|
||||
$colorindex=$colorindexused[$idusertouse]; // Color already assigned to this user
|
||||
}
|
||||
else
|
||||
{
|
||||
$colorindex=$nextindextouse;
|
||||
$colorindexused[$idusertouse]=$colorindex;
|
||||
if (! empty($theme_datacolor[$nextindextouse+1])) $nextindextouse++; // Prepare to use next color
|
||||
}
|
||||
//print '|'.($color).'='.($idusertouse?$idusertouse:0).'='.$colorindex.'<br>';
|
||||
// Define color
|
||||
$color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
|
||||
}
|
||||
|
||||
@ -249,7 +249,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
|
||||
}
|
||||
|
||||
|
||||
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
$NBMAX=3;
|
||||
|
||||
@ -375,7 +375,7 @@ if ($object->fetch($id) >= 0)
|
||||
if ($search_firstname) $param.= "&search_firstname=".urlencode($search_firstname);
|
||||
if ($search_email) $param.= "&search_email=".urlencode($search_email);
|
||||
|
||||
$cleartext='<br></div><div>'.$langs->trans("ToClearAllRecipientsClickHere").': '.'<input type="submit" name="clearlist" class="button" value="'.$langs->trans("TargetsReset").'">';
|
||||
$cleartext='<br></div><div>'.$langs->trans("ToClearAllRecipientsClickHere").': '.'<input type="submit" name="clearlist" class="button" value="'.$langs->trans("TargetsReset").'">';
|
||||
|
||||
print_barre_liste($langs->trans("MailSelectedRecipients").$cleartext,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,"",$num,$object->nbemail,'');
|
||||
|
||||
|
||||
@ -668,7 +668,7 @@ if ($action == 'create')
|
||||
print '<tr><td width="25%">'.$langs->trans("BackgroundColorByDefault").'</td><td colspan="3">';
|
||||
print $htmlother->selectColor($_POST['bgcolor'],'bgcolor','new_mailing',0);
|
||||
print '</td></tr>';
|
||||
print '<tr><td width="25%" class="fieldrequired" valign="top">'.$langs->trans("MailMessage").'<br>';
|
||||
print '<tr><td width="25%" valign="top"><span class="fieldrequired">'.$langs->trans("MailMessage").'</span><br>';
|
||||
print '<br><i>'.$langs->trans("CommonSubstitutions").':<br>';
|
||||
foreach($object->substitutionarray as $key => $val)
|
||||
{
|
||||
|
||||
@ -1797,10 +1797,10 @@ class Propal extends CommonObject
|
||||
$sql.= " WHERE p.entity = ".$conf->entity;
|
||||
$sql.= " AND p.fk_soc = s.rowid";
|
||||
$sql.= " AND p.fk_statut = c.id";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) //restriction
|
||||
{
|
||||
$sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
}
|
||||
if (! $user->rights->societe->client->voir && ! $socid) //restriction
|
||||
{
|
||||
$sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
}
|
||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||
if ($draft) $sql.= " AND p.fk_statut = 0";
|
||||
if ($notcurrentuser > 0) $sql.= " AND p.fk_user_author <> ".$user->id;
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/stats.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -2026,19 +2026,19 @@ class Commande extends CommonOrder
|
||||
{
|
||||
$obj = $this->db->fetch_object($result);
|
||||
|
||||
if ($shortlist == 1)
|
||||
{
|
||||
$ga[$obj->cid] = $obj->ref;
|
||||
}
|
||||
else if ($shortlist == 2)
|
||||
{
|
||||
$ga[$obj->cid] = $obj->ref.' ('.$obj->name.')';
|
||||
}
|
||||
else
|
||||
{
|
||||
$ga[$i]['id'] = $obj->cid;
|
||||
$ga[$i]['ref'] = $obj->ref;
|
||||
$ga[$i]['name'] = $obj->name;
|
||||
if ($shortlist == 1)
|
||||
{
|
||||
$ga[$obj->cid] = $obj->ref;
|
||||
}
|
||||
else if ($shortlist == 2)
|
||||
{
|
||||
$ga[$obj->cid] = $obj->ref.' ('.$obj->name.')';
|
||||
}
|
||||
else
|
||||
{
|
||||
$ga[$i]['id'] = $obj->cid;
|
||||
$ga[$i]['ref'] = $obj->ref;
|
||||
$ga[$i]['name'] = $obj->name;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/stats.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.commande.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
|
||||
@ -35,10 +35,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
$langs->load("bills");
|
||||
|
||||
$id = (GETPOST('id','int') ? GETPOST('id','int') : GETPOST('account','int'));
|
||||
|
||||
@ -27,10 +27,10 @@
|
||||
require('../../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
$langs->load("bills");
|
||||
|
||||
$action=GETPOST('action');
|
||||
|
||||
@ -23,10 +23,10 @@
|
||||
*/
|
||||
|
||||
require('../../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
|
||||
if (!$user->rights->banque->lire)
|
||||
accessforbidden();
|
||||
|
||||
@ -24,10 +24,10 @@
|
||||
*/
|
||||
|
||||
require('../../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
|
||||
@ -112,8 +112,8 @@ llxHeader();
|
||||
|
||||
print_fiche_titre($langs->trans("Rubriques"));
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -160,7 +160,7 @@ if ($result)
|
||||
$db->free($result);
|
||||
}
|
||||
|
||||
print "</form>";
|
||||
print "</form>";
|
||||
|
||||
/*
|
||||
* Line to add category
|
||||
@ -176,7 +176,7 @@ if ($action != 'edit')
|
||||
|
||||
print "</table>";
|
||||
|
||||
print "</form>";
|
||||
print "</form>";
|
||||
|
||||
llxFooter();
|
||||
|
||||
|
||||
@ -29,10 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbank.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
$langs->load("companies");
|
||||
|
||||
$action=GETPOST("action");
|
||||
|
||||
@ -27,12 +27,12 @@ require('../../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
|
||||
$WIDTH=DolGraph::getDefaultGraphSizeForStats('width',768);
|
||||
$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height',200);
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
|
||||
$WIDTH=DolGraph::getDefaultGraphSizeForStats('width',768);
|
||||
$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height',200);
|
||||
|
||||
// Security check
|
||||
if (isset($_GET["account"]) || isset($_GET["ref"]))
|
||||
|
||||
@ -27,10 +27,10 @@ require('../../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
|
||||
@ -24,10 +24,10 @@
|
||||
require('../../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
$langs->load("companies");
|
||||
|
||||
|
||||
|
||||
@ -31,10 +31,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
$langs->load("bills");
|
||||
|
||||
if (! $user->rights->banque->consolidate) accessforbidden();
|
||||
|
||||
@ -25,16 +25,16 @@
|
||||
|
||||
require('../../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
$langs->load("companies");
|
||||
$langs->load("bills");
|
||||
|
||||
@ -82,14 +82,14 @@ $pagenext = $page + 1;
|
||||
llxHeader();
|
||||
|
||||
$form = new Form($db);
|
||||
$societestatic=new Societe($db);
|
||||
$chargestatic=new ChargeSociales($db);
|
||||
$memberstatic=new Adherent($db);
|
||||
$paymentstatic=new Paiement($db);
|
||||
$paymentsupplierstatic=new PaiementFourn($db);
|
||||
$paymentvatstatic=new TVA($db);
|
||||
$bankstatic=new Account($db);
|
||||
$banklinestatic=new AccountLine($db);
|
||||
$societestatic=new Societe($db);
|
||||
$chargestatic=new ChargeSociales($db);
|
||||
$memberstatic=new Adherent($db);
|
||||
$paymentstatic=new Paiement($db);
|
||||
$paymentsupplierstatic=new PaiementFourn($db);
|
||||
$paymentvatstatic=new TVA($db);
|
||||
$bankstatic=new Account($db);
|
||||
$banklinestatic=new AccountLine($db);
|
||||
|
||||
|
||||
// Load account
|
||||
@ -332,59 +332,59 @@ else
|
||||
if ($links[$key]['type']=='payment')
|
||||
{
|
||||
$paymentstatic->id=$links[$key]['url_id'];
|
||||
$paymentstatic->ref=$langs->trans("Payment");
|
||||
$paymentstatic->ref=$langs->trans("Payment");
|
||||
print ' '.$paymentstatic->getNomUrl(1);
|
||||
$newline=0;
|
||||
}
|
||||
elseif ($links[$key]['type']=='payment_supplier')
|
||||
{
|
||||
$paymentsupplierstatic->id=$links[$key]['url_id'];
|
||||
$paymentsupplierstatic->ref=$langs->trans("Payment");;
|
||||
$paymentsupplierstatic->id=$links[$key]['url_id'];
|
||||
$paymentsupplierstatic->ref=$langs->trans("Payment");;
|
||||
print ' '.$paymentsupplierstatic->getNomUrl(1);
|
||||
$newline=0;
|
||||
}
|
||||
elseif ($links[$key]['type']=='payment_sc')
|
||||
{
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/fiche.php?id='.$links[$key]['url_id'].'">';
|
||||
print ' '.img_object($langs->trans('ShowPayment'),'payment').' ';
|
||||
print $langs->trans("SocialContributionPayment");
|
||||
print '</a>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/fiche.php?id='.$links[$key]['url_id'].'">';
|
||||
print ' '.img_object($langs->trans('ShowPayment'),'payment').' ';
|
||||
print $langs->trans("SocialContributionPayment");
|
||||
print '</a>';
|
||||
$newline=0;
|
||||
}
|
||||
elseif ($links[$key]['type']=='payment_vat')
|
||||
{
|
||||
$paymentvatstatic->id=$links[$key]['url_id'];
|
||||
$paymentvatstatic->ref=$langs->trans("Payment");
|
||||
print ' '.$paymentvatstatic->getNomUrl(2);
|
||||
}
|
||||
elseif ($links[$key]['type']=='payment_vat')
|
||||
{
|
||||
$paymentvatstatic->id=$links[$key]['url_id'];
|
||||
$paymentvatstatic->ref=$langs->trans("Payment");
|
||||
print ' '.$paymentvatstatic->getNomUrl(2);
|
||||
}
|
||||
elseif ($links[$key]['type']=='banktransfert') {
|
||||
// Do not show link to transfer since there is no transfer card (avoid confusion). Can already be accessed from transaction detail.
|
||||
if ($objp->amount > 0)
|
||||
{
|
||||
$banklinestatic->fetch($links[$key]['url_id']);
|
||||
$bankstatic->id=$banklinestatic->fk_account;
|
||||
$bankstatic->label=$banklinestatic->bank_account_label;
|
||||
print ' ('.$langs->trans("from").' ';
|
||||
print $bankstatic->getNomUrl(1,'transactions');
|
||||
print ' '.$langs->trans("toward").' ';
|
||||
$bankstatic->id=$objp->bankid;
|
||||
$bankstatic->label=$objp->bankref;
|
||||
print $bankstatic->getNomUrl(1,'');
|
||||
print ')';
|
||||
}
|
||||
else
|
||||
{
|
||||
$bankstatic->id=$objp->bankid;
|
||||
$bankstatic->label=$objp->bankref;
|
||||
print ' ('.$langs->trans("from").' ';
|
||||
print $bankstatic->getNomUrl(1,'');
|
||||
print ' '.$langs->trans("toward").' ';
|
||||
$banklinestatic->fetch($links[$key]['url_id']);
|
||||
$bankstatic->id=$banklinestatic->fk_account;
|
||||
$bankstatic->label=$banklinestatic->bank_account_label;
|
||||
print $bankstatic->getNomUrl(1,'transactions');
|
||||
print ')';
|
||||
}
|
||||
// Do not show link to transfer since there is no transfer card (avoid confusion). Can already be accessed from transaction detail.
|
||||
if ($objp->amount > 0)
|
||||
{
|
||||
$banklinestatic->fetch($links[$key]['url_id']);
|
||||
$bankstatic->id=$banklinestatic->fk_account;
|
||||
$bankstatic->label=$banklinestatic->bank_account_label;
|
||||
print ' ('.$langs->trans("from").' ';
|
||||
print $bankstatic->getNomUrl(1,'transactions');
|
||||
print ' '.$langs->trans("toward").' ';
|
||||
$bankstatic->id=$objp->bankid;
|
||||
$bankstatic->label=$objp->bankref;
|
||||
print $bankstatic->getNomUrl(1,'');
|
||||
print ')';
|
||||
}
|
||||
else
|
||||
{
|
||||
$bankstatic->id=$objp->bankid;
|
||||
$bankstatic->label=$objp->bankref;
|
||||
print ' ('.$langs->trans("from").' ';
|
||||
print $bankstatic->getNomUrl(1,'');
|
||||
print ' '.$langs->trans("toward").' ';
|
||||
$banklinestatic->fetch($links[$key]['url_id']);
|
||||
$bankstatic->id=$banklinestatic->fk_account;
|
||||
$bankstatic->label=$banklinestatic->bank_account_label;
|
||||
print $bankstatic->getNomUrl(1,'transactions');
|
||||
print ')';
|
||||
}
|
||||
}
|
||||
elseif ($links[$key]['type']=='company') {
|
||||
print '<a href="'.DOL_URL_ROOT.'/societe/soc.php?socid='.$links[$key]['url_id'].'">';
|
||||
|
||||
@ -27,8 +27,8 @@
|
||||
require('../../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/bankcateg.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/bankcateg.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
|
||||
@ -29,10 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
$langs->load("bills");
|
||||
|
||||
// Security check
|
||||
|
||||
@ -26,10 +26,10 @@
|
||||
|
||||
require('../../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
|
||||
if (! $user->rights->banque->transfer)
|
||||
accessforbidden();
|
||||
|
||||
@ -205,7 +205,7 @@ complete_head_from_modules($conf,$langs,null,$head,$h,'trip_stats');
|
||||
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
|
||||
|
||||
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
|
||||
// Show filter box
|
||||
|
||||
@ -2687,7 +2687,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
print $formconfirm;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Invoice content
|
||||
|
||||
|
||||
@ -2660,77 +2660,77 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return list of invoices (eventually filtered on a user) into an array
|
||||
*
|
||||
* @param int $shortlist 0=Return array[id]=ref, 1=Return array[](id=>id,ref=>ref,name=>name)
|
||||
* @param int $draft 0=not draft, 1=draft
|
||||
* @param User $excluser Objet user to exclude
|
||||
* @param int $socid Id third pary
|
||||
* @param int $limit For pagination
|
||||
* @param int $offset For pagination
|
||||
* @param string $sortfield Sort criteria
|
||||
* @param string $sortorder Sort order
|
||||
* @return int -1 if KO, array with result if OK
|
||||
*/
|
||||
function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='f.datef,f.rowid', $sortorder='DESC')
|
||||
{
|
||||
global $conf,$user;
|
||||
|
||||
$ga = array();
|
||||
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.client,";
|
||||
$sql.= " f.rowid as fid, f.facnumber as ref, f.datef as df";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE f.entity = ".$conf->entity;
|
||||
$sql.= " AND f.fk_soc = s.rowid";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) //restriction
|
||||
{
|
||||
$sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
}
|
||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||
if ($draft) $sql.= " AND f.fk_statut = 0";
|
||||
if (is_object($excluser)) $sql.= " AND f.fk_user_author <> ".$excluser->id;
|
||||
$sql.= $this->db->order($sortfield,$sortorder);
|
||||
$sql.= $this->db->plimit($limit,$offset);
|
||||
|
||||
$result=$this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$numc = $this->db->num_rows($result);
|
||||
if ($numc)
|
||||
{
|
||||
$i = 0;
|
||||
while ($i < $numc)
|
||||
{
|
||||
$obj = $this->db->fetch_object($result);
|
||||
|
||||
if ($shortlist == 1)
|
||||
{
|
||||
$ga[$obj->fid] = $obj->ref;
|
||||
}
|
||||
else if ($shortlist == 2)
|
||||
{
|
||||
$ga[$obj->fid] = $obj->ref.' ('.$obj->name.')';
|
||||
}
|
||||
else
|
||||
{
|
||||
$ga[$i]['id'] = $obj->fid;
|
||||
$ga[$i]['ref'] = $obj->ref;
|
||||
$ga[$i]['name'] = $obj->name;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
return $ga;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
/**
|
||||
* Return list of invoices (eventually filtered on a user) into an array
|
||||
*
|
||||
* @param int $shortlist 0=Return array[id]=ref, 1=Return array[](id=>id,ref=>ref,name=>name)
|
||||
* @param int $draft 0=not draft, 1=draft
|
||||
* @param User $excluser Objet user to exclude
|
||||
* @param int $socid Id third pary
|
||||
* @param int $limit For pagination
|
||||
* @param int $offset For pagination
|
||||
* @param string $sortfield Sort criteria
|
||||
* @param string $sortorder Sort order
|
||||
* @return int -1 if KO, array with result if OK
|
||||
*/
|
||||
function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='f.datef,f.rowid', $sortorder='DESC')
|
||||
{
|
||||
global $conf,$user;
|
||||
|
||||
$ga = array();
|
||||
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.client,";
|
||||
$sql.= " f.rowid as fid, f.facnumber as ref, f.datef as df";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE f.entity = ".$conf->entity;
|
||||
$sql.= " AND f.fk_soc = s.rowid";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) //restriction
|
||||
{
|
||||
$sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
}
|
||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||
if ($draft) $sql.= " AND f.fk_statut = 0";
|
||||
if (is_object($excluser)) $sql.= " AND f.fk_user_author <> ".$excluser->id;
|
||||
$sql.= $this->db->order($sortfield,$sortorder);
|
||||
$sql.= $this->db->plimit($limit,$offset);
|
||||
|
||||
$result=$this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$numc = $this->db->num_rows($result);
|
||||
if ($numc)
|
||||
{
|
||||
$i = 0;
|
||||
while ($i < $numc)
|
||||
{
|
||||
$obj = $this->db->fetch_object($result);
|
||||
|
||||
if ($shortlist == 1)
|
||||
{
|
||||
$ga[$obj->fid] = $obj->ref;
|
||||
}
|
||||
else if ($shortlist == 2)
|
||||
{
|
||||
$ga[$obj->fid] = $obj->ref.' ('.$obj->name.')';
|
||||
}
|
||||
else
|
||||
{
|
||||
$ga[$i]['id'] = $obj->fid;
|
||||
$ga[$i]['ref'] = $obj->ref;
|
||||
$ga[$i]['name'] = $obj->name;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
return $ga;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -3121,7 +3121,7 @@ class Facture extends CommonInvoice
|
||||
$this->total_tva += $line->total_tva;
|
||||
$this->total_ttc += $line->total_ttc;
|
||||
}
|
||||
$this->revenuestamp = 0;
|
||||
$this->revenuestamp = 0;
|
||||
|
||||
// Add a line "offered"
|
||||
$line=new FactureLigne($this->db);
|
||||
|
||||
@ -54,8 +54,8 @@ $endyear=$year;
|
||||
* View
|
||||
*/
|
||||
|
||||
$langs->load("bills");
|
||||
$langs->load("companies");
|
||||
$langs->load("bills");
|
||||
$langs->load("companies");
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
|
||||
@ -29,9 +29,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
$langs->load('bills');
|
||||
$langs->load('companies');
|
||||
$langs->load('compta');
|
||||
|
||||
@ -26,9 +26,9 @@
|
||||
require('../../../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
|
||||
@ -26,9 +26,9 @@
|
||||
require('../../../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
$langs->load("bills");
|
||||
|
||||
// Security check
|
||||
|
||||
@ -392,7 +392,7 @@ class Paiement extends CommonObject
|
||||
$this->error='Bad value for parameter accountid';
|
||||
dol_syslog(get_class($this).'::addPaymentToBank '.$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
|
||||
@ -27,10 +27,10 @@ require('../../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
$langs->load("bills");
|
||||
$langs->load("categories");
|
||||
|
||||
|
||||
@ -26,10 +26,10 @@
|
||||
|
||||
require('../../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
$langs->load("widthdrawals");
|
||||
|
||||
// Security check
|
||||
|
||||
@ -30,10 +30,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
$langs->load("widthdrawals");
|
||||
$langs->load("companies");
|
||||
$langs->load("bills");
|
||||
|
||||
@ -28,10 +28,10 @@ require('../../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/modPrelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
$langs->load("widthdrawals");
|
||||
$langs->load("companies");
|
||||
|
||||
|
||||
@ -29,10 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
$langs->load("companies");
|
||||
$langs->load('withdrawals');
|
||||
$langs->load('bills');
|
||||
|
||||
@ -29,10 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
$langs->load('withdrawals');
|
||||
$langs->load('bills');
|
||||
|
||||
|
||||
@ -27,11 +27,11 @@ require('../../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
$langs->load("withdrawals");
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
$langs->load("withdrawals");
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id > 0) accessforbidden();
|
||||
|
||||
@ -26,10 +26,10 @@
|
||||
require('../../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
|
||||
if (!$user->rights->prelevement->bons->lire)
|
||||
accessforbidden();
|
||||
|
||||
@ -31,10 +31,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.p
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
$langs->load("withdrawals");
|
||||
|
||||
// Security check
|
||||
|
||||
@ -29,10 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.p
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id > 0) accessforbidden();
|
||||
|
||||
@ -30,10 +30,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.p
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id > 0) accessforbidden();
|
||||
|
||||
@ -26,9 +26,9 @@
|
||||
require('../../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("withdrawals");
|
||||
$langs->load("companies");
|
||||
$langs->load("categories");
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -28,10 +28,10 @@ require('../../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
$langs->load("withdrawals");
|
||||
$langs->load("companies");
|
||||
|
||||
@ -59,7 +59,7 @@ if ($sortorder == "") $sortorder="DESC";
|
||||
if ($sortfield == "") $sortfield="p.datec";
|
||||
|
||||
$rej = new RejetPrelevement($db, $user);
|
||||
$ligne = new LignePrelevement($db);
|
||||
$ligne = new LignePrelevement($db, $user);
|
||||
|
||||
/*
|
||||
* Liste des factures
|
||||
|
||||
@ -26,10 +26,10 @@
|
||||
|
||||
require('../../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
$langs->load("withdrawals");
|
||||
$langs->load("companies");
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ $socid = isset($_GET["socid"])?$_GET["socid"]:'';
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'tax', '', '', 'charges');
|
||||
|
||||
$tva = new Tva($db);
|
||||
$tva = new Tva($db);
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('taxvatcard'));
|
||||
@ -54,7 +54,7 @@ $hookmanager->initHooks(array('taxvatcard'));
|
||||
|
||||
if ($_POST["cancel"] == $langs->trans("Cancel"))
|
||||
{
|
||||
header("Location: reglement.php");
|
||||
header("Location: reglement.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -231,9 +231,9 @@ if ($id)
|
||||
print $vatpayment->ref;
|
||||
print '</td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$vatpayment->label.'</td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$vatpayment->label.'</td></tr>';
|
||||
|
||||
print "<tr>";
|
||||
print '<td>'.$langs->trans("DatePayment").'</td><td colspan="3">';
|
||||
print dol_print_date($vatpayment->datep,'day');
|
||||
|
||||
@ -1009,13 +1009,13 @@ class Contact extends CommonObject
|
||||
$this->country = 'France';
|
||||
$this->email = 'specimen@specimen.com';
|
||||
|
||||
$this->phone_pro = '0909090901';
|
||||
$this->phone_perso = '0909090902';
|
||||
$this->phone_mobile = '0909090903';
|
||||
$this->fax = '0909090909';
|
||||
$this->phone_pro = '0909090901';
|
||||
$this->phone_perso = '0909090902';
|
||||
$this->phone_mobile = '0909090903';
|
||||
$this->fax = '0909090909';
|
||||
|
||||
$this->note_public='This is a comment (public)';
|
||||
$this->note_private='This is a comment (private)';
|
||||
$this->note_public='This is a comment (public)';
|
||||
$this->note_private='This is a comment (private)';
|
||||
|
||||
$socid = rand(1, $num_socs);
|
||||
$this->socid = $socids[$socid];
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
|
||||
$action = GETPOST('action');
|
||||
|
||||
@ -66,7 +66,7 @@ else if ($action == 'setnote_private' && $user->rights->societe->creer)
|
||||
* View
|
||||
*/
|
||||
|
||||
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
|
||||
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
@ -90,68 +90,68 @@ if ($id > 0)
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||
print $form->showrefnav($object, 'id', $linkback);
|
||||
print '</td></tr>';
|
||||
|
||||
// Name
|
||||
print '<tr><td width="20%">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td width="30%">'.$object->lastname.'</td>';
|
||||
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="30%">'.$object->firstname.'</td></tr>';
|
||||
|
||||
// Company
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||
{
|
||||
if ($object->socid > 0)
|
||||
{
|
||||
$objsoc = new Societe($db);
|
||||
$objsoc->fetch($object->socid);
|
||||
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->getNomUrl(1).'</td></tr>';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">';
|
||||
print $langs->trans("ContactNotLinkedToCompany");
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
// Civility
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td colspan="3">';
|
||||
print $object->getCivilityLabel();
|
||||
print '</td></tr>';
|
||||
|
||||
// Date To Birth
|
||||
print '<tr>';
|
||||
if (! empty($object->birthday))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
|
||||
print '<td>'.$langs->trans("DateToBirth").'</td><td colspan="3">'.dol_print_date($object->birthday,"day");
|
||||
|
||||
print ' ';
|
||||
//var_dump($birthdatearray);
|
||||
$ageyear=convertSecondToTime($now-$object->birthday,'year')-1970;
|
||||
$agemonth=convertSecondToTime($now-$object->birthday,'month')-1;
|
||||
if ($ageyear >= 2) print '('.$ageyear.' '.$langs->trans("DurationYears").')';
|
||||
else if ($agemonth >= 2) print '('.$agemonth.' '.$langs->trans("DurationMonths").')';
|
||||
else print '('.$agemonth.' '.$langs->trans("DurationMonth").')';
|
||||
|
||||
|
||||
print ' - ';
|
||||
if ($object->birthday_alert) print $langs->trans("BirthdayAlertOn");
|
||||
else print $langs->trans("BirthdayAlertOff");
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td>'.$langs->trans("DateToBirth").'</td><td colspan="3">'.$langs->trans("Unknown")."</td>";
|
||||
}
|
||||
print "</tr>";
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||
print $form->showrefnav($object, 'id', $linkback);
|
||||
print '</td></tr>';
|
||||
|
||||
// Name
|
||||
print '<tr><td width="20%">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td width="30%">'.$object->lastname.'</td>';
|
||||
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="30%">'.$object->firstname.'</td></tr>';
|
||||
|
||||
// Company
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||
{
|
||||
if ($object->socid > 0)
|
||||
{
|
||||
$objsoc = new Societe($db);
|
||||
$objsoc->fetch($object->socid);
|
||||
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->getNomUrl(1).'</td></tr>';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">';
|
||||
print $langs->trans("ContactNotLinkedToCompany");
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
// Civility
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td colspan="3">';
|
||||
print $object->getCivilityLabel();
|
||||
print '</td></tr>';
|
||||
|
||||
// Date To Birth
|
||||
print '<tr>';
|
||||
if (! empty($object->birthday))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
|
||||
print '<td>'.$langs->trans("DateToBirth").'</td><td colspan="3">'.dol_print_date($object->birthday,"day");
|
||||
|
||||
print ' ';
|
||||
//var_dump($birthdatearray);
|
||||
$ageyear=convertSecondToTime($now-$object->birthday,'year')-1970;
|
||||
$agemonth=convertSecondToTime($now-$object->birthday,'month')-1;
|
||||
if ($ageyear >= 2) print '('.$ageyear.' '.$langs->trans("DurationYears").')';
|
||||
else if ($agemonth >= 2) print '('.$agemonth.' '.$langs->trans("DurationMonths").')';
|
||||
else print '('.$agemonth.' '.$langs->trans("DurationMonth").')';
|
||||
|
||||
|
||||
print ' - ';
|
||||
if ($object->birthday_alert) print $langs->trans("BirthdayAlertOn");
|
||||
else print $langs->trans("BirthdayAlertOff");
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td>'.$langs->trans("DateToBirth").'</td><td colspan="3">'.$langs->trans("Unknown")."</td>";
|
||||
}
|
||||
print "</tr>";
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
@ -42,21 +42,21 @@ class box_activity extends ModeleBoxes
|
||||
var $info_box_contents = array();
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
function __construct($db,$param)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$this->db=$db;
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
function __construct($db,$param)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$this->db=$db;
|
||||
// FIXME: Use a cache to save data because this slow down too much main home page. This box slow down too seriously software.
|
||||
// FIXME: Removed number_format (not compatible with all languages)
|
||||
// FIXME: Pb into some status
|
||||
$this->enabled=$conf->global->MAIN_FEATURES_LEVEL; // Not enabled by default due to bugs (see previous FIXME)
|
||||
$this->enabled=$conf->global->MAIN_FEATURES_LEVEL; // Not enabled by default due to bugs (see previous FIXME)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -39,18 +39,18 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
||||
var $info_box_contents = array();
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
function __construct($db,$param)
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
function __construct($db,$param)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$this->db=$db;
|
||||
$this->enabled=$conf->global->MAIN_FEATURES_LEVEL;
|
||||
|
||||
$this->db=$db;
|
||||
$this->enabled=$conf->global->MAIN_FEATURES_LEVEL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -81,24 +81,24 @@ abstract class CommonObject
|
||||
return dol_trunc($ret,$maxlen);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return full address of contact
|
||||
*
|
||||
* @param int $withcountry 1=Add country into address string
|
||||
* @param string $sep Separator to use to build string
|
||||
* @return string Full address string
|
||||
*/
|
||||
function getFullAddress($withcountry=0,$sep="\n")
|
||||
{
|
||||
if ($withcountry && $this->country_id && (empty($this->country_code) || empty($this->country)))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT .'/core/lib/company.lib.php';
|
||||
$tmparray=getCountry($this->country_id,'all');
|
||||
$this->country_code=$tmparray['code'];
|
||||
$this->country =$tmparray['label'];
|
||||
}
|
||||
/**
|
||||
* Return full address of contact
|
||||
*
|
||||
* @param int $withcountry 1=Add country into address string
|
||||
* @param string $sep Separator to use to build string
|
||||
* @return string Full address string
|
||||
*/
|
||||
function getFullAddress($withcountry=0,$sep="\n")
|
||||
{
|
||||
if ($withcountry && $this->country_id && (empty($this->country_code) || empty($this->country)))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT .'/core/lib/company.lib.php';
|
||||
$tmparray=getCountry($this->country_id,'all');
|
||||
$this->country_code=$tmparray['code'];
|
||||
$this->country =$tmparray['label'];
|
||||
}
|
||||
|
||||
return dol_format_address($this, $withcountry, $sep);
|
||||
return dol_format_address($this, $withcountry, $sep);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -63,11 +63,11 @@ class Conf
|
||||
//! Used to store list of entities to use for each element
|
||||
public $entities = array();
|
||||
|
||||
public $dol_hide_topmenu; // Set if we force param dol_hide_topmenu into login url
|
||||
public $dol_hide_leftmenu; // Set if we force param dol_hide_leftmenu into login url
|
||||
public $dol_optimize_smallscreen; // Set if we force param dol_optimize_smallscreen into login url or if browser is smartphone
|
||||
public $dol_no_mouse_hover; // Set if we force param dol_no_mouse_hover into login url or if browser is smartphone
|
||||
public $dol_use_jmobile; // Set if we force param dol_use_jmobile into login url
|
||||
public $dol_hide_topmenu; // Set if we force param dol_hide_topmenu into login url
|
||||
public $dol_hide_leftmenu; // Set if we force param dol_hide_leftmenu into login url
|
||||
public $dol_optimize_smallscreen; // Set if we force param dol_optimize_smallscreen into login url or if browser is smartphone
|
||||
public $dol_no_mouse_hover; // Set if we force param dol_no_mouse_hover into login url or if browser is smartphone
|
||||
public $dol_use_jmobile; // Set if we force param dol_use_jmobile into login url
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -166,8 +166,8 @@ class HookManager
|
||||
}
|
||||
}
|
||||
|
||||
if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results);
|
||||
if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints;
|
||||
if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results);
|
||||
if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints;
|
||||
}
|
||||
// Generic hooks that return a string or array (printSearchForm, printLeftBlock, printTopRightMenu, formAddObjectLine, formBuilddocOptions, ...)
|
||||
else
|
||||
|
||||
@ -655,6 +655,74 @@ class Form
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return list of company for customer in Ajax if Ajax activated or go to select_thirparty_list
|
||||
*
|
||||
* @param int $selected Preselected products
|
||||
* @param string $htmlname Name of HTML seletc field (must be unique in page)
|
||||
* @param int $filter Filter on thirdparty
|
||||
* @param int $limit Limit on number of returned lines
|
||||
* @param array $ajaxoptions Options for ajax_autocompleter
|
||||
* @param int $forcecombo Force to use combo box
|
||||
* @return void
|
||||
*/
|
||||
function select_thirdparty($selected='', $htmlname='productid', $filter='', $limit=20, $ajaxoptions=array(), $forcecombo=0)
|
||||
{
|
||||
global $langs,$conf;
|
||||
|
||||
/* TODO Use ajax autocompletion (not finished)
|
||||
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo)
|
||||
{
|
||||
$placeholder='';
|
||||
|
||||
if ($selected && empty($selected_input_value))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
$societe = new Societe($this->db);
|
||||
$societe->fetch($selected);
|
||||
$selected_input_value=$societe->ref;
|
||||
}
|
||||
// mode=1 means customers products
|
||||
$urloption='htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished;
|
||||
print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
|
||||
if (empty($hidelabel)) print $langs->trans("RefOrLabel").' : ';
|
||||
else if ($hidelabel > 1) {
|
||||
if (! empty($conf->global->MAIN_HTML5_PLACEHOLDER)) $placeholder=' placeholder="'.$langs->trans("RefOrLabel").'"';
|
||||
else $placeholder=' title="'.$langs->trans("RefOrLabel").'"';
|
||||
if ($hidelabel == 2) {
|
||||
print img_picto($langs->trans("Search"), 'search');
|
||||
}
|
||||
}
|
||||
print '<input type="text" size="20" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' />';
|
||||
if ($hidelabel == 3) {
|
||||
print img_picto($langs->trans("Search"), 'search');
|
||||
}
|
||||
}
|
||||
else
|
||||
{*/
|
||||
print $this->select_thirdparty_list($selected,$htmlname,$filter,1,0,$forcecombo,array(),'',0,$limit);
|
||||
//}
|
||||
}
|
||||
|
||||
/**
|
||||
* Output html form to select a third party
|
||||
*
|
||||
* @param string $selected Preselected type
|
||||
* @param string $htmlname Name of field in form
|
||||
* @param string $filter Optionnal filters criteras (example: 's.rowid <> x')
|
||||
* @param int $showempty Add an empty field
|
||||
* @param int $showtype Show third party type in combolist (customer, prospect or supplier)
|
||||
* @param int $forcecombo Force to use combo box
|
||||
* @param array $event Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
|
||||
* @return string HTML string with
|
||||
* @deprecated Use select_thirdparty instead
|
||||
*/
|
||||
function select_company($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0, $event=array())
|
||||
{
|
||||
return $this->select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0, $event=array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Output html form to select a third party
|
||||
*
|
||||
@ -665,13 +733,17 @@ class Form
|
||||
* @param int $showtype Show third party type in combolist (customer, prospect or supplier)
|
||||
* @param int $forcecombo Force to use combo box
|
||||
* @param array $event Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
|
||||
* @param string $filterkey Filter on key value
|
||||
* @param int $outputmode 0=HTML select string, 1=Array
|
||||
* @param int $limit Limit number of answers
|
||||
* @return string HTML string with
|
||||
*/
|
||||
function select_company($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0, $event=array())
|
||||
function select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0, $event=array(), $filterkey='', $outputmode=0, $limit=20)
|
||||
{
|
||||
global $conf,$user,$langs;
|
||||
|
||||
$out='';
|
||||
$outarray=array();
|
||||
|
||||
// On recherche les societes
|
||||
$sql = "SELECT s.rowid, s.nom, s.client, s.fournisseur, s.code_client, s.code_fournisseur";
|
||||
@ -682,9 +754,33 @@ class Form
|
||||
if ($filter) $sql.= " AND (".$filter.")";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if (! empty($conf->global->COMPANY_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND s.status<>0 ";
|
||||
// Add criteria
|
||||
if ($filterkey && $filterkey != '')
|
||||
{
|
||||
$sql.=" AND (";
|
||||
if (! empty($conf->global->COMPANY_DONOTSEARCH_ANYWHERE)) // Can use index
|
||||
{
|
||||
$sql.="(s.name LIKE '".$filterkey."%'";
|
||||
$sql.=")";
|
||||
}
|
||||
else
|
||||
{
|
||||
// For natural search
|
||||
$scrit = explode(' ', $filterkey);
|
||||
foreach ($scrit as $crit) {
|
||||
$sql.=" AND (s.name LIKE '%".$crit."%'";
|
||||
$sql.=")";
|
||||
}
|
||||
}
|
||||
if (! empty($conf->barcode->enabled))
|
||||
{
|
||||
$sql .= " OR s.barcode LIKE '".$filterkey."'";
|
||||
}
|
||||
$sql.=")";
|
||||
}
|
||||
$sql.= " ORDER BY nom ASC";
|
||||
|
||||
dol_syslog(get_class($this)."::select_company sql=".$sql);
|
||||
dol_syslog(get_class($this)."::select_thirdparty_list sql=".$sql);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -692,32 +788,9 @@ class Form
|
||||
{
|
||||
//$minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2);
|
||||
$out.= ajax_combobox($htmlname, $event, $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
|
||||
/*
|
||||
<<<<<<< HEAD
|
||||
if ($selected && empty($selected_input_value))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
$product = new Product($this->db);
|
||||
$product->fetch($selected);
|
||||
$selected_input_value=$product->ref;
|
||||
}
|
||||
=======
|
||||
if ($selected && empty($selected_input_value))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
$product = new Product($this->db);
|
||||
$product->fetch($selected);
|
||||
$selected_input_value=$product->ref;
|
||||
}
|
||||
>>>>>>> refs/remotes/origin/3.3
|
||||
// mode=1 means customers products
|
||||
$ajaxoptions=array();
|
||||
$urloption='htmlname='.$htmlname.'&outjson=1&filter='.urlencode($filter).'&showtype='.$showtype;
|
||||
$out.=ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
|
||||
$out.='<input type="text" size="20" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'" />';
|
||||
*/
|
||||
}
|
||||
|
||||
// Construct $out and $outarray
|
||||
$out.= '<select id="'.$htmlname.'" class="flat" name="'.$htmlname.'">';
|
||||
if ($showempty) $out.= '<option value="-1"></option>';
|
||||
$num = $this->db->num_rows($resql);
|
||||
@ -741,9 +814,12 @@ class Form
|
||||
$out.= '<option value="'.$obj->rowid.'" selected="selected">'.$label.'</option>';
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
$out.= '<option value="'.$obj->rowid.'">'.$label.'</option>';
|
||||
}
|
||||
|
||||
array_push($outarray, array('key'=>$obj->rowid, 'value'=>$obj->name, 'label'=>$obj->name));
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
@ -754,6 +830,7 @@ class Form
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
|
||||
if ($outputmode) return $outarray;
|
||||
return $out;
|
||||
}
|
||||
|
||||
@ -1114,7 +1191,7 @@ class Form
|
||||
|
||||
|
||||
/**
|
||||
* Return list of products for customer in Ajax if Ajax activated or go to select_produits_do
|
||||
* Return list of products for customer in Ajax if Ajax activated or go to select_produits_list
|
||||
*
|
||||
* @param int $selected Preselected products
|
||||
* @param string $htmlname Name of HTML seletc field (must be unique in page)
|
||||
@ -1162,8 +1239,8 @@ class Form
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->select_produits_do($selected,$htmlname,$filtertype,$limit,$price_level,'',$status,$finished,0);
|
||||
{
|
||||
print $this->select_produits_list($selected,$htmlname,$filtertype,$limit,$price_level,'',$status,$finished,0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1178,13 +1255,16 @@ class Form
|
||||
* @param string $filterkey Filter on product
|
||||
* @param int $status -1=Return all products, 0=Products not on sell, 1=Products on sell
|
||||
* @param int $finished Filter on finished field: 2=No filter
|
||||
* @param int $disableout Disable print output
|
||||
* @param int $outputmode 0=HTML select string, 1=Array
|
||||
* @return array Array of keys for json
|
||||
*/
|
||||
function select_produits_do($selected='',$htmlname='productid',$filtertype='',$limit=20,$price_level=0,$filterkey='',$status=1,$finished=2,$disableout=0)
|
||||
function select_produits_list($selected='',$htmlname='productid',$filtertype='',$limit=20,$price_level=0,$filterkey='',$status=1,$finished=2,$outputmode=0)
|
||||
{
|
||||
global $langs,$conf,$user,$db;
|
||||
|
||||
$out='';
|
||||
$outarray=array();
|
||||
|
||||
$sql = "SELECT ";
|
||||
$sql.= " p.rowid, p.label, p.ref, p.description, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.stock";
|
||||
// Multilang : we add translation
|
||||
@ -1228,6 +1308,7 @@ class Form
|
||||
// Add criteria on ref/label
|
||||
if ($filterkey && $filterkey != '')
|
||||
{
|
||||
$sql.=" AND (";
|
||||
if (! empty($conf->global->PRODUCT_DONOTSEARCH_ANYWHERE)) // Can use index
|
||||
{
|
||||
$sql.=" AND (p.ref LIKE '".$filterkey."%' OR p.label LIKE '".$filterkey."%'";
|
||||
@ -1249,22 +1330,20 @@ class Form
|
||||
{
|
||||
$sql .= " OR p.barcode LIKE '".$filterkey."'";
|
||||
}
|
||||
$sql.=")";
|
||||
}
|
||||
$sql.= $db->order("p.ref");
|
||||
$sql.= $db->plimit($limit);
|
||||
|
||||
// Build output string
|
||||
$outselect='';
|
||||
$outjson=array();
|
||||
|
||||
dol_syslog(get_class($this)."::select_produits_do search product sql=".$sql, LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::select_produits_list search product sql=".$sql, LOG_DEBUG);
|
||||
$result=$this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
$outselect.='<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">';
|
||||
$outselect.='<option value="0" selected="selected"> </option>';
|
||||
$out.='<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">';
|
||||
$out.='<option value="0" selected="selected"> </option>';
|
||||
|
||||
$i = 0;
|
||||
while ($num && $i < $num)
|
||||
@ -1273,13 +1352,14 @@ class Form
|
||||
$optJson = array();
|
||||
$objp = $this->db->fetch_object($result);
|
||||
|
||||
if(!empty($objp->price_by_qty) && $objp->price_by_qty == 1) { // Price by quantity will return many prices for the same product
|
||||
if (!empty($objp->price_by_qty) && $objp->price_by_qty == 1)
|
||||
{ // Price by quantity will return many prices for the same product
|
||||
$sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product_price_by_qty";
|
||||
$sql.= " WHERE fk_product_price=".$objp->price_rowid;
|
||||
$sql.= " ORDER BY quantity ASC";
|
||||
|
||||
dol_syslog(get_class($this)."::select_produits_do search price by qty sql=".$sql);
|
||||
dol_syslog(get_class($this)."::select_produits_list search price by qty sql=".$sql);
|
||||
$result2 = $this->db->query($sql);
|
||||
if ($result2)
|
||||
{
|
||||
@ -1302,46 +1382,48 @@ class Form
|
||||
// Add new entry
|
||||
// "key" value of json key array is used by jQuery automatically as selected value
|
||||
// "label" value of json key array is used by jQuery automatically as text for combo box
|
||||
$outselect.=$opt;
|
||||
array_push($outjson, $optJson);
|
||||
$out.=$opt;
|
||||
array_push($outarray, $optJson);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_construct_product_list_option($objp, $opt, $optJson, $price_level, $selected);
|
||||
// Add new entry
|
||||
// "key" value of json key array is used by jQuery automatically as selected value
|
||||
// "label" value of json key array is used by jQuery automatically as text for combo box
|
||||
$outselect.=$opt;
|
||||
array_push($outjson, $optJson);
|
||||
$out.=$opt;
|
||||
array_push($outarray, $optJson);
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
$outselect.='</select>';
|
||||
$out.='</select>';
|
||||
|
||||
$this->db->free($result);
|
||||
|
||||
if (empty($disableout)) print $outselect;
|
||||
return $outjson;
|
||||
if (empty($outputmode)) return $out;
|
||||
return $outarray;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* _construct_product_list_option
|
||||
*
|
||||
*
|
||||
* @param resultset &$objp Resultset of fetch
|
||||
* @param string $opt Option
|
||||
* @param string $optJson Option
|
||||
* @param int $price_level Price level
|
||||
* @param string $selected Preselected value
|
||||
* @return
|
||||
* @return
|
||||
*/
|
||||
private function _construct_product_list_option(&$objp, &$opt, &$optJson, $price_level, $selected)
|
||||
private function _construct_product_list_option(&$objp, &$opt, &$optJson, $price_level, $selected)
|
||||
{
|
||||
global $langs,$conf,$user,$db;
|
||||
|
||||
@ -1399,7 +1481,7 @@ class Form
|
||||
$sql.= " ORDER BY date_price";
|
||||
$sql.= " DESC LIMIT 1";
|
||||
|
||||
dol_syslog(get_class($this)."::select_produits_do search price for level '.$price_level.' sql=".$sql);
|
||||
dol_syslog(get_class($this)."::_construct_product_list_option search price for level '.$price_level.' sql=".$sql);
|
||||
$result2 = $this->db->query($sql);
|
||||
if ($result2)
|
||||
{
|
||||
@ -1430,7 +1512,8 @@ class Form
|
||||
}
|
||||
|
||||
// Price by quantity
|
||||
if (!empty($objp->quantity) && $objp->quantity >= 1) {
|
||||
if (!empty($objp->quantity) && $objp->quantity >= 1)
|
||||
{
|
||||
$found = 1;
|
||||
$outqty=$objp->quantity;
|
||||
$outdiscount=$objp->remise_percent;
|
||||
@ -1511,7 +1594,7 @@ class Form
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of products for customer (in Ajax if Ajax activated or go to select_produits_fournisseurs_do)
|
||||
* Return list of products for customer (in Ajax if Ajax activated or go to select_produits_fournisseurs_list)
|
||||
*
|
||||
* @param int $socid Id third party
|
||||
* @param string $selected Preselected product
|
||||
@ -1536,7 +1619,7 @@ class Form
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->select_produits_fournisseurs_do($socid,$selected,$htmlname,$filtertype,$filtre,'',-1,0);
|
||||
print $this->select_produits_fournisseurs_list($socid,$selected,$htmlname,$filtertype,$filtre,'',-1,0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1550,13 +1633,16 @@ class Form
|
||||
* @param string $filtre Pour filtre sql
|
||||
* @param string $filterkey Filtre des produits
|
||||
* @param int $statut -1=Return all products, 0=Products not on sell, 1=Products on sell
|
||||
* @param int $disableout Disable print output
|
||||
* @param int $outputmode 0=HTML select string, 1=Array
|
||||
* @return array Array of keys for json
|
||||
*/
|
||||
function select_produits_fournisseurs_do($socid,$selected='',$htmlname='productid',$filtertype='',$filtre='',$filterkey='',$statut=-1,$disableout=0)
|
||||
function select_produits_fournisseurs_list($socid,$selected='',$htmlname='productid',$filtertype='',$filtre='',$filterkey='',$statut=-1,$outputmode=0)
|
||||
{
|
||||
global $langs,$conf;
|
||||
|
||||
$out='';
|
||||
$outarray=array();
|
||||
|
||||
$langs->load('stocks');
|
||||
|
||||
$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration,";
|
||||
@ -1590,20 +1676,18 @@ class Form
|
||||
$sql.= " ORDER BY pfp.ref_fourn DESC, pfp.quantity ASC";
|
||||
|
||||
// Build output string
|
||||
$outselect='';
|
||||
$outjson=array();
|
||||
|
||||
dol_syslog(get_class($this)."::select_produits_fournisseurs_do sql=".$sql,LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::select_produits_fournisseurs_list sql=".$sql,LOG_DEBUG);
|
||||
$result=$this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
//$outselect.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">'; // remove select to have id same with combo and ajax
|
||||
$outselect.='<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
|
||||
if (! $selected) $outselect.='<option value="0" selected="selected"> </option>';
|
||||
else $outselect.='<option value="0"> </option>';
|
||||
//$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">'; // remove select to have id same with combo and ajax
|
||||
$out.='<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
|
||||
if (! $selected) $out.='<option value="0" selected="selected"> </option>';
|
||||
else $out.='<option value="0"> </option>';
|
||||
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
@ -1694,9 +1778,9 @@ class Form
|
||||
// Add new entry
|
||||
// "key" value of json key array is used by jQuery automatically as selected value
|
||||
// "label" value of json key array is used by jQuery automatically as text for combo box
|
||||
$outselect.=$opt;
|
||||
array_push($outjson, array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'qty'=>$outqty, 'discount'=>$outdiscount, 'disabled'=>(empty($objp->idprodfournprice)?true:false)));
|
||||
// Exemple of var_dump $outjson
|
||||
$out.=$opt;
|
||||
array_push($outarray, array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'qty'=>$outqty, 'discount'=>$outdiscount, 'disabled'=>(empty($objp->idprodfournprice)?true:false)));
|
||||
// Exemple of var_dump $outarray
|
||||
// array(1) {[0]=>array(6) {[key"]=>string(1) "2" ["value"]=>string(3) "ppp"
|
||||
// ["label"]=>string(76) "ppp (<strong>f</strong>ff2) - ppp - 20,00 Euros/1unité (20,00 Euros/unité)"
|
||||
// ["qty"]=>string(1) "1" ["discount"]=>string(1) "0" ["disabled"]=>bool(false)
|
||||
@ -1707,12 +1791,12 @@ class Form
|
||||
|
||||
$i++;
|
||||
}
|
||||
$outselect.='</select>';
|
||||
$out.='</select>';
|
||||
|
||||
$this->db->free($result);
|
||||
|
||||
if (empty($disableout)) print $outselect;
|
||||
return $outjson;
|
||||
if (empty($outputmode)) return $out;
|
||||
return $outarray;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3524,7 +3608,7 @@ class Form
|
||||
function select_duration($prefix,$iSecond='',$disabled=0,$typehour='select')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
|
||||
if ($iSecond)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
@ -3532,8 +3616,8 @@ class Form
|
||||
$hourSelected = convertSecondToTime($iSecond,'hour');
|
||||
$minSelected = convertSecondToTime($iSecond,'min');
|
||||
}
|
||||
|
||||
if ($typehour=='select')
|
||||
|
||||
if ($typehour=='select')
|
||||
{
|
||||
print '<select class="flat" name="'.$prefix.'hour"'.($disabled?' disabled="disabled"':'').'>';
|
||||
for ($hour = 0; $hour < 24; $hour++)
|
||||
@ -3547,7 +3631,7 @@ class Form
|
||||
}
|
||||
print "</select>";
|
||||
}
|
||||
elseif ($typehour=='text')
|
||||
elseif ($typehour=='text')
|
||||
{
|
||||
$fullhours=convertSecondToTime($iSecond,'fullhour');
|
||||
print '<input type="text" size="3" name="'.$prefix.'hour" class="flat" value="'.$fullhours.'">';
|
||||
|
||||
@ -230,7 +230,7 @@ class FormActions
|
||||
//asort($arraylist);
|
||||
|
||||
if ($selected == 'manual') $selected='AC_OTH';
|
||||
if ($selected == 'auto') $selected='AC_OTH_AUTO';
|
||||
if ($selected == 'auto') $selected='AC_OTH_AUTO';
|
||||
|
||||
print $form->selectarray($htmlname, $arraylist, $selected);
|
||||
if ($user->admin && empty($onlyautoornot)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
||||
|
||||
@ -383,18 +383,18 @@ class FormFile
|
||||
$buttonlabeltoshow=$buttonlabel;
|
||||
if (empty($buttonlabel)) $buttonlabel=$langs->trans('Generate');
|
||||
|
||||
|
||||
// Keep this. Used for test with jmobile
|
||||
/*print '
|
||||
<form id="form1" name="form1">
|
||||
<select id="custom-select2a" name="custom-select2a">
|
||||
<option value="" data-placeholder="true">Choose One...</option>
|
||||
<option value="option1">Option #1</option>
|
||||
<option value="option2">Option #2</option>
|
||||
<option value="option3">Option #3 - This is a really f fsd f gdfgdgd gd gd gd fgd gd gd fgd fgfdreally really really really long label.</option>
|
||||
</select>
|
||||
</form>
|
||||
';*/
|
||||
|
||||
// Keep this. Used for test with jmobile
|
||||
/*print '
|
||||
<form id="form1" name="form1">
|
||||
<select id="custom-select2a" name="custom-select2a">
|
||||
<option value="" data-placeholder="true">Choose One...</option>
|
||||
<option value="option1">Option #1</option>
|
||||
<option value="option2">Option #2</option>
|
||||
<option value="option3">Option #3 - This is a really f fsd f gdfgdgd gd gd gd fgd gd gd fgd fgfdreally really really really long label.</option>
|
||||
</select>
|
||||
</form>
|
||||
';*/
|
||||
|
||||
if (empty($noform)) $out.= '<form action="'.$urlsource.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc').'" name="'.$forname.'" id="'.$forname.'_form" method="post">';
|
||||
$out.= '<input type="hidden" name="action" value="builddoc">';
|
||||
|
||||
@ -596,7 +596,7 @@ class FormMail
|
||||
if (!empty($conf->global->FCKEDITOR_ENABLE_MAIL)) {
|
||||
$this->withfckeditor=1;
|
||||
}
|
||||
$doleditor=new DolEditor('message',nl2br($defaultmessage),'',280,$this->ckeditortoolbar,'In',true,true,$this->withfckeditor,8,72);
|
||||
$doleditor=new DolEditor('message',$defaultmessage,'',280,$this->ckeditortoolbar,'In',true,true,$this->withfckeditor,8,72);
|
||||
$out.= $doleditor->Create(1);
|
||||
}
|
||||
$out.= "</td></tr>\n";
|
||||
|
||||
@ -945,30 +945,30 @@ class FormOther
|
||||
if (! count($arrayboxtoactivatelabel)) print 'jQuery("#boxcombo").hide();';
|
||||
print '
|
||||
|
||||
jQuery("#left, #right").sortable({
|
||||
/* placeholder: \'ui-state-highlight\', */
|
||||
handle: \'.boxhandle\',
|
||||
revert: \'invalid\',
|
||||
items: \'.box\',
|
||||
containment: \'.fiche\',
|
||||
connectWith: \'.connectedSortable\',
|
||||
stop: function(event, ui) {
|
||||
updateBoxOrder(0);
|
||||
}
|
||||
jQuery("#left, #right").sortable({
|
||||
/* placeholder: \'ui-state-highlight\', */
|
||||
handle: \'.boxhandle\',
|
||||
revert: \'invalid\',
|
||||
items: \'.box\',
|
||||
containment: \'.fiche\',
|
||||
connectWith: \'.connectedSortable\',
|
||||
stop: function(event, ui) {
|
||||
updateBoxOrder(0);
|
||||
}
|
||||
});
|
||||
|
||||
jQuery(".boxclose").click(function() {
|
||||
var self = this; // because JQuery can modify this
|
||||
jQuery(".boxclose").click(function() {
|
||||
var self = this; // because JQuery can modify this
|
||||
var boxid=self.id.substring(8);
|
||||
var label=jQuery(\'#boxlabelentry\'+boxid).val();
|
||||
var label=jQuery(\'#boxlabelentry\'+boxid).val();
|
||||
jQuery(\'#boxto_\'+boxid).remove();
|
||||
if (boxid > 0) jQuery(\'#boxcombo\').append(new Option(label, boxid));
|
||||
updateBoxOrder(1);
|
||||
});
|
||||
updateBoxOrder(1);
|
||||
});
|
||||
|
||||
});'."\n";
|
||||
});'."\n";
|
||||
|
||||
print '</script>'."\n";
|
||||
print '</script>'."\n";
|
||||
}
|
||||
|
||||
$nbboxactivated=count($boxidactivatedforuser);
|
||||
|
||||
@ -87,13 +87,13 @@ class InfoBox
|
||||
{
|
||||
if (preg_match('/^([^@]+)@([^@]+)$/i',$obj->file,$regs))
|
||||
{
|
||||
$boxname = preg_replace('/.php$/i','',$regs[1]);
|
||||
$boxname = preg_replace('/\.php$/i','',$regs[1]);
|
||||
$module = $regs[2];
|
||||
$relsourcefile = "/".$module."/core/boxes/".$boxname.".php";
|
||||
}
|
||||
else
|
||||
{
|
||||
$boxname=preg_replace('/.php$/i','',$obj->file);
|
||||
$boxname=preg_replace('/\.php$/i','',$obj->file);
|
||||
$relsourcefile = "/core/boxes/".$boxname.".php";
|
||||
}
|
||||
|
||||
|
||||
@ -300,7 +300,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
|
||||
$sqlmodified++;
|
||||
}
|
||||
|
||||
if ($sqlmodified) dol_syslog('Admin.lib::run_sql New Request '.($i+1).' sql='.$newsql, LOG_DEBUG);
|
||||
if ($sqlmodified) dol_syslog('Admin.lib::run_sql New Request '.($i+1).' sql='.$newsql, LOG_DEBUG);
|
||||
|
||||
$result=$db->query($newsql,$usesavepoint);
|
||||
if ($result)
|
||||
@ -1011,7 +1011,7 @@ function form_constantes($tableau,$strictw3c=0)
|
||||
$form = new Form($db);
|
||||
|
||||
if (! empty($strictw3c)) print "\n".'<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
@ -1076,6 +1076,17 @@ function form_constantes($tableau,$strictw3c=0)
|
||||
print '</div>';
|
||||
//print 'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members/remove?adminpw=%MAILMAN_ADMINPW%&unsubscribees=%EMAIL%';
|
||||
}
|
||||
if ($const == 'ADHERENT_MAILMAN_LISTS')
|
||||
{
|
||||
print '. '.$langs->trans("Example").': <a href="#" id="exampleclick3">'.img_down().'</a><br>';
|
||||
print '<div id="example3" class="hidden">';
|
||||
print 'mymailmanlist<br>';
|
||||
print 'mymailmanlist1,mymailmanlist2<br>';
|
||||
print 'TYPE:Type1:mymailmanlist1,TYPE:Type2:mymailmanlist2<br>';
|
||||
if ($conf->categorie->enabled) print 'CATEG:Categ1:mymailmanlist1,CATEG:Categ2:mymailmanlist2<br>';
|
||||
print '</div>';
|
||||
//print 'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members/remove?adminpw=%MAILMAN_ADMINPW%&unsubscribees=%EMAIL%';
|
||||
}
|
||||
|
||||
print "</td>\n";
|
||||
|
||||
@ -1129,14 +1140,14 @@ function form_constantes($tableau,$strictw3c=0)
|
||||
print '<td align="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||
print "</td>";
|
||||
}
|
||||
}
|
||||
print "</tr>\n";
|
||||
if (empty($strictw3c)) print "</form>\n";
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
if (! empty($strictw3c))
|
||||
if (! empty($strictw3c))
|
||||
{
|
||||
print '<div align="center"><input type="submit" class="button" value="'.$langs->trans("Update").'" name="update"></div>';
|
||||
print "</form>\n";
|
||||
|
||||
@ -253,7 +253,7 @@ function barcode_encode_genbarcode($code,$encoding)
|
||||
|
||||
$command=escapeshellarg($genbarcode_loc);
|
||||
//$paramclear=" \"".str_replace("\"", "\\\"",$code)."\" \"".str_replace("\"", "\\\"",strtoupper($encoding))."\"";
|
||||
$paramclear=" ".escapeshellarg($code)." ".escapeshellarg(strtoupper($encoding));
|
||||
$paramclear=" ".escapeshellarg($code)." ".escapeshellarg(strtoupper($encoding));
|
||||
|
||||
$fullcommandclear=$command." ".$paramclear." 2>&1";
|
||||
//print $fullcommandclear."<br>\n";exit;
|
||||
|
||||
@ -66,11 +66,11 @@ function contact_prepare_head($object)
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'contact');
|
||||
|
||||
// Notes
|
||||
$head[$h][0] = DOL_URL_ROOT.'/contact/note.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Note");
|
||||
$head[$h][2] = 'note';
|
||||
$h++;
|
||||
// Notes
|
||||
$head[$h][0] = DOL_URL_ROOT.'/contact/note.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Note");
|
||||
$head[$h][2] = 'note';
|
||||
$h++;
|
||||
|
||||
// Info
|
||||
$head[$h][0] = DOL_URL_ROOT.'/contact/info.php?id='.$object->id;
|
||||
|
||||
@ -1251,175 +1251,175 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re
|
||||
$sqlprotectagainstexternals='';
|
||||
$ret=array();
|
||||
|
||||
// find the subdirectory name as the reference
|
||||
// find the subdirectory name as the reference
|
||||
if (empty($refname)) $refname=basename(dirname($original_file)."/");
|
||||
|
||||
// Wrapping for some images
|
||||
if ($modulepart == 'companylogo')
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->mycompany->dir_output.'/logos/'.$original_file;
|
||||
}
|
||||
// Wrapping for users photos
|
||||
elseif ($modulepart == 'userphoto')
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->user->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping for members photos
|
||||
elseif ($modulepart == 'memberphoto')
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->adherent->dir_output.'/'.$original_file;
|
||||
if ($modulepart == 'companylogo')
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->mycompany->dir_output.'/logos/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les apercu factures
|
||||
elseif ($modulepart == 'apercufacture')
|
||||
{
|
||||
if ($user->rights->facture->lire) $accessallowed=1;
|
||||
$original_file=$conf->facture->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les apercu propal
|
||||
elseif ($modulepart == 'apercupropal')
|
||||
{
|
||||
if ($user->rights->propale->lire) $accessallowed=1;
|
||||
$original_file=$conf->propal->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les apercu commande
|
||||
elseif ($modulepart == 'apercucommande')
|
||||
{
|
||||
if ($user->rights->commande->lire) $accessallowed=1;
|
||||
$original_file=$conf->commande->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les apercu intervention
|
||||
elseif ($modulepart == 'apercufichinter')
|
||||
{
|
||||
if ($user->rights->ficheinter->lire) $accessallowed=1;
|
||||
$original_file=$conf->ficheinter->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images des stats propales
|
||||
elseif ($modulepart == 'propalstats')
|
||||
{
|
||||
if ($user->rights->propale->lire) $accessallowed=1;
|
||||
$original_file=$conf->propal->dir_temp.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images des stats commandes
|
||||
elseif ($modulepart == 'orderstats')
|
||||
{
|
||||
if ($user->rights->commande->lire) $accessallowed=1;
|
||||
$original_file=$conf->commande->dir_temp.'/'.$original_file;
|
||||
}
|
||||
elseif ($modulepart == 'orderstatssupplier')
|
||||
{
|
||||
if ($user->rights->fournisseur->commande->lire) $accessallowed=1;
|
||||
$original_file=$conf->fournisseur->dir_output.'/commande/temp/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images des stats factures
|
||||
elseif ($modulepart == 'billstats')
|
||||
{
|
||||
if ($user->rights->facture->lire) $accessallowed=1;
|
||||
$original_file=$conf->facture->dir_temp.'/'.$original_file;
|
||||
}
|
||||
elseif ($modulepart == 'billstatssupplier')
|
||||
{
|
||||
if ($user->rights->fournisseur->facture->lire) $accessallowed=1;
|
||||
$original_file=$conf->fournisseur->dir_output.'/facture/temp/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images des stats expeditions
|
||||
elseif ($modulepart == 'expeditionstats')
|
||||
{
|
||||
if ($user->rights->expedition->lire) $accessallowed=1;
|
||||
$original_file=$conf->expedition->dir_temp.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images des stats expeditions
|
||||
elseif ($modulepart == 'tripsexpensesstats')
|
||||
{
|
||||
if ($user->rights->deplacement->lire) $accessallowed=1;
|
||||
$original_file=$conf->deplacement->dir_temp.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images des stats expeditions
|
||||
elseif ($modulepart == 'memberstats')
|
||||
{
|
||||
if ($user->rights->adherent->lire) $accessallowed=1;
|
||||
$original_file=$conf->adherent->dir_temp.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images des stats produits
|
||||
elseif (preg_match('/^productstats_/i',$modulepart))
|
||||
{
|
||||
if ($user->rights->produit->lire || $user->rights->service->lire) $accessallowed=1;
|
||||
$original_file=(!empty($conf->product->multidir_temp[$entity])?$conf->product->multidir_temp[$entity]:$conf->service->multidir_temp[$entity]).'/'.$original_file;
|
||||
}
|
||||
// Wrapping for products or services
|
||||
elseif ($modulepart == 'tax')
|
||||
{
|
||||
if ($user->rights->tax->charges->lire) $accessallowed=1;
|
||||
$original_file=$conf->tax->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping for products or services
|
||||
elseif ($modulepart == 'actions')
|
||||
{
|
||||
if ($user->rights->agenda->myactions->read) $accessallowed=1;
|
||||
$original_file=$conf->agenda->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping for categories
|
||||
elseif ($modulepart == 'category')
|
||||
{
|
||||
if ($user->rights->categorie->lire) $accessallowed=1;
|
||||
$original_file=$conf->categorie->multidir_output[$entity].'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les prelevements
|
||||
elseif ($modulepart == 'prelevement')
|
||||
// Wrapping for users photos
|
||||
elseif ($modulepart == 'userphoto')
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->user->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping for members photos
|
||||
elseif ($modulepart == 'memberphoto')
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->adherent->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les apercu factures
|
||||
elseif ($modulepart == 'apercufacture')
|
||||
{
|
||||
if ($user->rights->facture->lire) $accessallowed=1;
|
||||
$original_file=$conf->facture->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les apercu propal
|
||||
elseif ($modulepart == 'apercupropal')
|
||||
{
|
||||
if ($user->rights->propale->lire) $accessallowed=1;
|
||||
$original_file=$conf->propal->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les apercu commande
|
||||
elseif ($modulepart == 'apercucommande')
|
||||
{
|
||||
if ($user->rights->commande->lire) $accessallowed=1;
|
||||
$original_file=$conf->commande->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les apercu intervention
|
||||
elseif ($modulepart == 'apercufichinter')
|
||||
{
|
||||
if ($user->rights->ficheinter->lire) $accessallowed=1;
|
||||
$original_file=$conf->ficheinter->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images des stats propales
|
||||
elseif ($modulepart == 'propalstats')
|
||||
{
|
||||
if ($user->rights->propale->lire) $accessallowed=1;
|
||||
$original_file=$conf->propal->dir_temp.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images des stats commandes
|
||||
elseif ($modulepart == 'orderstats')
|
||||
{
|
||||
if ($user->rights->commande->lire) $accessallowed=1;
|
||||
$original_file=$conf->commande->dir_temp.'/'.$original_file;
|
||||
}
|
||||
elseif ($modulepart == 'orderstatssupplier')
|
||||
{
|
||||
if ($user->rights->fournisseur->commande->lire) $accessallowed=1;
|
||||
$original_file=$conf->fournisseur->dir_output.'/commande/temp/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images des stats factures
|
||||
elseif ($modulepart == 'billstats')
|
||||
{
|
||||
if ($user->rights->facture->lire) $accessallowed=1;
|
||||
$original_file=$conf->facture->dir_temp.'/'.$original_file;
|
||||
}
|
||||
elseif ($modulepart == 'billstatssupplier')
|
||||
{
|
||||
if ($user->rights->fournisseur->facture->lire) $accessallowed=1;
|
||||
$original_file=$conf->fournisseur->dir_output.'/facture/temp/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images des stats expeditions
|
||||
elseif ($modulepart == 'expeditionstats')
|
||||
{
|
||||
if ($user->rights->expedition->lire) $accessallowed=1;
|
||||
$original_file=$conf->expedition->dir_temp.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images des stats expeditions
|
||||
elseif ($modulepart == 'tripsexpensesstats')
|
||||
{
|
||||
if ($user->rights->deplacement->lire) $accessallowed=1;
|
||||
$original_file=$conf->deplacement->dir_temp.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images des stats expeditions
|
||||
elseif ($modulepart == 'memberstats')
|
||||
{
|
||||
if ($user->rights->adherent->lire) $accessallowed=1;
|
||||
$original_file=$conf->adherent->dir_temp.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images des stats produits
|
||||
elseif (preg_match('/^productstats_/i',$modulepart))
|
||||
{
|
||||
if ($user->rights->produit->lire || $user->rights->service->lire) $accessallowed=1;
|
||||
$original_file=(!empty($conf->product->multidir_temp[$entity])?$conf->product->multidir_temp[$entity]:$conf->service->multidir_temp[$entity]).'/'.$original_file;
|
||||
}
|
||||
// Wrapping for products or services
|
||||
elseif ($modulepart == 'tax')
|
||||
{
|
||||
if ($user->rights->tax->charges->lire) $accessallowed=1;
|
||||
$original_file=$conf->tax->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping for products or services
|
||||
elseif ($modulepart == 'actions')
|
||||
{
|
||||
if ($user->rights->agenda->myactions->read) $accessallowed=1;
|
||||
$original_file=$conf->agenda->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping for categories
|
||||
elseif ($modulepart == 'category')
|
||||
{
|
||||
if ($user->rights->categorie->lire) $accessallowed=1;
|
||||
$original_file=$conf->categorie->multidir_output[$entity].'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les prelevements
|
||||
elseif ($modulepart == 'prelevement')
|
||||
{
|
||||
if ($user->rights->prelevement->bons->lire || preg_match('/^specimen/i',$original_file))
|
||||
{
|
||||
$accessallowed=1;
|
||||
}
|
||||
$original_file=$conf->prelevement->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les graph energie
|
||||
elseif ($modulepart == 'graph_stock')
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->stock->dir_temp.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les graph fournisseurs
|
||||
elseif ($modulepart == 'graph_fourn')
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->fournisseur->dir_temp.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les graph des produits
|
||||
elseif ($modulepart == 'graph_product')
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->product->multidir_temp[$entity].'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les code barre
|
||||
elseif ($modulepart == 'barcode')
|
||||
{
|
||||
$accessallowed=1;
|
||||
// If viewimage is called for barcode, we try to output an image on the fly,
|
||||
// with not build of file on disk.
|
||||
//$original_file=$conf->barcode->dir_temp.'/'.$original_file;
|
||||
$original_file='';
|
||||
}
|
||||
// Wrapping pour les icones de background des mailings
|
||||
elseif ($modulepart == 'iconmailing')
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->mailing->dir_temp.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les icones de background des mailings
|
||||
elseif ($modulepart == 'scanner_user_temp')
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->scanner->dir_temp.'/'.$user->id.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images fckeditor
|
||||
elseif ($modulepart == 'fckeditor')
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->fckeditor->dir_output.'/'.$original_file;
|
||||
}
|
||||
$original_file=$conf->prelevement->dir_output.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les graph energie
|
||||
elseif ($modulepart == 'graph_stock')
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->stock->dir_temp.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les graph fournisseurs
|
||||
elseif ($modulepart == 'graph_fourn')
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->fournisseur->dir_temp.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les graph des produits
|
||||
elseif ($modulepart == 'graph_product')
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->product->multidir_temp[$entity].'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les code barre
|
||||
elseif ($modulepart == 'barcode')
|
||||
{
|
||||
$accessallowed=1;
|
||||
// If viewimage is called for barcode, we try to output an image on the fly,
|
||||
// with not build of file on disk.
|
||||
//$original_file=$conf->barcode->dir_temp.'/'.$original_file;
|
||||
$original_file='';
|
||||
}
|
||||
// Wrapping pour les icones de background des mailings
|
||||
elseif ($modulepart == 'iconmailing')
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->mailing->dir_temp.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les icones de background des mailings
|
||||
elseif ($modulepart == 'scanner_user_temp')
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->scanner->dir_temp.'/'.$user->id.'/'.$original_file;
|
||||
}
|
||||
// Wrapping pour les images fckeditor
|
||||
elseif ($modulepart == 'fckeditor')
|
||||
{
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->fckeditor->dir_output.'/'.$original_file;
|
||||
}
|
||||
|
||||
// Wrapping for third parties
|
||||
else if ($modulepart == 'company' || $modulepart == 'societe')
|
||||
@ -1711,36 +1711,36 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$re
|
||||
else
|
||||
{
|
||||
// Define $accessallowed
|
||||
if (preg_match('/^([a-z]+)_user_temp$/i',$modulepart,$reg))
|
||||
{
|
||||
if ($user->rights->$reg[1]->lire || $user->rights->$reg[1]->read || ($user->rights->$reg[1]->download)) $accessallowed=1;
|
||||
$original_file=$conf->$reg[1]->dir_temp.'/'.$user->id.'/'.$original_file;
|
||||
}
|
||||
else if (preg_match('/^([a-z]+)_temp$/i',$modulepart,$reg))
|
||||
{
|
||||
if ($user->rights->$reg[1]->lire || $user->rights->$reg[1]->read || ($user->rights->$reg[1]->download)) $accessallowed=1;
|
||||
$original_file=$conf->$reg[1]->dir_temp.'/'.$original_file;
|
||||
}
|
||||
else if (preg_match('/^([a-z]+)_user$/i',$modulepart,$reg))
|
||||
{
|
||||
if ($user->rights->$reg[1]->lire || $user->rights->$reg[1]->read || ($user->rights->$reg[1]->download)) $accessallowed=1;
|
||||
$original_file=$conf->$reg[1]->dir_output.'/'.$user->id.'/'.$original_file;
|
||||
}
|
||||
else
|
||||
{
|
||||
$perm=GETPOST('perm');
|
||||
$subperm=GETPOST('subperm');
|
||||
if ($perm || $subperm)
|
||||
{
|
||||
if (($perm && ! $subperm && $user->rights->$modulepart->$perm) || ($perm && $subperm && $user->rights->$modulepart->$perm->$subperm)) $accessallowed=1;
|
||||
$original_file=$conf->$modulepart->dir_output.'/'.$original_file;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($user->rights->$modulepart->lire || $user->rights->$modulepart->read) $accessallowed=1;
|
||||
$original_file=$conf->$modulepart->dir_output.'/'.$original_file;
|
||||
}
|
||||
}
|
||||
if (preg_match('/^([a-z]+)_user_temp$/i',$modulepart,$reg))
|
||||
{
|
||||
if ($user->rights->$reg[1]->lire || $user->rights->$reg[1]->read || ($user->rights->$reg[1]->download)) $accessallowed=1;
|
||||
$original_file=$conf->$reg[1]->dir_temp.'/'.$user->id.'/'.$original_file;
|
||||
}
|
||||
else if (preg_match('/^([a-z]+)_temp$/i',$modulepart,$reg))
|
||||
{
|
||||
if ($user->rights->$reg[1]->lire || $user->rights->$reg[1]->read || ($user->rights->$reg[1]->download)) $accessallowed=1;
|
||||
$original_file=$conf->$reg[1]->dir_temp.'/'.$original_file;
|
||||
}
|
||||
else if (preg_match('/^([a-z]+)_user$/i',$modulepart,$reg))
|
||||
{
|
||||
if ($user->rights->$reg[1]->lire || $user->rights->$reg[1]->read || ($user->rights->$reg[1]->download)) $accessallowed=1;
|
||||
$original_file=$conf->$reg[1]->dir_output.'/'.$user->id.'/'.$original_file;
|
||||
}
|
||||
else
|
||||
{
|
||||
$perm=GETPOST('perm');
|
||||
$subperm=GETPOST('subperm');
|
||||
if ($perm || $subperm)
|
||||
{
|
||||
if (($perm && ! $subperm && $user->rights->$modulepart->$perm) || ($perm && $subperm && $user->rights->$modulepart->$perm->$subperm)) $accessallowed=1;
|
||||
$original_file=$conf->$modulepart->dir_output.'/'.$original_file;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($user->rights->$modulepart->lire || $user->rights->$modulepart->read) $accessallowed=1;
|
||||
$original_file=$conf->$modulepart->dir_output.'/'.$original_file;
|
||||
}
|
||||
}
|
||||
if (preg_match('/^specimen/i',$original_file)) $accessallowed=1; // If link to a specimen
|
||||
if ($user->admin) $accessallowed=1; // If user is admin
|
||||
|
||||
|
||||
@ -741,7 +741,7 @@ function dol_format_address($object,$withcountry=0,$sep="\n")
|
||||
}
|
||||
}
|
||||
|
||||
if ($withcountry) $ret.=($object->country?$sep.$object->country:'');
|
||||
if ($withcountry) $ret.=($object->country?$sep.$object->country:'');
|
||||
|
||||
return $ret;
|
||||
}
|
||||
@ -834,12 +834,12 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e
|
||||
else if ($format == 'dayxcard') $format='%Y%m%d';
|
||||
else if ($format == 'dayrfc') $format='%Y-%m-%d'; // DATE_RFC3339
|
||||
else if ($format == 'dayhourrfc') $format='%Y-%m-%dT%H:%M:%SZ'; // DATETIME RFC3339
|
||||
else if ($format == 'standard') $format='%Y-%m-%d %H:%M:%S';
|
||||
else if ($format == 'standard') $format='%Y-%m-%d %H:%M:%S';
|
||||
|
||||
if ($reduceformat)
|
||||
{
|
||||
$format=str_replace('%Y','%y',$format);
|
||||
$format=str_replace('yyyy','yy',$format);
|
||||
$format=str_replace('%Y','%y',$format);
|
||||
$format=str_replace('yyyy','yy',$format);
|
||||
}
|
||||
|
||||
// If date undefined or "", we return ""
|
||||
@ -1230,8 +1230,8 @@ function dol_print_phone($phone,$country='',$cid=0,$socid=0,$addlink='',$separ="
|
||||
{
|
||||
if (! empty($conf->browser->phone)) // If phone, we use link of phone
|
||||
{
|
||||
$newphone ='<a href="tel:'.$phone.'"';
|
||||
$newphone.='>'.$phone.'</a>';
|
||||
$newphone ='<a href="tel:'.$phone.'"';
|
||||
$newphone.='>'.$phone.'</a>';
|
||||
}
|
||||
else if (! empty($conf->clicktodial->enabled) && $addlink == 'AC_TEL') // If click to dial, we use click to dial url
|
||||
{
|
||||
@ -2329,10 +2329,10 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m
|
||||
|
||||
if (! empty($conf->dol_optimize_smallscreen) && empty($thead) && $field) // If this is a sort field
|
||||
{
|
||||
$options=preg_replace('/sortfield=([a-zA-Z0-9,\s\.]+)/i','',$moreparam);
|
||||
$options=preg_replace('/sortorder=([a-zA-Z0-9,\s\.]+)/i','',$options);
|
||||
$options=preg_replace('/&+/i','&',$options);
|
||||
if (! preg_match('/^&/',$options)) $options='&'.$options;
|
||||
$options=preg_replace('/sortfield=([a-zA-Z0-9,\s\.]+)/i','',$moreparam);
|
||||
$options=preg_replace('/sortorder=([a-zA-Z0-9,\s\.]+)/i','',$options);
|
||||
$options=preg_replace('/&+/i','&',$options);
|
||||
if (! preg_match('/^&/',$options)) $options='&'.$options;
|
||||
|
||||
if ($sortorder == 'DESC' ) $out.= '<a href="'.$file.'?sortfield='.$field.'&sortorder=asc&begin='.$begin.$options.'">';
|
||||
if ($sortorder == 'ASC' ) $out.= '<a href="'.$file.'?sortfield='.$field.'&sortorder=desc&begin='.$begin.$options.'">';
|
||||
@ -2342,7 +2342,7 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m
|
||||
|
||||
if (! empty($conf->dol_optimize_smallscreen) && empty($thead) && $field) // If this is a sort field
|
||||
{
|
||||
$out.='</a>';
|
||||
$out.='</a>';
|
||||
}
|
||||
|
||||
if (empty($conf->dol_optimize_smallscreen) && empty($thead) && $field) // If this is a sort field
|
||||
|
||||
@ -745,18 +745,18 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
|
||||
{
|
||||
$counterpadded=str_pad($counter,dol_strlen($maskcounter),"0",STR_PAD_LEFT);
|
||||
|
||||
// Define $maskLike
|
||||
$maskLike = dol_string_nospecial($mask);
|
||||
$maskLike = str_replace("%","_",$maskLike);
|
||||
// Replace protected special codes with matching number of _ as wild card caracter
|
||||
$maskLike = preg_replace('/\{yyyy\}/i','____',$maskLike);
|
||||
$maskLike = preg_replace('/\{yy\}/i','__',$maskLike);
|
||||
$maskLike = preg_replace('/\{y\}/i','_',$maskLike);
|
||||
$maskLike = preg_replace('/\{mm\}/i','__',$maskLike);
|
||||
$maskLike = preg_replace('/\{dd\}/i','__',$maskLike);
|
||||
$maskLike = str_replace(dol_string_nospecial('{'.$masktri.'}'),$counterpadded,$maskLike);
|
||||
if ($maskrefclient) $maskLike = str_replace(dol_string_nospecial('{'.$maskrefclient.'}'),str_pad("",dol_strlen($maskrefclient),"_"),$maskLike);
|
||||
if ($masktype) $maskLike = str_replace(dol_string_nospecial('{'.$masktype.'}'),$masktype_value,$maskLike);
|
||||
// Define $maskLike
|
||||
$maskLike = dol_string_nospecial($mask);
|
||||
$maskLike = str_replace("%","_",$maskLike);
|
||||
// Replace protected special codes with matching number of _ as wild card caracter
|
||||
$maskLike = preg_replace('/\{yyyy\}/i','____',$maskLike);
|
||||
$maskLike = preg_replace('/\{yy\}/i','__',$maskLike);
|
||||
$maskLike = preg_replace('/\{y\}/i','_',$maskLike);
|
||||
$maskLike = preg_replace('/\{mm\}/i','__',$maskLike);
|
||||
$maskLike = preg_replace('/\{dd\}/i','__',$maskLike);
|
||||
$maskLike = str_replace(dol_string_nospecial('{'.$masktri.'}'),$counterpadded,$maskLike);
|
||||
if ($maskrefclient) $maskLike = str_replace(dol_string_nospecial('{'.$maskrefclient.'}'),str_pad("",dol_strlen($maskrefclient),"_"),$maskLike);
|
||||
if ($masktype) $maskLike = str_replace(dol_string_nospecial('{'.$masktype.'}'),$masktype_value,$maskLike);
|
||||
|
||||
$ref='';
|
||||
$sql = "SELECT ".$field." as ref";
|
||||
@ -764,8 +764,8 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
|
||||
$sql.= " WHERE ".$field." LIKE '".$maskLike."'";
|
||||
$sql.= " AND ".$field." NOT LIKE '%PROV%'";
|
||||
$sql.= " AND entity IN (".getEntity($table, 1).")";
|
||||
if ($where) $sql.=$where;
|
||||
if ($sqlwhere) $sql.=' AND '.$sqlwhere;
|
||||
if ($where) $sql.=$where;
|
||||
if ($sqlwhere) $sql.=' AND '.$sqlwhere;
|
||||
|
||||
dol_syslog("functions2::get_next_value sql=".$sql);
|
||||
$resql=$db->query($sql);
|
||||
|
||||
@ -238,7 +238,7 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte
|
||||
$filename='mergedpdf';
|
||||
|
||||
if (! empty($option)) $filename.='_'.$option;
|
||||
$file=$diroutputpdf.'/'.$filename.'.pdf';
|
||||
$file=$diroutputpdf.'/'.$filename.'.pdf';
|
||||
|
||||
if (! $error && $pagecount)
|
||||
{
|
||||
|
||||
@ -32,12 +32,12 @@ function mailmanspip_admin_prepare_head()
|
||||
|
||||
return array(
|
||||
array(
|
||||
DOL_URL_ROOT.'/adherents/admin/mailman.php',
|
||||
DOL_URL_ROOT.'/admin/mailman.php',
|
||||
$langs->trans('Mailman'),
|
||||
'mailman'
|
||||
),
|
||||
array(
|
||||
DOL_URL_ROOT.'/adherents/admin/spip.php',
|
||||
DOL_URL_ROOT.'/admin/spip.php',
|
||||
$langs->trans('SPIP'),
|
||||
'spip'
|
||||
)
|
||||
|
||||
@ -291,9 +291,9 @@ function dol_loginfunction($langs,$conf,$mysoc)
|
||||
// Set dol_hide_topmenu, dol_hide_leftmenu, dol_optimize_smallscreen, dol_nomousehover
|
||||
$dol_hide_topmenu=GETPOST('dol_hide_topmenu');
|
||||
$dol_hide_leftmenu=GETPOST('dol_hide_leftmenu');
|
||||
$dol_optimize_smallscreen=GETPOST('dol_optimize_smallscreen');
|
||||
$dol_no_mouse_hover=GETPOST('dol_no_mouse_hover');
|
||||
$dol_use_jmobile=GETPOST('dol_use_jmobile');
|
||||
$dol_optimize_smallscreen=GETPOST('dol_optimize_smallscreen');
|
||||
$dol_no_mouse_hover=GETPOST('dol_no_mouse_hover');
|
||||
$dol_use_jmobile=GETPOST('dol_use_jmobile');
|
||||
|
||||
// Include login page template
|
||||
include $template_dir.'login.tpl.php';
|
||||
|
||||
@ -110,7 +110,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
||||
|
||||
-- Commercial - Proposals
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1100__+MAX_llx_menu__, 'commercial', 'propals', 5__+MAX_llx_menu__, '/comm/propal/index.php?leftmenu=propals', 'Prop', 0, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1101__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/societe/societe.php?leftmenu=propals', 'NewPropal', 1, 'propal', '$user->rights->propale->creer', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1101__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal.php?action=create&leftmenu=propals', 'NewPropal', 1, 'propal', '$user->rights->propale->creer', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1102__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/list.php?leftmenu=propals', 'List', 1, 'propal', '$user->rights->propale->lire', '', 2, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1103__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?leftmenu=propals&viewstatut=0', 'PropalsDraft', 1, 'propal', '$user->rights->propale->lire', '', 2, 2, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1104__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?leftmenu=propals&viewstatut=1', 'PropalsOpened', 1, 'propal', '$user->rights->propale->lire', '', 2, 3, __ENTITY__);
|
||||
@ -120,7 +120,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1110__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/stats/index.php?leftmenu=propals', 'Statistics', 1, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__);
|
||||
-- Commercial - Customer's orders
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1200__+MAX_llx_menu__, 'commercial', 'orders', 5__+MAX_llx_menu__, '/commande/index.php?leftmenu=orders', 'CustomersOrders', 0, 'orders', '$user->rights->commande->lire', '', 2, 5, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1201__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/societe/societe.php?leftmenu=orders', 'NewOrder', 1, 'orders', '$user->rights->commande->creer', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1201__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/fiche.php?action=create&leftmenu=orders', 'NewOrder', 1, 'orders', '$user->rights->commande->creer', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1202__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/liste.php?leftmenu=orders', 'List', 1, 'orders', '$user->rights->commande->lire', '', 2, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1203__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/liste.php?leftmenu=orders&viewstatut=0', 'StatusOrderDraftShort', 1, 'orders', '$user->rights->commande->lire', '', 2, 2, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1204__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/liste.php?leftmenu=orders&viewstatut=1', 'StatusOrderValidated', 1, 'orders', '$user->rights->commande->lire', '', 2, 3, __ENTITY__);
|
||||
@ -131,12 +131,12 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1209__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/stats/index.php?leftmenu=orders', 'Statistics', 1, 'orders', '$user->rights->commande->lire', '', 2, 4, __ENTITY__);
|
||||
-- Commercial - Supplier's orders
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->fournisseur->enabled', __HANDLER__, 'left', 5100__+MAX_llx_menu__, 'commercial', 'orders_suppliers', 5__+MAX_llx_menu__, '/fourn/commande/index.php?leftmenu=orders_suppliers', 'SuppliersOrders', 0, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 6, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->fournisseur->enabled', __HANDLER__, 'left', 5101__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/societe/societe.php?leftmenu=orders_suppliers', 'NewOrder', 1, 'orders', '$user->rights->fournisseur->commande->creer', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->fournisseur->enabled', __HANDLER__, 'left', 5101__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/fiche.php?action=create&leftmenu=orders_suppliers', 'NewOrder', 1, 'orders', '$user->rights->fournisseur->commande->creer', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->fournisseur->enabled', __HANDLER__, 'left', 5102__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/liste.php?leftmenu=orders_suppliers&viewstatut=0', 'List', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->fournisseur->enabled', __HANDLER__, 'left', 5108__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier', 'Statistics', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 7, __ENTITY__);
|
||||
-- Commercial - Contracts
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1400__+MAX_llx_menu__, 'commercial', 'contracts', 5__+MAX_llx_menu__, '/contrat/index.php?leftmenu=contracts', 'Contracts', 0, 'contracts', '$user->rights->contrat->lire', '', 2, 7, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1401__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/societe/societe.php?leftmenu=contracts', 'NewContract', 1, 'contracts', '$user->rights->contrat->creer', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1401__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/fiche.php?&action=create&leftmenu=contracts', 'NewContract', 1, 'contracts', '$user->rights->contrat->creer', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1402__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/liste.php?leftmenu=contracts', 'List', 1, 'contracts', '$user->rights->contrat->lire', '', 2, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1403__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/services.php?leftmenu=contracts', 'MenuServices', 1, 'contracts', '$user->rights->contrat->lire', '', 2, 2, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled&&$leftmenu=="contracts"', __HANDLER__, 'left', 1404__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services.php?leftmenu=contracts&mode=0', 'MenuInactiveServices', 2, 'contracts', '$user->rights->contrat->lire', '', 2, 0, __ENTITY__);
|
||||
@ -155,7 +155,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->fournisseur->enabled', __HANDLER__, 'left', 1604__+MAX_llx_menu__, 'accountancy', '', 1600__+MAX_llx_menu__, '/compta/facture/stats/index.php?leftmenu=customers_bills&mode=supplier', 'Statistics', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 8, __ENTITY__);
|
||||
-- Accountancy - Customer invoice
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'accountancy', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/clients.php?action=facturer&leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/facture.php?action=create&leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1702__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/facture/fiche-rec.php?leftmenu=customers_bills', 'Repeatable', 1, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1703__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/facture/impayees.php?action=facturer&leftmenu=customers_bills', 'Unpaid', 1, 'bills', '$user->rights->facture->lire', '', 2, 5, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1704__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/paiement/liste.php?leftmenu=customers_bills', 'Payments', 1, 'bills', '$user->rights->facture->lire', '', 2, 6, __ENTITY__);
|
||||
|
||||
@ -76,8 +76,8 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0)
|
||||
}
|
||||
$url=preg_replace('/__LOGIN__/',$user->login,$url);
|
||||
$shorturl=preg_replace('/__LOGIN__/',$user->login,$shorturl);
|
||||
$url=preg_replace('/__USERID__/',$user->id,$url);
|
||||
$shorturl=preg_replace('/__USERID__/',$user->id,$shorturl);
|
||||
$url=preg_replace('/__USERID__/',$user->id,$url);
|
||||
$shorturl=preg_replace('/__USERID__/',$user->id,$shorturl);
|
||||
|
||||
// Define the class (top menu selected or not)
|
||||
if (! empty($_SESSION['idmenu']) && $newTabMenu[$i]['rowid'] == $_SESSION['idmenu']) $classname='class="tmenusel"';
|
||||
@ -238,54 +238,54 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
|
||||
$menuArbo = new Menubase($db,'auguria');
|
||||
$newmenu = $menuArbo->menuLeftCharger($newmenu,$mainmenu,$leftmenu,($user->societe_id?1:0),'auguria',$tabMenu);
|
||||
|
||||
// We update newmenu for special dynamic menus
|
||||
if ($conf->banque->enabled && $user->rights->banque->lire && $mainmenu == 'bank') // Entry for each bank account
|
||||
{
|
||||
$sql = "SELECT rowid, label, courant, rappro, courant";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
|
||||
$sql.= " WHERE entity = ".$conf->entity;
|
||||
$sql.= " AND clos = 0";
|
||||
$sql.= " ORDER BY label";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$numr = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
if ($numr > 0) $newmenu->add('/compta/bank/index.php',$langs->trans("BankAccounts"),0,$user->rights->banque->lire);
|
||||
|
||||
while ($i < $numr)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$newmenu->add('/compta/bank/fiche.php?id='.$objp->rowid,$objp->label,1,$user->rights->banque->lire);
|
||||
if ($objp->rappro && $objp->courant != 2 && empty($objp->clos)) // If not cash account and not closed and can be reconciliate
|
||||
{
|
||||
$newmenu->add('/compta/bank/rappro.php?account='.$objp->rowid,$langs->trans("Conciliate"),2,$user->rights->banque->consolidate);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else dol_print_error($db);
|
||||
$db->free($resql);
|
||||
// We update newmenu for special dynamic menus
|
||||
if ($conf->banque->enabled && $user->rights->banque->lire && $mainmenu == 'bank') // Entry for each bank account
|
||||
{
|
||||
$sql = "SELECT rowid, label, courant, rappro, courant";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
|
||||
$sql.= " WHERE entity = ".$conf->entity;
|
||||
$sql.= " AND clos = 0";
|
||||
$sql.= " ORDER BY label";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$numr = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
if ($numr > 0) $newmenu->add('/compta/bank/index.php',$langs->trans("BankAccounts"),0,$user->rights->banque->lire);
|
||||
|
||||
while ($i < $numr)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$newmenu->add('/compta/bank/fiche.php?id='.$objp->rowid,$objp->label,1,$user->rights->banque->lire);
|
||||
if ($objp->rappro && $objp->courant != 2 && empty($objp->clos)) // If not cash account and not closed and can be reconciliate
|
||||
{
|
||||
$newmenu->add('/compta/bank/rappro.php?account='.$objp->rowid,$langs->trans("Conciliate"),2,$user->rights->banque->consolidate);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else dol_print_error($db);
|
||||
$db->free($resql);
|
||||
}
|
||||
|
||||
if ($conf->ftp->enabled && $mainmenu == 'ftp') // Entry for FTP
|
||||
{
|
||||
$MAXFTP=20;
|
||||
$i=1;
|
||||
while ($i <= $MAXFTP)
|
||||
{
|
||||
$paramkey='FTP_NAME_'.$i;
|
||||
//print $paramkey;
|
||||
if (! empty($conf->global->$paramkey))
|
||||
{
|
||||
$link="/ftp/index.php?idmenu=".$_SESSION["idmenu"]."&numero_ftp=".$i;
|
||||
|
||||
$newmenu->add($link, dol_trunc($conf->global->$paramkey,24));
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$MAXFTP=20;
|
||||
$i=1;
|
||||
while ($i <= $MAXFTP)
|
||||
{
|
||||
$paramkey='FTP_NAME_'.$i;
|
||||
//print $paramkey;
|
||||
if (! empty($conf->global->$paramkey))
|
||||
{
|
||||
$link="/ftp/index.php?idmenu=".$_SESSION["idmenu"]."&numero_ftp=".$i;
|
||||
|
||||
$newmenu->add($link, dol_trunc($conf->global->$paramkey,24));
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -334,8 +334,8 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
|
||||
|
||||
// Add mainmenu in GET url. This make to go back on correct menu even when using Back on browser.
|
||||
$url=dol_buildpath($menu_array[$i]['url'],1);
|
||||
$url=preg_replace('/__LOGIN__/',$user->login,$url);
|
||||
$url=preg_replace('/__USERID__/',$user->id,$url);
|
||||
$url=preg_replace('/__LOGIN__/',$user->login,$url);
|
||||
$url=preg_replace('/__USERID__/',$user->id,$url);
|
||||
|
||||
if (! preg_match('/mainmenu=/i',$menu_array[$i]['url']))
|
||||
{
|
||||
|
||||
@ -101,7 +101,7 @@ class MenuManager
|
||||
// On va le chercher en session si non defini par le lien
|
||||
$leftmenu=isset($_SESSION["leftmenu"])?$_SESSION["leftmenu"]:'';
|
||||
}
|
||||
if (! empty($forceleftmenu)) $leftmenu=$forceleftmenu;
|
||||
if (! empty($forceleftmenu)) $leftmenu=$forceleftmenu;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
|
||||
$tabMenu=array();
|
||||
@ -191,8 +191,8 @@ class MenuManager
|
||||
if ($val['enabled'] == 1)
|
||||
{
|
||||
$relurl=dol_buildpath($val['url'],1);
|
||||
$relurl=preg_replace('/__LOGIN__/',$user->login,$relurl);
|
||||
$relurl=preg_replace('/__USERID__/',$user->id,$relurl);
|
||||
$relurl=preg_replace('/__LOGIN__/',$user->login,$relurl);
|
||||
$relurl=preg_replace('/__USERID__/',$user->id,$relurl);
|
||||
|
||||
print '<a href="#">'.$val['titre'].'</a>'."\n";
|
||||
// Search submenu fot this entry
|
||||
@ -201,7 +201,7 @@ class MenuManager
|
||||
$submenu=new Menu();
|
||||
$res=print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$submenu,1,$tmpmainmenu,$tmpleftmenu);
|
||||
$nexturl=dol_buildpath($submenu->liste[0]['url'],1);
|
||||
|
||||
|
||||
$canonrelurl=preg_replace('/\?.*$/','',$relurl);
|
||||
$canonnexturl=preg_replace('/\?.*$/','',$nexturl);
|
||||
//var_dump($canonrelurl);
|
||||
@ -210,12 +210,12 @@ class MenuManager
|
||||
if (($canonrelurl != $canonnexturl && ! in_array($val['mainmenu'],array('tools')))
|
||||
|| (strpos($canonrelurl,'/product/index.php') !== false || strpos($canonrelurl,'/compta/bank/index.php') !== false))
|
||||
{
|
||||
// We add sub entry
|
||||
print str_pad('',1).'<li data-role="list-divider" class="lilevel1 ui-btn-icon-right ui-btn">'; // ui-btn to highlight on clic
|
||||
print '<a href="'.$relurl.'">';
|
||||
print str_pad('',12,' ');
|
||||
print $langs->trans(ucfirst($val['mainmenu'])."Dashboard");
|
||||
print '</a>';
|
||||
// We add sub entry
|
||||
print str_pad('',1).'<li data-role="list-divider" class="lilevel1 ui-btn-icon-right ui-btn">'; // ui-btn to highlight on clic
|
||||
print '<a href="'.$relurl.'">';
|
||||
print str_pad('',12,' ');
|
||||
print $langs->trans(ucfirst($val['mainmenu'])."Dashboard");
|
||||
print '</a>';
|
||||
print '</li>'."\n";
|
||||
}
|
||||
foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
|
||||
@ -226,8 +226,8 @@ class MenuManager
|
||||
$canonurl2=preg_replace('/\?.*$/','',$val2['url']);
|
||||
//var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']);
|
||||
if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2='';
|
||||
if ($val2['level']==0) print str_pad('',$val2['level']+1).'<li'.($val2['level']==0?' data-role="list-divider"':'').' class="lilevel'.($val2['level']+1).' ui-btn-icon-right ui-btn">'; // ui-btn to highlight on clic
|
||||
else print str_pad('',$val2['level']+1).'<li class="lilevel'.($val2['level']+1).'">'; // ui-btn to highlight on clic
|
||||
if ($val2['level']==0) print str_pad('',$val2['level']+1).'<li'.($val2['level']==0?' data-role="list-divider"':'').' class="lilevel'.($val2['level']+1).' ui-btn-icon-right ui-btn">'; // ui-btn to highlight on clic
|
||||
else print str_pad('',$val2['level']+1).'<li class="lilevel'.($val2['level']+1).'">'; // ui-btn to highlight on clic
|
||||
if ($relurl2) print '<a href="'.$relurl2.'">';
|
||||
print str_pad('',($val2['level']+1)*12,' ');
|
||||
print $val2['titre'];
|
||||
|
||||
@ -680,7 +680,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
{
|
||||
$langs->load("orders");
|
||||
$newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
|
||||
$newmenu->add("/commande/fiche.php?action=create", $langs->trans("NewOrder"), 1, $user->rights->commande->creer);
|
||||
$newmenu->add("/commande/fiche.php?action=create&leftmenu=orders", $langs->trans("NewOrder"), 1, $user->rights->commande->creer);
|
||||
$newmenu->add("/commande/liste.php?leftmenu=orders", $langs->trans("List"), 1, $user->rights->commande->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire);
|
||||
@ -696,7 +696,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
{
|
||||
$langs->load("orders");
|
||||
$newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers",$langs->trans("SuppliersOrders"), 0, $user->rights->fournisseur->commande->lire, '', $mainmenu, 'orders_suppliers');
|
||||
$newmenu->add("/fourn/commande/fiche.php?action=create", $langs->trans("NewOrder"), 1, $user->rights->fournisseur->commande->creer);
|
||||
$newmenu->add("/fourn/commande/fiche.php?action=create&leftmenu=orders_suppliers", $langs->trans("NewOrder"), 1, $user->rights->fournisseur->commande->creer);
|
||||
$newmenu->add("/fourn/commande/liste.php?leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->rights->fournisseur->commande->lire);
|
||||
$newmenu->add("/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire);
|
||||
}
|
||||
@ -1213,15 +1213,15 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
$sql.= " WHERE entity = ".$conf->entity;
|
||||
$sql.= " AND clos = 0";
|
||||
$sql.= " ORDER BY label";
|
||||
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$numr = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
|
||||
if ($numr > 0) $newmenu->add('/compta/bank/index.php',$langs->trans("BankAccounts"),0,$user->rights->banque->lire);
|
||||
|
||||
|
||||
while ($i < $numr)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
@ -1247,16 +1247,16 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
if (! empty($conf->global->$paramkey))
|
||||
{
|
||||
$link="/ftp/index.php?idmenu=".$_SESSION["idmenu"]."&numero_ftp=".$i;
|
||||
|
||||
|
||||
$newmenu->add($link, dol_trunc($conf->global->$paramkey,24));
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Build final $menu_array = $menu_array_before +$newmenu->liste + $menu_array_after
|
||||
//var_dump($menu_array_before);exit;
|
||||
//var_dump($menu_array_after);exit;
|
||||
|
||||
@ -77,7 +77,7 @@ class MenuManager
|
||||
// On va le chercher en session si non defini par le lien
|
||||
$mainmenu=isset($_SESSION["mainmenu"])?$_SESSION["mainmenu"]:'';
|
||||
}
|
||||
if (! empty($forcemainmenu)) $mainmenu=$forcemainmenu;
|
||||
if (! empty($forcemainmenu)) $mainmenu=$forcemainmenu;
|
||||
|
||||
if (isset($_GET["leftmenu"]))
|
||||
{
|
||||
@ -98,7 +98,7 @@ class MenuManager
|
||||
// On va le chercher en session si non defini par le lien
|
||||
$leftmenu=isset($_SESSION["leftmenu"])?$_SESSION["leftmenu"]:'';
|
||||
}
|
||||
if (! empty($forceleftmenu)) $leftmenu=$forceleftmenu;
|
||||
if (! empty($forceleftmenu)) $leftmenu=$forceleftmenu;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
|
||||
$tabMenu=array();
|
||||
@ -145,8 +145,8 @@ class MenuManager
|
||||
if ($val['enabled'] == 1)
|
||||
{
|
||||
$relurl=dol_buildpath($val['url'],1);
|
||||
$relurl=preg_replace('/__LOGIN__/',$user->login,$relurl);
|
||||
$relurl=preg_replace('/__USERID__/',$user->id,$relurl);
|
||||
$relurl=preg_replace('/__LOGIN__/',$user->login,$relurl);
|
||||
$relurl=preg_replace('/__USERID__/',$user->id,$relurl);
|
||||
|
||||
print '<a href="#">'.$val['titre'].'</a>'."\n";
|
||||
// Search submenu fot this entry
|
||||
@ -158,7 +158,7 @@ class MenuManager
|
||||
|
||||
$canonrelurl=preg_replace('/\?.*$/','',$relurl);
|
||||
$canonnexturl=preg_replace('/\?.*$/','',$nexturl);
|
||||
//var_dump($canonrelurl);
|
||||
//var_dump($canonrelurl);
|
||||
//var_dump($canonnexturl);
|
||||
print '<ul>'."\n";
|
||||
if (($canonrelurl != $canonnexturl && ! in_array($val['mainmenu'],array('tools')))
|
||||
|
||||
@ -89,7 +89,7 @@ class MenuManager
|
||||
if (empty($noout)) print_start_menu_entry_empty($idsel, $classname, $showmode);
|
||||
if (empty($noout)) print_text_menu_entry_empty($langs->trans("Home"), 1, dol_buildpath('/index.php',1).'?mainmenu=home&leftmenu=', $id, $idsel, $classname, $this->atarget);
|
||||
if (empty($noout)) print_end_menu_entry_empty($showmode);
|
||||
$this->menu->add(dol_buildpath('/index.php',1), $langs->trans("Home"), 0, $showmode, $this->atarget, 'home', '');
|
||||
$this->menu->add(dol_buildpath('/index.php',1), $langs->trans("Home"), 0, $showmode, $this->atarget, 'home', '');
|
||||
|
||||
if (empty($noout)) print_end_menu_array_empty();
|
||||
|
||||
@ -191,62 +191,62 @@ class MenuManager
|
||||
{
|
||||
$this->leftmenu=dol_clone($this->menu);
|
||||
unset($this->menu->liste);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($mode == 'jmobile')
|
||||
{
|
||||
foreach($this->topmenu->liste as $key => $val) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
|
||||
{
|
||||
print '<ul data-role="listview" data-inset="true">';
|
||||
print '<li data-role="list-divider">';
|
||||
if ($val['enabled'] == 1)
|
||||
{
|
||||
$relurl=dol_buildpath($val['url'],1);
|
||||
$relurl=preg_replace('/__LOGIN__/',$user->login,$relurl);
|
||||
$relurl=preg_replace('/__USERID__/',$user->id,$relurl);
|
||||
|
||||
print '<a href="#">'.$val['titre'].'</a>'."\n";
|
||||
// Search submenu fot this entry
|
||||
$tmpmainmenu=$val['mainmenu'];
|
||||
$tmpleftmenu='all';
|
||||
//$submenu=new Menu();
|
||||
//$res=print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$submenu,1,$tmpmainmenu,$tmpleftmenu);
|
||||
//$nexturl=dol_buildpath($submenu->liste[0]['url'],1);
|
||||
$submenu=$this->leftmenu;
|
||||
|
||||
$canonrelurl=preg_replace('/\?.*$/','',$relurl);
|
||||
$canonnexturl=preg_replace('/\?.*$/','',$nexturl);
|
||||
//var_dump($canonrelurl);
|
||||
//var_dump($canonnexturl);
|
||||
print '<ul>';
|
||||
if ($mode == 'jmobile')
|
||||
{
|
||||
foreach($this->topmenu->liste as $key => $val) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
|
||||
{
|
||||
print '<ul data-role="listview" data-inset="true">';
|
||||
print '<li data-role="list-divider">';
|
||||
if ($val['enabled'] == 1)
|
||||
{
|
||||
$relurl=dol_buildpath($val['url'],1);
|
||||
$relurl=preg_replace('/__LOGIN__/',$user->login,$relurl);
|
||||
$relurl=preg_replace('/__USERID__/',$user->id,$relurl);
|
||||
|
||||
print '<a href="#">'.$val['titre'].'</a>'."\n";
|
||||
// Search submenu fot this entry
|
||||
$tmpmainmenu=$val['mainmenu'];
|
||||
$tmpleftmenu='all';
|
||||
//$submenu=new Menu();
|
||||
//$res=print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$submenu,1,$tmpmainmenu,$tmpleftmenu);
|
||||
//$nexturl=dol_buildpath($submenu->liste[0]['url'],1);
|
||||
$submenu=$this->leftmenu;
|
||||
|
||||
$canonrelurl=preg_replace('/\?.*$/','',$relurl);
|
||||
$canonnexturl=preg_replace('/\?.*$/','',$nexturl);
|
||||
//var_dump($canonrelurl);
|
||||
//var_dump($canonnexturl);
|
||||
print '<ul>';
|
||||
if ($canonrelurl != $canonnexturl && ! in_array($val['mainmenu'],array('home','tools')))
|
||||
{
|
||||
// We add sub entry
|
||||
print '<li data-role="list-divider"><a href="'.$relurl.'">'.$langs->trans("MainArea").'-'.$val['titre'].'</a></li>'."\n";
|
||||
}
|
||||
foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
|
||||
{
|
||||
$relurl2=dol_buildpath($val2['url'],1);
|
||||
$relurl2=preg_replace('/__LOGIN__/',$user->login,$relurl2);
|
||||
$relurl2=preg_replace('/__USERID__/',$user->id,$relurl2);
|
||||
//var_dump($val2);
|
||||
print '<li'.($val2['level']==0?' data-role="list-divider"':'').'><a href="'.$relurl2.'">'.$val2['titre'].'</a></li>'."\n";
|
||||
}
|
||||
//var_dump($submenu);
|
||||
print '</ul>';
|
||||
}
|
||||
if ($val['enabled'] == 2)
|
||||
{
|
||||
print '<font class="vsmenudisabled">'.$val['titre'].'</font>';
|
||||
}
|
||||
print '</li>';
|
||||
{
|
||||
// We add sub entry
|
||||
print '<li data-role="list-divider"><a href="'.$relurl.'">'.$langs->trans("MainArea").'-'.$val['titre'].'</a></li>'."\n";
|
||||
}
|
||||
foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
|
||||
{
|
||||
$relurl2=dol_buildpath($val2['url'],1);
|
||||
$relurl2=preg_replace('/__LOGIN__/',$user->login,$relurl2);
|
||||
$relurl2=preg_replace('/__USERID__/',$user->id,$relurl2);
|
||||
//var_dump($val2);
|
||||
print '<li'.($val2['level']==0?' data-role="list-divider"':'').'><a href="'.$relurl2.'">'.$val2['titre'].'</a></li>'."\n";
|
||||
}
|
||||
//var_dump($submenu);
|
||||
print '</ul>';
|
||||
}
|
||||
if ($val['enabled'] == 2)
|
||||
{
|
||||
print '<font class="vsmenudisabled">'.$val['titre'].'</font>';
|
||||
}
|
||||
print '</li>';
|
||||
print '</ul>'."\n";
|
||||
|
||||
break; // Only first menu entry (so home)
|
||||
}
|
||||
}
|
||||
|
||||
break; // Only first menu entry (so home)
|
||||
}
|
||||
}
|
||||
|
||||
unset($this->menu);
|
||||
|
||||
return $res;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user