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

This commit is contained in:
Laurent Destailleur 2013-06-06 18:56:59 +02:00
commit 368efc77e0
197 changed files with 5102 additions and 4877 deletions

22
.gitattributes vendored Normal file
View File

@ -0,0 +1,22 @@
# Set default behaviour, in case users don't have core.autocrlf set.
* text=auto
# Explicitly declare text files we want to always be normalized and converted
# to native line endings on checkout.
*.php text eol=lf
*.sql text eol=lf
*.htm text eol=lf
*.html text eol=lf
*.js text eol=lf
*.css text eol=lf
*.lang text eol=lf
*.txt text eol=lf
*.md text eol=lf
# Denote all files that are truly binary and should not be modified.
*.ico binary
*.png binary
*.jpg binary
*.odt binary
*.odf binary

1
.gitignore vendored
View File

@ -14,3 +14,4 @@ doxygen_warnings.log
/.project /.project
.DS_Store .DS_Store
.idea .idea
*.iml

View File

@ -4,16 +4,21 @@ English Dolibarr ChangeLog
***** ChangeLog for 3.5 compared to 3.4 ***** ***** ChangeLog for 3.5 compared to 3.4 *****
For users: For users:
- New: [ task #877 ] Reorganize menus - New: [ task #877 ] Reorganize menus.
- New: [ task #858 ] Holiday module: note on manual holiday assignation - New: [ task #858 ] Holiday module: note on manual holiday assignation.
- New: [ task #892 ] Add option in thridparty customer/supplier admin to hide non active in select_company method - New: [ task #892 ] Add option in thridparty customer/supplier admin to hide non active in select_company method.
- New: [ task #531 ] Add a workload on tasks - New: [ task #531 ] Add a workload on tasks.
- New: Add graph of bank account input/output into input-output report page. - New: Add graph of bank account input/output into input-output report page.
- New: Add script export-bank-receipts. - New: Add script export-bank-receipts.
- New: Add option "filter=bank" onto script rebuild_merge_pdf.php to merge - New: Add option "filter=bank" onto script rebuild_merge_pdf.php to merge.
PDF that has one payment on a specific bank account.* PDF that has one payment on a specific bank account.*
- New: [ task #901 ] Add Extrafeild on Fiche Inter - New: [ task #901 ] Add Extrafeild on Fiche Inter.
- New: Show process id in all command line scripts - New: Show process id in all command line scripts.
- New: Module mailman can subscribe/unsubscribe to ML according to categories of member.
For translators:
- Normalized sort order of all languages files with english ref file.
For developers: For developers:
- New: DolGraph can build graph with three lines. - New: DolGraph can build graph with three lines.
@ -106,8 +111,10 @@ WARNING: If you used external modules, some of them may need to be upgraded due
***** ChangeLog for 3.3.2 compared to 3.3.1 ***** ***** ChangeLog for 3.3.3 compared to 3.3.2 *****
- Fix: [ bug #903 ] Fatal error: Call to undefined function dol_get_first_day() in htdocs/commande/liste.php
***** ChangeLog for 3.3.2 compared to 3.3.1 *****
- Fix: Dutch (nl_NL) translation - Fix: Dutch (nl_NL) translation
- Generalize fix: file with a specific mask not found, again - Generalize fix: file with a specific mask not found, again
- Fix: translations and BILL_SUPPLIER_BUILDDOC trigger - Fix: translations and BILL_SUPPLIER_BUILDDOC trigger
@ -136,8 +143,8 @@ WARNING: If you used external modules, some of them may need to be upgraded due
- Fix: [ bug #788 ] Date of linked interventions are not shown - Fix: [ bug #788 ] Date of linked interventions are not shown
- Fix: external users should not see costprice and margin infos - Fix: external users should not see costprice and margin infos
- Fix: [ bug #806 ] Tasks are ordered alphabetically instead of chronological order - Fix: [ bug #806 ] Tasks are ordered alphabetically instead of chronological order
***** ChangeLog for 3.3.1 compared to 3.3 *****
***** ChangeLog for 3.3.1 compared to 3.3 *****
- Fix: [ bug #733 ] Mass emailing tools do not support <style HTML tag - Fix: [ bug #733 ] Mass emailing tools do not support <style HTML tag
- Fix: Package for launchpad - Fix: Package for launchpad
- Fix: [ bug #736 ] Missing column in llx_c_chargesociales - Fix: [ bug #736 ] Missing column in llx_c_chargesociales
@ -145,8 +152,6 @@ WARNING: If you used external modules, some of them may need to be upgraded due
- Fix: [ bug #762 ] Bad profit calculation in Reporting - Fix: [ bug #762 ] Bad profit calculation in Reporting
- Fix: bug dictionnary with wrong prefix table - Fix: bug dictionnary with wrong prefix table
***** ChangeLog for 3.3 compared to 3.2.3 ***** ***** ChangeLog for 3.3 compared to 3.2.3 *****
For users: For users:
- New: Add holiday module, to declare and follow holidays of your employees. - New: Add holiday module, to declare and follow holidays of your employees.

View File

@ -528,7 +528,7 @@ if ($rowid)
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().'&nbsp;</td>'; print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().'&nbsp;</td>';
print '</tr>'; print '</tr>';
// Name // Lastname
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$object->lastname.'&nbsp;</td>'; print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$object->lastname.'&nbsp;</td>';
print '</tr>'; print '</tr>';
@ -536,6 +536,9 @@ if ($rowid)
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur">'.$object->firstname.'&nbsp;</td>'; print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur">'.$object->firstname.'&nbsp;</td>';
print '</tr>'; print '</tr>';
// EMail
print '<tr><td>'.$langs->trans("EMail").'</td><td class="valeur">'.dol_print_email($object->email,0,$object->fk_soc,1).'</td></tr>';
// Status // Status
print '<tr><td>'.$langs->trans("Status").'</td><td class="valeur">'.$object->getLibStatut(4).'</td></tr>'; print '<tr><td>'.$langs->trans("Status").'</td><td class="valeur">'.$object->getLibStatut(4).'</td></tr>';

View File

@ -829,6 +829,9 @@ else
print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" size="40" value="'.(GETPOST('firstname','alpha')?GETPOST('firstname','alpha'):$object->firstname).'"></td>'; print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" size="40" value="'.(GETPOST('firstname','alpha')?GETPOST('firstname','alpha'):$object->firstname).'"></td>';
print '</tr>'; print '</tr>';
// EMail
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED?'<span class="fieldrequired">':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'</span>':'').'</td><td><input type="text" name="member_email" size="40" value="'.(GETPOST('member_email','alpha')?GETPOST('member_email','alpha'):$object->email).'"></td></tr>';
// Password // Password
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{ {
@ -882,9 +885,6 @@ else
// Tel mobile // Tel mobile
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(GETPOST('phone_mobile','alpha')?GETPOST('phone_mobile','alpha'):$object->phone_mobile).'"></td></tr>'; print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(GETPOST('phone_mobile','alpha')?GETPOST('phone_mobile','alpha'):$object->phone_mobile).'"></td></tr>';
// EMail
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED?'<span class="fieldrequired">':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'</span>':'').'</td><td><input type="text" name="member_email" size="40" value="'.(GETPOST('member_email','alpha')?GETPOST('member_email','alpha'):$object->email).'"></td></tr>';
// Birthday // Birthday
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n"; print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
$form->select_date(($object->naiss ? $object->naiss : -1),'naiss','','',1,'formsoc'); $form->select_date(($object->naiss ? $object->naiss : -1),'naiss','','',1,'formsoc');
@ -1076,6 +1076,9 @@ else
print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" size="40" value="'.(isset($_POST["firstname"])?$_POST["firstname"]:$object->firstname).'"></td>'; print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" size="40" value="'.(isset($_POST["firstname"])?$_POST["firstname"]:$object->firstname).'"></td>';
print '</tr>'; print '</tr>';
// EMail
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED?'<span class="fieldrequired">':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'</span>':'').'</td><td><input type="text" name="email" size="40" value="'.(isset($_POST["email"])?$_POST["email"]:$object->email).'"></td></tr>';
// Password // Password
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{ {
@ -1118,9 +1121,6 @@ else
// Tel mobile // Tel mobile
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(isset($_POST["phone_mobile"])?$_POST["phone_mobile"]:$object->phone_mobile).'"></td></tr>'; print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(isset($_POST["phone_mobile"])?$_POST["phone_mobile"]:$object->phone_mobile).'"></td></tr>';
// EMail
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED?'<span class="fieldrequired">':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'</span>':'').'</td><td><input type="text" name="email" size="40" value="'.(isset($_POST["email"])?$_POST["email"]:$object->email).'"></td></tr>';
// Birthday // Birthday
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n"; print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
$form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc'); $form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
@ -1402,13 +1402,16 @@ else
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().'&nbsp;</td>'; print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().'&nbsp;</td>';
print '</tr>'; print '</tr>';
// Name // Lastname
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$object->lastname.'&nbsp;</td>'; print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$object->lastname.'&nbsp;</td>';
print '</tr>'; print '</tr>';
// Firstname // Firstname
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur">'.$object->firstname.'&nbsp;</td></tr>'; print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur">'.$object->firstname.'&nbsp;</td></tr>';
// EMail
print '<tr><td>'.$langs->trans("EMail").'</td><td class="valeur">'.dol_print_email($object->email,0,$object->fk_soc,1).'</td></tr>';
// Password // Password
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{ {
@ -1442,9 +1445,6 @@ else
// Tel mobile // Tel mobile
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td class="valeur">'.dol_print_phone($object->phone_mobile,$object->country_code,0,$object->fk_soc,1).'</td></tr>'; print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td class="valeur">'.dol_print_phone($object->phone_mobile,$object->country_code,0,$object->fk_soc,1).'</td></tr>';
// EMail
print '<tr><td>'.$langs->trans("EMail").'</td><td class="valeur">'.dol_print_email($object->email,0,$object->fk_soc,1).'</td></tr>';
// Birthday // Birthday
print '<tr><td>'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth,'day').'</td></tr>'; print '<tr><td>'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth,'day').'</td></tr>';

View File

@ -45,6 +45,7 @@ $startyear=$year-2;
$endyear=$year; $endyear=$year;
$langs->load("members"); $langs->load("members");
$langs->load("companies");
/* /*

View File

@ -45,6 +45,7 @@ $startyear=$year-2;
$endyear=$year; $endyear=$year;
$langs->load("members"); $langs->load("members");
$langs->load("companies");
/* /*

View File

@ -47,6 +47,7 @@ $startyear=$year-2;
$endyear=$year; $endyear=$year;
$langs->load("members"); $langs->load("members");
$langs->load("companies");
/* /*

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2004 Andre Cianfarani <acianfa@free.fr>
@ -44,6 +44,10 @@ if (! $user->admin) accessforbidden();
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$value = GETPOST('value','alpha'); $value = GETPOST('value','alpha');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$type = 'order';
/* /*
* Actions * Actions
@ -114,7 +118,7 @@ else if ($action == 'specimen')
} }
// Activate a model // Activate a model
else if ($action == 'set') if ($action == 'set')
{ {
$ret = addDocumentModel($value, $type, $label, $scandir); $ret = addDocumentModel($value, $type, $label, $scandir);
} }
@ -260,14 +264,14 @@ foreach ($dirmodels as $reldir)
require_once $dir.$file.'.php'; require_once $dir.$file.'.php';
$module = new $file; $module = new $file($db);
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
if ($module->isEnabled()) if ($module->isEnabled())
{ {
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n"; print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
print $module->info(); print $module->info();
@ -319,7 +323,7 @@ foreach ($dirmodels as $reldir)
print $form->textwithpicto('',$htmltooltip,1,0); print $form->textwithpicto('',$htmltooltip,1,0);
print '</td>'; print '</td>';
print '</tr>'; print "</tr>\n";
} }
} }
} }
@ -327,17 +331,16 @@ foreach ($dirmodels as $reldir)
} }
} }
} }
print "</table><br>\n";
print '</table><br>';
/* /*
* Document templates generators * Document templates generators
*/ */
print_titre($langs->trans("OrdersModelModule")); print_titre($langs->trans("OrdersModelModule"));
// Load array def with activated templates // Load array def with activated templates
$type='order';
$def = array(); $def = array();
$sql = "SELECT nom"; $sql = "SELECT nom";
$sql.= " FROM ".MAIN_DB_PREFIX."document_model"; $sql.= " FROM ".MAIN_DB_PREFIX."document_model";

View File

@ -40,6 +40,9 @@ if (! $user->admin) accessforbidden();
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$value = GETPOST('value','alpha'); $value = GETPOST('value','alpha');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$type='invoice';
/* /*
@ -137,78 +140,40 @@ if ($action == 'setModuleOptions')
} }
} }
if ($action == 'set') // Activate a model
else if ($action == 'set')
{ {
$label = GETPOST('label','alpha'); $ret = addDocumentModel($value, $type, $label, $scandir);
$scandir = GETPOST('scandir','alpha');
$type='invoice';
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
$sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", ";
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
$sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null");
$sql.= ")";
if ($db->query($sql))
{
}
} }
if ($action == 'del') else if ($action == 'del')
{ {
$type='invoice'; $ret = delDocumentModel($value, $type);
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; if ($ret > 0)
$sql.= " WHERE nom = '".$db->escape($value)."'"; {
$sql.= " AND type = '".$type."'";
$sql.= " AND entity = ".$conf->entity;
if ($db->query($sql))
{
if ($conf->global->FACTURE_ADDON_PDF == "$value") dolibarr_del_const($db, 'FACTURE_ADDON_PDF',$conf->entity); if ($conf->global->FACTURE_ADDON_PDF == "$value") dolibarr_del_const($db, 'FACTURE_ADDON_PDF',$conf->entity);
} }
} }
if ($action == 'setdoc') // Set default model
else if ($action == 'setdoc')
{ {
$label = GETPOST('label','alpha'); if (dolibarr_set_const($db, "FACTURE_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
$scandir = GETPOST('scandir','alpha'); {
// La constante qui a ete lue en avant du nouveau set
// on passe donc par une variable pour avoir un affichage coherent
$conf->global->FACTURE_ADDON_PDF = $value;
}
$db->begin(); // On active le modele
$ret = delDocumentModel($value, $type);
if (dolibarr_set_const($db, "FACTURE_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) if ($ret > 0)
{ {
$conf->global->FACTURE_ADDON_PDF = $value; $ret = addDocumentModel($value, $type, $label, $scandir);
} }
// On active le modele
$type='invoice';
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
$sql_del.= " WHERE nom = '".$db->escape($value)."'";
$sql_del.= " AND type = '".$type."'";
$sql_del.= " AND entity = ".$conf->entity;
dol_syslog("Delete from model table ".$sql_del);
$result1=$db->query($sql_del);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
$sql.= " VALUES ('".$value."', '".$type."', ".$conf->entity.", ";
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
$sql.= (! empty($scandir)?"'".$scandir."'":"null");
$sql.= ")";
dol_syslog("Insert into model table ".$sql);
$result2=$db->query($sql);
if ($result1 && $result2)
{
$db->commit();
}
else
{
dol_syslog("Error ".$db->lasterror(), LOG_ERR);
$db->rollback();
}
} }
if ($action == 'setmod') else if ($action == 'setmod')
{ {
// TODO Verifier si module numerotation choisi peut etre active // TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated // par appel methode canBeActivated

View File

@ -22,14 +22,15 @@
*/ */
/** /**
* \file htdocs/adherents/admin/mailman.php * \file htdocs/admin/mailman.php
* \ingroup mailmanspip * \ingroup mailmanspip
* \brief Page to setup the module MailmanSpip (Mailman) * \brief Page to setup the module MailmanSpip (Mailman)
*/ */
require '../../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/mailmanspip.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/mailmanspip.lib.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$langs->load("admin"); $langs->load("admin");
$langs->load("members"); $langs->load("members");
@ -186,6 +187,7 @@ if (! empty($conf->global->ADHERENT_USE_MAILMAN))
print '<script type="text/javascript"> print '<script type="text/javascript">
var i1=0; var i1=0;
var i2=0; var i2=0;
var i3=0;
jQuery(document).ready(function(){ jQuery(document).ready(function(){
jQuery("#exampleclick1").click(function(event){ jQuery("#exampleclick1").click(function(event){
if (i1 == 0) { jQuery("#example1").show(); i1=1; } if (i1 == 0) { jQuery("#example1").show(); i1=1; }
@ -195,7 +197,11 @@ if (! empty($conf->global->ADHERENT_USE_MAILMAN))
if (i2 == 0) { jQuery("#example2").show(); i2=1; } if (i2 == 0) { jQuery("#example2").show(); i2=1; }
else if (i2 == 1) { jQuery("#example2").hide(); i2=0; } else if (i2 == 1) { jQuery("#example2").hide(); i2=0; }
}); });
}); jQuery("#exampleclick3").click(function(){
if (i3 == 0) { jQuery("#example3").show(); i3=1; }
else if (i3 == 1) { jQuery("#example3").hide(); i3=0; }
});
});
</script>'; </script>';
form_constantes($constantes,1); form_constantes($constantes,1);

View File

@ -599,7 +599,7 @@ else
print '</table>'; print '</table>';
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail') if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA))
{ {
print '<br>'; print '<br>';
/* /*
@ -686,7 +686,7 @@ else
$formmail->withtopic=(isset($_POST['subject'])?$_POST['subject']:$langs->trans("Test")); $formmail->withtopic=(isset($_POST['subject'])?$_POST['subject']:$langs->trans("Test"));
$formmail->withtopicreadonly=0; $formmail->withtopicreadonly=0;
$formmail->withfile=2; $formmail->withfile=2;
$formmail->withbody=(isset($_POST['message'])?$_POST['message']:($action == 'testhtml'?$langs->trans("PredefinedMailTestHtml"):$langs->trans("PredefinedMailTest"))); $formmail->withbody=(isset($_POST['message'])?$_POST['message']:($action == 'testhtml'?$langs->transnoentities("PredefinedMailTestHtml"):$langs->transnoentities("PredefinedMailTest")));
$formmail->withbodyreadonly=0; $formmail->withbodyreadonly=0;
$formmail->withcancel=1; $formmail->withcancel=1;
$formmail->withdeliveryreceipt=1; $formmail->withdeliveryreceipt=1;

View File

@ -193,8 +193,7 @@ if ($action == 'setModuleOptions')
} }
// Activate a model
if ($action == 'set') if ($action == 'set')
{ {
$ret = addDocumentModel($value, $type, $label, $scandir); $ret = addDocumentModel($value, $type, $label, $scandir);
@ -359,16 +358,16 @@ print "</table><br>\n";
/* /*
* Modeles de documents * Document templates generators
*/ */
print_titre($langs->trans("ProposalsPDFModules")); print_titre($langs->trans("ProposalsPDFModules"));
// Defini tableau def de modele propal // Load array def with activated templates
$def = array(); $def = array();
$sql = "SELECT nom"; $sql = "SELECT nom";
$sql.= " FROM ".MAIN_DB_PREFIX."document_model"; $sql.= " FROM ".MAIN_DB_PREFIX."document_model";
$sql.= " WHERE type = 'propal'"; $sql.= " WHERE type = '".$type."'";
$sql.= " AND entity = ".$conf->entity; $sql.= " AND entity = ".$conf->entity;
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
@ -390,7 +389,7 @@ else
print "<table class=\"noborder\" width=\"100%\">\n"; print "<table class=\"noborder\" width=\"100%\">\n";
print "<tr class=\"liste_titre\">\n"; print "<tr class=\"liste_titre\">\n";
print " <td width=\"140\">".$langs->trans("Name")."</td>\n"; print " <td>".$langs->trans("Name")."</td>\n";
print " <td>".$langs->trans("Description")."</td>\n"; print " <td>".$langs->trans("Description")."</td>\n";
print '<td align="center" width="40">'.$langs->trans("Status")."</td>\n"; print '<td align="center" width="40">'.$langs->trans("Status")."</td>\n";
print '<td align="center" width="40">'.$langs->trans("Default")."</td>\n"; print '<td align="center" width="40">'.$langs->trans("Default")."</td>\n";

View File

@ -217,7 +217,7 @@ else
{ {
$var=true; $var=true;
if (! count($listofmethods)) print '<div class="warning">'.$langs->trans("NoSmsEngine",'<a href="http://www.dolistore.com/search.php?orderby=position&orderway=desc&search_query=smsmanager">DoliStore</a>').'</div>'; if (! count($listofmethods)) print '<div class="warning">'.$langs->trans("NoSmsEngine",'<a target="_blank" href="http://www.dolistore.com/search.php?orderby=position&orderway=desc&search_query=smsmanager">DoliStore</a>').'</div>';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>'; print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';

View File

@ -22,14 +22,15 @@
*/ */
/** /**
* \file htdocs/adherents/admin/spip.php * \file htdocs/admin/spip.php
* \ingroup mailmanspip * \ingroup mailmanspip
* \brief Page to setup the module MailmanSpip (SPIP) * \brief Page to setup the module MailmanSpip (SPIP)
*/ */
require '../../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/mailmanspip.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/mailmanspip.lib.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$langs->load("admin"); $langs->load("admin");
$langs->load("members"); $langs->load("members");

View File

@ -103,7 +103,8 @@ print "</tr>\n";
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyForSell").'</td>'; print '<tr '.$bc[$var].'><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
print '<td colspan="2">'; print '<td colspan="2">';
print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',1,1); //print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',1,1);
print $form->select_thirdparty($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',0,array(),1);
print '</td></tr>'; print '</td></tr>';
if (! empty($conf->banque->enabled)) if (! empty($conf->banque->enabled))
{ {

View File

@ -372,19 +372,19 @@ class Categorie
* Link an object to the category * Link an object to the category
* *
* @param Object $obj Object to link to category * @param Object $obj Object to link to category
* @param string $type Type of category * @param string $type Type of category (member, supplier, product, customer)
* @return int 1 : OK, -1 : erreur SQL, -2 : id non renseign, -3 : Already linked * @return int 1 : OK, -1 : erreur SQL, -2 : id not defined, -3 : Already linked
*/ */
function add_type($obj,$type) function add_type($obj,$type)
{ {
if ($this->id == -1) if ($this->id == -1) return -2;
{ if ($type == 'company') $type='societe';
return -2; if ($type == 'fournisseur') $type='societe';
}
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_".$type." (fk_categorie, fk_".($type=='fournisseur'?'societe':$type).")"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_".$type." (fk_categorie, fk_".$type.")";
$sql .= " VALUES (".$this->id.", ".$obj->id.")"; $sql .= " VALUES (".$this->id.", ".$obj->id.")";
dol_syslog(get_class($this).'::add_type sql='.$sql);
if ($this->db->query($sql)) if ($this->db->query($sql))
{ {
return 1; return 1;
@ -956,36 +956,43 @@ class Categorie
} }
/** /**
* Return list of categories linked to element of type $type with id $typeid * Return list of categories linked to element of id $id and type $typeid
* *
* @param int $id Id of element * @param int $id Id of element
* @param int $typeid Type id of link (0,1,2,3...) * @param int $typeid Type of link (0 or 'product', 1 or 'supplier', 2 or 'customer', 3 or 'member', ...)
* @return array List of category objects * @param string $mode 'object'=Get array of categories, 'label'=Get array of category labels
* @return mixed Array of category objects or < 0 if KO
*/ */
function containing($id,$typeid) function containing($id,$typeid,$mode='object')
{ {
$cats = array (); $cats = array();
$table=''; $type=''; $table=''; $type='';
if ($typeid == 0) { $table='product'; $type='product'; } if ($typeid == 0 || $typeid == 'product') { $typeid=0; $table='product'; $type='product'; }
if ($typeid == 1) { $table='societe'; $type='fournisseur'; } else if ($typeid == 1 || $typeid == 'supplier') { $typeid=1; $table='societe'; $type='fournisseur'; }
if ($typeid == 2) { $table='societe'; $type='societe'; } else if ($typeid == 2 || $typeid == 'customer') { $typeid=2; $table='societe'; $type='societe'; }
if ($typeid == 3) { $table='member'; $type='member'; } else if ($typeid == 3 || $typeid == 'member') { $typeid=3; $table='member'; $type='member'; }
$sql = "SELECT ct.fk_categorie"; $sql = "SELECT ct.fk_categorie, c.label";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie_".$type." as ct"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie_".$type." as ct, ".MAIN_DB_PREFIX."categorie as c";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON ct.fk_categorie = c.rowid"; $sql.= " WHERE ct.fk_categorie = c.rowid AND ct.fk_".$table." = ".$id." AND c.type = ".$typeid;
$sql.= " WHERE ct.fk_".$table." = ".$id." AND c.type = ".$typeid;
$sql.= " AND c.entity IN (".getEntity('category',1).")"; $sql.= " AND c.entity IN (".getEntity('category',1).")";
dol_syslog(get_class($this).'::containing sql='.$sql);
$res = $this->db->query($sql); $res = $this->db->query($sql);
if ($res) if ($res)
{ {
while ($rec = $this->db->fetch_array($res)) while ($obj = $this->db->fetch_object($res))
{ {
$cat = new Categorie($this->db); if ($mode == 'label')
$cat->fetch($rec['fk_categorie']); {
$cats[] = $cat; $cats[] = $obj->label;
}
else {
$cat = new Categorie($this->db);
$cat->fetch($obj->fk_categorie);
$cats[] = $cat;
}
} }
return $cats; return $cats;

View File

@ -668,7 +668,7 @@ if ($action == 'create')
print '<tr><td width="25%">'.$langs->trans("BackgroundColorByDefault").'</td><td colspan="3">'; print '<tr><td width="25%">'.$langs->trans("BackgroundColorByDefault").'</td><td colspan="3">';
print $htmlother->selectColor($_POST['bgcolor'],'bgcolor','new_mailing',0); print $htmlother->selectColor($_POST['bgcolor'],'bgcolor','new_mailing',0);
print '</td></tr>'; print '</td></tr>';
print '<tr><td width="25%" class="fieldrequired" valign="top">'.$langs->trans("MailMessage").'<br>'; print '<tr><td width="25%" valign="top"><span class="fieldrequired">'.$langs->trans("MailMessage").'</span><br>';
print '<br><i>'.$langs->trans("CommonSubstitutions").':<br>'; print '<br><i>'.$langs->trans("CommonSubstitutions").':<br>';
foreach($object->substitutionarray as $key => $val) foreach($object->substitutionarray as $key => $val)
{ {

View File

@ -28,6 +28,7 @@
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -59,7 +59,7 @@ if ($sortorder == "") $sortorder="DESC";
if ($sortfield == "") $sortfield="p.datec"; if ($sortfield == "") $sortfield="p.datec";
$rej = new RejetPrelevement($db, $user); $rej = new RejetPrelevement($db, $user);
$ligne = new LignePrelevement($db); $ligne = new LignePrelevement($db, $user);
/* /*
* Liste des factures * Liste des factures

View File

@ -655,6 +655,56 @@ class Form
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
} }
/**
* Return list of company for customer in Ajax if Ajax activated or go to select_thirparty_list
*
* @param int $selected Preselected products
* @param string $htmlname Name of HTML seletc field (must be unique in page)
* @param int $filter Filter on thirdparty
* @param int $limit Limit on number of returned lines
* @param array $ajaxoptions Options for ajax_autocompleter
* @param int $forcecombo Force to use combo box
* @return void
*/
function select_thirdparty($selected='', $htmlname='productid', $filter='', $limit=20, $ajaxoptions=array(), $forcecombo=0)
{
global $langs,$conf;
/* TODO Use ajax autocompletion (not finished)
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo)
{
$placeholder='';
if ($selected && empty($selected_input_value))
{
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$societe = new Societe($this->db);
$societe->fetch($selected);
$selected_input_value=$societe->ref;
}
// mode=1 means customers products
$urloption='htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished;
print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
if (empty($hidelabel)) print $langs->trans("RefOrLabel").' : ';
else if ($hidelabel > 1) {
if (! empty($conf->global->MAIN_HTML5_PLACEHOLDER)) $placeholder=' placeholder="'.$langs->trans("RefOrLabel").'"';
else $placeholder=' title="'.$langs->trans("RefOrLabel").'"';
if ($hidelabel == 2) {
print img_picto($langs->trans("Search"), 'search');
}
}
print '<input type="text" size="20" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' />';
if ($hidelabel == 3) {
print img_picto($langs->trans("Search"), 'search');
}
}
else
{*/
print $this->select_thirdparty_list($selected,$htmlname,$filter,1,0,$forcecombo,array(),'',0,$limit);
//}
}
/** /**
* Output html form to select a third party * Output html form to select a third party
* *
@ -666,12 +716,34 @@ class Form
* @param int $forcecombo Force to use combo box * @param int $forcecombo Force to use combo box
* @param array $event Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) * @param array $event Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
* @return string HTML string with * @return string HTML string with
* @deprecated Use select_thirdparty instead
*/ */
function select_company($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0, $event=array()) function select_company($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0, $event=array())
{
return $this->select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0, $event=array());
}
/**
* Output html form to select a third party
*
* @param string $selected Preselected type
* @param string $htmlname Name of field in form
* @param string $filter Optionnal filters criteras (example: 's.rowid <> x')
* @param int $showempty Add an empty field
* @param int $showtype Show third party type in combolist (customer, prospect or supplier)
* @param int $forcecombo Force to use combo box
* @param array $event Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
* @param string $filterkey Filter on key value
* @param int $outputmode 0=HTML select string, 1=Array
* @param int $limit Limit number of answers
* @return string HTML string with
*/
function select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showempty=0, $showtype=0, $forcecombo=0, $event=array(), $filterkey='', $outputmode=0, $limit=20)
{ {
global $conf,$user,$langs; global $conf,$user,$langs;
$out=''; $out='';
$outarray=array();
// On recherche les societes // On recherche les societes
$sql = "SELECT s.rowid, s.nom, s.client, s.fournisseur, s.code_client, s.code_fournisseur"; $sql = "SELECT s.rowid, s.nom, s.client, s.fournisseur, s.code_client, s.code_fournisseur";
@ -682,9 +754,33 @@ class Form
if ($filter) $sql.= " AND (".$filter.")"; if ($filter) $sql.= " AND (".$filter.")";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if (! empty($conf->global->COMPANY_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND s.status<>0 "; if (! empty($conf->global->COMPANY_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND s.status<>0 ";
// Add criteria
if ($filterkey && $filterkey != '')
{
$sql.=" AND (";
if (! empty($conf->global->COMPANY_DONOTSEARCH_ANYWHERE)) // Can use index
{
$sql.="(s.name LIKE '".$filterkey."%'";
$sql.=")";
}
else
{
// For natural search
$scrit = explode(' ', $filterkey);
foreach ($scrit as $crit) {
$sql.=" AND (s.name LIKE '%".$crit."%'";
$sql.=")";
}
}
if (! empty($conf->barcode->enabled))
{
$sql .= " OR s.barcode LIKE '".$filterkey."'";
}
$sql.=")";
}
$sql.= " ORDER BY nom ASC"; $sql.= " ORDER BY nom ASC";
dol_syslog(get_class($this)."::select_company sql=".$sql); dol_syslog(get_class($this)."::select_thirdparty_list sql=".$sql);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
@ -692,32 +788,9 @@ class Form
{ {
//$minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2); //$minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2);
$out.= ajax_combobox($htmlname, $event, $conf->global->COMPANY_USE_SEARCH_TO_SELECT); $out.= ajax_combobox($htmlname, $event, $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
/*
<<<<<<< HEAD
if ($selected && empty($selected_input_value))
{
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$product = new Product($this->db);
$product->fetch($selected);
$selected_input_value=$product->ref;
}
=======
if ($selected && empty($selected_input_value))
{
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$product = new Product($this->db);
$product->fetch($selected);
$selected_input_value=$product->ref;
}
>>>>>>> refs/remotes/origin/3.3
// mode=1 means customers products
$ajaxoptions=array();
$urloption='htmlname='.$htmlname.'&outjson=1&filter='.urlencode($filter).'&showtype='.$showtype;
$out.=ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
$out.='<input type="text" size="20" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'" />';
*/
} }
// Construct $out and $outarray
$out.= '<select id="'.$htmlname.'" class="flat" name="'.$htmlname.'">'; $out.= '<select id="'.$htmlname.'" class="flat" name="'.$htmlname.'">';
if ($showempty) $out.= '<option value="-1"></option>'; if ($showempty) $out.= '<option value="-1"></option>';
$num = $this->db->num_rows($resql); $num = $this->db->num_rows($resql);
@ -741,9 +814,12 @@ class Form
$out.= '<option value="'.$obj->rowid.'" selected="selected">'.$label.'</option>'; $out.= '<option value="'.$obj->rowid.'" selected="selected">'.$label.'</option>';
} }
else else
{ {
$out.= '<option value="'.$obj->rowid.'">'.$label.'</option>'; $out.= '<option value="'.$obj->rowid.'">'.$label.'</option>';
} }
array_push($outarray, array('key'=>$obj->rowid, 'value'=>$obj->name, 'label'=>$obj->name));
$i++; $i++;
} }
} }
@ -754,6 +830,7 @@ class Form
dol_print_error($this->db); dol_print_error($this->db);
} }
if ($outputmode) return $outarray;
return $out; return $out;
} }
@ -1114,7 +1191,7 @@ class Form
/** /**
* Return list of products for customer in Ajax if Ajax activated or go to select_produits_do * Return list of products for customer in Ajax if Ajax activated or go to select_produits_list
* *
* @param int $selected Preselected products * @param int $selected Preselected products
* @param string $htmlname Name of HTML seletc field (must be unique in page) * @param string $htmlname Name of HTML seletc field (must be unique in page)
@ -1162,8 +1239,8 @@ class Form
} }
} }
else else
{ {
$this->select_produits_do($selected,$htmlname,$filtertype,$limit,$price_level,'',$status,$finished,0); print $this->select_produits_list($selected,$htmlname,$filtertype,$limit,$price_level,'',$status,$finished,0);
} }
} }
@ -1178,13 +1255,16 @@ class Form
* @param string $filterkey Filter on product * @param string $filterkey Filter on product
* @param int $status -1=Return all products, 0=Products not on sell, 1=Products on sell * @param int $status -1=Return all products, 0=Products not on sell, 1=Products on sell
* @param int $finished Filter on finished field: 2=No filter * @param int $finished Filter on finished field: 2=No filter
* @param int $disableout Disable print output * @param int $outputmode 0=HTML select string, 1=Array
* @return array Array of keys for json * @return array Array of keys for json
*/ */
function select_produits_do($selected='',$htmlname='productid',$filtertype='',$limit=20,$price_level=0,$filterkey='',$status=1,$finished=2,$disableout=0) function select_produits_list($selected='',$htmlname='productid',$filtertype='',$limit=20,$price_level=0,$filterkey='',$status=1,$finished=2,$outputmode=0)
{ {
global $langs,$conf,$user,$db; global $langs,$conf,$user,$db;
$out='';
$outarray=array();
$sql = "SELECT "; $sql = "SELECT ";
$sql.= " p.rowid, p.label, p.ref, p.description, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.stock"; $sql.= " p.rowid, p.label, p.ref, p.description, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.stock";
// Multilang : we add translation // Multilang : we add translation
@ -1228,6 +1308,7 @@ class Form
// Add criteria on ref/label // Add criteria on ref/label
if ($filterkey && $filterkey != '') if ($filterkey && $filterkey != '')
{ {
$sql.=" AND (";
if (! empty($conf->global->PRODUCT_DONOTSEARCH_ANYWHERE)) // Can use index if (! empty($conf->global->PRODUCT_DONOTSEARCH_ANYWHERE)) // Can use index
{ {
$sql.=" AND (p.ref LIKE '".$filterkey."%' OR p.label LIKE '".$filterkey."%'"; $sql.=" AND (p.ref LIKE '".$filterkey."%' OR p.label LIKE '".$filterkey."%'";
@ -1249,22 +1330,20 @@ class Form
{ {
$sql .= " OR p.barcode LIKE '".$filterkey."'"; $sql .= " OR p.barcode LIKE '".$filterkey."'";
} }
$sql.=")";
} }
$sql.= $db->order("p.ref"); $sql.= $db->order("p.ref");
$sql.= $db->plimit($limit); $sql.= $db->plimit($limit);
// Build output string // Build output string
$outselect=''; dol_syslog(get_class($this)."::select_produits_list search product sql=".$sql, LOG_DEBUG);
$outjson=array();
dol_syslog(get_class($this)."::select_produits_do search product sql=".$sql, LOG_DEBUG);
$result=$this->db->query($sql); $result=$this->db->query($sql);
if ($result) if ($result)
{ {
$num = $this->db->num_rows($result); $num = $this->db->num_rows($result);
$outselect.='<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">'; $out.='<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">';
$outselect.='<option value="0" selected="selected">&nbsp;</option>'; $out.='<option value="0" selected="selected">&nbsp;</option>';
$i = 0; $i = 0;
while ($num && $i < $num) while ($num && $i < $num)
@ -1273,13 +1352,14 @@ class Form
$optJson = array(); $optJson = array();
$objp = $this->db->fetch_object($result); $objp = $this->db->fetch_object($result);
if(!empty($objp->price_by_qty) && $objp->price_by_qty == 1) { // Price by quantity will return many prices for the same product if (!empty($objp->price_by_qty) && $objp->price_by_qty == 1)
{ // Price by quantity will return many prices for the same product
$sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise"; $sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise";
$sql.= " FROM ".MAIN_DB_PREFIX."product_price_by_qty"; $sql.= " FROM ".MAIN_DB_PREFIX."product_price_by_qty";
$sql.= " WHERE fk_product_price=".$objp->price_rowid; $sql.= " WHERE fk_product_price=".$objp->price_rowid;
$sql.= " ORDER BY quantity ASC"; $sql.= " ORDER BY quantity ASC";
dol_syslog(get_class($this)."::select_produits_do search price by qty sql=".$sql); dol_syslog(get_class($this)."::select_produits_list search price by qty sql=".$sql);
$result2 = $this->db->query($sql); $result2 = $this->db->query($sql);
if ($result2) if ($result2)
{ {
@ -1302,31 +1382,33 @@ class Form
// Add new entry // Add new entry
// "key" value of json key array is used by jQuery automatically as selected value // "key" value of json key array is used by jQuery automatically as selected value
// "label" value of json key array is used by jQuery automatically as text for combo box // "label" value of json key array is used by jQuery automatically as text for combo box
$outselect.=$opt; $out.=$opt;
array_push($outjson, $optJson); array_push($outarray, $optJson);
} }
} }
} else { }
else
{
$this->_construct_product_list_option($objp, $opt, $optJson, $price_level, $selected); $this->_construct_product_list_option($objp, $opt, $optJson, $price_level, $selected);
// Add new entry // Add new entry
// "key" value of json key array is used by jQuery automatically as selected value // "key" value of json key array is used by jQuery automatically as selected value
// "label" value of json key array is used by jQuery automatically as text for combo box // "label" value of json key array is used by jQuery automatically as text for combo box
$outselect.=$opt; $out.=$opt;
array_push($outjson, $optJson); array_push($outarray, $optJson);
} }
$i++; $i++;
} }
$outselect.='</select>'; $out.='</select>';
$this->db->free($result); $this->db->free($result);
if (empty($disableout)) print $outselect; if (empty($outputmode)) return $out;
return $outjson; return $outarray;
} }
else else
{ {
dol_print_error($db); dol_print_error($db);
} }
} }
@ -1399,7 +1481,7 @@ class Form
$sql.= " ORDER BY date_price"; $sql.= " ORDER BY date_price";
$sql.= " DESC LIMIT 1"; $sql.= " DESC LIMIT 1";
dol_syslog(get_class($this)."::select_produits_do search price for level '.$price_level.' sql=".$sql); dol_syslog(get_class($this)."::_construct_product_list_option search price for level '.$price_level.' sql=".$sql);
$result2 = $this->db->query($sql); $result2 = $this->db->query($sql);
if ($result2) if ($result2)
{ {
@ -1430,7 +1512,8 @@ class Form
} }
// Price by quantity // Price by quantity
if (!empty($objp->quantity) && $objp->quantity >= 1) { if (!empty($objp->quantity) && $objp->quantity >= 1)
{
$found = 1; $found = 1;
$outqty=$objp->quantity; $outqty=$objp->quantity;
$outdiscount=$objp->remise_percent; $outdiscount=$objp->remise_percent;
@ -1511,7 +1594,7 @@ class Form
} }
/** /**
* Return list of products for customer (in Ajax if Ajax activated or go to select_produits_fournisseurs_do) * Return list of products for customer (in Ajax if Ajax activated or go to select_produits_fournisseurs_list)
* *
* @param int $socid Id third party * @param int $socid Id third party
* @param string $selected Preselected product * @param string $selected Preselected product
@ -1536,7 +1619,7 @@ class Form
} }
else else
{ {
$this->select_produits_fournisseurs_do($socid,$selected,$htmlname,$filtertype,$filtre,'',-1,0); print $this->select_produits_fournisseurs_list($socid,$selected,$htmlname,$filtertype,$filtre,'',-1,0);
} }
} }
@ -1550,13 +1633,16 @@ class Form
* @param string $filtre Pour filtre sql * @param string $filtre Pour filtre sql
* @param string $filterkey Filtre des produits * @param string $filterkey Filtre des produits
* @param int $statut -1=Return all products, 0=Products not on sell, 1=Products on sell * @param int $statut -1=Return all products, 0=Products not on sell, 1=Products on sell
* @param int $disableout Disable print output * @param int $outputmode 0=HTML select string, 1=Array
* @return array Array of keys for json * @return array Array of keys for json
*/ */
function select_produits_fournisseurs_do($socid,$selected='',$htmlname='productid',$filtertype='',$filtre='',$filterkey='',$statut=-1,$disableout=0) function select_produits_fournisseurs_list($socid,$selected='',$htmlname='productid',$filtertype='',$filtre='',$filterkey='',$statut=-1,$outputmode=0)
{ {
global $langs,$conf; global $langs,$conf;
$out='';
$outarray=array();
$langs->load('stocks'); $langs->load('stocks');
$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration,"; $sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration,";
@ -1590,20 +1676,18 @@ class Form
$sql.= " ORDER BY pfp.ref_fourn DESC, pfp.quantity ASC"; $sql.= " ORDER BY pfp.ref_fourn DESC, pfp.quantity ASC";
// Build output string // Build output string
$outselect='';
$outjson=array();
dol_syslog(get_class($this)."::select_produits_fournisseurs_do sql=".$sql,LOG_DEBUG); dol_syslog(get_class($this)."::select_produits_fournisseurs_list sql=".$sql,LOG_DEBUG);
$result=$this->db->query($sql); $result=$this->db->query($sql);
if ($result) if ($result)
{ {
$num = $this->db->num_rows($result); $num = $this->db->num_rows($result);
//$outselect.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">'; // remove select to have id same with combo and ajax //$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">'; // remove select to have id same with combo and ajax
$outselect.='<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">'; $out.='<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
if (! $selected) $outselect.='<option value="0" selected="selected">&nbsp;</option>'; if (! $selected) $out.='<option value="0" selected="selected">&nbsp;</option>';
else $outselect.='<option value="0">&nbsp;</option>'; else $out.='<option value="0">&nbsp;</option>';
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)
@ -1694,9 +1778,9 @@ class Form
// Add new entry // Add new entry
// "key" value of json key array is used by jQuery automatically as selected value // "key" value of json key array is used by jQuery automatically as selected value
// "label" value of json key array is used by jQuery automatically as text for combo box // "label" value of json key array is used by jQuery automatically as text for combo box
$outselect.=$opt; $out.=$opt;
array_push($outjson, array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'qty'=>$outqty, 'discount'=>$outdiscount, 'disabled'=>(empty($objp->idprodfournprice)?true:false))); array_push($outarray, array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'qty'=>$outqty, 'discount'=>$outdiscount, 'disabled'=>(empty($objp->idprodfournprice)?true:false)));
// Exemple of var_dump $outjson // Exemple of var_dump $outarray
// array(1) {[0]=>array(6) {[key"]=>string(1) "2" ["value"]=>string(3) "ppp" // array(1) {[0]=>array(6) {[key"]=>string(1) "2" ["value"]=>string(3) "ppp"
// ["label"]=>string(76) "ppp (<strong>f</strong>ff2) - ppp - 20,00 Euros/1unité (20,00 Euros/unité)" // ["label"]=>string(76) "ppp (<strong>f</strong>ff2) - ppp - 20,00 Euros/1unité (20,00 Euros/unité)"
// ["qty"]=>string(1) "1" ["discount"]=>string(1) "0" ["disabled"]=>bool(false) // ["qty"]=>string(1) "1" ["discount"]=>string(1) "0" ["disabled"]=>bool(false)
@ -1707,12 +1791,12 @@ class Form
$i++; $i++;
} }
$outselect.='</select>'; $out.='</select>';
$this->db->free($result); $this->db->free($result);
if (empty($disableout)) print $outselect; if (empty($outputmode)) return $out;
return $outjson; return $outarray;
} }
else else
{ {

View File

@ -596,7 +596,7 @@ class FormMail
if (!empty($conf->global->FCKEDITOR_ENABLE_MAIL)) { if (!empty($conf->global->FCKEDITOR_ENABLE_MAIL)) {
$this->withfckeditor=1; $this->withfckeditor=1;
} }
$doleditor=new DolEditor('message',nl2br($defaultmessage),'',280,$this->ckeditortoolbar,'In',true,true,$this->withfckeditor,8,72); $doleditor=new DolEditor('message',$defaultmessage,'',280,$this->ckeditortoolbar,'In',true,true,$this->withfckeditor,8,72);
$out.= $doleditor->Create(1); $out.= $doleditor->Create(1);
} }
$out.= "</td></tr>\n"; $out.= "</td></tr>\n";

View File

@ -87,13 +87,13 @@ class InfoBox
{ {
if (preg_match('/^([^@]+)@([^@]+)$/i',$obj->file,$regs)) if (preg_match('/^([^@]+)@([^@]+)$/i',$obj->file,$regs))
{ {
$boxname = preg_replace('/.php$/i','',$regs[1]); $boxname = preg_replace('/\.php$/i','',$regs[1]);
$module = $regs[2]; $module = $regs[2];
$relsourcefile = "/".$module."/core/boxes/".$boxname.".php"; $relsourcefile = "/".$module."/core/boxes/".$boxname.".php";
} }
else else
{ {
$boxname=preg_replace('/.php$/i','',$obj->file); $boxname=preg_replace('/\.php$/i','',$obj->file);
$relsourcefile = "/core/boxes/".$boxname.".php"; $relsourcefile = "/core/boxes/".$boxname.".php";
} }

View File

@ -1076,6 +1076,17 @@ function form_constantes($tableau,$strictw3c=0)
print '</div>'; print '</div>';
//print 'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members/remove?adminpw=%MAILMAN_ADMINPW%&unsubscribees=%EMAIL%'; //print 'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members/remove?adminpw=%MAILMAN_ADMINPW%&unsubscribees=%EMAIL%';
} }
if ($const == 'ADHERENT_MAILMAN_LISTS')
{
print '. '.$langs->trans("Example").': <a href="#" id="exampleclick3">'.img_down().'</a><br>';
print '<div id="example3" class="hidden">';
print 'mymailmanlist<br>';
print 'mymailmanlist1,mymailmanlist2<br>';
print 'TYPE:Type1:mymailmanlist1,TYPE:Type2:mymailmanlist2<br>';
if ($conf->categorie->enabled) print 'CATEG:Categ1:mymailmanlist1,CATEG:Categ2:mymailmanlist2<br>';
print '</div>';
//print 'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members/remove?adminpw=%MAILMAN_ADMINPW%&unsubscribees=%EMAIL%';
}
print "</td>\n"; print "</td>\n";

View File

@ -32,12 +32,12 @@ function mailmanspip_admin_prepare_head()
return array( return array(
array( array(
DOL_URL_ROOT.'/adherents/admin/mailman.php', DOL_URL_ROOT.'/admin/mailman.php',
$langs->trans('Mailman'), $langs->trans('Mailman'),
'mailman' 'mailman'
), ),
array( array(
DOL_URL_ROOT.'/adherents/admin/spip.php', DOL_URL_ROOT.'/admin/spip.php',
$langs->trans('SPIP'), $langs->trans('SPIP'),
'spip' 'spip'
) )

View File

@ -110,7 +110,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
-- Commercial - Proposals -- Commercial - Proposals
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1100__+MAX_llx_menu__, 'commercial', 'propals', 5__+MAX_llx_menu__, '/comm/propal/index.php?leftmenu=propals', 'Prop', 0, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1100__+MAX_llx_menu__, 'commercial', 'propals', 5__+MAX_llx_menu__, '/comm/propal/index.php?leftmenu=propals', 'Prop', 0, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1101__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/societe/societe.php?leftmenu=propals', 'NewPropal', 1, 'propal', '$user->rights->propale->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1101__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal.php?action=create&amp;leftmenu=propals', 'NewPropal', 1, 'propal', '$user->rights->propale->creer', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1102__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/list.php?leftmenu=propals', 'List', 1, 'propal', '$user->rights->propale->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1102__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/list.php?leftmenu=propals', 'List', 1, 'propal', '$user->rights->propale->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1103__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?leftmenu=propals&amp;viewstatut=0', 'PropalsDraft', 1, 'propal', '$user->rights->propale->lire', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1103__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?leftmenu=propals&amp;viewstatut=0', 'PropalsDraft', 1, 'propal', '$user->rights->propale->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1104__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?leftmenu=propals&amp;viewstatut=1', 'PropalsOpened', 1, 'propal', '$user->rights->propale->lire', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1104__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?leftmenu=propals&amp;viewstatut=1', 'PropalsOpened', 1, 'propal', '$user->rights->propale->lire', '', 2, 3, __ENTITY__);
@ -120,7 +120,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1110__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/stats/index.php?leftmenu=propals', 'Statistics', 1, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1110__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/stats/index.php?leftmenu=propals', 'Statistics', 1, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__);
-- Commercial - Customer's orders -- Commercial - Customer's orders
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1200__+MAX_llx_menu__, 'commercial', 'orders', 5__+MAX_llx_menu__, '/commande/index.php?leftmenu=orders', 'CustomersOrders', 0, 'orders', '$user->rights->commande->lire', '', 2, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1200__+MAX_llx_menu__, 'commercial', 'orders', 5__+MAX_llx_menu__, '/commande/index.php?leftmenu=orders', 'CustomersOrders', 0, 'orders', '$user->rights->commande->lire', '', 2, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1201__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/societe/societe.php?leftmenu=orders', 'NewOrder', 1, 'orders', '$user->rights->commande->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1201__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/fiche.php?action=create&amp;leftmenu=orders', 'NewOrder', 1, 'orders', '$user->rights->commande->creer', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1202__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/liste.php?leftmenu=orders', 'List', 1, 'orders', '$user->rights->commande->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1202__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/liste.php?leftmenu=orders', 'List', 1, 'orders', '$user->rights->commande->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1203__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/liste.php?leftmenu=orders&amp;viewstatut=0', 'StatusOrderDraftShort', 1, 'orders', '$user->rights->commande->lire', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1203__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/liste.php?leftmenu=orders&amp;viewstatut=0', 'StatusOrderDraftShort', 1, 'orders', '$user->rights->commande->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1204__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/liste.php?leftmenu=orders&amp;viewstatut=1', 'StatusOrderValidated', 1, 'orders', '$user->rights->commande->lire', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1204__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/liste.php?leftmenu=orders&amp;viewstatut=1', 'StatusOrderValidated', 1, 'orders', '$user->rights->commande->lire', '', 2, 3, __ENTITY__);
@ -131,12 +131,12 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1209__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/stats/index.php?leftmenu=orders', 'Statistics', 1, 'orders', '$user->rights->commande->lire', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1209__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/stats/index.php?leftmenu=orders', 'Statistics', 1, 'orders', '$user->rights->commande->lire', '', 2, 4, __ENTITY__);
-- Commercial - Supplier's orders -- Commercial - Supplier's orders
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->fournisseur->enabled', __HANDLER__, 'left', 5100__+MAX_llx_menu__, 'commercial', 'orders_suppliers', 5__+MAX_llx_menu__, '/fourn/commande/index.php?leftmenu=orders_suppliers', 'SuppliersOrders', 0, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->fournisseur->enabled', __HANDLER__, 'left', 5100__+MAX_llx_menu__, 'commercial', 'orders_suppliers', 5__+MAX_llx_menu__, '/fourn/commande/index.php?leftmenu=orders_suppliers', 'SuppliersOrders', 0, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 6, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->fournisseur->enabled', __HANDLER__, 'left', 5101__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/societe/societe.php?leftmenu=orders_suppliers', 'NewOrder', 1, 'orders', '$user->rights->fournisseur->commande->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->fournisseur->enabled', __HANDLER__, 'left', 5101__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/fiche.php?action=create&amp;leftmenu=orders_suppliers', 'NewOrder', 1, 'orders', '$user->rights->fournisseur->commande->creer', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->fournisseur->enabled', __HANDLER__, 'left', 5102__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/liste.php?leftmenu=orders_suppliers&amp;viewstatut=0', 'List', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->fournisseur->enabled', __HANDLER__, 'left', 5102__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/liste.php?leftmenu=orders_suppliers&amp;viewstatut=0', 'List', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->fournisseur->enabled', __HANDLER__, 'left', 5108__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/commande/stats/index.php?leftmenu=orders_suppliers&amp;mode=supplier', 'Statistics', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 7, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->fournisseur->enabled', __HANDLER__, 'left', 5108__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/commande/stats/index.php?leftmenu=orders_suppliers&amp;mode=supplier', 'Statistics', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 7, __ENTITY__);
-- Commercial - Contracts -- Commercial - Contracts
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1400__+MAX_llx_menu__, 'commercial', 'contracts', 5__+MAX_llx_menu__, '/contrat/index.php?leftmenu=contracts', 'Contracts', 0, 'contracts', '$user->rights->contrat->lire', '', 2, 7, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1400__+MAX_llx_menu__, 'commercial', 'contracts', 5__+MAX_llx_menu__, '/contrat/index.php?leftmenu=contracts', 'Contracts', 0, 'contracts', '$user->rights->contrat->lire', '', 2, 7, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1401__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/societe/societe.php?leftmenu=contracts', 'NewContract', 1, 'contracts', '$user->rights->contrat->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1401__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/fiche.php?&action=create&amp;leftmenu=contracts', 'NewContract', 1, 'contracts', '$user->rights->contrat->creer', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1402__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/liste.php?leftmenu=contracts', 'List', 1, 'contracts', '$user->rights->contrat->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1402__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/liste.php?leftmenu=contracts', 'List', 1, 'contracts', '$user->rights->contrat->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1403__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/services.php?leftmenu=contracts', 'MenuServices', 1, 'contracts', '$user->rights->contrat->lire', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1403__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/services.php?leftmenu=contracts', 'MenuServices', 1, 'contracts', '$user->rights->contrat->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled&&$leftmenu=="contracts"', __HANDLER__, 'left', 1404__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services.php?leftmenu=contracts&amp;mode=0', 'MenuInactiveServices', 2, 'contracts', '$user->rights->contrat->lire', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled&&$leftmenu=="contracts"', __HANDLER__, 'left', 1404__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services.php?leftmenu=contracts&amp;mode=0', 'MenuInactiveServices', 2, 'contracts', '$user->rights->contrat->lire', '', 2, 0, __ENTITY__);
@ -155,7 +155,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->fournisseur->enabled', __HANDLER__, 'left', 1604__+MAX_llx_menu__, 'accountancy', '', 1600__+MAX_llx_menu__, '/compta/facture/stats/index.php?leftmenu=customers_bills&mode=supplier', 'Statistics', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 8, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->fournisseur->enabled', __HANDLER__, 'left', 1604__+MAX_llx_menu__, 'accountancy', '', 1600__+MAX_llx_menu__, '/compta/facture/stats/index.php?leftmenu=customers_bills&mode=supplier', 'Statistics', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 8, __ENTITY__);
-- Accountancy - Customer invoice -- Accountancy - Customer invoice
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'accountancy', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'accountancy', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/clients.php?action=facturer&amp;leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/facture.php?action=create&amp;leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1702__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/facture/fiche-rec.php?leftmenu=customers_bills', 'Repeatable', 1, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1702__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/facture/fiche-rec.php?leftmenu=customers_bills', 'Repeatable', 1, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1703__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/facture/impayees.php?action=facturer&amp;leftmenu=customers_bills', 'Unpaid', 1, 'bills', '$user->rights->facture->lire', '', 2, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1703__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/facture/impayees.php?action=facturer&amp;leftmenu=customers_bills', 'Unpaid', 1, 'bills', '$user->rights->facture->lire', '', 2, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1704__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/paiement/liste.php?leftmenu=customers_bills', 'Payments', 1, 'bills', '$user->rights->facture->lire', '', 2, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1704__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/paiement/liste.php?leftmenu=customers_bills', 'Payments', 1, 'bills', '$user->rights->facture->lire', '', 2, 6, __ENTITY__);

View File

@ -680,7 +680,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
{ {
$langs->load("orders"); $langs->load("orders");
$newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders'); $newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
$newmenu->add("/commande/fiche.php?action=create", $langs->trans("NewOrder"), 1, $user->rights->commande->creer); $newmenu->add("/commande/fiche.php?action=create&amp;leftmenu=orders", $langs->trans("NewOrder"), 1, $user->rights->commande->creer);
$newmenu->add("/commande/liste.php?leftmenu=orders", $langs->trans("List"), 1, $user->rights->commande->lire); $newmenu->add("/commande/liste.php?leftmenu=orders", $langs->trans("List"), 1, $user->rights->commande->lire);
if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire); if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire);
if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire); if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire);
@ -696,7 +696,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
{ {
$langs->load("orders"); $langs->load("orders");
$newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers",$langs->trans("SuppliersOrders"), 0, $user->rights->fournisseur->commande->lire, '', $mainmenu, 'orders_suppliers'); $newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers",$langs->trans("SuppliersOrders"), 0, $user->rights->fournisseur->commande->lire, '', $mainmenu, 'orders_suppliers');
$newmenu->add("/fourn/commande/fiche.php?action=create", $langs->trans("NewOrder"), 1, $user->rights->fournisseur->commande->creer); $newmenu->add("/fourn/commande/fiche.php?action=create&amp;leftmenu=orders_suppliers", $langs->trans("NewOrder"), 1, $user->rights->fournisseur->commande->creer);
$newmenu->add("/fourn/commande/liste.php?leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->rights->fournisseur->commande->lire); $newmenu->add("/fourn/commande/liste.php?leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->rights->fournisseur->commande->lire);
$newmenu->add("/commande/stats/index.php?leftmenu=orders_suppliers&amp;mode=supplier", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire); $newmenu->add("/commande/stats/index.php?leftmenu=orders_suppliers&amp;mode=supplier", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire);
} }

View File

@ -62,7 +62,7 @@ class modMailmanSpip extends DolibarrModules
$this->requiredby = array(); $this->requiredby = array();
// Config pages // Config pages
$this->config_page_url = array('mailman.php@adherents'); $this->config_page_url = array('mailman.php');
// Constants // Constants
$this->const = array(); $this->const = array();

View File

@ -106,7 +106,7 @@ class modOpenSurvey extends DolibarrModules
// Add here list of permission defined by an id, a label, a boolean and two constant strings. // Add here list of permission defined by an id, a label, a boolean and two constant strings.
// Example: // Example:
$this->rights[$r][0] = 55000; // Permission id (must not be already used) $this->rights[$r][0] = 55001; // Permission id (must not be already used)
$this->rights[$r][1] = 'Read surveys'; // Permission label $this->rights[$r][1] = 'Read surveys'; // Permission label
$this->rights[$r][2] = 'r'; // Permission by default for new user (0/1) $this->rights[$r][2] = 'r'; // Permission by default for new user (0/1)
$this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][3] = 0; // Permission by default for new user (0/1)
@ -116,7 +116,7 @@ class modOpenSurvey extends DolibarrModules
// Add here list of permission defined by an id, a label, a boolean and two constant strings. // Add here list of permission defined by an id, a label, a boolean and two constant strings.
// Example: // Example:
$this->rights[$r][0] = 55001; // Permission id (must not be already used) $this->rights[$r][0] = 55002; // Permission id (must not be already used)
$this->rights[$r][1] = 'Create/modify surveys'; // Permission label $this->rights[$r][1] = 'Create/modify surveys'; // Permission label
$this->rights[$r][2] = 'w'; // Permission by default for new user (0/1) $this->rights[$r][2] = 'w'; // Permission by default for new user (0/1)
$this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][3] = 0; // Permission by default for new user (0/1)

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2004-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com> * Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010 Pierre Morin <pierre.morin@auguria.net> * Copyright (C) 2010 Pierre Morin <pierre.morin@auguria.net>

View File

@ -1065,7 +1065,6 @@ if ($action == 'create')
print $object->showOptionals($extrafields,'edit'); print $object->showOptionals($extrafields,'edit');
} }
// Show link to origin object // Show link to origin object
if (! empty($origin) && ! empty($originid) && is_object($objectsrc)) if (! empty($origin) && ! empty($originid) && is_object($objectsrc))
{ {
@ -1082,56 +1081,6 @@ if ($action == 'create')
print '<input type="hidden" name="originid" value="'.$objectsrc->id.'">'; print '<input type="hidden" name="originid" value="'.$objectsrc->id.'">';
} }
// Model
print '<tr>';
print '<td>'.$langs->trans("DefaultModel").'</td>';
print '<td colspan="2">';
$liste=ModelePDFFicheinter::liste_modeles($db);
print $form->selectarray('model',$liste,$conf->global->FICHEINTER_ADDON_PDF);
print "</td></tr>";
// Public note
print '<tr>';
print '<td class="border" valign="top">'.$langs->trans('NotePublic').'</td>';
print '<td valign="top" colspan="2">';
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
print $doleditor->Create(1);
//print '<textarea name="note_public" cols="80" rows="'.ROWS_3.'">'.$note_public.'</textarea>';
print '</td></tr>';
// Private note
if (!empty($user->societe_id))
{
print '<tr>';
print '<td class="border" valign="top">'.$langs->trans('NotePrivate').'</td>';
print '<td valign="top" colspan="2">';
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
print $doleditor->Create(1);
//print '<textarea name="note_private" cols="80" rows="'.ROWS_3.'">'.$note_private.'</textarea>';
print '</td></tr>';
}
// Other attributes
$parameters=array('colspan' => ' colspan="2"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
// Show link to origin object
if (! empty($origin) && ! empty($originid) && is_object($objectsrc))
{
$newclassname=$classname;
if ($newclassname=='Propal') $newclassname='CommercialProposal';
print '<tr><td>'.$langs->trans($newclassname).'</td><td colspan="2">'.$objectsrc->getNomUrl(1).'</td></tr>';
}
print '</table>';
if (is_object($objectsrc))
{
print '<input type="hidden" name="origin" value="'.$objectsrc->element.'">';
print '<input type="hidden" name="originid" value="'.$objectsrc->id.'">';
}
print '<center><br>'; print '<center><br>';
print '<input type="submit" class="button" value="'.$langs->trans("CreateDraftIntervention").'">'; print '<input type="submit" class="button" value="'.$langs->trans("CreateDraftIntervention").'">';
print '</center>'; print '</center>';

View File

@ -1802,7 +1802,7 @@ class CommandeFournisseur extends CommonOrder
$sql.= ",total_localtax1='".price2num($total_localtax1)."'"; $sql.= ",total_localtax1='".price2num($total_localtax1)."'";
$sql.= ",total_localtax2='".price2num($total_localtax2)."'"; $sql.= ",total_localtax2='".price2num($total_localtax2)."'";
$sql.= ",total_ttc='".price2num($total_ttc)."'"; $sql.= ",total_ttc='".price2num($total_ttc)."'";
$sql.= ",product_type='".$type."'"; $sql.= ",product_type=".$type;
$sql.= " WHERE rowid = ".$rowid; $sql.= " WHERE rowid = ".$rowid;
dol_syslog(get_class($this)."::updateline sql=".$sql); dol_syslog(get_class($this)."::updateline sql=".$sql);
@ -2063,7 +2063,7 @@ class CommandeFournisseurLigne
$sql.= ' cd.localtax1_tx, cd.localtax2_tx,'; $sql.= ' cd.localtax1_tx, cd.localtax2_tx,';
$sql.= ' cd.remise, cd.remise_percent, cd.subprice,'; $sql.= ' cd.remise, cd.remise_percent, cd.subprice,';
$sql.= ' cd.info_bits, cd.total_ht, cd.total_tva, cd.total_ttc,'; $sql.= ' cd.info_bits, cd.total_ht, cd.total_tva, cd.total_ttc,';
$sql.= ' cd.total_localtax1, cd.local_localtax2,'; $sql.= ' cd.total_localtax1, cd.total_localtax2,';
$sql.= ' p.ref as product_ref, p.label as product_libelle, p.description as product_desc'; $sql.= ' p.ref as product_ref, p.label as product_libelle, p.description as product_desc';
$sql.= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet as cd'; $sql.= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet as cd';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON cd.fk_product = p.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON cd.fk_product = p.rowid';
@ -2096,10 +2096,12 @@ class CommandeFournisseurLigne
$this->product_desc = $objp->product_desc; $this->product_desc = $objp->product_desc;
$this->db->free($result); $this->db->free($result);
return 1;
} }
else else
{ {
dol_print_error($this->db); dol_print_error($this->db);
return -1;
} }
} }

