Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop Conflicts: htdocs/core/lib/admin.lib.php
This commit is contained in:
commit
e25651204c
1
.gitignore
vendored
1
.gitignore
vendored
@ -14,3 +14,4 @@ doxygen_warnings.log
|
||||
/.project
|
||||
.DS_Store
|
||||
.idea
|
||||
*.iml
|
||||
|
||||
@ -536,8 +536,8 @@ 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>';
|
||||
// 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
|
||||
@ -1409,8 +1409,8 @@ else
|
||||
// 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>';
|
||||
// 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))
|
||||
|
||||
@ -44,7 +44,7 @@ $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,7 @@ $year = strftime("%Y", time());
|
||||
$startyear=$year-2;
|
||||
$endyear=$year;
|
||||
|
||||
$langs->load("members");
|
||||
$langs->load("members");
|
||||
$langs->load("companies");
|
||||
|
||||
|
||||
|
||||
@ -46,8 +46,8 @@ $year = strftime("%Y", time());
|
||||
$startyear=$year-2;
|
||||
$endyear=$year;
|
||||
|
||||
$langs->load("members");
|
||||
$langs->load("companies");
|
||||
$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)
|
||||
{
|
||||
|
||||
@ -44,8 +44,8 @@ if (! $user->admin) accessforbidden();
|
||||
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$type = 'order';
|
||||
|
||||
|
||||
|
||||
@ -40,8 +40,8 @@ if (! $user->admin) accessforbidden();
|
||||
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$type='invoice';
|
||||
|
||||
|
||||
@ -158,19 +158,19 @@ else if ($action == 'del')
|
||||
// Set default model
|
||||
else if ($action == 'setdoc')
|
||||
{
|
||||
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 (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);
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'setmod')
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -379,7 +379,7 @@ class Categorie
|
||||
{
|
||||
if ($this->id == -1) return -2;
|
||||
if ($type == 'company') $type='societe';
|
||||
if ($type == 'fournisseur') $type='societe';
|
||||
if ($type == 'fournisseur') $type='societe';
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_".$type." (fk_categorie, fk_".$type.")";
|
||||
$sql .= " VALUES (".$this->id.", ".$obj->id.")";
|
||||
|
||||
@ -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,'');
|
||||
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -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");
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -702,13 +702,13 @@ class Form
|
||||
$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;
|
||||
}
|
||||
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();
|
||||
|
||||
@ -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">';
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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)
|
||||
@ -1078,9 +1078,9 @@ function form_constantes($tableau,$strictw3c=0)
|
||||
}
|
||||
if ($const == 'ADHERENT_MAILMAN_LISTS')
|
||||
{
|
||||
print '. '.$langs->trans("Example").': <a href="#" id="exampleclick3">'.img_down().'</a><br>';
|
||||
print '. '.$langs->trans("Example").': <a href="#" id="exampleclick3">'.img_down().'</a><br>';
|
||||
print '<div id="example3" class="hidden">';
|
||||
print 'mymailmanlist<br>';
|
||||
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>';
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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'];
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -608,7 +608,7 @@ abstract class DolibarrModules
|
||||
$file = $this->boxes[$key]['file'];
|
||||
//$note = $this->boxes[$key][2];
|
||||
|
||||
if (empty($file)) $file = isset($this->boxes[$key][1])?$this->boxes[$key][1]:''; // For backward compatibility
|
||||
if (empty($file)) $file = isset($this->boxes[$key][1])?$this->boxes[$key][1]:''; // For backward compatibility
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes";
|
||||
$sql.= " USING ".MAIN_DB_PREFIX."boxes, ".MAIN_DB_PREFIX."boxes_def";
|
||||
|
||||
@ -297,7 +297,7 @@ class ExportCsv extends ModeleExports
|
||||
// Rule Dolibarr: No HTML
|
||||
//print $charset.' '.$newvalue."\n";
|
||||
$newvalue=dol_string_nohtmltag($newvalue,1,$charset);
|
||||
//print $charset.' '.$newvalue."\n";
|
||||
//print $charset.' '.$newvalue."\n";
|
||||
|
||||
// Rule 1 CSV: No CR, LF in cells
|
||||
$newvalue=str_replace("\r",'',$newvalue);
|
||||
|
||||
@ -425,19 +425,19 @@ class ExportExcel extends ModeleExports
|
||||
* @return string Letter
|
||||
*/
|
||||
function column2Letter($c)
|
||||
{
|
||||
|
||||
$c = intval($c);
|
||||
if ($c <= 0) return '';
|
||||
|
||||
{
|
||||
|
||||
$c = intval($c);
|
||||
if ($c <= 0) return '';
|
||||
|
||||
while ($c != 0)
|
||||
{
|
||||
$p = ($c - 1) % 26;
|
||||
$c = intval(($c - $p) / 26);
|
||||
$letter = chr(65 + $p) . $letter;
|
||||
}
|
||||
|
||||
return $letter;
|
||||
{
|
||||
$p = ($c - 1) % 26;
|
||||
$c = intval(($c - $p) / 26);
|
||||
$letter = chr(65 + $p) . $letter;
|
||||
}
|
||||
|
||||
return $letter;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -655,9 +655,9 @@ function tablewithentity($table)
|
||||
global $db;
|
||||
|
||||
$resql=$db->DDLDescTable($table,'entity');
|
||||
if ($resql)
|
||||
{
|
||||
$i=0;
|
||||
if ($resql)
|
||||
{
|
||||
$i=0;
|
||||
$obj=$db->fetch_object($resql);
|
||||
if ($obj) return 1;
|
||||
else return 0;
|
||||
|
||||
@ -150,17 +150,17 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
// Definition of $dir and $file
|
||||
if ($object->specimen)
|
||||
{
|
||||
$dir = $conf->expedition->dir_output."/receipt";
|
||||
$file = $dir . "/SPECIMEN.pdf";
|
||||
}
|
||||
else
|
||||
{
|
||||
$objectref = dol_sanitizeFileName($object->ref);
|
||||
$dir = $conf->expedition->dir_output."/receipt/" . $objectref;
|
||||
$file = $dir . "/" . $objectref . ".pdf";
|
||||
// Definition of $dir and $file
|
||||
if ($object->specimen)
|
||||
{
|
||||
$dir = $conf->expedition->dir_output."/receipt";
|
||||
$file = $dir . "/SPECIMEN.pdf";
|
||||
}
|
||||
else
|
||||
{
|
||||
$objectref = dol_sanitizeFileName($object->ref);
|
||||
$dir = $conf->expedition->dir_output."/receipt/" . $objectref;
|
||||
$file = $dir . "/" . $objectref . ".pdf";
|
||||
}
|
||||
|
||||
if (! file_exists($dir))
|
||||
@ -287,39 +287,39 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
// Description of product line
|
||||
$curX = $this->posxdesc-1;
|
||||
|
||||
$showpricebeforepagebreak=1;
|
||||
|
||||
$pdf->startTransaction();
|
||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxcomm-$curX,3,$curX,$curY,$hideref,$hidedesc);
|
||||
$pageposafter=$pdf->getPage();
|
||||
if ($pageposafter > $pageposbefore) // There is a pagebreak
|
||||
{
|
||||
$pdf->rollbackTransaction(true);
|
||||
$pageposafter=$pageposbefore;
|
||||
//print $pageposafter.'-'.$pageposbefore;exit;
|
||||
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxcomm-$curX,4,$curX,$curY,$hideref,$hidedesc);
|
||||
$posyafter=$pdf->GetY();
|
||||
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text
|
||||
{
|
||||
if ($i == ($nblines-1)) // No more lines, and no space left to show total, so we create a new page
|
||||
{
|
||||
$pdf->AddPage('','',true);
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||
$pdf->setPage($pagenb+1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// We found a page break
|
||||
$showpricebeforepagebreak=0;
|
||||
}
|
||||
}
|
||||
else // No pagebreak
|
||||
{
|
||||
$pdf->commitTransaction();
|
||||
}
|
||||
$showpricebeforepagebreak=1;
|
||||
|
||||
$pdf->startTransaction();
|
||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxcomm-$curX,3,$curX,$curY,$hideref,$hidedesc);
|
||||
$pageposafter=$pdf->getPage();
|
||||
if ($pageposafter > $pageposbefore) // There is a pagebreak
|
||||
{
|
||||
$pdf->rollbackTransaction(true);
|
||||
$pageposafter=$pageposbefore;
|
||||
//print $pageposafter.'-'.$pageposbefore;exit;
|
||||
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxcomm-$curX,4,$curX,$curY,$hideref,$hidedesc);
|
||||
$posyafter=$pdf->GetY();
|
||||
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text
|
||||
{
|
||||
if ($i == ($nblines-1)) // No more lines, and no space left to show total, so we create a new page
|
||||
{
|
||||
$pdf->AddPage('','',true);
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||
$pdf->setPage($pagenb+1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// We found a page break
|
||||
$showpricebeforepagebreak=0;
|
||||
}
|
||||
}
|
||||
else // No pagebreak
|
||||
{
|
||||
$pdf->commitTransaction();
|
||||
}
|
||||
|
||||
$nexY = $pdf->GetY();
|
||||
$pageposafter=$pdf->getPage();
|
||||
@ -526,31 +526,31 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show miscellaneous information (payment mode, payment term, ...)
|
||||
*
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $posy Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
global $conf;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
/**
|
||||
* Show miscellaneous information (payment mode, payment term, ...)
|
||||
*
|
||||
* @param PDF &$pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $posy Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
*/
|
||||
function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
global $conf;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
$pdf->SetFont('','', $default_font_size);
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
|
||||
$larg_sign = ($this->page_largeur-$this->marge_gauche-$this->marge_droite)/3;
|
||||
$pdf->Rect($this->marge_gauche, $posy + 1, $larg_sign, 25);
|
||||
$pdf->SetXY($this->marge_gauche + 2, $posy + 2);
|
||||
$pdf->MultiCell($larg_sign,2, $outputlangs->trans("For").' '.$outputlangs->convToOutputCharset($mysoc->name).":",'','L');
|
||||
|
||||
$pdf->Rect(2*$larg_sign+$this->marge_gauche, $posy + 1, $larg_sign, 25);
|
||||
$pdf->SetXY(2*$larg_sign+$this->marge_gauche + 2, $posy + 2);
|
||||
$pdf->MultiCell($larg_sign,2, $outputlangs->trans("ForCustomer").':','','L');
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
|
||||
$larg_sign = ($this->page_largeur-$this->marge_gauche-$this->marge_droite)/3;
|
||||
$pdf->Rect($this->marge_gauche, $posy + 1, $larg_sign, 25);
|
||||
$pdf->SetXY($this->marge_gauche + 2, $posy + 2);
|
||||
$pdf->MultiCell($larg_sign,2, $outputlangs->trans("For").' '.$outputlangs->convToOutputCharset($mysoc->name).":",'','L');
|
||||
|
||||
$pdf->Rect(2*$larg_sign+$this->marge_gauche, $posy + 1, $larg_sign, 25);
|
||||
$pdf->SetXY(2*$larg_sign+$this->marge_gauche + 2, $posy + 2);
|
||||
$pdf->MultiCell($larg_sign,2, $outputlangs->trans("ForCustomer").':','','L');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -629,19 +629,19 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
|
||||
pdf_pagehead($pdf,$outputlangs,$this->page_hauteur);
|
||||
|
||||
// Show Draft Watermark
|
||||
if($object->statut==0 && (! empty($conf->global->COMMANDE_DRAFT_WATERMARK)) )
|
||||
{
|
||||
pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->COMMANDE_DRAFT_WATERMARK);
|
||||
// Show Draft Watermark
|
||||
if($object->statut==0 && (! empty($conf->global->COMMANDE_DRAFT_WATERMARK)) )
|
||||
{
|
||||
pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->COMMANDE_DRAFT_WATERMARK);
|
||||
}
|
||||
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->SetFont('','B', $default_font_size + 3);
|
||||
|
||||
$posy=$this->marge_haute;
|
||||
$posx=$this->page_largeur-$this->marge_droite-100;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->SetFont('','B', $default_font_size + 3);
|
||||
|
||||
$posy=$this->marge_haute;
|
||||
$posx=$this->page_largeur-$this->marge_droite-100;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche,$posy);
|
||||
|
||||
// Logo
|
||||
$logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo;
|
||||
@ -695,8 +695,8 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
|
||||
$posy+=2;
|
||||
|
||||
// Show list of linked objects
|
||||
$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size);
|
||||
// Show list of linked objects
|
||||
$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size);
|
||||
|
||||
if ($showaddress)
|
||||
{
|
||||
@ -724,10 +724,10 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
$pdf->SetFont('','B',$default_font_size);
|
||||
$pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
|
||||
|
||||
// Show sender information
|
||||
$pdf->SetXY($posx+2,$posy+8);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
|
||||
// Show sender information
|
||||
$pdf->SetXY($posx+2,$posy+8);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
|
||||
|
||||
// Client destinataire
|
||||
$posy=42;
|
||||
|
||||
@ -114,14 +114,14 @@ class modOpenSurvey extends DolibarrModules
|
||||
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$r++;
|
||||
|
||||
// Add here list of permission defined by an id, a label, a boolean and two constant strings.
|
||||
// Example:
|
||||
$this->rights[$r][0] = 55002; // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Create/modify surveys'; // Permission label
|
||||
$this->rights[$r][2] = 'w'; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'survey'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
// Add here list of permission defined by an id, a label, a boolean and two constant strings.
|
||||
// Example:
|
||||
$this->rights[$r][0] = 55002; // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Create/modify surveys'; // Permission label
|
||||
$this->rights[$r][2] = 'w'; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'survey'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$r++;
|
||||
|
||||
|
||||
@ -195,7 +195,7 @@ class modOpenSurvey extends DolibarrModules
|
||||
*/
|
||||
function init($options='')
|
||||
{
|
||||
// Permissions
|
||||
// Permissions
|
||||
$this->remove($options);
|
||||
|
||||
$sql = array();
|
||||
|
||||
@ -107,60 +107,60 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices
|
||||
{
|
||||
global $db,$conf;
|
||||
|
||||
if ($object->type == 2) $prefix=$this->prefixcreditnote;
|
||||
else $prefix=$this->prefixinvoice;
|
||||
if ($object->type == 2) $prefix=$this->prefixcreditnote;
|
||||
else $prefix=$this->prefixinvoice;
|
||||
|
||||
// D'abord on recupere la valeur max
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max"; // This is standard SQL
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn";
|
||||
$sql.= " WHERE ref LIKE '".$prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
|
||||
$resql=$db->query($sql);
|
||||
dol_syslog(get_class($this)."::getNextValue sql=".$sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj) $max = intval($obj->max);
|
||||
else $max=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog(get_class($this)."::getNextValue sql=".$sql, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ($mode == 'last')
|
||||
{
|
||||
$num = sprintf("%04s",$max);
|
||||
|
||||
$ref='';
|
||||
$sql = "SELECT ref as ref";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn";
|
||||
$sql.= " WHERE ref LIKE '".$prefix."____-".$num."'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
|
||||
dol_syslog(get_class($this)."::getNextValue sql=".$sql);
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj) $ref = $obj->ref;
|
||||
}
|
||||
else dol_print_error($db);
|
||||
|
||||
return $ref;
|
||||
}
|
||||
else if ($mode == 'next')
|
||||
{
|
||||
$date=$object->date; // This is invoice date (not creation date)
|
||||
$yymm = strftime("%y%m",$date);
|
||||
$num = sprintf("%04s",$max+1);
|
||||
|
||||
dol_syslog(get_class($this)."::getNextValue return ".$prefix.$yymm."-".$num);
|
||||
return $prefix.$yymm."-".$num;
|
||||
}
|
||||
// D'abord on recupere la valeur max
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max"; // This is standard SQL
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn";
|
||||
$sql.= " WHERE ref LIKE '".$prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
|
||||
$resql=$db->query($sql);
|
||||
dol_syslog(get_class($this)."::getNextValue sql=".$sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj) $max = intval($obj->max);
|
||||
else $max=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog(get_class($this)."::getNextValue sql=".$sql, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ($mode == 'last')
|
||||
{
|
||||
$num = sprintf("%04s",$max);
|
||||
|
||||
$ref='';
|
||||
$sql = "SELECT ref as ref";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn";
|
||||
$sql.= " WHERE ref LIKE '".$prefix."____-".$num."'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
|
||||
dol_syslog(get_class($this)."::getNextValue sql=".$sql);
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj) $ref = $obj->ref;
|
||||
}
|
||||
else dol_print_error($db);
|
||||
|
||||
return $ref;
|
||||
}
|
||||
else if ($mode == 'next')
|
||||
{
|
||||
$date=$object->date; // This is invoice date (not creation date)
|
||||
$yymm = strftime("%y%m",$date);
|
||||
$num = sprintf("%04s",$max+1);
|
||||
|
||||
dol_syslog(get_class($this)."::getNextValue return ".$prefix.$yymm."-".$num);
|
||||
return $prefix.$yymm."-".$num;
|
||||
}
|
||||
else dol_print_error('','Bad parameter for getNextValue');
|
||||
}
|
||||
|
||||
|
||||
@ -49,8 +49,8 @@ $title=$langs->trans("Search");
|
||||
|
||||
// URL http://mydolibarr/core/search_page?dol_use_jmobile=1 can be used for tests
|
||||
$head='<!-- Quick access -->'."\n";
|
||||
$arrayofjs=array();
|
||||
$arrayofcss=array();
|
||||
$arrayofjs=array();
|
||||
$arrayofcss=array();
|
||||
top_htmlhead($head, $title, 0, 0, $arrayofjs, $arrayofcss);
|
||||
|
||||
|
||||
|
||||
@ -127,8 +127,8 @@ if ($forgetpasslink || $helpcenterlink)
|
||||
{
|
||||
$moreparam='';
|
||||
if ($dol_hide_topmenu) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_topmenu='.$dol_hide_topmenu;
|
||||
if ($dol_hide_leftmenu) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_leftmenu='.$dol_hide_leftmenu;
|
||||
if ($dol_no_mouse_hover) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_no_mouse_hover='.$dol_no_mouse_hover;
|
||||
if ($dol_hide_leftmenu) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_leftmenu='.$dol_hide_leftmenu;
|
||||
if ($dol_no_mouse_hover) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_no_mouse_hover='.$dol_no_mouse_hover;
|
||||
if ($dol_use_jmobile) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_use_jmobile='.$dol_use_jmobile;
|
||||
|
||||
echo '<br>';
|
||||
|
||||
@ -19,13 +19,13 @@
|
||||
header('Cache-Control: Public, must-revalidate');
|
||||
header("Content-type: text/html; charset=".$conf->file->character_set_client);
|
||||
|
||||
if (GETPOST('dol_hide_topmenu')) $conf->dol_use_jmobile=1;
|
||||
if (GETPOST('dol_hide_leftmenu')) $conf->dol_hide_leftmenu=1;
|
||||
if (GETPOST('dol_optimize_smallscreen')) $conf->dol_optimize_smallscreen=1;
|
||||
if (GETPOST('dol_no_mouse_hover')) $conf->dol_no_mouse_hover=1;
|
||||
if (GETPOST('dol_use_jmobile')) $conf->dol_use_jmobile=1;
|
||||
if (GETPOST('dol_hide_topmenu')) $conf->dol_use_jmobile=1;
|
||||
if (GETPOST('dol_hide_leftmenu')) $conf->dol_hide_leftmenu=1;
|
||||
if (GETPOST('dol_optimize_smallscreen')) $conf->dol_optimize_smallscreen=1;
|
||||
if (GETPOST('dol_no_mouse_hover')) $conf->dol_no_mouse_hover=1;
|
||||
if (GETPOST('dol_use_jmobile')) $conf->dol_use_jmobile=1;
|
||||
|
||||
print top_htmlhead('',$langs->trans('Login').' '.$title);
|
||||
print top_htmlhead('',$langs->trans('Login').' '.$title);
|
||||
?>
|
||||
<!-- BEGIN PHP TEMPLATE PASSWORDFORGOTTEN.TPL.PHP -->
|
||||
|
||||
@ -111,11 +111,11 @@ if (! empty($hookmanager->resArray['options'])) {
|
||||
<br>
|
||||
<div align="center" style="margin-top: 4px;">
|
||||
<?php
|
||||
$moreparam='';
|
||||
if (! empty($conf->dol_hide_topmenu)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_topmenu='.$conf->dol_hide_topmenu;
|
||||
if (! empty($conf->dol_hide_leftmenu)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_leftmenu='.$conf->dol_hide_leftmenu;
|
||||
if (! empty($conf->dol_no_mouse_hover)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_no_mouse_hover='.$conf->dol_no_mouse_hover;
|
||||
if (! empty($conf->dol_use_jmobile)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_use_jmobile='.$conf->dol_use_jmobile;
|
||||
$moreparam='';
|
||||
if (! empty($conf->dol_hide_topmenu)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_topmenu='.$conf->dol_hide_topmenu;
|
||||
if (! empty($conf->dol_hide_leftmenu)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_leftmenu='.$conf->dol_hide_leftmenu;
|
||||
if (! empty($conf->dol_no_mouse_hover)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_no_mouse_hover='.$conf->dol_no_mouse_hover;
|
||||
if (! empty($conf->dol_use_jmobile)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_use_jmobile='.$conf->dol_use_jmobile;
|
||||
|
||||
print '<a style="color: #888888; font-size: 10px" href="'.$dol_url_root.'/index.php'.$moreparam.'">('.$langs->trans('BackToLoginPage').')</a>';
|
||||
?>
|
||||
|
||||
@ -119,16 +119,16 @@ print_fiche_titre($pagetitle,'','setup');
|
||||
print $langs->trans('CronInfo');
|
||||
|
||||
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1);
|
||||
if ($ret == 'html') print '<br>';
|
||||
}
|
||||
|
||||
if ($action == 'execute'){
|
||||
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1);
|
||||
if ($ret == 'html') print '<br>';
|
||||
}
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1);
|
||||
if ($ret == 'html') print '<br>';
|
||||
}
|
||||
|
||||
if ($action == 'execute'){
|
||||
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1);
|
||||
if ($ret == 'html') print '<br>';
|
||||
}
|
||||
|
||||
|
||||
// liste des jobs creer
|
||||
@ -181,7 +181,7 @@ if (count($object->lines)>0) {
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print $form->selectarray('status', array('0'=>$langs->trans("No"),'1'=>$langs->trans("Yes")), GETPOST('status'), 1);
|
||||
print '</td><td class="liste_titre" align="right">';
|
||||
print ' ';
|
||||
print ' ';
|
||||
print '<input class="liste_titre" type="image" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print ' ';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
@ -265,7 +265,7 @@ if (count($object->lines)>0) {
|
||||
print '</td>';
|
||||
|
||||
print '<td align="center">';
|
||||
print yn($line->status);
|
||||
print yn($line->status);
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">';
|
||||
|
||||
@ -52,7 +52,7 @@ print $langs->trans("FormatedExportDesc3").'<br>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
|
||||
// List export set
|
||||
@ -108,7 +108,7 @@ if (count($export->array_export_code))
|
||||
*/
|
||||
}
|
||||
print '</center>';
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -855,42 +855,42 @@ class FactureFournisseur extends CommonInvoice
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$this->oldref = '';
|
||||
|
||||
// Rename directory if dir was a temporary ref
|
||||
if (preg_match('/^[\(]?PROV/i', $this->ref))
|
||||
{
|
||||
// On renomme repertoire facture ($this->ref = ancienne ref, $num = nouvelle ref)
|
||||
// afin de ne pas perdre les fichiers attaches
|
||||
$facref = dol_sanitizeFileName($this->ref);
|
||||
if (! $error)
|
||||
{
|
||||
$this->oldref = '';
|
||||
|
||||
// Rename directory if dir was a temporary ref
|
||||
if (preg_match('/^[\(]?PROV/i', $this->ref))
|
||||
{
|
||||
// On renomme repertoire facture ($this->ref = ancienne ref, $num = nouvelle ref)
|
||||
// afin de ne pas perdre les fichiers attaches
|
||||
$facref = dol_sanitizeFileName($this->ref);
|
||||
$snumfa = dol_sanitizeFileName($num);
|
||||
|
||||
$dirsource = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$facref;
|
||||
$dirsource = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$facref;
|
||||
$dirdest = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$snumfa;
|
||||
if (file_exists($dirsource))
|
||||
{
|
||||
dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest);
|
||||
|
||||
if (@rename($dirsource, $dirdest))
|
||||
{
|
||||
$this->oldref = $facref;
|
||||
|
||||
dol_syslog("Rename ok");
|
||||
// Suppression ancien fichier PDF dans nouveau rep
|
||||
dol_delete_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$snumfa.'/'.$facref.'*.*');
|
||||
}
|
||||
}
|
||||
}
|
||||
if (file_exists($dirsource))
|
||||
{
|
||||
dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest);
|
||||
|
||||
if (@rename($dirsource, $dirdest))
|
||||
{
|
||||
$this->oldref = $facref;
|
||||
|
||||
dol_syslog("Rename ok");
|
||||
// Suppression ancien fichier PDF dans nouveau rep
|
||||
dol_delete_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$snumfa.'/'.$facref.'*.*');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set new ref and define current statut
|
||||
if (! $error)
|
||||
{
|
||||
$this->ref = $num;
|
||||
$this->statut=1;
|
||||
//$this->date_validation=$now; this is stored into log table
|
||||
// Set new ref and define current statut
|
||||
if (! $error)
|
||||
{
|
||||
$this->ref = $num;
|
||||
$this->statut=1;
|
||||
//$this->date_validation=$now; this is stored into log table
|
||||
}
|
||||
|
||||
// Triggers call
|
||||
|
||||
@ -114,14 +114,14 @@ elseif ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fourni
|
||||
$object->fetch($id);
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$qualified_for_stock_change=0;
|
||||
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||
{
|
||||
$qualified_for_stock_change=$object->hasProductsOrServices(2);
|
||||
}
|
||||
else
|
||||
{
|
||||
$qualified_for_stock_change=$object->hasProductsOrServices(1);
|
||||
$qualified_for_stock_change=0;
|
||||
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||
{
|
||||
$qualified_for_stock_change=$object->hasProductsOrServices(2);
|
||||
}
|
||||
else
|
||||
{
|
||||
$qualified_for_stock_change=$object->hasProductsOrServices(1);
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user