Merge branch 'develop' of github.com:Dolibarr/dolibarr into check_rejection
Conflicts: htdocs/compta/paiement/cheque/card.php
This commit is contained in:
commit
84be022ee1
@ -28,10 +28,10 @@ Restler 3.0 LGPL-3+ Yes
|
||||
TCPDF 6.2.6 LGPL-3+ Yes PDF generation
|
||||
|
||||
JS libraries:
|
||||
jQuery 1.8.2 MIT License Yes JS library
|
||||
jQuery UI 1.9.1 GPL and MIT License Yes JS library plugin UI
|
||||
jQuery 1.11.3 MIT License Yes JS library
|
||||
jQuery UI 1.11.4 GPL and MIT License Yes JS library plugin UI
|
||||
jQuery select2 3.5.2 GPL and Apache License Yes JS library plugin for sexier multiselect
|
||||
jQuery blockUI 2.43 GPL and MIT License Yes JS library plugin blockUI (to use ajax popups)
|
||||
jQuery blockUI 2.70.0 GPL and MIT License Yes JS library plugin blockUI (to use ajax popups)
|
||||
jQuery Colorpicker 1.1 MIT License Yes JS library for color picker for a defined list of colors
|
||||
jQuery DataTables 1.9.4 BSD Yes JS library for tables output
|
||||
jQuery FileUpload 5.0.3 GPL and MIT License Yes JS library to upload files
|
||||
|
||||
@ -34,6 +34,7 @@ For translators:
|
||||
For developers:
|
||||
- New: Function yn can show a visual checkbox.
|
||||
- New: Introduced select2 jquery plugin.
|
||||
- New: Possibility to add javascript in main login page with "getLoginPageOptions" hook
|
||||
|
||||
WARNING: Following changes may create regression for some external modules, but was necessary to make
|
||||
Dolibarr better:
|
||||
@ -42,8 +43,9 @@ Dolibarr better:
|
||||
- Hooks 'printLeftBlock' and 'formConfirm' are now compliant with hook development rules. They are
|
||||
"addreplace" hooks, so you must return content with "->resprints='mycontent'" and not with "return 'mycontent'"
|
||||
- All fields "fk_societe" were renamed into "fk_soc".
|
||||
- Method select_PriceBaseType and load_PriceBaseType were merged into selectPriceBaseType
|
||||
|
||||
- Method select_PriceBaseType and load_PriceBaseType were merged into selectPriceBaseType.
|
||||
- The trigger USER_LOGIN* are deprecated. They are still working but you should prefer use the
|
||||
hook afterLogin or afterLoginFailed instead.
|
||||
|
||||
***** ChangeLog for 3.7.2 compared to 3.7.1 *****
|
||||
FIX [ bug #2855 ] Wrong translation key in localtax report page
|
||||
|
||||
@ -38,6 +38,15 @@ filter-pristine-tar = True
|
||||
END
|
||||
|
||||
|
||||
# Complete .bashrc with DEBEMAIL and DEBFULLNAME
|
||||
Example:
|
||||
export DEBFULLNAME="Laurent Destailleur (eldy)"
|
||||
export DEBEMAIL=eldy@users.sourceforge.net
|
||||
Other example:
|
||||
export DEBFULLNAME="Laurent Destailleur"
|
||||
export DEBEMAIL="eldy@destailleur.fr"
|
||||
|
||||
|
||||
# To use Alioth.debian.org
|
||||
* Create an account login
|
||||
* Update your ~/.ssh/config file to add:
|
||||
@ -111,7 +120,7 @@ severity 123 xxx
|
||||
##### Update but tracker system
|
||||
|
||||
To set status of a bug to "pending"
|
||||
> bts tag 999999 +pending
|
||||
> bts --smtp-host=yoursmtpserver tag 999999 +pending
|
||||
|
||||
or replay to email 999999@bugs.debian.org + submitter of bug
|
||||
With a message starting with:
|
||||
|
||||
@ -455,13 +455,15 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/documents`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/document`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/documents`;
|
||||
|
||||
# Removed known external modules to avoid any error when packaging from env where external modules are tested
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom/*`; # For custom we want to keep dir
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/ancotec*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/cabinetmed*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/calling*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/bootstrap*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/factory*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/lead*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/management*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/nltechno*`;
|
||||
|
||||
@ -218,7 +218,7 @@ jQuery(document).ready(function() {
|
||||
}
|
||||
init_myfunc();
|
||||
jQuery("#mybutton").click(function() {
|
||||
init_needroot();
|
||||
init_myfunc();
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
|
||||
1
htdocs/.gitignore
vendored
1
htdocs/.gitignore
vendored
@ -10,3 +10,4 @@
|
||||
/ovh*
|
||||
/pos
|
||||
/ultimatepdf*
|
||||
/lead
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -56,6 +56,8 @@ $list = array (
|
||||
'ACCOUNTING_PRODUCT_SOLD_ACCOUNT',
|
||||
'ACCOUNTING_SERVICE_BUY_ACCOUNT',
|
||||
'ACCOUNTING_SERVICE_SOLD_ACCOUNT',
|
||||
'ACCOUNTING_VAT_BUY_ACCOUNT',
|
||||
'ACCOUNTING_VAT_SOLD_ACCOUNT',
|
||||
'ACCOUNTING_ACCOUNT_SUSPENSE',
|
||||
'ACCOUNTING_ACCOUNT_TRANSFER_CASH'
|
||||
);
|
||||
|
||||
@ -295,8 +295,8 @@ else
|
||||
print_liste_field_titre($langs->trans("Credit"));
|
||||
print_liste_field_titre($langs->trans("Amount"));
|
||||
print_liste_field_titre($langs->trans("Sens"));
|
||||
|
||||
print '<td></td>';
|
||||
print_liste_field_titre('');
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
foreach ( $book->linesmvt as $line ) {
|
||||
|
||||
@ -90,7 +90,7 @@ if ($resql) {
|
||||
print_liste_field_titre($langs->trans("Amount"), $_SERVER['PHP_SELF'], "bk.montant", "", "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Sens"), $_SERVER['PHP_SELF'], "bk.sens", "", "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "bk.code_journal", "", "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre(" ");
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
$var = True;
|
||||
|
||||
@ -112,7 +112,7 @@ if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
// les variables
|
||||
$cptfour = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER)) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef");
|
||||
$cpttva = (! empty($conf->global->ACCOUNTING_VAT_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_ACCOUNT : $langs->trans("CodeNotDef");
|
||||
$cpttva = (! empty($conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT : $langs->trans("CodeNotDef");
|
||||
|
||||
$tabfac = array ();
|
||||
$tabht = array ();
|
||||
|
||||
@ -136,7 +136,7 @@ if ($result) {
|
||||
else
|
||||
$compta_prod = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef");
|
||||
}
|
||||
$cpttva = (! empty($conf->global->ACCOUNTING_VAT_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_ACCOUNT : $langs->trans("CodeNotDef");
|
||||
$cpttva = (! empty($conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT : $langs->trans("CodeNotDef");
|
||||
$compta_tva = (! empty($obj->account_tva) ? $obj->account_tva : $cpttva);
|
||||
|
||||
// Situation invoices handling
|
||||
|
||||
@ -34,9 +34,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/cotisation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
|
||||
$langs->load("companies");
|
||||
@ -239,7 +240,7 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'update' && $cancel='' && $user->rights->adherent->creer)
|
||||
if ($action == 'update' && ! $cancel && $user->rights->adherent->creer)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
@ -322,8 +323,29 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
$result=$object->update($user,0,$nosyncuser,$nosyncuserpass);
|
||||
|
||||
if ($result >= 0 && ! count($object->errors))
|
||||
{
|
||||
// Categories association
|
||||
// First we delete all categories association
|
||||
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . 'categorie_member';
|
||||
$sql .= ' WHERE fk_member = ' . $object->id;
|
||||
$resql = $db->query($sql);
|
||||
if (! $resql) dol_print_error($db);
|
||||
|
||||
// Then we add the associated categories
|
||||
$categories = GETPOST('memcats', 'array');
|
||||
|
||||
if (! empty($categories))
|
||||
{
|
||||
$cat = new Categorie($db);
|
||||
foreach ($categories as $id_category)
|
||||
{
|
||||
$cat->fetch($id_category);
|
||||
$cat->add_type($object, 'member');
|
||||
}
|
||||
}
|
||||
|
||||
// Logo/Photo save
|
||||
$dir= $conf->adherent->dir_output . '/' . get_exdir($object->id,2,0,1,$object,'member').'/photos';
|
||||
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
|
||||
@ -536,6 +558,18 @@ if (empty($reshook))
|
||||
$result=$object->create($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
// Categories association
|
||||
$memcats = GETPOST('memcats', 'array');
|
||||
if (! empty($memcats))
|
||||
{
|
||||
$cat = new Categorie($db);
|
||||
foreach ($memcats as $id_category)
|
||||
{
|
||||
$cat->fetch($id_category);
|
||||
$cat->add_type($object, 'member');
|
||||
}
|
||||
}
|
||||
|
||||
$db->commit();
|
||||
$rowid=$object->id;
|
||||
$action='';
|
||||
@ -899,6 +933,15 @@ else
|
||||
print $form->selectyesno("public",$object->public,1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Categories
|
||||
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
|
||||
{
|
||||
print '<tr><td>' . fieldLabel('Categories', 'memcars') . '</td><td>';
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, 'parent', null, null, 1);
|
||||
print $form->multiselectarray('memcats', $cate_arbo, GETPOST('memcats', 'array'), null, null, null, null, '100%');
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
@ -1024,7 +1067,7 @@ else
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td>'.$langs->trans("Ref").'</td><td class="valeur" colspan="2">'.$object->id.'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td class="valeur" colspan="2">'.$object->id.'</td></tr>';
|
||||
|
||||
// Login
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||
@ -1070,7 +1113,7 @@ else
|
||||
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40" value="'.(isset($_POST["societe"])?$_POST["societe"]:$object->societe).'"></td></tr>';
|
||||
|
||||
// Civility
|
||||
print '<tr><td width="20%">'.$langs->trans("UserTitle").'</td><td width="35%">';
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td>';
|
||||
print $formcompany->select_civility(isset($_POST["civility_id"])?$_POST["civility_id"]:$object->civility_id)."\n";
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@ -1144,12 +1187,27 @@ else
|
||||
print $form->selectyesno("public",(isset($_POST["public"])?$_POST["public"]:$object->public),1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Categories
|
||||
if (! empty( $conf->categorie->enabled ) && !empty( $user->rights->categorie->lire ))
|
||||
{
|
||||
print '<tr><td>' . fieldLabel('Categories', 'memcats') . '</td>';
|
||||
print '<td colspan="2">';
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, null, null, null, 1);
|
||||
$c = new Categorie($db);
|
||||
$cats = $c->containing($object->id, Categorie::TYPE_MEMBER);
|
||||
foreach ($cats as $cat) {
|
||||
$arrayselected[] = $cat->id;
|
||||
}
|
||||
print $form->multiselectarray('memcats', $cate_arbo, $arrayselected, '', 0, '', 0, '100%');
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array();
|
||||
$parameters=array("colspan"=>2);
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print $object->showOptionals($extrafields,'edit');
|
||||
print $object->showOptionals($extrafields,'edit',$parameters);
|
||||
}
|
||||
|
||||
// Third party Dolibarr
|
||||
@ -1291,7 +1349,7 @@ else
|
||||
$helpcontent.=dol_htmlentitiesbr($texttosend)."\n";
|
||||
$label=$form->textwithpicto($tmp,$helpcontent,1,'help');
|
||||
|
||||
// Cree un tableau formulaire
|
||||
// Create form popup
|
||||
$formquestion=array();
|
||||
if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => ($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL?true:false));
|
||||
if (! empty($conf->mailman->enabled) && ! empty($conf->global->ADHERENT_USE_MAILMAN)) {
|
||||
@ -1465,12 +1523,21 @@ else
|
||||
// Status
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td class="valeur">'.$object->getLibStatut(4).'</td></tr>';
|
||||
|
||||
// Categories
|
||||
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
|
||||
{
|
||||
print '<tr><td>' . $langs->trans("Categories") . '</td>';
|
||||
print '<td colspan="2">';
|
||||
print $form->showCategories($object->id, 'member', 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array();
|
||||
$parameters=array('colspan'=>2);
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print $object->showOptionals($extrafields);
|
||||
print $object->showOptionals($extrafields, 'view', $parameters);
|
||||
}
|
||||
|
||||
// Third party Dolibarr
|
||||
|
||||
@ -53,6 +53,12 @@ $pagenext = $page + 1;
|
||||
if (! $sortorder) { $sortorder="DESC"; }
|
||||
if (! $sortfield) { $sortfield="d.lastname"; }
|
||||
|
||||
$label=GETPOST("libelle","alpha");
|
||||
$cotisation=GETPOST("cotisation","int");
|
||||
$vote=GETPOST("vote","int");
|
||||
$comment=GETPOST("comment");
|
||||
$mail_valid=GETPOST("mail_valid");
|
||||
|
||||
// Security check
|
||||
$result=restrictedArea($user,'adherent',$rowid,'adherent_type');
|
||||
|
||||
@ -83,11 +89,11 @@ if ($action == 'add' && $user->rights->adherent->configurer)
|
||||
{
|
||||
$object = new AdherentType($db);
|
||||
|
||||
$object->libelle = trim($_POST["libelle"]);
|
||||
$object->cotisation = trim($_POST["cotisation"]);
|
||||
$object->note = trim($_POST["comment"]);
|
||||
$object->mail_valid = trim($_POST["mail_valid"]);
|
||||
$object->vote = trim($_POST["vote"]);
|
||||
$object->libelle = trim($label);
|
||||
$object->cotisation = trim($cotisation);
|
||||
$object->note = trim($comment);
|
||||
$object->mail_valid = trim($mail_valid);
|
||||
$object->vote = trim($vote);
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||
@ -120,12 +126,12 @@ if ($action == 'update' && $user->rights->adherent->configurer)
|
||||
if ($_POST["button"] != $langs->trans("Cancel"))
|
||||
{
|
||||
$object = new AdherentType($db);
|
||||
$object->id = $_POST["rowid"];
|
||||
$object->libelle = trim($_POST["libelle"]);
|
||||
$object->cotisation = trim($_POST["cotisation"]);
|
||||
$object->note = trim($_POST["comment"]);
|
||||
$object->mail_valid = trim($_POST["mail_valid"]);
|
||||
$object->vote = trim($_POST["vote"]);
|
||||
$object->id = $rowid;
|
||||
$object->libelle = trim($label);
|
||||
$object->cotisation = trim($cotisation);
|
||||
$object->note = trim($comment);
|
||||
$object->mail_valid = trim($mail_valid);
|
||||
$object->vote = trim($vote);
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||
@ -169,6 +175,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
||||
|
||||
print_fiche_titre($langs->trans("MembersTypes"));
|
||||
|
||||
dol_fiche_head('');
|
||||
|
||||
$sql = "SELECT d.rowid, d.libelle, d.cotisation, d.vote";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
|
||||
@ -197,7 +204,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td><a href="'.$_SERVER["PHP_SELF"].'?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowType"),'group').' '.$objp->rowid.'</a></td>';
|
||||
print '<td>'.$objp->libelle.'</td>';
|
||||
print '<td>'.dol_escape_htmltag($objp->libelle).'</td>';
|
||||
print '<td align="center">'.yn($objp->cotisation).'</td>';
|
||||
print '<td align="center">'.yn($objp->vote).'</td>';
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$objp->rowid.'">'.img_edit().'</a></td>';
|
||||
@ -211,6 +218,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
/*
|
||||
* Hotbar
|
||||
@ -246,7 +254,7 @@ if ($action == 'create')
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tbody>';
|
||||
|
||||
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" name="libelle" size="40"></td></tr>';
|
||||
@ -277,7 +285,7 @@ if ($action == 'create')
|
||||
}
|
||||
print '<tbody>';
|
||||
print "</table>\n";
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
@ -317,7 +325,7 @@ if ($rowid > 0)
|
||||
print '</td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td width="15%">'.$langs->trans("Label").'</td><td>'.$object->libelle.'</td></tr>';
|
||||
print '<tr><td width="15%">'.$langs->trans("Label").'</td><td>'.dol_escape_htmltag($object->libelle).'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
|
||||
print yn($object->cotisation);
|
||||
@ -343,7 +351,9 @@ if ($rowid > 0)
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
/*
|
||||
* Hotbar
|
||||
@ -493,15 +503,15 @@ if ($rowid > 0)
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_lastname" value="'.$search_lastname.'" size="12"></td>';
|
||||
print '<input class="flat" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).'" size="12"></td>';
|
||||
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_login" value="'.$search_login.'" size="7"></td>';
|
||||
print '<input class="flat" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'" size="7"></td>';
|
||||
|
||||
print '<td class="liste_titre"> </td>';
|
||||
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_email" value="'.$search_email.'" size="12"></td>';
|
||||
print '<input class="flat" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).'" size="12"></td>';
|
||||
|
||||
print '<td class="liste_titre"> </td>';
|
||||
|
||||
@ -563,7 +573,7 @@ if ($rowid > 0)
|
||||
if ($datefin)
|
||||
{
|
||||
print '<td align="center" class="nowrap">';
|
||||
if ($datefin < time() && $objp->statut > 0)
|
||||
if ($datefin < dol_now() && $objp->statut > 0)
|
||||
{
|
||||
print dol_print_date($datefin,'day')." ".img_warning($langs->trans("SubscriptionLate"));
|
||||
}
|
||||
@ -634,17 +644,18 @@ if ($rowid > 0)
|
||||
|
||||
$head = member_type_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'card', $langs->trans("MemberType"), 0, 'group');
|
||||
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?rowid='.$rowid.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
dol_fiche_head($head, 'card', $langs->trans("MemberType"), 0, 'group');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="15%">'.$langs->trans("Ref").'</td><td>'.$object->id.'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td><input type="text" name="libelle" size="40" value="'.$object->libelle.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td><input type="text" name="libelle" size="40" value="'.dol_escape_htmltag($object->libelle).'"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
|
||||
print $form->selectyesno("cotisation",$object->cotisation,1);
|
||||
@ -683,6 +694,8 @@ if ($rowid > 0)
|
||||
print '</table><br><br>';
|
||||
}
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
@ -693,6 +706,7 @@ if ($rowid > 0)
|
||||
}
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2008-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -137,6 +137,11 @@ print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup');
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="save">';
|
||||
|
||||
|
||||
$head=agenda_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'autoactions', $langs->trans("Agenda"), 0, 'action');
|
||||
@ -145,10 +150,6 @@ print $langs->trans("AgendaAutoActionDesc")."<br>\n";
|
||||
print $langs->trans("OnlyActiveElementsAreShown").'<br>';
|
||||
print "<br>\n";
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="save">';
|
||||
|
||||
$var=true;
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -168,8 +169,9 @@ if (! empty($triggers))
|
||||
//print 'module='.$module.'<br>';
|
||||
if (! empty($conf->$module->enabled))
|
||||
{
|
||||
// Discard special case.
|
||||
// Discard special case: If option FICHINTER_CLASSIFY_BILLED is not set, we discard both trigger FICHINTER_CLASSIFY_BILLED and FICHINTER_CLASSIFY_UNBILLED
|
||||
if ($trigger['code'] == 'FICHINTER_CLASSIFY_BILLED' && empty($conf->global->FICHINTER_CLASSIFY_BILLED)) continue;
|
||||
if ($trigger['code'] == 'FICHINTER_CLASSIFY_UNBILLED' && empty($conf->global->FICHINTER_CLASSIFY_BILLED)) continue;
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
@ -185,13 +187,14 @@ if (! empty($triggers))
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
print '<br><div class="center">';
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" name="save" class="button" value="'.$langs->trans("Save").'">';
|
||||
print "</div>";
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print "<br>";
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2008-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
*
|
||||
@ -127,6 +127,10 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
|
||||
print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup');
|
||||
print '<br>';
|
||||
|
||||
print '<form name="extsitesconfig" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="save">';
|
||||
|
||||
$head=agenda_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'extsites', $langs->trans("Agenda"), 0, 'action');
|
||||
@ -134,7 +138,6 @@ dol_fiche_head($head, 'extsites', $langs->trans("Agenda"), 0, 'action');
|
||||
print $langs->trans("AgendaExtSitesDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
print '<form name="extsitesconfig" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
|
||||
$selectedvalue=$conf->global->AGENDA_DISABLE_EXT;
|
||||
if ($selectedvalue==1) $selectedvalue=0; else $selectedvalue=1;
|
||||
@ -219,7 +222,8 @@ while ($i <= $MAXAGENDA)
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" id="save" name="save" class="button hideifnotset" value="'.$langs->trans("Save").'">';
|
||||
@ -227,7 +231,6 @@ print '</div>';
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
llxFooter();
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2008-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -93,17 +93,16 @@ print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup');
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" name="agenda">';
|
||||
print '<input type="hidden" name="action" value="set">';
|
||||
|
||||
$head=agenda_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'other', $langs->trans("Agenda"), 0, 'action');
|
||||
|
||||
//print_titre($langs->trans("OtherOptions"));
|
||||
|
||||
$var=true;
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" name="agenda">';
|
||||
print '<input type="hidden" name="action" value="set">';
|
||||
|
||||
print '<table class="noborder allwidth">'."\n";
|
||||
print '<tr class="liste_titre">'."\n";
|
||||
print '<td>'.$langs->trans("Parameters").'</td>'."\n";
|
||||
@ -158,11 +157,12 @@ print '</td></tr>'."\n";
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center"><input class="button" type="submit" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print "<br>";
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2008-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
@ -78,6 +78,9 @@ print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup');
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '<form name="agendasetupform" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
$head=agenda_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'xcal', $langs->trans("Agenda"), 0, 'action');
|
||||
@ -85,18 +88,16 @@ dol_fiche_head($head, 'xcal', $langs->trans("Agenda"), 0, 'action');
|
||||
print $langs->trans("AgendaSetupOtherDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
print '<form name="agendasetupform" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print '<tr class="liste_titre">';
|
||||
print "<td>".$langs->trans("Parameter")."</td>";
|
||||
print "<td>".$langs->trans("Value")."</td>";
|
||||
//print "<td>".$langs->trans("Examples")."</td>";
|
||||
print "<td> </td>";
|
||||
print "</tr>";
|
||||
|
||||
print "<tr class=\"impair\">";
|
||||
print "<tr ".$bc[false].">";
|
||||
print '<td class="fieldrequired">'.$langs->trans("PasswordTogetVCalExport")."</td>";
|
||||
print '<td><input required="required" type="text" class="flat" id="MAIN_AGENDA_XCAL_EXPORTKEY" name="MAIN_AGENDA_XCAL_EXPORTKEY" value="' . (GETPOST('MAIN_AGENDA_XCAL_EXPORTKEY','alpha')?GETPOST('MAIN_AGENDA_XCAL_EXPORTKEY','alpha'):$conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) . '" size="40">';
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
@ -105,13 +106,13 @@ print '</td>';
|
||||
print "<td> </td>";
|
||||
print "</tr>";
|
||||
|
||||
print "<tr class=\"pair\">";
|
||||
print "<tr ".$bc[true].">";
|
||||
print "<td>".$langs->trans("PastDelayVCalExport")."</td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"MAIN_AGENDA_EXPORT_PAST_DELAY\" value=\"". (GETPOST('MAIN_AGENDA_EXPORT_PAST_DELAY','alpha')?GETPOST('MAIN_AGENDA_EXPORT_PAST_DELAY','alpha'):$conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY) . "\" size=\"10\"> ".$langs->trans("days")."</td>";
|
||||
print "<td> </td>";
|
||||
print "</tr>";
|
||||
|
||||
print "<tr class=\"impair\">";
|
||||
print "<tr ".$bc[false].">";
|
||||
print "<td>".$langs->trans("UseACacheDelay")."</td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"MAIN_AGENDA_EXPORT_CACHE\" value=\"". (GETPOST('MAIN_AGENDA_EXPORT_CACHE','alpha')?GETPOST('MAIN_AGENDA_EXPORT_CACHE','alpha'):$conf->global->MAIN_AGENDA_EXPORT_CACHE) . "\" size=\"10\"></td>";
|
||||
print "<td> </td>";
|
||||
@ -121,13 +122,13 @@ print '</table>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="25%">'.$langs->trans("Parameter")."</td>";
|
||||
print "<td>".$langs->trans("Value")."</td>";
|
||||
print "</tr>";
|
||||
print "<tr ".$bc[$var].">";
|
||||
print "<tr ".$bc[false].">";
|
||||
print '<td class="fieldrequired">'.$langs->trans("FixTZ")."</td>";
|
||||
print "<td>";
|
||||
print '<input class="flat" type="text" size="4" name="AGENDA_EXPORT_FIX_TZ" value="'.$conf->global->AGENDA_EXPORT_FIX_TZ.'">';
|
||||
@ -137,13 +138,14 @@ print "</tr>";
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br><div class="center">';
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print "<input type=\"submit\" name=\"save\" class=\"button\" value=\"".$langs->trans("Save")."\">";
|
||||
print "</div>";
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
clearstatcache();
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ $list = array(
|
||||
'ACCOUNTING_PRODUCT_SOLD_ACCOUNT',
|
||||
'ACCOUNTING_SERVICE_BUY_ACCOUNT',
|
||||
'ACCOUNTING_SERVICE_SOLD_ACCOUNT',
|
||||
'ACCOUNTING_VAT_ACCOUNT',
|
||||
'ACCOUNTING_VAT_SOLD_ACCOUNT',
|
||||
'ACCOUNTING_VAT_BUY_ACCOUNT',
|
||||
'ACCOUNTING_ACCOUNT_CUSTOMER',
|
||||
'ACCOUNTING_ACCOUNT_SUPPLIER'
|
||||
|
||||
@ -70,7 +70,7 @@ $hookmanager->initHooks(array('admin'));
|
||||
// Put here declaration of dictionaries properties
|
||||
|
||||
// Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this.
|
||||
$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,6,0,7,17,24,28,0,10,23,12,13,0,14,0,22,20,18,21,0,15,0,25,0,26);
|
||||
$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,6,0,29,0,7,17,24,28,0,10,23,12,13,0,14,0,22,20,18,21,0,15,0,25,0,26);
|
||||
|
||||
// Name of SQL tables of dictionaries
|
||||
$tabname=array();
|
||||
@ -102,6 +102,7 @@ $tabname[25]= MAIN_DB_PREFIX."c_email_templates";
|
||||
$tabname[26]= MAIN_DB_PREFIX."c_units";
|
||||
$tabname[27]= MAIN_DB_PREFIX."c_stcomm";
|
||||
$tabname[28]= MAIN_DB_PREFIX."c_holiday_types";
|
||||
$tabname[29]= MAIN_DB_PREFIX."c_lead_status";
|
||||
|
||||
// Dictionary labels
|
||||
$tablib=array();
|
||||
@ -133,6 +134,7 @@ $tablib[25]= "DictionaryEMailTemplates";
|
||||
$tablib[26]= "DictionaryUnits";
|
||||
$tablib[27]= "DictionaryProspectStatus";
|
||||
$tablib[28]= "DictionaryHolidayTypes";
|
||||
$tablib[29]= "DictionaryOpportunityStatus";
|
||||
|
||||
// Requests to extract data
|
||||
$tabsql=array();
|
||||
@ -164,6 +166,7 @@ $tabsql[25]= "SELECT rowid as rowid, label, type_template, private, position,
|
||||
$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units";
|
||||
$tabsql[27]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_stcomm";
|
||||
$tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.delay, h.newByMonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
|
||||
$tabsql[29]= "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status";
|
||||
|
||||
// Criteria to sort dictionaries
|
||||
$tabsqlsort=array();
|
||||
@ -195,6 +198,7 @@ $tabsqlsort[25]="label ASC";
|
||||
$tabsqlsort[26]="code ASC";
|
||||
$tabsqlsort[27]="code ASC";
|
||||
$tabsqlsort[28]="country ASC, code ASC";
|
||||
$tabsqlsort[29]="position ASC";
|
||||
|
||||
// Nom des champs en resultat de select pour affichage du dictionnaire
|
||||
$tabfield=array();
|
||||
@ -226,6 +230,7 @@ $tabfield[25]= "label,type_template,private,position,topic,content";
|
||||
$tabfield[26]= "code,label,short_label";
|
||||
$tabfield[27]= "code,libelle";
|
||||
$tabfield[28]= "code,label,delay,newByMonth,country_id,country";
|
||||
$tabfield[29]= "code,label,percent,position";
|
||||
|
||||
// Nom des champs d'edition pour modification d'un enregistrement
|
||||
$tabfieldvalue=array();
|
||||
@ -257,6 +262,7 @@ $tabfieldvalue[25]= "label,type_template,private,position,topic,content";
|
||||
$tabfieldvalue[26]= "code,label,short_label";
|
||||
$tabfieldvalue[27]= "code,libelle";
|
||||
$tabfieldvalue[28]= "code,label,delay,newByMonth,country";
|
||||
$tabfieldvalue[29]= "code,label,percent,position";
|
||||
|
||||
// Nom des champs dans la table pour insertion d'un enregistrement
|
||||
$tabfieldinsert=array();
|
||||
@ -288,6 +294,7 @@ $tabfieldinsert[25]= "label,type_template,private,position,topic,content";
|
||||
$tabfieldinsert[26]= "code,label,short_label";
|
||||
$tabfieldinsert[27]= "code,libelle";
|
||||
$tabfieldinsert[28]= "code,label,delay,newByMonth,fk_country";
|
||||
$tabfieldinsert[29]= "code,label,percent,position";
|
||||
|
||||
// Nom du rowid si le champ n'est pas de type autoincrement
|
||||
// Example: "" if id field is "rowid" and has autoincrement on
|
||||
@ -321,6 +328,7 @@ $tabrowid[25]= "";
|
||||
$tabrowid[26]= "";
|
||||
$tabrowid[27]= "id";
|
||||
$tabrowid[28]= "";
|
||||
$tabrowid[29]= "";
|
||||
|
||||
// Condition to show dictionary in setup page
|
||||
$tabcond=array();
|
||||
@ -352,6 +360,7 @@ $tabcond[25]= true; // && ! empty($conf->global->MAIN_EMAIL_EDIT_TEMPLATE_FROM_D
|
||||
$tabcond[26]= ! empty($conf->product->enabled);
|
||||
$tabcond[27]= ! empty($conf->societe->enabled);
|
||||
$tabcond[28]= ! empty($conf->holiday->enabled);
|
||||
$tabcond[29]= ! empty($conf->projet->enabled);
|
||||
|
||||
// List of help for fields
|
||||
$tabhelp=array();
|
||||
@ -383,6 +392,7 @@ $tabhelp[25] = array();
|
||||
$tabhelp[26] = array();
|
||||
$tabhelp[27] = array();
|
||||
$tabhelp[28] = array();
|
||||
$tabhelp[29] = array();
|
||||
|
||||
// List of check for fields (NOT USED YET)
|
||||
$tabfieldcheck=array();
|
||||
@ -414,6 +424,7 @@ $tabfieldcheck[25] = array();
|
||||
$tabfieldcheck[26] = array();
|
||||
$tabfieldcheck[27] = array();
|
||||
$tabfieldcheck[28] = array();
|
||||
$tabfieldcheck[29] = array();
|
||||
|
||||
// Complete all arrays with entries found into modules
|
||||
complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp,$tabfieldcheck);
|
||||
|
||||
@ -68,7 +68,15 @@ if ($action == 'update')
|
||||
|
||||
dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'chaine',0,'',$conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT", $_POST["MAIN_SEARCHFORM_CONTACT"],'chaine',0,'',$conf->entity);
|
||||
$val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array()))));
|
||||
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TOPMENU_BACK1', $conf->entity);
|
||||
else dolibarr_set_const($db, 'THEME_ELDY_TOPMENU_BACK1', join(',',colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array())),'chaine',0,'',$conf->entity);
|
||||
|
||||
$val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array()))));
|
||||
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKTITLE1', $conf->entity);
|
||||
else dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', join(',',colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array())),'chaine',0,'',$conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT", $_POST["MAIN_SEARCHFORM_CONTACT"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_SOCIETE", $_POST["MAIN_SEARCHFORM_SOCIETE"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE", $_POST["MAIN_SEARCHFORM_PRODUITSERVICE"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER",$_POST["MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER"],'chaine',0,'',$conf->entity);
|
||||
@ -148,7 +156,7 @@ if ($action == 'edit') // Edit
|
||||
|
||||
print '</table><br>'."\n";
|
||||
|
||||
// Themes
|
||||
// Themes and themes options
|
||||
show_theme(null,1);
|
||||
print '<br>';
|
||||
|
||||
|
||||
@ -230,7 +230,6 @@ $linuxlike=1;
|
||||
if (preg_match('/^win/i',PHP_OS)) $linuxlike=0;
|
||||
if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0;
|
||||
|
||||
|
||||
if (empty($conf->global->MAIN_MAIL_SENDMODE)) $conf->global->MAIN_MAIL_SENDMODE='mail';
|
||||
$port=! empty($conf->global->MAIN_MAIL_SMTP_PORT)?$conf->global->MAIN_MAIL_SMTP_PORT:ini_get('smtp_port');
|
||||
if (! $port) $port=25;
|
||||
@ -275,8 +274,21 @@ if ($action == 'edit')
|
||||
';
|
||||
if ($linuxlike)
|
||||
{
|
||||
print ' jQuery("#MAIN_MAIL_SMTP_SERVER").prop("disabled", true);';
|
||||
print ' jQuery("#MAIN_MAIL_SMTP_PORT").prop("disabled", true);';
|
||||
print '
|
||||
jQuery("#MAIN_MAIL_SMTP_SERVER").hide();
|
||||
jQuery("#MAIN_MAIL_SMTP_PORT").hide();
|
||||
jQuery("#smtp_server_mess").show();
|
||||
jQuery("#smtp_port_mess").show();
|
||||
';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '
|
||||
jQuery("#MAIN_MAIL_SMTP_SERVER").prop("disabled", true);
|
||||
jQuery("#MAIN_MAIL_SMTP_PORT").prop("disabled", true);
|
||||
jQuery("#smtp_server_mess").hide();
|
||||
jQuery("#smtp_port_mess").hide();
|
||||
';
|
||||
}
|
||||
print '
|
||||
}
|
||||
@ -287,7 +299,11 @@ if ($action == 'edit')
|
||||
jQuery("#MAIN_MAIL_EMAIL_TLS").removeAttr("disabled");
|
||||
jQuery("#MAIN_MAIL_SMTP_SERVER").removeAttr("disabled");
|
||||
jQuery("#MAIN_MAIL_SMTP_PORT").removeAttr("disabled");
|
||||
}
|
||||
jQuery("#MAIN_MAIL_SMTP_SERVER").show();
|
||||
jQuery("#MAIN_MAIL_SMTP_PORT").show();
|
||||
jQuery("#smtp_server_mess").hide();
|
||||
jQuery("#smtp_port_mess").hide();
|
||||
}
|
||||
}
|
||||
initfields();
|
||||
jQuery("#MAIN_MAIL_SENDMODE").change(function() {
|
||||
@ -336,7 +352,7 @@ if ($action == 'edit')
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Server
|
||||
// Host server
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>';
|
||||
if (! $conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail')
|
||||
@ -357,6 +373,7 @@ if ($action == 'edit')
|
||||
{
|
||||
print '<input class="flat" id="MAIN_MAIL_SMTP_SERVER" name="MAIN_MAIL_SMTP_SERVER" size="18" value="' . $mainserver . '">';
|
||||
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_sav" name="MAIN_MAIL_SMTP_SERVER_sav" value="' . $mainserver . '">';
|
||||
print '<span id="smtp_server_mess">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -389,6 +406,7 @@ if ($action == 'edit')
|
||||
{
|
||||
print '<input class="flat" id="MAIN_MAIL_SMTP_PORT" name="MAIN_MAIL_SMTP_PORT" size="3" value="' . $mainport . '">';
|
||||
print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_sav" name="MAIN_MAIL_SMTP_PORT_sav" value="' . $mainport . '">';
|
||||
print '<span id="smtp_port_mess">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -509,7 +527,7 @@ else
|
||||
print $text;
|
||||
print '</td></tr>';
|
||||
|
||||
// Server
|
||||
// Host server
|
||||
$var=!$var;
|
||||
if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail'))
|
||||
{
|
||||
|
||||
@ -190,7 +190,7 @@ if ($result)
|
||||
print_liste_field_titre($langs->trans("IP"),$_SERVER["PHP_SELF"],"e.ip","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("User"),$_SERVER["PHP_SELF"],"u.login","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Description"),$_SERVER["PHP_SELF"],"e.description","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('','','');
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
|
||||
@ -134,7 +134,7 @@ if ($savehandler == 'files')
|
||||
print_liste_field_titre($langs->trans("DateModification"),$_SERVER["PHP_SELF"],"datem","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Age"),$_SERVER["PHP_SELF"],"age","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Raw"),$_SERVER["PHP_SELF"],"raw","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('','','');
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
$var=True;
|
||||
|
||||
@ -103,7 +103,7 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans("Owner"),$_SERVER["PHP_SELF"],"u.lastname","","",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"b.dateb","","",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Position"),$_SERVER["PHP_SELF"],"b.position","","",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('','','');
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
$var=True;
|
||||
|
||||
@ -924,9 +924,66 @@ if ($id > 0)
|
||||
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="3">';
|
||||
if (GETPOST("afaire") == 1) $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
|
||||
else if (GETPOST("afaire") == 2) $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
|
||||
//else $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend','ap');
|
||||
else $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
|
||||
print '</td></tr>';
|
||||
|
||||
$userepeatevent=0; // Dev in progress
|
||||
if ($userepeatevent)
|
||||
{
|
||||
// Repeat
|
||||
print '<tr><td>'.$langs->trans("RepeatEvent").'</td><td colspan="3">';
|
||||
print '<input type="hidden" name="recurid" value="'.$object->recurid.'">';
|
||||
$arrayrecurrulefreq=array(
|
||||
'no'=>$langs->trans("No"),
|
||||
'MONTHLY'=>$langs->trans("EveryMonth"),
|
||||
'WEEKLY'=>$langs->trans("EveryWeek"),
|
||||
//'DAYLY'=>$langs->trans("EveryDay")
|
||||
);
|
||||
$selectedrecurrulefreq='no';
|
||||
$selectedrecurrulebymonthday='';
|
||||
$selectedrecurrulebyday='';
|
||||
if ($object->recurrule && preg_match('/FREQ=([A-Z]+)/i',$object->recurrule,$reg)) $selectedrecurrulefreq=$reg[1];
|
||||
if ($object->recurrule && preg_match('/FREQ=MONTHLY.*BYMONTHDAY=(\d+)/i',$object->recurrule,$reg)) $selectedrecurrulebymonthday=$reg[1];
|
||||
if ($object->recurrule && preg_match('/FREQ=WEEKLY.*BYDAY(\d+)/i',$object->recurrule,$reg)) $selectedrecurrulebyday=$reg[1];
|
||||
print $form->selectarray('recurrulefreq', $arrayrecurrulefreq, $selectedrecurrulefreq);
|
||||
// If recurrulefreq is MONTHLY
|
||||
print '<div class="repeateventBYMONTHDAY">';
|
||||
print $langs->trans("DayOfMonth").': <input type="input" size="2" name="BYMONTHDAY" value="'.$selectedrecurrulebymonthday.'">';
|
||||
print '</div>';
|
||||
// If recurrulefreq is WEEKLY
|
||||
print '<div class="repeateventBYDAY">';
|
||||
print $langs->trans("DayOfWeek").': <input type="input" size="4" name="BYDAY" value="'.$selectedrecurrulebyday.'">';
|
||||
print '</div>';
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
function init_repeat()
|
||||
{
|
||||
if (jQuery("#recurrulefreq").val() == \'MONTHLY\')
|
||||
{
|
||||
jQuery(".repeateventBYMONTHDAY").show();
|
||||
jQuery(".repeateventBYDAY").hide();
|
||||
}
|
||||
else if (jQuery("#recurrulefreq").val() == \'WEEKLY\')
|
||||
{
|
||||
jQuery(".repeateventBYMONTHDAY").hide();
|
||||
jQuery(".repeateventBYDAY").show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery(".repeateventBYMONTHDAY").hide();
|
||||
jQuery(".repeateventBYDAY").hide();
|
||||
}
|
||||
}
|
||||
init_repeat();
|
||||
jQuery("#recurrulefreq").change(function() {
|
||||
init_repeat();
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Status
|
||||
print '<tr><td class="nowrap">'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="3">';
|
||||
$percent=GETPOST("percentage")?GETPOST("percentage"):$object->percentage;
|
||||
@ -992,7 +1049,7 @@ if ($id > 0)
|
||||
print '</td>';
|
||||
|
||||
// Contact
|
||||
print '<td>'.$langs->trans("Contact").'</td><td width="30%">';
|
||||
print '<td>'.$langs->trans("Contact").'</td><td>';
|
||||
$form->select_contacts($object->socid, $object->contactid, 'contactid', 1, '', '', 0, 'minwidth200');
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -1000,17 +1057,15 @@ if ($id > 0)
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
|
||||
$formproject=new FormProjets($db);
|
||||
|
||||
// Projet associe
|
||||
$langs->load("project");
|
||||
|
||||
print '<tr><td width="30%">'.$langs->trans("Project").'</td><td colspan="3">';
|
||||
$numprojet=$formproject->select_projects($object->socid,$object->fk_project,'projectid');
|
||||
if ($numprojet==0)
|
||||
{
|
||||
print ' <a href="../../projet/card.php?socid='.$object->socid.'&action=create">'.$langs->trans("AddProject").'</a>';
|
||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$object->socid.'&action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit').'">'.$langs->trans("AddProject").'</a>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -1065,7 +1120,7 @@ if ($id > 0)
|
||||
if($action == 'clone')
|
||||
{
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . GETPOST('id'), $langs->trans('CloneAction'), $langs->trans('ConfirmCloneAction', $object->label), 'confirm_clone', $formquestion, 'yes', 1);
|
||||
|
||||
|
||||
print $formconfirm;
|
||||
}
|
||||
|
||||
@ -1275,7 +1330,7 @@ if ($id > 0)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("Modify").'</a></div>';
|
||||
}
|
||||
|
||||
|
||||
if ($user->rights->agenda->allactions->create ||
|
||||
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create))
|
||||
{
|
||||
@ -1285,7 +1340,7 @@ if ($id > 0)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("ToClone").'</a></div>';
|
||||
}
|
||||
|
||||
|
||||
if ($user->rights->agenda->allactions->delete ||
|
||||
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->delete))
|
||||
{
|
||||
|
||||
@ -341,11 +341,14 @@ dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action');
|
||||
print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,0,$filtert,0,$pid,$socid,$action,$listofextcals,$actioncode,$usergroup);
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
// Define the legend/list of calendard to show
|
||||
$s=''; $link='';
|
||||
|
||||
$showextcals=$listofextcals;
|
||||
// Legend
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
|
||||
if (! empty($conf->use_javascript_ajax)) // If javascript on
|
||||
{
|
||||
$s='';
|
||||
$s.='<script type="text/javascript">' . "\n";
|
||||
$s.='jQuery(document).ready(function () {' . "\n";
|
||||
$s.='jQuery("#check_birthday").click(function() { jQuery(".family_birthday").toggle(); });' . "\n";
|
||||
@ -358,7 +361,10 @@ if (! empty($conf->use_javascript_ajax))
|
||||
$s.='});' . "\n";
|
||||
$s.='</script>' . "\n";
|
||||
|
||||
// Local calendar
|
||||
$s.='<div class="nowrap clear float"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> ' . $langs->trans("LocalAgenda").' </div>';
|
||||
|
||||
// External calendars
|
||||
if (is_array($showextcals) && count($showextcals) > 0)
|
||||
{
|
||||
$s.='<script type="text/javascript">' . "\n";
|
||||
@ -377,13 +383,23 @@ if (! empty($conf->use_javascript_ajax))
|
||||
$s.='<div class="nowrap float"><input type="checkbox" id="check_ext' . $htmlname . '" name="check_ext' . $htmlname . '" checked> ' . $val['name'] . ' </div>';
|
||||
}
|
||||
}
|
||||
|
||||
// Birthdays
|
||||
$s.='<div class="nowrap float"><input type="checkbox" id="check_birthday" name="check_birthday"> '.$langs->trans("AgendaShowBirthdayEvents").' </div>';
|
||||
|
||||
// Calendars from hooks
|
||||
$parameters=array(); $object=null;
|
||||
$reshook=$hookmanager->executeHooks('addCalendarChoice',$parameters,$object,$action);
|
||||
if (empty($reshook))
|
||||
{
|
||||
$s.= $hookmanager->resPrint;
|
||||
}
|
||||
elseif ($reshook > 1)
|
||||
{
|
||||
$s = $hookmanager->resPrint;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$link='';
|
||||
// Add link to show birthdays
|
||||
if (empty($conf->use_javascript_ajax))
|
||||
else // If javascript off
|
||||
{
|
||||
$newparam=$param; // newparam is for birthday links
|
||||
$newparam=preg_replace('/showbirthday=[0-1]/i','showbirthday='.(empty($showbirthday)?1:0),$newparam);
|
||||
@ -396,10 +412,10 @@ if (empty($conf->use_javascript_ajax))
|
||||
$link.='</a>';
|
||||
}
|
||||
|
||||
print_fiche_titre($s,$link.' '.$nav, '');
|
||||
print_fiche_titre($s, $link.' '.$nav, '');
|
||||
|
||||
|
||||
// Get event in an array
|
||||
// Load events from database into $eventarray
|
||||
$eventarray=array();
|
||||
|
||||
$sql = 'SELECT ';
|
||||
@ -470,6 +486,7 @@ if ($filtert > 0 || $usergroup > 0)
|
||||
$sql.= ' ORDER BY datep';
|
||||
//print $sql;
|
||||
|
||||
|
||||
dol_syslog("comm/action/index.php", LOG_DEBUG);
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
@ -571,6 +588,7 @@ else
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
// Complete $eventarray with birthdates
|
||||
if ($showbirthday)
|
||||
{
|
||||
// Add events in array
|
||||
@ -638,6 +656,7 @@ if ($showbirthday)
|
||||
}
|
||||
}
|
||||
|
||||
// Complete $eventarray with external import Ical
|
||||
if (count($listofextcals))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/ical.class.php';
|
||||
@ -878,6 +897,15 @@ if (count($listofextcals))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Complete $eventarray with events coming from external module
|
||||
$parameters=array(); $object=null;
|
||||
$reshook=$hookmanager->executeHooks('getCalendarEvents',$parameters,$object,$action);
|
||||
if (! empty($hookmanager->resArray['eventarray'])) $eventarray=array_merge($eventarray, $hookmanager->resArray['eventarray']);
|
||||
|
||||
|
||||
|
||||
$maxnbofchar=18;
|
||||
$cachethirdparties=array();
|
||||
$cachecontacts=array();
|
||||
|
||||
@ -270,22 +270,22 @@ if ($result)
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'p.ref','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Company'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Company'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('AskPriceSupplierDate'),$_SERVER["PHP_SELF"],'p.date_livraison','',$param, 'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('AmountHT'),$_SERVER["PHP_SELF"],'p.total_ht','',$param, 'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Author'),$_SERVER["PHP_SELF"],'u.login','',$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Status'),$_SERVER["PHP_SELF"],'p.fk_statut','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" size="6" type="text" name="search_ref" value="'.$search_ref.'">';
|
||||
print '</td>';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" size="12" name="search_societe" value="'.$search_societe.'">';
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Date
|
||||
print '<td class="liste_titre" colspan="1" align="center">';
|
||||
//print $langs->trans('Month').': ';
|
||||
@ -294,7 +294,7 @@ if ($result)
|
||||
$syear = $year;
|
||||
$formother->select_year($syear,'year',1, 20, 5);
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Amount
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<input class="flat" type="text" size="10" name="search_montant_ht" value="'.$search_montant_ht.'">';
|
||||
@ -353,7 +353,7 @@ if ($result)
|
||||
print '</td></tr></table>';
|
||||
|
||||
print "</td>\n";
|
||||
|
||||
|
||||
$url = DOL_URL_ROOT.'/comm/card.php?socid='.$objp->rowid;
|
||||
|
||||
// Company
|
||||
@ -364,12 +364,12 @@ if ($result)
|
||||
print '<td>';
|
||||
print $companystatic->getNomUrl(1,'customer');
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Date askprice
|
||||
print '<td align="center">';
|
||||
print dol_print_date($db->jdate($objp->dp), 'day');
|
||||
print "</td>\n";
|
||||
|
||||
|
||||
print '<td align="right">'.price($objp->total_ht)."</td>\n";
|
||||
|
||||
$userstatic->id=$objp->fk_user_author;
|
||||
|
||||
@ -410,17 +410,19 @@ if ($id > 0)
|
||||
print '</td><td colspan="3">';
|
||||
$limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount';
|
||||
print $form->editfieldval("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer,$limit_field_type,($object->outstanding_limit != '' ? price($object->outstanding_limit) : ''));
|
||||
if (empty($object->outstanding_limit)) print $langs->trans("NoLimit");
|
||||
// display amount and link to unpaid bill
|
||||
$outstandingBills = $object->get_OutstandingBill();
|
||||
if ($outstandingBills != 0)
|
||||
print ' (' . $langs->trans('CurrentOutstandingBill') . ': ';
|
||||
print price($outstandingBills, '', $langs, 0, 0, - 1, $conf->currency);
|
||||
if ($object->outstanding_limit != '')
|
||||
{
|
||||
print ' ('.$langs->trans("CurrentOutstandingBill");
|
||||
print ' <a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->id.'&search_status=1">';
|
||||
print price($outstandingBills, '', $langs, 0, -1, -1, $conf->currency);
|
||||
print '</a>';
|
||||
if ($outstandingBills > $object->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached"));
|
||||
print ')';
|
||||
if ($outstandingBills > $object->outstanding_limit)
|
||||
print img_warning($langs->trans("OutstandingBillReached"));
|
||||
//print ' / ' . price($soc->outstanding_limit);
|
||||
}
|
||||
print ')';
|
||||
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@ -131,8 +131,8 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"p.name", $begin, $param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"p.firstname", $begin, $param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom", $begin, $param,"",$sortfield,$sortorder);
|
||||
print '<td class="liste_titre">'.$langs->trans("Email").'</td>';
|
||||
print '<td class="liste_titre">'.$langs->trans("Phone").'</td>';
|
||||
print_liste_field_titre($langs->trans("Email"));
|
||||
print_liste_field_titre($langs->trans("Phone"));
|
||||
print "</tr>\n";
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?type='.$_GET["type"].'" method="GET">';
|
||||
|
||||
@ -55,7 +55,7 @@ $search_zipcode=GETPOST("search_zipcode");
|
||||
$search_town=GETPOST("search_town");
|
||||
$search_code=GETPOST("search_code");
|
||||
$search_compta=GETPOST("search_compta");
|
||||
$search_status = GETPOST("search_status",'int');
|
||||
$search_status= GETPOST("search_status",'int');
|
||||
|
||||
// Load sale and categ filters
|
||||
$search_sale = GETPOST("search_sale",'int');
|
||||
@ -205,7 +205,7 @@ if ($result)
|
||||
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@ -419,13 +419,8 @@ if ($object->fetch($id) >= 0)
|
||||
print_liste_field_titre($langs->trans("DateSending"),$_SERVER["PHP_SELF"],"mc.date_envoi",$param,'','align="center"',$sortfield,$sortorder);
|
||||
}
|
||||
|
||||
// Statut
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"mc.statut",$param,'','align="right"',$sortfield,$sortorder);
|
||||
|
||||
//Search Icon
|
||||
print '<td class="liste_titre">';
|
||||
print ' ';
|
||||
print '</td>';
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
|
||||
print '</tr>';
|
||||
|
||||
@ -464,7 +459,7 @@ if ($object->fetch($id) >= 0)
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print ' ';
|
||||
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Reset"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ class PropaleStats extends Stats
|
||||
|
||||
$this->field='total_ht';
|
||||
$this->field_line='total_ht';
|
||||
|
||||
|
||||
$this->where.= " p.fk_statut > 0";
|
||||
//$this->where.= " AND p.fk_soc = s.rowid AND p.entity = ".$conf->entity;
|
||||
$this->where.= " AND p.entity IN (".getEntity('propal', 1).")";
|
||||
@ -183,7 +183,7 @@ class PropaleStats extends Stats
|
||||
return $this->_getAllByYear($sql);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return nb, amount of predefined product for year
|
||||
@ -193,9 +193,11 @@ class PropaleStats extends Stats
|
||||
*/
|
||||
function getAllByProduct($year)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg";
|
||||
$sql.= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product";
|
||||
//if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE ".$this->where;
|
||||
$sql.= " AND p.rowid = tl.fk_propal AND tl.fk_product = product.rowid";
|
||||
$sql.= " AND p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year,1,false))."' AND '".$this->db->idate(dol_get_last_day($year,12,false))."'";
|
||||
@ -204,5 +206,5 @@ class PropaleStats extends Stats
|
||||
//$sql.= $this->db->plimit(20);
|
||||
|
||||
return $this->_getAllByProduct($sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,8 +9,8 @@
|
||||
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
*
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
@ -255,6 +255,7 @@ if ($result)
|
||||
if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht;
|
||||
if ($search_author) $param.='&search_author='.$search_author;
|
||||
if ($search_town) $param.='&search_town='.$search_town;
|
||||
|
||||
print_barre_liste($langs->trans('ListOfProposals').' '.($socid?'- '.$soc->name:''), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_commercial.png');
|
||||
|
||||
// Lignes des champs de filtre
|
||||
@ -310,7 +311,7 @@ if ($result)
|
||||
print_liste_field_titre($langs->trans('AmountHT'),$_SERVER["PHP_SELF"],'p.total_ht','',$param, 'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Author'),$_SERVER["PHP_SELF"],'u.login','',$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Status'),$_SERVER["PHP_SELF"],'p.fk_statut','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@ -351,9 +351,8 @@ if ($resql)
|
||||
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -416,7 +415,7 @@ if ($resql)
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSearch',$parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status);
|
||||
print '</td>';
|
||||
|
||||
@ -474,8 +473,8 @@ if ($resql)
|
||||
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print '<td align="center">';
|
||||
print $prospectstatic->LibStatut($prospectstatic->status,3);
|
||||
print '<td align="right">';
|
||||
print $prospectstatic->LibStatut($prospectstatic->status,5);
|
||||
print '</td>';
|
||||
|
||||
print '<td></td>';
|
||||
|
||||
@ -130,13 +130,8 @@ $sql.= ' WHERE c.fk_soc = s.rowid';
|
||||
$sql.= ' AND c.entity IN ('.getEntity('commande', 1).')';
|
||||
if ($socid) $sql.= ' AND s.rowid = '.$socid;
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($search_ref) {
|
||||
$sql .= natural_search('c.ref', $search_ref);
|
||||
}
|
||||
if ($sall)
|
||||
{
|
||||
$sql .= natural_search(array('c.ref', 'c.note_private'), $sall);
|
||||
}
|
||||
if ($search_ref) $sql .= natural_search('c.ref', $search_ref);
|
||||
if ($sall) $sql .= natural_search(array('c.ref', 'c.note_private'), $sall);
|
||||
if ($viewstatut <> '')
|
||||
{
|
||||
if ($viewstatut < 4 && $viewstatut > -3)
|
||||
@ -190,24 +185,12 @@ else if ($deliveryyear > 0)
|
||||
{
|
||||
$sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_get_first_day($deliveryyear,1,false))."' AND '".$db->idate(dol_get_last_day($deliveryyear,12,false))."'";
|
||||
}
|
||||
if (!empty($search_company))
|
||||
{
|
||||
$sql .= natural_search('s.nom', $search_company);
|
||||
}
|
||||
if (!empty($search_ref_customer))
|
||||
{
|
||||
$sql.= ' AND c.ref_client LIKE \'%'.$db->escape($search_ref_customer).'%\'';
|
||||
}
|
||||
if (!empty($search_company)) $sql .= natural_search('s.nom', $search_company);
|
||||
if (!empty($search_ref_customer)) $sql.= natural_search('c.ref_client', $search_ref_customer);
|
||||
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
|
||||
if ($search_user > 0)
|
||||
{
|
||||
$sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='commande' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".$search_user;
|
||||
}
|
||||
if ($search_total_ht != '')
|
||||
{
|
||||
$sql.= natural_search('c.total_ht', $search_total_ht, 1);
|
||||
}
|
||||
$sql.= ' ORDER BY '.$sortfield.' '.$sortorder;
|
||||
if ($search_user > 0) $sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='commande' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".$search_user;
|
||||
if ($search_total_ht != '') $sql.= natural_search('c.total_ht', $search_total_ht, 1);
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
@ -216,7 +199,6 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
|
||||
$sql.= $db->plimit($limit + 1,$offset);
|
||||
|
||||
//print $sql;
|
||||
@ -291,7 +273,7 @@ if ($resql)
|
||||
if (! empty($moreforfilter))
|
||||
{
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre" colspan="9">';
|
||||
print '<td class="liste_titre" colspan="10">';
|
||||
print $moreforfilter;
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -304,6 +286,7 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans('DeliveryDate'),$_SERVER["PHP_SELF"],'c.date_livraison','',$param, 'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('AmountHT'),$_SERVER["PHP_SELF"],'c.total_ht','',$param, 'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Status'),$_SERVER["PHP_SELF"],'c.fk_statut','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -328,6 +311,7 @@ if ($resql)
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<input class="flat" type="text" size="6" name="search_total_ht" value="'.$search_total_ht.'">';
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print "</td></tr>\n";
|
||||
@ -493,6 +477,8 @@ if ($resql)
|
||||
// Statut
|
||||
print '<td align="right" class="nowrap">'.$generic_commande->LibStatut($objp->fk_statut,$objp->facturee,5).'</td>';
|
||||
|
||||
print '<td></td>';
|
||||
|
||||
print '</tr>';
|
||||
|
||||
$total+=$objp->total_ht;
|
||||
@ -507,7 +493,8 @@ if ($resql)
|
||||
print '<td class="nowrap" colspan="5">'.$langs->trans('TotalHT').'</td>';
|
||||
// Total HT
|
||||
print '<td align="right" class="nowrap">'.price($total).'</td>';
|
||||
print '<td class="nowrap"> </td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -113,12 +113,12 @@ if ($conf->salaries->enabled)
|
||||
$total = 0 ;
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"s.dateep","",$param,'width="140px"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"s.rowid","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"s.dateep","",$param,'width="140px"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"s.rowid","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
$var=1;
|
||||
while ($i < $num)
|
||||
|
||||
@ -139,7 +139,7 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"u.lastname","","&socid=$socid",'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","&socid=$socid",'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("FeesKilometersOrAmout"),$_SERVER["PHP_SELF"],"d.km","","&socid=$socid",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"], '');
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
// Filters lines
|
||||
|
||||
@ -2502,7 +2502,9 @@ if ($action == 'create')
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
} else if ($id > 0 || ! empty($ref)) {
|
||||
}
|
||||
else if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
/*
|
||||
* Show object in view mode
|
||||
*/
|
||||
@ -2522,7 +2524,8 @@ if ($action == 'create')
|
||||
$result = $object->fetch_thirdparty();
|
||||
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($object->socid);
|
||||
$result=$soc->fetch($object->socid);
|
||||
if ($result < 0) dol_print_error($db);
|
||||
$selleruserevenustamp = $mysoc->useRevenueStamp();
|
||||
|
||||
$totalpaye = $object->getSommePaiement();
|
||||
@ -2857,7 +2860,8 @@ if ($action == 'create')
|
||||
$outstandingBills = $soc->get_OutstandingBill();
|
||||
print ' - ' . $langs->trans('CurrentOutstandingBill') . ': ';
|
||||
print price($outstandingBills, '', $langs, 0, 0, - 1, $conf->currency);
|
||||
if ($soc->outstanding_limit != '') {
|
||||
if ($soc->outstanding_limit != '')
|
||||
{
|
||||
if ($outstandingBills > $soc->outstanding_limit)
|
||||
print img_warning($langs->trans("OutstandingBillReached"));
|
||||
print ' / ' . price($soc->outstanding_limit);
|
||||
@ -2946,7 +2950,8 @@ if ($action == 'create')
|
||||
} else
|
||||
print '. ';
|
||||
}
|
||||
if ($absolute_creditnote > 0) {
|
||||
if ($absolute_creditnote > 0)
|
||||
{
|
||||
// If validated, we show link "add credit note to payment"
|
||||
if ($object->statut != 1 || $object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) {
|
||||
if ($object->statut == 0 && $object->type != Facture::TYPE_DEPOSIT) {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
@ -129,7 +129,7 @@ if ($action == 'create')
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="facid" value="'.$object->id.'">';
|
||||
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
$rowspan=4;
|
||||
@ -202,7 +202,7 @@ if ($action == 'create')
|
||||
$sql = 'SELECT l.fk_product, l.product_type, l.label as custom_label, l.description, l.qty, l.rowid, l.tva_tx,';
|
||||
$sql.= ' l.fk_remise_except,';
|
||||
$sql.= ' l.remise_percent, l.subprice, l.info_bits,';
|
||||
$sql.= ' l.total_ht, l.total_tva, l.total_ttc,';
|
||||
$sql.= ' l.total_ht, l.total_tva as total_vat, l.total_ttc,';
|
||||
$sql.= ' l.date_start,';
|
||||
$sql.= ' l.date_end,';
|
||||
$sql.= ' l.product_type,';
|
||||
@ -220,7 +220,7 @@ if ($action == 'create')
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0; $total = 0;
|
||||
|
||||
echo '<table class="notopnoleftnoright" width="100%">';
|
||||
echo '<table class="noborder" width="100%">';
|
||||
if ($num)
|
||||
{
|
||||
print '<tr class="liste_titre">';
|
||||
@ -572,7 +572,7 @@ else
|
||||
/*
|
||||
* List mode
|
||||
*/
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid, f.titre, f.total, f.rowid as facid";
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid, f.rowid as facid, f.titre, f.total, f.tva as total_vat, f.total_ttc";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f";
|
||||
$sql.= " WHERE f.fk_soc = s.rowid";
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
@ -592,11 +592,13 @@ else
|
||||
$i = 0;
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Ref").'</td>';
|
||||
print_liste_field_titre($langs->trans("Ref"));
|
||||
print_liste_field_titre($langs->trans("Company"),$_SERVER['PHP_SELF'],"s.nom","","&socid=$socid","",$sortfiled,$sortorder);
|
||||
print '</td><td align="right">'.$langs->trans("Amount").'</td>';
|
||||
print '<td> </td>';
|
||||
print "</td>\n";
|
||||
print_liste_field_titre($langs->trans("AmountHT"),'','','','','align="right"');
|
||||
print_liste_field_titre($langs->trans("AmountVAT"),'','','','','align="right"');
|
||||
print_liste_field_titre($langs->trans("AmountTTC"),'','','','','align="right"');
|
||||
print_liste_field_titre(''); // Field may contains ling text
|
||||
print "</tr>\n";
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
@ -616,19 +618,21 @@ else
|
||||
print '<td>'.$companystatic->getNomUrl(1,'customer').'</td>';
|
||||
|
||||
print '<td align="right">'.price($objp->total).'</td>'."\n";
|
||||
print '<td align="right">'.price($objp->total_vat).'</td>'."\n";
|
||||
print '<td align="right">'.price($objp->total_ttc).'</td>'."\n";
|
||||
|
||||
echo '<td align="center">';
|
||||
|
||||
print '<td align="center">';
|
||||
if ($user->rights->facture->creer)
|
||||
{
|
||||
echo '<a href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&socid='.$objp->socid.'&fac_rec='.$objp->facid.'">';
|
||||
echo $langs->trans("CreateBill"),'</a>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&socid='.$objp->socid.'&fac_rec='.$objp->facid.'">';
|
||||
print $langs->trans("CreateBill").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo " ";
|
||||
print " ";
|
||||
}
|
||||
echo "</td></tr>\n";
|
||||
print "</td>";
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -180,30 +180,12 @@ if ($filtre)
|
||||
$sql .= ' AND ' . trim($filt[0]) . ' = ' . trim($filt[1]);
|
||||
}
|
||||
}
|
||||
if ($search_ref)
|
||||
{
|
||||
$sql .= natural_search('f.facnumber', $search_ref);
|
||||
}
|
||||
if ($search_refcustomer)
|
||||
{
|
||||
$sql .= natural_search('f.ref_client', $search_refcustomer);
|
||||
}
|
||||
if ($search_societe)
|
||||
{
|
||||
$sql .= natural_search('s.nom', $search_societe);
|
||||
}
|
||||
if ($search_montant_ht != '')
|
||||
{
|
||||
$sql.= natural_search('f.total', $search_montant_ht, 1);
|
||||
}
|
||||
if ($search_montant_ttc != '')
|
||||
{
|
||||
$sql.= natural_search('f.total_ttc', $search_montant_ttc, 1);
|
||||
}
|
||||
if ($search_status != '')
|
||||
{
|
||||
$sql.= " AND f.fk_statut = '".$db->escape($search_status)."'";
|
||||
}
|
||||
if ($search_ref) $sql .= natural_search('f.facnumber', $search_ref);
|
||||
if ($search_refcustomer) $sql .= natural_search('f.ref_client', $search_refcustomer);
|
||||
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
|
||||
if ($search_montant_ht != '') $sql.= natural_search('f.total', $search_montant_ht, 1);
|
||||
if ($search_montant_ttc != '') $sql.= natural_search('f.total_ttc', $search_montant_ttc, 1);
|
||||
if ($search_status != '') $sql.= " AND f.fk_statut = '".$db->escape($search_status)."'";
|
||||
if ($month > 0)
|
||||
{
|
||||
if ($year > 0 && empty($day))
|
||||
@ -258,7 +240,6 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
|
||||
$sql.= $db->plimit($limit+1,$offset);
|
||||
//print $sql;
|
||||
|
||||
@ -307,7 +288,7 @@ if ($resql)
|
||||
if ($moreforfilter)
|
||||
{
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre" colspan="10">';
|
||||
print '<td class="liste_titre" colspan="11">';
|
||||
print $moreforfilter;
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -323,8 +304,8 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans('AmountTTC'),$_SERVER['PHP_SELF'],'f.total_ttc','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Received'),$_SERVER['PHP_SELF'],'am','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Status'),$_SERVER['PHP_SELF'],'fk_statut,paye,am','',$param,'align="right"',$sortfield,$sortorder);
|
||||
//print '<td class="liste_titre"> </td>';
|
||||
print '</tr>';
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
// Filters lines
|
||||
print '<tr class="liste_titre">';
|
||||
@ -346,9 +327,10 @@ if ($resql)
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="left"><input class="flat" type="text" size="8" name="search_societe" value="'.$search_societe.'"></td>';
|
||||
print '<td class="liste_titre" align="right"><input class="flat" type="text" size="6" name="search_montant_ht" value="'.$search_montant_ht.'"></td>';
|
||||
print '<td class="liste_titre" align="right"> </td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre" align="right"><input class="flat" type="text" size="6" name="search_montant_ttc" value="'.$search_montant_ttc.'"></td>';
|
||||
print '<td class="liste_titre" align="right"> </td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print "</td></tr>\n";
|
||||
@ -440,7 +422,9 @@ if ($resql)
|
||||
print '<td align="right" class="nowrap">';
|
||||
print $facturestatic->LibStatut($objp->paye,$objp->fk_statut,5,$paiement,$objp->type);
|
||||
print "</td>";
|
||||
//print "<td> </td>";
|
||||
|
||||
print "<td></td>";
|
||||
|
||||
print "</tr>\n";
|
||||
$total_ht+=$objp->total_ht;
|
||||
$total_tva+=$objp->total_tva;
|
||||
@ -458,7 +442,8 @@ if ($resql)
|
||||
print '<td class="liste_total" align="right">'.price($total_tva,0,$langs).'</td>';
|
||||
print '<td class="liste_total" align="right">'.price($total_ttc,0,$langs).'</td>';
|
||||
print '<td class="liste_total" align="right">'.price($totalrecu,0,$langs).'</td>';
|
||||
print '<td class="liste_total" align="center"> </td>';
|
||||
print '<td class="liste_total"></td>';
|
||||
print '<td class="liste_total"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -654,13 +654,16 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans("Received"),$_SERVER["PHP_SELF"],"am","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Rest"),$_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye,am","",$param,'align="right"',$sortfield,$sortorder);
|
||||
|
||||
$searchpitco='<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
$searchpitco.='<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Reset"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
if (empty($mode))
|
||||
{
|
||||
print_liste_field_titre($langs->trans("PDFMerge"),$_SERVER["PHP_SELF"],"","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($searchpitco,$_SERVER["PHP_SELF"],"","",$param,'align="center"',$sortfield,$sortorder);
|
||||
}
|
||||
else
|
||||
{
|
||||
print_liste_field_titre($langs->trans("Remind"),$_SERVER["PHP_SELF"],"","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($searchpitco,$_SERVER["PHP_SELF"],"","",$param,'align="center"',$sortfield,$sortorder);
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
@ -695,9 +698,6 @@ if ($resql)
|
||||
print $form->selectarray('filtre', $liststatus, $filter, 1);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '<br>';
|
||||
if (empty($mode))
|
||||
{
|
||||
if ($conf->use_javascript_ajax) print '<a href="#" id="checkall">'.$langs->trans("All").'</a> / <a href="#" id="checknone">'.$langs->trans("None").'</a>';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
|
||||
* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2013-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
*
|
||||
@ -109,15 +109,22 @@ if (! empty($conf->holiday->enabled))
|
||||
{
|
||||
$user_id = $user->id;
|
||||
|
||||
$nbaquis=$holiday->getCPforUser($user_id);
|
||||
$nbdeduced=$holiday->getConfCP('nbHolidayDeducted');
|
||||
$nb_holiday = $nbaquis / $nbdeduced;
|
||||
|
||||
print '<table class="noborder nohover" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Holidays").'</td></tr>';
|
||||
print "<tr ".$bc[0].">";
|
||||
print '<td colspan="3">';
|
||||
print $langs->trans('SoldeCPUser',round($nb_holiday,2)).($nbdeduced != 1 ? ' ('.$nbaquis.' / '.$nbdeduced.')' : '');
|
||||
|
||||
$out='';
|
||||
$typeleaves=$holiday->getTypes(1,1);
|
||||
foreach($typeleaves as $key => $val)
|
||||
{
|
||||
$nb_type = $holiday->getCPforUser($user->id, $val['rowid']);
|
||||
$nb_holiday += $nb_type;
|
||||
$out .= ' - '.$val['label'].': <strong>'.($nb_type?price2num($nb_type):0).'</strong><br>';
|
||||
}
|
||||
print $langs->trans('SoldeCPUser', round($nb_holiday,5)).'<br>';
|
||||
print $out;
|
||||
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</table><br>';
|
||||
|
||||
@ -151,7 +151,7 @@ if ($result)
|
||||
if($obj->product_type == 0) $compta_prod = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT)?$conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT:$langs->trans("CodeNotDef"));
|
||||
else $compta_prod = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT)?$conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT:$langs->trans("CodeNotDef"));
|
||||
}
|
||||
$cpttva = (! empty($conf->global->ACCOUNTING_VAT_ACCOUNT)?$conf->global->ACCOUNTING_VAT_ACCOUNT:$langs->trans("CodeNotDef"));
|
||||
$cpttva = (! empty($conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT)?$conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT:$langs->trans("CodeNotDef"));
|
||||
$compta_tva = (! empty($obj->account_tva)?$obj->account_tva:$cpttva);
|
||||
|
||||
$account_localtax1=getLocalTaxesFromRate($obj->tva_tx, 1, $obj->thirdparty, $mysoc);
|
||||
|
||||
@ -705,7 +705,7 @@ if (! GETPOST('action'))
|
||||
print_liste_field_titre($langs->trans('Date'),$_SERVER["PHP_SELF"],'dp','','','',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Type'),$_SERVER["PHP_SELF"],'libelle','','','',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Amount'),$_SERVER["PHP_SELF"],'fa_amount','','','align="right"',$sortfield,$sortorder);
|
||||
print '<td> </td>';
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
while ($i < min($num,$limit))
|
||||
@ -728,6 +728,6 @@ if (! GETPOST('action'))
|
||||
}
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -88,7 +88,7 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"dp","","",'width="80" align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"c.libelle","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"c.libelle","","",'align="right"',$sortfield,$sortorder);
|
||||
print "<td> </td>";
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
while ($i < min($num,$limit))
|
||||
|
||||
@ -655,7 +655,8 @@ else
|
||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"b.amount", "",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("LineRecord"),$_SERVER["PHP_SELF"],"b.rowid", "",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Payment"),$_SERVER["PHP_SELF"],"p.rowid", "",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('','','');
|
||||
print_liste_field_titre('');
|
||||
|
||||
print "</tr>\n";
|
||||
$i=1;
|
||||
$var=false;
|
||||
|
||||
@ -68,6 +68,12 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
||||
$search_company="";
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('paymentlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@ -81,24 +87,37 @@ if (GETPOST("orphelins"))
|
||||
// Paiements lies a aucune facture (pour aide au diagnostic)
|
||||
$sql = "SELECT p.rowid, p.datep as dp, p.amount,";
|
||||
$sql.= " p.statut, p.num_paiement,";
|
||||
//$sql.= " c.libelle as paiement_type";
|
||||
$sql.= " c.code as paiement_code";
|
||||
// Add fields for extrafields
|
||||
foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
|
||||
// Add fields from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."paiement as p,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."c_paiement as c)";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement";
|
||||
$sql.= " WHERE p.fk_paiement = c.id";
|
||||
$sql.= " AND p.entity = ".$conf->entity;
|
||||
$sql.= " AND pf.fk_facture IS NULL";
|
||||
// Add where from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "SELECT DISTINCT p.rowid, p.datep as dp, p.amount,"; // DISTINCT is to avoid duplicate when there is a link to sales representatives
|
||||
$sql.= " p.statut, p.num_paiement,";
|
||||
//$sql.= " c.libelle as paiement_type,";
|
||||
$sql.= " c.code as paiement_code,";
|
||||
$sql.= " ba.rowid as bid, ba.label,";
|
||||
$sql.= " s.rowid as socid, s.nom as name";
|
||||
//$sql.= " f.facnumber";
|
||||
// Add fields for extrafields
|
||||
foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
|
||||
// Add fields from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."c_paiement as c, ".MAIN_DB_PREFIX."paiement as p)";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON p.fk_bank = b.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
||||
@ -127,6 +146,10 @@ else
|
||||
if ($search_paymenttype != "") $sql .=" AND c.code='".$db->escape($search_paymenttype)."'";
|
||||
if ($search_amount) $sql .=" AND p.amount='".$db->escape(price2num($search_amount))."'";
|
||||
if ($search_company) $sql .= natural_search('s.nom', $search_company);
|
||||
// Add where from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
}
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($limit+1, $offset);
|
||||
@ -157,11 +180,13 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$paramlist,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"p.amount","",$paramlist,'align="right"',$sortfield,$sortorder);
|
||||
//print_liste_field_titre($langs->trans("Invoices"),"","","",$paramlist,'align="left"',$sortfield,$sortorder);
|
||||
if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))
|
||||
{
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut","",$paramlist,'align="right"',$sortfield,$sortorder);
|
||||
}
|
||||
print '<td class="liste_titre"> </td>';
|
||||
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut","",$paramlist,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
// Lines for filters fields
|
||||
@ -199,7 +224,7 @@ if ($resql)
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
|
||||
print '<td width="40">';
|
||||
print '<td>';
|
||||
$paymentstatic->id=$objp->rowid;
|
||||
$paymentstatic->ref=$objp->rowid;
|
||||
print $paymentstatic->getNomUrl(1);
|
||||
|
||||
@ -75,17 +75,16 @@ if ($result)
|
||||
|
||||
print_barre_liste($langs->trans("WithdrawalsReceipts"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num);
|
||||
|
||||
print"\n<!-- debut table -->\n";
|
||||
print '<table class="liste" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("WithdrawalsReceipts"),$_SERVER["PHP_SELF"],"p.ref",'','','class="liste_titre"');
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"p.datec","","",'class="liste_titre" align="center"');
|
||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"","","",'align="center"');
|
||||
print '</tr>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<form action="bons.php" method="GET">';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="GET">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_ligne" value="'. $search_line.'" size="10"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>';
|
||||
|
||||
@ -308,7 +308,7 @@ if ($id > 0)
|
||||
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom",'',$urladd);
|
||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"pl.amount","",$urladd,'align="center"');
|
||||
print_liste_field_titre('');
|
||||
print '</tr>';
|
||||
print "</tr>\n";
|
||||
|
||||
$var=false;
|
||||
|
||||
|
||||
@ -147,7 +147,9 @@ if ($result)
|
||||
print_liste_field_titre($langs->trans("Bill"),$_SERVER["PHP_SELF"],"p.ref",'',$urladd,'class="liste_titre"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom",'',$urladd,'class="liste_titre"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"f.total_ttc","",$urladd,'class="liste_titre" align="center"',$sortfield,$sortorder);
|
||||
print '<td class="liste_titre" colspan="2"> </td></tr>';
|
||||
print_liste_field_titre('');
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
$var=false;
|
||||
|
||||
|
||||
@ -124,8 +124,8 @@ if ($result)
|
||||
print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client",'','','align="center"');
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"p.datec","","",'align="center"');
|
||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"pl.amount","","",'align="right"');
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '</tr>';
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="GET">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@ -92,7 +92,7 @@ if ($result)
|
||||
print_liste_field_titre($langs->trans("Line"),$_SERVER["PHP_SELF"],"p.ref",'',$urladd);
|
||||
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom",'',$urladd);
|
||||
print_liste_field_titre($langs->trans("Reason"),$_SERVER["PHP_SELF"],"pr.motif","",$urladd);
|
||||
print '</tr>';
|
||||
print "</tr>\n";
|
||||
|
||||
$var=True;
|
||||
|
||||
|
||||
@ -127,14 +127,14 @@ if ($result)
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"s.rowid","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"u.rowid","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"s.salary","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PaymentMode"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("");
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"s.rowid","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"u.rowid","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"s.salary","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PaymentMode"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@ -164,6 +164,7 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"cs.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"cs.date_ech","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cs.paye","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -184,6 +185,8 @@ if ($resql)
|
||||
print '<input class="flat" type="text" size="6" name="search_amount" value="'.$search_amount.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
// Status
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print "</td></tr>\n";
|
||||
@ -228,6 +231,8 @@ if ($resql)
|
||||
|
||||
print '<td align="right" class="nowrap">'.$chargesociale_static->LibStatut($obj->paye,5,$obj->alreadypayed).'</a></td>';
|
||||
|
||||
print '<td></td>';
|
||||
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
*
|
||||
@ -140,7 +140,7 @@ if ($result)
|
||||
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"dm","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"t.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("");
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@ -921,7 +921,11 @@ class Contact extends CommonObject
|
||||
//if ($this->civility_id) $label.= '<br><b>' . $langs->trans("Civility") . ':</b> '.$this->civility_id; // TODO Translate cibilty_id code
|
||||
$label.= '<br><b>' . $langs->trans("Poste") . ':</b> '.$this->poste;
|
||||
$label.= '<br><b>' . $langs->trans("EMail") . ':</b> '.$this->email;
|
||||
$label.= '<br><b>' . $langs->trans("Phone") . ':</b> '.join(', ',array($this->phone_pro,$this->phone_mobile,$this->phone_perso));
|
||||
$phonelist=array();
|
||||
if ($this->phone_pro) $phonelist[]=$this->phone_pro;
|
||||
if ($this->phone_mobile) $phonelist[]=$this->phone_mobile;
|
||||
if ($this->phone_pesro) $phonelist[]=$this->phone_perso;
|
||||
$label.= '<br><b>' . $langs->trans("Phone") . ':</b> '.join(', ',$phonelist);
|
||||
$label.= '<br><b>' . $langs->trans("Address") . ':</b> '.dol_format_address($this, 1, ' ', $langs);
|
||||
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
|
||||
@ -131,7 +131,7 @@ $formother=new FormOther($db);
|
||||
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name,";
|
||||
$sql.= " p.rowid as cidp, p.lastname as lastname, p.statut, p.firstname, p.poste, p.email, p.skype,";
|
||||
$sql.= " p.phone, p.phone_mobile, p.fax, p.fk_pays, p.priv, p.tms,";
|
||||
$sql.= " p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.fk_pays, p.priv, p.tms,";
|
||||
$sql.= " co.code as country_code";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as p";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = p.fk_pays";
|
||||
@ -311,10 +311,10 @@ if ($result)
|
||||
print_liste_field_titre($langs->trans("DateModificationShort"),$_SERVER["PHP_SELF"],"p.tms", $begin, $param, 'align="center"', $sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ContactVisibility"),$_SERVER["PHP_SELF"],"p.priv", $begin, $param, 'align="center"', $sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut", $begin, $param, 'align="center"', $sortfield,$sortorder);
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
// Ligne des champs de filtres
|
||||
// Lines for filter fields
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="search_lastname" size="9" value="'.dol_escape_htmltag($search_lastname).'">';
|
||||
@ -377,6 +377,10 @@ if ($result)
|
||||
$contactstatic->firstname='';
|
||||
$contactstatic->id=$obj->cidp;
|
||||
$contactstatic->statut=$obj->statut;
|
||||
$contactstatic->poste=$obj->poste;
|
||||
$contactstatic->phone_pro=$obj->phone_pro;
|
||||
$contactstatic->phone_perso=$obj->phone_perso;
|
||||
$contactstatic->phone_mobile=$obj->phone_mobile;
|
||||
print $contactstatic->getNomUrl(1,'',20);
|
||||
print '</td>';
|
||||
|
||||
@ -403,7 +407,7 @@ if ($result)
|
||||
}
|
||||
|
||||
// Phone
|
||||
print '<td>'.dol_print_phone($obj->phone,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').'</td>';
|
||||
print '<td>'.dol_print_phone($obj->phone_pro,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').'</td>';
|
||||
// Phone mobile
|
||||
print '<td>'.dol_print_phone($obj->phone_mobile,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').'</td>';
|
||||
// Fax
|
||||
|
||||
@ -20,7 +20,6 @@
|
||||
* \file htdocs/core/boxes/box_task.php
|
||||
* \ingroup Projet
|
||||
* \brief Module to Task activity of the current year
|
||||
* \version $Id: box_task.php,v 1.1 2012/09/11 Charles-François BENKE
|
||||
*/
|
||||
|
||||
include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php");
|
||||
@ -123,8 +122,7 @@ class box_task extends ModeleBoxes
|
||||
|
||||
|
||||
// Add the sum à the bottom of the boxes
|
||||
$this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="left" ', 'text' => $langs->trans("Total")." ".$textHead);
|
||||
$this->info_box_contents[$i][1] = array('td' => '', 'text' => "");
|
||||
$this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="left" colspan="2" ', 'text' => $langs->trans("Total")." ".$textHead);
|
||||
$this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')." ".$langs->trans("Tasks"));
|
||||
$this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5));
|
||||
$this->info_box_contents[$i][4] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot,'all',25200,5));
|
||||
|
||||
@ -39,7 +39,7 @@ class CMailFile
|
||||
var $subject; // Topic: Subject of email
|
||||
var $addr_from; // From: Label and EMail of sender (must include '<>'). For example '<myemail@example.com>' or 'John Doe <myemail@example.com>' or '<myemail+trackingid@example.com>')
|
||||
// Sender: Who send the email ("Sender" has sent emails on behalf of "From").
|
||||
// Use it when the "From" is an email of a domain that is a SPF protected domain, and sending smtp server is not this domain. In such case, use for Sender an email of the protected domain.
|
||||
// Use it when the "From" is an email of a domain that is a SPF protected domain, and sending smtp server is not this domain. In such case, add Sender field with an email of the protected domain.
|
||||
// Return-Path: Email where to send bounds.
|
||||
var $errors_to; // Errors-To: Email where to send errors.
|
||||
var $addr_to;
|
||||
@ -408,8 +408,8 @@ class CMailFile
|
||||
$bounce = ''; // By default
|
||||
if (! empty($conf->global->MAIN_MAIL_ALLOW_SENDMAIL_F))
|
||||
{
|
||||
// le return-path dans les header ne fonctionne pas avec tous les MTA
|
||||
// Le passage par -f est donc possible si la constante MAIN_MAIL_ALLOW_SENDMAIL_F est definie.
|
||||
// le "Return-Path" (retour des messages bounced) dans les header ne fonctionne pas avec tous les MTA
|
||||
// Le forcage de la valeure grace à l'option -f de sendmail est donc possible si la constante MAIN_MAIL_ALLOW_SENDMAIL_F est definie.
|
||||
// La variable definie pose des pb avec certains sendmail securisee (option -f refusee car dangereuse)
|
||||
$bounce .= ($bounce?' ':'').(! empty($conf->global->MAIN_MAIL_ERRORS_TO) ? '-f' . $this->getValidAddress($conf->global->MAIN_MAIL_ERRORS_TO,2) : ($this->addr_from != '' ? '-f' . $this->getValidAddress($this->addr_from,2) : '') );
|
||||
}
|
||||
@ -427,7 +427,15 @@ class CMailFile
|
||||
|
||||
if (! $res)
|
||||
{
|
||||
$this->error="Failed to send mail with php mail to HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port')."<br>Check your server logs and your firewalls setup";
|
||||
$this->error="Failed to send mail with php mail";
|
||||
$linuxlike=1;
|
||||
if (preg_match('/^win/i',PHP_OS)) $linuxlike=0;
|
||||
if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0;
|
||||
if (! $linuxlike)
|
||||
{
|
||||
$this->error.=" to HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port'); // This values are value used only for non linuxlike systems
|
||||
}
|
||||
$this->error.=".<br>Check your server logs and your firewalls setup";
|
||||
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
|
||||
}
|
||||
else
|
||||
|
||||
@ -135,7 +135,7 @@ abstract class CommonObject
|
||||
|
||||
$sql = "SELECT rowid, ref, ref_ext";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.$element;
|
||||
$sql.= " WHERE entity IN (".getEntity($element).")" ;
|
||||
$sql.= " WHERE entity IN (".getEntity($element,1).")" ;
|
||||
|
||||
if ($id > 0) $sql.= " AND rowid = ".$db->escape($id);
|
||||
else if ($ref) $sql.= " AND ref = '".$db->escape($ref)."'";
|
||||
@ -3572,8 +3572,8 @@ abstract class CommonObject
|
||||
* Function to show lines of extrafields with output datas
|
||||
*
|
||||
* @param object $extrafields Extrafield Object
|
||||
* @param string $mode Show output (view) or input (edit) for extrafield
|
||||
* @param array $params Optionnal parameters
|
||||
* @param string $mode Show output ('view') or input ('edit') for extrafield
|
||||
* @param array $params Optionnal parameters. Example: array('colspan'=>2)
|
||||
* @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names)
|
||||
*
|
||||
* @return string
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
/* Copyright (C) 2009-2015 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -23,19 +23,23 @@
|
||||
|
||||
|
||||
/**
|
||||
* \class DolCookie
|
||||
* \brief Class to manage cookies
|
||||
* Class to manage cookies.
|
||||
* This class is used by external module multicompany but will be removed soon only and must not be used by
|
||||
*
|
||||
* @deprecated PHP already provide function to read/store a cookie. No need to use a dedicated class. Also storing sensitive information into cookie is forbidden, so encryption is useless.
|
||||
* If a data is sensitive, it must be stored into database (if we need a long term retention) or into session.
|
||||
*/
|
||||
class DolCookie
|
||||
{
|
||||
var $myKey;
|
||||
private $_myKey;
|
||||
private $_iv;
|
||||
|
||||
var $myCookie;
|
||||
var $myValue;
|
||||
var $myExpire;
|
||||
var $myPath;
|
||||
var $myDomain;
|
||||
var $mySecure;
|
||||
var $cookiearray;
|
||||
var $cookie;
|
||||
|
||||
/**
|
||||
@ -45,8 +49,8 @@ class DolCookie
|
||||
*/
|
||||
function __construct($key = '')
|
||||
{
|
||||
$this->myKey = $key;
|
||||
$this->cookiearray = array();
|
||||
$this->_myKey = hash('sha256', $key, TRUE);
|
||||
$this->_iv = md5(md5($this->_myKey));
|
||||
$this->cookie = "";
|
||||
$this->myCookie = "";
|
||||
$this->myValue = "";
|
||||
@ -58,16 +62,12 @@ class DolCookie
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function cryptCookie()
|
||||
private function _cryptCookie()
|
||||
{
|
||||
if (!empty($this->myKey))
|
||||
if (!empty($this->_myKey) && !empty($this->_iv))
|
||||
{
|
||||
$valuecrypt = base64_encode($this->myValue);
|
||||
$max=dol_strlen($valuecrypt)-1;
|
||||
for ($f=0 ; $f <= $max; $f++)
|
||||
{
|
||||
$this->cookie .= intval(ord($valuecrypt[$f]))*$this->myKey."|";
|
||||
}
|
||||
$this->cookie = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->_myKey, $valuecrypt, MCRYPT_MODE_CBC, $this->_iv));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -82,19 +82,12 @@ class DolCookie
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function decryptCookie()
|
||||
private function _decryptCookie()
|
||||
{
|
||||
if (!empty($this->myKey))
|
||||
if (!empty($this->_myKey) && !empty($this->_iv))
|
||||
{
|
||||
$this->cookiearray = explode("|",$_COOKIE[$this->myCookie]);
|
||||
$this->myValue = "" ;
|
||||
$num = (count($this->cookiearray) - 2);
|
||||
for ($f = 0; $f <= $num; $f++)
|
||||
{
|
||||
if (!empty($this->myKey)) {
|
||||
$this->myValue .= strval(chr($this->cookiearray[$f]/$this->myKey));
|
||||
}
|
||||
}
|
||||
$this->cookie = $_COOKIE[$this->myCookie];
|
||||
$this->myValue = trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->_myKey, base64_decode($this->cookie), MCRYPT_MODE_CBC, $this->_iv));
|
||||
|
||||
return(base64_decode($this->myValue));
|
||||
}
|
||||
@ -115,7 +108,7 @@ class DolCookie
|
||||
* @param int $secure 0 or 1
|
||||
* @return void
|
||||
*/
|
||||
function _setCookie($cookie, $value, $expire=0, $path="/", $domain="", $secure=0)
|
||||
public function setCookie($cookie, $value, $expire=0, $path="/", $domain="", $secure=0)
|
||||
{
|
||||
$this->myCookie = $cookie;
|
||||
$this->myValue = $value;
|
||||
@ -126,7 +119,7 @@ class DolCookie
|
||||
|
||||
//print 'key='.$this->myKey.' name='.$this->myCookie.' value='.$this->myValue.' expire='.$this->myExpire;
|
||||
|
||||
$this->cryptCookie();
|
||||
$this->_cryptCookie();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -135,11 +128,11 @@ class DolCookie
|
||||
* @param string $cookie Cookie name
|
||||
* @return string Decrypted value
|
||||
*/
|
||||
function _getCookie($cookie)
|
||||
public function getCookie($cookie)
|
||||
{
|
||||
$this->myCookie = $cookie;
|
||||
|
||||
$decryptValue = $this->decryptCookie();
|
||||
$decryptValue = $this->_decryptCookie();
|
||||
|
||||
return $decryptValue;
|
||||
}
|
||||
|
||||
@ -116,8 +116,8 @@ class HookManager
|
||||
* @param array $parameters Array of parameters
|
||||
* @param Object $object Object to use hooks on
|
||||
* @param string $action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...)
|
||||
* @return mixed For 'addreplace hooks (doActions,formObjectOptions,pdf_xxx,...): Return 0 if we want to keep standard actions, >0 if we want to stop standard actions, <0 if KO.
|
||||
* For 'output' hooks (printLeftBlock, formAddObjectLine, formBuilddocOptions, ...): Return 0, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint.
|
||||
* @return mixed For 'addreplace hooks (doActions,formObjectOptions,pdf_xxx,...): Return 0 if we want to keep standard actions, >0 if we want to stop standard actions, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results and set into ->resArray.
|
||||
* For 'output' hooks (printLeftBlock, formAddObjectLine, formBuilddocOptions, ...): Return 0, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results and set into ->resArray.
|
||||
* All types can also return some values into an array ->results.
|
||||
* $this->error or this->errors are also defined by class called by this function if error.
|
||||
*/
|
||||
@ -128,26 +128,28 @@ class HookManager
|
||||
$parameters['context']=join(':',$this->contextarray);
|
||||
dol_syslog(get_class($this).'::executeHooks method='.$method." action=".$action." context=".$parameters['context']);
|
||||
|
||||
// Define type of hook ('output' or 'addreplace'. 'returnvalue' is deprecated).
|
||||
// Define type of hook ('output' or 'addreplace'. 'returnvalue' is deprecated because a 'addreplace' hook can also return resPrint and resArray).
|
||||
$hooktype='output';
|
||||
if (in_array(
|
||||
$method,
|
||||
array(
|
||||
'addMoreActionsButtons',
|
||||
'addStatisticLine',
|
||||
'deleteFile',
|
||||
'doActions',
|
||||
'formCreateThirdpartyOptions',
|
||||
'formObjectOptions',
|
||||
'formattachOptions',
|
||||
'formBuilddocLineOptions',
|
||||
'moveUploadedFile',
|
||||
'pdf_writelinedesc',
|
||||
'paymentsupplierinvoices',
|
||||
'printSearchForm',
|
||||
'formatEvent'
|
||||
)
|
||||
)) $hooktype='addreplace';
|
||||
if (in_array(
|
||||
$method,
|
||||
array(
|
||||
'addMoreActionsButtons',
|
||||
'addStatisticLine',
|
||||
'deleteFile',
|
||||
'doActions',
|
||||
'formCreateThirdpartyOptions',
|
||||
'formObjectOptions',
|
||||
'formattachOptions',
|
||||
'formBuilddocLineOptions',
|
||||
'moveUploadedFile',
|
||||
'pdf_writelinedesc',
|
||||
'paymentsupplierinvoices',
|
||||
'printAddress',
|
||||
'printSearchForm',
|
||||
'formatEvent',
|
||||
'addCalendarChoice'
|
||||
)
|
||||
)) $hooktype='addreplace';
|
||||
// Deprecated hook types ('returnvalue')
|
||||
if (preg_match('/^pdf_/',$method) && $method != 'pdf_writelinedesc') $hooktype='returnvalue'; // pdf_xxx except pdf_writelinedesc are 'returnvalue' hooks. When there is 2 hooks of this type, only last one win. TODO Move them into 'output' or 'addreplace' hooks.
|
||||
if ($method == 'insertExtraFields')
|
||||
|
||||
@ -398,7 +398,7 @@ class Form
|
||||
if ($direction > 0) { $extracss=($extracss?$extracss.' ':'').'inline-block'; $extrastyle='padding: 0px; padding-right: 3px !important;'; }
|
||||
|
||||
$htmltext=str_replace('"',""",$htmltext);
|
||||
if ($tooltipon == 2 || $tooltipon == 3) $paramfortooltipimg=' class="classfortooltip inline-block'.($extracss?' '.$extracss:'').'" style="padding: 0px;'.($extrastyle?' '.$extrastyle:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td img tag to store tooltip
|
||||
if ($tooltipon == 2 || $tooltipon == 3) $paramfortooltipimg=' class="classfortooltip inline-block'.($extracss?' '.$extracss:'').'" style="padding: 0px;'.($extrastyle?' '.$extrastyle:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on img tag to store tooltip
|
||||
else $paramfortooltipimg =($extracss?' class="'.$extracss.'"':'').($extrastyle?' style="'.$extrastyle.'"':''); // Attribut to put on td text tag
|
||||
if ($tooltipon == 1 || $tooltipon == 3) $paramfortooltiptd=' class="classfortooltip inline-block'.($extracss?' '.$extracss:'').'" style="padding: 0px;'.($extrastyle?' '.$extrastyle:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td tag to store tooltip
|
||||
else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':'').($extrastyle?' style="'.$extrastyle.'"':''); // Attribut to put on td text tag
|
||||
@ -4043,14 +4043,15 @@ class Form
|
||||
* @param int $empty 0=Fields required, 1=Empty inputs are allowed, 2=Empty inputs are allowed for hours only
|
||||
* @param string $form_name Not used
|
||||
* @param int $d 1=Show days, month, years
|
||||
* @param int $addnowbutton Add a button "Now"
|
||||
* @param int $addnowlink Add a link "Now"
|
||||
* @param int $nooutput Do not output html string but return it
|
||||
* @param int $disabled Disable input fields
|
||||
* @param int $fullday When a checkbox with this html name is on, hour and day are set with 00:00 or 23:59
|
||||
* @param string $addplusone Add a link "+1 hour". Value must be name of another select_date field.
|
||||
* @return mixed Nothing or string if nooutput is 1
|
||||
* @see form_date
|
||||
*/
|
||||
function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowbutton=0, $nooutput=0, $disabled=0, $fullday='')
|
||||
function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowlink=0, $nooutput=0, $disabled=0, $fullday='', $addplusone='')
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
@ -4203,7 +4204,7 @@ class Form
|
||||
if ($h)
|
||||
{
|
||||
// Show hour
|
||||
$retstring.='<select'.($disabled?' disabled':'').' class="flat '.($fullday?$fullday.'hour':'').'" name="'.$prefix.'hour">';
|
||||
$retstring.='<select'.($disabled?' disabled':'').' class="flat '.($fullday?$fullday.'hour':'').'" id="'.$prefix.'hour" name="'.$prefix.'hour">';
|
||||
if ($emptyhours) $retstring.='<option value="-1"> </option>';
|
||||
for ($hour = 0; $hour < 24; $hour++)
|
||||
{
|
||||
@ -4217,7 +4218,7 @@ class Form
|
||||
if ($m)
|
||||
{
|
||||
// Show minutes
|
||||
$retstring.='<select'.($disabled?' disabled':'').' class="flat '.($fullday?$fullday.'min':'').'" name="'.$prefix.'min">';
|
||||
$retstring.='<select'.($disabled?' disabled':'').' class="flat '.($fullday?$fullday.'min':'').'" id="'.$prefix.'min" name="'.$prefix.'min">';
|
||||
if ($emptyhours) $retstring.='<option value="-1"> </option>';
|
||||
for ($min = 0; $min < 60 ; $min++)
|
||||
{
|
||||
@ -4227,14 +4228,18 @@ class Form
|
||||
$retstring.='</select>';
|
||||
}
|
||||
|
||||
// Add a "Now" button
|
||||
if ($conf->use_javascript_ajax && $addnowbutton)
|
||||
// Add a "Now" link
|
||||
if ($conf->use_javascript_ajax && $addnowlink)
|
||||
{
|
||||
// Script which will be inserted in the OnClick of the "Now" button
|
||||
// Script which will be inserted in the onClick of the "Now" link
|
||||
$reset_scripts = "";
|
||||
|
||||
// Generate the date part, depending on the use or not of the javascript calendar
|
||||
if ($usecalendar == "eldy")
|
||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date(dol_now(),'day').'\');';
|
||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date(dol_now(),'%d').'\');';
|
||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date(dol_now(),'%m').'\');';
|
||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date(dol_now(),'%Y').'\');';
|
||||
/*if ($usecalendar == "eldy")
|
||||
{
|
||||
$base=DOL_URL_ROOT.'/core/';
|
||||
$reset_scripts .= 'resetDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');';
|
||||
@ -4244,30 +4249,66 @@ class Form
|
||||
$reset_scripts .= 'this.form.elements[\''.$prefix.'day\'].value=formatDate(new Date(), \'d\'); ';
|
||||
$reset_scripts .= 'this.form.elements[\''.$prefix.'month\'].value=formatDate(new Date(), \'M\'); ';
|
||||
$reset_scripts .= 'this.form.elements[\''.$prefix.'year\'].value=formatDate(new Date(), \'yyyy\'); ';
|
||||
}
|
||||
// Generate the hour part
|
||||
}*/
|
||||
// Update the hour part
|
||||
if ($h)
|
||||
{
|
||||
if ($fullday) $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
|
||||
$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); ';
|
||||
//$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); ';
|
||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date(dol_now(),'%H').'\');';
|
||||
if ($fullday) $reset_scripts .= ' } ';
|
||||
}
|
||||
// Generate the minute part
|
||||
// Update the minute part
|
||||
if ($m)
|
||||
{
|
||||
if ($fullday) $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
|
||||
$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); ';
|
||||
//$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); ';
|
||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date(dol_now(),'%M').'\');';
|
||||
if ($fullday) $reset_scripts .= ' } ';
|
||||
}
|
||||
// If reset_scripts is not empty, print the button with the reset_scripts in OnClick
|
||||
// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
|
||||
if ($reset_scripts && empty($conf->dol_optimize_smallscreen))
|
||||
{
|
||||
$retstring.=' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="Now" onClick="'.$reset_scripts.'">';
|
||||
$retstring.=' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">';
|
||||
$retstring.=$langs->trans("Now");
|
||||
$retstring.='</button> ';
|
||||
}
|
||||
}
|
||||
|
||||
// Add a "Plus one hour" link
|
||||
if ($conf->use_javascript_ajax && $addplusone)
|
||||
{
|
||||
// Script which will be inserted in the onClick of the "Add plusone" link
|
||||
$reset_scripts = "";
|
||||
|
||||
// Generate the date part, depending on the use or not of the javascript calendar
|
||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date(dol_now(),'day').'\');';
|
||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date(dol_now(),'%d').'\');';
|
||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date(dol_now(),'%m').'\');';
|
||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date(dol_now(),'%Y').'\');';
|
||||
// Update the hour part
|
||||
if ($h)
|
||||
{
|
||||
if ($fullday) $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
|
||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date(dol_now(),'%H').'\');';
|
||||
if ($fullday) $reset_scripts .= ' } ';
|
||||
}
|
||||
// Update the minute part
|
||||
if ($m)
|
||||
{
|
||||
if ($fullday) $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
|
||||
$reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date(dol_now(),'%M').'\');';
|
||||
if ($fullday) $reset_scripts .= ' } ';
|
||||
}
|
||||
// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
|
||||
if ($reset_scripts && empty($conf->dol_optimize_smallscreen))
|
||||
{
|
||||
$retstring.=' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">';
|
||||
$retstring.=$langs->trans("DateStartPlusOne");
|
||||
$retstring.='</button> ';
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($nooutput)) return $retstring;
|
||||
|
||||
print $retstring;
|
||||
@ -5158,11 +5199,11 @@ class Form
|
||||
*/
|
||||
global $dolibarr_main_url_root;
|
||||
$ret.='<!-- Put link to gravatar -->';
|
||||
$ret.='<img class="photo'.$modulepart.'" alt="Gravatar avatar" title="'.$email.' Gravatar avatar" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="https://www.gravatar.com/avatar/'.dol_hash(strtolower(trim($email)),3).'?s='.$width.'&d='.urlencode(dol_buildpath($nophoto,2)).'">'; // gravatar need md5 hash
|
||||
$ret.='<img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="Gravatar avatar" title="'.$email.' Gravatar avatar" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="https://www.gravatar.com/avatar/'.dol_hash(strtolower(trim($email)),3).'?s='.$width.'&d='.urlencode(dol_buildpath($nophoto,2)).'">'; // gravatar need md5 hash
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret.='<img class="photo'.$modulepart.'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.$nophoto.'">';
|
||||
$ret.='<img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.$nophoto.'">';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -795,8 +795,8 @@ class FormFile
|
||||
print_liste_field_titre($langs->trans("Size"),$url,"size","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"),$url,"date","",$param,'align="center"',$sortfield,$sortorder);
|
||||
if (empty($useinecm)) print_liste_field_titre('',$url,"","",$param,'align="center"');
|
||||
print_liste_field_titre('','','');
|
||||
print '</tr>';
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
$nboffiles=count($filearray);
|
||||
|
||||
@ -866,14 +866,26 @@ class FormFile
|
||||
if (image_format_supported($file['name']) > 0)
|
||||
{
|
||||
$permtoedit=0;
|
||||
if ($user->rights->produit->creer && $object->type == Product::TYPE_PRODUCT) $permtoedit=1;
|
||||
if ($user->rights->service->creer && $object->type == Product::TYPE_SERVICE) $permtoedit=1;
|
||||
$newmodulepart=$modulepart;
|
||||
if ($modulepart == 'product' || $modulepart == 'produit' || $modulepart == 'service')
|
||||
{
|
||||
if ($user->rights->produit->creer && $object->type == Product::TYPE_PRODUCT) $permtoedit=1;
|
||||
if ($user->rights->service->creer && $object->type == Product::TYPE_SERVICE) $permtoedit=1;
|
||||
$newmodulepart='produit|service';
|
||||
}
|
||||
/* TODO Not yet working
|
||||
if ($modulepart == 'holiday')
|
||||
{
|
||||
if ($user->rights->holiday->write_all) $permtoedit=1;
|
||||
}
|
||||
*/
|
||||
|
||||
if (empty($conf->global->MAIN_UPLOAD_DOC)) $permtoedit=0;
|
||||
|
||||
if ($permtoedit)
|
||||
{
|
||||
// Link to resize
|
||||
print '<a href="'.DOL_URL_ROOT.'/core/photos_resize.php?modulepart='.urlencode('produit|service').'&id='.$object->id.'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension'])).'" title="'.dol_escape_htmltag($langs->trans("Resize")).'">'.img_picto($langs->trans("Resize"),DOL_URL_ROOT.'/theme/common/transform-crop-and-resize','',1).'</a> ';
|
||||
print '<a href="'.DOL_URL_ROOT.'/core/photos_resize.php?modulepart='.urlencode($newmodulepart).'&id='.$object->id.'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension'])).'" title="'.dol_escape_htmltag($langs->trans("Resize")).'">'.img_picto($langs->trans("Resize"),DOL_URL_ROOT.'/theme/common/transform-crop-and-resize','',1).'</a> ';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ class FormOrder
|
||||
print '<select class="flat" name="'.$htmlname.'">';
|
||||
if ($addempty) print '<option value="-1" selected> </option>';
|
||||
|
||||
// TODO Use a table called llx_c_input_reason
|
||||
// TODO Use the table called llx_c_input_reason
|
||||
print '<option value="0"'.($selected=='0'?' selected':'').'>'.$langs->trans('OrderSource0').'</option>';
|
||||
print '<option value="1"'.($selected=='1'?' selected':'').'>'.$langs->trans('OrderSource1').'</option>';
|
||||
print '<option value="2"'.($selected=='2'?' selected':'').'>'.$langs->trans('OrderSource2').'</option>';
|
||||
@ -109,9 +109,9 @@ class FormOrder
|
||||
global $conf,$langs,$form;
|
||||
|
||||
if (! is_object($form)) $form=new Form($this->db);
|
||||
|
||||
|
||||
$listofmethods=array();
|
||||
|
||||
|
||||
$sql = "SELECT rowid, code, libelle as label";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_input_method";
|
||||
$sql.= " WHERE active = 1";
|
||||
|
||||
@ -582,6 +582,24 @@ class FormOther
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Output a HTML thumb of color or a text if not defined.
|
||||
*
|
||||
* @param string $color String with hex (FFFFFF) or comma RGB ('255,255,255')
|
||||
* @param string $textifnotdefined Text to show if color not defined
|
||||
* @return string HTML code for color thumb
|
||||
* @see selectColor
|
||||
*/
|
||||
static function showColor($color, $textifnotdefined='')
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
$color = colorArrayToHex(colorStringToArray($color,array()),'');
|
||||
if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 36px; background-color: #'.$color.'" value="'.$color.'">';
|
||||
else print $textifnotdefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Output a HTML code to select a color
|
||||
*
|
||||
@ -591,7 +609,7 @@ class FormOther
|
||||
* @param int $showcolorbox 1=Show color code and color box, 0=Show only color code
|
||||
* @param array $arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813')
|
||||
* @return void
|
||||
* @deprecated
|
||||
* @deprecated Use instead selectColor
|
||||
* @see selectColor()
|
||||
*/
|
||||
function select_color($set_color='', $prefix='f_color', $form_name='', $showcolorbox=1, $arrayofcolors='')
|
||||
@ -609,8 +627,9 @@ class FormOther
|
||||
* @param array $arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813')
|
||||
* @param string $morecss Add css style into input field
|
||||
* @return string
|
||||
* @see showColor
|
||||
*/
|
||||
function selectColor($set_color='', $prefix='f_color', $form_name='', $showcolorbox=1, $arrayofcolors='', $morecss='')
|
||||
static function selectColor($set_color='', $prefix='f_color', $form_name='', $showcolorbox=1, $arrayofcolors='', $morecss='')
|
||||
{
|
||||
// Deprecation warning
|
||||
if ($form_name) {
|
||||
@ -857,7 +876,7 @@ class FormOther
|
||||
$min_year = $currentyear-$min_year;
|
||||
if(empty($selected) && empty($useempty)) $selected = $currentyear;
|
||||
|
||||
$out.= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '"'.$option.' >';
|
||||
$out.= '<select class="flat" placeholder="aa" id="' . $htmlname . '" name="' . $htmlname . '"'.$option.' >';
|
||||
if($useempty)
|
||||
{
|
||||
$selected_html='';
|
||||
|
||||
@ -364,7 +364,7 @@ class FormProjets
|
||||
}
|
||||
// Label for task
|
||||
$labeltoshow.=' - '.$obj->tref.' '.dol_trunc($obj->tlabel,$maxlength);
|
||||
|
||||
|
||||
if (!empty($selected) && $selected == $obj->rowid)
|
||||
{
|
||||
$out.= '<option value="'.$obj->rowid.'" selected';
|
||||
@ -408,38 +408,42 @@ class FormProjets
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Build a HTML select list of element of same thirdparty to suggest to link them to project
|
||||
*
|
||||
* @param string $table_element Table of the element to update
|
||||
* @param int $socid socid to filter
|
||||
* @param int $socid If of thirdparty to use as filter
|
||||
* @param string $morecss More CSS
|
||||
* @return int|string The HTML select list of element or '' if nothing or -1 if KO
|
||||
*/
|
||||
function select_element($table_element,$socid=0)
|
||||
function select_element($table_element,$socid=0,$morecss='')
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
if ($table_element == 'projet_task') return ''; // Special cas of element we never link to a project (already always done)
|
||||
|
||||
$linkedtothirdparty=false;
|
||||
if (! in_array($table_element, array('don','expensereport_det','expensereport'))) $linkedtothirdparty=true;
|
||||
|
||||
$projectkey="fk_projet";
|
||||
switch ($table_element)
|
||||
{
|
||||
case "facture":
|
||||
$sql = "SELECT rowid, facnumber as ref";
|
||||
$sql = "SELECT t.rowid, t.facnumber as ref";
|
||||
break;
|
||||
case "facture_fourn":
|
||||
$sql = "SELECT rowid, ref, ref_supplier";
|
||||
$sql = "SELECT t.rowid, t.ref, t.ref_supplier";
|
||||
break;
|
||||
case "commande_fourn":
|
||||
$sql = "SELECT rowid, ref, ref_supplier";
|
||||
$sql = "SELECT t.rowid, t.ref, t.ref_supplier";
|
||||
break;
|
||||
case "facture_rec":
|
||||
$sql = "SELECT rowid, titre as ref";
|
||||
$sql = "SELECT t.rowid, t.titre as ref";
|
||||
break;
|
||||
case "actioncomm":
|
||||
$sql = "SELECT id as rowid, label as ref";
|
||||
$sql = "SELECT t.id as rowid, t.label as ref";
|
||||
$projectkey="fk_project";
|
||||
break;
|
||||
case "expensereport_det":
|
||||
@ -448,14 +452,16 @@ class FormProjets
|
||||
$projectkey="fk_projet";
|
||||
break;*/
|
||||
default:
|
||||
$sql = "SELECT rowid, ref";
|
||||
$sql = "SELECT t.rowid, t.ref";
|
||||
break;
|
||||
}
|
||||
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.$table_element;
|
||||
if ($linkedtothirdparty) $sql.=", s.nom as name";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.$table_element." as t";
|
||||
if ($linkedtothirdparty) $sql.=", ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= " WHERE ".$projectkey." is null";
|
||||
if (! empty($socid) && ! in_array($table_element, array('don'))) $sql.= " AND fk_soc=".$socid;
|
||||
if (! in_array($table_element, array('expensereport_det'))) $sql.= ' AND entity='.getEntity('project');
|
||||
if (! empty($socid) && $linkedtothirdparty) $sql.= " AND t.fk_soc=".$socid;
|
||||
if (! in_array($table_element, array('expensereport_det'))) $sql.= ' AND t.entity='.getEntity('project');
|
||||
if ($linkedtothirdparty) $sql.=" AND s.rowid = t.fk_soc";
|
||||
$sql.= " ORDER BY ref DESC";
|
||||
|
||||
dol_syslog(get_class($this).'::select_element', LOG_DEBUG);
|
||||
@ -467,12 +473,14 @@ class FormProjets
|
||||
$i = 0;
|
||||
if ($num > 0)
|
||||
{
|
||||
$sellist = '<select class="flat" name="elementselect">';
|
||||
$sellist = '<select class="flat elementselect css'.$table_element.($morecss?' '.$morecss:'').'" name="elementselect">';
|
||||
$sellist .='<option value="-1"></option>';
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$ref=$obj->ref?$obj->ref:$obj->rowid;
|
||||
if (! empty($obj->ref_supplier)) $ref.=' ('.$obj->ref_supplier.')';
|
||||
if (! empty($obj->name)) $ref.=' - '.$obj->name;
|
||||
$sellist .='<option value="'.$obj->rowid.'">'.$ref.'</option>';
|
||||
$i++;
|
||||
}
|
||||
@ -489,13 +497,84 @@ class FormProjets
|
||||
return $sellist;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
$this->error=$this->db->lasterror();
|
||||
$this->errors[]=$this->db->lasterror();
|
||||
dol_syslog(get_class($this) . "::select_element " . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Build a HTML select list of element of same thirdparty to suggest to link them to project
|
||||
*
|
||||
* @param string $htmlname HTML name
|
||||
* @param int $preselected Preselected
|
||||
* @param int $shwoempty Add an empty line
|
||||
* @param int $useshortlabel Use short label
|
||||
* @return int|string The HTML select list of element or '' if nothing or -1 if KO
|
||||
*/
|
||||
function selectOpportunityStatus($htmlname,$preselected=0,$showempty=1,$useshortlabel=0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$sql = "SELECT rowid, code, label, percent";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.'c_lead_status';
|
||||
$sql.= " WHERE active = 1";
|
||||
$sql.= " ORDER BY position";
|
||||
|
||||
dol_syslog(get_class($this).'::selectOpportunityStatus', LOG_DEBUG);
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
if ($num > 0)
|
||||
{
|
||||
$sellist = '<select class="flat oppstatus" name="'.$htmlname.'">';
|
||||
if ($showempty) $sellist.= '<option value="-1"></option>';
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$sellist .='<option value="'.$obj->rowid.'"';
|
||||
if ($obj->rowid == $preselected) $sellist .= ' selected="selected"';
|
||||
$sellist .= '>';
|
||||
if ($useshortlabel)
|
||||
{
|
||||
$finallabel = ($langs->transnoentitiesnoconv("OppStatusShort".$obj->code) != "OppStatusShort".$obj->code ? $langs->transnoentitiesnoconv("OppStatusShort".$obj->code) : $obj->label);
|
||||
}
|
||||
else
|
||||
{
|
||||
$finallabel = ($langs->transnoentitiesnoconv("OppStatus".$obj->code) != "OppStatus".$obj->code ? $langs->transnoentitiesnoconv("OppStatus".$obj->code) : $obj->label);
|
||||
$finallabel.= ' ('.$obj->percent.'%)';
|
||||
}
|
||||
$sellist .= $finallabel;
|
||||
$sellist .='</option>';
|
||||
$i++;
|
||||
}
|
||||
$sellist .='</select>';
|
||||
}
|
||||
/*else
|
||||
{
|
||||
$sellist = '<select class="flat" name="elementselect">';
|
||||
$sellist.= '<option value="0" disabled>'.$langs->trans("None").'</option>';
|
||||
$sellist.= '</select>';
|
||||
}*/
|
||||
$this->db->free($resql);
|
||||
|
||||
return $sellist;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
$this->errors[]=$this->db->lasterror();
|
||||
dol_syslog(get_class($this) . "::select_element " . $this->error, LOG_ERR);
|
||||
dol_syslog(get_class($this) . "::selectOpportunityStatus " . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -400,7 +400,7 @@ class RssParser
|
||||
{
|
||||
if (! empty($conf->global->EXTERNALRSS_USE_SIMPLEXML))
|
||||
{
|
||||
$itemLink = (string) $item['link']['href'];
|
||||
$itemLink = (isset($item['link']['href']) ? (string) $item['link']['href'] : '');
|
||||
$itemTitle = (string) $item['title'];
|
||||
$itemDescription = (string) $item['summary'];
|
||||
$itemPubDate = (string) $item['created'];
|
||||
@ -409,7 +409,7 @@ class RssParser
|
||||
}
|
||||
else
|
||||
{
|
||||
$itemLink = (string) $item['link']['href'];
|
||||
$itemLink = (isset($item['link']['href']) ? (string) $item['link']['href'] : '');
|
||||
$itemTitle = (string) $item['title'];
|
||||
$itemDescription = (string) $item['summary'];
|
||||
$itemPubDate = (string) $item['created'];
|
||||
|
||||
@ -337,8 +337,8 @@ class Translate
|
||||
}
|
||||
|
||||
/**
|
||||
* Return translated value of key. Search in lang file, then into database.
|
||||
* Key must be any complete entry into lang file: CurrencyEUR, ...
|
||||
* Return translated value of key for special keys ("Currency...", "Civility...", ...).
|
||||
* Search in lang file, then into database. Key must be any complete entry into lang file: CurrencyEUR, ...
|
||||
* If not found, return key.
|
||||
* The string return is not formated (translated with transnoentitiesnoconv)
|
||||
* NOTE: To avoid infinite loop (getLabelFromKey->transnoentities->getTradFromKey), if you modify this function,
|
||||
@ -354,25 +354,33 @@ class Translate
|
||||
if (! is_string($key)) return 'ErrorBadValueForParamNotAString'; // Avoid multiple errors with code not using function correctly.
|
||||
|
||||
$newstr=$key;
|
||||
if (preg_match('/^Currency([A-Z][A-Z][A-Z])$/i',$key,$reg))
|
||||
{
|
||||
$newstr=$this->getLabelFromKey($db,$reg[1],'c_currencies','code_iso','label');
|
||||
}
|
||||
else if (preg_match('/^SendingMethod([0-9A-Z]+)$/i',$key,$reg))
|
||||
{
|
||||
$newstr=$this->getLabelFromKey($db,$reg[1],'c_shipment_mode','code','libelle');
|
||||
}
|
||||
else if (preg_match('/^PaymentTypeShort([0-9A-Z]+)$/i',$key,$reg))
|
||||
{
|
||||
$newstr=$this->getLabelFromKey($db,$reg[1],'c_paiement','code','libelle');
|
||||
}
|
||||
else if (preg_match('/^Civility([0-9A-Z]+)$/i',$key,$reg))
|
||||
if (preg_match('/^Civility([0-9A-Z]+)$/i',$key,$reg))
|
||||
{
|
||||
$newstr=$this->getLabelFromKey($db,$reg[1],'c_civility','code','label');
|
||||
}
|
||||
else if (preg_match('/^OrderSource([0-9A-Z]+)$/i',$key,$reg))
|
||||
elseif (preg_match('/^Currency([A-Z][A-Z][A-Z])$/i',$key,$reg))
|
||||
{
|
||||
$newstr=$this->getLabelFromKey($db,$reg[1],'c_currencies','code_iso','label');
|
||||
}
|
||||
elseif (preg_match('/^SendingMethod([0-9A-Z]+)$/i',$key,$reg))
|
||||
{
|
||||
$newstr=$this->getLabelFromKey($db,$reg[1],'c_shipment_mode','code','libelle');
|
||||
}
|
||||
elseif (preg_match('/^PaymentTypeShort([0-9A-Z]+)$/i',$key,$reg))
|
||||
{
|
||||
// TODO Add a table for OrderSourceX
|
||||
$newstr=$this->getLabelFromKey($db,$reg[1],'c_paiement','code','libelle');
|
||||
}
|
||||
elseif (preg_match('/^OppStatusShort([0-9A-Z]+)$/i',$key,$reg))
|
||||
{
|
||||
$newstr=$this->getLabelFromKey($db,$reg[1],'c_lead_status','code','label');
|
||||
}
|
||||
elseif (preg_match('/^OppStatus([0-9A-Z]+)$/i',$key,$reg))
|
||||
{
|
||||
$newstr=$this->getLabelFromKey($db,$reg[1],'c_lead_status','code','label');
|
||||
}
|
||||
elseif (preg_match('/^OrderSource([0-9A-Z]+)$/i',$key,$reg))
|
||||
{
|
||||
// TODO OrderSourceX must be replaced with content of table llx_c_input_reason or llx_c_input_method
|
||||
//$newstr=$this->getLabelFromKey($db,$reg[1],'c_ordersource','code','label');
|
||||
}
|
||||
return $newstr;
|
||||
|
||||
@ -20,6 +20,8 @@
|
||||
//
|
||||
|
||||
/**
|
||||
* addLineBatch
|
||||
*
|
||||
* @param index int number of produt. 0 = first product line
|
||||
*/
|
||||
function addLineBatch(index)
|
||||
|
||||
@ -340,7 +340,7 @@ function ajax_dialog($title,$message,$w=350,$h=150)
|
||||
* Use ajax_combobox() only for small combo list! If not, use instead ajax_autocompleter().
|
||||
* TODO: It is used when COMPANY_USE_SEARCH_TO_SELECT and CONTACT_USE_SEARCH_TO_SELECT are set by html.formcompany.class.php. Should use ajax_autocompleter instead like done by html.form.class.php for select_produits.
|
||||
*
|
||||
* @param string $htmlname Name of html select field
|
||||
* @param string $htmlname Name of html select field ('myid' or '.myclass')
|
||||
* @param array $events More events option. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
|
||||
* @param int $minLengthToAutocomplete Minimum length of input string to start autocomplete
|
||||
* @param int $forcefocus Force focus on field
|
||||
|
||||
@ -504,7 +504,7 @@ function show_projects($conf,$langs,$db,$object,$backtopage='')
|
||||
$projecttmp = new Project($db);
|
||||
|
||||
$i=0;
|
||||
$var=false;
|
||||
$var=true;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
@ -629,7 +629,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
}
|
||||
// Edit
|
||||
print_liste_field_titre('');
|
||||
print "</tr>";
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -971,6 +971,7 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
|
||||
|
||||
$out.="<tr ".$bc[$var].">";
|
||||
|
||||
// Date
|
||||
$out.='<td width="120" align="left" class="nowrap">';
|
||||
$out.=dol_print_date($datep,'dayhour');
|
||||
if ($datep2 && $datep2 != $datep)
|
||||
@ -998,7 +999,7 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
|
||||
|
||||
// Title of event
|
||||
//$out.='<td colspan="2">'.dol_trunc($obj->label,40).'</td>';
|
||||
$out.='<td colspan="2">'.$actionstatic->getNomUrl(1,40).'</td>';
|
||||
$out.='<td colspan="2">'.$actionstatic->getNomUrl(1,120).'</td>';
|
||||
|
||||
// Contact pour cette action
|
||||
if (empty($objcon->id) && $obj->fk_contact > 0)
|
||||
@ -1240,14 +1241,14 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
|
||||
//$actionstatic->libelle=$libelle;
|
||||
$actionstatic->libelle=$histo[$key]['note'];
|
||||
$actionstatic->id=$histo[$key]['id'];
|
||||
$out.=$actionstatic->getNomUrl(1,40);
|
||||
$out.=$actionstatic->getNomUrl(1,120);
|
||||
}
|
||||
if (isset($histo[$key]['type']) && $histo[$key]['type']=='mailing')
|
||||
{
|
||||
$out.='<a href="'.DOL_URL_ROOT.'/comm/mailing/card.php?id='.$histo[$key]['id'].'">'.img_object($langs->trans("ShowEMailing"),"email").' ';
|
||||
$transcode=$langs->trans("Action".$histo[$key]['acode']);
|
||||
$libelle=($transcode!="Action".$histo[$key]['acode']?$transcode:'Send mass mailing');
|
||||
$out.=dol_trunc($libelle,40);
|
||||
$out.=dol_trunc($libelle,120);
|
||||
}
|
||||
$out.='</td>';
|
||||
|
||||
|
||||
@ -226,7 +226,7 @@ function dol_shutdown()
|
||||
* Return value of a param into GET or POST supervariable
|
||||
*
|
||||
* @param string $paramname Name of parameter to found
|
||||
* @param string $check Type of check (''=no check, 'int'=check it's numeric, 'alpha'=check it's text and sign, 'aZ'=check it's a-z only, 'array'=check it's array, 'san_alpha'= Use filter_var with FILTER_SANITIZE_STRING (do not use this for free text string), 'custom'= custom filter specify $filter and $options)
|
||||
* @param string $check Type of check (''=no check, 'int'=check it's numeric, 'alpha'=check it's text and sign, 'aZ'=check it's a-z only, 'array'=check it's array, 'san_alpha'=Use filter_var with FILTER_SANITIZE_STRING (do not use this for free text string), 'custom'= custom filter specify $filter and $options)
|
||||
* @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get, 4 = post then get then cookie)
|
||||
* @param int $filter Filter to apply when $check is set to custom. (See http://php.net/manual/en/filter.filters.php for détails)
|
||||
* @param mixed $options Options to pass to filter_var when $check is set to custom
|
||||
@ -545,7 +545,7 @@ function dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
|
||||
|
||||
|
||||
/**
|
||||
* Returns text escaped for inclusion in HTML alt or title tags, or into values of HTMPL input fields
|
||||
* Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
|
||||
*
|
||||
* @param string $stringtoescape String to escape
|
||||
* @param int $keepb Do not clean b tags
|
||||
@ -2639,7 +2639,7 @@ function dol_print_error_email($prefixcode)
|
||||
* @param string $td Options of attribute td ("" by defaut, example: 'align="center"')
|
||||
* @param string $sortfield Current field used to sort
|
||||
* @param string $sortorder Current sort order
|
||||
* @param string $prefix Prefix for css
|
||||
* @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag.
|
||||
* @return void
|
||||
*/
|
||||
function print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $td="", $sortfield="", $sortorder="", $prefix="")
|
||||
@ -2659,7 +2659,7 @@ function print_liste_field_titre($name, $file="", $field="", $begin="", $morepar
|
||||
* @param string $moreattrib Add more attributes on th ("" by defaut)
|
||||
* @param string $sortfield Current field used to sort
|
||||
* @param string $sortorder Current sort order
|
||||
* @param string $prefix Prefix for css
|
||||
* @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag.
|
||||
* @return string
|
||||
*/
|
||||
function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="")
|
||||
@ -2675,7 +2675,7 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m
|
||||
|
||||
// If field is used as sort criteria we use a specific class
|
||||
// Example if (sortfield,field)=("nom","xxx.nom") or (sortfield,field)=("nom","nom")
|
||||
if ($field && ($sortfield == $field || $sortfield == preg_replace("/^[^\.]+\./","",$field))) $out.= '<'.$tag.' class="liste_titre_sel" '. $moreattrib.'>';
|
||||
if ($field && ($sortfield == $field || $sortfield == preg_replace("/^[^\.]+\./","",$field))) $out.= '<'.$tag.' class="'.$prefix.'liste_titre_sel" '. $moreattrib.'>';
|
||||
else $out.= '<'.$tag.' class="'.$prefix.'liste_titre" '. $moreattrib.'>';
|
||||
|
||||
if (! empty($conf->dol_optimize_smallscreen) && empty($thead) && $field) // If this is a sort field
|
||||
@ -3761,7 +3761,7 @@ function get_exdir($num,$level,$alpha,$withoutslash,$object,$modulepart)
|
||||
// TODO if object is null, load it from id and modulepart.
|
||||
|
||||
|
||||
if (! empty($level) && in_array($modulepart, array('cheque','user','category','shipment', 'member','don','donation','supplier_invoice','invoice_supplier')))
|
||||
if (! empty($level) && in_array($modulepart, array('cheque','user','category','holiday','shipment', 'member','don','donation','supplier_invoice','invoice_supplier')))
|
||||
{
|
||||
// This part should be removed once all code is using "get_exdir" to forge path, with all parameters provided
|
||||
if (empty($alpha)) $num = preg_replace('/([^0-9])/i','',$num);
|
||||
@ -4313,17 +4313,16 @@ function dolGetFirstLastname($firstname,$lastname,$nameorder=-1)
|
||||
/**
|
||||
* Set event message in dol_events session object. Will be output by calling dol_htmloutput_events.
|
||||
* Note: Calling dol_htmloutput_events is done into pages by standard llxFooter() function.
|
||||
* Note: Prefer to use setEventMessages instead.
|
||||
*
|
||||
* @param mixed $mesgs Message string or array
|
||||
* @param string $style Which style to use ('mesgs' by default, 'warnings', 'errors')
|
||||
* @return void
|
||||
* @see dol_htmloutput_events
|
||||
* @deprecated Use setEventMessages instead
|
||||
*/
|
||||
function setEventMessage($mesgs, $style='mesgs')
|
||||
{
|
||||
dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING);
|
||||
|
||||
//dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING); This is not deprecated, it is used by setEventMessages function
|
||||
if (! is_array($mesgs)) // If mesgs is a string
|
||||
{
|
||||
if ($mesgs) $_SESSION['dol_events'][$style][] = $mesgs;
|
||||
@ -4651,7 +4650,7 @@ function dol_osencode($str)
|
||||
* @param string $fieldkey Field for code
|
||||
* @param string $fieldid Field for id
|
||||
* @return int <0 if KO, Id of code if OK
|
||||
* @see getLabelFromKey
|
||||
* @see $langs->getLabelFromKey
|
||||
*/
|
||||
function dol_getIdFromCode($db,$key,$tablename,$fieldkey='code',$fieldid='id')
|
||||
{
|
||||
@ -4666,7 +4665,7 @@ function dol_getIdFromCode($db,$key,$tablename,$fieldkey='code',$fieldid='id')
|
||||
return $cache_codes[$tablename][$key]; // Found in cache
|
||||
}
|
||||
|
||||
$sql = "SELECT ".$fieldid." as id";
|
||||
$sql = "SELECT ".$fieldid." as valuetoget";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.$tablename;
|
||||
$sql.= " WHERE ".$fieldkey." = '".$key."'";
|
||||
dol_syslog('dol_getIdFromCode', LOG_DEBUG);
|
||||
@ -4674,7 +4673,7 @@ function dol_getIdFromCode($db,$key,$tablename,$fieldkey='code',$fieldid='id')
|
||||
if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj) $cache_codes[$tablename][$key]=$obj->id;
|
||||
if ($obj) $cache_codes[$tablename][$key]=$obj->valuetoget;
|
||||
else $cache_codes[$tablename][$key]='';
|
||||
$db->free($resql);
|
||||
return $cache_codes[$tablename][$key];
|
||||
|
||||
@ -651,7 +651,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
|
||||
$masktri='00000';
|
||||
$maskcounter='00000';
|
||||
}
|
||||
|
||||
|
||||
$maskraz=-1;
|
||||
$maskoffset=0;
|
||||
$resetEveryMonth=false;
|
||||
@ -670,7 +670,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
|
||||
if (dol_strlen($maskrefclient_maskcounter) > 0 && dol_strlen($maskrefclient_maskcounter) < 3) return 'ErrorCounterMustHaveMoreThan3Digits';
|
||||
}
|
||||
else $maskrefclient='';
|
||||
|
||||
|
||||
// fail if there is neither a global nor a third party counter
|
||||
if (! $hasglobalcounter && ($maskrefclient_maskcounter == ''))
|
||||
{
|
||||
@ -1915,29 +1915,30 @@ function fetchObjectByElement($element_id,$element_type) {
|
||||
|
||||
|
||||
/**
|
||||
* Convert an array with RGB value into hex RGB value
|
||||
* Convert an array with RGB value into hex RGB value.
|
||||
* This is the opposite function of colorStringToArray
|
||||
*
|
||||
* @param array $arraycolor Array
|
||||
* @param string $colorifnotfound Color code to return if entry not defined or not a RGB format
|
||||
* @return string RGB hex value (without # before). For example: FF00FF
|
||||
* @see Make the opposite of colorStringToArray
|
||||
* @return string RGB hex value (without # before). For example: 'FF00FF', '01FF02'
|
||||
* @see colorStringToArray
|
||||
*/
|
||||
function colorArrayToHex($arraycolor,$colorifnotfound='888888')
|
||||
{
|
||||
if (! is_array($arraycolor)) return $colorifnotfound;
|
||||
if (empty($arraycolor)) return $colorifnotfound;
|
||||
return dechex($arraycolor[0]).dechex($arraycolor[1]).dechex($arraycolor[2]);
|
||||
return sprintf("%02s",dechex($arraycolor[0])).sprintf("%02s",dechex($arraycolor[1])).sprintf("%02s",dechex($arraycolor[2]));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert a string RGB value ('FFFFFF', '255,255,255') into an array RGB array(255,255,255).
|
||||
* This is the opposite function of colorArrayToHex.
|
||||
* If entry is already an array, return it.
|
||||
*
|
||||
* @param string $stringcolor String with hex (FFFFFF) or comma RGB ('255,255,255')
|
||||
* @param array $colorifnotfound Color code array to return if entry not defined
|
||||
* @return string RGB hex value (without # before). For example: FF00FF
|
||||
* @see Make the opposite of colorArrayToHex
|
||||
* @see colorArrayToHex
|
||||
*/
|
||||
function colorStringToArray($stringcolor,$colorifnotfound=array(88,88,88))
|
||||
{
|
||||
|
||||
@ -34,11 +34,16 @@ function holiday_prepare_head($object)
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT . '/holiday/card.php?id='.$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/holiday/card.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Card");
|
||||
$head[$h][2] = 'card';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/holiday/document.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans('Document');
|
||||
$head[$h][2] = 'documents';
|
||||
$h++;
|
||||
|
||||
// Show more tabs from modules
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
@ -68,17 +68,6 @@ function member_prepare_head(Adherent $object)
|
||||
$h++;
|
||||
}
|
||||
|
||||
// Show category tab
|
||||
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
||||
$type = Categorie::TYPE_MEMBER;
|
||||
$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type='.$type;
|
||||
$head[$h][1] = $langs->trans('Categories');
|
||||
$head[$h][2] = 'category';
|
||||
$h++;
|
||||
}
|
||||
|
||||
// Show more tabs from modules
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
|
||||
@ -891,16 +891,17 @@ function print_projecttasks_array($db, $socid, $projectsListId, $mytasks=0, $sta
|
||||
$project_year_filter=0;
|
||||
|
||||
$title=$langs->trans("Project");
|
||||
if ($statut != '' && $statut >= 0) $title=$langs->trans("Project").' ('.$langs->trans($projectstatic->statuts[$statut]).')';
|
||||
if (strcmp($statut, '') && $statut >= 0) $title=$langs->trans("Project").' ('.$langs->trans($projectstatic->statuts_long[$statut]).')';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($title,"index.php","","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Tasks"),"","","","",'align="right"',$sortfield,$sortorder);
|
||||
//if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) print_liste_field_titre($langs->trans("OpportunityStatus"),"","","","",'align="right"',$sortfield,$sortorder);
|
||||
if (empty($conf->global->PROJECT_HIDE_TASKS)) print_liste_field_titre($langs->trans("Tasks"),"","","","",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),"","","","",'align="right"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
$sql = "SELECT p.rowid as projectid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut, COUNT(t.rowid) as nb";
|
||||
$sql = "SELECT p.rowid as projectid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut as status, p.fk_opp_status as opp_status, COUNT(t.rowid) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
if ($mytasks)
|
||||
{
|
||||
@ -938,7 +939,7 @@ function print_projecttasks_array($db, $socid, $projectsListId, $mytasks=0, $sta
|
||||
$sql.= " AND (p.datee IS NULL OR p.datee >= ".$db->idate(dol_get_first_day($project_year_filter,1,false)).")";
|
||||
}
|
||||
}
|
||||
$sql.= " GROUP BY p.rowid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut";
|
||||
$sql.= " GROUP BY p.rowid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut, p.fk_opp_status";
|
||||
$sql.= " ORDER BY p.title, p.ref";
|
||||
|
||||
$var=true;
|
||||
@ -966,8 +967,15 @@ function print_projecttasks_array($db, $socid, $projectsListId, $mytasks=0, $sta
|
||||
$projectstatic->ref=$objp->ref;
|
||||
print $projectstatic->getNomUrl(1);
|
||||
print ' - '.dol_trunc($objp->title,24).'</td>';
|
||||
print '<td align="right">'.$objp->nb.'</td>';
|
||||
$projectstatic->statut = $objp->fk_statut;
|
||||
/*if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
||||
{
|
||||
print '<td align="right">';
|
||||
$code = dol_getIdFromCode($db, $objp->opp_status, 'c_lead_status', 'rowid', 'code');
|
||||
if ($code) print $langs->trans("OppStatus".$code);
|
||||
print '</td>';
|
||||
}*/
|
||||
if (empty($conf->global->PROJECT_HIDE_TASKS)) print '<td align="right">'.$objp->nb.'</td>';
|
||||
$projectstatic->statut = $objp->status;
|
||||
print '<td align="right">'.$projectstatic->getLibStatut(3).'</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
@ -212,7 +212,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
|
||||
// Execute hook getLoginPageOptions
|
||||
// Should be an array with differents options in $hookmanager->resArray
|
||||
$parameters=array('entity' => GETPOST('entity','int'));
|
||||
$hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks
|
||||
$reshook = $hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks. resArray is filled by hook.
|
||||
|
||||
// Login
|
||||
$login = (! empty($hookmanager->resArray['username']) ? $hookmanager->resArray['username'] : (GETPOST("username","alpha") ? GETPOST("username","alpha") : $demologin));
|
||||
@ -238,7 +238,6 @@ function dol_loginfunction($langs,$conf,$mysoc)
|
||||
elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png'))
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png';
|
||||
|
||||
}
|
||||
|
||||
// Security graphical code
|
||||
|
||||
@ -254,7 +254,10 @@ function entity_prepare_head($object, $aEntities)
|
||||
*/
|
||||
function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
{
|
||||
global $conf,$langs,$bc;
|
||||
global $conf,$langs,$db;
|
||||
global $bc;
|
||||
|
||||
$formother = new FormOther($db);
|
||||
|
||||
//$dirthemes=array(empty($conf->global->MAIN_FORCETHEMEDIR)?'/theme':$conf->global->MAIN_FORCETHEMEDIR.'/theme');
|
||||
$dirthemes=array('/theme');
|
||||
@ -380,9 +383,48 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
print '<td>'.$langs->trans("HighlightLinesOnMouseHover").'</td>';
|
||||
$hoverdisabled=(isset($conf->global->THEME_ELDY_USE_HOVER) && $conf->global->THEME_ELDY_USE_HOVER == '0');
|
||||
print '<td colspan="'.($colspan-1).'"><input '.$bc[$var].' name="check_THEME_ELDY_USE_HOVER"'.($edit?'':' disabled').' type="checkbox" '.($hoverdisabled?"":" checked").'>';
|
||||
print ' ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||
print ' ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
//if ($conf->theme == 'eldy')
|
||||
//{
|
||||
// TopMenuBackgroundColor
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("TopMenuBackgroundColor").'</td>';
|
||||
print '<td colspan="'.($colspan-1).'">';
|
||||
if ($edit)
|
||||
{
|
||||
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''),'THEME_ELDY_TOPMENU_BACK1','formcolor',1).' ';
|
||||
}
|
||||
else
|
||||
{
|
||||
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),'');
|
||||
if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 36px; background-color: #'.$color.'" value="'.$color.'">';
|
||||
else print $langs->trans("Default");
|
||||
}
|
||||
print ' ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||
print '</td>';
|
||||
|
||||
// BackgroundTableTitleColor
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("BackgroundTableTitleColor").'</td>';
|
||||
print '<td colspan="'.($colspan-1).'">';
|
||||
if ($edit)
|
||||
{
|
||||
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKTITLE1,array()),''),'THEME_ELDY_BACKTITLE1','formcolor',1).' ';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $formother->showColor($conf->global->THEME_ELDY_BACKTITLE1, $langs->trans("Default"));
|
||||
}
|
||||
print ' ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||
print '</td>';
|
||||
//}
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -1194,6 +1194,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
$newmenu->add("/projet/index.php?leftmenu=projects", $langs->trans("Projects"), 0, $user->rights->projet->lire && $user->rights->projet->lire, '', $mainmenu, 'projects');
|
||||
$newmenu->add("/projet/card.php?leftmenu=projects&action=create", $langs->trans("NewProject"), 1, $user->rights->projet->creer && $user->rights->projet->creer);
|
||||
$newmenu->add("/projet/list.php?leftmenu=projects", $langs->trans("List"), 1, $user->rights->projet->lire && $user->rights->projet->lire);
|
||||
$newmenu->add("/projet/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire && $user->rights->projet->lire);
|
||||
|
||||
if (empty($conf->global->PROJECT_HIDE_TASKS))
|
||||
{
|
||||
@ -1217,19 +1218,21 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
*/
|
||||
if ($mainmenu == 'hrm')
|
||||
{
|
||||
// Holiday module
|
||||
// Leave/Holiday/Vacation module
|
||||
if (! empty($conf->holiday->enabled))
|
||||
{
|
||||
$langs->load("holiday");
|
||||
|
||||
$newmenu->add("/holiday/index.php?&leftmenu=hrm", $langs->trans("CPTitreMenu"), 0, $user->rights->holiday->write, '', $mainmenu, 'hrm');
|
||||
$newmenu->add("/holiday/card.php?&action=request", $langs->trans("MenuAddCP"), 1,$user->rights->holiday->write);
|
||||
$newmenu->add("/holiday/list.php?&leftmenu=hrm", $langs->trans("CPTitreMenu"), 0, $user->rights->holiday->read, '', $mainmenu, 'hrm');
|
||||
$newmenu->add("/holiday/card.php?&action=request", $langs->trans("New"), 1,$user->rights->holiday->write);
|
||||
$newmenu->add("/holiday/list.php?&leftmenu=hrm", $langs->trans("List"), 1,$user->rights->holiday->read);
|
||||
$newmenu->add("/holiday/list.php?select_statut=2&leftmenu=hrm", $langs->trans("ListToApprove"), 2, $user->rights->holiday->read);
|
||||
$newmenu->add("/holiday/define_holiday.php?&action=request", $langs->trans("MenuConfCP"), 1, $user->rights->holiday->define_holiday);
|
||||
$newmenu->add("/holiday/view_log.php?&action=request", $langs->trans("MenuLogCP"), 1, $user->rights->holiday->view_log);
|
||||
$newmenu->add("/holiday/month_report.php?&action=request", $langs->trans("MenuReportMonth"), 1, $user->rights->holiday->month_report);
|
||||
$newmenu->add("/holiday/view_log.php?&action=request", $langs->trans("MenuLogCP"), 1, $user->rights->holiday->define_holiday);
|
||||
$newmenu->add("/holiday/month_report.php?&action=request", $langs->trans("MenuReportMonth"), 1, $user->rights->holiday->define_holiday);
|
||||
}
|
||||
|
||||
// Trips and expenses
|
||||
// Trips and expenses (old module)
|
||||
if (! empty($conf->deplacement->enabled))
|
||||
{
|
||||
$langs->load("trips");
|
||||
|
||||
@ -241,10 +241,10 @@ class modFacture extends DolibarrModules
|
||||
$this->export_label[$r]='CustomersInvoicesAndPayments'; // Translation key (used only if key ExportDataset_xxx_z not found)
|
||||
$this->export_icon[$r]='bill';
|
||||
$this->export_permission[$r]=array(array("facture","facture","export"));
|
||||
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'f.fk_user_author'=>'CreatedById','uc.login'=>'CreatedByLogin','f.fk_user_valid'=>'ValidatedById','uv.login'=>'ValidatedByLogin','p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber','p.fk_bank'=>'IdTransaction');
|
||||
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'f.fk_user_author'=>'CreatedById','uc.login'=>'CreatedByLogin','f.fk_user_valid'=>'ValidatedById','uv.login'=>'ValidatedByLogin','p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber','pt.code'=>'PaymentMode','p.fk_bank'=>'IdTransaction');
|
||||
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number','p.fk_bank'=>'Number');
|
||||
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number','p.fk_bank'=>'Number');
|
||||
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment','p.fk_bank'=>'payment','f.fk_user_author'=>'user','uc.login'=>'user','f.fk_user_valid'=>'user','uv.login'=>'user');
|
||||
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment','pt.code'=>'payment','p.fk_bank'=>'payment','f.fk_user_author'=>'user','uc.login'=>'user','f.fk_user_valid'=>'user','uv.login'=>'user');
|
||||
$this->export_dependencies_array[$r]=array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
|
||||
// Add extra fields
|
||||
$sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture'";
|
||||
@ -295,6 +295,7 @@ class modFacture extends DolibarrModules
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_extrafields as extra ON f.rowid = extra.fk_object';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON pf.fk_facture = f.rowid';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiement as p ON pf.fk_paiement = p.rowid';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as pt ON pt.id = p.fk_paiement';
|
||||
$this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid';
|
||||
$this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('facture',1).')';
|
||||
$r++;
|
||||
|
||||
@ -134,16 +134,16 @@ class modHoliday extends DolibarrModules
|
||||
$r=0;
|
||||
|
||||
$this->rights[$r][0] = 20001; // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Create/modify your own holidays'; // Permission label
|
||||
$this->rights[$r][1] = 'Read your own holidays'; // Permission label
|
||||
$this->rights[$r][3] = 1; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$this->rights[$r][4] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$r++;
|
||||
|
||||
$this->rights[$r][0] = 20002; // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Create/modify hollidays for everybody'; // Permission label
|
||||
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'write_all'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$this->rights[$r][1] = 'Create/modify your own holidays'; // Permission label
|
||||
$this->rights[$r][3] = 1; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$r++;
|
||||
|
||||
@ -155,23 +155,23 @@ class modHoliday extends DolibarrModules
|
||||
$r++;
|
||||
|
||||
$this->rights[$r][0] = 20004; // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Setup holidays of users'; // Permission label
|
||||
$this->rights[$r][1] = 'Read hollidays for everybody'; // Permission label
|
||||
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'define_holiday'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$this->rights[$r][4] = 'read_all'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$r++;
|
||||
|
||||
$this->rights[$r][0] = 20005; // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'See logs for holidays requests'; // Permission label
|
||||
$this->rights[$r][1] = 'Create/modify hollidays for everybody'; // Permission label
|
||||
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'view_log'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$this->rights[$r][4] = 'write_all'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$r++;
|
||||
|
||||
$this->rights[$r][0] = 20006; // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Read holidays monthly report'; // Permission label
|
||||
$this->rights[$r][1] = 'Setup holidays of users (setup and update balance)'; // Permission label
|
||||
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'month_report'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$this->rights[$r][4] = 'define_holiday'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$r++;
|
||||
|
||||
|
||||
@ -166,7 +166,7 @@ class modProduct extends DolibarrModules
|
||||
if (! empty($conf->barcode->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('p.barcode'=>'product'));
|
||||
if (! empty($conf->fournisseur->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('s.nom'=>'product','pf.ref_fourn'=>'product','pf.unitprice'=>'product'));
|
||||
// Add extra fields
|
||||
$sql="SELECT name, label, type FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product'";
|
||||
$sql="SELECT name, label, type FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product' AND entity IN (0, ".$conf->entity.')';
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql) // This can fail when class is used on old database (during migration for example)
|
||||
{
|
||||
@ -251,7 +251,8 @@ class modProduct extends DolibarrModules
|
||||
$this->import_fields_array[$r]=array('p.ref'=>"Ref*",'p.label'=>"Label*",'p.description'=>"Description",'p.url'=>"PublicUrl",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.length'=>"Length",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.duration'=>"Duration",'p.customcode'=>'CustomCode','p.price'=>"SellingPriceHT",'p.price_ttc'=>"SellingPriceTTC",'p.tva_tx'=>'VAT','p.tosell'=>"OnSell*",'p.tobuy'=>"OnBuy*",'p.fk_product_type'=>"Type*",'p.finished'=>'Nature','p.datec'=>'DateCreation*');
|
||||
if (! empty($conf->barcode->enabled)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('p.barcode'=>'BarCode'));
|
||||
// Add extra fields
|
||||
$sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product' AND entity = ".$conf->entity;
|
||||
$import_extrafield_sample=array();
|
||||
$sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product' entity IN (0, ".$conf->entity.')';
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql) // This can fail when class is used on old database (during migration for example)
|
||||
{
|
||||
@ -260,13 +261,14 @@ class modProduct extends DolibarrModules
|
||||
$fieldname='extra.'.$obj->name;
|
||||
$fieldlabel=ucfirst($obj->label);
|
||||
$this->import_fields_array[$r][$fieldname]=$fieldlabel.($obj->fieldrequired?'*':'');
|
||||
$import_extrafield_sample[$fieldname]=$fieldlabel;
|
||||
}
|
||||
}
|
||||
// End add extra fields
|
||||
$this->import_fieldshidden_array[$r]=array('extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'product'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
|
||||
$this->import_regex_array[$r]=array('p.ref'=>'[^ ]','p.tosell'=>'^[0|1]$','p.tobuy'=>'^[0|1]$','p.fk_product_type'=>'^[0|1]$','p.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
|
||||
$this->import_examplevalues_array[$r]=array('p.ref'=>"PREF123456",'p.label'=>"My product",'p.description'=>"This is a description example for record",'p.note'=>"Some note",'p.price'=>"100",'p.price_ttc'=>"110",'p.tva_tx'=>'10','p.tosell'=>"0 or 1",'p.tobuy'=>"0 or 1",'p.fk_product_type'=>"0 for product/1 for service",'p.finished'=>'','p.duration'=>"1y",'p.datec'=>'2008-12-31');
|
||||
|
||||
$import_sample=array('p.ref'=>"PREF123456",'p.label'=>"My product",'p.description'=>"This is a description example for record",'p.note'=>"Some note",'p.price'=>"100",'p.price_ttc'=>"110",'p.tva_tx'=>'10','p.tosell'=>"0 or 1",'p.tobuy'=>"0 or 1",'p.fk_product_type'=>"0 for product/1 for service",'p.finished'=>'','p.duration'=>"1y",'p.datec'=>'2008-12-31');
|
||||
$this->import_examplevalues_array[$r]=array_merge($import_sample,$import_extrafield_sample);
|
||||
|
||||
if (! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
|
||||
@ -211,7 +211,6 @@ class modUser extends DolibarrModules
|
||||
$this->export_permission[$r]=array(array("user","user","export"));
|
||||
$this->export_fields_array[$r]=array('u.rowid'=>"Id",'u.login'=>"Login",'u.lastname'=>"Lastname",'u.firstname'=>"Firstname",'u.office_phone'=>'Phone','u.office_fax'=>'Fax','u.email'=>'EMail','u.datec'=>"DateCreation",'u.tms'=>"DateLastModification",'u.admin'=>"Administrator",'u.statut'=>'Status','u.note'=>"Note",'u.datelastlogin'=>'LastConnexion','u.datepreviouslogin'=>'PreviousConnexion','u.fk_socpeople'=>"IdContact",'u.fk_soc'=>"IdCompany",'u.fk_member'=>"MemberId");
|
||||
$this->export_TypeFields_array[$r]=array('u.login'=>"Text",'u.lastname'=>"Text",'u.firstname'=>"Text",'u.office_phone'=>'Text','u.office_fax'=>'Text','u.email'=>'Text','u.datec'=>"Date",'u.tms'=>"Date",'u.admin'=>"Boolean",'u.statut'=>'Status','u.note'=>"Text",'u.datelastlogin'=>'Date','u.datepreviouslogin'=>'Date','u.fk_soc'=>"List:societe:nom:rowid",'u.fk_member'=>"List:adherent:nom");
|
||||
|
||||
$this->export_entities_array[$r]=array('u.rowid'=>"user",'u.login'=>"user",'u.lastname'=>"user",'u.firstname'=>"user",'u.office_phone'=>'user','u.office_fax'=>'user','u.email'=>'user','u.datec'=>"user",'u.tms'=>"user",'u.admin'=>"user",'u.statut'=>'user','u.note'=>"user",'u.datelastlogin'=>'user','u.datepreviouslogin'=>'user','u.fk_socpeople'=>"contact",'u.fk_soc'=>"company",'u.fk_member'=>"member");
|
||||
if (empty($conf->adherent->enabled))
|
||||
{
|
||||
|
||||
@ -37,7 +37,6 @@
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
|
||||
$langs->load("products");
|
||||
$langs->load("other");
|
||||
@ -52,12 +51,19 @@ $cancel=GETPOST("cancel");
|
||||
// Security check
|
||||
if (empty($modulepart)) accessforbidden('Bad value for modulepart');
|
||||
$accessallowed=0;
|
||||
if ($modulepart=='produit|service')
|
||||
if ($modulepart == 'produit' || $modulepart == 'product' || $modulepart == 'service' || $modulepart == 'produit|service')
|
||||
{
|
||||
$result=restrictedArea($user,'produit|service',$id,'product&product');
|
||||
if ($modulepart=='produit|service' && (! $user->rights->produit->lire && ! $user->rights->service->lire)) accessforbidden();
|
||||
$accessallowed=1;
|
||||
}
|
||||
elseif ($modulepart == 'holiday')
|
||||
{
|
||||
$result=restrictedArea($user,'holiday',$id,'holiday');
|
||||
if ($modulepart=='holiday' && (! $user->rights->holiday->read)) accessforbidden();
|
||||
$accessallowed=1;
|
||||
}
|
||||
|
||||
|
||||
// Security:
|
||||
// Limit access if permissions are wrong
|
||||
@ -66,15 +72,32 @@ if (! $accessallowed)
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$object = new Product($db);
|
||||
if ($id > 0)
|
||||
// Define dir according to modulepart
|
||||
if ($modulepart == 'produit' || $modulepart == 'product' || $modulepart == 'service' || $modulepart == 'produit|service')
|
||||
{
|
||||
$result = $object->fetch($id);
|
||||
if ($result <= 0) dol_print_error($db,'Failed to load object');
|
||||
$dir=$conf->product->multidir_output[$object->entity]; // By default
|
||||
if ($object->type == Product::TYPE_PRODUCT) $dir=$conf->product->multidir_output[$object->entity];
|
||||
if ($object->type == Product::TYPE_SERVICE) $dir=$conf->service->multidir_output[$object->entity];
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
$object = new Product($db);
|
||||
if ($id > 0)
|
||||
{
|
||||
$result = $object->fetch($id);
|
||||
if ($result <= 0) dol_print_error($db,'Failed to load object');
|
||||
$dir=$conf->product->multidir_output[$object->entity]; // By default
|
||||
if ($object->type == Product::TYPE_PRODUCT) $dir=$conf->product->multidir_output[$object->entity];
|
||||
if ($object->type == Product::TYPE_SERVICE) $dir=$conf->service->multidir_output[$object->entity];
|
||||
}
|
||||
}
|
||||
elseif ($modulepart == 'holiday')
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
|
||||
$object = new Holiday($db);
|
||||
if ($id > 0)
|
||||
{
|
||||
$result = $object->fetch($id);
|
||||
if ($result <= 0) dol_print_error($db,'Failed to load object');
|
||||
$dir=$conf->holiday->dir_output; // By default
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2009-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
/* Copyright (C) 2009-2015 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -245,6 +245,18 @@ if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file
|
||||
|
||||
<?php if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER; ?>
|
||||
|
||||
<?php
|
||||
if (! empty($hookmanager->resArray['options'])) {
|
||||
foreach ($hookmanager->resArray['options'] as $format => $option)
|
||||
{
|
||||
if ($format == 'js') {
|
||||
echo "\n".'<!-- Javascript by hook -->';
|
||||
echo $option."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// Google Analytics (need Google module)
|
||||
if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID))
|
||||
|
||||
@ -527,7 +527,8 @@ jQuery(document).ready(function() {
|
||||
}
|
||||
if (this.id == 'pmpprice')
|
||||
{
|
||||
var defaultbuyprice = <?php echo (isset($conf->global->MARGIN_PMP_AS_DEFAULT_BUY_PRICE)?int($conf->global->MARGIN_PMP_AS_DEFAULT_BUY_PRICE):1); ?>;
|
||||
// If margin is calculated on PMP, we set it by defaut (but only if value is not 0)
|
||||
var defaultbuyprice = <?php echo ((isset($conf->global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == 'pmp')?1:0); ?>;
|
||||
if (this.price > 0 && 1 == defaultbuyprice) { defaultkey = this.id; defaultprice = this.price; }
|
||||
options += '<option value="'+this.id+'" price="'+this.price+'">'+this.label+'</option>';
|
||||
}
|
||||
|
||||
@ -178,7 +178,7 @@ print_liste_field_titre($langs->trans("CronLastResult"),$_SERVER["PHP_SELF"],"t.
|
||||
print_liste_field_titre($langs->trans("CronLastOutput"),$_SERVER["PHP_SELF"],"t.lastoutput","",$arg_url,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Enabled"),$_SERVER["PHP_SELF"],"t.status","",$arg_url,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print '</tr>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td> </td>';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -27,6 +27,7 @@ require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
|
||||
|
||||
$langs->load("sendings");
|
||||
$langs->load("deliveries");
|
||||
$langs->load('companies');
|
||||
|
||||
// Security check
|
||||
@ -132,7 +133,7 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans("DateReceived"), $_SERVER["PHP_SELF"],"l.date_delivery","",$param, 'align="center"',$sortfield,$sortorder);
|
||||
}
|
||||
print_liste_field_titre($langs->trans("Status"), $_SERVER["PHP_SELF"],"e.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
// Lignes des champs de filtre
|
||||
@ -143,22 +144,24 @@ if ($resql)
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" size="10" name="search_company" value="'.dol_escape_htmltag($search_company).'">';
|
||||
print '</td>';
|
||||
// Date
|
||||
// Date delivery planned
|
||||
print '<td class="liste_titre"> </td>';
|
||||
if ($conf->livraison_bon->enabled)
|
||||
{
|
||||
// Delivery order
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" size="10" type="text" name="search_ref_liv" value="'.$search_ref_liv.'"';
|
||||
print '</td>';
|
||||
|
||||
// Date received
|
||||
print '<td class="liste_titre"> </td>';
|
||||
}
|
||||
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
// Status
|
||||
print '<td></td>';
|
||||
// Search
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<a href="#" id="checkall">'.$langs->trans("All").'</a> / <a href="#" id="checknone">'.$langs->trans("None").'</a>';
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@ -170,8 +173,9 @@ if ($resql)
|
||||
|
||||
$var=!$var;
|
||||
|
||||
// Ref
|
||||
print "<tr ".$bc[$var].">";
|
||||
|
||||
// Ref
|
||||
print "<td>";
|
||||
$shipment->id=$objp->rowid;
|
||||
$shipment->ref=$objp->ref;
|
||||
@ -195,11 +199,6 @@ if ($resql)
|
||||
}*/
|
||||
print "</td>\n";
|
||||
|
||||
// Date real
|
||||
print '<td align="center">';
|
||||
print dol_print_date($db->jdate($objp->date_expedition),"day");
|
||||
print '</td>'."\n";
|
||||
|
||||
if ($conf->livraison_bon->enabled)
|
||||
{
|
||||
$shipment->fetchObjectLinked($shipment->id,$shipment->element);
|
||||
@ -209,13 +208,16 @@ if ($resql)
|
||||
print '<td>';
|
||||
print !empty($receiving) ? $receiving->getNomUrl($db) : '';
|
||||
print '</td>';
|
||||
|
||||
// Date received
|
||||
print '<td align="center">';
|
||||
print dol_print_date($db->jdate($objp->date_reception),"day");
|
||||
print '</td>'."\n";
|
||||
}
|
||||
|
||||
print '<td align="right">'.$expedition->LibStatut($objp->fk_statut,5).'</td>';
|
||||
|
||||
print '<td></td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
$i++;
|
||||
|
||||
@ -668,123 +668,6 @@ if ($action == "confirm_cancel" && GETPOST('confirm')=="yes" && GETPOST('detail_
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == "confirm_paid" && GETPOST('confirm')=="yes" && $id > 0 && $user->rights->expensereport->to_paid)
|
||||
{
|
||||
$object = new ExpenseReport($db);
|
||||
$object->fetch($id);
|
||||
|
||||
$result = $object->setPaid($user);
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
// Define output language
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||
{
|
||||
$outputlangs = $langs;
|
||||
$newlang = '';
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha');
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
|
||||
if (! empty($newlang)) {
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
$model=$object->modelpdf;
|
||||
$ret = $object->fetch($id); // Reload to get new records
|
||||
|
||||
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
}
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
if (! empty($conf->global->DEPLACEMENT_TO_CLEAN))
|
||||
{
|
||||
// Send mail
|
||||
|
||||
// TO
|
||||
$destinataire = new User($db);
|
||||
$destinataire->fetch($object->fk_user_author);
|
||||
$emailTo = $destinataire->email;
|
||||
|
||||
// FROM
|
||||
$expediteur = new User($db);
|
||||
$expediteur->fetch($object->fk_user_paid);
|
||||
$emailFrom = $expediteur->email;
|
||||
|
||||
// SUBJECT
|
||||
$subject = "' ERP - Note de frais payée";
|
||||
|
||||
// CONTENT
|
||||
$message = "Bonjour {$destinataire->firstname},\n\n";
|
||||
$message.= "Votre note de frais \"{$object->ref}\" vient d'être payée.\n";
|
||||
$message.= "- Payeur : {$expediteur->firstname} {$expediteur->lastname}\n";
|
||||
$message.= "- Lien : {$dolibarr_main_url_root}/expensereport/card.php?id={$object->id}\n\n";
|
||||
$message.= "Bien cordialement,\n' SI";
|
||||
|
||||
// Génération du pdf avant attachement
|
||||
$object->setDocModel($user,"");
|
||||
$resultPDF = expensereport_pdf_create($db,$object,'',"",$langs);
|
||||
|
||||
// PREPARE SEND
|
||||
$mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message);
|
||||
|
||||
if(!$mailfile->error):
|
||||
|
||||
// SEND
|
||||
$result=$mailfile->sendfile();
|
||||
if ($result):
|
||||
// Insert écriture dans le compte courant
|
||||
$idTrip = $id;
|
||||
$idAccount = 1;
|
||||
|
||||
$object = new ExpenseReport($db);
|
||||
$object->fetch($idTrip);
|
||||
|
||||
$datePaiement = explode("-",$object->date_paiement);
|
||||
|
||||
$dateop = dol_mktime(12,0,0,$datePaiement[1],$datePaiement[2],$datePaiement[0]);
|
||||
$operation = $object->code_paiement;
|
||||
$label = "Règlement ".$object->ref;
|
||||
$amount = - price2num($object->total_ttc);
|
||||
$num_chq = '';
|
||||
$cat1 = '';
|
||||
|
||||
$user = new User($db);
|
||||
$user->fetch($object->fk_user_paid);
|
||||
|
||||
$acct=new Account($db,$idAccount);
|
||||
$insertid = $acct->addline($dateop, $operation, $label, $amount, $num_chq, $cat1, $user);
|
||||
|
||||
if ($insertid > 0):
|
||||
$sql = " UPDATE ".MAIN_DB_PREFIX."expensereport as d";
|
||||
$sql.= " SET integration_compta = 1, fk_bank_account = $idAccount";
|
||||
$sql.= " WHERE rowid = $idTrip";
|
||||
$resql=$db->query($sql);
|
||||
if($result):
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
else:
|
||||
dol_print_error($db);
|
||||
endif;
|
||||
else:
|
||||
dol_print_error($db,$acct->error);
|
||||
endif;
|
||||
endif;
|
||||
|
||||
else:
|
||||
|
||||
$mesg="Impossible d'envoyer l'email.";
|
||||
|
||||
endif;
|
||||
// END - Send mail
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == "confirm_brouillonner" && GETPOST('confirm')=="yes" && $id > 0 && $user->rights->expensereport->creer)
|
||||
{
|
||||
$object = new ExpenseReport($db);
|
||||
@ -829,16 +712,96 @@ if ($action == "confirm_brouillonner" && GETPOST('confirm')=="yes" && $id > 0 &&
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'set_paid')
|
||||
if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid)
|
||||
{
|
||||
if ($object->set_paid($id) >= 0)
|
||||
$object = new ExpenseReport($db);
|
||||
$object->fetch($id);
|
||||
|
||||
$result = $object->set_paid($id, $user);
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
||||
exit;
|
||||
// Define output language
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||
{
|
||||
$outputlangs = $langs;
|
||||
$newlang = '';
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha');
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
|
||||
if (! empty($newlang)) {
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
$model=$object->modelpdf;
|
||||
$ret = $object->fetch($id); // Reload to get new records
|
||||
|
||||
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
}
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
if (! empty($conf->global->DEPLACEMENT_TO_CLEAN))
|
||||
{
|
||||
// Send mail
|
||||
|
||||
// TO
|
||||
$destinataire = new User($db);
|
||||
$destinataire->fetch($object->fk_user_author);
|
||||
$emailTo = $destinataire->email;
|
||||
|
||||
// FROM
|
||||
$expediteur = new User($db);
|
||||
$expediteur->fetch($user->id);
|
||||
$emailFrom = $expediteur->email;
|
||||
|
||||
// SUBJECT
|
||||
$subject = "'ERP - Note de frais payée";
|
||||
|
||||
// CONTENT
|
||||
$message = "Bonjour {$destinataire->firstname},\n\n";
|
||||
$message.= "Votre note de frais \"{$object->ref}\" vient d'être payée.\n";
|
||||
$message.= "- Payeur : {$expediteur->firstname} {$expediteur->lastname}\n";
|
||||
$message.= "- Lien : {$dolibarr_main_url_root}/expensereport/card.php?id={$object->id}\n\n";
|
||||
$message.= "Bien cordialement,\n' SI";
|
||||
|
||||
// Generate pdf before attachment
|
||||
$object->setDocModel($user,"");
|
||||
$resultPDF = expensereport_pdf_create($db,$object,'',"",$langs);
|
||||
|
||||
// PREPARE SEND
|
||||
$mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message);
|
||||
|
||||
if(!$mailfile->error):
|
||||
|
||||
// SEND
|
||||
$result=$mailfile->sendfile();
|
||||
if ($result):
|
||||
|
||||
// Retour
|
||||
if($result):
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
else:
|
||||
dol_print_error($db);
|
||||
endif;
|
||||
|
||||
else:
|
||||
dol_print_error($db,$acct->error);
|
||||
endif;
|
||||
|
||||
else:
|
||||
|
||||
$mesg="Impossible d'envoyer l'email.";
|
||||
|
||||
endif;
|
||||
// END - Send mail
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
else {
|
||||
setEventMessage($object->error, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == "addline")
|
||||
@ -1311,7 +1274,7 @@ else
|
||||
print '<td>'.$langs->trans("AUTHORPAIEMENT").'</td>';
|
||||
print '<td>';
|
||||
$userfee=new User($db);
|
||||
$userfee->fetch($object->fk_user_paid);
|
||||
$userfee->fetch($user->id);
|
||||
print $userfee->getNomUrl(1);
|
||||
print '</td></tr>';
|
||||
|
||||
@ -2005,9 +1968,9 @@ if ($action != 'create' && $action != 'edit')
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/expensereport/payment/payment.php?id=' . $object->id . '&action=create">' . $langs->trans('DoPayment') . '</a></div>';
|
||||
}
|
||||
|
||||
if ($object->statut == 1 && round($remaintopay) == 0 && $object->paid == 0 && $user->rights->don->creer)
|
||||
if (round($remaintopay) == 0 && $object->paid == 0)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?rowid='.$object->id.'&action=set_paid">'.$langs->trans("ClassifyPaid")."</a></div>";
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id='.$object->id.'&action=set_paid">'.$langs->trans("ClassifyPaid")."</a></div>";
|
||||
}
|
||||
|
||||
// Cancel
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
|
||||
* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -88,8 +89,6 @@ class ExpenseReport extends CommonObject
|
||||
var $fk_user_approve;
|
||||
|
||||
// Paiement
|
||||
var $date_paiement;
|
||||
var $fk_user_paid;
|
||||
var $user_paid_infos;
|
||||
|
||||
/*
|
||||
@ -241,7 +240,6 @@ class ExpenseReport extends CommonObject
|
||||
$sql.= " , fk_user_author = ".($user->id > 0 ? "'".$user->id."'":"null");
|
||||
$sql.= " , fk_user_validator = ".($this->fk_user_validator > 0 ? $this->fk_user_validator:"null");
|
||||
$sql.= " , fk_user_valid = ".($this->fk_user_valid > 0 ? $this->fk_user_valid:"null");
|
||||
$sql.= " , fk_user_paid = ".($this->fk_user_paid > 0 ? $this->fk_user_paid:"null");
|
||||
$sql.= " , fk_statut = ".($this->fk_statut >= 0 ? $this->fk_statut:'0');
|
||||
$sql.= " , fk_c_paiement = ".($this->fk_c_paiement > 0 ? $this->fk_c_paiement:"null");
|
||||
$sql.= " , note_public = ".(!empty($this->note_public)?"'".$this->db->escape($this->note_public)."'":"''");
|
||||
@ -277,9 +275,9 @@ class ExpenseReport extends CommonObject
|
||||
$sql.= " d.detail_refuse, d.detail_cancel, d.fk_user_refuse, d.fk_user_cancel,"; // ACTIONS
|
||||
$sql.= " d.date_refuse, d.date_cancel,"; // ACTIONS
|
||||
$sql.= " d.total_ht, d.total_ttc, d.total_tva,"; // TOTAUX (int)
|
||||
$sql.= " d.date_debut, d.date_fin, d.date_create, d.date_valid, d.date_approve, d.date_paiement,"; // DATES (datetime)
|
||||
$sql.= " d.date_debut, d.date_fin, d.date_create, d.date_valid, d.date_approve,"; // DATES (datetime)
|
||||
$sql.= " d.fk_user_author, d.fk_user_validator, d.fk_statut as status, d.fk_c_paiement,";
|
||||
$sql.= " d.fk_user_valid, d.fk_user_approve, d.fk_user_paid,";
|
||||
$sql.= " d.fk_user_valid, d.fk_user_approve,";
|
||||
$sql.= " dp.libelle as libelle_paiement, dp.code as code_paiement"; // INNER JOIN paiement
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." as d LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as dp ON d.fk_c_paiement = dp.id";
|
||||
if ($ref) $sql.= " WHERE d.ref = '".$this->db->escape($ref)."'";
|
||||
@ -305,7 +303,6 @@ class ExpenseReport extends CommonObject
|
||||
|
||||
$this->date_debut = $this->db->jdate($obj->date_debut);
|
||||
$this->date_fin = $this->db->jdate($obj->date_fin);
|
||||
$this->date_paiement = $this->db->jdate($obj->date_paiement);
|
||||
$this->date_valid = $this->db->jdate($obj->date_valid);
|
||||
$this->date_approve = $this->db->jdate($obj->date_approve);
|
||||
$this->date_create = $this->db->jdate($obj->date_create);
|
||||
@ -318,7 +315,6 @@ class ExpenseReport extends CommonObject
|
||||
$this->fk_user_refuse = $obj->fk_user_refuse;
|
||||
$this->fk_user_cancel = $obj->fk_user_cancel;
|
||||
$this->fk_user_approve = $obj->fk_user_approve;
|
||||
$this->fk_user_paid = $obj->fk_user_paid;
|
||||
|
||||
$user_author = new User($this->db);
|
||||
if ($this->fk_user_author > 0) $user_author->fetch($this->fk_user_author);
|
||||
@ -341,13 +337,6 @@ class ExpenseReport extends CommonObject
|
||||
$this->user_valid_infos = dolGetFirstLastname($user_valid->firstname, $user_valid->lastname);
|
||||
}
|
||||
|
||||
if ($this->fk_statut==6)
|
||||
{
|
||||
$user_paid = new User($this->db);
|
||||
if ($this->fk_user_paid > 0) $user_paid->fetch($this->fk_user_paid);
|
||||
$this->user_paid_infos = dolGetFirstLastname($user_paid->firstname, $user_paid->lastname);
|
||||
}
|
||||
|
||||
$this->libelle_statut = $obj->libelle_statut;
|
||||
$this->libelle_paiement = $obj->libelle_paiement;
|
||||
$this->code_statut = $obj->code_statut;
|
||||
@ -375,14 +364,17 @@ class ExpenseReport extends CommonObject
|
||||
/**
|
||||
* Classify the expense report as paid
|
||||
*
|
||||
* @param int $id id of expense report
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param int $id Id of expense report
|
||||
* @param user $fuser User making change
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function set_paid($id)
|
||||
function set_paid($id, $fuser)
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."expensereport SET fk_statut = 6";
|
||||
$sql.= " WHERE rowid = $id AND fk_statut = 5";
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."expensereport";
|
||||
$sql.= " SET fk_statut = 6";
|
||||
$sql.= " WHERE rowid = ".$id." AND fk_statut = 5";
|
||||
|
||||
dol_syslog(get_class($this)."::set_paid sql=".$sql, LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -1017,41 +1009,6 @@ class ExpenseReport extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* setPaid
|
||||
*
|
||||
* @param User $fuser User
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function setPaid($fuser)
|
||||
{
|
||||
$now= dol_now();
|
||||
|
||||
$this->date_paiement = $this->db->idate($now);
|
||||
if ($this->fk_statut != 6)
|
||||
{
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql.= " SET fk_statut = 6, fk_user_paid = ".$fuser->id.",";
|
||||
$sql.= " date_paiement='".$this->db->idate($this->date_paiement)."'";
|
||||
$sql.= ' WHERE rowid = '.$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::setPaid sql=".$sql, LOG_DEBUG);
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog(get_class($this)."::set_paid expensereport already with paid status", LOG_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* set_unpaid
|
||||
*
|
||||
|
||||
@ -126,9 +126,8 @@ if (isset($_POST['action']))
|
||||
$outputlangs = $langs;
|
||||
$outputlangs->charset_output = 'UTF-8';
|
||||
|
||||
$sql = "SELECT d.rowid, d.ref, d.date_paiement, d.total_ht, d.total_tva, d.total_ttc";
|
||||
$sql = "SELECT d.rowid, d.ref, d.total_ht, d.total_tva, d.total_ttc";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."expensereport as d";
|
||||
$sql.= " WHERE date_paiement LIKE '".$select_date."%'";
|
||||
$sql.= " ORDER BY d.rowid";
|
||||
|
||||
$result = $db->query($sql);
|
||||
@ -146,7 +145,7 @@ if (isset($_POST['action']))
|
||||
$objet->total_tva = number_format($objet->total_tva,2);
|
||||
$objet->total_ttc = number_format($objet->total_ttc,2);
|
||||
$objet->ref = trim($objet->ref);
|
||||
$ligne.= "{$objet->rowid}, {$objet->ref}, ----, {$objet->date_paiement}, {$objet->total_ht}, {$objet->total_tva}, {$objet->total_ttc}\n";
|
||||
$ligne.= "{$objet->rowid}, {$objet->ref}, ----, {$objet->total_ht}, {$objet->total_tva}, {$objet->total_ttc}\n";
|
||||
|
||||
$ligne.= "--->, Ligne, Type, Description, ----, ----, ----\n";
|
||||
|
||||
|
||||
@ -191,7 +191,7 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans("TotalVAT"),$_SERVER["PHP_SELF"],"d.total_tva","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("TotalTTC"),$_SERVER["PHP_SELF"],"d.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Statut"),$_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
// Filters
|
||||
@ -263,10 +263,13 @@ if ($resql)
|
||||
print '<td align="right">'.price($objp->total_ttc).'</td>';
|
||||
|
||||
$expensereporttmp->status=$objp->status;
|
||||
print '<td align="right" colspan="2">';
|
||||
print '<td align="right">';
|
||||
//print $objp->status;
|
||||
print $expensereporttmp->getLibStatut(5);
|
||||
print '</td>';
|
||||
|
||||
print '<td></td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
$total_total_ht = $total_total_ht + $objp->total_ht;
|
||||
|
||||
@ -33,8 +33,6 @@ if ($_GET["action"] == 'confirm_ndf_to_account' && $_GET["confirm"] == "yes"):
|
||||
$expensereport = new ExpenseReport($db);
|
||||
$expensereport->fetch($idTrip,$user);
|
||||
|
||||
$datePaiement = explode("-",$expensereport->date_paiement);
|
||||
|
||||
$dateop = dol_mktime(12,0,0,$datePaiement[1],$datePaiement[2],$datePaiement[0]);
|
||||
$operation = $expensereport->code_paiement;
|
||||
$label = "Règlement ".$expensereport->ref;
|
||||
@ -43,7 +41,7 @@ if ($_GET["action"] == 'confirm_ndf_to_account' && $_GET["confirm"] == "yes"):
|
||||
$cat1 = '';
|
||||
|
||||
$user = new User($db);
|
||||
$user->fetch($expensereport->fk_user_paid);
|
||||
$user->fetch($user->id);
|
||||
|
||||
$acct=new Account($db,$idAccount);
|
||||
$insertid = $acct->addline($dateop, $operation, $label, $amount, $num_chq, $cat1, $user);
|
||||
|
||||
@ -46,7 +46,6 @@ class Export
|
||||
|
||||
// To store export modules
|
||||
var $hexa;
|
||||
var $hexafilter;
|
||||
var $hexafiltervalue;
|
||||
var $datatoexport;
|
||||
var $model_name;
|
||||
@ -635,9 +634,6 @@ class Export
|
||||
$this->db->begin();
|
||||
|
||||
$filter='';
|
||||
if (! empty($this->hexafilter) && ! empty($this->hexafiltervalue)) {
|
||||
$filter = json_encode(array('field' => $this->hexafilter, 'value' => $this->hexafiltervalue));
|
||||
}
|
||||
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'export_model (';
|
||||
$sql.= 'label,';
|
||||
@ -646,12 +642,12 @@ class Export
|
||||
$sql.= 'filter';
|
||||
$sql.= ') VALUES (';
|
||||
$sql.= "'".$this->db->escape($this->model_name)."',";
|
||||
$sql.= "'".$this->datatoexport."',";
|
||||
$sql.= "'".$this->hexa."',";
|
||||
$sql.= (! empty($filter)?"'".$filter."'":"null");
|
||||
$sql.= "'".$this->db->escape($this->datatoexport)."',";
|
||||
$sql.= "'".$this->db->escape($this->hexa)."',";
|
||||
$sql.= "'".$this->db->escape($this->hexafiltervalue)."'";
|
||||
$sql.= ")";
|
||||
|
||||
dol_syslog("Export::create", LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -675,7 +671,7 @@ class Export
|
||||
*/
|
||||
function fetch($id)
|
||||
{
|
||||
$sql = 'SELECT em.rowid, em.field, em.label, em.type, em.filter';
|
||||
$sql = 'SELECT em.rowid, em.label, em.type, em.field, em.filter';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'export_model as em';
|
||||
$sql.= ' WHERE em.rowid = '.$id;
|
||||
|
||||
@ -687,13 +683,11 @@ class Export
|
||||
if ($obj)
|
||||
{
|
||||
$this->id = $obj->rowid;
|
||||
$this->hexa = $obj->field;
|
||||
$this->model_name = $obj->label;
|
||||
$this->datatoexport = $obj->type;
|
||||
|
||||
$filter = json_decode($obj->filter, true);
|
||||
$this->hexafilter = (isset($filter['field'])?$filter['field']:'');
|
||||
$this->hexafiltervalue = (isset($filter['value'])?$filter['value']:'');
|
||||
|
||||
$this->hexa = $obj->field;
|
||||
$this->hexafiltervalue = $obj->filter;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -105,7 +105,7 @@ $entitytolang = array(
|
||||
);
|
||||
|
||||
$array_selected=isset($_SESSION["export_selected_fields"])?$_SESSION["export_selected_fields"]:array();
|
||||
$array_filtervalue=isset($_SESSION["export_FilterValue_fields"])?$_SESSION["export_FilterValue_fields"]:array();
|
||||
$array_filtervalue=isset($_SESSION["export_filtered_fields"])?$_SESSION["export_filtered_fields"]:array();
|
||||
$datatoexport=GETPOST("datatoexport");
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$confirm=GETPOST('confirm', 'alpha');
|
||||
@ -228,7 +228,6 @@ if ($action=='downfield' || $action=='upfield')
|
||||
if ($step == 1 || $action == 'cleanselect')
|
||||
{
|
||||
$_SESSION["export_selected_fields"]=array();
|
||||
//$_SESSION["export_FilterValue_fields"]=array();
|
||||
$_SESSION["export_filtered_fields"]=array();
|
||||
$array_selected=array();
|
||||
$array_filtervalue=array();
|
||||
@ -286,12 +285,15 @@ if ($action == 'add_export_model')
|
||||
}
|
||||
|
||||
$hexafiltervalue='';
|
||||
foreach($array_filtervalue as $key=>$val)
|
||||
if (! empty($array_filtervalue) && is_array($array_filtervalue))
|
||||
{
|
||||
if ($hexafilter) $hexafiltervalue.=',';
|
||||
$hexafiltervalue.=$key.'='.$val;
|
||||
foreach($array_filtervalue as $key=>$val)
|
||||
{
|
||||
if ($hexafiltervalue) $hexafiltervalue.=',';
|
||||
$hexafiltervalue.=$key.'='.$val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$objexport->model_name = $export_name;
|
||||
$objexport->datatoexport = $datatoexport;
|
||||
$objexport->hexa = $hexa;
|
||||
@ -317,10 +319,11 @@ if ($action == 'add_export_model')
|
||||
}
|
||||
}
|
||||
|
||||
// Reload an predefined export model
|
||||
if ($step == 2 && $action == 'select_model')
|
||||
{
|
||||
$_SESSION["export_selected_fields"]=array();
|
||||
$_SESSION["export_FilterValue_fields"]=array();
|
||||
$_SESSION["export_filtered_fields"]=array();
|
||||
|
||||
$array_selected=array();
|
||||
$array_filtervalue=array();
|
||||
@ -337,16 +340,15 @@ if ($step == 2 && $action == 'select_model')
|
||||
}
|
||||
$_SESSION["export_selected_fields"]=$array_selected;
|
||||
|
||||
$fieldsarray=explode(',',$objexport->hexafilter);
|
||||
$fieldsarrayvalue=explode(',',$objexport->hexafiltervalue);
|
||||
$i=1;
|
||||
foreach($fieldsarray as $val)
|
||||
foreach($fieldsarrayvalue as $val)
|
||||
{
|
||||
$tmp=explode('=',$val);
|
||||
$array_filtervalue[$tmp[0]]=$tmp[1];
|
||||
$i++;
|
||||
}
|
||||
$_SESSION["export_FilterValue_fields"]=$array_filtervalue;
|
||||
$_SESSION["export_filtered_fields"]=$array_filtervalue;
|
||||
}
|
||||
}
|
||||
|
||||
@ -356,7 +358,7 @@ if ($step == 4 && $action == 'submitFormField')
|
||||
// on boucle sur les champs selectionne pour recuperer la valeur
|
||||
if (is_array($objexport->array_export_TypeFields[0]))
|
||||
{
|
||||
$_SESSION["export_FilterValue_fields"]=array();
|
||||
$_SESSION["export_filtered_fields"]=array();
|
||||
//var_dump($_POST);
|
||||
foreach($objexport->array_export_TypeFields[0] as $code => $type) // $code: s.fieldname $value: Text|Boolean|List:ccc
|
||||
{
|
||||
@ -372,7 +374,7 @@ if ($step == 4 && $action == 'submitFormField')
|
||||
}
|
||||
}
|
||||
$array_filtervalue=(! empty($objexport->array_export_FilterValue[0])?$objexport->array_export_FilterValue[0]:'');
|
||||
$_SESSION["export_FilterValue_fields"]=$array_filtervalue;
|
||||
$_SESSION["export_filtered_fields"]=$array_filtervalue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
|
||||
@ -332,24 +332,33 @@ else if ($action == 'add' && $user->rights->ficheinter->creer)
|
||||
}
|
||||
else
|
||||
{
|
||||
// Extrafields
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$array_options = $extrafields->getOptionalsFromPost($extralabels);
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||
if ($ret < 0) {
|
||||
$error ++;
|
||||
$action = 'create';
|
||||
}
|
||||
|
||||
$object->array_options = $array_options;
|
||||
if (! $error)
|
||||
{
|
||||
// Extrafields
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$array_options = $extrafields->getOptionalsFromPost($extralabels);
|
||||
|
||||
$result = $object->create($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
$id=$result; // Force raffraichissement sur fiche venant d'etre cree
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = 'create';
|
||||
}
|
||||
$object->array_options = $array_options;
|
||||
|
||||
$result = $object->create($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
$id=$result; // Force raffraichissement sur fiche venant d'etre cree
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = 'create';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -145,7 +145,7 @@ if ($result)
|
||||
print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],"fd.duree","",$urlparam,'align="right"',$sortfield,$sortorder);
|
||||
}
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"f.fk_statut","",$urlparam,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"], '');
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -224,6 +224,7 @@ else
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
@ -200,7 +200,7 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans("OrderDate"),$_SERVER["PHP_SELF"],"dc","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('DateDeliveryPlanned'),$_SERVER["PHP_SELF"],'cf.date_livraison','',$param, 'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cf.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -308,7 +308,9 @@ if ($resql)
|
||||
|
||||
|
||||
// Statut
|
||||
print '<td align="right" colspan="2">'.$commandestatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut, 5).'</td>';
|
||||
|
||||
print '<td></td>';
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user