View File

@ -336,10 +336,11 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
*/ */
else if ($action == 'updateligne' && $user->rights->fournisseur->commande->creer && $_POST['save'] == $langs->trans('Save')) else if ($action == 'updateligne' && $user->rights->fournisseur->commande->creer && $_POST['save'] == $langs->trans('Save'))
{ {
$product=new Product($db);
if ($_POST["elrowid"]) if ($_POST["elrowid"])
{ {
if ($product->fetch($_POST["elrowid"]) < 0) dol_print_error($db); $line = new CommandeFournisseurLigne($db);
$res = $line->fetch($_POST["elrowid"]);
if (!$res) dol_print_error($db);
} }
$localtax1_tx=get_localtax($_POST['tva_tx'],1,$mysoc,$object->thirdparty); $localtax1_tx=get_localtax($_POST['tva_tx'],1,$mysoc,$object->thirdparty);
@ -356,9 +357,18 @@ else if ($action == 'updateligne' && $user->rights->fournisseur->commande->creer
$localtax2_tx, $localtax2_tx,
'HT', 'HT',
0, 0,
isset($_POST["type"])?$_POST["type"]:$product->type isset($_POST["type"])?$_POST["type"]:$line->product_type
); );
unset($_POST['qty']);
unset($_POST['type']);
unset($_POST['idprodfournprice']);
unset($_POST['remmise_percent']);
unset($_POST['dp_desc']);
unset($_POST['np_desc']);
unset($_POST['pu']);
unset($_POST['tva_tx']);
unset($localtax1_tx);
unset($localtax2_tx);
if ($result >= 0) if ($result >= 0)
{ {
$outputlangs = $langs; $outputlangs = $langs;

View File

@ -51,7 +51,6 @@ insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_M
-- --
-- IHM -- IHM
-- --
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_LISTE_LIMIT','25','chaine','Longueur maximum des listes',0,0); insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_LISTE_LIMIT','25','chaine','Longueur maximum des listes',0,0);
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SHOW_WORKBOARD','1','yesno','Affichage tableau de bord de travail Dolibarr',0,0); insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SHOW_WORKBOARD','1','yesno','Affichage tableau de bord de travail Dolibarr',0,0);
@ -62,7 +61,7 @@ insert into llx_const (name, value, type, note, visible) values ('MAIN_MENUFRONT
-- --
-- Delai tolerance -- Warning delays
-- --
insert into llx_const (name, value, type, note, visible) values ('MAIN_DELAY_ACTIONS_TODO','7','chaine','Tolérance de retard avant alerte (en jours) sur actions planifiées non réalisées',0); insert into llx_const (name, value, type, note, visible) values ('MAIN_DELAY_ACTIONS_TODO','7','chaine','Tolérance de retard avant alerte (en jours) sur actions planifiées non réalisées',0);
insert into llx_const (name, value, type, note, visible) values ('MAIN_DELAY_ORDERS_TO_PROCESS','2','chaine','Tolérance de retard avant alerte (en jours) sur commandes clients non traitées',0); insert into llx_const (name, value, type, note, visible) values ('MAIN_DELAY_ORDERS_TO_PROCESS','2','chaine','Tolérance de retard avant alerte (en jours) sur commandes clients non traitées',0);
@ -77,13 +76,8 @@ insert into llx_const (name, value, type, note, visible) values ('MAIN_DELAY_MEM
insert into llx_const (name, value, type, note, visible) values ('MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE','62','chaine','Tolérance de retard avant alerte (en jours) sur rapprochements bancaires à faire',0); insert into llx_const (name, value, type, note, visible) values ('MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE','62','chaine','Tolérance de retard avant alerte (en jours) sur rapprochements bancaires à faire',0);
--
-- Tiers
--
insert into llx_const (name, value, type, note, visible, entity) values ('SOCIETE_NOLIST_COURRIER','1','yesno','Liste les fichiers du repertoire courrier',0,0);
-- --
-- Mail Mailing -- Mail Mailing
-- --
insert into llx_const (name, value, type, note, visible) values ('MAIN_FIX_FOR_BUGGED_MTA','1','chaine','Set constant to fix email ending from PHP with some linux ike system',1);
insert into llx_const (name, value, type, note, visible) values ('MAILING_EMAIL_FROM','dolibarr@domain.com','chaine','EMail emmetteur pour les envois d emailings',0); insert into llx_const (name, value, type, note, visible) values ('MAILING_EMAIL_FROM','dolibarr@domain.com','chaine','EMail emmetteur pour les envois d emailings',0);

View File

@ -80,8 +80,8 @@ insert into llx_c_actioncomm (id, code, type, libelle, module, position) values
UPDATE llx_product p SET p.stock= (SELECT SUM(ps.reel) FROM llx_product_stock ps WHERE ps.fk_product = p.rowid); UPDATE llx_product p SET p.stock= (SELECT SUM(ps.reel) FROM llx_product_stock ps WHERE ps.fk_product = p.rowid);
-- VMYSQL4.1 DELETE T1 FROM llx_boxes_def as T1, llx_boxes_def as T2 where T1.entity = T2.entity AND T1.file = T2.file AND T1.note = T2.note and T1.rowid > T2.rowid -- VMYSQL4.1 DELETE T1 FROM llx_boxes_def as T1, llx_boxes_def as T2 where T1.entity = T2.entity AND T1.file = T2.file AND T1.note = T2.note and T1.rowid > T2.rowid;
-- VPGSQL8.2 DELETE FROM llx_boxes_def as T1 WHERE rowid NOT IN (SELECT min(rowid) FROM llx_boxes_def GROUP BY file, entity, note) -- VPGSQL8.2 DELETE FROM llx_boxes_def as T1 WHERE rowid NOT IN (SELECT min(rowid) FROM llx_boxes_def GROUP BY file, entity, note);
-- Requests to clean old tables or fields -- Requests to clean old tables or fields

View File

@ -1,5 +1,3 @@
# Dolibarr language file - es_MX - banks # Dolibarr language file - es_MX - banks
CHARSET=UTF-8 CHARSET=UTF-8
IBAN=CLAVE Interbancaria
BIC=Sucursal
BankAccountDomiciliation=Tarjeta BankAccountDomiciliation=Tarjeta

View File

@ -23,6 +23,4 @@ TerreNumRefModelDesc1=Devuelve el número bajo el formato %syymm-nnnn para las f
AddCreditNote=Crear nota de crédito AddCreditNote=Crear nota de crédito
BillTo=Receptor BillTo=Receptor
Residence=Tarjeta Residence=Tarjeta
IBANNumber=CLAVE Interbancaria
BICNumber=Sucursal
PaymentByTransferOnThisBankAccount=Cuenta para depositos y transferencias PaymentByTransferOnThisBankAccount=Cuenta para depositos y transferencias

View File

@ -314,46 +314,51 @@ class MailmanSpip
return -1; return -1;
} }
if (! empty($conf->global->ADHERENT_MAILMAN_URL)) if ($conf->adherent->enabled) // Synchro for members
{ {
if ($listes == '' && ! empty($conf->global->ADHERENT_MAILMAN_LISTS)) if (! empty($conf->global->ADHERENT_MAILMAN_URL))
{ {
$lists=explode(',',$conf->global->ADHERENT_MAILMAN_LISTS); if ($listes == '' && ! empty($conf->global->ADHERENT_MAILMAN_LISTS)) $lists=explode(',',$conf->global->ADHERENT_MAILMAN_LISTS);
} else $lists=explode(',',$listes);
else
{
$lists=explode(',',$listes);
}
foreach ($lists as $list)
{
// Filter on type something (ADHERENT_MAILMAN_LISTS = "filtervalue:mailinglist1,filtervalue2:mailinglist2,mailinglist3")
$tmp=explode(':',$list);
if (! empty($tmp[1]))
{
$list=$tmp[1];
if ($object->element == 'member' && $object->type != $tmp[0]) // Filter on member type label
{
dol_syslog("We ignore list ".$list." because object member type ".$object->type." does not match ".$tmp[0], LOG_DEBUG);
continue;
}
}
//We call Mailman to subscribe the user $categstatic=new Categorie($this->db);
$result = $this->callMailman($object, $conf->global->ADHERENT_MAILMAN_URL, $list);
if ($result === false) foreach ($lists as $list)
{ {
$this->mladded_ko[$list]=$object->email; // Filter on type something (ADHERENT_MAILMAN_LISTS = "mailinglist0,TYPE:typevalue:mailinglist1,CATEG:categvalue:mailinglist2")
return -2; $tmp=explode(':',$list);
} if (! empty($tmp[2]))
else $this->mladded_ok[$list]=$object->email; {
} $list=$tmp[2];
return count($lists); if ($object->element == 'member' && $tmp[0] == 'TYPE' && $object->type != $tmp[1]) // Filter on member type label
} {
else dol_syslog("We ignore list ".$list." because object member type ".$object->type." does not match ".$tmp[1], LOG_DEBUG);
{ continue;
$this->error="ADHERENT_MAILMAN_URL not defined"; }
return -1; if ($object->element == 'member' && $tmp[0] == 'CATEG' && ! in_array($tmp[1], $categstatic->containing($object->id, 'member', 'label'))) // Filter on member category
{
dol_syslog("We ignore list ".$list." because object member is not into category ".$tmp[1], LOG_DEBUG);
continue;
}
}
//We call Mailman to subscribe the user
$result = $this->callMailman($object, $conf->global->ADHERENT_MAILMAN_URL, $list);
if ($result === false)
{
$this->mladded_ko[$list]=$object->email;
return -2;
}
else $this->mladded_ok[$list]=$object->email;
}
return count($lists);
}
else
{
$this->error="ADHERENT_MAILMAN_URL not defined";
return -1;
}
} }
} }
@ -381,46 +386,49 @@ class MailmanSpip
return -1; return -1;
} }
if (! empty($conf->global->ADHERENT_MAILMAN_UNSUB_URL)) if ($conf->adherent->enabled) // Synchro for members
{ {
if ($listes=='' && ! empty($conf->global->ADHERENT_MAILMAN_LISTS)) if (! empty($conf->global->ADHERENT_MAILMAN_UNSUB_URL))
{ {
$lists=explode(',',$conf->global->ADHERENT_MAILMAN_LISTS); if ($listes=='' && ! empty($conf->global->ADHERENT_MAILMAN_LISTS)) $lists=explode(',',$conf->global->ADHERENT_MAILMAN_LISTS);
} else $lists=explode(',',$listes);
else
{
$lists=explode(',',$listes);
}
foreach ($lists as $list)
{
// Filter on type something (ADHERENT_MAILMAN_LISTS = "filtervalue:mailinglist1,filtervalue2:mailinglist2,mailinglist3")
$tmp=explode(':',$list);
if (! empty($tmp[1]))
{
$list=$tmp[1];
if ($object->element == 'member' && $object->type != $tmp[1]) // Filter on member type label
{
dol_syslog("We ignore list ".$list." because object member type ".$object->type." does not match ".$tmp[0], LOG_DEBUG);
continue;
}
}
//We call Mailman to unsubscribe the user foreach ($lists as $list)
$result = $this->callMailman($object, $conf->global->ADHERENT_MAILMAN_UNSUB_URL, $list); {
// Filter on type something (ADHERENT_MAILMAN_LISTS = "mailinglist0,TYPE:typevalue:mailinglist1,CATEG:categvalue:mailinglist2")
$tmp=explode(':',$list);
if (! empty($tmp[2]))
{
$list=$tmp[2];
if ($object->element == 'member' && $tmp[0] == 'TYPE' && $object->type != $tmp[1]) // Filter on member type label
{
dol_syslog("We ignore list ".$list." because object member type ".$object->type." does not match ".$tmp[1], LOG_DEBUG);
continue;
}
if ($object->element == 'member' && $tmp[0] == 'CATEG' && ! in_array($tmp[1], $categstatic->containing($object->id, 'member', 'label'))) // Filter on member category
{
dol_syslog("We ignore list ".$list." because object member is not into category ".$tmp[1], LOG_DEBUG);
continue;
}
}
if ($result === false) //We call Mailman to unsubscribe the user
{ $result = $this->callMailman($object, $conf->global->ADHERENT_MAILMAN_UNSUB_URL, $list);
$this->mlremoved_ko[$list]=$object->email;
return -2; if ($result === false)
} {
else $this->mlremoved_ok[$list]=$object->email; $this->mlremoved_ko[$list]=$object->email;
} return -2;
return count($lists); }
} else $this->mlremoved_ok[$list]=$object->email;
else }
{ return count($lists);
$this->error="ADHERENT_MAILMAN_UNSUB_URL not defined"; }
return -1; else
{
$this->error="ADHERENT_MAILMAN_UNSUB_URL not defined";
return -1;
}
} }
} }

