Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop Conflicts: htdocs/install/mysql/migration/3.3.0-3.4.0.sql
This commit is contained in:
commit
e74b07cbff
39
ChangeLog
39
ChangeLog
@ -14,10 +14,13 @@ For users:
|
||||
- New: Can expand/collapse menus, categories and users list.
|
||||
- New: extra parameters are supported into ODT templates.
|
||||
- New: total per vat rate are available as tags for ODT templates.
|
||||
- New: Add more types for extra parameters (lists, phone, emails, checkbox, prices)
|
||||
- New: Add more types for extra parameters (lists, phone, emails, checkbox, prices).
|
||||
- New: Some part of interface use more CSS3 (ie: agenda)
|
||||
- New: [ task #707 ] Create option ProfIdx are mandatory to validate a invoice
|
||||
|
||||
- New: [ task #707 ] Create option ProfIdx are mandatory to validate a invoice.
|
||||
- New: Can define of we want to use VAT or not for subscriptions (foundation module).
|
||||
- New: Can define a default choice for choice "More action when recording
|
||||
a subscription" (foundation module).
|
||||
|
||||
For developers:
|
||||
- System of menu managers has been rewritten to reduce code to do same things.
|
||||
- An external module can force its theme.
|
||||
@ -37,6 +40,36 @@ For translators:
|
||||
- Update language files.
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 3.3.1 compared to 3.3 *****
|
||||
|
||||
- Fix: [ bug #733 ] Mass emailing tools do not support <style HTML tag
|
||||
- Fix: Package for launchpad
|
||||
- Fix: [ bug #736 ] Missing column in llx_c_chargesociales
|
||||
- Fix: Localtax2 for Spain must be based into buyer
|
||||
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 3.3.1 compared to 3.3 *****
|
||||
|
||||
- Fix: [ bug #733 ] Mass emailing tools do not support <style HTML tag
|
||||
- Fix: Package for launchpad
|
||||
- Fix: [ bug #736 ] Missing column in llx_c_chargesociales
|
||||
- Fix: Localtax2 for Spain must be based into buyer
|
||||
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 3.3.1 compared to 3.3 *****
|
||||
|
||||
- Fix: [ bug #733 ] Mass emailing tools do not support <style HTML tag
|
||||
- Fix: Package for launchpad
|
||||
- Fix: [ bug #736 ] Missing column in llx_c_chargesociales
|
||||
- Fix: Localtax2 for Spain must be based into buyer
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 3.3 compared to 3.2.3 *****
|
||||
For users:
|
||||
- New: Add holiday module, to declare and follow holidays of your employees.
|
||||
|
||||
@ -4,6 +4,6 @@ dolibarr (3.4.0+nmu1) unstable; urgency=low
|
||||
* New upstream release.
|
||||
closes: bug#634783
|
||||
|
||||
-- Dolibarr team <contact@dolibarr.org> Mon, 14 Jan 2013 12:00:00 +0100
|
||||
-- Dolibarr team <contact@dolibarr.org> Sat, 2 Mar 2013 12:00:00 +0100
|
||||
|
||||
# For a changelog file dedicated to end users, see /usr/share/doc/dolibarr/ChangeLog.gz
|
||||
# For a changelog file dedicated to end users, see /usr/share/doc/dolibarr/ChangeLog.gz
|
||||
|
||||
@ -96,11 +96,11 @@ https://launchpad.net/dolibarr/stable
|
||||
lp:dolibarr
|
||||
merge packaging lp:~yourlogin/+junk/debian-dev
|
||||
For beta:
|
||||
# bzr-builder format 0.3 deb-version {debupstream}-0~{revno}
|
||||
# bzr-builder format 0.3 deb-version {debupstream}-1~{revno}
|
||||
lp:dolibarr/beta
|
||||
merge packaging lp:~yourlogin/+junk/debian-beta
|
||||
For stable:
|
||||
# bzr-builder format 0.3 deb-version {debupstream}-0~{revno}
|
||||
# bzr-builder format 0.3 deb-version {debupstream}-2~{revno}
|
||||
lp:dolibarr/stable
|
||||
merge packaging lp:~yourlogin/+junk/debian-stable
|
||||
- Run command
|
||||
|
||||
@ -2,7 +2,7 @@ README (English)
|
||||
--------------------------------
|
||||
This directory contains sub-directories to provide tools or
|
||||
documentation for developers.
|
||||
Note: All files in this directory are in CVS only and are not
|
||||
Note: All files in this directory are in VCS only and are not
|
||||
provided with a standard release.
|
||||
|
||||
|
||||
|
||||
10
dev/findutf8bom.sh
Executable file
10
dev/findutf8bom.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Checks if files contains UTF-8 BOM
|
||||
# in dolibarr source tree excluding
|
||||
# git repository, custom modules and incuded libraries
|
||||
#
|
||||
# Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr
|
||||
grep -rlI \
|
||||
--exclude-dir='.git' --exclude-dir='includes' --exclude-dir='custom' \
|
||||
$'\xEF\xBB\xBF' .
|
||||
10
dev/findutf8bomincludes.sh
Executable file
10
dev/findutf8bomincludes.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Checks if files contains UTF-8 BOM
|
||||
# in dolibarr includes tree excluding
|
||||
# git repository
|
||||
#
|
||||
# Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr
|
||||
grep -rlI \
|
||||
--exclude-dir='.git' \
|
||||
$'\xEF\xBB\xBF' htdocs/includes
|
||||
10
dev/removeutf8bom.sh
Executable file
10
dev/removeutf8bom.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Removes UTF-8 BOM from a file list on STDIN
|
||||
# Use by piping the output of a findutf8bom script
|
||||
#
|
||||
# Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr
|
||||
while read f; do
|
||||
echo "Fixing $f"
|
||||
sed -i '1s/^\xEF\xBB\xBF//' $f
|
||||
done
|
||||
@ -1,4 +1,4 @@
|
||||
README (English)
|
||||
README (English)
|
||||
--------------------------------
|
||||
|
||||
* Most screen captures and icons are Dolibarr contributions, however,
|
||||
|
||||
@ -169,31 +169,54 @@ print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_DEFAULT_S
|
||||
print '</td><td align="center" width="80">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||
print "</td></tr>\n";
|
||||
print '</form>';
|
||||
print '</form>';
|
||||
|
||||
// Insertion cotisations dans compte financier
|
||||
// Insert subscription into bank account
|
||||
$var=!$var;
|
||||
print '<form action="adherent.php" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="constname" value="ADHERENT_BANK_USE">';
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("AddSubscriptionIntoAccount").'</td>';
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
print '<td>';
|
||||
print $form->selectyesno('constvalue',$conf->global->ADHERENT_BANK_USE,1);
|
||||
print '</td><td align="center" width="80">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="right" colspan="2">';
|
||||
print $langs->trans("WarningModuleNotActive",$langs->transnoentities("Module85Name"));
|
||||
print '</td>';
|
||||
}
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("MoreActionsOnSubscription").'</td>';
|
||||
$arraychoices=array('0'=>$langs->trans("None"));
|
||||
if (! empty($conf->banque->enabled)) $arraychoices['bankdirect']=$langs->trans("MoreActionBankDirect");
|
||||
if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $arraychoices['invoiceonly']=$langs->trans("MoreActionInvoiceOnly");
|
||||
if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $arraychoices['bankviainvoice']=$langs->trans("MoreActionBankViaInvoice");
|
||||
print '<td>';
|
||||
print $form->selectarray('constvalue',$arraychoices,$conf->global->ADHERENT_BANK_USE,0);
|
||||
print '</td><td align="center" width="80">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
print '</form>';
|
||||
print '</form>';
|
||||
|
||||
// Use vat for invoice creation
|
||||
if ($conf->facture->enabled)
|
||||
{
|
||||
$var=!$var;
|
||||
print '<form action="adherent.php" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="constname" value="ADHERENT_VAT_FOR_SUBSCRIPTIONS">';
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("VATToUseForSubscriptions").'</td>';
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
print '<td>';
|
||||
print $form->selectarray('constvalue', array('0'=>$langs->trans("NoVatOnSubscription"),'defaultforfoundationcountry'=>$langs->trans("Default")), (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS)?'0':$conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS), 0);
|
||||
print '</td><td align="center" width="80">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="right" colspan="2">';
|
||||
print $langs->trans("WarningModuleNotActive",$langs->transnoentities("Module85Name"));
|
||||
print '</td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
@ -362,7 +362,11 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
|
||||
|
||||
// Add line to draft invoice
|
||||
$idprodsubscription=0;
|
||||
$vattouse=get_default_tva($mysoc, $customer, $idprodsubscription);
|
||||
$vattouse=0;
|
||||
if (isset($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) && $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS == 'defaultforfoundationcountry')
|
||||
{
|
||||
$vattouse=get_default_tva($mysoc, $mysoc, $idprodsubscription);
|
||||
}
|
||||
//print xx".$vattouse." - ".$mysoc." - ".$customer;exit;
|
||||
$result=$invoice->addline($invoice->id,$label,0,1,$vattouse,0,0,$idprodsubscription,0,$datecotisation,$datesubend,0,0,'','TTC',$cotisation,1);
|
||||
if ($result <= 0)
|
||||
@ -756,9 +760,9 @@ if ($rowid)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! empty($conf->global->ADHERENT_BANK_USE) && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $bankviainvoice=1;
|
||||
else if (! empty($conf->global->ADHERENT_BANK_USE) && ! empty($conf->banque->enabled)) $bankdirect=1;
|
||||
else if (empty($conf->global->ADHERENT_BANK_USE) && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $invoiceonly=1;
|
||||
if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $bankviainvoice=1;
|
||||
else if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && ! empty($conf->banque->enabled)) $bankdirect=1;
|
||||
else if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $invoiceonly=1;
|
||||
}
|
||||
|
||||
print "\n\n<!-- Form add subscription -->\n";
|
||||
|
||||
@ -107,13 +107,8 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg
|
||||
'%MONTH%'=>$month,
|
||||
'%DAY%'=>$day,
|
||||
'%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT,
|
||||
'%SERVER%'=>"http://".$_SERVER["SERVER_NAME"]."/", // deprecated
|
||||
// For backward compatibility
|
||||
'%SOCIETE%'=>$objp->company,
|
||||
'%ZIP%'=>$objp->zip,
|
||||
'%COUNTRY%'=>$objp->country,
|
||||
'%ANNEE%'=>$year,
|
||||
'%SERVEUR%'=>"http://".$_SERVER["SERVER_NAME"]."/" // deprecated
|
||||
'%SERVER%'=>"http://".$_SERVER["SERVER_NAME"]."/",
|
||||
'%SOCIETE%'=>$objp->company
|
||||
);
|
||||
complete_substitutions_array($substitutionarray, $langs);
|
||||
|
||||
|
||||
@ -57,30 +57,44 @@ if ($actionsave)
|
||||
if ($disableext) $disableext=0; else $disableext=1;
|
||||
$res=dolibarr_set_const($db,'AGENDA_DISABLE_EXT',$disableext,'chaine',0);
|
||||
|
||||
$i=1;
|
||||
$i=1; $errorsaved=0;
|
||||
$error=0;
|
||||
|
||||
// Save agendas
|
||||
while ($i <= $MAXAGENDA)
|
||||
{
|
||||
$color=trim(GETPOST('agenda_ext_color'.$i,'alpha'));
|
||||
if ($color=='-1') $color='';
|
||||
|
||||
$name=trim(GETPOST('agenda_ext_name'.$i),'alpha');
|
||||
$src=trim(GETPOST('agenda_ext_src'.$i,'alpha'));
|
||||
$color=trim(GETPOST('agenda_ext_color'.$i,'alpha'));
|
||||
if ($color=='-1') $color='';
|
||||
|
||||
if (! empty($src) && ! preg_match('/^(http\s*|ftp\s*):/', $src))
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorParamMustBeAnUrl"),'errors');
|
||||
$error++;
|
||||
$errorsaved++;
|
||||
break;
|
||||
}
|
||||
|
||||
//print 'color='.$color;
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_NAME'.$i,trim(GETPOST('agenda_ext_name'.$i),'alpha'),'chaine',0);
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_NAME'.$i,$name,'chaine',0);
|
||||
if (! $res > 0) $error++;
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_SRC'.$i,trim(GETPOST('agenda_ext_src'.$i,'alpha')),'chaine',0);
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_SRC'.$i,$src,'chaine',0);
|
||||
if (! $res > 0) $error++;
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_COLOR'.$i,$color,'chaine',0);
|
||||
if (! $res > 0) $error++;
|
||||
$i++;
|
||||
}
|
||||
|
||||
// Save nb of agenda
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST('AGENDA_EXT_NB','alpha')),'chaine',0);
|
||||
if (! $res > 0) $error++;
|
||||
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
|
||||
$MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST('AGENDA_EXT_NB','alpha')),'chaine',0);
|
||||
if (! $res > 0) $error++;
|
||||
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
|
||||
$MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
@ -89,7 +103,7 @@ if ($actionsave)
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
if (empty($errorsaved)) $mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
}
|
||||
|
||||
@ -156,18 +170,22 @@ $var=true;
|
||||
while ($i <= $MAXAGENDA)
|
||||
{
|
||||
$key=$i;
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td width="180" nowrap="nowrap">'.$langs->trans("AgendaExtNb",$key)."</td>";
|
||||
$name='AGENDA_EXT_NAME'.$key;
|
||||
$src='AGENDA_EXT_SRC'.$key;
|
||||
$color='AGENDA_EXT_COLOR'.$key;
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"agenda_ext_name".$key."\" value=\"". $conf->global->$name . "\" size=\"28\"></td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"agenda_ext_src".$key."\" value=\"". $conf->global->$src . "\" size=\"60\"></td>";
|
||||
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
// Nb
|
||||
print '<td width="180" nowrap="nowrap">'.$langs->trans("AgendaExtNb",$key)."</td>";
|
||||
// Name
|
||||
print '<td><input type="text" class="flat" name="agenda_ext_name'.$key.'" value="'. (GETPOST('agenda_ext_name'.$key)?GETPOST('agenda_ext_name'.$key):$conf->global->$name) . '" size="28"></td>';
|
||||
// URL
|
||||
print '<td><input type="url" class="flat" name="agenda_ext_src'.$key.'" value="'. (GETPOST('agenda_ext_src'.$key)?GETPOST('agenda_ext_src'.$key):$conf->global->$src) . '" size="60"></td>';
|
||||
// Color (Possible colors are limited by Google)
|
||||
print '<td nowrap="nowrap" align="center">';
|
||||
// Possible colors are limited by Google
|
||||
//print $formadmin->select_colors($conf->global->$color, "google_agenda_color".$key, $colorlist);
|
||||
print $formother->select_color($conf->global->$color, "agenda_ext_color".$key, 'extsitesconfig', 1, '');
|
||||
print $formother->select_color((GETPOST("agenda_ext_color".$key)?GETPOST("agenda_ext_color".$key):$conf->global->$color), "agenda_ext_color".$key, 'extsitesconfig', 1, '');
|
||||
print '</td>';
|
||||
print "</tr>";
|
||||
$i++;
|
||||
@ -187,7 +205,8 @@ dol_fiche_end();
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
@ -71,6 +71,7 @@ $hookmanager->initHooks(array('admin'));
|
||||
|
||||
// Sort order to show dictionnary (0 is space). All other dictionnaries (added by modules) will be at end of this.
|
||||
$taborder=array(9,0,4,3,2,0,1,8,19,16,0,5,11,0,6,0,10,12,13,0,14,0,7,17,0,22,20,18,21,0,15,0,24,23);
|
||||
if (! empty($conf->global->MAIN_USE_REVENUESTAMP)) $taborder=array(9,0,4,3,2,0,1,8,19,16,0,5,11,0,6,0,10,25,12,13,0,14,0,7,17,0,22,20,18,21,0,15,0,24,23);
|
||||
|
||||
// Name of SQL tables of dictionnaries
|
||||
$tabname=array();
|
||||
@ -98,6 +99,7 @@ $tabname[21]= MAIN_DB_PREFIX."c_availability";
|
||||
$tabname[22]= MAIN_DB_PREFIX."c_input_reason";
|
||||
$tabname[23]= MAIN_DB_PREFIX."accountingaccount";
|
||||
$tabname[24]= MAIN_DB_PREFIX."accounting_system";
|
||||
$tabname[25]= MAIN_DB_PREFIX."c_revenuestamp";
|
||||
|
||||
// Dictionary labels
|
||||
$tablib=array();
|
||||
@ -124,7 +126,8 @@ $tablib[20]= "DictionnaryOrderMethods";
|
||||
$tablib[21]= "DictionnaryAvailability";
|
||||
$tablib[22]= "DictionnarySource";
|
||||
$tablib[23]= "DictionnaryAccountancyplan";
|
||||
$tablib[24]= "DictionnaryAccountancysystem";
|
||||
$tablib[24]= "DictionnaryAccountancysystem";
|
||||
$tablib[25]= "DictionnaryRevenueStamp";
|
||||
|
||||
// Requete pour extraction des donnees des dictionnaires
|
||||
$tabsql=array();
|
||||
@ -151,7 +154,8 @@ $tabsql[20]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREF
|
||||
$tabsql[21]= "SELECT c.rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_availability AS c";
|
||||
$tabsql[22]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason";
|
||||
$tabsql[23]= "SELECT rowid as rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number as accountancy_code, account_parent, label, active FROM ".MAIN_DB_PREFIX."accountingaccount";
|
||||
$tabsql[24]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as country_id, p.code as country_code, p.libelle as pays, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_pays as p WHERE s.fk_pays=p.rowid and p.active=1";
|
||||
$tabsql[24]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as country_id, p.code as country_code, p.libelle as pays, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_pays as p WHERE s.fk_pays=p.rowid and p.active=1";
|
||||
$tabsql[25]= "SELECT t.rowid, t.taux, p.libelle as country, p.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, llx_c_pays as p WHERE t.fk_pays=p.rowid";
|
||||
|
||||
// Critere de tri du dictionnaire
|
||||
$tabsqlsort=array();
|
||||
@ -178,7 +182,8 @@ $tabsqlsort[20]="code ASC, libelle ASC";
|
||||
$tabsqlsort[21]="code ASC, label ASC";
|
||||
$tabsqlsort[22]="code ASC, label ASC";
|
||||
$tabsqlsort[23]="fk_pcg_version ASC, accountancy_code ASC";
|
||||
$tabsqlsort[24]="pcg_version ASC";
|
||||
$tabsqlsort[24]="pcg_version ASC";
|
||||
$tabsqlsort[25]="country ASC, taux ASC";
|
||||
|
||||
// Nom des champs en resultat de select pour affichage du dictionnaire
|
||||
$tabfield=array();
|
||||
@ -205,7 +210,8 @@ $tabfield[20]= "code,libelle";
|
||||
$tabfield[21]= "code,label";
|
||||
$tabfield[22]= "code,label";
|
||||
$tabfield[23]= "fk_pcg_version,accountancy_code,account_parent,pcg_type,pcg_subtype,label";
|
||||
$tabfield[24]= "pcg_version,country_id,country,label";
|
||||
$tabfield[24]= "pcg_version,country_id,country,label";
|
||||
$tabfield[25]= "country_id,country,taux,accountancy_code_sell,accountancy_code_buy,note";
|
||||
|
||||
// Nom des champs d'edition pour modification d'un enregistrement
|
||||
$tabfieldvalue=array();
|
||||
@ -232,7 +238,8 @@ $tabfieldvalue[20]= "code,libelle";
|
||||
$tabfieldvalue[21]= "code,label";
|
||||
$tabfieldvalue[22]= "code,label";
|
||||
$tabfieldvalue[23]= "fk_pcg_version,accountancy_code,account_parent,pcg_type,pcg_subtype,label";
|
||||
$tabfieldvalue[24]= "pcg_version,country,label";
|
||||
$tabfieldvalue[24]= "pcg_version,country,label";
|
||||
$tabfieldvalue[25]= "country,taux,accountancy_code_sell,accountancy_code_buy,note";
|
||||
|
||||
// Nom des champs dans la table pour insertion d'un enregistrement
|
||||
$tabfieldinsert=array();
|
||||
@ -259,7 +266,8 @@ $tabfieldinsert[20]= "code,libelle";
|
||||
$tabfieldinsert[21]= "code,label";
|
||||
$tabfieldinsert[22]= "code,label";
|
||||
$tabfieldinsert[23]= "fk_pcg_version,account_number,account_parent,pcg_type,pcg_subtype,label";
|
||||
$tabfieldinsert[24]= "pcg_version,fk_pays,label";
|
||||
$tabfieldinsert[24]= "pcg_version,fk_pays,label";
|
||||
$tabfieldinsert[25]= "fk_pays,taux,accountancy_code_sell,accountancy_code_buy,note";
|
||||
|
||||
// Nom du rowid si le champ n'est pas de type autoincrement
|
||||
// Example: "" if id field is "rowid" and has autoincrement on
|
||||
@ -288,7 +296,8 @@ $tabrowid[20]= "";
|
||||
$tabrowid[21]= "rowid";
|
||||
$tabrowid[22]= "rowid";
|
||||
$tabrowid[23]= "";
|
||||
$tabrowid[24]= "";
|
||||
$tabrowid[24]= "";
|
||||
$tabrowid[25]= "";
|
||||
|
||||
// Condition to show dictionnary in setup page
|
||||
$tabcond=array();
|
||||
@ -315,7 +324,8 @@ $tabcond[20]= ! empty($conf->fournisseur->enabled);
|
||||
$tabcond[21]= ! empty($conf->propal->enabled);
|
||||
$tabcond[22]= (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled));
|
||||
$tabcond[23]= (! empty($conf->global->ACCOUNTING_USEDICTTOEDIT) && ! empty($conf->accounting->enabled)); // The accountancy plan should be edited with specific pages. You can set ACCOUNTING_USEDICTTOEDIT to 1 if you want to use dictionnary editor.
|
||||
$tabcond[24]= (! empty($conf->global->ACCOUNTING_USEDICTTOEDIT) && ! empty($conf->accounting->enabled)); // The accountancy system should be edited with specific pages. You can set ACCOUNTING_USEDICTTOEDIT to 1 if you want to use dictionnary editor.
|
||||
$tabcond[24]= (! empty($conf->global->ACCOUNTING_USEDICTTOEDIT) && ! empty($conf->accounting->enabled)); // The accountancy system should be edited with specific pages. You can set ACCOUNTING_USEDICTTOEDIT to 1 if you want to use dictionnary editor.
|
||||
$tabcond[25]= (! empty($conf->global->MAIN_USE_REVENUESTAMP)); // The accountancy system should be edited with specific pages. You can set ACCOUNTING_USEDICTTOEDIT to 1 if you want to use dictionnary editor.
|
||||
|
||||
// List of help for fields
|
||||
$tabhelp=array();
|
||||
@ -342,7 +352,8 @@ $tabhelp[20] = array();
|
||||
$tabhelp[21] = array();
|
||||
$tabhelp[22] = array();
|
||||
$tabhelp[23] = array();
|
||||
$tabhelp[24] = array();
|
||||
$tabhelp[24] = array();
|
||||
$tabhelp[25] = array();
|
||||
|
||||
// Complete all arrays with entries found into modules
|
||||
complete_dictionnary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp);
|
||||
@ -717,7 +728,11 @@ if ($id)
|
||||
$align="left";
|
||||
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
|
||||
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
|
||||
if ($fieldlist[$field]=='taux') { $valuetoshow=$langs->trans("Rate"); }
|
||||
if ($fieldlist[$field]=='taux') {
|
||||
if ($tabname[$id] != MAIN_DB_PREFIX."c_revenuestamp") $valuetoshow=$langs->trans("Rate");
|
||||
else $valuetoshow=$langs->trans("Amount");
|
||||
$align='right';
|
||||
}
|
||||
if ($fieldlist[$field]=='localtax1_type') { $valuetoshow=$form->textwithtooltip($langs->trans("UseLocalTax")." 2",$langs->trans("LocalTaxDesc"),2,1,img_help(1,'')); $align="center"; $sortable=0; }
|
||||
if ($fieldlist[$field]=='localtax1') { $valuetoshow=$langs->trans("Rate")." 2";}
|
||||
if ($fieldlist[$field]=='localtax2_type') { $valuetoshow=$form->textwithtooltip($langs->trans("UseLocalTax")." 3",$langs->trans("LocalTaxDesc"),2,1,img_help(1,'')); $align="center"; $sortable=0; }
|
||||
@ -834,7 +849,11 @@ if ($id)
|
||||
$valuetoshow=$langs->trans($valuetoshow); // try to translate
|
||||
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
|
||||
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
|
||||
if ($fieldlist[$field]=='taux') { $valuetoshow=$langs->trans("Rate"); }
|
||||
if ($fieldlist[$field]=='taux') {
|
||||
if ($tabname[$id] != MAIN_DB_PREFIX."c_revenuestamp") $valuetoshow=$langs->trans("Rate");
|
||||
else $valuetoshow=$langs->trans("Amount");
|
||||
$align='right';
|
||||
}
|
||||
if ($fieldlist[$field]=='localtax1_type') { $valuetoshow=$form->textwithtooltip($langs->trans("UseLocalTax")." 2",$langs->trans("LocalTaxDesc"),2,1,img_help(1,'')); $align="center"; $sortable=0; }
|
||||
if ($fieldlist[$field]=='localtax1') { $valuetoshow=$langs->trans("Rate")." 2"; $sortable=0; }
|
||||
if ($fieldlist[$field]=='localtax2_type') { $valuetoshow=$form->textwithtooltip($langs->trans("UseLocalTax")." 3",$langs->trans("LocalTaxDesc"),2,1,img_help(1,'')); $align="center"; $sortable=0; }
|
||||
|
||||
111
htdocs/admin/ecm.php
Normal file
111
htdocs/admin/ecm.php
Normal file
@ -0,0 +1,111 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/ecm.php
|
||||
* \ingroup core
|
||||
* \brief Page to setup ECM (GED) module
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
|
||||
$langs->load("admin");
|
||||
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
|
||||
/*
|
||||
* Action
|
||||
*/
|
||||
if (preg_match('/set_(.*)/',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
if (preg_match('/del_(.*)/',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$help_url='';
|
||||
llxHeader('',$langs->trans("ECMSetup"),$help_url);
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print_fiche_titre($langs->trans("ECMSetup"),$linkback,'setup');
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="center" width="20"> </td>';
|
||||
print '<td align="center" width="100">'.$langs->trans("Value").'</td>'."\n";
|
||||
print '</tr>';
|
||||
|
||||
$var=true;
|
||||
$form = new Form($db);
|
||||
|
||||
// Mail required for members
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("ECMAutoTree").'</td>';
|
||||
print '<td align="center" width="20"> </td>';
|
||||
|
||||
print '<td align="center" width="100">';
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print ajax_constantonoff('ECM_AUTO_TREE_ENABLED');
|
||||
}
|
||||
else
|
||||
{
|
||||
if($conf->global->ECM_AUTO_TREE_ENABLED == 0)
|
||||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_ECM_AUTO_TREE_ENABLED">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
else if($conf->global->USER_MAIL_REQUIRED == 1)
|
||||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_ECM_AUTO_TREE_ENABLED">'.img_picto($langs->trans("Enabled"),'on').'</a>';
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
@ -131,7 +131,6 @@ print "</tr>\n";
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("ConnectionTimeout").'</td><td align="right">';
|
||||
//print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor")));
|
||||
print '</td>';
|
||||
print '<td nowrap="nowrap">';
|
||||
print '<input class="flat" name="MAIN_USE_CONNECT_TIMEOUT" type="text" size="4" value="'.(isset($_POST["MAIN_USE_CONNECT_TIMEOUT"])?GETPOST("MAIN_USE_CONNECT_TIMEOUT"):$conf->global->MAIN_USE_CONNECT_TIMEOUT).'">';
|
||||
@ -142,7 +141,6 @@ print '</tr>';
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("ResponseTimeout").'</td><td align="right">';
|
||||
//print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor")));
|
||||
print '</td>';
|
||||
print '<td nowrap="nowrap">';
|
||||
print '<input class="flat" name="MAIN_USE_RESPONSE_TIMEOUT" type="text" size="4" value="'.$conf->global->MAIN_USE_RESPONSE_TIMEOUT.'">';
|
||||
@ -153,7 +151,6 @@ print '</tr>';
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("MAIN_PROXY_USE").'</td><td align="right">';
|
||||
//print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor")));
|
||||
print '</td>';
|
||||
print '<td nowrap="nowrap">';
|
||||
print $form->selectyesno('MAIN_PROXY_USE',$conf->global->MAIN_PROXY_USE,1);
|
||||
@ -163,7 +160,6 @@ print '</tr>';
|
||||
$var=!$var;
|
||||
print '<tr '.$bcdd[$var].'>';
|
||||
print '<td>'.$langs->trans("MAIN_PROXY_HOST").'</td><td align="right">';
|
||||
//print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor")));
|
||||
print '</td>';
|
||||
print '<td nowrap="nowrap">';
|
||||
print '<input class="flat" name="MAIN_PROXY_HOST" type="text" size="16" value="'.$conf->global->MAIN_PROXY_HOST.'">';
|
||||
@ -173,7 +169,6 @@ print '</tr>';
|
||||
$var=!$var;
|
||||
print '<tr '.$bcdd[$var].'>';
|
||||
print '<td>'.$langs->trans("MAIN_PROXY_PORT").'</td><td align="right">';
|
||||
//print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor")));
|
||||
print '</td>';
|
||||
print '<td nowrap="nowrap">';
|
||||
print '<input class="flat" name="MAIN_PROXY_PORT" type="text" size="4" value="'.$conf->global->MAIN_PROXY_PORT.'">';
|
||||
@ -183,7 +178,6 @@ print '</tr>';
|
||||
$var=!$var;
|
||||
print '<tr '.$bcdd[$var].'>';
|
||||
print '<td>'.$langs->trans("MAIN_PROXY_USER").'</td><td align="right">';
|
||||
//print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor")));
|
||||
print '</td>';
|
||||
print '<td nowrap="nowrap">';
|
||||
print '<input class="flat" name="MAIN_PROXY_USER" type="text" size="16" value="'.$conf->global->MAIN_PROXY_USER.'">';
|
||||
@ -193,7 +187,6 @@ print '</tr>';
|
||||
$var=!$var;
|
||||
print '<tr '.$bcdd[$var].'>';
|
||||
print '<td>'.$langs->trans("MAIN_PROXY_PASS").'</td><td align="right">';
|
||||
//print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor")));
|
||||
print '</td>';
|
||||
print '<td nowrap="nowrap">';
|
||||
print '<input class="flat" name="MAIN_PROXY_PASS" type="text" size="16" value="'.$conf->global->MAIN_PROXY_PASS.'">';
|
||||
|
||||
@ -146,7 +146,8 @@ print '<td width="100"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$var=!$var;
|
||||
if (empty($conf->global->MAIN_SESSION_TIMEOUT)) $conf->global->MAIN_SESSION_TIMEOUT=ini_get("session.gc_maxlifetime");
|
||||
$sessiontimeout=ini_get("session.gc_maxlifetime");
|
||||
if (empty($conf->global->MAIN_SESSION_TIMEOUT)) $conf->global->MAIN_SESSION_TIMEOUT=$sessiontimeout;
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?action=MAIN_SESSION_TIMEOUT" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr '.$bc[$var].'>';
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 Roman Ozana <ozana@omdesign.cz>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -55,9 +55,15 @@ class ICal
|
||||
function read_file($file)
|
||||
{
|
||||
$this->file = $file;
|
||||
$file_text = join("", file($file)); //load file
|
||||
$file_text = preg_replace("/[\r\n]{1,} ([:;])/","\\1",$file_text);
|
||||
|
||||
$file_text='';
|
||||
|
||||
$tmparray=file($file);
|
||||
if (is_array($tmparray))
|
||||
{
|
||||
$file_text = join("", $tmparray); //load file
|
||||
$file_text = preg_replace("/[\r\n]{1,} ([:;])/","\\1",$file_text);
|
||||
}
|
||||
|
||||
return $file_text; // return all text
|
||||
}
|
||||
|
||||
|
||||
@ -731,16 +731,16 @@ else if ($action == "addline" && $user->rights->propal->creer)
|
||||
|
||||
$desc=dol_concatdesc($desc,$product_desc);
|
||||
|
||||
// Add custom code and origin country into description
|
||||
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code)))
|
||||
{
|
||||
$tmptxt='(';
|
||||
if (! empty($prod->customcode)) $tmptxt.=$langs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode;
|
||||
if (! empty($prod->customcode) && ! empty($prod->country_code)) $tmptxt.=' - ';
|
||||
if (! empty($prod->country_code)) $tmptxt.=$langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code,0,$db,$langs,0);
|
||||
$tmptxt.=')';
|
||||
$desc.= dol_concatdesc($desc, $tmptxt);
|
||||
}
|
||||
// Add custom code and origin country into description
|
||||
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code)))
|
||||
{
|
||||
$tmptxt='(';
|
||||
if (! empty($prod->customcode)) $tmptxt.=$langs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode;
|
||||
if (! empty($prod->customcode) && ! empty($prod->country_code)) $tmptxt.=' - ';
|
||||
if (! empty($prod->country_code)) $tmptxt.=$langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code,0,$db,$langs,0);
|
||||
$tmptxt.=')';
|
||||
$desc= dol_concatdesc($desc, $tmptxt);
|
||||
}
|
||||
}
|
||||
|
||||
$type = $prod->type;
|
||||
@ -1180,37 +1180,6 @@ if ($action == 'create')
|
||||
|
||||
$object = new Propal($db);
|
||||
|
||||
$numpr='';
|
||||
$obj = $conf->global->PROPALE_ADDON;
|
||||
if ($obj)
|
||||
{
|
||||
if (! empty($conf->global->PROPALE_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php"))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.'.php';
|
||||
$modPropale = new $obj;
|
||||
$numpr = $modPropale->getNextValue($soc,$object);
|
||||
}
|
||||
}
|
||||
|
||||
// Fix pour modele numerotation qui deconne
|
||||
// Si numero deja pris (ne devrait pas arriver), on incremente par .num+1
|
||||
$sql = "SELECT count(*) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."propal";
|
||||
$sql.= " WHERE ref LIKE '".$numpr."%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj=$db->fetch_object($resql);
|
||||
$num = $obj->nb;
|
||||
$db->free($resql);
|
||||
if ($num > 0)
|
||||
{
|
||||
$numpr .= "." . ($num + 1);
|
||||
}
|
||||
}
|
||||
|
||||
print '<form name="addprop" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
@ -1222,12 +1191,9 @@ if ($action == 'create')
|
||||
}
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Ref").'</td>';
|
||||
print '<td colspan="2">'.$numpr.'</td>';
|
||||
print '<input type="hidden" name="ref" value="'.$numpr.'">';
|
||||
print '</tr>';
|
||||
|
||||
// Reference
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Ref').'</td><td colspan="2">'.$langs->trans("Draft").'</td></tr>';
|
||||
|
||||
// Ref customer
|
||||
print '<tr><td>'.$langs->trans('RefCustomer').'</td><td colspan="2">';
|
||||
@ -1990,10 +1956,10 @@ else
|
||||
if ($action != 'statut' && $action <> 'editline')
|
||||
{
|
||||
// Validate
|
||||
if ($object->statut == 0 && $user->rights->propal->valider)
|
||||
if ($object->statut == 0 && $object->total_ttc >= 0 && count($object->lines) > 0 && $user->rights->propal->valider)
|
||||
{
|
||||
if (count($object->lines) > 0) print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=validate">'.$langs->trans('Validate').'</a>';
|
||||
else print '<a class="butActionRefused" href="#">'.$langs->trans('Validate').'</a>';
|
||||
//else print '<a class="butActionRefused" href="#">'.$langs->trans('Validate').'</a>';
|
||||
}
|
||||
|
||||
// Edit
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
*
|
||||
@ -720,7 +720,7 @@ class Propal extends CommonObject
|
||||
|
||||
if ($this->id)
|
||||
{
|
||||
if (empty($this->ref)) $this->ref='(PROV'.$this->id.')';
|
||||
$this->ref='(PROV'.$this->id.')';
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."propal SET ref='".$this->ref."' WHERE rowid=".$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::create sql=".$sql);
|
||||
@ -1178,11 +1178,29 @@ class Propal extends CommonObject
|
||||
$now=dol_now();
|
||||
|
||||
if ($user->rights->propale->valider)
|
||||
{
|
||||
{
|
||||
$this->db->begin();
|
||||
|
||||
// Numbering module definition
|
||||
$soc = new Societe($this->db);
|
||||
$soc->fetch($this->socid);
|
||||
|
||||
// Class of company linked to propal
|
||||
$result=$soc->set_as_client();
|
||||
|
||||
// Define new ref
|
||||
if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref)))
|
||||
{
|
||||
$num = $this->getNextNumRef($soc);
|
||||
}
|
||||
else
|
||||
{
|
||||
$num = $this->ref;
|
||||
}
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
|
||||
$sql.= " SET fk_statut = 1, date_valid='".$this->db->idate($now)."', fk_user_valid=".$user->id;
|
||||
$sql.= " SET ref = '".$num."',";
|
||||
$sql.= " fk_statut = 1, date_valid='".$this->db->idate($now)."', fk_user_valid=".$user->id;
|
||||
$sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0";
|
||||
|
||||
dol_syslog(get_class($this).'::valid sql='.$sql);
|
||||
|
||||
@ -657,15 +657,15 @@ else if ($action == 'addline' && $user->rights->commande->creer)
|
||||
|
||||
$desc=dol_concatdesc($desc,$product_desc);
|
||||
|
||||
// Add custom code and origin country into description
|
||||
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code)))
|
||||
{
|
||||
$tmptxt='(';
|
||||
if (! empty($prod->customcode)) $tmptxt.=$langs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode;
|
||||
if (! empty($prod->customcode) && ! empty($prod->country_code)) $tmptxt.=' - ';
|
||||
if (! empty($prod->country_code)) $tmptxt.=$langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code,0,$db,$langs,0);
|
||||
$tmptxt.=')';
|
||||
$desc.= dol_concatdesc($desc, $tmptxt);
|
||||
// Add custom code and origin country into description
|
||||
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code)))
|
||||
{
|
||||
$tmptxt='(';
|
||||
if (! empty($prod->customcode)) $tmptxt.=$langs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode;
|
||||
if (! empty($prod->customcode) && ! empty($prod->country_code)) $tmptxt.=' - ';
|
||||
if (! empty($prod->country_code)) $tmptxt.=$langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code,0,$db,$langs,0);
|
||||
$tmptxt.=')';
|
||||
$desc= dol_concatdesc($desc, $tmptxt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1121,7 +1121,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
|
||||
if (! empty($prod->customcode) && ! empty($prod->country_code)) $tmptxt.=' - ';
|
||||
if (! empty($prod->country_code)) $tmptxt.=$langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code,0,$db,$langs,0);
|
||||
$tmptxt.=')';
|
||||
$desc.= dol_concatdesc($desc, $tmptxt);
|
||||
$desc= dol_concatdesc($desc, $tmptxt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -37,10 +37,8 @@ class Contact extends CommonObject
|
||||
public $table_element='socpeople';
|
||||
|
||||
var $id;
|
||||
var $civilite_id; // In fact we stor civility_code
|
||||
var $civilite_id; // In fact we store civility_code
|
||||
var $lastname;
|
||||
var $name; // TODO deprecated
|
||||
var $nom; // TODO deprecated
|
||||
var $firstname;
|
||||
var $address;
|
||||
var $zip;
|
||||
|
||||
@ -605,11 +605,11 @@ else
|
||||
});
|
||||
|
||||
$("#copyaddressfromsoc").click(function() {
|
||||
$(\'textarea[name="address"]\').text("'.addslashes($objsoc->address).'");
|
||||
$(\'input[name="zipcode"]\').val("'.addslashes($objsoc->zip).'");
|
||||
$(\'input[name="town"]\').val("'.addslashes($objsoc->town).'");
|
||||
$(\'select[name="country_id"]\').val("'.addslashes($objsoc->country_id).'");
|
||||
$(\'select[name="state_id"]\').val("'.addslashes($objsoc->state_id).'");
|
||||
$(\'textarea[name="address"]\').text("'.dol_escape_js($objsoc->address).'");
|
||||
$(\'input[name="zipcode"]\').val("'.dol_escape_js($objsoc->zip).'");
|
||||
$(\'input[name="town"]\').val("'.dol_escape_js($objsoc->town).'");
|
||||
$(\'select[name="country_id"]\').val("'.dol_escape_js($objsoc->country_id).'");
|
||||
$(\'select[name="state_id"]\').val("'.dol_escape_js($objsoc->state_id).'");
|
||||
});
|
||||
})'."\n";
|
||||
print '</script>'."\n";
|
||||
|
||||
@ -58,7 +58,7 @@ $userid=GETPOST('userid','int');
|
||||
$begin=GETPOST('begin');
|
||||
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="p.name";
|
||||
if (! $sortfield) $sortfield="p.lastname";
|
||||
if ($page < 0) { $page = 0; }
|
||||
$limit = $conf->liste_limit;
|
||||
$offset = $limit * $page;
|
||||
@ -114,7 +114,7 @@ llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Em
|
||||
$form=new Form($db);
|
||||
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name,";
|
||||
$sql.= " p.rowid as cidp, p.name as lastname, p.firstname, p.poste, p.email,";
|
||||
$sql.= " p.rowid as cidp, p.lastname as lastname, p.firstname, p.poste, p.email,";
|
||||
$sql.= " p.phone, p.phone_mobile, p.fax, p.fk_pays, p.priv, p.tms,";
|
||||
$sql.= " cp.code as country_code";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as p";
|
||||
@ -144,7 +144,7 @@ else
|
||||
|
||||
if ($search_lastname) // filtre sur le nom
|
||||
{
|
||||
$sql .= " AND p.name LIKE '%".$db->escape($search_lastname)."%'";
|
||||
$sql .= " AND p.lastname LIKE '%".$db->escape($search_lastname)."%'";
|
||||
}
|
||||
if ($search_firstname) // filtre sur le prenom
|
||||
{
|
||||
@ -200,7 +200,7 @@ else if ($type == "p") // filtre sur type
|
||||
}
|
||||
if ($sall)
|
||||
{
|
||||
$sql .= " AND (p.name LIKE '%".$db->escape($sall)."%' OR p.firstname LIKE '%".$db->escape($sall)."%' OR p.email LIKE '%".$db->escape($sall)."%')";
|
||||
$sql .= " AND (p.lastname LIKE '%".$db->escape($sall)."%' OR p.firstname LIKE '%".$db->escape($sall)."%' OR p.email LIKE '%".$db->escape($sall)."%')";
|
||||
}
|
||||
if (! empty($socid))
|
||||
{
|
||||
@ -256,7 +256,7 @@ if ($result)
|
||||
|
||||
// Ligne des titres
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"p.name", $begin, $param, '', $sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"p.lastname", $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("PostOrFunction"),$_SERVER["PHP_SELF"],"p.poste", $begin, $param, '', $sortfield,$sortorder);
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom", $begin, $param, '', $sortfield,$sortorder);
|
||||
|
||||
@ -283,8 +283,25 @@ class Contrat extends CommonObject
|
||||
global $langs, $conf;
|
||||
|
||||
$error=0;
|
||||
|
||||
// Definition du nom de module de numerotation de commande
|
||||
$soc = new Societe($this->db);
|
||||
$soc->fetch($this->socid);
|
||||
|
||||
// Class of company linked to order
|
||||
$result=$soc->set_as_client();
|
||||
|
||||
// Define new ref
|
||||
if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref)))
|
||||
{
|
||||
$num = $this->getNextNumRef($soc);
|
||||
}
|
||||
else
|
||||
{
|
||||
$num = $this->ref;
|
||||
}
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."contrat SET statut = 1";
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."contrat SET ref = '".$num."', statut = 1";
|
||||
$sql .= " WHERE rowid = ".$this->id . " AND statut = 0";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
@ -647,6 +664,16 @@ class Contrat extends CommonObject
|
||||
$error=0;
|
||||
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."contrat");
|
||||
|
||||
// Mise a jour ref
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."contrat SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id;
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
if ($this->id)
|
||||
{
|
||||
$this->ref="(PROV".$this->id.")";
|
||||
}
|
||||
}
|
||||
|
||||
// Insert contacts commerciaux ('SALESREPSIGN','contrat')
|
||||
$result=$this->add_contact($this->commercial_signature_id,'SALESREPSIGN','internal');
|
||||
|
||||
@ -158,27 +158,35 @@ if (GETPOST('remonth') && GETPOST('reday') && GETPOST('reyear'))
|
||||
|
||||
if ($action == 'add' && $user->rights->contrat->creer)
|
||||
{
|
||||
$object->socid = $socid;
|
||||
$object->date_contrat = $datecontrat;
|
||||
|
||||
// Check
|
||||
if (empty($datecontrat))
|
||||
{
|
||||
$error++;
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")).'</div>';
|
||||
$action='create';
|
||||
}
|
||||
|
||||
if ($socid<1)
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Customer")),'errors');
|
||||
$action='create';
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$object->socid = $socid;
|
||||
$object->date_contrat = $datecontrat;
|
||||
|
||||
$object->commercial_suivi_id = GETPOST('commercial_suivi_id','int');
|
||||
$object->commercial_signature_id = GETPOST('commercial_signature_id','int');
|
||||
$object->commercial_suivi_id = GETPOST('commercial_suivi_id','int');
|
||||
$object->commercial_signature_id = GETPOST('commercial_signature_id','int');
|
||||
|
||||
$object->note = GETPOST('note','alpha');
|
||||
$object->fk_project = GETPOST('projectid','int');
|
||||
$object->remise_percent = GETPOST('remise_percent','alpha');
|
||||
$object->ref = GETPOST('ref','alpha');
|
||||
$object->note = GETPOST('note','alpha');
|
||||
$object->fk_project = GETPOST('projectid','int');
|
||||
$object->remise_percent = GETPOST('remise_percent','alpha');
|
||||
$object->ref = GETPOST('ref','alpha');
|
||||
|
||||
// Check
|
||||
if (empty($datecontrat))
|
||||
{
|
||||
$error++;
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")).'</div>';
|
||||
$action='create';
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$result = $object->create($user,$langs,$conf);
|
||||
if ($result > 0)
|
||||
{
|
||||
@ -612,7 +620,7 @@ if ($action == 'create')
|
||||
dol_htmloutput_errors($mesg,'');
|
||||
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($socid);
|
||||
if ($socid>0) $soc->fetch($socid);
|
||||
|
||||
$object->date_contrat = dol_now();
|
||||
|
||||
@ -628,22 +636,39 @@ if ($action == 'create')
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td>'.$langs->trans("Ref").'</td>';
|
||||
print '<td><input type="text" maxlength="30" name="ref" size="20" value="'.$numct.'"></td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Ref').'</td><td colspan="2">'.$langs->trans("Draft").'</td></tr>';
|
||||
|
||||
// Customer
|
||||
print '<tr><td>'.$langs->trans("Customer").'</td><td>'.$soc->getNomUrl(1).'</td></tr>';
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired">'.$langs->trans('Customer').'</td>';
|
||||
if($socid>0)
|
||||
{
|
||||
print '<td colspan="2">';
|
||||
print $soc->getNomUrl(1);
|
||||
print '<input type="hidden" name="socid" value="'.$soc->id.'">';
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td colspan="2">';
|
||||
print $form->select_company('','socid','s.client = 1',1);
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
// Ligne info remises tiers
|
||||
print '<tr><td>'.$langs->trans('Discount').'</td><td>';
|
||||
if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client);
|
||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||
$absolute_discount=$soc->getAvailableDiscounts();
|
||||
print '. ';
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency));
|
||||
else print $langs->trans("CompanyHasNoAbsoluteDiscount");
|
||||
print '.';
|
||||
print '</td></tr>';
|
||||
if($socid>0)
|
||||
{
|
||||
// Ligne info remises tiers
|
||||
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="2">';
|
||||
if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client);
|
||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||
print '. ';
|
||||
$absolute_discount=$soc->getAvailableDiscounts();
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency));
|
||||
else print $langs->trans("CompanyHasNoAbsoluteDiscount");
|
||||
print '.';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Commercial suivi
|
||||
print '<tr><td width="20%" nowrap><span class="fieldrequired">'.$langs->trans("TypeContact_contrat_internal_SALESREPFOLL").'</span></td><td>';
|
||||
@ -760,8 +785,19 @@ else
|
||||
*/
|
||||
if ($action == 'valid')
|
||||
{
|
||||
//$numfa = contrat_get_num($soc);
|
||||
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("ValidateAContract"),$langs->trans("ConfirmValidateContract"),"confirm_valid",'',0,1);
|
||||
$ref = substr($object->ref, 1, 4);
|
||||
if ($ref == 'PROV')
|
||||
{
|
||||
$numref = $object->getNextNumRef($soc);
|
||||
}
|
||||
else
|
||||
{
|
||||
$numref = $object->ref;
|
||||
}
|
||||
|
||||
$text=$langs->trans('ConfirmValidateContract',$numref);
|
||||
|
||||
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("ValidateAContract"),$text,"confirm_valid",'',0,1);
|
||||
if ($ret == 'html') print '<br>';
|
||||
}
|
||||
|
||||
|
||||
@ -331,7 +331,7 @@ if ($result)
|
||||
$var=!$var;
|
||||
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td width="100" nowrap="nowrap">';
|
||||
print '<td width="110" nowrap="nowrap">';
|
||||
$staticcontrat->ref=($obj->ref?$obj->ref:$obj->cid);
|
||||
$staticcontrat->id=$obj->cid;
|
||||
print $staticcontrat->getNomUrl(1,16);
|
||||
@ -397,7 +397,7 @@ if ($resql)
|
||||
$obj = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td width="100" nowrap="nowrap">';
|
||||
print '<td width="110" nowrap="nowrap">';
|
||||
$staticcontrat->ref=($obj->ref?$obj->ref:$obj->fk_contrat);
|
||||
$staticcontrat->id=$obj->fk_contrat;
|
||||
print $staticcontrat->getNomUrl(1,16);
|
||||
@ -478,7 +478,7 @@ if ($resql)
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
|
||||
print '<td width="100" nowrap="nowrap">';
|
||||
print '<td width="110" nowrap="nowrap">';
|
||||
$staticcontrat->ref=($obj->ref?$obj->ref:$obj->fk_contrat);
|
||||
$staticcontrat->id=$obj->fk_contrat;
|
||||
print $staticcontrat->getNomUrl(1,16);
|
||||
@ -558,7 +558,7 @@ if ($resql)
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
|
||||
print '<td width="100" nowrap="nowrap">';
|
||||
print '<td width="110" nowrap="nowrap">';
|
||||
$staticcontrat->ref=($obj->ref?$obj->ref:$obj->fk_contrat);
|
||||
$staticcontrat->id=$obj->fk_contrat;
|
||||
print $staticcontrat->getNomUrl(1,16);
|
||||
|
||||
@ -335,7 +335,7 @@ abstract class CommonObject
|
||||
$sql = "SELECT ec.rowid, ec.statut, ec.fk_socpeople as id"; // This field contains id of llx_socpeople or id of llx_user
|
||||
if ($source == 'internal') $sql.=", '-1' as socid";
|
||||
if ($source == 'external' || $source == 'thirdparty') $sql.=", t.fk_soc as socid";
|
||||
$sql.= ", t.civilite as civility, t.name as lastname, t.firstname, t.email";
|
||||
$sql.= ", t.civilite as civility, t.lastname as lastname, t.firstname, t.email";
|
||||
$sql.= ", tc.source, tc.element, tc.code, tc.libelle";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_type_contact tc";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."element_contact ec";
|
||||
@ -348,7 +348,7 @@ abstract class CommonObject
|
||||
if ($source == 'external' || $source == 'thirdparty') $sql.= " AND tc.source = 'external'";
|
||||
$sql.= " AND tc.active=1";
|
||||
if ($statut >= 0) $sql.= " AND ec.statut = '".$statut."'";
|
||||
$sql.=" ORDER BY t.name ASC";
|
||||
$sql.=" ORDER BY t.lastname ASC";
|
||||
|
||||
dol_syslog(get_class($this)."::liste_contact sql=".$sql);
|
||||
$resql=$this->db->query($sql);
|
||||
@ -722,9 +722,10 @@ abstract class CommonObject
|
||||
* @param string $table To force other table element or element line
|
||||
* @param int $id To force other object id
|
||||
* @param string $format Data format ('text' by default, 'date')
|
||||
* @param string $id_field To force rowid field name
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function setValueFrom($field, $value, $table='', $id='', $format='text')
|
||||
function setValueFrom($field, $value, $table='', $id='', $format='text', $id_field='rowid')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -736,7 +737,7 @@ abstract class CommonObject
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$table." SET ";
|
||||
if ($format == 'text') $sql.= $field." = '".$this->db->escape($value)."'";
|
||||
else if ($format == 'date') $sql.= $field." = '".$this->db->idate($value)."'";
|
||||
$sql.= " WHERE rowid = ".$id;
|
||||
$sql.= " WHERE ".$id_field." = ".$id;
|
||||
|
||||
dol_syslog(get_class($this)."::setValueFrom sql=".$sql, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
@ -54,7 +54,7 @@ class Menu
|
||||
* @param string $url Url to follow on click
|
||||
* @param string $titre Label of menu to add
|
||||
* @param string $level Level of menu to add
|
||||
* @param int $enabled Menu active or not
|
||||
* @param int $enabled Menu active or not (0=Not active, 1=Active, 2=Active but grey)
|
||||
* @param string $target Target lien
|
||||
* @param string $mainmenu Main menu ('home', 'companies', 'products', ...)
|
||||
* @param string $leftmenu Left menu ('setup', 'system', 'admintools', ...)
|
||||
|
||||
@ -508,6 +508,7 @@ class DoliDBMssql
|
||||
function plimit($limit=0,$offset=0)
|
||||
{
|
||||
global $conf;
|
||||
if (empty($limit)) return "";
|
||||
if ($limit < 0) $limit=$conf->liste_limit;
|
||||
if ($offset > 0) return " LIMIT $offset,$limit ";
|
||||
else return " LIMIT $limit ";
|
||||
|
||||
@ -488,6 +488,7 @@ class DoliDBMysql
|
||||
function plimit($limit=0,$offset=0)
|
||||
{
|
||||
global $conf;
|
||||
if (empty($limit)) return "";
|
||||
if ($limit < 0) $limit=$conf->liste_limit;
|
||||
if ($offset > 0) return " LIMIT $offset,$limit ";
|
||||
else return " LIMIT $limit ";
|
||||
|
||||
@ -490,6 +490,7 @@ class DoliDBMysqli
|
||||
function plimit($limit=0,$offset=0)
|
||||
{
|
||||
global $conf;
|
||||
if (empty($limit)) return "";
|
||||
if ($limit < 0) $limit=$conf->liste_limit;
|
||||
if ($offset > 0) return " LIMIT $offset,$limit ";
|
||||
else return " LIMIT $limit ";
|
||||
|
||||
@ -700,6 +700,7 @@ class DoliDBPgsql
|
||||
function plimit($limit=0,$offset=0)
|
||||
{
|
||||
global $conf;
|
||||
if (empty($limit)) return "";
|
||||
if ($limit < 0) $limit=$conf->liste_limit;
|
||||
if ($offset > 0) return " LIMIT ".$limit." OFFSET ".$offset." ";
|
||||
else return " LIMIT $limit ";
|
||||
|
||||
@ -629,6 +629,7 @@ class DoliDBSqlite
|
||||
function plimit($limit=0,$offset=0)
|
||||
{
|
||||
global $conf;
|
||||
if (empty($limit)) return "";
|
||||
if ($limit < 0) $limit=$conf->liste_limit;
|
||||
if ($offset > 0) return " LIMIT $offset,$limit ";
|
||||
else return " LIMIT $limit ";
|
||||
|
||||
@ -88,10 +88,13 @@ if (! class_exists('MenuManager'))
|
||||
}
|
||||
}
|
||||
$menumanager = new MenuManager($db, empty($user->societe_id)?0:1);
|
||||
$menumanager->loadMenu();
|
||||
|
||||
$menumanager->showmenu('jmobile');
|
||||
|
||||
print '</body></html>'."\n";
|
||||
print '</body>';
|
||||
|
||||
print '</html>'."\n";
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
|
||||
@ -491,7 +491,7 @@ function dol_strtoupper($utf8_string)
|
||||
* On Windows LOG_ERR=4, LOG_WARNING=5, LOG_NOTICE=LOG_INFO=6, LOG_DEBUG=6 si define_syslog_variables ou PHP 5.3+, 7 si dolibarr
|
||||
* On Linux LOG_ERR=3, LOG_WARNING=4, LOG_INFO=6, LOG_DEBUG=7
|
||||
* @param int $ident 1=Increase ident of 1, -1=Decrease ident of 1
|
||||
* @param string $suffixinfilename When output is a file, append this suffix into default log filename.
|
||||
* @param string $suffixinfilename When output is a file, append this suffix into default log filename.
|
||||
* @return void
|
||||
*/
|
||||
function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename='')
|
||||
@ -706,7 +706,7 @@ function dol_format_address($object)
|
||||
$ret.="\n".$object->state;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
else // Other: title firstname name \n address lines \n zip town \n country
|
||||
{
|
||||
$ret .= ($ret ? "\n" : '' ).$object->zip;
|
||||
@ -1646,32 +1646,33 @@ function img_picto($alt, $picto, $options = '', $pictoisfullpath = false)
|
||||
global $conf;
|
||||
|
||||
// Define fullpathpicto to use into src
|
||||
if ($pictoisfullpath) {
|
||||
if ($pictoisfullpath)
|
||||
{
|
||||
// Clean parameters
|
||||
if (! preg_match('/(\.png|\.gif)$/i',$picto))
|
||||
$picto .= '.png';
|
||||
if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto .= '.png';
|
||||
$fullpathpicto = $picto;
|
||||
}
|
||||
else
|
||||
{
|
||||
// By default, we search into theme directory
|
||||
// By default, we search $url/theme/$theme/img/$picto
|
||||
$url = DOL_URL_ROOT;
|
||||
$path = 'theme/'.$conf->theme;
|
||||
if (! empty($conf->global->MAIN_FORCETHEMEDIR))
|
||||
$path = preg_replace('/^\//', '', $conf->global->MAIN_FORCETHEMEDIR).'/'.$path;
|
||||
// If we ask an image into module/img (not into a theme path)
|
||||
$theme = $conf->theme;
|
||||
|
||||
$path = 'theme/'.$theme;
|
||||
if (! empty($conf->global->MAIN_OVERWRITE_THEME_RES)) $path = $conf->global->MAIN_OVERWRITE_THEME_RES.'/theme/'.$conf->global->MAIN_OVERWRITE_THEME_RES;
|
||||
if (! empty($conf->global->MAIN_FORCETHEMEDIR)) $path = preg_replace('/^\//', '', $conf->global->MAIN_FORCETHEMEDIR).'/'.$path; // TODO What if there is both FORCETHEMDIR and OVERWRITE_THEM_RES
|
||||
// If we ask an image into $url/$mymodule/img (instead of default path)
|
||||
if (preg_match('/^([^@]+)@([^@]+)$/i',$picto,$regs))
|
||||
{
|
||||
$picto = $regs[1];
|
||||
$path = $regs[2];
|
||||
$path = $regs[2]; // $path is $mymodule
|
||||
}
|
||||
// Clean parameters
|
||||
if (! preg_match('/(\.png|\.gif)$/i',$picto))
|
||||
$picto .= '.png';
|
||||
// If img file not into standard path, we use alternate path
|
||||
if (defined('DOL_URL_ROOT_ALT') && DOL_URL_ROOT_ALT && ! file_exists(DOL_DOCUMENT_ROOT.'/'.$path.'/img/'.$picto))
|
||||
$url = DOL_URL_ROOT_ALT;
|
||||
if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto .= '.png';
|
||||
// If img file is not into standard path, we use alternate path (Avoid using DOL_URL_ROOT_ALT for performane)
|
||||
if (defined('DOL_URL_ROOT_ALT') && DOL_URL_ROOT_ALT && ! file_exists(DOL_DOCUMENT_ROOT.'/'.$path.'/img/'.$picto)) $url = DOL_URL_ROOT_ALT;
|
||||
|
||||
// $url is '' or '/custom', $path is current theme or
|
||||
$fullpathpicto = $url.'/'.$path.'/img/'.$picto;
|
||||
}
|
||||
|
||||
@ -2719,10 +2720,10 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
|
||||
dol_syslog("get_localtax tva=".$tva." local=".$local." thirdparty_buyer id=".(is_object($thirdparty_buyer)?$thirdparty_buyer->id:'')." thirdparty_seller id=".$thirdparty_seller->id);
|
||||
|
||||
// Some test to guess with no need to make database access
|
||||
if ($mysoc->country_code == 'ES') // For spain and localtaxes 1, tax is qualified if buyer use local taxe
|
||||
if ($mysoc->country_code == 'ES') // For spain localtaxes 1 and 2, tax is qualified if buyer use local taxe
|
||||
{
|
||||
if ($local == 1 && ! $thirdparty_buyer->localtax1_assuj) return 0;
|
||||
if ($local == 2 && ! $thirdparty_seller->localtax2_assuj) return 0;
|
||||
if ($local == 2 && ! $thirdparty_buyer->localtax2_assuj) return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -4179,7 +4180,7 @@ function printCommonFooter($zone='private')
|
||||
{
|
||||
$micro_end_time=dol_microtime_float(true);
|
||||
print "\n".'<script type="text/javascript">'."\n";
|
||||
print 'console.log("';
|
||||
print 'window.console && console.log("';
|
||||
if (! empty($conf->global->MEMCACHED_SERVER)) print 'MEMCACHED_SERVER='.$conf->global->MEMCACHED_SERVER.' - ';
|
||||
print 'MAIN_OPTIMIZE_SPEED='.(isset($conf->global->MAIN_OPTIMIZE_SPEED)?$conf->global->MAIN_OPTIMIZE_SPEED:'off');
|
||||
print ' - Build time: '.ceil(1000*($micro_end_time-$micro_start_time)).' ms';
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
* @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
|
||||
* @return void
|
||||
*/
|
||||
function print_smartphone_menu($db,$atarget,$type_user,$limitmenuto,&$tabMenu)
|
||||
function print_smartphone_menu($db,$atarget,$type_user,$limitmenuto,&$tabMenu,&$menu)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
|
||||
|
||||
|
||||
@ -45,7 +45,15 @@ class MenuSmart
|
||||
{
|
||||
$this->type_user=$type_user;
|
||||
$this->db=$db;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Load this->tabMenu
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function loadMenu()
|
||||
{
|
||||
// On sauve en session le menu principal choisi
|
||||
if (isset($_GET["mainmenu"])) $_SESSION["mainmenu"]=$_GET["mainmenu"];
|
||||
if (isset($_GET["idmenu"])) $_SESSION["idmenu"]=$_GET["idmenu"];
|
||||
@ -86,8 +94,8 @@ class MenuSmart
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
|
||||
$tabMenu=array();
|
||||
$menuArbo = new Menubase($db,'smartphone');
|
||||
$menuArbo->menuLoad($mainmenu, $leftmenu, $type_user, 'smartphone', $tabMenu);
|
||||
$menuArbo = new Menubase($this->db,'smartphone');
|
||||
$menuArbo->menuLoad($mainmenu, $leftmenu, $this->type_user, 'smartphone', $tabMenu);
|
||||
$this->tabMenu=$tabMenu;
|
||||
}
|
||||
|
||||
@ -110,7 +118,11 @@ class MenuSmart
|
||||
$conf->global->MAIN_SEARCHFORM_CONTACT=0;
|
||||
}
|
||||
|
||||
print_smartphone_menu($this->db,$this->atarget,$this->hideifnotallowed,$mode,$this->tabMenu);
|
||||
$this->menu=new Menu();
|
||||
|
||||
print_smartphone_menu($this->db,$this->atarget,$this->hideifnotallowed,$mode,$this->tabMenu,$this->menu);
|
||||
|
||||
unset($this->menu);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -32,9 +32,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
|
||||
* @param string $atarget Target
|
||||
* @param int $type_user 0=Internal,1=External,2=All
|
||||
* @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
|
||||
* @param array &$menu Object Menu to return back list of menu entries
|
||||
* @return void
|
||||
*/
|
||||
function print_auguria_menu($db,$atarget,$type_user,&$tabMenu)
|
||||
function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu)
|
||||
{
|
||||
global $user,$conf,$langs,$dolibarr_main_db_name;
|
||||
|
||||
@ -122,7 +123,7 @@ function print_start_menu_entry_auguria($idsel,$classname)
|
||||
* Output menu entry
|
||||
*
|
||||
* @param string $text Text
|
||||
* @param int $showmode 1 or 2
|
||||
* @param int $showmode 1 = allowed or 2 = not allowed
|
||||
* @param string $url Url
|
||||
* @param string $id Id
|
||||
* @param string $idsel Id sel
|
||||
@ -150,6 +151,10 @@ function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $cla
|
||||
{
|
||||
print '<div class="'.$id.' '.$idsel.'"><span class="mainmenu_'.$idsel.' '.$id.'" id="mainmenuspan_'.$idsel.'"></span></div>';
|
||||
print '<a class="tmenudisabled" id="mainmenua_'.$idsel.'" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">';
|
||||
print '<span class="mainmenuaspan">';
|
||||
print $text;
|
||||
print '</span>';
|
||||
print '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -181,18 +186,19 @@ function print_end_menu_array_auguria()
|
||||
/**
|
||||
* Core function to output left menu auguria
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param array $menu_array_before Table of menu entries to show before entries of menu handler
|
||||
* @param array $menu_array_after Table of menu entries to show after entries of menu handler
|
||||
* @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
|
||||
* @param DoliDB $db Database handler
|
||||
* @param array $menu_array_before Table of menu entries to show before entries of menu handler
|
||||
* @param array $menu_array_after Table of menu entries to show after entries of menu handler
|
||||
* @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
|
||||
* @param array &$menu Object Menu to return back list of menu entries
|
||||
* @return void
|
||||
*/
|
||||
function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabMenu)
|
||||
function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabMenu,&$menu)
|
||||
{
|
||||
global $user,$conf,$langs,$dolibarr_main_db_name,$mysoc;
|
||||
|
||||
$overwritemenufor = array();
|
||||
$newmenu = new Menu();
|
||||
$newmenu = $menu;
|
||||
|
||||
$mainmenu=$_SESSION["mainmenu"];
|
||||
$leftmenu=$_SESSION["leftmenu"];
|
||||
|
||||
@ -47,12 +47,21 @@ class MenuManager
|
||||
*/
|
||||
function __construct($db, $type_user)
|
||||
{
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$this->type_user=$type_user;
|
||||
$this->db=$db;
|
||||
|
||||
// On sauve en session le menu principal choisi
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load this->tabMenu
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function loadMenu()
|
||||
{
|
||||
global $conf, $user, $langs;
|
||||
|
||||
// On sauve en session le menu principal choisi
|
||||
if (isset($_GET["mainmenu"])) $_SESSION["mainmenu"]=$_GET["mainmenu"];
|
||||
if (isset($_GET["idmenu"])) $_SESSION["idmenu"]=$_GET["idmenu"];
|
||||
|
||||
@ -92,8 +101,8 @@ class MenuManager
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
|
||||
$tabMenu=array();
|
||||
$menuArbo = new Menubase($db,'auguria');
|
||||
$menuArbo->menuLoad($mainmenu, $leftmenu, $type_user, 'auguria', $tabMenu);
|
||||
$menuArbo = new Menubase($this->db,'auguria');
|
||||
$menuArbo->menuLoad($mainmenu, $leftmenu, $this->type_user, 'auguria', $tabMenu);
|
||||
|
||||
// Modules system tools
|
||||
// TODO Find a way to add parent menu only if child menu exists. For the moment, no other method than hard coded methods.
|
||||
@ -158,9 +167,14 @@ class MenuManager
|
||||
}
|
||||
|
||||
$res='ErrorBadParameterForMode';
|
||||
if ($mode == 'top') $res=print_auguria_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu);
|
||||
if ($mode == 'left') $res=print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu);
|
||||
|
||||
$this->menu=new Menu();
|
||||
|
||||
if ($mode == 'top') $res=print_auguria_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu);
|
||||
if ($mode == 'left') $res=print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$this->menu);
|
||||
|
||||
unset($this->menu);
|
||||
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,10 +31,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $atarget Target
|
||||
* @param int $type_user 0=Menu for backoffice, 1=Menu for front office
|
||||
* @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
|
||||
* @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
|
||||
* @param array &$menu Object Menu to return back list of menu entries
|
||||
* @return void
|
||||
*/
|
||||
function print_eldy_menu($db,$atarget,$type_user,&$tabMenu)
|
||||
function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu)
|
||||
{
|
||||
global $user,$conf,$langs,$dolibarr_main_db_name;
|
||||
|
||||
@ -72,6 +73,7 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu)
|
||||
print_start_menu_entry($idsel,$classname);
|
||||
print_text_menu_entry($langs->trans("ThirdParties"), $showmode, DOL_URL_ROOT.'/societe/index.php?mainmenu=companies&leftmenu=', $id, $idsel, $classname, $atarget);
|
||||
print_end_menu_entry();
|
||||
$menu->add(DOL_URL_ROOT.'/societe/index.php?mainmenu=companies&leftmenu=', $langs->trans("ThirdParties"), 0, $showmode, $atarget, $mainmenu, $leftmenu);
|
||||
}
|
||||
|
||||
// Products-Services
|
||||
@ -312,7 +314,7 @@ function print_start_menu_entry($idsel,$classname)
|
||||
* Output menu entry
|
||||
*
|
||||
* @param string $text Text
|
||||
* @param int $showmode 1 or 2
|
||||
* @param int $showmode 1 = allowed or 2 = not allowed
|
||||
* @param string $url Url
|
||||
* @param string $id Id
|
||||
* @param string $idsel Id sel
|
||||
@ -340,6 +342,10 @@ function print_text_menu_entry($text, $showmode, $url, $id, $idsel, $classname,
|
||||
{
|
||||
print '<div class="'.$id.' '.$idsel.'"><span class="'.$id.'" id="mainmenuspan_'.$idsel.'"></span></div>';
|
||||
print '<a class="tmenudisabled" id="mainmenua_'.$idsel.'" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">';
|
||||
print '<span class="mainmenuaspan">';
|
||||
print $text;
|
||||
print '</span>';
|
||||
print '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -375,13 +381,14 @@ function print_end_menu_array()
|
||||
* @param array $menu_array_before Table of menu entries to show before entries of menu handler
|
||||
* @param array $menu_array_after Table of menu entries to show after entries of menu handler
|
||||
* @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
|
||||
* @param array &$menu Object Menu to return back list of menu entries
|
||||
* @return void
|
||||
*/
|
||||
function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu)
|
||||
function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu,&$menu)
|
||||
{
|
||||
global $user,$conf,$langs,$dolibarr_main_db_name,$mysoc;
|
||||
|
||||
$newmenu = new Menu();
|
||||
$newmenu = $menu;
|
||||
|
||||
$mainmenu=$_SESSION["mainmenu"];
|
||||
$leftmenu=$_SESSION["leftmenu"];
|
||||
@ -653,7 +660,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
{
|
||||
$langs->load("contracts");
|
||||
$newmenu->add("/contrat/index.php?leftmenu=contracts", $langs->trans("Contracts"), 0, $user->rights->contrat->lire, '', $mainmenu, 'contracts');
|
||||
$newmenu->add("/societe/societe.php?leftmenu=contracts", $langs->trans("NewContract"), 1, $user->rights->contrat->creer);
|
||||
$newmenu->add("/contrat/fiche.php?&action=create&leftmenu=contracts", $langs->trans("NewContract"), 1, $user->rights->contrat->creer);
|
||||
$newmenu->add("/contrat/liste.php?leftmenu=contracts", $langs->trans("List"), 1, $user->rights->contrat->lire);
|
||||
$newmenu->add("/contrat/services.php?leftmenu=contracts", $langs->trans("MenuServices"), 1, $user->rights->contrat->lire);
|
||||
if ($leftmenu=="contracts") $newmenu->add("/contrat/services.php?leftmenu=contracts&mode=0", $langs->trans("MenuInactiveServices"), 2, $user->rights->contrat->lire);
|
||||
@ -1241,15 +1248,14 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
* @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
|
||||
* @return void
|
||||
*/
|
||||
function print_jmobile_eldy_menu($db,$atarget,$type_user,&$tabMenu)
|
||||
function print_jmobile_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu)
|
||||
{
|
||||
print '<ul data-role="listview" data-inset="true">
|
||||
<li><a href="#">Acura</a></li>
|
||||
<li><a href="#">Audi</a></li>
|
||||
<li><a href="#">BMW</a></li>
|
||||
<li><a href="#">Cadillac</a></li>
|
||||
<li><a href="#">Ferrari</a></li>
|
||||
</ul>';
|
||||
print '<ul data-role="listview" data-inset="true">';
|
||||
foreach ($tabMenu as $key => $val)
|
||||
{
|
||||
print '<li><a href="#">'.$key.'</a></li>';
|
||||
}
|
||||
print '</ul>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -48,7 +48,16 @@ class MenuManager
|
||||
{
|
||||
$this->type_user=$type_user;
|
||||
$this->db=$db;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load this->tabMenu
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function loadMenu()
|
||||
{
|
||||
// On sauve en session le menu principal choisi
|
||||
if (isset($_GET["mainmenu"])) $_SESSION["mainmenu"]=$_GET["mainmenu"];
|
||||
if (isset($_GET["idmenu"])) $_SESSION["idmenu"]=$_GET["idmenu"];
|
||||
@ -89,8 +98,8 @@ class MenuManager
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
|
||||
$tabMenu=array();
|
||||
$menuArbo = new Menubase($db,'eldy');
|
||||
$menuArbo->menuLoad($mainmenu, $leftmenu, $type_user, 'eldy', $tabMenu);
|
||||
$menuArbo = new Menubase($this->db,'eldy');
|
||||
$menuArbo->menuLoad($mainmenu, $leftmenu, $this->type_user, 'eldy', $tabMenu);
|
||||
$this->tabMenu=$tabMenu;
|
||||
}
|
||||
|
||||
@ -112,12 +121,19 @@ class MenuManager
|
||||
$conf->global->MAIN_SEARCHFORM_SOCIETE=0;
|
||||
$conf->global->MAIN_SEARCHFORM_CONTACT=0;
|
||||
}
|
||||
|
||||
$res='ErrorBadParameterForMode';
|
||||
if ($mode == 'top') $res=print_eldy_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu);
|
||||
if ($mode == 'left') $res=print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu);
|
||||
if ($mode == 'jmobile') $res=print_jmobile_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu);
|
||||
|
||||
$res='ErrorBadParameterForMode';
|
||||
|
||||
$this->menu=new Menu();
|
||||
|
||||
if ($mode == 'top') $res=print_eldy_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu);
|
||||
if ($mode == 'left') $res=print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$this->menu);
|
||||
if ($mode == 'jmobile') $res=print_jmobile_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$this->menu);
|
||||
|
||||
unset($this->menu);
|
||||
|
||||
//print 'xx'.$mode;
|
||||
//var_dump($this->menu);
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ class MenuManager
|
||||
var $type_user=0; // Put 0 for internal users, 1 for external users
|
||||
var $atarget=""; // To store default target to use onto links
|
||||
|
||||
var $menu_array;
|
||||
var $menu;
|
||||
var $menu_array_after;
|
||||
|
||||
|
||||
@ -46,6 +46,17 @@ class MenuManager
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load this->tabMenu
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function loadMenu()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show menu
|
||||
*
|
||||
@ -58,6 +69,8 @@ class MenuManager
|
||||
|
||||
$id='mainmenu';
|
||||
|
||||
$this->menu=new Menu();
|
||||
|
||||
if ($mode == 'top')
|
||||
{
|
||||
print_start_menu_array_empty();
|
||||
@ -74,40 +87,35 @@ class MenuManager
|
||||
|
||||
if ($mode == 'left')
|
||||
{
|
||||
$newmenu = new Menu();
|
||||
|
||||
// Put here left menu entries
|
||||
// ***** START *****
|
||||
|
||||
$langs->load("admin"); // Load translation file admin.lang
|
||||
$newmenu->add("/admin/index.php?leftmenu=setup", $langs->trans("Setup"),0);
|
||||
$newmenu->add("/admin/company.php", $langs->trans("MenuCompanySetup"),1);
|
||||
$newmenu->add("/admin/modules.php", $langs->trans("Modules"),1);
|
||||
$newmenu->add("/admin/menus.php", $langs->trans("Menus"),1);
|
||||
$newmenu->add("/admin/ihm.php", $langs->trans("GUISetup"),1);
|
||||
$newmenu->add("/admin/boxes.php", $langs->trans("Boxes"),1);
|
||||
$newmenu->add("/admin/delais.php",$langs->trans("Alerts"),1);
|
||||
$newmenu->add("/admin/proxy.php?mainmenu=home", $langs->trans("Security"),1);
|
||||
$newmenu->add("/admin/limits.php?mainmenu=home", $langs->trans("MenuLimits"),1);
|
||||
$newmenu->add("/admin/pdf.php?mainmenu=home", $langs->trans("PDF"),1);
|
||||
$newmenu->add("/admin/mails.php?mainmenu=home", $langs->trans("Emails"),1);
|
||||
$newmenu->add("/admin/sms.php?mainmenu=home", $langs->trans("SMS"),1);
|
||||
$newmenu->add("/admin/dict.php?mainmenu=home", $langs->trans("DictionnarySetup"),1);
|
||||
$newmenu->add("/admin/const.php?mainmenu=home", $langs->trans("OtherSetup"),1);
|
||||
$this->menu->add("/admin/index.php?leftmenu=setup", $langs->trans("Setup"),0);
|
||||
$this->menu->add("/admin/company.php", $langs->trans("MenuCompanySetup"),1);
|
||||
$this->menu->add("/admin/modules.php", $langs->trans("Modules"),1);
|
||||
$this->menu->add("/admin/menus.php", $langs->trans("Menus"),1);
|
||||
$this->menu->add("/admin/ihm.php", $langs->trans("GUISetup"),1);
|
||||
$this->menu->add("/admin/boxes.php", $langs->trans("Boxes"),1);
|
||||
$this->menu->add("/admin/delais.php",$langs->trans("Alerts"),1);
|
||||
$this->menu->add("/admin/proxy.php?mainmenu=home", $langs->trans("Security"),1);
|
||||
$this->menu->add("/admin/limits.php?mainmenu=home", $langs->trans("MenuLimits"),1);
|
||||
$this->menu->add("/admin/pdf.php?mainmenu=home", $langs->trans("PDF"),1);
|
||||
$this->menu->add("/admin/mails.php?mainmenu=home", $langs->trans("Emails"),1);
|
||||
$this->menu->add("/admin/sms.php?mainmenu=home", $langs->trans("SMS"),1);
|
||||
$this->menu->add("/admin/dict.php?mainmenu=home", $langs->trans("DictionnarySetup"),1);
|
||||
$this->menu->add("/admin/const.php?mainmenu=home", $langs->trans("OtherSetup"),1);
|
||||
|
||||
// ***** END *****
|
||||
|
||||
// do not change code after this
|
||||
|
||||
// override menu_array by value array in $newmenu
|
||||
$this->menu_array=$newmenu->liste;
|
||||
|
||||
$alt=0;
|
||||
$num=count($this->menu_array);
|
||||
$num=count($this->menu->liste);
|
||||
for ($i = 0; $i < $num; $i++)
|
||||
{
|
||||
$alt++;
|
||||
if (empty($this->menu_array[$i]['level']))
|
||||
if (empty($this->menu->liste[$i]['level']))
|
||||
{
|
||||
if (($alt%2==0))
|
||||
{
|
||||
@ -121,7 +129,7 @@ class MenuManager
|
||||
|
||||
// Place tabulation
|
||||
$tabstring='';
|
||||
$tabul=($this->menu_array[$i]['level'] - 1);
|
||||
$tabul=($this->menu->liste[$i]['level'] - 1);
|
||||
if ($tabul > 0)
|
||||
{
|
||||
for ($j=0; $j < $tabul; $j++)
|
||||
@ -130,31 +138,31 @@ class MenuManager
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->menu_array[$i]['level'] == 0) {
|
||||
if ($this->menu_array[$i]['enabled'])
|
||||
if ($this->menu->liste[$i]['level'] == 0) {
|
||||
if ($this->menu->liste[$i]['enabled'])
|
||||
{
|
||||
print '<div class="menu_titre">'.$tabstring.'<a class="vmenu" href="'.dol_buildpath($this->menu_array[$i]['url'],1).'"'.($this->menu_array[$i]['target']?' target="'.$this->menu_array[$i]['target'].'"':'').'>'.$this->menu_array[$i]['titre'].'</a></div>'."\n";
|
||||
print '<div class="menu_titre">'.$tabstring.'<a class="vmenu" href="'.dol_buildpath($this->menu->liste[$i]['url'],1).'"'.($this->menu->liste[$i]['target']?' target="'.$this->menu->liste[$i]['target'].'"':'').'>'.$this->menu->liste[$i]['titre'].'</a></div>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="menu_titre">'.$tabstring.'<font class="vmenudisabled">'.$this->menu_array[$i]['titre'].'</font></div>'."\n";
|
||||
print '<div class="menu_titre">'.$tabstring.'<font class="vmenudisabled">'.$this->menu->liste[$i]['titre'].'</font></div>'."\n";
|
||||
}
|
||||
print '<div class="menu_top"></div>'."\n";
|
||||
}
|
||||
|
||||
if ($this->menu_array[$i]['level'] > 0) {
|
||||
if ($this->menu->liste[$i]['level'] > 0) {
|
||||
print '<div class="menu_contenu">';
|
||||
|
||||
if ($this->menu_array[$i]['enabled'])
|
||||
print $tabstring.'<a class="vsmenu" href="'.dol_buildpath($this->menu_array[$i]['url'],1).'">'.$this->menu_array[$i]['titre'].'</a><br>';
|
||||
if ($this->menu->liste[$i]['enabled'])
|
||||
print $tabstring.'<a class="vsmenu" href="'.dol_buildpath($this->menu->liste[$i]['url'],1).'">'.$this->menu->liste[$i]['titre'].'</a><br>';
|
||||
else
|
||||
print $tabstring.'<font class="vsmenudisabled">'.$this->menu_array[$i]['titre'].'</font><br>';
|
||||
print $tabstring.'<font class="vsmenudisabled">'.$this->menu->liste[$i]['titre'].'</font><br>';
|
||||
|
||||
print '</div>'."\n";
|
||||
}
|
||||
|
||||
// If next is a new block or end
|
||||
if (empty($this->menu_array[$i+1]['level']))
|
||||
if (empty($this->menu->liste[$i+1]['level']))
|
||||
{
|
||||
print '<div class="menu_end"></div>'."\n";
|
||||
print "</div>\n";
|
||||
|
||||
@ -261,9 +261,10 @@ class ExportExcel2007 extends ExportExcel
|
||||
* @param array $array_selected_sorted Array with list of field to export
|
||||
* @param resource $objp A record from a fetch with all fields from select
|
||||
* @param Translate $outputlangs Object lang to translate values
|
||||
* @param array $array_types Array with types of fields
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function write_record($array_selected_sorted,$objp,$outputlangs)
|
||||
function write_record($array_selected_sorted,$objp,$outputlangs,$array_types)
|
||||
{
|
||||
// Create a format for the column headings
|
||||
if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL))
|
||||
@ -282,7 +283,8 @@ class ExportExcel2007 extends ExportExcel
|
||||
$newvalue=$objp->$alias;
|
||||
|
||||
$newvalue=$this->excel_clean($newvalue);
|
||||
|
||||
$typefield=isset($array_types[$code])?$array_types[$code]:'';
|
||||
|
||||
// Traduction newvalue
|
||||
if (preg_match('/^\((.*)\)$/i',$newvalue,$reg))
|
||||
{
|
||||
@ -293,6 +295,8 @@ class ExportExcel2007 extends ExportExcel
|
||||
$newvalue=$outputlangs->convToOutputCharset($newvalue);
|
||||
}
|
||||
|
||||
//var_dump($code.' '.$alias.' '.$newvalue.' '.$typefield);
|
||||
|
||||
if (preg_match('/^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$/i',$newvalue))
|
||||
{
|
||||
if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL))
|
||||
@ -341,7 +345,21 @@ class ExportExcel2007 extends ExportExcel
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row+1, $newvalue);
|
||||
//$coord=$this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row+1)->getCoordinate();
|
||||
//if ($typefield == 'Text') $this->workbook->getActiveSheet()->getStyle($coord)->getNumberFormat()->setFormatCode('@');
|
||||
//$this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row+1, $newvalue);
|
||||
if ($typefield == 'Text')
|
||||
{
|
||||
var_dump($code.' '.$alias.' '.$newvalue.' '.$typefield);
|
||||
$this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row+1, $newvalue);
|
||||
$this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row+1)->setValueExplicit($newvalue, PHPExcel_Cell_DataType::TYPE_STRING);
|
||||
}
|
||||
else
|
||||
{
|
||||
//$coord=$this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row+1)->getCoordinate();
|
||||
//if ($typefield == 'Text') $this->workbook->getActiveSheet()->getStyle($coord)->getNumberFormat()->setFormatCode('@');
|
||||
$this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row+1, $newvalue);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->col++;
|
||||
|
||||
@ -80,14 +80,14 @@ class modCommande extends DolibarrModules
|
||||
$this->const[$r][0] = "COMMANDE_ADDON_PDF";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "einstein";
|
||||
$this->const[$r][3] = 'Nom du gestionnaire de generation des commandes en PDF';
|
||||
$this->const[$r][3] = 'Name of PDF model of order';
|
||||
$this->const[$r][4] = 0;
|
||||
|
||||
$r++;
|
||||
$this->const[$r][0] = "COMMANDE_ADDON";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "mod_commande_marbre";
|
||||
$this->const[$r][3] = 'Nom du gestionnaire de numerotation des commandes';
|
||||
$this->const[$r][3] = 'Name of numbering numerotation rules of order';
|
||||
$this->const[$r][4] = 0;
|
||||
|
||||
$r++;
|
||||
|
||||
@ -65,7 +65,7 @@ class modECM extends DolibarrModules
|
||||
$this->dirs = array("/ecm/temp");
|
||||
|
||||
// Config pages. Put here list of php page names stored in admmin directory used to setup module
|
||||
$this->config_page_url = array();
|
||||
$this->config_page_url = array('ecm.php');
|
||||
|
||||
// Dependencies
|
||||
$this->depends = array(); // List of modules id that must be enabled if this module is enabled
|
||||
@ -73,7 +73,14 @@ class modECM extends DolibarrModules
|
||||
|
||||
// Constants
|
||||
$this->const = array(); // List of parameters
|
||||
|
||||
$r=0;
|
||||
|
||||
$this->const[$r][0] = "ECM_AUTO_TREE_ENABLED";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "1";
|
||||
$this->const[$r][3] = 'Auto tree is enabled by default';
|
||||
$this->const[$r][4] = 0;
|
||||
|
||||
// Boxes
|
||||
$this->boxes = array(); // List of boxes
|
||||
$r=0;
|
||||
|
||||
@ -78,11 +78,15 @@ class modFacture extends DolibarrModules
|
||||
$this->const[$r][0] = "FACTURE_ADDON_PDF";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "crabe";
|
||||
$this->const[$r][3] = 'Name of PDF model of invoice';
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "FACTURE_ADDON";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "terre";
|
||||
$this->const[$r][2] = "mod_facture_terre";
|
||||
$this->const[$r][3] = 'Name of numbering numerotation rules of invoice';
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "FACTURE_ADDON_PDF_ODT_PATH";
|
||||
|
||||
@ -133,14 +133,14 @@ class modHoliday extends DolibarrModules
|
||||
$r=0;
|
||||
|
||||
$this->rights[$r][0] = 20001; // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Créer / Modifier / Lire ses demandes de congés payés'; // Permission label
|
||||
$this->rights[$r][1] = 'Lire/créer/modifier ses demandes de congés payés'; // 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++;
|
||||
|
||||
$this->rights[$r][0] = 20002; // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Lire / Modifier toutes les demandes de congés payés'; // Permission label
|
||||
$this->rights[$r][1] = 'Lire/créer/modifier toutes les demandes de congés payés'; // Permission label
|
||||
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'lire_tous'; // 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)
|
||||
|
||||
@ -283,7 +283,7 @@ class modSociete extends DolibarrModules
|
||||
$this->export_label[$r]='ExportDataset_company_2';
|
||||
$this->export_icon[$r]='contact';
|
||||
$this->export_permission[$r]=array(array("societe","contact","export"));
|
||||
$this->export_fields_array[$r]=array('c.rowid'=>"IdContact",'c.civilite'=>"CivilityCode",'c.name'=>'Lastname','c.firstname'=>'Firstname','c.datec'=>"DateCreation",'c.tms'=>"DateLastModification",'c.priv'=>"ContactPrivate",'c.address'=>"Address",'c.zip'=>"Zip",'c.town'=>"Town",'c.phone'=>"Phone",'c.fax'=>"Fax",'c.email'=>"EMail",'p.libelle'=>"Country",'p.code'=>"CountryCode",'s.rowid'=>"IdCompany",'s.nom'=>"CompanyName",'s.status'=>"Status",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode");
|
||||
$this->export_fields_array[$r]=array('c.rowid'=>"IdContact",'c.civilite'=>"CivilityCode",'c.lastname'=>'Lastname','c.firstname'=>'Firstname','c.datec'=>"DateCreation",'c.tms'=>"DateLastModification",'c.priv'=>"ContactPrivate",'c.address'=>"Address",'c.zip'=>"Zip",'c.town'=>"Town",'c.phone'=>"Phone",'c.fax'=>"Fax",'c.email'=>"EMail",'p.libelle'=>"Country",'p.code'=>"CountryCode",'s.rowid'=>"IdCompany",'s.nom'=>"CompanyName",'s.status'=>"Status",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode");
|
||||
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>"company",'s.code_client'=>"company",'s.code_fournisseur'=>"company"); // We define here only fields that use another picto
|
||||
if (empty($conf->fournisseur->enabled))
|
||||
{
|
||||
|
||||
@ -583,6 +583,7 @@ class InterfaceActionsAuto
|
||||
$ret=$actioncomm->add($user); // User qui saisit l'action
|
||||
if ($ret > 0)
|
||||
{
|
||||
$_SESSION['LAST_ACTION_CREATED'] = $ret;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
|
||||
@ -380,16 +380,17 @@ llxHeader($moreheadcss.$moreheadjs,$langs->trans("ECMArea"),'','','','',$morejs,
|
||||
// Add sections to manage
|
||||
$rowspan=0;
|
||||
$sectionauto=array();
|
||||
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'product', 'test'=>(! empty($conf->product->enabled) || ! empty($conf->service->enabled)), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); }
|
||||
if (! empty($conf->societe->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsByThirdParties")); }
|
||||
if (! empty($conf->propal->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Prop"), 'desc'=>$langs->trans("ECMDocsByProposals")); }
|
||||
if (! empty($conf->contrat->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'contract','test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsByContracts")); }
|
||||
if (! empty($conf->commande->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled,'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsByOrders")); }
|
||||
if (! empty($conf->facture->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); }
|
||||
if (! empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'order_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsByOrders")); }
|
||||
if (! empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'invoice_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); }
|
||||
if (! empty($conf->tax->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBySocialContributions")); }
|
||||
|
||||
if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
|
||||
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'product', 'test'=>(! empty($conf->product->enabled) || ! empty($conf->service->enabled)), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); }
|
||||
if (! empty($conf->societe->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsByThirdParties")); }
|
||||
if (! empty($conf->propal->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Prop"), 'desc'=>$langs->trans("ECMDocsByProposals")); }
|
||||
if (! empty($conf->contrat->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'contract','test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsByContracts")); }
|
||||
if (! empty($conf->commande->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled,'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsByOrders")); }
|
||||
if (! empty($conf->facture->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); }
|
||||
if (! empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'order_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsByOrders")); }
|
||||
if (! empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'invoice_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); }
|
||||
if (! empty($conf->tax->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBySocialContributions")); }
|
||||
}
|
||||
print_fiche_titre($langs->trans("ECMArea").' - '.$langs->trans("ECMFileManager"));
|
||||
|
||||
print $langs->trans("ECMAreaDesc")."<br>";
|
||||
@ -466,7 +467,6 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti
|
||||
print '</td></tr>';
|
||||
|
||||
$showonrightsize='';
|
||||
|
||||
// Auto section
|
||||
if (count($sectionauto))
|
||||
{
|
||||
@ -788,6 +788,8 @@ if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE
|
||||
include 'tpl/builddatabase.tpl.php';
|
||||
}
|
||||
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -200,8 +200,8 @@ class Export
|
||||
* Arrays this->array_export_xxx are already loaded for required datatoexport
|
||||
*
|
||||
* @param int $indice Indice of export
|
||||
* @param array $array_selected Filter on array of fields to export
|
||||
* @param array $array_filterValue Filter on array of fields to export
|
||||
* @param array $array_selected Filter fields on array of fields to export
|
||||
* @param array $array_filterValue Filter records on array of value for fields
|
||||
* @return string SQL String. Example "select s.rowid as r_rowid, s.status as s_status from ..."
|
||||
*/
|
||||
function build_sql($indice, $array_selected, $array_filterValue)
|
||||
@ -230,7 +230,7 @@ class Export
|
||||
// pour ne pas a gerer le nombre de condition
|
||||
foreach ($array_filterValue as $key => $value)
|
||||
{
|
||||
$sqlWhere.=" and ".$this->build_filterQuery($this->array_export_TypeFields[0][$key], $key, $array_filterValue[$key]);
|
||||
$sqlWhere.=" and ".$this->build_filterQuery($this->array_export_TypeFields[$indice][$key], $key, $array_filterValue[$key]);
|
||||
}
|
||||
$sql.=$sqlWhere;
|
||||
}
|
||||
@ -464,7 +464,7 @@ class Export
|
||||
* @param string $datatoexport Name of dataset to export
|
||||
* @param array $array_selected Filter on array of fields to export
|
||||
* @param array $array_filterValue Filter on array of fields with a filter
|
||||
* @param string $sqlquery If set, transmit a sql query instead of building it from arrays
|
||||
* @param string $sqlquery If set, transmit the sql request for select (otherwise, sql request is generated from arrays)
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function build_file($user, $model, $datatoexport, $array_selected, $array_filterValue, $sqlquery = '')
|
||||
@ -547,8 +547,7 @@ class Export
|
||||
}
|
||||
}
|
||||
// end of special operation processing
|
||||
|
||||
$objmodel->write_record($array_selected,$objp,$outputlangs);
|
||||
$objmodel->write_record($array_selected,$objp,$outputlangs,$this->array_export_TypeFields[$indice]);
|
||||
}
|
||||
|
||||
// Genere en-tete
|
||||
|
||||
@ -295,7 +295,9 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
|
||||
//print "xx".$tva_tx; exit;
|
||||
if ($result > 0)
|
||||
{
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||
$ret=$object->fetch($object->id); // Reload to get new records
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||
{
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
@ -307,7 +309,6 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
|
||||
$ret=$object->fetch($object->id); // Reload to get new records
|
||||
supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
unset($_POST['qty']);
|
||||
|
||||
@ -367,7 +367,7 @@ class Holiday extends CommonObject
|
||||
$sql.= " uu.lastname as user_lastname,";
|
||||
$sql.= " uu.firstname as user_firstname,";
|
||||
|
||||
$sql.= " ua.name as validator_lastname,";
|
||||
$sql.= " ua.lastname as validator_lastname,";
|
||||
$sql.= " ua.firstname as validator_firstname";
|
||||
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp, ".MAIN_DB_PREFIX."user as uu, ".MAIN_DB_PREFIX."user as ua";
|
||||
|
||||
@ -101,9 +101,11 @@ if(!empty($search_ref))
|
||||
// DATE START
|
||||
if($year_start > 0) {
|
||||
if($month_start > 0) {
|
||||
$filter.= " AND date_format(cp.date_debut, '%Y-%m') = '$year_start-$month_start'";
|
||||
$filter .= " AND (cp.date_debut BETWEEN '".$db->idate(dol_get_first_day($year_start,$month_start,1))."' AND '".$db->idate(dol_get_last_day($year_start,$month_start,1))."')";
|
||||
//$filter.= " AND date_format(cp.date_debut, '%Y-%m') = '$year_start-$month_start'";
|
||||
} else {
|
||||
$filter.= " AND date_format(cp.date_debut, '%Y') = '$year_start'";
|
||||
$filter .= " AND (cp.date_debut BETWEEN '".$db->idate(dol_get_first_day($year_start,1,1))."' AND '".$db->idate(dol_get_last_day($year_start,12,1))."')";
|
||||
//$filter.= " AND date_format(cp.date_debut, '%Y') = '$year_start'";
|
||||
}
|
||||
} else {
|
||||
if($month_start > 0) {
|
||||
@ -114,9 +116,11 @@ if($year_start > 0) {
|
||||
// DATE FIN
|
||||
if($year_end > 0) {
|
||||
if($month_end > 0) {
|
||||
$filter.= " AND date_format(cp.date_fin, '%Y-%m') = '$year_end-$month_end'";
|
||||
$filter .= " AND (cp.date_fin BETWEEN '".$db->idate(dol_get_first_day($year_end,$month_end,1))."' AND '".$db->idate(dol_get_last_day($year_end,$month_end,1))."')";
|
||||
//$filter.= " AND date_format(cp.date_fin, '%Y-%m') = '$year_end-$month_end'";
|
||||
} else {
|
||||
$filter.= " AND date_format(cp.date_fin, '%Y') = '$year_end'";
|
||||
$filter .= " AND (cp.date_fin BETWEEN '".$db->idate(dol_get_first_day($year_end,1,1))."' AND '".$db->idate(dol_get_last_day($year_end,12,1))."')";
|
||||
//$filter.= " AND date_format(cp.date_fin, '%Y') = '$year_end'";
|
||||
}
|
||||
} else {
|
||||
if($month_end > 0) {
|
||||
@ -127,9 +131,11 @@ if($year_end > 0) {
|
||||
// DATE CREATE
|
||||
if($year_create > 0) {
|
||||
if($month_create > 0) {
|
||||
$filter.= " AND date_format(cp.date_create, '%Y-%m') = '$year_create-$month_create'";
|
||||
$filter .= " AND (cp.date_create BETWEEN '".$db->idate(dol_get_first_day($year_create,$month_create,1))."' AND '".$db->idate(dol_get_last_day($year_create,$month_create,1))."')";
|
||||
//$filter.= " AND date_format(cp.date_create, '%Y-%m') = '$year_create-$month_create'";
|
||||
} else {
|
||||
$filter.= " AND date_format(cp.date_create, '%Y') = '$year_create'";
|
||||
$filter .= " AND (cp.date_create BETWEEN '".$db->idate(dol_get_first_day($year_create,1,1))."' AND '".$db->idate(dol_get_last_day($year_create,12,1))."')";
|
||||
//$filter.= " AND date_format(cp.date_create, '%Y') = '$year_create'";
|
||||
}
|
||||
} else {
|
||||
if($month_create > 0) {
|
||||
|
||||
2
htdocs/includes/ckeditor/adapters/jquery.js
vendored
2
htdocs/includes/ckeditor/adapters/jquery.js
vendored
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<%
|
||||
<%
|
||||
'
|
||||
' Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
' For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
|
||||
2
htdocs/includes/ckeditor/ckeditor.js
vendored
2
htdocs/includes/ckeditor/ckeditor.js
vendored
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user