View File

@ -336,19 +336,7 @@ class Product extends CommonObject
$result = $this->_log_price($user); $result = $this->_log_price($user);
if ($result > 0) if ($result > 0)
{ {
if ($this->update($id, $user, true, 'add') > 0) if ($this->update($id, $user, true, 'add') <= 0)
{
// FIXME: not use here
/*
if ($this->catid > 0)
{
require_once DOL_DOCUMENT_ROOT .'/categories/class/categorie.class.php';
$cat = new Categorie($this->db, $this->catid);
$cat->add_type($this,"product");
}
*/
}
else
{ {
$error++; $error++;
$this->error='ErrorFailedToUpdateRecord'; $this->error='ErrorFailedToUpdateRecord';
@ -2169,13 +2157,13 @@ class Product extends CommonObject
'fullpath' => $compl_path.$label, // Label 'fullpath' => $compl_path.$label, // Label
'type'=>$type // Nb of units that compose parent product 'type'=>$type // Nb of units that compose parent product
); );
}
// Recursive call if child is an array // Recursive call if child is an array
if (is_array($desc_pere['childs'])) if (is_array($desc_pere['childs']))
{ {
//print 'YYY We go down for '.$desc_pere[3]." -> \n"; //print 'YYY We go down for '.$desc_pere[3]." -> \n";
$this ->fetch_prod_arbo($desc_pere['childs'], $compl_path.$desc_pere[3]." -> ", $desc_pere[1]*$multiply, $level+1); $this ->fetch_prod_arbo($desc_pere['childs'], $compl_path.$desc_pere[3]." -> ", $desc_pere[1]*$multiply, $level+1);
}
} }
} }
} }

View File

@ -71,7 +71,7 @@ if (empty($conf->adherent->enabled)) accessforbidden('',1,1,1);
if (empty($conf->global->MEMBER_ENABLE_PUBLIC)) if (empty($conf->global->MEMBER_ENABLE_PUBLIC))
{ {
print $langs->trans("Auto subscription form for public visitors has no been enabled"); print $langs->trans("Auto subscription form for public visitors has not been enabled");
exit; exit;
} }

View File

@ -0,0 +1,107 @@
<?php
/* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/product/ajax/products.php
* \brief File to return Ajax response on product list request
*/
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); // Disables token renewal
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1');
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1');
if (empty($_GET['keysearch']) && ! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
require '../../main.inc.php';
$htmlname=GETPOST('htmlname','alpha');
$socid=GETPOST('socid','int');
$type=GETPOST('type','int');
$mode=GETPOST('mode','int');
$status=((GETPOST('status','int') >= 0) ? GETPOST('status','int') : -1);
$outjson=(GETPOST('outjson','int') ? GETPOST('outjson','int') : 0);
$price_level=GETPOST('price_level','int');
$action=GETPOST('action', 'alpha');
$id=GETPOST('id', 'int');
$price_by_qty_rowid=GETPOST('pbq', 'int');
/*
* View
*/
//print '<!-- Ajax page called with url '.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].' -->'."\n";
dol_syslog(join(',',$_GET));
//print_r($_GET);
if (! empty($action) && $action == 'fetch' && ! empty($id))
{
require DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
$outjson=array();
$object = new Societe($db);
$ret=$object->fetch($id);
if ($ret > 0)
{
$outname=$object->name;
$outjson = array('name'=>$outname);
}
echo json_encode($outjson);
}
else
{
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
$langs->load("products");
$langs->load("main");
top_httphead();
if (empty($htmlname)) return;
$match = preg_grep('/('.$htmlname.'[0-9]+)/',array_keys($_GET));
sort($match);
$id = (! empty($match[0]) ? $match[0] : '');
if (! GETPOST($htmlname) && ! GETPOST($id)) return;
// When used from jQuery, the search term is added as GET param "term".
$searchkey=(GETPOST($id)?GETPOST($id):(GETPOST($htmlname)?GETPOST($htmlname):''));
$form = new Form($db);
if (empty($mode) || $mode == 'customer')
{
$arrayresult=$form->select_company_html($socid,$htmlname,"client IN (1,3)",0,0,0,null,$searchkey,$outjson);
}
elseif ($mode == 'supplier')
{
$arrayresult=$form->select_company_html($socid,$htmlname,"fournisseur=1",0,0,0,null,$searchkey,$outjson);
}
$db->close();
if ($outjson) print json_encode($arrayresult);
}
?>

View File

@ -79,4 +79,12 @@ CKEDITOR.editorConfig = function( config )
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['SpecialChar'] ['SpecialChar']
]; ];
// Used for mailing fields
config.toolbar_dolibarr_readonly =
[
['Source','Maximize'],
['Find']
];
}; };

View File

@ -79,4 +79,12 @@ CKEDITOR.editorConfig = function( config )
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['Link','Unlink','SpecialChar'] ['Link','Unlink','SpecialChar']
]; ];
// Used for mailing fields
config.toolbar_dolibarr_readonly =
[
['Source','Maximize'],
['Find']
];
}; };

View File

@ -79,4 +79,12 @@ CKEDITOR.editorConfig = function( config )
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['Link','Unlink','SpecialChar'] ['Link','Unlink','SpecialChar']
]; ];
// Used for mailing fields
config.toolbar_dolibarr_readonly =
[
['Source','Maximize'],
['Find']
];
}; };

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 690 B

View File

@ -227,7 +227,9 @@ div.inline-block
.nowrap { .nowrap {
white-space: <?php print ($dol_optimize_smallscreen?'normal':'nowrap'); ?>; white-space: <?php print ($dol_optimize_smallscreen?'normal':'nowrap'); ?>;
} }
.dolibarrcombobox {
height: 22px;
}
/* ============================================================================== */ /* ============================================================================== */
/* Styles to hide objects */ /* Styles to hide objects */
@ -787,7 +789,7 @@ div.blockvmenusearch div.menu_titre {
{ {
padding-top: 1px; padding-top: 1px;
padding-bottom: 1px; padding-bottom: 1px;
height: 16px; min-height: 14px;
} }
div.blockvmenubookmarks div.blockvmenubookmarks
@ -1143,20 +1145,6 @@ div.tabs a.tab#active {
} }
div.tabs a.tab span {
padding: 0px 10px 0px 10px;
background-image: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/bg_ssmenu_btnG.jpg',1); ?>);
background-position: left;
background-repeat: no-repeat;
display: block;
height: 18px;
width: auto;
}
div.tabs a.tab#active span {
background-image: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/bg_ssmenusel_btnG.jpg',1); ?>);
}
div.tabs a.tab:hover { div.tabs a.tab:hover {
color: #FFFFFF; color: #FFFFFF;
background-color: #505050; background-color: #505050;
@ -1174,6 +1162,7 @@ div.tabBar {
margin: 0px 0px 10px 0px; margin: 0px 0px 10px 0px;
background: #dee7ec url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/tab_background.png',1); ?>) repeat-x; background: #dee7ec url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/tab_background.png',1); ?>) repeat-x;
} }
*/
div.tabsAction { div.tabsAction {
margin: 20px 0em 1px 0em; margin: 20px 0em 1px 0em;
@ -1181,7 +1170,7 @@ div.tabsAction {
text-align: right; text-align: right;
} }
/*
a.tabTitle { a.tabTitle {
background: #5088A9; background: #5088A9;
color: white; color: white;
@ -1299,8 +1288,7 @@ div.divButAction { margin-bottom: 1.4em; }
margin: 0px 10px 0px 10px; margin: 0px 10px 0px 10px;
text-decoration: none; text-decoration: none;
white-space: nowrap; white-space: nowrap;
float: right; font-size: 12px;
font-size: 10px;
height: 18px; height: 18px;
line-height: 18px; line-height: 18px;
cursor: pointer; cursor: pointer;
@ -1330,8 +1318,7 @@ div.divButAction { margin-bottom: 1.4em; }
margin: 0px 10px 0px 10px; margin: 0px 10px 0px 10px;
text-decoration: none; text-decoration: none;
white-space: nowrap; white-space: nowrap;
float: right; font-size: 12px;
font-size: 10px;
height: 18px; height: 18px;
line-height: 18px; line-height: 18px;
margin-bottom: 10px; margin-bottom: 10px;
@ -2119,10 +2106,6 @@ A.none, A.none:active, A.none:visited, A.none:hover {
font-size:1em; font-size:1em;
} }
div.tabsAction {
margin-top: 10px;
}
table.noborder { table.noborder {
margin-bottom: 10px; margin-bottom: 10px;
position: relative; position: relative;

View File

@ -79,4 +79,11 @@ CKEDITOR.editorConfig = function( config )
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['Link','Unlink','SpecialChar'] ['Link','Unlink','SpecialChar']
]; ];
// Used for mailing fields
config.toolbar_dolibarr_readonly =
[
['Source','Maximize'],
['Find']
];
}; };

View File

@ -919,19 +919,20 @@ div.blockvmenupair, div.blockvmenuimpair, div.blockvmenubookmarks
margin: 1px 0px 8px 2px; margin: 1px 0px 8px 2px;
<?php if ($usecss3) { ?> <?php if ($usecss3) { ?>
background-image: -o-linear-gradient(bottom, rgb(<?php echo $colorbacktab2; ?>) 0px, rgb(<?php echo $colorbacktab1; ?>) 8px);
background-image: -moz-linear-gradient(bottom, rgb(<?php echo $colorbacktab2; ?>) 0px, rgb(<?php echo $colorbacktab1; ?>) 8px); background-image: -o-linear-gradient(bottom, rgb(<?php echo $colorbacktab2; ?>) 0px, rgb(<?php echo $colorbacktab1; ?>) 3px);
/* background-image: -webkit-linear-gradient(bottom, rgb(<?php echo $colorbacktab1; ?>) 90%, rgb(<?php echo $colorbacktab2; ?>) 100%); */ background-image: -moz-linear-gradient(bottom, rgb(<?php echo $colorbacktab2; ?>) 0px, rgb(<?php echo $colorbacktab1; ?>) 3px);
background-image: -webkit-linear-gradient(right, rgb(<?php echo $colorbacktab2; ?>) 0px, rgb(<?php echo $colorbacktab1; ?>) 8px); background-image: -webkit-linear-gradient(right, rgb(<?php echo $colorbacktab2; ?>) 0px, rgb(<?php echo $colorbacktab1; ?>) 3px);
background-image: -ms-linear-gradient(bottom, rgb(<?php echo $colorbacktab2; ?>) 0px, rgb(<?php echo $colorbacktab1; ?>) 8px); background-image: -ms-linear-gradient(bottom, rgb(<?php echo $colorbacktab2; ?>) 0px, rgb(<?php echo $colorbacktab1; ?>) 3px);
background-image: linear-gradient(bottom, rgb(<?php echo $colorbacktab2; ?>) 0px, rgb(<?php echo $colorbacktab1; ?>) 8px); background-image: linear-gradient(bottom, rgb(<?php echo $colorbacktab2; ?>) 0px, rgb(<?php echo $colorbacktab1; ?>) 3px);
<?php } else { ?> <?php } else { ?>
background-image: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/tmenu.jpg',1); ?>); background-image: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/tmenu.jpg',1); ?>);
background-position:top; background-position:top;
background-repeat:repeat-x; background-repeat:repeat-x;
<?php } ?> <?php } ?>
border-left: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC;
border-right: 1px solid #DDDDDD; border-right: 1px solid #D0D0D0;
border-bottom: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD;
border-top: 1px solid #DDDDDD; border-top: 1px solid #DDDDDD;
border-radius: 5px; border-radius: 5px;
@ -1874,19 +1875,20 @@ div.ok {
} }
div.warning { div.warning {
color: #997711; color: #504020;
padding: 0.2em 0.2em 0.2em 0.2em; padding: 0.3em 0.3em 0.3em 0.3em;
margin: 0.5em 0em 0.5em 0em; margin: 0.5em 0em 0.5em 0em;
border: 1px solid #e0e0d0; border: 1px solid #e0d0b0;
-moz-border-radius:6px; -moz-border-radius:6px;
-webkit-border-radius: 6px; -webkit-border-radius: 6px;
border-radius: 6px; border-radius: 6px;
background: #efefd4; background: #FFEF9A;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
} }
div.error { div.error {
color: #550000; font-weight: bold; color: #550000; font-weight: bold;
padding: 0.2em 0.2em 0.2em 0.2em; padding: 0.3em 0.3em 0.3em 0.3em;
margin: 0.5em 0em 0.5em 0em; margin: 0.5em 0em 0.5em 0em;
border: 1px solid #DC9CAB; border: 1px solid #DC9CAB;
-moz-border-radius:6px; -moz-border-radius:6px;
@ -1897,14 +1899,15 @@ div.error {
/* Info admin */ /* Info admin */
div.info { div.info {
color: #807050; color: #302010;
padding: 0.4em 0.4em 0.4em 0.4em; padding: 0.4em 0.4em 0.4em 0.4em;
margin: 0.5em 0em 0.5em 0em; margin: 0.5em 0em 0.5em 0em;
border: 1px solid #DFDFA0; border: 1px solid #DFBF9A;
-moz-border-radius:6px; -moz-border-radius:6px;
-webkit-border-radius: 6px; -webkit-border-radius: 6px;
border-radius:6px; border-radius:6px;
background: #EFEFBA; background: #EFCFAA;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
} }

View File

@ -197,7 +197,7 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldcustomer,$dura
$sendto = $oldemail; $sendto = $oldemail;
$from = $conf->global->MAIN_MAIL_EMAIL_FROM; $from = $conf->global->MAIN_MAIL_EMAIL_FROM;
$errorsto = $conf->global->MAIN_MAIL_ERRORS_TO; $errorsto = $conf->global->MAIN_MAIL_ERRORS_TO;
$msgishtml = 0; $msgishtml = -1;
print "- Send email for ".$oldcustomer."(".$oldemail."), total: ".$total."\n"; print "- Send email for ".$oldcustomer."(".$oldemail."), total: ".$total."\n";
dol_syslog("email_expire_services_to_customers.php: send mail to ".$oldemail); dol_syslog("email_expire_services_to_customers.php: send mail to ".$oldemail);

View File

@ -197,7 +197,7 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldsalerepresenta
$sendto = $oldemail; $sendto = $oldemail;
$from = $conf->global->MAIN_MAIL_EMAIL_FROM; $from = $conf->global->MAIN_MAIL_EMAIL_FROM;
$errorsto = $conf->global->MAIN_MAIL_ERRORS_TO; $errorsto = $conf->global->MAIN_MAIL_ERRORS_TO;
$msgishtml = 0; $msgishtml = -1;
print "- Send email for ".$oldsalerepresentative." (".$oldemail."), total: ".$total."\n"; print "- Send email for ".$oldsalerepresentative." (".$oldemail."), total: ".$total."\n";
dol_syslog("email_expire_services_to_representatives.php: send mail to ".$oldemail); dol_syslog("email_expire_services_to_representatives.php: send mail to ".$oldemail);

View File

@ -216,19 +216,19 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldtarget)
$sendto = $oldemail; $sendto = $oldemail;
$from = $conf->global->MAIN_MAIL_EMAIL_FROM; $from = $conf->global->MAIN_MAIL_EMAIL_FROM;
$errorsto = $conf->global->MAIN_MAIL_ERRORS_TO; $errorsto = $conf->global->MAIN_MAIL_ERRORS_TO;
$msgishtml = 0; $msgishtml = -1;
print "- Send email for '".$oldtarget."' (".$oldemail."), total: ".$total."\n"; print "- Send email for '".$oldtarget."' (".$oldemail."), total: ".$total."\n";
dol_syslog("email_unpaid_invoices_to_customers.php: send mail to ".$oldemail); dol_syslog("email_unpaid_invoices_to_customers.php: send mail to ".$oldemail);
$usehtml=0; $usehtml=0;
if (dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_FOOTER)) $usehtml+=1; if (dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_FOOTER)) $usehtml+=1;
if (dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_HEADER)) $usehtml+=1; if (dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_HEADER)) $usehtml+=1;
$allmessage=''; $allmessage='';
if (! empty($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_HEADER)) if (! empty($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_HEADER))
{ {
$allmessage.=$conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_HEADER; $allmessage.=$conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_HEADER;
} }
else else
{ {

View File

@ -192,19 +192,19 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldsalerepresenta
$sendto = $oldemail; $sendto = $oldemail;
$from = $conf->global->MAIN_MAIL_EMAIL_FROM; $from = $conf->global->MAIN_MAIL_EMAIL_FROM;
$errorsto = $conf->global->MAIN_MAIL_ERRORS_TO; $errorsto = $conf->global->MAIN_MAIL_ERRORS_TO;
$msgishtml = 0; $msgishtml = -1;
print "- Send email for ".$oldsalerepresentative." (".$oldemail."), total: ".$total."\n"; print "- Send email for ".$oldsalerepresentative." (".$oldemail."), total: ".$total."\n";
dol_syslog("email_unpaid_invoices_to_representatives.php: send mail to ".$oldemail); dol_syslog("email_unpaid_invoices_to_representatives.php: send mail to ".$oldemail);
$usehtml=0; $usehtml=0;
if (dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_FOOTER)) $usehtml+=1; if (dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_FOOTER)) $usehtml+=1;
if (dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_HEADER)) $usehtml+=1; if (dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_HEADER)) $usehtml+=1;
$allmessage=''; $allmessage='';
if (! empty($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_HEADER)) if (! empty($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_HEADER))
{ {
$allmessage.=$conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_HEADER; $allmessage.=$conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_HEADER;
} }
else else
{ {

View File

@ -29,6 +29,7 @@ global $conf,$user,$langs,$db;
require_once 'PHPUnit/Autoload.php'; require_once 'PHPUnit/Autoload.php';
require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
require_once dirname(__FILE__).'/../../htdocs/adherents/class/adherent.class.php'; require_once dirname(__FILE__).'/../../htdocs/adherents/class/adherent.class.php';
require_once dirname(__FILE__).'/../../htdocs/adherents/class/adherent_type.class.php';
if (empty($user->id)) if (empty($user->id))
{ {
@ -115,11 +116,39 @@ class AdherentTest extends PHPUnit_Framework_TestCase
} }
/** /**
* testAdherentCreate * testAdherentTypeCreate
* *
* @return void * @return void
*/ */
public function testAdherentCreate() public function testAdherentTypeCreate()
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
$user=$this->savuser;
$langs=$this->savlangs;
$db=$this->savdb;
$localobject=new AdherentType($this->savdb);
$localobject->statut=1;
$localobject->libelle='Adherent type test';
$localobject->cotisation=1;
$localobject->vote=1;
$result=$localobject->create($user);
print __METHOD__." result=".$result."\n";
$this->assertLessThan($result, 0);
return $localobject->id;
}
/**
* testAdherentCreate
*
* @return void
*
* @depends testAdherentTypeCreate
* The depends says test is run only if previous is ok
*/
public function testAdherentCreate($fk_adherent_type)
{ {
global $conf,$user,$langs,$db; global $conf,$user,$langs,$db;
$conf=$this->savconf; $conf=$this->savconf;
@ -129,6 +158,7 @@ class AdherentTest extends PHPUnit_Framework_TestCase
$localobject=new Adherent($this->savdb); $localobject=new Adherent($this->savdb);
$localobject->initAsSpecimen(); $localobject->initAsSpecimen();
$localobject->typeid=$fk_adherent_type;
$result=$localobject->create($user); $result=$localobject->create($user);
print __METHOD__." result=".$result."\n"; print __METHOD__." result=".$result."\n";
$this->assertLessThan($result, 0); $this->assertLessThan($result, 0);

View File

@ -184,17 +184,24 @@ class CategorieTest extends PHPUnit_Framework_TestCase
print __METHOD__." catid=".$catid."\n"; print __METHOD__." catid=".$catid."\n";
$this->assertGreaterThan(0, $catid); $this->assertGreaterThan(0, $catid);
// Category // Try to create product linked to category
$localobject2=new Product($this->savdb); $localobject2=new Product($this->savdb);
$localobject2->initAsSpecimen(); $localobject2->initAsSpecimen();
$localobject2->ref.='-CATEG'; $localobject2->ref.='-CATEG';
$localobject2->tva_npr=1; $localobject2->tva_npr=1;
$localobject2->catid=$catid;
$result=$localobject2->create($user); $result=$localobject2->create($user);
$cat = new Categorie($this->savdb);
$cat->id = $catid;
$result=$cat->add_type($localobject2,"product");
print __METHOD__." result=".$result."\n"; print __METHOD__." result=".$result."\n";
$this->assertGreaterThan(0, $result); $this->assertGreaterThan(0, $result);
// Get list of categories for product
$localcateg=new Categorie($this->savdb);
$listofcateg=$localcateg->containing($localobject2->id, 'product', 'label');
$this->assertTrue(in_array('Specimen Category for product',$listofcateg), 'Categ not found linked to product when it should');
return $id; return $id;
} }

View File

@ -131,11 +131,11 @@ class CommandeFournisseurTest extends PHPUnit_Framework_TestCase
// Set supplier and product to use // Set supplier and product to use
$socid=1; $socid=1;
$prodid=1;
$societe=new Societe($db); $societe=new Societe($db);
$societe->fetch($socid); $societe->fetch($socid);
$product=new ProductFournisseur($db); $product=new ProductFournisseur($db);
$product->fetch($prodid); $product->fetch(0,'PIDRESS');
if ($product->id <= 0) { print "\n".__METHOD__." A product with ref PIDRESS must exists into database"; die(); }
$quantity=10; $quantity=10;
$ref_fourn='SUPPLIER_REF_PHPUNIT'; $ref_fourn='SUPPLIER_REF_PHPUNIT';

View File

@ -613,7 +613,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
$vat1=get_default_localtax($companyes,$companyes,1,0); $vat1=get_default_localtax($companyes,$companyes,1,0);
$vat2=get_default_localtax($companyes,$companyes,2,0); $vat2=get_default_localtax($companyes,$companyes,2,0);
$this->assertEquals(5.2,$vat1); $this->assertEquals(5.2,$vat1);
$this->assertEquals(-15,$vat2); $this->assertEquals(-21,$vat2);
// Test RULE ES-IT // Test RULE ES-IT
$vat1=get_default_localtax($companyes,$companyit,1,0); $vat1=get_default_localtax($companyes,$companyit,1,0);

View File

@ -129,11 +129,16 @@ class PdfDocTest extends PHPUnit_Framework_TestCase
$langs=$this->savlangs; $langs=$this->savlangs;
$db=$this->savdb; $db=$this->savdb;
$localproduct=new Product($this->savdb);
$localproduct->fetch(0,'PIDRESS');
$product_id=$localproduct->id;
if ($product_id <= 0) { print "\n".__METHOD__." A product with ref PIDRESS must exists into database"; die(); }
$localobject=new Facture($this->savdb); $localobject=new Facture($this->savdb);
$localobject->initAsSpecimen(); $localobject->initAsSpecimen();
$localobject->lines=array(); $localobject->lines=array();
$localobject->lines[0]=new FactureLigne($this->savdb); $localobject->lines[0]=new FactureLigne($this->savdb);
$localobject->lines[0]->fk_product=1; $localobject->lines[0]->fk_product=$product_id;
$localobject->lines[0]->label='Label 1'; $localobject->lines[0]->label='Label 1';
$localobject->lines[0]->desc="This is a description with a é accent\n(Country of origin: France)"; $localobject->lines[0]->desc="This is a description with a é accent\n(Country of origin: France)";