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

This commit is contained in:
florian HENRY 2018-03-25 17:19:27 +02:00
commit ffbeb17ec2
114 changed files with 2722 additions and 2339 deletions

102
ChangeLog
View File

@ -17,8 +17,75 @@ Following changes may create regressions for some external modules, but were nec
* PHP 5.3 is no more supported. Minimum PHP is now 5.4+
* Remove the old deprecated code of doActions and getInstanceDao in canvas. The doActions of standard hooks are
already available and are better.
* Removed method fetch_prods() and get_each_prod() not used, keep only get_arbo_each_prod() that is better.
***** ChangeLog for 7.0.1 compared to 7.0.0 *****
FIX: #8139 User search does not work if MAIN_USE_OLD_SEARCH_FORM, missing list.php
FIX: #8200
FIX: #8219
FIX: #8232
FIX: #8269
FIX: #8277
FIX: #8285 Extrafields now reported by /api/index.php/agendaevents/{id}
FIX: #8289 add a configuration for stock calculation
FIX: Activate all also if there are inactive services
FIX: add planned delivery to order exports
FIX: approval date was not visible if leave was canceled after
FIX: avoid "Array" on screen
FIX: Avoid empty value to fk_multicurrency attribute
FIX: Bad var for substitution of free text
FIX: Can't activate tasks on projects configuration
FIX: Can use odx templates that does not include lines tags
FIX: check shipping on delete order
FIX: check verif exped on delete order
FIX: comment on tasks
FIX: country must not be mandatory for accounting report groups
FIX: css
FIX: Delete tasks on project delete will now trigger TASK_DELETE
FIX: Do not lose filter when editing comment of a time spent in task view
FIX: duplicate confirm message. Missing reposition class
FIX: Duplicate product_type asignement on order addline
FIX: email use the validate user instead of approver in holiday approval
FIX: Error management in leave request
FIX: for nondisplay of fk_element 's id in REST API response
FIX: Generic substitution of constant disabled for sensitive constant
FIX: if we make a mistake with situation_percent, now we can correct it. before situation_final was always set to 1 and no way to go back
FIX: Import process must stop after ending line nb to import
FIX: Infinite loop on deletion of temp file when there is symbolic links
FIX: Input of holiday for subordinates was ko
FIX: invoice creation fails when next date not defined
FIX: Label of event show twice
FIX: letter for month March
FIX: Look and feel v7
FIX: Make a redirect after the remove_file action to avoid deletion done
FIX: migration script for product photo
FIX: missing email of customer in stripe info payments
FIX: missing object entity in fetch
FIX: Missing restore_lastsearch_values
FIX: multicompany compatibility and fix reports
FIX: natural search double quote
FIX: navigation and filters on holiday list
FIX: Parameter must be an array or an object that implements Countable
FIX: Payment mode not correctly set in donation and document
FIX: Permission in list of holiday
FIX: Properties updated if update successfull.
FIX: reverse field to have object loaded in doaction
FIX: Saving wrong localtax on order addline
FIX: Search criteria on vat
FIX: security report by DIGITEMIS CYBERSECURITY & PRIVACY
FIX: show status on societe banner
FIX: solve column mismatch in user card with multicompany transverse mode + code cleanup
FIX: Subscription events not recorded into agenda
FIX: Subscription not correctly log in blockedlog
FIX: Temporary dir for mail files must be cleaned at beginning of form
FIX: Trad and creation date in subscription create
FIX: translation of holiday types
FIX: Unknown column 'pl.amount_requested' in compta/prelevement/factures.php
FIX: Useless clean of tree
FIX: Use of undefined constant _ROWS_2
FIX: warning when adding ECM files using old photo path
***** ChangeLog for 7.0.0 compared to 6.0.5 *****
For users:
@ -307,6 +374,41 @@ Following changes may create regressions for some external modules, but were nec
multicompany module to a version that support Dolibarr v7, everything should work as expected.
***** ChangeLog for 6.0.6 compared to 6.0.6 *****
FIX: #7974 Contract - Invalid reference on the document
FIX: #8139
FIX: #8139 User search does not work if MAIN_USE_OLD_SEARCH_FORM, missing list.php
FIX: #8151
FIX: #8200
FIX: add planned delivery to order exports
FIX: a discount is a percent, not an amount, so we use vatrate not price
FIX: Avoid empty value to fk_multicurrency attribute
FIX: Bad localtaxes assignment in cashdesk
FIX: check shipping on delete order
FIX: check verif exped on delete order
FIX: creer into lire
FIX: Delete tasks on project delete will now trigger TASK_DELETE
FIX: Global on $user parameter reset the variable
FIX: if we make a mistake with situation_percent, now we can correct…
FIX: if we make a mistake with situation_percent, now we can correct it. before situation_final was always set to 1 and no way to go back
FIX: Import process must stop after ending line nb to import
FIX: migration script for product photo
FIX: natural search double quote
FIX: reverse field to have object loaded in doaction
FIX: Saving wrong localtax on order addline
FIX: show status on societe banner
FIX: solve column mismatch in user card's usergroup list + code cleanup
FIX: solve column mismatch in user card with multicompany transverse mode + code cleanup
FIX: unset categorie
FIX: update_extras on fourn card
FIX: warning when adding ECM files using old photo path
FIX: Withdrawals lines not filter by company name and not respect dropdown limit lines by page
NEW: Add sale representative einstein_pdf_modules
NEW_einstein_pdf_modules
NEW: field commerciaux and categ export CustomersInvoicesAndPayments
***** ChangeLog for 6.0.5 compared to 6.0.4 *****
FIX: security vulnerability reported by ADLab of Venustech
CVE-2017-17897, CVE-2017-17898, CVE-2017-17899, CVE-2017-17900

View File

@ -17,7 +17,7 @@
*/
/**
* \file build/generate_filecheck_xml.php
* \file build/generate_filelist_xml.php
* \ingroup dev
* \brief This script create a xml checksum file
*/
@ -45,7 +45,7 @@ $includeconstants=array();
if (empty($argv[1]))
{
print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
print "Usage: ".$script_file." release=auto|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
exit -1;
}
@ -68,11 +68,20 @@ while ($i < $argc)
$i++;
}
// If release is auto, we take current version
$tmpver=explode('-', $release, 2);
if ($tmpver[0] == 'auto')
{
$release=DOL_VERSION;
if ($tmpver[1]) $release.='-'.$tmpver[1];
}
if (empty($includecustom))
{
if (DOL_VERSION != $release)
$tmpver=explode('-', $release, 2);
if (DOL_VERSION != $tmpver[0])
{
print 'Error: When parameter "includecustom" is not set, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$release.')'."\n";
print 'Error: When parameter "includecustom" is not set and there is no suffix in release parameter, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$tmpver[0].')'."\n";
print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n";
exit -1;
}

View File

@ -388,7 +388,7 @@ if ($nboftargetok) {
#-----------------------
if ($CHOOSEDTARGET{'-CHKSUM'})
{
print 'Create xml check file with md5 checksum with command php '.$SOURCE.'/build/generate_filecheck_xml.php release='.$MAJOR.'.'.$MINOR.'.'.$BUILD."\n";
print 'Create xml check file with md5 checksum with command php '.$SOURCE.'/build/generate_filelist_xml.php release='.$MAJOR.'.'.$MINOR.'.'.$BUILD."\n";
$ret=`php $SOURCE/build/generate_filelist_xml.php release=$MAJOR.$MINOR.$BUILD`;
print $ret."\n";
# Copy to final dir

View File

@ -39,7 +39,7 @@ $langs->load("members");
if (! $user->admin) accessforbidden();
$type=array('yesno','texte','chaine');
$oldtypetonewone=array('texte'=>'text','chaine'=>'string'); // old type to new ones
$action = GETPOST('action','alpha');
@ -53,20 +53,7 @@ if ($action == 'updateall')
{
$db->begin();
$res1=$res2=$res3=$res4=$res5=$res6=0;
$res1=dolibarr_set_const($db, 'ADHERENT_LOGIN_NOT_REQUIRED', GETPOST('ADHERENT_LOGIN_NOT_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity);
$res2=dolibarr_set_const($db, 'ADHERENT_MAIL_REQUIRED', GETPOST('ADHERENT_MAIL_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity);
$res3=dolibarr_set_const($db, 'ADHERENT_DEFAULT_SENDINFOBYMAIL', GETPOST('ADHERENT_DEFAULT_SENDINFOBYMAIL', 'alpha'), 'chaine', 0, '', $conf->entity);
$res4=dolibarr_set_const($db, 'ADHERENT_BANK_USE', GETPOST('ADHERENT_BANK_USE', 'alpha'), 'chaine', 0, '', $conf->entity);
// Use vat for invoice creation
if ($conf->facture->enabled)
{
$res4=dolibarr_set_const($db, 'ADHERENT_VAT_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_VAT_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
$res5=dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
{
$res6=dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
}
}
$res1=dolibarr_set_const($db, 'XXXX', GETPOST('ADHERENT_LOGIN_NOT_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity);
if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0)
{
setEventMessages('ErrorFailedToSaveDate', null, 'errors');
@ -82,19 +69,16 @@ if ($action == 'updateall')
// Action mise a jour ou ajout d'une constante
if ($action == 'update' || $action == 'add')
{
$constlineid = GETPOST('rowid','int');
$constname=GETPOST('constname','alpha');
$constvalue=(GETPOST('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname) : GETPOST('constvalue'));
if (($constname=='ADHERENT_CARD_TYPE' || $constname=='ADHERENT_ETIQUETTE_TYPE' || $constname=='ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS') && $constvalue == -1) $constvalue='';
if ($constname=='ADHERENT_LOGIN_NOT_REQUIRED') // Invert choice
{
if ($constvalue) $constvalue=0;
else $constvalue=1;
}
$constvalue=(GETPOSTISSET('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname, 'alpha') : GETPOST('constvalue'));
$consttype=(GETPOSTISSET('consttype_'.$constname) ? GETPOST('consttype_'.$constname, 'alphanohtml') : GETPOST('consttype'));
$constnote=(GETPOSTISSET('constnote_'.$constname) ? GETPOST('constnote_'.$constname, 'none') : GETPOST('constnote'));
$consttype=GETPOST('consttype','alpha');
$constnote=GETPOST('constnote');
$res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity);
$typetouse = empty($oldtypetonewone[$consttype]) ? $consttype : $oldtypetonewone[$consttype];
$res=dolibarr_set_const($db,$constname, $constvalue, $typetouse, 0, $constnote, $conf->entity);
if (! $res > 0) $error++;
@ -111,7 +95,7 @@ if ($action == 'update' || $action == 'add')
// Action activation d'un sous module du module adherent
if ($action == 'set')
{
$result=dolibarr_set_const($db, GETPOST('name','alpha'),GETPOST('value'),'',0,'',$conf->entity);
$result=dolibarr_set_const($db, GETPOST('name','alpha'), GETPOST('value'), '', 0, '', $conf->entity);
if ($result < 0)
{
print $db->error();
@ -157,23 +141,15 @@ print '<input type="hidden" name="action" value="updateall">';
* Editing global variables not related to a specific theme
*/
$constantes=array(
'ADHERENT_MAIL_FROM',
'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT',
'ADHERENT_AUTOREGISTER_NOTIF_MAIL',
'ADHERENT_AUTOREGISTER_MAIL_SUBJECT',
'ADHERENT_AUTOREGISTER_MAIL',
'ADHERENT_MAIL_VALID_SUBJECT',
'ADHERENT_MAIL_VALID',
'ADHERENT_MAIL_COTIS_SUBJECT',
'ADHERENT_MAIL_COTIS',
'ADHERENT_MAIL_RESIL_SUBJECT',
'ADHERENT_MAIL_RESIL',
);
$helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
$helptext.='__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, ';
$helptext.='__COMPANY__, __ADDRESS__, __ZIP__, __TOWN__, __COUNTRY__, __EMAIL__, __BIRTH__, __PHOTO__, __TYPE__, ';
$helptext.='__YEAR__, __MONTH__, __DAY__';
'ADHERENT_MAIL_FROM'=>'string',
'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT'=>'string',
'ADHERENT_AUTOREGISTER_NOTIF_MAIL'=>'html',
'ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER' =>'emailtemplate:member', /* old was ADHERENT_AUTOREGISTER_MAIL */
'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_VALID */
'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_COTIS */
'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' =>'emailtemplate:member',
'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_RESIL */
);
$helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
$helptext.='__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, ';

View File

@ -238,21 +238,6 @@ if (empty($reshook))
}
}
/*
if ($action == 'confirm_sendinfo' && $confirm == 'yes')
{
if ($object->email)
{
$from=$conf->email_from;
if (! empty($conf->global->ADHERENT_MAIL_FROM)) $from=$conf->global->ADHERENT_MAIL_FROM;
$result=$object->send_an_email($langs->transnoentitiesnoconv("ThisIsContentOfYourCard")."\n\n%INFOS%\n\n",$langs->transnoentitiesnoconv("CardContent"));
$langs->load("mails");
setEventMessages($langs->trans("MailSuccessfulySent", $from, $object->email), null, 'mesgs');
}
}*/
if ($action == 'update' && ! $cancel && $user->rights->adherent->creer)
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@ -630,7 +615,34 @@ if (empty($reshook))
// Send confirmation email (according to parameters of member type. Otherwise generic)
if ($object->email && GETPOST("send_mail"))
{
$result=$object->send_an_email($adht->getMailOnValid(),$conf->global->ADHERENT_MAIL_VALID_SUBJECT,array(),array(),array(),"","",0,2);
$subject = '';
$msg= '';
// Send subscription email
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail=new FormMail($db);
// Set output language
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
$outputlangs->loadLangs(array("main", "members"));
// Get email content fro mtemplae
$arraydefaultmessage=null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION;
if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
{
$subject = $arraydefaultmessage->topic;
$msg = $arraydefaultmessage->content;
}
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs);
$result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, 2);
if ($result < 0)
{
$error++;
@ -674,7 +686,34 @@ if (empty($reshook))
{
if ($object->email && GETPOST("send_mail"))
{
$result=$object->send_an_email($adht->getMailOnResiliate(),$conf->global->ADHERENT_MAIL_RESIL_SUBJECT,array(),array(),array(),"","",0,-1);
$subject = '';
$msg= '';
// Send subscription email
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail=new FormMail($db);
// Set output language
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
$outputlangs->loadLangs(array("main", "members"));
// Get email content fro mtemplae
$arraydefaultmessage=null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION;
if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
{
$subject = $arraydefaultmessage->topic;
$msg = $arraydefaultmessage->content;
}
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnResiliate()), $substitutionarray, $outputlangs);
$result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1);
}
if ($result < 0)
{
@ -1339,7 +1378,7 @@ else
array('label' => $langs->trans("AliasNames"), 'type' => 'text', 'name' => 'companyalias', 'value' => $companyalias, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"')
);
print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1);
print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id, $langs->trans("CreateDolibarrThirdParty"), $langs->trans("ConfirmCreateThirdParty"), "confirm_create_thirdparty", $formquestion, 'yes');
}
// Confirm validate member
@ -1350,10 +1389,34 @@ else
$adht = new AdherentType($db);
$adht->fetch($object->typeid);
$subjecttosend=$object->makeSubstitution($conf->global->ADHERENT_MAIL_VALID_SUBJECT);
$texttosend=$object->makeSubstitution($adht->getMailOnValid());
$subject = '';
$msg= '';
$tmp=$langs->trans("SendAnEMailToMember");
// Send subscription email
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail=new FormMail($db);
// Set output language
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
$outputlangs->loadLangs(array("main", "members"));
// Get email content fro mtemplae
$arraydefaultmessage=null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION;
if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
{
$subject = $arraydefaultmessage->topic;
$msg = $arraydefaultmessage->content;
}
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs);
$tmp=$langs->trans("SendingAnEMailToMember");
$tmp.='<br>'.$langs->trans("MailFrom").': <b>'.$conf->global->ADHERENT_MAIL_FROM.'</b>, ';
$tmp.='<br>'.$langs->trans("MailRecipient").': <b>'.$object->email.'</b>';
$helpcontent='';
@ -1375,15 +1438,9 @@ else
if (! empty($conf->mailman->enabled) && ! empty($conf->global->ADHERENT_USE_SPIP)) {
$formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroSpipEnabled"),'value'=>'');
}
print $form->formconfirm("card.php?rowid=".$id,$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion,1,1);
print $form->formconfirm("card.php?rowid=".$id, $langs->trans("ValidateMember"), $langs->trans("ConfirmValidateMember"), "confirm_valid", $formquestion, 'yes', 1, 220);
}
// Confirm send card by mail
/*if ($action == 'sendinfo')
{
print $form->formconfirm("card.php?rowid=".$id,$langs->trans("SendCardByMail"),$langs->trans("ConfirmSendCardByMail",$object->email),"confirm_sendinfo",'',0,1);
}*/
// Confirm terminate
if ($action == 'resign')
{
@ -1392,10 +1449,34 @@ else
$adht = new AdherentType($db);
$adht->fetch($object->typeid);
$subjecttosend=$object->makeSubstitution($conf->global->ADHERENT_MAIL_RESIL_SUBJECT);
$texttosend=$object->makeSubstitution($adht->getMailOnResiliate());
$subject = '';
$msg= '';
$tmp=$langs->trans("SendAnEMailToMember");
// Send subscription email
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail=new FormMail($db);
// Set output language
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
$outputlangs->loadLangs(array("main", "members"));
// Get email content fro mtemplae
$arraydefaultmessage=null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION;
if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
{
$subject = $arraydefaultmessage->topic;
$msg = $arraydefaultmessage->content;
}
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnResiliate()), $substitutionarray, $outputlangs);
$tmp=$langs->trans("SendingAnEMailToMember");
$tmp.='<br>('.$langs->trans("MailFrom").': <b>'.$conf->global->ADHERENT_MAIL_FROM.'</b>, ';
$tmp.=$langs->trans("MailRecipient").': <b>'.$object->email.'</b>)';
$helpcontent='';
@ -1412,7 +1493,7 @@ else
$formquestion=array();
if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => (! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?'true':'false'));
if ($backtopage) $formquestion[]=array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]));
print $form->formconfirm("card.php?rowid=".$id,$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_resign",$formquestion,'no',1);
print $form->formconfirm("card.php?rowid=".$id, $langs->trans("ResiliateMember"), $langs->trans("ConfirmResiliateMember"), "confirm_resign", $formquestion, 'no', 1, 220);
}
// Confirm remove member
@ -1420,7 +1501,7 @@ else
{
$formquestion=array();
if ($backtopage) $formquestion[]=array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]));
print $form->formconfirm("card.php?rowid=".$id,$langs->trans("DeleteMember"),$langs->trans("ConfirmDeleteMember"),"confirm_delete",$formquestion,0,1);
print $form->formconfirm("card.php?rowid=".$id, $langs->trans("DeleteMember"), $langs->trans("ConfirmDeleteMember"), "confirm_delete", $formquestion, 'no', 1);
}
// Confirm add in spip
@ -1623,7 +1704,7 @@ else
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
if (empty($reshook)) {
if ($action != 'valid' && $action != 'editlogin' && $action != 'editthirdparty')
if ($action != 'editlogin' && $action != 'editthirdparty')
{
// Send
if ($object->statut == 1) {

View File

@ -147,9 +147,11 @@ class Adherent extends CommonObject
if ($msgishtml == -1)
{
$msgishtml = 0;
if (dol_textishtml($text,1)) $msgishtml = 1;
if (dol_textishtml($text,0)) $msgishtml = 1;
}
dol_syslog('send_an_email msgishtml='.$msgishtml);
$texttosend=$this->makeSubstitution($text);
$subjecttosend=$this->makeSubstitution($subject);
if ($msgishtml) $texttosend=dol_htmlentitiesbr($texttosend);
@ -1331,7 +1333,7 @@ class Adherent extends CommonObject
* Do complementary actions after subscription recording.
*
* @param int $subscriptionid Id of created subscription
* @param string $option Which action ('bankdirect', 'invoiceonly', ...)
* @param string $option Which action ('bankdirect', 'bankviainvoice', 'invoiceonly', ...)
* @param int $accountid Id bank account
* @param int $datesubscription Date of subscription
* @param int $paymentdate Date of payment
@ -1341,7 +1343,7 @@ class Adherent extends CommonObject
* @param string $num_chq Numero cheque (if Id bank account provided)
* @param string $emetteur_nom Name of cheque writer
* @param string $emetteur_banque Name of bank of cheque
* @param string $autocreatethirdparty Auto create new thirdparty if member not linked to a thirdparty.
* @param string $autocreatethirdparty Auto create new thirdparty if member not linked to a thirdparty and we request an option that generate invoice.
* @return int <0 if KO, >0 if OK
*/
function subscriptionComplementaryActions($subscriptionid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom='', $emetteur_banque='', $autocreatethirdparty=0)
@ -1352,6 +1354,8 @@ class Adherent extends CommonObject
$this->invoice = null; // This will contains invoice if an invoice is created
dol_syslog("subscriptionComplementaryActions subscriptionid=".$subscriptionid." option=".$option." accountid=".$accountid." datesubscription=".$datesubscription." paymentdate=".$paymentdate." label=".$label." amount=".$amount." num_chq=".$num_chq." autocreatethirdparty=".$autocreatethirdparty);
// Insert into bank account directlty (if option choosed for) + link to llx_subscription if option is 'bankdirect'
if ($option == 'bankdirect' && $accountid)
{
@ -1407,7 +1411,7 @@ class Adherent extends CommonObject
if (! $error)
{
if (! ($this->fk_soc > 0))
if (! ($this->fk_soc > 0)) // If not yet linked to a company
{
if ($autocreatethirdparty)
{
@ -1668,6 +1672,8 @@ class Adherent extends CommonObject
if ($result < 0) { $error++; $this->db->rollback(); return -1; }
// End call triggers
$this->datevalid = $now;
$this->db->commit();
return 1;
}
@ -1892,6 +1898,8 @@ class Adherent extends CommonObject
$label.= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
if (! empty($this->firstname) || ! empty($this->lastname))
$label.= '<br><b>' . $langs->trans('Name') . ':</b> ' . $this->getFullName($langs);
if (! empty($this->societe))
$label.= '<br><b>' . $langs->trans('Company') . ':</b> ' . $this->societe;
$label.='</div>';
$url = DOL_URL_ROOT.'/adherents/card.php?rowid='.$this->id;
@ -2494,7 +2502,6 @@ class Adherent extends CommonObject
/**
* Send reminders by emails before subscription end
* CAN BE A CRON TASK
@ -2506,6 +2513,7 @@ class Adherent extends CommonObject
{
global $conf, $langs, $mysoc, $user;
$error = 0;
$this->output = '';
$this->error='';
@ -2555,16 +2563,16 @@ class Adherent extends CommonObject
$adherent->fetch_thirdparty();
// Send reminder email
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang);
$outputlangs->loadLangs(array("main", "members"));
$arraydefaultmessage=$formmail->getEMailTemplate($this->db, 'member', $user, $outputlangs, 0, 1, '(SendReminderForExpiredSubscriptionTitle)');
$arraydefaultmessage=null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION;
if (is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($this->db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
{
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $adherent);
//if (is_array($adherent->thirdparty)) $substitutionarraycomp = ...
@ -2575,6 +2583,7 @@ class Adherent extends CommonObject
$from = $conf->global->ADHERENT_MAIL_FROM;
$to = $adherent->email;
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$cmail = new CMailFile($subject, $to, $from, $msg, array(), array(), array(), '', '', 0, 1);
$result = $cmail->sendfile();
if (! $result)
@ -2591,7 +2600,7 @@ class Adherent extends CommonObject
}
else
{
$blockingerrormsg="Can't find email template '(SendReminderForExpiredSubscriptionTitle)'";
$blockingerrormsg="Can't find email template, defined into member module setup, to use for reminding";
$nbko++;
break;
}

View File

@ -499,7 +499,7 @@ class AdherentType extends CommonObject
/**
* getMailOnValid
*
* @return string Return mail model
* @return string Return mail content of type or empty
*/
function getMailOnValid()
{
@ -509,16 +509,14 @@ class AdherentType extends CommonObject
{
return $this->mail_valid;
}
else
{
return $conf->global->ADHERENT_MAIL_VALID;
}
return '';
}
/**
* getMailOnSubscription
*
* @return string Return mail model
* @return string Return mail content of type or empty
*/
function getMailOnSubscription()
{
@ -529,16 +527,14 @@ class AdherentType extends CommonObject
{
return $this->mail_subscription;
}
else
{
return $conf->global->ADHERENT_MAIL_COTIS;
}
return '';
}
/**
* getMailOnResiliate
*
* @return string Return mail model
* @return string Return mail model content of type or empty
*/
function getMailOnResiliate()
{
@ -549,10 +545,8 @@ class AdherentType extends CommonObject
{
return $this->mail_resiliate;
}
else
{
return $conf->global->ADHERENT_MAIL_RESIL;
}
return '';
}
}

View File

@ -593,7 +593,6 @@ while ($i < min($num, $limit))
$memberstatic->ref=$obj->rowid;
$memberstatic->lastname=$obj->lastname;
$memberstatic->firstname=$obj->firstname;
$memberstatic->societe=$obj->company;
$memberstatic->statut=$obj->statut;
$memberstatic->datefin= $datefin;
$memberstatic->socid = $obj->fk_soc;
@ -605,6 +604,7 @@ while ($i < min($num, $limit))
} else {
$companyname=$obj->company;
}
$memberstatic->societe = $companyname;
print '<tr class="oddeven">';

View File

@ -349,8 +349,32 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
// Send confirmation Email
if ($object->email && $sendalsoemail)
{
$subjecttosend=$object->makeSubstitution($conf->global->ADHERENT_MAIL_COTIS_SUBJECT);
$texttosend=$object->makeSubstitution($adht->getMailOnSubscription());
$subject = '';
$msg= '';
// Send subscription email
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail=new FormMail($db);
// Set output language
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
$outputlangs->loadLangs(array("main", "members"));
// Get email content fro mtemplae
$arraydefaultmessage=null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION;
if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
{
$subject = $arraydefaultmessage->topic;
$msg = $arraydefaultmessage->content;
}
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnSubscription()), $substitutionarray, $outputlangs);
// Attach a file ?
$file='';
@ -1018,8 +1042,33 @@ if ($rowid > 0)
$adht = new AdherentType($db);
$adht->fetch($object->typeid);
$subjecttosend=$object->makeSubstitution($conf->global->ADHERENT_MAIL_COTIS_SUBJECT);
$texttosend=$object->makeSubstitution($adht->getMailOnSubscription());
// Send subscription email
$subject = '';
$msg= '';
// Send subscription email
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail=new FormMail($db);
// Set output language
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
$outputlangs->loadLangs(array("main", "members"));
// Get email content fro mtemplae
$arraydefaultmessage=null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION;
if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
{
$subject = $arraydefaultmessage->topic;
$msg = $arraydefaultmessage->content;
}
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnSubscription()), $substitutionarray, $outputlangs);
$tmp='<input name="sendmail" type="checkbox"'.(GETPOST('sendmail','alpha')?' checked':(! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?' checked':'')).'>';
$helpcontent='';

View File

@ -91,17 +91,17 @@ $tabsqlsort[25]="label ASC, lang ASC, position ASC";
// Nom des champs en resultat de select pour affichage du dictionnaire
$tabfield=array();
$tabfield[25]= "label,type_template,lang,fk_user,private,position,topic,joinfiles,content";
$tabfield[25]= "label,lang,type_template,fk_user,private,position,topic,joinfiles,content";
if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $tabfield[25].=',content_lines';
// Nom des champs d'edition pour modification d'un enregistrement
$tabfieldvalue=array();
$tabfieldvalue[25]= "label,type_template,fk_user,lang,private,position,topic,joinfiles,content";
$tabfieldvalue[25]= "label,lang,type_template,fk_user,private,position,topic,joinfiles,content";
if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $tabfieldvalue[25].=',content_lines';
// Nom des champs dans la table pour insertion d'un enregistrement
$tabfieldinsert=array();
$tabfieldinsert[25]= "label,type_template,fk_user,lang,private,position,topic,joinfiles,content";
$tabfieldinsert[25]= "label,lang,type_template,fk_user,private,position,topic,joinfiles,content";
if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $tabfieldinsert[25].=',content_lines';
$tabfieldinsert[25].=',entity'; // Must be at end because not into other arrays
@ -233,8 +233,7 @@ if (empty($reshook))
$ok=0;
$fieldnamekey=$listfield[$f];
// We take translate key of field
if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) $fieldnamekey='Label';
if ($fieldnamekey == 'libelle_facture') $fieldnamekey = 'LabelOnDocuments';
if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) $fieldnamekey='Code';
if ($fieldnamekey == 'code') $fieldnamekey = 'Code';
if ($fieldnamekey == 'note') $fieldnamekey = 'Note';
if ($fieldnamekey == 'type_template') $fieldnamekey = 'TypeOfTemplate';
@ -478,7 +477,7 @@ foreach ($fieldlist as $field => $value)
if ($fieldlist[$field]=='lang') { $valuetoshow=(empty($conf->global->MAIN_MULTILANGS) ? '&nbsp;' : $langs->trans("Language")); }
if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); }
if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); }
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label"); }
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Code"); }
if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); }
if ($fieldlist[$field]=='private') { $align='center'; }
if ($fieldlist[$field]=='position') { $align='center'; }
@ -695,7 +694,7 @@ if ($resql)
if ($fieldlist[$field]=='fk_user') { $valuetoshow=$langs->trans("Owner"); }
if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); }
if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); }
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label"); }
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Code"); }
if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); }
if ($fieldlist[$field]=='private') { $align='center'; }
if ($fieldlist[$field]=='position') { $align='center'; }
@ -990,7 +989,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
{
$selectedlang = $langs->defaultlang;
if ($context == 'edit') $selectedlang = $obj->{$fieldlist[$field]};
print $formadmin->select_language($selectedlang, 'langcode', 0, null, 1);
print $formadmin->select_language($selectedlang, 'langcode', 0, null, 1, 0, 0, 'maxwidth150');
}
else
{

View File

@ -1654,7 +1654,8 @@ class ActionComm extends CommonObject
{
global $conf, $langs;
$this->output = '';
$error = 0;
$this->output = '';
$this->error='';
if (empty($conf->global->AGENDA_REMINDER_EMAIL))
@ -1668,6 +1669,8 @@ class ActionComm extends CommonObject
dol_syslog(__METHOD__, LOG_DEBUG);
$this->db->begin();
// TODO Scan events of type 'email' into table llx_actioncomm_reminder with status todo, send email, then set status to done
@ -1676,7 +1679,9 @@ class ActionComm extends CommonObject
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_reminder WHERE dateremind < '".$this->db->jdate($now - (3600 * 24 * 32))."'";
$this->db->query($sql);
return 0;
$this->db->commit();
return $error;
}
}

View File

@ -32,10 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$langs->load("users");
$langs->load("companies");
$langs->load("agenda");
$langs->load("commercial");
$langs->loadLangs(array("users","companies","agenda","commercial"));
$action=GETPOST('action','alpha');
$resourceid=GETPOST("resourceid","int");
@ -57,6 +54,7 @@ else
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE));
}
if ($actioncode == '' && empty($actioncodearray)) $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
$search_id=GETPOST('search_id','alpha');
$search_title=GETPOST('search_title','alpha');
$dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth','int'), GETPOST('dateselectday','int'), GETPOST('dateselectyear','int'));
@ -170,7 +168,8 @@ include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
{
//$actioncode='';
$search_title='';
$search_id='';
$search_title='';
$datestart='';
$dateend='';
$status='';
@ -199,24 +198,25 @@ llxHeader('',$langs->trans("Agenda"),$help_url);
$listofextcals=array();
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
if ($actioncode != '') {
if(is_array($actioncode)) {
foreach($actioncode as $str_action) $param.="&actioncode[]=".$str_action;
} else $param.="&actioncode=".$actioncode;
foreach($actioncode as $str_action) $param.="&actioncode[]=".urlencode($str_action);
} else $param.="&actioncode=".urlencode($actioncode);
}
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
if ($status != '' && $status > -1) $param.="&status=".$status;
if ($filter) $param.="&filter=".$filter;
if ($filtert) $param.="&filtert=".$filtert;
if ($socid) $param.="&socid=".$socid;
if ($resourceid > 0) $param.="&resourceid=".urlencode($resourceid);
if ($status != '' && $status > -1) $param.="&status=".urlencode($status);
if ($filter) $param.="&filter=".urlencode($filter);
if ($filtert) $param.="&filtert=".urlencode($filtert);
if ($socid) $param.="&socid=".urlencode($socid);
if ($showbirthday) $param.="&showbirthday=1";
if ($pid) $param.="&projectid=".$pid;
if ($type) $param.="&type=".$type;
if ($usergroup) $param.="&usergroup=".$usergroup;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
if ($search_title != '') $param.='&search_title='.$search_title;
if ($pid) $param.="&projectid=".urlencode($pid);
if ($type) $param.="&type=".urlencode($type);
if ($usergroup) $param.="&usergroup=".urlencode($usergroup);
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
if ($search_id != '') $param.='&search_title='.urlencode($search_id);
if ($search_title != '') $param.='&search_title='.urlencode($search_title);
if (GETPOST('datestartday','int')) $param.='&datestartday='.GETPOST('datestartday','int');
if (GETPOST('datestartmonth','int')) $param.='&datestartmonth='.GETPOST('datestartmonth','int');
if (GETPOST('datestartyear','int')) $param.='&datestartyear='.GETPOST('datestartyear','int');
@ -293,6 +293,7 @@ if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // R
if ($status == '100') { $sql.= " AND a.percent = 100"; }
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
if ($search_id) $sql.=natural_search("a.id", $search_id, 1);
if ($search_title) $sql.=natural_search("a.label", $search_title);
// We must filter on assignement table
if ($filtert > 0 || $usergroup > 0)
@ -421,7 +422,7 @@ if ($resql)
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
print '<tr class="liste_titre_filter">';
if (! empty($arrayfields['a.id']['checked'])) print '<td class="liste_titre"></td>';
if (! empty($arrayfields['a.id']['checked'])) print '<td class="liste_titre"><input type="text" class="maxwidth50" name="search_id" value="'.$search_id.'"></td>';
if (! empty($arrayfields['owner']['checked'])) print '<td class="liste_titre"></td>';
if (! empty($arrayfields['c.libelle']['checked'])) print '<td class="liste_titre"></td>';
if (! empty($arrayfields['a.label']['checked'])) print '<td class="liste_titre"><input type="text" class="maxwidth75" name="search_title" value="'.$search_title.'"></td>';
@ -492,7 +493,6 @@ if ($resql)
$caction=new CActionComm($db);
$arraylist=$caction->liste_array(1, 'code', '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0), '', 1);
$var=true;
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($resql);

View File

@ -660,8 +660,6 @@ if ($object->id > 0)
*/
if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{
$propal_static = new Propal($db);
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht";
$sql.= ", p.tva as total_tva";
$sql.= ", p.total as total_ttc";
@ -676,9 +674,9 @@ if ($object->id > 0)
$resql=$db->query($sql);
if ($resql)
{
$var=true;
$num = $db->num_rows($resql);
$propal_static = new Propal($db);
$num = $db->num_rows($resql);
if ($num > 0)
{
print '<table class="noborder" width="100%">';
@ -727,8 +725,6 @@ if ($object->id > 0)
*/
if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
{
$commande_static=new Commande($db);
$sql = "SELECT s.nom, s.rowid";
$sql.= ", c.rowid as cid, c.total_ht";
$sql.= ", c.tva as total_tva";
@ -744,9 +740,9 @@ if ($object->id > 0)
$resql=$db->query($sql);
if ($resql)
{
$var=true;
$num = $db->num_rows($resql);
$commande_static=new Commande($db);
$num = $db->num_rows($resql);
if ($num > 0)
{
// Check if there are orders billable
@ -808,9 +804,8 @@ if ($object->id > 0)
/*
* Last shipments
*/
if (! empty($conf->expedition->enabled) && $user->rights->expedition->lire) {
$sendingstatic = new Expedition($db);
if (! empty($conf->expedition->enabled) && $user->rights->expedition->lire)
{
$sql = 'SELECT e.rowid as id';
$sql.= ', e.ref';
$sql.= ', e.date_creation';
@ -829,10 +824,11 @@ if ($object->id > 0)
$sql.= " ORDER BY e.date_creation DESC";
$resql = $db->query($sql);
if ($resql) {
$var = true;
$num = $db->num_rows($resql);
$i = 0;
if ($resql)
{
$sendingstatic = new Expedition($db);
$num = $db->num_rows($resql);
if ($num > 0) {
print '<table class="noborder" width="100%">';
@ -843,12 +839,16 @@ if ($object->id > 0)
print '</tr>';
}
while ($i < $num && $i < $MAXLIST) {
$i = 0;
while ($i < $num && $i < $MAXLIST)
{
$objp = $db->fetch_object($resql);
print '<tr class="oddeven">';
print '<td class="nowrap">';
$sendingstatic->id = $objp->id;
$sendingstatic->ref = $objp->ref;
print '<tr class="oddeven">';
print '<td class="nowrap">';
print $sendingstatic->getNomUrl(1);
print '</td>';
if ($objp->date_creation > 0) {
@ -875,9 +875,7 @@ if ($object->id > 0)
*/
if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
{
$contratstatic=new Contrat($db);
$sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut, c.datec as dc, c.date_contrat as dcon, c.ref_supplier as refsup";
$sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut, c.datec as dc, c.date_contrat as dcon, c.ref_customer as refcus, c.ref_supplier as refsup";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c";
$sql.= " WHERE c.fk_soc = s.rowid ";
$sql.= " AND s.rowid = ".$object->id;
@ -887,9 +885,10 @@ if ($object->id > 0)
$resql=$db->query($sql);
if ($resql)
{
$var=true;
$contrat=new Contrat($db);
$num = $db->num_rows($resql);
if ($num >0 )
if ($num >0)
{
print '<table class="noborder" width="100%">';
@ -900,17 +899,19 @@ if ($object->id > 0)
print '</tr></table></td>';
print '</tr>';
}
$i = 0;
while ($i < $num && $i < $MAXLIST)
{
$contrat=new Contrat($db);
$objp = $db->fetch_object($resql);
$contrat->id=$objp->id;
$contrat->ref=$objp->ref?$objp->ref:$objp->id;
$contrat->ref_customer=$objp->refcus;
$contrat->ref_supplier=$objp->refsup;
print '<tr class="oddeven">';
print '<td class="nowrap">';
$contrat->id=$objp->id;
$contrat->ref=$objp->ref?$objp->ref:$objp->id;
print $contrat->getNomUrl(1,12);
print "</td>\n";
print '<td class="nowrap">'.dol_trunc($objp->refsup,12)."</td>\n";
@ -946,12 +947,11 @@ if ($object->id > 0)
$sql.= " AND f.entity = ".$conf->entity;
$sql.= " ORDER BY f.tms DESC";
$fichinter_static=new Fichinter($db);
$resql=$db->query($sql);
if ($resql)
{
$var=true;
$fichinter_static=new Fichinter($db);
$num = $db->num_rows($resql);
if ($num > 0)
{
@ -962,8 +962,8 @@ if ($object->id > 0)
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/fichinter/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
print '</tr></table></td>';
print '</tr>';
}
$i = 0;
while ($i < $num && $i < $MAXLIST)
{
@ -996,8 +996,6 @@ if ($object->id > 0)
*/
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{
$invoicetemplate = new FactureRec($db);
$sql = 'SELECT f.rowid as id, f.titre as ref, f.amount';
$sql.= ', f.total as total_ht';
$sql.= ', f.tva as total_tva';
@ -1020,9 +1018,9 @@ if ($object->id > 0)
$resql=$db->query($sql);
if ($resql)
{
$var=true;
$invoicetemplate = new FactureRec($db);
$num = $db->num_rows($resql);
$i = 0;
if ($num > 0)
{
print '<table class="noborder" width="100%">';
@ -1033,12 +1031,11 @@ if ($object->id > 0)
print '</tr>';
}
$i = 0;
while ($i < $num && $i < $MAXLIST)
{
$objp = $db->fetch_object($resql);
print '<tr class="oddeven">';
print '<td class="nowrap">';
$invoicetemplate->id = $objp->id;
$invoicetemplate->ref = $objp->ref;
$invoicetemplate->suspended = $objp->suspended;
@ -1047,6 +1044,9 @@ if ($object->id > 0)
$invoicetemplate->total_ht = $objp->total_ht;
$invoicetemplate->total_tva = $objp->total_tva;
$invoicetemplate->total_ttc = $objp->total_ttc;
print '<tr class="oddeven">';
print '<td class="nowrap">';
print $invoicetemplate->getNomUrl(1);
print '</td>';
if ($objp->frequency && $objp->date_last_gen > 0)
@ -1097,8 +1097,6 @@ if ($object->id > 0)
*/
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{
$facturestatic = new Facture($db);
$sql = 'SELECT f.rowid as facid, f.facnumber, f.type, f.amount';
$sql.= ', f.total as total_ht';
$sql.= ', f.tva as total_tva';
@ -1118,9 +1116,9 @@ if ($object->id > 0)
$resql=$db->query($sql);
if ($resql)
{
$var=true;
$facturestatic = new Facture($db);
$num = $db->num_rows($resql);
$i = 0;
if ($num > 0)
{
print '<table class="noborder" width="100%">';
@ -1132,18 +1130,20 @@ if ($object->id > 0)
print '</tr>';
}
$i = 0;
while ($i < $num && $i < $MAXLIST)
{
$objp = $db->fetch_object($resql);
print '<tr class="oddeven">';
print '<td class="nowrap">';
$facturestatic->id = $objp->facid;
$facturestatic->ref = $objp->facnumber;
$facturestatic->type = $objp->type;
$facturestatic->total_ht = $objp->total_ht;
$facturestatic->total_tva = $objp->total_tva;
$facturestatic->total_ttc = $objp->total_ttc;
$facturestatic->total_ht = $objp->total_ht;
$facturestatic->total_tva = $objp->total_tva;
$facturestatic->total_ttc = $objp->total_ttc;
print '<tr class="oddeven">';
print '<td class="nowrap">';
print $facturestatic->getNomUrl(1);
print '</td>';
if ($objp->df > 0)

View File

@ -1980,17 +1980,17 @@ if ($action == 'create' && $user->rights->commande->creer)
{
if ($action != 'classify')
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref.='<input type="hidden" name="action" value="classin">';
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref.='<input type="hidden" name="action" value="classin">';
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (! empty($object->fk_project)) {
$proj = new Project($db);

View File

@ -1530,8 +1530,8 @@ class Commande extends CommonOrder
{
$prod = new Product($this->db);
$prod->fetch($idproduct);
$prod -> get_sousproduits_arbo ();
$prods_arbo = $prod->get_each_prod();
$prod -> get_sousproduits_arbo();
$prods_arbo = $prod->get_arbo_each_prod();
if(count($prods_arbo) > 0)
{
foreach($prods_arbo as $key => $value)

View File

@ -3974,7 +3974,7 @@ else if ($id > 0 || ! empty($ref))
if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'discount_vat') {
print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">';
print $form->textwithpicto($langs->trans("Discount") . ':', $langs->trans("HelpEscompte"), - 1);
print '</td><td align="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td>&nbsp;</td></tr>';
print '</td><td align="right">' . price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye, 'MT')) . '</td><td>&nbsp;</td></tr>';
$resteapayeraffiche = 0;
$cssforamountpaymentcomplete = '';
}
@ -3982,7 +3982,7 @@ else if ($id > 0 || ! empty($ref))
if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'badcustomer') {
print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">';
print $form->textwithpicto($langs->trans("Abandoned") . ':', $langs->trans("HelpAbandonBadCustomer"), - 1);
print '</td><td align="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td>&nbsp;</td></tr>';
print '</td><td align="right">' . price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye, 'MT')) . '</td><td>&nbsp;</td></tr>';
// $resteapayeraffiche=0;
$cssforamountpaymentcomplete = '';
}
@ -3990,7 +3990,7 @@ else if ($id > 0 || ! empty($ref))
if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'product_returned') {
print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">';
print $form->textwithpicto($langs->trans("ProductReturned") . ':', $langs->trans("HelpAbandonProductReturned"), - 1);
print '</td><td align="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td>&nbsp;</td></tr>';
print '</td><td align="right">' . price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye, 'MT')) . '</td><td>&nbsp;</td></tr>';
$resteapayeraffiche = 0;
$cssforamountpaymentcomplete = '';
}
@ -4001,7 +4001,7 @@ else if ($id > 0 || ! empty($ref))
if ($object->close_note)
$text .= '<br><br><b>' . $langs->trans("Reason") . '</b>:' . $object->close_note;
print $form->textwithpicto($langs->trans("Abandoned") . ':', $text, - 1);
print '</td><td align="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td>&nbsp;</td></tr>';
print '</td><td align="right">' . price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye, 'MT')) . '</td><td>&nbsp;</td></tr>';
$resteapayeraffiche = 0;
$cssforamountpaymentcomplete = '';
}

View File

@ -68,6 +68,13 @@ class FactureRec extends CommonInvoice
var $usenewprice=0;
var $suspended; // status
const STATUS_NOTSUSPENDED = 0;
const STATUS_SUSPENDED = 1;
/**
* Constructor
*
@ -95,6 +102,7 @@ class FactureRec extends CommonInvoice
// Clean parameters
$this->titre=trim($this->titre);
$this->usenewprice=empty($this->usenewprice)?0:$this->usenewprice;
if (empty($this->suspended)) $this->suspended=0;
// No frequency defined then no next date to execution
if (empty($this->frequency))
@ -147,6 +155,7 @@ class FactureRec extends CommonInvoice
$sql.= ", fk_multicurrency";
$sql.= ", multicurrency_code";
$sql.= ", multicurrency_tx";
$sql.= ", suspended";
$sql.= ") VALUES (";
$sql.= "'".$this->db->escape($this->titre)."'";
$sql.= ", ".$facsrc->socid;
@ -167,13 +176,14 @@ class FactureRec extends CommonInvoice
$sql.= ", '".$this->db->escape($this->unit_frequency)."'";
$sql.= ", ".(!empty($this->date_when)?"'".$this->db->idate($this->date_when)."'":'NULL');
$sql.= ", ".(!empty($this->date_last_gen)?"'".$this->db->idate($this->date_last_gen)."'":'NULL');
$sql.= ", ".$this->nb_gen_done;
$sql.= ", ".$this->nb_gen_max;
$sql.= ", ".$this->auto_validate;
$sql.= ", ".$this->generate_pdf;
$sql.= ", ".$facsrc->fk_multicurrency;
$sql.= ", '".$facsrc->multicurrency_code."'";
$sql.= ", ".$facsrc->multicurrency_tx;
$sql.= ", ".$this->db->escape($this->nb_gen_done);
$sql.= ", ".$this->db->escape($this->nb_gen_max);
$sql.= ", ".$this->db->escape($this->auto_validate);
$sql.= ", ".$this->db->escape($this->generate_pdf);
$sql.= ", ".$this->db->escape($facsrc->fk_multicurrency);
$sql.= ", '".$this->db->escape($facsrc->multicurrency_code)."'";
$sql.= ", ".$this->db->escape($facsrc->multicurrency_tx);
$sql.= ", ".$this->db->escape($this->suspended);
$sql.= ")";
if ($this->db->query($sql))
@ -1149,49 +1159,69 @@ class FactureRec extends CommonInvoice
$prefix='';
if ($recur)
{
if ($status == 1) return $langs->trans('Disabled'); // credit note
if ($status == self::STATUS_SUSPENDED) return $langs->trans('Disabled');
else return $langs->trans('Active');
}
else return $langs->trans("Draft");
else
{
if ($status == self::STATUS_SUSPENDED) return $langs->trans('Disabled');
else return $langs->trans("Draft");
}
}
if ($mode == 1)
{
$prefix='Short';
if ($recur)
{
if ($status == 1) return $langs->trans('Disabled');
if ($status == self::STATUS_SUSPENDED) return $langs->trans('Disabled');
else return $langs->trans('Active');
}
else return $langs->trans("Draft");
else
{
if ($status == self::STATUS_SUSPENDED) return $langs->trans('Disabled');
else return $langs->trans("Draft");
}
}
if ($mode == 2)
{
if ($recur)
{
if ($status == 1) return img_picto($langs->trans('Disabled'),'statut6').' '.$langs->trans('Disabled');
if ($status == self::STATUS_SUSPENDED) return img_picto($langs->trans('Disabled'),'statut6').' '.$langs->trans('Disabled');
else return img_picto($langs->trans('Active'),'statut4').' '.$langs->trans('Active');
}
else return img_picto($langs->trans('Draft'),'statut0').' '.$langs->trans('Draft');
else
{
if ($status == self::STATUS_SUSPENDED) return img_picto($langs->trans('Disabled'),'statut6').' '.$langs->trans('Disabled');
else return img_picto($langs->trans('Draft'),'statut0').' '.$langs->trans('Draft');
}
}
if ($mode == 3)
{
if ($recur)
{
$prefix='Short';
if ($status == 1) return img_picto($langs->trans('Disabled'),'statut6');
if ($status == self::STATUS_SUSPENDED) return img_picto($langs->trans('Disabled'),'statut6');
else return img_picto($langs->trans('Active'),'statut4');
}
else return img_picto($langs->trans('Draft'),'statut0');
else
{
if ($status == self::STATUS_SUSPENDED) return img_picto($langs->trans('Disabled'),'statut6');
else return img_picto($langs->trans('Draft'),'statut0');
}
}
if ($mode == 4)
{
$prefix='';
if ($recur)
{
if ($status == 1) return img_picto($langs->trans('Disabled'),'statut6').' '.$langs->trans('Disabled');
if ($status == self::STATUS_SUSPENDED) return img_picto($langs->trans('Disabled'),'statut6').' '.$langs->trans('Disabled');
else return img_picto($langs->trans('Active'),'statut4').' '.$langs->trans('Active');
}
else return img_picto($langs->trans('Draft'),'statut0').' '.$langs->trans('Draft');
else
{
if ($status == self::STATUS_SUSPENDED) return img_picto($langs->trans('Disabled'),'statut6').' '.$langs->trans('Disabled');
else return img_picto($langs->trans('Draft'),'statut0').' '.$langs->trans('Draft');
}
}
if ($mode == 5 || $mode == 6)
{
@ -1199,10 +1229,14 @@ class FactureRec extends CommonInvoice
if ($mode == 5) $prefix='Short';
if ($recur)
{
if ($status == 1) return '<span class="xhideonsmartphone">'.$langs->trans('Disabled').' </span>'.img_picto($langs->trans('Disabled'),'statut6');
if ($status == self::STATUS_SUSPENDED) return '<span class="xhideonsmartphone">'.$langs->trans('Disabled').' </span>'.img_picto($langs->trans('Disabled'),'statut6');
else return '<span class="xhideonsmartphone">'.$langs->trans('Active').' </span>'.img_picto($langs->trans('Active'),'statut4');
}
else return $langs->trans('Draft').' '.img_picto($langs->trans('Active'),'statut0');
else
{
if ($status == self::STATUS_SUSPENDED) return '<span class="xhideonsmartphone">'.$langs->trans('Disabled').' </span>'.img_picto($langs->trans('Disabled'),'statut6');
else return $langs->trans('Draft').' '.img_picto($langs->trans('Active'),'statut0');
}
}
}

View File

@ -531,7 +531,7 @@ class Paiement extends CommonObject
{
if ($accountid <= 0)
{
$this->error='Bad value for parameter accountid';
$this->error='Bad value for parameter accountid='.$accountid;
dol_syslog(get_class($this).'::addPaymentToBank '.$this->error, LOG_ERR);
return -1;
}

View File

@ -955,19 +955,35 @@ if (empty($reshook))
setEventMessages($object->error, $object->errors, 'errors');
}
$result = $object->setValueFrom('ref', GETPOST('ref','alpha'), '', null, 'text', '', $user, 'CONTRACT_MODIFY');
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
$action = 'editref';
} else {
header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
exit;
}
}
else {
header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id);
exit;
}
$old_ref = $object->ref;
$result = $object->setValueFrom('ref', GETPOST('ref','alpha'), '', null, 'text', '', $user, 'CONTRACT_MODIFY');
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
$action = 'editref';
} else {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$old_filedir = $conf->contrat->dir_output . '/' . dol_sanitizeFileName($old_ref);
$new_filedir = $conf->contrat->dir_output . '/' . dol_sanitizeFileName($object->ref);
$files = dol_dir_list($old_filedir);
if (!empty($files))
{
if (!is_dir($new_filedir)) dol_mkdir($new_filedir);
foreach ($files as $file)
{
dol_move($file['fullname'], $new_filedir.'/'.$file['name']);
}
}
header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
exit;
}
}
else {
header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id);
exit;
}
}
elseif ($action=='setdate_contrat')
{

View File

@ -205,8 +205,6 @@ $formother = new FormOther($db);
$socstatic = new Societe($db);
$contracttmp = new Contrat($db);
llxHeader('', $langs->trans("Contracts"));
$sql = 'SELECT';
$sql.= " c.rowid, c.ref, c.datec as date_creation, c.tms as date_update, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public,";
$sql.= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client,';
@ -309,489 +307,504 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
$sql.= $db->plimit($limit + 1, $offset);
$resql=$db->query($sql);
if ($resql)
if (! $resql)
{
$num = $db->num_rows($resql);
$i = 0;
dol_print_error($db);
exit;
}
$arrayofselected=is_array($toselect)?$toselect:array();
$num = $db->num_rows($resql);
if ($socid > 0)
// Direct jump if only one record found
if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall)
{
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
header("Location: ".DOL_URL_ROOT.'/contrat/card.php?id='.$id);
exit;
}
// Output page
// --------------------------------------------------------------------
llxHeader('', $langs->trans("Contracts"));
$i = 0;
$arrayofselected=is_array($toselect)?$toselect:array();
if ($socid > 0)
{
$soc = new Societe($db);
$soc->fetch($socid);
if (empty($search_name)) $search_name = $soc->name;
}
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($sall != '') $param.='&sall='.urlencode($sall);
if ($search_contract != '') $param.='&search_contract='.urlencode($search_contract);
if ($search_name != '') $param.='&search_name='.urlencode($search_name);
if ($search_email != '') $param.='&search_email='.urlencode($search_email);
if ($search_ref_customer != '') $param.='&search_ref_customer='.urlencode($search_ref_customer);
if ($search_ref_supplier != '') $param.='&search_ref_supplier='.urlencode($search_ref_supplier);
if ($search_op2df != '') $param.='&search_op2df='.urlencode($search_op2df);
if ($search_dfyear != '') $param.='&search_dfyear='.urlencode($search_dfyear);
if ($search_dfmonth != '') $param.='&search_dfmonth='.urlencode($search_dfmonth);
if ($search_sale != '') $param.='&search_sale=' .urlencode($search_sale);
if ($search_user != '') $param.='&search_user=' .urlencode($search_user);
if ($search_product_category != '') $param.='&search_product_category=' .urlencode($search_product_category);
if ($show_files) $param.='&show_files=' .urlencode($show_files);
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
// List of mass actions available
$arrayofmassactions = array(
'presend'=>$langs->trans("SendByMail"),
'builddoc'=>$langs->trans("PDFMerge"),
);
if ($user->rights->contrat->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete");
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'title_commercial.png', 0, '', '', $limit);
$topicmail="SendContractRef";
$modelmail="contract";
$objecttmp=new Contrat($db);
$trackid='con'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
}
$moreforfilter='';
// If the user can view prospects other than his'
if ($user->rights->societe->client->voir || $socid)
{
$langs->load("commercial");
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': ';
$moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user,0,1,'maxwidth200');
$moreforfilter.='</div>';
}
// If the user can view other users
if ($user->rights->user->user->lire)
{
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': ';
$moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200');
$moreforfilter.='</div>';
}
// If the user can view categories of products
if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights->service->lire))
{
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
$moreforfilter.='</div>';
}
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
else $moreforfilter = $hookmanager->resPrint;
if (! empty($moreforfilter))
{
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print $moreforfilter;
print '</div>';
}
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
print '<tr class="liste_titre_filter">';
if (! empty($arrayfields['c.ref']['checked']))
{
print '<td class="liste_titre">';
print '<input type="text" class="flat" size="3" name="search_contract" value="'.dol_escape_htmltag($search_contract).'">';
print '</td>';
}
if (! empty($arrayfields['c.ref_customer']['checked']))
{
print '<td class="liste_titre">';
print '<input type="text" class="flat" size="6" name="search_ref_customer" value="'.dol_escape_htmltag($search_ref_customer).'">';
print '</td>';
}
if (! empty($arrayfields['c.ref_supplier']['checked']))
{
print '<td class="liste_titre">';
print '<input type="text" class="flat" size="6" name="search_ref_supplier" value="'.dol_escape_htmltag($search_ref_supplier).'">';
print '</td>';
}
if (! empty($arrayfields['s.nom']['checked']))
{
print '<td class="liste_titre">';
print '<input type="text" class="flat" size="8" name="search_name" value="'.dol_escape_htmltag($search_name).'">';
print '</td>';
}
if (! empty($arrayfields['s.email']['checked']))
{
print '<td class="liste_titre">';
print '<input type="text" class="flat" size="6" name="search_email" value="'.dol_escape_htmltag($search_email).'">';
print '</td>';
}
// Town
if (! empty($arrayfields['s.town']['checked'])) print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.$search_town.'"></td>';
// Zip
if (! empty($arrayfields['s.zip']['checked'])) print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_zip" value="'.$search_zip.'"></td>';
// State
if (! empty($arrayfields['state.nom']['checked']))
{
print '<td class="liste_titre">';
print '<input class="flat" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).'">';
print '</td>';
}
// Country
if (! empty($arrayfields['country.code_iso']['checked']))
{
print '<td class="liste_titre" align="center">';
print $form->select_country($search_country,'search_country','',0,'maxwidth100');
print '</td>';
}
// Company type
if (! empty($arrayfields['typent.code']['checked']))
{
print '<td class="liste_titre maxwidthonsmartphone" align="center">';
print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT));
print '</td>';
}
if (! empty($arrayfields['sale_representative']['checked']))
{
print '<td class="liste_titre"></td>';
}
if (! empty($arrayfields['c.date_contrat']['checked']))
{
// Date contract
print '<td class="liste_titre center nowraponall">';
//print $langs->trans('Month').': ';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.$day.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
//print '&nbsp;'.$langs->trans('Year').': ';
$syear = $year;
print $formother->selectyear($syear,'year',1, 20, 5, 0, 0, '', 'widthauto');
print '</td>';
}
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
// Fields from hook
$parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
if (! empty($arrayfields['c.datec']['checked']))
{
print '<td class="liste_titre">';
print '</td>';
}
// Date modification
if (! empty($arrayfields['c.tms']['checked']))
{
print '<td class="liste_titre">';
print '</td>';
}
// First end date
if (! empty($arrayfields['lower_planned_end_date']['checked']))
{
print '<td class="liste_titre" align="center">';
$arrayofoperators=array('0'=>'','='=>'=','<='=>'<=','>='=>'>=');
print $form->selectarray('search_op2df',$arrayofoperators,$search_op2df,0);
print '</br>';
print $formother->select_month($search_dfmonth, 'search_dfmonth', 1);
print ' ';
$formother->select_year($search_dfyear, 'search_dfyear', 1, 20, 5);
print '</td>';
}
// Status
if (! empty($arrayfields['status']['checked']))
{
print '<td class="liste_titre" colspan="4" align="right"></td>';
}
print '<td class="liste_titre" align="middle">';
$searchpicto=$form->showFilterButtons();
print $searchpicto;
print '</td>';
print "</tr>\n";
print '<tr class="liste_titre">';
if (! empty($arrayfields['c.ref']['checked'])) print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], "c.ref","","$param",'',$sortfield,$sortorder);
if (! empty($arrayfields['c.ref_customer']['checked'])) print_liste_field_titre($arrayfields['c.ref_customer']['label'], $_SERVER["PHP_SELF"], "c.ref_customer","","$param",'',$sortfield,$sortorder);
if (! empty($arrayfields['c.ref_supplier']['checked'])) print_liste_field_titre($arrayfields['c.ref_supplier']['label'], $_SERVER["PHP_SELF"], "c.ref_supplier","","$param",'',$sortfield,$sortorder);
if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom","","$param",'',$sortfield,$sortorder);
if (! empty($arrayfields['s.email']['checked'])) print_liste_field_titre($arrayfields['s.email']['label'], $_SERVER["PHP_SELF"], "s.email","","$param",'',$sortfield,$sortorder);
if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'],$_SERVER["PHP_SELF"],'s.zip','',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['sale_representative']['checked'])) print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "","","$param",'',$sortfield,$sortorder);
if (! empty($arrayfields['c.date_contrat']['checked'])) print_liste_field_titre($arrayfields['c.date_contrat']['label'], $_SERVER["PHP_SELF"], "c.date_contrat","","$param",'align="center"',$sortfield,$sortorder);
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
$parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (! empty($arrayfields['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'],$_SERVER["PHP_SELF"],"c.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'],$_SERVER["PHP_SELF"],"c.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['lower_planned_end_date']['checked'])) print_liste_field_titre($arrayfields['lower_planned_end_date']['label'],$_SERVER["PHP_SELF"],"lower_planned_end_date","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['status']['checked']))
{
print_liste_field_titre($staticcontratligne->LibStatut(0,3), '', '', '', '', 'width="16"');
print_liste_field_titre($staticcontratligne->LibStatut(4,3,0), '', '', '', '', 'width="16"');
print_liste_field_titre($staticcontratligne->LibStatut(4,3,1), '', '', '', '', 'width="16"');
print_liste_field_titre($staticcontratligne->LibStatut(5,3), '', '', '', '', 'width="16"');
}
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
print "</tr>\n";
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($resql);
$contracttmp->ref=$obj->ref;
$contracttmp->id=$obj->rowid;
$contracttmp->ref_customer=$obj->ref_customer;
$contracttmp->ref_supplier=$obj->ref_supplier;
if ($obj->socid > 0)
{
$soc = new Societe($db);
$soc->fetch($socid);
if (empty($search_name)) $search_name = $soc->name;
$result=$socstatic->fetch($obj->socid);
}
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($sall != '') $param.='&sall='.urlencode($sall);
if ($search_contract != '') $param.='&search_contract='.urlencode($search_contract);
if ($search_name != '') $param.='&search_name='.urlencode($search_name);
if ($search_email != '') $param.='&search_email='.urlencode($search_email);
if ($search_ref_customer != '') $param.='&search_ref_customer='.urlencode($search_ref_customer);
if ($search_ref_supplier != '') $param.='&search_ref_supplier='.urlencode($search_ref_supplier);
if ($search_op2df != '') $param.='&search_op2df='.urlencode($search_op2df);
if ($search_dfyear != '') $param.='&search_dfyear='.urlencode($search_dfyear);
if ($search_dfmonth != '') $param.='&search_dfmonth='.urlencode($search_dfmonth);
if ($search_sale != '') $param.='&search_sale=' .urlencode($search_sale);
if ($search_user != '') $param.='&search_user=' .urlencode($search_user);
if ($search_product_category != '') $param.='&search_product_category=' .urlencode($search_product_category);
if ($show_files) $param.='&show_files=' .urlencode($show_files);
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
// List of mass actions available
$arrayofmassactions = array(
'presend'=>$langs->trans("SendByMail"),
'builddoc'=>$langs->trans("PDFMerge"),
);
if ($user->rights->contrat->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete");
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'title_commercial.png', 0, '', '', $limit);
$topicmail="SendContractRef";
$modelmail="contract";
$objecttmp=new Contrat($db);
$trackid='con'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
}
$moreforfilter='';
// If the user can view prospects other than his'
if ($user->rights->societe->client->voir || $socid)
{
$langs->load("commercial");
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': ';
$moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user,0,1,'maxwidth200');
$moreforfilter.='</div>';
}
// If the user can view other users
if ($user->rights->user->user->lire)
{
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': ';
$moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200');
$moreforfilter.='</div>';
}
// If the user can view categories of products
if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights->service->lire))
{
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
$moreforfilter.='</div>';
}
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
else $moreforfilter = $hookmanager->resPrint;
if (! empty($moreforfilter))
{
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print $moreforfilter;
print '</div>';
}
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
print '<tr class="liste_titre_filter">';
print '<tr class="oddeven">';
if (! empty($arrayfields['c.ref']['checked']))
{
print '<td class="liste_titre">';
print '<input type="text" class="flat" size="3" name="search_contract" value="'.dol_escape_htmltag($search_contract).'">';
print '<td class="nowrap">';
print $contracttmp->getNomUrl(1);
if ($obj->nb_late) print img_warning($langs->trans("Late"));
if (!empty($obj->note_private) || !empty($obj->note_public))
{
print ' <span class="note">';
print '<a href="'.DOL_URL_ROOT.'/contrat/note.php?id='.$obj->rowid.'">'.img_picto($langs->trans("ViewPrivateNote"),'object_generic').'</a>';
print '</span>';
}
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->contrat->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
print $formfile->getDocumentsLink($contracttmp->element, $filename, $filedir);
print '</td>';
print '</td>';
}
if (! empty($arrayfields['c.ref_customer']['checked']))
{
print '<td class="liste_titre">';
print '<input type="text" class="flat" size="6" name="search_ref_customer" value="'.dol_escape_htmltag($search_ref_customer).'">';
print '</td>';
print '<td>'.$obj->ref_customer.'</td>';
}
if (! empty($arrayfields['c.ref_supplier']['checked']))
{
print '<td class="liste_titre">';
print '<input type="text" class="flat" size="6" name="search_ref_supplier" value="'.dol_escape_htmltag($search_ref_supplier).'">';
print '</td>';
print '<td>'.$obj->ref_supplier.'</td>';
}
if (! empty($arrayfields['s.nom']['checked']))
{
print '<td class="liste_titre">';
print '<input type="text" class="flat" size="8" name="search_name" value="'.dol_escape_htmltag($search_name).'">';
print '<td>';
//print '<a href="../comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a>';
if ($obj->socid > 0)
{
print $socstatic->getNomUrl(1, '');
}
print '</td>';
}
if (! empty($arrayfields['s.email']['checked']))
{
print '<td class="liste_titre">';
print '<input type="text" class="flat" size="6" name="search_email" value="'.dol_escape_htmltag($search_email).'">';
print '</td>';
print '<td>'.$obj->email.'</td>';
}
// Town
if (! empty($arrayfields['s.town']['checked'])) print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.$search_town.'"></td>';
if (! empty($arrayfields['s.town']['checked']))
{
print '<td class="nocellnopadd">';
print $obj->town;
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Zip
if (! empty($arrayfields['s.zip']['checked'])) print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_zip" value="'.$search_zip.'"></td>';
if (! empty($arrayfields['s.zip']['checked']))
{
print '<td class="nocellnopadd">';
print $obj->zip;
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// State
if (! empty($arrayfields['state.nom']['checked']))
{
print '<td class="liste_titre">';
print '<input class="flat" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).'">';
print '</td>';
print "<td>".$obj->state_name."</td>\n";
if (! $i) $totalarray['nbfield']++;
}
// Country
if (! empty($arrayfields['country.code_iso']['checked']))
{
print '<td class="liste_titre" align="center">';
print $form->select_country($search_country,'search_country','',0,'maxwidth100');
print '<td align="center">';
$tmparray=getCountry($obj->fk_pays,'all');
print $tmparray['label'];
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Company type
// Type ent
if (! empty($arrayfields['typent.code']['checked']))
{
print '<td class="liste_titre maxwidthonsmartphone" align="center">';
print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT));
print '<td align="center">';
if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1);
print $typenArray[$obj->typent_code];
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
if (! empty($arrayfields['sale_representative']['checked']))
{
print '<td class="liste_titre"></td>';
}
if (! empty($arrayfields['c.date_contrat']['checked']))
{
// Date contract
print '<td class="liste_titre center nowraponall">';
//print $langs->trans('Month').': ';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.$day.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
//print '&nbsp;'.$langs->trans('Year').': ';
$syear = $year;
print $formother->selectyear($syear,'year',1, 20, 5, 0, 0, '', 'widthauto');
// Sales representatives
print '<td>';
if ($obj->socid > 0)
{
$listsalesrepresentatives=$socstatic->getSalesRepresentatives($user);
if ($listsalesrepresentatives < 0) dol_print_error($db);
$nbofsalesrepresentative=count($listsalesrepresentatives);
if ($nbofsalesrepresentative > 3) // We print only number
{
print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$socstatic->id.'">';
print $nbofsalesrepresentative;
print '</a>';
}
else if ($nbofsalesrepresentative > 0)
{
$userstatic=new User($db);
$j=0;
foreach($listsalesrepresentatives as $val)
{
$userstatic->id=$val['id'];
$userstatic->lastname=$val['lastname'];
$userstatic->firstname=$val['firstname'];
$userstatic->email=$val['email'];
$userstatic->statut=$val['statut'];
$userstatic->entity=$val['entity'];
$userstatic->photo=$val['photo'];
//print '<div class="float">':
print $userstatic->getNomUrl(-2);
$j++;
if ($j < $nbofsalesrepresentative) print ' ';
//print '</div>';
}
}
//else print $langs->trans("NoSalesRepresentativeAffected");
}
else
{
print '&nbsp';
}
print '</td>';
}
// Date
if (! empty($arrayfields['c.date_contrat']['checked']))
{
print '<td align="center">'.dol_print_date($db->jdate($obj->date_contrat), 'day', 'tzuser').'</td>';
}
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
$parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
if (! empty($arrayfields['c.datec']['checked']))
{
print '<td class="liste_titre">';
print '<td align="center" class="nowrap">';
print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Date modification
if (! empty($arrayfields['c.tms']['checked']))
{
print '<td class="liste_titre">';
print '<td align="center" class="nowrap">';
print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// First end date
// Date lower end date
if (! empty($arrayfields['lower_planned_end_date']['checked']))
{
print '<td class="liste_titre" align="center">';
$arrayofoperators=array('0'=>'','='=>'=','<='=>'<=','>='=>'>=');
print $form->selectarray('search_op2df',$arrayofoperators,$search_op2df,0);
print '</br>';
print $formother->select_month($search_dfmonth, 'search_dfmonth', 1);
print ' ';
$formother->select_year($search_dfyear, 'search_dfyear', 1, 20, 5);
print '</td>';
print '<td align="center" class="nowrap">';
print dol_print_date($db->jdate($obj->lower_planned_end_date), 'day', 'tzuser');
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Status
if (! empty($arrayfields['status']['checked']))
{
print '<td class="liste_titre" colspan="4" align="right"></td>';
print '<td align="center">'.($obj->nb_initial>0?$obj->nb_initial:'').'</td>';
print '<td align="center">'.($obj->nb_running>0?$obj->nb_running:'').'</td>';
print '<td align="center">'.($obj->nb_expired>0?$obj->nb_expired:'').'</td>';
print '<td align="center">'.($obj->nb_closed>0 ?$obj->nb_closed:'').'</td>';
}
// Action column
print '<td class="nowrap" align="center">';
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
{
$selected=0;
if (in_array($obj->rowid, $arrayofselected)) $selected=1;
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected?' checked="checked"':'').'>';
}
print '<td class="liste_titre" align="middle">';
$searchpicto=$form->showFilterButtons();
print $searchpicto;
print '</td>';
if (! $i) $totalarray['nbfield']++;
print "</tr>\n";
print '<tr class="liste_titre">';
if (! empty($arrayfields['c.ref']['checked'])) print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], "c.ref","","$param",'',$sortfield,$sortorder);
if (! empty($arrayfields['c.ref_customer']['checked'])) print_liste_field_titre($arrayfields['c.ref_customer']['label'], $_SERVER["PHP_SELF"], "c.ref_customer","","$param",'',$sortfield,$sortorder);
if (! empty($arrayfields['c.ref_supplier']['checked'])) print_liste_field_titre($arrayfields['c.ref_supplier']['label'], $_SERVER["PHP_SELF"], "c.ref_supplier","","$param",'',$sortfield,$sortorder);
if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom","","$param",'',$sortfield,$sortorder);
if (! empty($arrayfields['s.email']['checked'])) print_liste_field_titre($arrayfields['s.email']['label'], $_SERVER["PHP_SELF"], "s.email","","$param",'',$sortfield,$sortorder);
if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'],$_SERVER["PHP_SELF"],'s.zip','',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['sale_representative']['checked'])) print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "","","$param",'',$sortfield,$sortorder);
if (! empty($arrayfields['c.date_contrat']['checked'])) print_liste_field_titre($arrayfields['c.date_contrat']['label'], $_SERVER["PHP_SELF"], "c.date_contrat","","$param",'align="center"',$sortfield,$sortorder);
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
$parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (! empty($arrayfields['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'],$_SERVER["PHP_SELF"],"c.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'],$_SERVER["PHP_SELF"],"c.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['lower_planned_end_date']['checked'])) print_liste_field_titre($arrayfields['lower_planned_end_date']['label'],$_SERVER["PHP_SELF"],"lower_planned_end_date","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
if (! empty($arrayfields['status']['checked']))
{
print_liste_field_titre($staticcontratligne->LibStatut(0,3), '', '', '', '', 'width="16"');
print_liste_field_titre($staticcontratligne->LibStatut(4,3,0), '', '', '', '', 'width="16"');
print_liste_field_titre($staticcontratligne->LibStatut(4,3,1), '', '', '', '', 'width="16"');
print_liste_field_titre($staticcontratligne->LibStatut(5,3), '', '', '', '', 'width="16"');
}
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
print "</tr>\n";
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($resql);
$contracttmp->ref=$obj->ref;
$contracttmp->id=$obj->rowid;
$contracttmp->ref_customer=$obj->ref_customer;
$contracttmp->ref_supplier=$obj->ref_supplier;
if ($obj->socid > 0)
{
$result=$socstatic->fetch($obj->socid);
}
print '<tr class="oddeven">';
if (! empty($arrayfields['c.ref']['checked']))
{
print '<td class="nowrap">';
print $contracttmp->getNomUrl(1);
if ($obj->nb_late) print img_warning($langs->trans("Late"));
if (!empty($obj->note_private) || !empty($obj->note_public))
{
print ' <span class="note">';
print '<a href="'.DOL_URL_ROOT.'/contrat/note.php?id='.$obj->rowid.'">'.img_picto($langs->trans("ViewPrivateNote"),'object_generic').'</a>';
print '</span>';
}
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->contrat->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
print $formfile->getDocumentsLink($contracttmp->element, $filename, $filedir);
print '</td>';
print '</td>';
}
if (! empty($arrayfields['c.ref_customer']['checked']))
{
print '<td>'.$obj->ref_customer.'</td>';
}
if (! empty($arrayfields['c.ref_supplier']['checked']))
{
print '<td>'.$obj->ref_supplier.'</td>';
}
if (! empty($arrayfields['s.nom']['checked']))
{
print '<td>';
//print '<a href="../comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a>';
if ($obj->socid > 0)
{
print $socstatic->getNomUrl(1, '');
}
print '</td>';
}
if (! empty($arrayfields['s.email']['checked']))
{
print '<td>'.$obj->email.'</td>';
}
// Town
if (! empty($arrayfields['s.town']['checked']))
{
print '<td class="nocellnopadd">';
print $obj->town;
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Zip
if (! empty($arrayfields['s.zip']['checked']))
{
print '<td class="nocellnopadd">';
print $obj->zip;
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// State
if (! empty($arrayfields['state.nom']['checked']))
{
print "<td>".$obj->state_name."</td>\n";
if (! $i) $totalarray['nbfield']++;
}
// Country
if (! empty($arrayfields['country.code_iso']['checked']))
{
print '<td align="center">';
$tmparray=getCountry($obj->fk_pays,'all');
print $tmparray['label'];
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Type ent
if (! empty($arrayfields['typent.code']['checked']))
{
print '<td align="center">';
if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1);
print $typenArray[$obj->typent_code];
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
if (! empty($arrayfields['sale_representative']['checked']))
{
// Sales representatives
print '<td>';
if ($obj->socid > 0)
{
$listsalesrepresentatives=$socstatic->getSalesRepresentatives($user);
if ($listsalesrepresentatives < 0) dol_print_error($db);
$nbofsalesrepresentative=count($listsalesrepresentatives);
if ($nbofsalesrepresentative > 3) // We print only number
{
print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$socstatic->id.'">';
print $nbofsalesrepresentative;
print '</a>';
}
else if ($nbofsalesrepresentative > 0)
{
$userstatic=new User($db);
$j=0;
foreach($listsalesrepresentatives as $val)
{
$userstatic->id=$val['id'];
$userstatic->lastname=$val['lastname'];
$userstatic->firstname=$val['firstname'];
$userstatic->email=$val['email'];
$userstatic->statut=$val['statut'];
$userstatic->entity=$val['entity'];
$userstatic->photo=$val['photo'];
//print '<div class="float">':
print $userstatic->getNomUrl(-2);
$j++;
if ($j < $nbofsalesrepresentative) print ' ';
//print '</div>';
}
}
//else print $langs->trans("NoSalesRepresentativeAffected");
}
else
{
print '&nbsp';
}
print '</td>';
}
// Date
if (! empty($arrayfields['c.date_contrat']['checked']))
{
print '<td align="center">'.dol_print_date($db->jdate($obj->date_contrat), 'day', 'tzuser').'</td>';
}
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
if (! empty($arrayfields['c.datec']['checked']))
{
print '<td align="center" class="nowrap">';
print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Date modification
if (! empty($arrayfields['c.tms']['checked']))
{
print '<td align="center" class="nowrap">';
print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Date lower end date
if (! empty($arrayfields['lower_planned_end_date']['checked']))
{
print '<td align="center" class="nowrap">';
print dol_print_date($db->jdate($obj->lower_planned_end_date), 'day', 'tzuser');
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Status
if (! empty($arrayfields['status']['checked']))
{
print '<td align="center">'.($obj->nb_initial>0?$obj->nb_initial:'').'</td>';
print '<td align="center">'.($obj->nb_running>0?$obj->nb_running:'').'</td>';
print '<td align="center">'.($obj->nb_expired>0?$obj->nb_expired:'').'</td>';
print '<td align="center">'.($obj->nb_closed>0 ?$obj->nb_closed:'').'</td>';
}
// Action column
print '<td class="nowrap" align="center">';
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
{
$selected=0;
if (in_array($obj->rowid, $arrayofselected)) $selected=1;
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected?' checked="checked"':'').'>';
}
print '</td>';
if (! $i) $totalarray['nbfield']++;
print "</tr>\n";
$i++;
}
$db->free($resql);
print '</table>';
print '</div>';
print '</form>';
$hidegeneratedfilelistifempty=1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty=0;
// Show list of available documents
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
$urlsource.=str_replace('&amp;','&',$param);
$filedir=$diroutputmassaction;
$genallowed=$user->rights->contrat->lire;
$delallowed=$user->rights->contrat->lire;
print $formfile->showdocuments('massfilesarea_contract','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'','','',null,$hidegeneratedfilelistifempty);
}
else
{
dol_print_error($db);
$i++;
}
$db->free($resql);
print '</table>';
print '</div>';
print '</form>';
$hidegeneratedfilelistifempty=1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty=0;
// Show list of available documents
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
$urlsource.=str_replace('&amp;','&',$param);
$filedir=$diroutputmassaction;
$genallowed=$user->rights->contrat->lire;
$delallowed=$user->rights->contrat->lire;
print $formfile->showdocuments('massfilesarea_contract','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'','','',null,$hidegeneratedfilelistifempty);
llxFooter();

View File

@ -63,7 +63,7 @@ if ((isset($_POST['roworder']) && ! empty($_POST['roworder'])) && (isset($_POST[
$row->table_element_line = $table_element_line;
$row->fk_element = $fk_element;
$row->id = $element_id;
$row->line_ajaxorder($newrowordertab); // This update field rank or position in table table_element_line
$row->line_ajaxorder($newrowordertab); // This update field rank or position in table row->table_element_line
// Reorder line to have position of children lines sharing same counter than parent lines
// This should be useless because there is no need to have children sharing same counter than parent, but well, it's cleaner into database.

View File

@ -2841,7 +2841,6 @@ abstract class CommonObject
$sql.= " ".$clause." (fk_target = ".$targetid." AND targettype = '".$targettype."')";
}
$sql .= ' ORDER BY sourcetype';
//print $sql;
dol_syslog(get_class($this)."::fetchObjectLink", LOG_DEBUG);
$resql = $this->db->query($sql);
@ -3086,9 +3085,10 @@ abstract class CommonObject
* @param int $status Status to set
* @param int $elementId Id of element to force (use this->id by default)
* @param string $elementType Type of element to force (use this->table_element by default)
* @param string $trigkey Trigger key to use for trigger
* @return int <0 if KO, >0 if OK
*/
function setStatut($status,$elementId=null,$elementType='')
function setStatut($status, $elementId=null, $elementType='', $trigkey='')
{
global $user,$langs,$conf;
@ -3100,6 +3100,7 @@ abstract class CommonObject
$this->db->begin();
$fieldstatus="fk_statut";
if ($elementTable == 'facture_rec') $fieldstatus="suspended";
if ($elementTable == 'mailing') $fieldstatus="statut";
if ($elementTable == 'cronjob') $fieldstatus="status";
if ($elementTable == 'user') $fieldstatus="statut";
@ -3117,13 +3118,16 @@ abstract class CommonObject
{
$error = 0;
$trigkey='';
if ($this->element == 'supplier_proposal' && $status == 2) $trigkey='SUPPLIER_PROPOSAL_SIGN'; // 2 = SupplierProposal::STATUS_SIGNED. Can't use constant into this generic class
if ($this->element == 'supplier_proposal' && $status == 3) $trigkey='SUPPLIER_PROPOSAL_REFUSE'; // 3 = SupplierProposal::STATUS_REFUSED. Can't use constant into this generic class
if ($this->element == 'supplier_proposal' && $status == 4) $trigkey='SUPPLIER_PROPOSAL_CLOSE'; // 4 = SupplierProposal::STATUS_CLOSED. Can't use constant into this generic class
if ($this->element == 'fichinter' && $status == 3) $trigkey='FICHINTER_CLASSIFY_DONE';
if ($this->element == 'fichinter' && $status == 2) $trigkey='FICHINTER_CLASSIFY_BILLED';
if ($this->element == 'fichinter' && $status == 1) $trigkey='FICHINTER_CLASSIFY_UNBILLED';
// Try autoset of trigkey
if (empty($trigkey))
{
if ($this->element == 'supplier_proposal' && $status == 2) $trigkey='SUPPLIER_PROPOSAL_SIGN'; // 2 = SupplierProposal::STATUS_SIGNED. Can't use constant into this generic class
if ($this->element == 'supplier_proposal' && $status == 3) $trigkey='SUPPLIER_PROPOSAL_REFUSE'; // 3 = SupplierProposal::STATUS_REFUSED. Can't use constant into this generic class
if ($this->element == 'supplier_proposal' && $status == 4) $trigkey='SUPPLIER_PROPOSAL_CLOSE'; // 4 = SupplierProposal::STATUS_CLOSED. Can't use constant into this generic class
if ($this->element == 'fichinter' && $status == 3) $trigkey='FICHINTER_CLASSIFY_DONE';
if ($this->element == 'fichinter' && $status == 2) $trigkey='FICHINTER_CLASSIFY_BILLED';
if ($this->element == 'fichinter' && $status == 1) $trigkey='FICHINTER_CLASSIFY_UNBILLED';
}
if ($trigkey)
{
@ -6004,7 +6008,7 @@ abstract class CommonObject
{
$labeltoshow = '<span'.($mode != 'view' ? ' class="fieldrequired"':'').'>'.$labeltoshow.'</span>';
}
if (empty($onetrtd)) $out .= '<td>';
else $out .= '<td'.($colspan?' colspan="'.($colspan+1).'"':'').'>';
@ -6194,6 +6198,243 @@ abstract class CommonObject
return $buyPrice;
}
/**
* Show photos of an object (nbmax maximum), into several columns
*
* @param string $modulepart 'product', 'ticketsup', ...
* @param string $sdir Directory to scan (full absolute path)
* @param int $size 0=original size, 1='small' use thumbnail if possible
* @param int $nbmax Nombre maximum de photos (0=pas de max)
* @param int $nbbyrow Number of image per line or -1 to use div. Used only if size=1.
* @param int $showfilename 1=Show filename
* @param int $showaction 1=Show icon with action links (resize, delete)
* @param int $maxHeight Max height of original image when size='small' (so we can use original even if small requested). If 0, always use 'small' thumb image.
* @param int $maxWidth Max width of original image when size='small'
* @param int $nolink Do not add a href link to view enlarged imaged into a new tab
* @param int $notitle Do not add title tag on image
* @param int $usesharelink Use the public shared link of image (if not available, the 'nophoto' image will be shown instead)
* @return string Html code to show photo. Number of photos shown is saved in this->nbphoto
*/
function show_photos($modulepart, $sdir, $size=0, $nbmax=0, $nbbyrow=5, $showfilename=0, $showaction=0, $maxHeight=120, $maxWidth=160, $nolink=0, $notitle=0, $usesharelink=0)
{
global $conf,$user,$langs;
include_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
include_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php';
$sortfield='position_name';
$sortorder='asc';
$dir = $sdir . '/';
$pdir = '/';
if ($modulepart == 'ticketsup')
{
$dir .= get_exdir(0, 0, 0, 0, $this, $modulepart).$this->track_id.'/';
$pdir .= get_exdir(0, 0, 0, 0, $this, $modulepart).$this->track_id.'/';
}
else
{
$dir .= get_exdir(0, 0, 0, 0, $this, $modulepart).$this->ref.'/';
$pdir .= get_exdir(0, 0, 0, 0, $this, $modulepart).$this->ref.'/';
}
// For backward compatibility
if ($modulepart == 'product' && ! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
{
$dir = $sdir . '/'. get_exdir($this->id,2,0,0,$this,$modulepart) . $this->id ."/photos/";
$pdir = '/' . get_exdir($this->id,2,0,0,$this,$modulepart) . $this->id ."/photos/";
}
// Defined relative dir to DOL_DATA_ROOT
$relativedir = '';
if ($dir)
{
$relativedir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $dir);
$relativedir = preg_replace('/^[\\/]/','',$relativedir);
$relativedir = preg_replace('/[\\/]$/','',$relativedir);
}
$dirthumb = $dir.'thumbs/';
$pdirthumb = $pdir.'thumbs/';
$return ='<!-- Photo -->'."\n";
$nbphoto=0;
$filearray=dol_dir_list($dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
/*if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) // For backward compatiblity, we scan also old dirs
{
$filearrayold=dol_dir_list($dirold,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$filearray=array_merge($filearray, $filearrayold);
}*/
completeFileArrayWithDatabaseInfo($filearray, $relativedir);
if (count($filearray))
{
if ($sortfield && $sortorder)
{
$filearray=dol_sort_array($filearray, $sortfield, $sortorder);
}
foreach($filearray as $key => $val)
{
$photo='';
$file = $val['name'];
//if (! utf8_check($file)) $file=utf8_encode($file); // To be sure file is stored in UTF8 in memory
//if (dol_is_file($dir.$file) && image_format_supported($file) >= 0)
if (image_format_supported($file) >= 0)
{
$nbphoto++;
$photo = $file;
$viewfilename = $file;
if ($size == 1 || $size == 'small') { // Format vignette
// Find name of thumb file
$photo_vignette=basename(getImageFileNameForSize($dir.$file, '_small'));
if (! dol_is_file($dirthumb.$photo_vignette)) $photo_vignette='';
// Get filesize of original file
$imgarray=dol_getImageSize($dir.$photo);
if ($nbbyrow > 0)
{
if ($nbphoto == 1) $return.= '<table width="100%" valign="top" align="center" border="0" cellpadding="2" cellspacing="2">';
if ($nbphoto % $nbbyrow == 1) $return.= '<tr align=center valign=middle border=1>';
$return.= '<td width="'.ceil(100/$nbbyrow).'%" class="photo">';
}
else if ($nbbyrow < 0) $return .= '<div class="inline-block">';
$return.= "\n";
$relativefile=preg_replace('/^\//', '', $pdir.$photo);
if (empty($nolink))
{
$urladvanced=getAdvancedPreviewUrl($modulepart, $relativefile, 0, 'entity='.$this->entity);
if ($urladvanced) $return.='<a href="'.$urladvanced.'">';
else $return.= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$this->entity.'&file='.urlencode($pdir.$photo).'" class="aphoto" target="_blank">';
}
// Show image (width height=$maxHeight)
// Si fichier vignette disponible et image source trop grande, on utilise la vignette, sinon on utilise photo origine
$alt=$langs->transnoentitiesnoconv('File').': '.$relativefile;
$alt.=' - '.$langs->transnoentitiesnoconv('Size').': '.$imgarray['width'].'x'.$imgarray['height'];
if ($notitle) $alt='';
if ($usesharelink)
{
if ($val['share'])
{
if (empty($maxHeight) || $photo_vignette && $imgarray['height'] > $maxHeight)
{
$return.= '<!-- Show original file (thumb not yet available with shared links) -->';
$return.= '<img class="photo photowithmargin" border="0" height="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?hashp='.urlencode($val['share']).'" title="'.dol_escape_htmltag($alt).'">';
}
else {
$return.= '<!-- Show original file -->';
$return.= '<img class="photo photowithmargin" border="0" height="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?hashp='.urlencode($val['share']).'" title="'.dol_escape_htmltag($alt).'">';
}
}
else
{
$return.= '<!-- Show nophoto file (because file is not shared) -->';
$return.= '<img class="photo photowithmargin" border="0" height="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png" title="'.dol_escape_htmltag($alt).'">';
}
}
else
{
if (empty($maxHeight) || $photo_vignette && $imgarray['height'] > $maxHeight)
{
$return.= '<!-- Show thumb -->';
$return.= '<img class="photo photowithmargin" border="0" height="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$this->entity.'&file='.urlencode($pdirthumb.$photo_vignette).'" title="'.dol_escape_htmltag($alt).'">';
}
else {
$return.= '<!-- Show original file -->';
$return.= '<img class="photo photowithmargin" border="0" height="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$this->entity.'&file='.urlencode($pdir.$photo).'" title="'.dol_escape_htmltag($alt).'">';
}
}
if (empty($nolink)) $return.= '</a>';
$return.="\n";
if ($showfilename) $return.= '<br>'.$viewfilename;
if ($showaction)
{
$return.= '<br>';
// On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites
if ($photo_vignette && (image_format_supported($photo) > 0) && ($this->imgWidth > $maxWidth || $this->imgHeight > $maxHeight))
{
$return.= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=addthumb&amp;file='.urlencode($pdir.$viewfilename).'">'.img_picto($langs->trans('GenerateThumb'),'refresh').'&nbsp;&nbsp;</a>';
}
// Special cas for product
if ($modulepart == 'product' && ($user->rights->produit->creer || $user->rights->service->creer))
{
// Link to resize
$return.= '<a href="'.DOL_URL_ROOT.'/core/photos_resize.php?modulepart='.urlencode('produit|service').'&id='.$this->id.'&amp;file='.urlencode($pdir.$viewfilename).'" title="'.dol_escape_htmltag($langs->trans("Resize")).'">'.img_picto($langs->trans("Resize"), 'resize', '').'</a> &nbsp; ';
// Link to delete
$return.= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=delete&amp;file='.urlencode($pdir.$viewfilename).'">';
$return.= img_delete().'</a>';
}
}
$return.= "\n";
if ($nbbyrow > 0)
{
$return.= '</td>';
if (($nbphoto % $nbbyrow) == 0) $return.= '</tr>';
}
else if ($nbbyrow < 0) $return.='</div>';
}
if (empty($size)) { // Format origine
$return.= '<img class="photo photowithmargin" border="0" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$this->entity.'&file='.urlencode($pdir.$photo).'">';
if ($showfilename) $return.= '<br>'.$viewfilename;
if ($showaction)
{
// Special case for product
if ($modulepart == 'product' && ($user->rights->produit->creer || $user->rights->service->creer))
{
// Link to resize
$return.= '<a href="'.DOL_URL_ROOT.'/core/photos_resize.php?modulepart='.urlencode('produit|service').'&id='.$this->id.'&amp;file='.urlencode($pdir.$viewfilename).'" title="'.dol_escape_htmltag($langs->trans("Resize")).'">'.img_picto($langs->trans("Resize"), 'resize', '').'</a> &nbsp; ';
// Link to delete
$return.= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=delete&amp;file='.urlencode($pdir.$viewfilename).'">';
$return.= img_delete().'</a>';
}
}
}
// On continue ou on arrete de boucler ?
if ($nbmax && $nbphoto >= $nbmax) break;
}
}
if ($size==1 || $size=='small')
{
if ($nbbyrow > 0)
{
// Ferme tableau
while ($nbphoto % $nbbyrow)
{
$return.= '<td width="'.ceil(100/$nbbyrow).'%">&nbsp;</td>';
$nbphoto++;
}
if ($nbphoto) $return.= '</table>';
}
}
}
$this->nbphoto = $nbphoto;
return $return;
}
/**
@ -6228,7 +6469,6 @@ abstract class CommonObject
else return false;
}
/**
* Function test if type is date
*
@ -6311,7 +6551,7 @@ abstract class CommonObject
*
* @return array
*/
private function set_save_query()
protected function set_save_query()
{
global $conf;
@ -6365,7 +6605,7 @@ abstract class CommonObject
*
* @param stdClass $obj Contain data of object from database
*/
private function setVarsFromFetchObj(&$obj)
protected function setVarsFromFetchObj(&$obj)
{
foreach ($this->fields as $field => $info)
{
@ -6410,7 +6650,7 @@ abstract class CommonObject
*
* @return string
*/
private function get_field_list()
protected function get_field_list()
{
$keys = array_keys($this->fields);
return implode(',', $keys);

View File

@ -1462,10 +1462,11 @@ class Form
* @param string $enableonlytext If option $enableonlytext is set, we use this text to explain into label why record is disabled. Not used if enableonly is empty.
* @param string $morecss More css
* @param int $noactive Show only active users (this will also happened whatever is this option if USER_HIDE_INACTIVE_IN_COMBOBOX is on).
* @param int $outputmode 0=HTML select string, 1=Array
* @return string HTML select string
* @see select_dolgroups
*/
function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity=0, $maxlength=0, $showstatus=0, $morefilter='', $show_every=0, $enableonlytext='', $morecss='', $noactive=0)
function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity=0, $maxlength=0, $showstatus=0, $morefilter='', $show_every=0, $enableonlytext='', $morecss='', $noactive=0, $outputmode=0)
{
global $conf,$user,$langs;
@ -1491,6 +1492,7 @@ class Form
}
$out='';
$outarray = array();
// Forge request to select users
$sql = "SELECT DISTINCT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity";
@ -1618,6 +1620,7 @@ class Form
$out.=' - '.$disableline; // This is text from $enableonlytext parameter
}
$out.= '</option>';
$outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength);
$i++;
}
@ -1634,6 +1637,7 @@ class Form
dol_print_error($this->db);
}
if ($outputmode) return $outarray;
return $out;
}
@ -3593,7 +3597,7 @@ class Form
* @param string $action Action
* @param array $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , ))
* type can be 'hidden', 'text', 'password', 'checkbox', 'radio', 'date', ...
* @param string $selectedchoice "" or "no" or "yes"
* @param string $selectedchoice '' or 'no' or 'yes' or '1' or '0'
* @param int $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx
* @param int $height Force height of box
* @param int $width Force width of box ('999' or '90%'). Ignored and forced to 90% on smartphones.
@ -5417,23 +5421,23 @@ class Form
* Return a HTML select string, built from an array of key+value.
* Note: Do not apply langs->trans function on returned content, content may be entity encoded twice.
*
* @param string $htmlname Name of html select area. Must start with "multi" if this is a multiselect
* @param array $array Array (key => value)
* @param string|string[] $id Preselected key or preselected keys for multiselect
* @param int|string $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (key is -1 and value is '' or '&nbsp;' if 1, key is -1 and value is text if string), <0 to add an empty value with key that is this value.
* @param int $key_in_label 1 to show key into label with format "[key] value"
* @param int $value_as_key 1 to use value as key
* @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container
* @param int $translate 1=Translate and encode value
* @param int $maxlen Length maximum for labels
* @param int $disabled Html select box is disabled
* @param string $sort 'ASC' or 'DESC' = Sort on label, '' or 'NONE' or 'POS' = Do not sort, we keep original order
* @param string $morecss Add more class to css styles
* @param int $addjscombo Add js combo
* @param string $moreparamonempty Add more param on the empty option line. Not used if show_empty not set
* @param int $disablebademail Check if an email is found into value and if not disable and colorize entry
* @param int $nohtmlescape No html escaping.
* @return string HTML select string.
* @param string $htmlname Name of html select area. Must start with "multi" if this is a multiselect
* @param array $array Array (key => value)
* @param string|string[] $id Preselected key or preselected keys for multiselect
* @param int|string $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (key is -1 and value is '' or '&nbsp;' if 1, key is -1 and value is text if string), <0 to add an empty value with key that is this value.
* @param int $key_in_label 1 to show key into label with format "[key] value"
* @param int $value_as_key 1 to use value as key
* @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container
* @param int $translate 1=Translate and encode value
* @param int $maxlen Length maximum for labels
* @param int $disabled Html select box is disabled
* @param string $sort 'ASC' or 'DESC' = Sort on label, '' or 'NONE' or 'POS' = Do not sort, we keep original order
* @param string $morecss Add more class to css styles
* @param int $addjscombo Add js combo
* @param string $moreparamonempty Add more param on the empty option line. Not used if show_empty not set
* @param int $disablebademail Check if an email is found into value and if not disable and colorize entry
* @param int $nohtmlescape No html escaping.
* @return string HTML select string.
* @see multiselectarray
*/
static function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0, $moreparamonempty='',$disablebademail=0, $nohtmlescape=0)
@ -6458,7 +6462,7 @@ class Form
else if ($object->element == 'member')
{
$fullname=$object->getFullName($langs);
if ($object->morphy == 'mor') {
if ($object->morphy == 'mor' && $object->societe) {
$ret.= dol_htmlentities($object->societe) . ((! empty($fullname) && $object->societe != $fullname)?' ('.dol_htmlentities($fullname).')':'');
} else {
$ret.= dol_htmlentities($fullname) . ((! empty($object->societe) && $object->societe != $fullname)?' ('.dol_htmlentities($object->societe).')':'');

View File

@ -24,6 +24,7 @@
* \ingroup Advanced accountancy
* \brief File of class with all html predefined components
*/
require_once DOL_DOCUMENT_ROOT .'/core/class/html.form.class.php';
/**

View File

@ -924,12 +924,13 @@ class FormMail extends Form
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
$langs->load('paypal');
$typeforonlinepayment='free';
if ($this->param["models"]=='order_send') $typeforonlinepayment='order'; // TODO use detection on something else than template
if ($this->param["models"]=='facture_send') $typeforonlinepayment='invoice'; // TODO use detection on something else than template
if ($this->param["models"]=='member_send') $typeforonlinepayment='member'; // TODO use detection on something else than template
if ($this->param["models"]=='order' || $this->param["models"]=='order_send') $typeforonlinepayment='order'; // TODO use detection on something else than template
if ($this->param["models"]=='invoice' || $this->param["models"]=='facture_send') $typeforonlinepayment='invoice'; // TODO use detection on something else than template
if ($this->param["models"]=='member') $typeforonlinepayment='member'; // TODO use detection on something else than template
$url=getOnlinePaymentUrl(0, $typeforonlinepayment, $this->substit['__REF__']);
$paymenturl=$url;
$paymenturl=$url;
}
$this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__']=($paymenturl?$langs->trans("PredefinedMailContentLink", $paymenturl):'');
$this->substit['__ONLINE_PAYMENT_URL__']=$paymenturl;
//Add lines substitution key from each line
@ -1045,7 +1046,7 @@ class FormMail extends Form
* @param int $id Id of template to find, or -1 for first found with position 0, or 0 for first found whatever is position (priority order depends on lang provided or not) or -2 for exact match with label (no answer if not found)
* @param int $active 1=Only active template, 0=Only disabled, -1=All
* @param string $label Label of template
* @return ModelMail
* @return ModelMail One instance of ModelMail
*/
public function getEMailTemplate($db, $type_template, $user, $outputlangs, $id=0, $active=1, $label='')
{
@ -1200,6 +1201,7 @@ class FormMail extends Form
$line->topic=$obj->topic;
$line->content=$obj->content;
$line->content_lines=$obj->content_lines;
$this->lines_model[]=$line;
}
$this->db->free($resql);

View File

@ -808,7 +808,7 @@ class FormTicketsup
// External users can't send message email
if ($user->rights->ticketsup->write && !$user->societe_id) {
if ($user->rights->ticketsup->write && !$user->socid) {
print '<tr><td width="30%"></td><td colspan="2">';
$checkbox_selected = ( GETPOST('send_email') == "1" ? ' checked' : '');
print '<input type="checkbox" name="send_email" value="1" id="send_msg_email" '.$checkbox_selected.'/> ';
@ -839,7 +839,7 @@ class FormTicketsup
print "</td></tr>";
}
if (!$user->societe_id) {
if (! $user->socid) {
print '<tr><td width="30%"></td><td>';
$checkbox_selected = ( GETPOST('private_message') == "1" ? ' checked' : '');
print '<input type="checkbox" name="private_message" value="1" id="private_message" '.$checkbox_selected.'/> ';
@ -902,7 +902,7 @@ class FormTicketsup
// Intro
// External users can't send message email
if ($user->rights->ticketsup->write && !$user->societe_id) {
if ($user->rights->ticketsup->write && !$user->socid) {
$mail_intro = GETPOST('mail_intro') ? GETPOST('mail_intro') : $conf->global->TICKETS_MESSAGE_MAIL_INTRO;
print '<tr class="email_line"><td><label for="mail_intro">' . $langs->trans("TicketMessageMailIntro") . '</label>';
@ -945,7 +945,7 @@ class FormTicketsup
$doleditor = new DolEditor('message', $defaultmessage, '100%', 350, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70);
$doleditor->Create();
print '</td><td align="center">';
if ($user->rights->ticketsup->write && !$user->societe_id) {
if ($user->rights->ticketsup->write && !$user->socid) {
print $form->textwithpicto('', $langs->trans("TicketMessageHelp"), 1, 'help');
}
@ -953,7 +953,7 @@ class FormTicketsup
// Signature
// External users can't send message email
if ($user->rights->ticketsup->write && !$user->societe_id) {
if ($user->rights->ticketsup->write && !$user->socid) {
$mail_signature = GETPOST('mail_signature') ? GETPOST('mail_signature') : $conf->global->TICKETS_MESSAGE_MAIL_SIGNATURE;
print '<tr class="email_line"><td><label for="mail_intro">' . $langs->trans("TicketMessageMailSignature") . '</label>';

View File

@ -169,12 +169,12 @@ class Interfaces
if (method_exists($objMod, 'runTrigger')) // New method to implement
{
dol_syslog(get_class($this)."::run_triggers action=".$action." Launch runTrigger for file '".$files[$key]."'", LOG_INFO);
//dol_syslog(get_class($this)."::run_triggers action=".$action." Launch runTrigger for file '".$files[$key]."'", LOG_DEBUG);
$result=$objMod->runTrigger($action,$object,$user,$langs,$conf);
}
elseif (method_exists($objMod, 'run_trigger')) // Deprecated method
{
dol_syslog(get_class($this)."::run_triggers action=".$action." Launch run_trigger for file '".$files[$key]."'", LOG_INFO);
dol_syslog(get_class($this)."::run_triggers action=".$action." Launch old method run_trigger (rename your trigger into runTrigger) for file '".$files[$key]."'", LOG_WARNING);
$result=$objMod->run_trigger($action,$object,$user,$langs,$conf);
}
else

View File

@ -449,7 +449,6 @@ class Utils
}
}
return 0;
}

View File

@ -1321,14 +1321,15 @@ function complete_elementList_with_modules(&$elementList)
/**
* Show array with constants to edit
*
* @param array $tableau Array of constants
* @param array $tableau Array of constants array('key'=>type, ) where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ...
* @param int $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (no form into table), 2=No form nor button at all
* @param string $helptext Help
* @return void
*/
function form_constantes($tableau, $strictw3c=0, $helptext='')
{
global $db,$bc,$langs,$conf,$_Avery_Labels;
global $db,$bc,$langs,$conf,$user;
global $_Avery_Labels;
$form = new Form($db);
@ -1343,11 +1344,20 @@ function form_constantes($tableau, $strictw3c=0, $helptext='')
print '</td>';
if (empty($strictw3c)) print '<td align="center" width="80">'.$langs->trans("Action").'</td>';
print "</tr>\n";
$var=true;
$listofparam=array();
foreach($tableau as $const) // Loop on each param
foreach($tableau as $key => $const) // Loop on each param
{
// $const is a const key like 'MYMODULE_ABC'
if (is_numeric($key)) {
$type = 'string';
}
else
{
$type = $const;
$const = $key;
}
$sql = "SELECT ";
$sql.= "rowid";
$sql.= ", ".$db->decrypt('name')." as name";
@ -1355,7 +1365,7 @@ function form_constantes($tableau, $strictw3c=0, $helptext='')
$sql.= ", type";
$sql.= ", note";
$sql.= " FROM ".MAIN_DB_PREFIX."const";
$sql.= " WHERE ".$db->decrypt('name')." = '".$const."'";
$sql.= " WHERE ".$db->decrypt('name')." = '".$db->escape($const)."'";
$sql.= " AND entity IN (0, ".$conf->entity.")";
$sql.= " ORDER BY name ASC, entity DESC";
$result = $db->query($sql);
@ -1365,23 +1375,26 @@ function form_constantes($tableau, $strictw3c=0, $helptext='')
{
$obj = $db->fetch_object($result); // Take first result of select
// For avoid warning in strict mode
if (empty($obj)) {
$obj = (object) array('rowid'=>'','name'=>'','value'=>'','type'=>'','note'=>'');
if (empty($obj)) // If not yet into table
{
$obj = (object) array('rowid'=>'','name'=>$const,'value'=>'','type'=>$type,'note'=>'');
}
if (empty($strictw3c)) print "\n".'<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
if (empty($strictw3c))
{
print "\n".'<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
}
print '<tr class="oddeven">';
// Show constant
print '<td>';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
if (empty($strictw3c)) print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="rowid'.(empty($strictw3c)?'':'[]').'" value="'.$obj->rowid.'">';
print '<input type="hidden" name="constname'.(empty($strictw3c)?'':'[]').'" value="'.$const.'">';
print '<input type="hidden" name="constnote'.(empty($strictw3c)?'':'[]').'" value="'.nl2br(dol_escape_htmltag($obj->note)).'">';
print '<input type="hidden" name="constnote_'.$obj->name.'" value="'.nl2br(dol_escape_htmltag($obj->note)).'">';
print '<input type="hidden" name="consttype_'.$obj->name.'" value="'.($obj->type?$obj->type:'string').'">';
print $langs->trans('Desc'.$const);
@ -1428,34 +1441,57 @@ function form_constantes($tableau, $strictw3c=0, $helptext='')
}
print $form->selectarray('constvalue'.(empty($strictw3c)?'':'[]'),$arrayoflabels,($obj->value?$obj->value:'CARD'),1,0,0);
print '<input type="hidden" name="consttype" value="yesno">';
print '<input type="hidden" name="constnote'.(empty($strictw3c)?'':'[]').'" value="'.nl2br(dol_escape_htmltag($obj->note)).'">';
print '</td>';
}
else
{
print '<td>';
if (in_array($const,array('ADHERENT_CARD_TEXT','ADHERENT_CARD_TEXT_RIGHT','ADHERENT_ETIQUETTE_TEXT')))
print '<input type="hidden" name="consttype'.(empty($strictw3c)?'':'[]').'" value="'.($obj->type?$obj->type:'string').'">';
print '<input type="hidden" name="constnote'.(empty($strictw3c)?'':'[]').'" value="'.nl2br(dol_escape_htmltag($obj->note)).'">';
if ($obj->type == 'textarea' || in_array($const,array('ADHERENT_CARD_TEXT','ADHERENT_CARD_TEXT_RIGHT','ADHERENT_ETIQUETTE_TEXT')))
{
print '<textarea class="flat" name="constvalue'.(empty($strictw3c)?'':'[]').'" cols="50" rows="5" wrap="soft">'."\n";
print $obj->value;
print "</textarea>\n";
print '<input type="hidden" name="consttype" value="texte">';
}
else if (in_array($const,array('ADHERENT_AUTOREGISTER_NOTIF_MAIL','ADHERENT_AUTOREGISTER_MAIL','ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL')))
elseif ($obj->type == 'html')
{
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor('constvalue_'.$const.(empty($strictw3c)?'':'[]'),$obj->value,'',160,'dolibarr_notes','',false,false,$conf->fckeditor->enabled,ROWS_5,'90%');
$doleditor->Create();
print '<input type="hidden" name="consttype'.(empty($strictw3c)?'':'[]').'" value="texte">';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor('constvalue_'.$const.(empty($strictw3c)?'':'[]'),$obj->value,'',160,'dolibarr_notes','',false,false,$conf->fckeditor->enabled,ROWS_5,'90%');
$doleditor->Create();
}
else if ($obj->type == 'yesno')
elseif ($obj->type == 'yesno')
{
print $form->selectyesno('constvalue'.(empty($strictw3c)?'':'[]'),$obj->value,1);
print '<input type="hidden" name="consttype'.(empty($strictw3c)?'':'[]').'" value="yesno">';
print $form->selectyesno('constvalue'.(empty($strictw3c)?'':'[]'),$obj->value,1);
}
else
elseif (preg_match('/emailtemplate/', $obj->type))
{
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$tmp=explode(':', $obj->type);
$nboftemplates = $formmail->fetchAllEMailTemplate($tmp[1], $user, null, -1); // We set lang=null to get in priority record with no lang
//$arraydefaultmessage = $formmail->getEMailTemplate($db, $tmp[1], $user, null, 0, 1, '');
$arrayofmessagename=array();
if (is_array($formmail->lines_model))
{
foreach($formmail->lines_model as $modelmail)
{
//var_dump($modelmail);
$moreonlabel='';
if (! empty($arrayofmessagename[$modelmail->label])) $moreonlabel=' <span class="opacitymedium">('.$langs->trans("SeveralLangugeVariatFound").')</span>';
$arrayofmessagename[$modelmail->label]=$langs->trans(preg_replace('/\(|\)/','',$modelmail->label)).$moreonlabel;
}
}
//var_dump($arraydefaultmessage);
//var_dump($arrayofmessagename);
print $form->selectarray('constvalue_'.$obj->name, $arrayofmessagename, $obj->value, 'None', 1, 0, '', 0, 0, 0, '', '', 1);
}
else // type = 'string' ou 'chaine'
{
print '<input type="text" class="flat" size="48" name="constvalue'.(empty($strictw3c)?'':'[]').'" value="'.dol_escape_htmltag($obj->value).'">';
print '<input type="hidden" name="consttype'.(empty($strictw3c)?'':'[]').'" value="chaine">';
}
print '</td>';
}

View File

@ -168,7 +168,7 @@ function societe_prepare_head(Societe $object)
}
// Related items
if (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->fichinter->enabled) || ! empty($conf->fournisseur->enabled))
if (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->ficheinter->enabled) || ! empty($conf->fournisseur->enabled))
{
$head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Referers");
@ -1530,10 +1530,17 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$out.=getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'maxwidthsearch ');
$out.='</tr>';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
$caction=new CActionComm($db);
$arraylist=$caction->liste_array(1, 'code', '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0), '', 1);
foreach ($histo as $key=>$value)
{
$actionstatic->fetch($histo[$key]['id']); // TODO Do we need this, we already have a lot of data of line into $histo
$actionstatic->type_picto=$histo[$key]['apicto'];
$actionstatic->type_code=$histo[$key]['acode'];
$out.='<tr class="oddeven">';
// Done or todo
@ -1564,26 +1571,26 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$out.='<td>';
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
if ($histo[$key]['apicto']) $out.=img_picto('', $histo[$key]['apicto']);
if ($actionstatic->type_picto) print img_picto('', $actionstatic->type_picto);
else {
if ($histo[$key]['acode'] == 'AC_TEL') $out.=img_picto('', 'object_phoning').' ';
if ($histo[$key]['acode'] == 'AC_FAX') $out.=img_picto('', 'object_phoning_fax').' ';
if ($histo[$key]['acode'] == 'AC_EMAIL') $out.=img_picto('', 'object_email').' ';
if ($actionstatic->type_code == 'AC_RDV') $out.= img_picto('', 'object_group', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actionstatic->type_code == 'AC_TEL') $out.= img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actionstatic->type_code == 'AC_FAX') $out.= img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actionstatic->type_code == 'AC_EMAIL') $out.= img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actionstatic->type_code == 'AC_INT') $out.= img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright').' ';
elseif (! preg_match('/_AUTO/', $actionstatic->type_code)) $out.= img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').' ';
}
$out.=$actionstatic->type;
}
else {
$typelabel = $actionstatic->type;
if ($histo[$key]['acode'] != 'AC_OTH_AUTO') $typelabel = $langs->trans("ActionAC_MANUAL");
$out.=$typelabel;
}
$labeltype=$actionstatic->type_code;
if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($arraylist[$labeltype])) $labeltype='AC_OTH';
if (! empty($arraylist[$labeltype])) $labeltype=$arraylist[$labeltype];
$out.= dol_trunc($labeltype,28);
$out.='</td>';
// Title
$out.='<td>';
if (isset($histo[$key]['type']) && $histo[$key]['type']=='action')
{
$actionstatic->type_code=$histo[$key]['acode'];
$transcode=$langs->trans("Action".$histo[$key]['acode']);
$libelle=($transcode!="Action".$histo[$key]['acode']?$transcode:$histo[$key]['alabel']);
//$actionstatic->libelle=$libelle;
@ -1635,7 +1642,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$propalstatic->type=$histo[$key]['ftype'];
$out.=$propalstatic->getNomUrl(1);
} else {
$out.= $langs->trans("ProposalDeleted");
//$out.= '<span class="opacitymedium">'.$langs->trans("ProposalDeleted").'</span>';
}
}
elseif (($histo[$key]['elementtype'] == 'order' || $histo[$key]['elementtype'] == 'commande') && ! empty($conf->commande->enabled))
@ -1646,7 +1653,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$orderstatic->type=$histo[$key]['ftype'];
$out.=$orderstatic->getNomUrl(1);
} else {
$out.= $langs->trans("OrderDeleted");
//$out.= '<span class="opacitymedium">'.$langs->trans("OrderDeleted").'<span>';
}
}
elseif (($histo[$key]['elementtype'] == 'invoice' || $histo[$key]['elementtype'] == 'facture') && ! empty($conf->facture->enabled))
@ -1657,7 +1664,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$facturestatic->type=$histo[$key]['ftype'];
$out.=$facturestatic->getNomUrl(1,'compta');
} else {
$out.= $langs->trans("InvoiceDeleted");
//$out.= '<span class="opacitymedium">'.$langs->trans("InvoiceDeleted").'</span>';
}
}
else $out.='&nbsp;';

View File

@ -1327,7 +1327,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
$showimage=$object->is_photo_available($conf->product->multidir_output[$object->entity]);
$maxvisiblephotos=(isset($conf->global->PRODUCT_MAX_VISIBLE_PHOTO)?$conf->global->PRODUCT_MAX_VISIBLE_PHOTO:5);
if ($conf->browser->phone) $maxvisiblephotos=1;
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$object->show_photos($conf->product->multidir_output[$object->entity],'small',$maxvisiblephotos,0,0,0,$width,0).'</div>';
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$object->show_photos('product', $conf->product->multidir_output[$object->entity],'small',$maxvisiblephotos,0,0,0,$width,0).'</div>';
else
{
if (!empty($conf->global->PRODUCT_NODISPLAYIFNOPHOTO)) {
@ -1346,7 +1346,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
$showimage=$object->is_photo_available($conf->ticketsup->dir_output.'/'.$object->track_id);
$maxvisiblephotos=(isset($conf->global->TICKETSUP_MAX_VISIBLE_PHOTO)?$conf->global->TICKETSUP_MAX_VISIBLE_PHOTO:2);
if ($conf->browser->phone) $maxvisiblephotos=1;
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$object->show_photos($conf->ticketsup->dir_output,'small',$maxvisiblephotos,0,0,0,$width,0).'</div>';
if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$object->show_photos('ticketsup', $conf->ticketsup->dir_output,'small',$maxvisiblephotos,0,0,0,$width,0).'</div>';
else
{
if (!empty($conf->global->TICKETSUP_NODISPLAYIFNOPHOTO)) {
@ -5686,6 +5686,7 @@ function dol_textishtml($msg,$option=0)
elseif (preg_match('/<h[0-9]>/i',$msg)) return true;
elseif (preg_match('/&[A-Z0-9]{1,6};/i',$msg)) return true; // Html entities names (http://www.w3schools.com/tags/ref_entities.asp)
elseif (preg_match('/&#[0-9]{2,3};/i',$msg)) return true; // Html entities numbers (http://www.w3schools.com/tags/ref_entities.asp)
return false;
}
}
@ -5775,6 +5776,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob
'__MYCOMPANY_COUNTRY_ID__' => $mysoc->country_id
));
}
if (($onlykey || is_object($object)) && (empty($exclude) || ! in_array('object', $exclude)))
{
if ($onlykey)
@ -5789,8 +5791,9 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob
$substitutionarray['__THIRDPARTY_NAME__'] = '__THIRDPARTY_NAME__';
$substitutionarray['__THIRDPARTY_EMAIL__'] = '__THIRDPARTY_EMAIL__';
if (is_object($object) && $object->element == 'shipping')
if (is_object($object) && $object->element == 'member')
{
$substitutionarray['__MEMBER_ID__'] = '__MEMBER_ID__';
$substitutionarray['__MEMBER_CIVILITY__'] = '__MEMBER_CIVILITY__';
$substitutionarray['__MEMBER_FIRSTNAME__'] = '__MEMBER_FIRSTNAME__';
$substitutionarray['__MEMBER_LASTNAME__'] = '__MEMBER_LASTNAME__';
@ -5804,7 +5807,8 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = 'Lowest data for planned expiration of service';
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATETIME__'] = 'Lowest date and hour for planned expiration of service';
$substitutionarray['__ONLINE_PAYMENT_URL__'] = 'LinkToPayOnlineIfApplicable';
$substitutionarray['__ONLINE_PAYMENT_URL__'] = 'UrlToPayOnlineIfApplicable';
$substitutionarray['__ONLINE_PAYMENT_TEXT_AND_URL__'] = 'TextAndUrlToPayOnlineIfApplicable';
$substitutionarray['__SECUREKEYPAYMENT__'] = 'Security key (if key is not unique per record)';
$substitutionarray['__SECUREKEYPAYMENT_MEMBER__'] = 'Security key for payment on a member subscription (one key per member)';
$substitutionarray['__SECUREKEYPAYMENT_ORDER__'] = 'Security key for payment on an order';
@ -5829,6 +5833,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob
$birthday = dol_print_date($object->birth,'day');
$substitutionarray['__MEMBER_ID__']=$object->id;
if (method_exists($object, 'getCivilityLabel')) $substitutionarray['__MEMBER_CIVILITY__'] = $object->getCivilityLabel();
$substitutionarray['__MEMBER_FIRSTNAME__']=$msgishtml?dol_htmlentitiesbr($object->firstname):$object->firstname;
$substitutionarray['__MEMBER_LASTNAME__']=$msgishtml?dol_htmlentitiesbr($object->lastname):$object->lastname;
@ -5920,6 +5925,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob
$paymenturl=$url;
}
$substitutionarray['__ONLINE_PAYMENT_TEXT_AND_URL__']=($paymenturl?$outputlangs->trans("PredefinedMailContentLink", $paymenturl):'');
$substitutionarray['__ONLINE_PAYMENT_URL__']=$paymenturl;
}
}
@ -5985,8 +5991,8 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob
}
/**
* Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newval).
* Texts like __(TranslationKey|langfile)__ and __[ConstantKey]__ are also replaced.
* Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newval),
* and texts like __(TranslationKey|langfile)__ and __[ConstantKey]__ are also replaced.
* Example of usage:
* $substitutionarray = getCommonSubstitutionArray($langs, 0, null, $thirdparty);
* complete_substitutions_array($substitutionarray, $langs, $thirdparty);

View File

@ -55,9 +55,11 @@ function member_prepare_head(Adherent $object)
if (! empty($user->rights->adherent->cotisation->lire))
{
$nbSubscription = is_array($object->subscriptions)?count($object->subscriptions):0;
$head[$h][0] = DOL_URL_ROOT.'/adherents/subscription.php?rowid='.$object->id;
$head[$h][1] = $langs->trans("Subscriptions");
$head[$h][2] = 'subscription';
if ($nbSubscription > 0) $head[$h][1].= ' <span class="badge">'.$nbSubscription.'</span>';
$h++;
}

View File

@ -210,7 +210,7 @@ function getOnlinePaymentUrl($mode, $type, $ref='', $amount='9.99', $freetag='yo
}
// For multicompany
if (! empty($out)) $out.="&entity=".$conf->entity; // Check the entity because He may be the same reference in several entities
if (! empty($out) && ! empty($conf->multicompany->enabled)) $out.="&entity=".$conf->entity; // Check the entity because we may have the same reference in several entities
return $out;
}

View File

@ -104,7 +104,7 @@ function ticketsup_prepare_head($object)
// History
$head[$h][0] = DOL_URL_ROOT.'/ticketsup/history.php?track_id=' . $object->track_id;
$head[$h][1] = $langs->trans('TicketHistory');
$head[$h][1] = $langs->trans('Events');
$head[$h][2] = 'tabTicketLogs';
$h++;

View File

@ -237,9 +237,16 @@ class MenuManager
{
$substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user);
$substitarray['__USERID__'] = $user->id; // For backward compatibility
$val2['url'] = make_substitutions($val2['url'], $substitarray);
$val2['url'] = make_substitutions($val2['url'], $substitarray); // Make also substitution of __(XXX)__ and __[XXX]__
$relurl2=dol_buildpath($val2['url'],1);
if (! preg_match("/^(http:\/\/|https:\/\/)/i", $val2['url']))
{
$relurl2=dol_buildpath($val2['url'],1);
}
else
{
$relurl2=$val2['url'];
}
$canonurl2=preg_replace('/\?.*$/','',$val2['url']);
//var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']);
if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2='';

View File

@ -185,6 +185,7 @@ class MenuManager
$tmpleftmenu='all';
$submenu=new Menu();
print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$submenu,1,$tmpmainmenu,$tmpleftmenu); // Fill $submenu (example with tmpmainmenu='home' tmpleftmenu='all', return left menu tree of Home)
// Note: $submenu contains menu entry with substitution not yet done
//if ($tmpmainmenu.'-'.$tmpleftmenu == 'home-all') { var_dump($submenu); exit; }
//if ($tmpmainmenu=='accountancy') { var_dump($submenu->liste); exit; }
$nexturl=dol_buildpath($submenu->liste[0]['url'],1);
@ -247,9 +248,16 @@ class MenuManager
{
$substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user);
$substitarray['__USERID__'] = $user->id; // For backward compatibility
$val2['url'] = make_substitutions($val2['url'], $substitarray);
$val2['url'] = make_substitutions($val2['url'], $substitarray); // Make also substitution of __(XXX)__ and __[XXX]__
$relurl2=dol_buildpath($val2['url'],1);
if (! preg_match("/^(http:\/\/|https:\/\/)/i", $val2['url']))
{
$relurl2=dol_buildpath($val2['url'],1);
}
else
{
$relurl2=$val2['url'];
}
$canonurl2=preg_replace('/\?.*$/','',$val2['url']);
//var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']);
if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2='';

View File

@ -83,34 +83,7 @@ class modAdherent extends DolibarrModules
$this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "ADHERENT_MAIL_RESIL";
$this->const[$r][1] = "texte";
$this->const[$r][2] = "Votre adhésion vient d'être résiliée.\r\nNous espérons vous revoir très bientôt";
$this->const[$r][3] = "Mail de résiliation";
$this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "ADHERENT_MAIL_VALID";
$this->const[$r][1] = "texte";
$this->const[$r][2] = "Votre adhésion vient d'être validée. \r\nVoici le rappel de vos coordonnées (toute information erronée entrainera la non validation de votre inscription) :\r\n\r\n__INFOS__\r\n\r\n";
$this->const[$r][3] = "Mail de validation";
$this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "ADHERENT_MAIL_VALID_SUBJECT";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "Votre adhésion a été validée";
$this->const[$r][3] = "Sujet du mail de validation";
$this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "ADHERENT_MAIL_RESIL_SUBJECT";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "Résiliation de votre adhésion";
$this->const[$r][3] = "Sujet du mail de résiliation";
$this->const[$r][4] = 0;
$r++;
// For emails
$this->const[$r][0] = "ADHERENT_MAIL_FROM";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "";
@ -118,20 +91,35 @@ class modAdherent extends DolibarrModules
$this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "ADHERENT_MAIL_COTIS";
$this->const[$r][1] = "texte";
$this->const[$r][2] = "Bonjour __FIRSTNAME__,\r\nCet email confirme que votre cotisation a été reçue\r\net enregistrée";
$this->const[$r][3] = "Mail de validation de cotisation";
$this->const[$r][0] = "ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER";
$this->const[$r][1] = "emailtemplate:member";
$this->const[$r][2] = "(SendingEmailOnAutoSubscription)";
$this->const[$r][3] = "";
$this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "ADHERENT_MAIL_COTIS_SUBJECT";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "Reçu de votre cotisation";
$this->const[$r][3] = "Sujet du mail de validation de cotisation";
$this->const[$r][0] = "ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION";
$this->const[$r][1] = "emailtemplate:member";
$this->const[$r][2] = "(SendingEmailOnNewSubscription)";
$this->const[$r][3] = "";
$this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION";
$this->const[$r][1] = "emailtemplate:member";
$this->const[$r][2] = "(SendingReminderForExpiredSubscription)";
$this->const[$r][3] = "";
$this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "ADHERENT_EMAIL_TEMPLATE_CANCELATION";
$this->const[$r][1] = "emailtemplate:member";
$this->const[$r][2] = "(SendingEmailOnCancelation)";
$this->const[$r][3] = "";
$this->const[$r][4] = 0;
$r++;
// For cards
$this->const[$r][0] = "ADHERENT_CARD_HEADER_TEXT";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "__YEAR__";
@ -160,20 +148,6 @@ class modAdherent extends DolibarrModules
$this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "ADHERENT_BANK_ACCOUNT";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "";
$this->const[$r][3] = "ID du Compte banquaire utilise";
$this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "ADHERENT_BANK_CATEGORIE";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "";
$this->const[$r][3] = "ID de la catégorie bancaire des cotisations";
$this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "ADHERENT_ETIQUETTE_TYPE";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "L7163";
@ -188,6 +162,22 @@ class modAdherent extends DolibarrModules
$this->const[$r][4] = 0;
$r++;
// For subscriptions
$this->const[$r][0] = "ADHERENT_BANK_ACCOUNT";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "";
$this->const[$r][3] = "ID of bank account to use";
$this->const[$r][4] = 0;
$r++;
$this->const[$r][0] = "ADHERENT_BANK_CATEGORIE";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "";
$this->const[$r][3] = "ID of bank transaction category to use";
$this->const[$r][4] = 0;
$r++;
// Boxes
//-------
$this->boxes = array(0=>array('file'=>'box_members.php','enabledbydefaulton'=>'Home'));

View File

@ -228,7 +228,7 @@ class modResource extends DolibarrModules
'langs'=> 'resource',
'position'=> 101,
'enabled'=> '1',
'perms'=> '$user->rights->resource->read',
'perms'=> '$user->rights->resource->write',
'target'=> '',
'user'=> 0
);

View File

@ -108,6 +108,7 @@ if ($action == 'presend')
// Create form for email
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang);
$formmail->fromtype = (GETPOST('fromtype')?GETPOST('fromtype'):(!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)?$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE:'user'));
@ -196,13 +197,7 @@ if ($action == 'presend')
$formmail->param['returnurl'] = $_SERVER["PHP_SELF"] . '?id=' . $object->id;
$formmail->param['fileinit'] = array($file);
// Init list of files
/*if (GETPOST('mode','alpha') == 'init')
{
$formmail->clear_attached_files();
$formmail->add_attached_files($file, basename($file), dol_mimetype($file));
}*/
$formmail->withsubstit = 1;
// Show form
print $formmail->get_form();

View File

@ -86,8 +86,10 @@ $formfile->form_attach_new_file(
$savingdocmask
);
// Drag and drop for up and down allowed on product, thirdparty, ...
// The drag and drop call the page core/ajax/row.php
$disablemove=1;
if (in_array($modulepart, array('product', 'produit', 'societe', 'user'))) $disablemove=0; // Drag and drop for up and down allowed on product, thirdparty, ...
if (in_array($modulepart, array('product', 'produit', 'societe', 'user', 'ticketsup'))) $disablemove=0;
// List of document
$formfile->list_of_documents(

View File

@ -79,7 +79,7 @@ print '<div class="tagtable border table-border centpercent">'."\n";
if ($module != 'product') {
// No public note yet on products
print '<div class="tagtr pair table-border-row">'."\n";
print '<div class="tagtd tdtop table-key-border-col'.(empty($cssclass)?'':' '.$cssclass).'"'.($colwidth ? ' style="width: '.$colwidth.'%"' : '').'>'."\n";
print '<div class="tagtd tagtdnote tdtop table-key-border-col'.(empty($cssclass)?'':' '.$cssclass).'"'.($colwidth ? ' style="width: '.$colwidth.'%"' : '').'>'."\n";
print $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam, '', 0);
print '</div>'."\n";
print '<div class="tagtd table-val-border-col">'."\n";
@ -89,7 +89,7 @@ if ($module != 'product') {
}
if (empty($user->societe_id)) {
print '<div class="tagtr '.($module != 'product'?'impair':'pair').' table-border-row">'."\n";
print '<div class="tagtd tdtop table-key-border-col'.(empty($cssclass)?'':' '.$cssclass).'"'.($colwidth ? ' style="width: '.$colwidth.'%"' : '').'>'."\n";
print '<div class="tagtd tagtdnote tdtop table-key-border-col'.(empty($cssclass)?'':' '.$cssclass).'"'.($colwidth ? ' style="width: '.$colwidth.'%"' : '').'>'."\n";
print $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0);
print '</div>'."\n";
print '<div class="tagtd table-val-border-col">'."\n";

View File

@ -760,7 +760,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("projects");
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ProjectModifiedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("ProjectModifieddInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("ProjectModifiedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Task").': '.$object->ref;
$object->sendtoid=0;

View File

@ -93,7 +93,7 @@ class InterfaceTicketEmail extends DolibarrTriggers
/**
* Function called when a Dolibarrr business event is done.
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
* All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers
*
* @param string $action Event action code
* @param Object $object Object

View File

@ -705,7 +705,7 @@ if ($id > 0 || ! empty($ref))
$text=$product_static->getNomUrl(1);
$text.= ' - '.$label;
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($objp->description)).'<br>';
$description.= $product_static->show_photos($conf->product->multidir_output[$product_static->entity],1,1,0,0,0,80);
$description.= $product_static->show_photos('product', $conf->product->multidir_output[$product_static->entity], 1, 1, 0, 0, 0, 80);
print $form->textwithtooltip($text,$description,3,'','',$i);
// Show range

View File

@ -124,7 +124,7 @@ class Interventions extends DolibarrApi
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
$sql.= ' WHERE t.entity IN ('.getEntity('fichinter').')';
$sql.= ' WHERE t.entity IN ('.getEntity('intervention').')';
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= " AND t.fk_soc = sc.fk_soc";
if ($socids) $sql.= " AND t.fk_soc IN (".$socids.")";
if ($search_sale > 0) $sql.= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale

View File

@ -128,7 +128,7 @@ class Fichinter extends CommonObject
$sql.= " WHERE sc.fk_user = " .$user->id;
$clause = "AND";
}
$sql.= " ".$clause." fi.entity IN (".getEntity($this->element).")";
$sql.= " ".$clause." fi.entity IN (".getEntity('intervention').")";
$resql=$this->db->query($sql);
if ($resql)
@ -348,7 +348,10 @@ class Fichinter extends CommonObject
$sql.= " f.tms as datem,";
$sql.= " f.duree, f.fk_projet, f.note_public, f.note_private, f.model_pdf, f.extraparams, fk_contrat";
$sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f";
if ($ref) $sql.= " WHERE f.ref='".$this->db->escape($ref)."'";
if ($ref) {
$sql.= " WHERE f.entity IN (".getEntity('intervention').")";
$sql.= " AND f.ref='".$this->db->escape($ref)."'";
}
else $sql.= " WHERE f.rowid=".$rowid;
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
@ -782,7 +785,6 @@ class Fichinter extends CommonObject
$sql.= " f.fk_user_valid";
$sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f";
$sql.= " WHERE f.rowid = ".$id;
$sql.= " AND f.entity = ".$conf->entity;
$resql = $this->db->query($sql);
if ($resql)
@ -886,7 +888,6 @@ class Fichinter extends CommonObject
// Delete object
$sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinter";
$sql.= " WHERE rowid = ".$this->id;
$sql.= " AND entity = ".$conf->entity;
dol_syslog("Fichinter::delete", LOG_DEBUG);
$resql = $this->db->query($sql);
@ -950,7 +951,6 @@ class Fichinter extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter ";
$sql.= " SET datei = '".$this->db->idate($date_delivery)."'";
$sql.= " WHERE rowid = ".$this->id;
$sql.= " AND entity = ".$conf->entity;
$sql.= " AND fk_statut = 0";
if ($this->db->query($sql))
@ -984,7 +984,6 @@ class Fichinter extends CommonObject
$sql.= " SET description = '".$this->db->escape($description)."',";
$sql.= " fk_user_modif = ".$user->id;
$sql.= " WHERE rowid = ".$this->id;
$sql.= " AND entity = ".$conf->entity;
if ($this->db->query($sql))
{
@ -1017,7 +1016,6 @@ class Fichinter extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter ";
$sql.= " SET fk_contrat = '".$contractid."'";
$sql.= " WHERE rowid = ".$this->id;
$sql.= " AND entity = ".$conf->entity;
if ($this->db->query($sql))
{
@ -1395,7 +1393,7 @@ class FichinterLigne extends CommonObjectLine
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{
$this->id=$this->rowid;
$this->id=$this->id;
$result=$this->insertExtraFields();
if ($result < 0)
{
@ -1457,7 +1455,7 @@ class FichinterLigne extends CommonObjectLine
$sql.= ",date='".$this->db->idate($this->datei)."'";
$sql.= ",duree=".$this->duration;
$sql.= ",rang='".$this->db->escape($this->rang)."'";
$sql.= " WHERE rowid = ".$this->rowid;
$sql.= " WHERE rowid = ".$this->id;
dol_syslog("FichinterLigne::update", LOG_DEBUG);
$resql=$this->db->query($sql);
@ -1466,7 +1464,7 @@ class FichinterLigne extends CommonObjectLine
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{
$this->id=$this->rowid;
$this->id=$this->id;
$result=$this->insertExtraFields();
if ($result < 0)
{
@ -1535,7 +1533,6 @@ class FichinterLigne extends CommonObjectLine
$sql.= " , dateo = ".(! empty($obj->dateo)?"'".$this->db->idate($obj->dateo)."'":"null");
$sql.= " , datee = ".(! empty($obj->datee)?"'".$this->db->idate($obj->datee)."'":"null");
$sql.= " WHERE rowid = ".$this->fk_fichinter;
$sql.= " AND entity = ".$conf->entity;
dol_syslog("FichinterLigne::update_total", LOG_DEBUG);
$resql=$this->db->query($sql);
@ -1574,10 +1571,10 @@ class FichinterLigne extends CommonObjectLine
if ($this->statut == 0)
{
dol_syslog(get_class($this)."::deleteline lineid=".$this->rowid);
dol_syslog(get_class($this)."::deleteline lineid=".$this->id);
$this->db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinterdet WHERE rowid = ".$this->rowid;
$sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinterdet WHERE rowid = ".$this->id;
$resql = $this->db->query($sql);
if ($resql)

View File

@ -81,8 +81,8 @@ $sql = "SELECT count(f.rowid), f.fk_statut";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."fichinter as f";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE f.fk_soc = s.rowid";
$sql.= " AND f.entity IN (".getEntity('societe').")";
$sql.= " WHERE f.entity IN (".getEntity('intervention').")";
$sql.= " AND f.fk_soc = s.rowid";
if ($user->societe_id) $sql.=' AND f.fk_soc = '.$user->societe_id;
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
$sql.= " GROUP BY f.fk_statut";
@ -180,8 +180,8 @@ if (! empty($conf->ficheinter->enabled))
$sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE f.fk_soc = s.rowid";
$sql.= " AND f.entity IN (".getEntity('intervention').")";
$sql.= " WHERE f.entity IN (".getEntity('intervention').")";
$sql.= " AND f.fk_soc = s.rowid";
$sql.= " AND f.fk_statut = 0";
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
@ -228,8 +228,8 @@ $sql.= " s.nom as name, s.rowid as socid";
$sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f,";
$sql.= " ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE f.fk_soc = s.rowid";
$sql.= " AND f.entity IN (".getEntity('commande').")";
$sql.= " WHERE f.entity IN (".getEntity('intervention').")";
$sql.= " AND f.fk_soc = s.rowid";
//$sql.= " AND c.fk_statut > 2";
if ($socid) $sql .= " AND f.fk_soc = ".$socid;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
@ -299,8 +299,8 @@ if (! empty($conf->ficheinter->enabled))
$sql.=" FROM ".MAIN_DB_PREFIX."fichinter as f";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE f.fk_soc = s.rowid";
$sql.= " AND f.entity IN (".getEntity('intervention').")";
$sql.= " WHERE f.entity IN (".getEntity('intervention').")";
$sql.= " AND f.fk_soc = s.rowid";
$sql.= " AND f.fk_statut = 1";
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;

View File

@ -194,8 +194,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid";
if (! $user->rights->societe->client->voir && empty($socid)) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
$sql.= " WHERE f.fk_soc = s.rowid ";
$sql.= " AND f.entity = ".$conf->entity;
$sql.= " WHERE f.entity IN (".getEntity('intervention').")";
$sql.= " AND f.fk_soc = s.rowid";
if ($search_ref) {
$sql .= natural_search('f.ref', $search_ref);
}

View File

@ -50,7 +50,7 @@ $cancelbutton = GETPOST('cancel','alpha');
// Security check
$id = (GETPOST('socid','int') ? GETPOST('socid','int') : GETPOST('id','int'));
if ($user->societe_id) $id=$user->societe_id;
$result = restrictedArea($user, 'societe&fournisseur', $id, '&societe');
$result = restrictedArea($user, 'societe&fournisseur', $id, '&societe', '', 'rowid');
$object = new Fournisseur($db);
$extrafields = new ExtraFields($db);

View File

@ -553,7 +553,7 @@ class Holiday extends CommonObject
} else {
$error++;
}
$sql.= " halfday = ".$this->halfday.",";
$sql.= " halfday = ".$this->halfday.",";
if(!empty($this->statut) && is_numeric($this->statut)) {
$sql.= " statut = ".$this->statut.",";
} else {
@ -714,10 +714,10 @@ class Holiday extends CommonObject
if ($infos_CP['statut'] == 4) continue; // ignore not validated holidays
if ($infos_CP['statut'] == 5) continue; // ignore not validated holidays
/*
var_dump("--");
var_dump("old: ".dol_print_date($infos_CP['date_debut'],'dayhour').' '.dol_print_date($infos_CP['date_fin'],'dayhour').' '.$infos_CP['halfday']);
var_dump("new: ".dol_print_date($dateStart,'dayhour').' '.dol_print_date($dateEnd,'dayhour').' '.$halfday);
*/
var_dump("--");
var_dump("old: ".dol_print_date($infos_CP['date_debut'],'dayhour').' '.dol_print_date($infos_CP['date_fin'],'dayhour').' '.$infos_CP['halfday']);
var_dump("new: ".dol_print_date($dateStart,'dayhour').' '.dol_print_date($dateEnd,'dayhour').' '.$halfday);
*/
if ($halfday == 0)
{
@ -797,7 +797,7 @@ class Holiday extends CommonObject
$sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp";
$sql.= " WHERE cp.entity IN (".getEntity('holiday').")";
$sql.= " AND cp.fk_user = ".(int) $fk_user;
$sql.= " AND date_debut <= '".$this->db->idate($timestamp)."' AND date_fin >= '".$this->db->idate($timestamp)."'";
$sql.= " AND date_debut <= '".$this->db->idate($timestamp)."' AND date_fin >= '".$this->db->idate($timestamp)."'";
$resql = $this->db->query($sql);
if ($resql)
@ -837,7 +837,7 @@ class Holiday extends CommonObject
}
else dol_print_error($this->db);
return array('morning'=>$isavailablemorning, 'afternoon'=>$isavailableafternoon);
return array('morning'=>$isavailablemorning, 'afternoon'=>$isavailableafternoon);
}
@ -860,10 +860,10 @@ class Holiday extends CommonObject
//if ($option != 'nolink')
//{
// Add param to save lastsearch_values or not
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
// Add param to save lastsearch_values or not
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
//}
$linkstart = '<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
@ -1147,15 +1147,15 @@ class Holiday extends CommonObject
}
if ($result)
{
{
$this->db->commit();
return 1;
}
else
{
$this->db->rollback();
}
else
{
$this->db->rollback();
return -1;
}
}
}
return 0;
@ -1210,7 +1210,7 @@ class Holiday extends CommonObject
return 1;
}
else
{
{
return -1;
}
}
@ -1395,7 +1395,7 @@ class Holiday extends CommonObject
}
else
{
// We want only list of vacation balance for user ids
// We want only list of vacation balance for user ids
$sql = "SELECT DISTINCT cpu.fk_user";
$sql.= " FROM ".MAIN_DB_PREFIX."holiday_users as cpu, ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE cpu.fk_user = u.user";
@ -1427,7 +1427,7 @@ class Holiday extends CommonObject
return $stringlist;
}
else
{
{
// Erreur SQL
$this->error="Error ".$this->db->lasterror();
return -1;
@ -1454,46 +1454,46 @@ class Holiday extends CommonObject
else
$sql.= " WHERE u.entity IN (0,".$conf->entity.")";
$sql.= " AND u.statut > 0";
if ($filters) $sql.=$filters;
$sql.= " AND u.statut > 0";
if ($filters) $sql.=$filters;
$resql=$this->db->query($sql);
$resql=$this->db->query($sql);
// Si pas d'erreur SQL
if ($resql)
{
$i = 0;
$tab_result = $this->holiday;
$num = $this->db->num_rows($resql);
// Si pas d'erreur SQL
if ($resql)
{
$i = 0;
$tab_result = $this->holiday;
$num = $this->db->num_rows($resql);
// Boucles du listage des utilisateurs
while($i < $num) {
// Boucles du listage des utilisateurs
while($i < $num) {
$obj = $this->db->fetch_object($resql);
$obj = $this->db->fetch_object($resql);
$tab_result[$i]['rowid'] = $obj->rowid;
$tab_result[$i]['name'] = $obj->lastname; // deprecated
$tab_result[$i]['lastname'] = $obj->lastname;
$tab_result[$i]['firstname'] = $obj->firstname;
$tab_result[$i]['gender'] = $obj->gender;
$tab_result[$i]['status'] = $obj->statut;
$tab_result[$i]['employee'] = $obj->employee;
$tab_result[$i]['photo'] = $obj->photo;
$tab_result[$i]['fk_user'] = $obj->fk_user;
//$tab_result[$i]['type'] = $obj->type;
//$tab_result[$i]['nb_holiday'] = $obj->nb_holiday;
$tab_result[$i]['rowid'] = $obj->rowid;
$tab_result[$i]['name'] = $obj->lastname; // deprecated
$tab_result[$i]['lastname'] = $obj->lastname;
$tab_result[$i]['firstname'] = $obj->firstname;
$tab_result[$i]['gender'] = $obj->gender;
$tab_result[$i]['status'] = $obj->statut;
$tab_result[$i]['employee'] = $obj->employee;
$tab_result[$i]['photo'] = $obj->photo;
$tab_result[$i]['fk_user'] = $obj->fk_user;
//$tab_result[$i]['type'] = $obj->type;
//$tab_result[$i]['nb_holiday'] = $obj->nb_holiday;
$i++;
$i++;
}
// Retoune le tableau des utilisateurs
return $tab_result;
}
else
{
// Erreur SQL
$this->errors[]="Error ".$this->db->lasterror();
return -1;
}
// Retoune le tableau des utilisateurs
return $tab_result;
}
else
{
// Erreur SQL
$this->errors[]="Error ".$this->db->lasterror();
return -1;
}
}
else
{
@ -1637,32 +1637,32 @@ class Holiday extends CommonObject
$sql.= ")";
$resql=$this->db->query($sql);
if (! $resql)
{
$error++; $this->errors[]="Error ".$this->db->lasterror();
}
if (! $resql)
{
$error++; $this->errors[]="Error ".$this->db->lasterror();
}
if (! $error)
{
$this->optRowid = $this->db->last_insert_id(MAIN_DB_PREFIX."holiday_logs");
}
if (! $error)
{
$this->optRowid = $this->db->last_insert_id(MAIN_DB_PREFIX."holiday_logs");
}
// Commit or rollback
if ($error)
{
foreach($this->errors as $errmsg)
{
dol_syslog(get_class($this)."::addLogCP ".$errmsg, LOG_ERR);
$this->error.=($this->error?', '.$errmsg:$errmsg);
}
$this->db->rollback();
return -1*$error;
}
else
{
$this->db->commit();
// Commit or rollback
if ($error)
{
foreach($this->errors as $errmsg)
{
dol_syslog(get_class($this)."::addLogCP ".$errmsg, LOG_ERR);
$this->error.=($this->error?', '.$errmsg:$errmsg);
}
$this->db->rollback();
return -1*$error;
}
else
{
$this->db->commit();
return $this->optRowid;
}
}
}
/**
@ -1702,43 +1702,43 @@ class Holiday extends CommonObject
$resql=$this->db->query($sql);
// Si pas d'erreur SQL
if ($resql) {
if ($resql) {
$i = 0;
$tab_result = $this->logs;
$num = $this->db->num_rows($resql);
$i = 0;
$tab_result = $this->logs;
$num = $this->db->num_rows($resql);
// Si pas d'enregistrement
if(!$num) {
// Si pas d'enregistrement
if(!$num) {
return 2;
}
}
// On liste les résultats et on les ajoutent dans le tableau
while($i < $num) {
// On liste les résultats et on les ajoutent dans le tableau
while($i < $num) {
$obj = $this->db->fetch_object($resql);
$obj = $this->db->fetch_object($resql);
$tab_result[$i]['rowid'] = $obj->rowid;
$tab_result[$i]['date_action'] = $obj->date_action;
$tab_result[$i]['fk_user_action'] = $obj->fk_user_action;
$tab_result[$i]['fk_user_update'] = $obj->fk_user_update;
$tab_result[$i]['type_action'] = $obj->type_action;
$tab_result[$i]['prev_solde'] = $obj->prev_solde;
$tab_result[$i]['new_solde'] = $obj->new_solde;
$tab_result[$i]['fk_type'] = $obj->fk_type;
$tab_result[$i]['rowid'] = $obj->rowid;
$tab_result[$i]['date_action'] = $obj->date_action;
$tab_result[$i]['fk_user_action'] = $obj->fk_user_action;
$tab_result[$i]['fk_user_update'] = $obj->fk_user_update;
$tab_result[$i]['type_action'] = $obj->type_action;
$tab_result[$i]['prev_solde'] = $obj->prev_solde;
$tab_result[$i]['new_solde'] = $obj->new_solde;
$tab_result[$i]['fk_type'] = $obj->fk_type;
$i++;
}
// Retourne 1 et ajoute le tableau à la variable
$this->logs = $tab_result;
return 1;
}
else
{
// Erreur SQL
$this->error="Error ".$this->db->lasterror();
return -1;
}
$i++;
}
// Retourne 1 et ajoute le tableau à la variable
$this->logs = $tab_result;
return 1;
}
else
{
// Erreur SQL
$this->error="Error ".$this->db->lasterror();
return -1;
}
}

View File

@ -220,6 +220,7 @@ if (!empty($search_name)) {
$filters.=natural_search(array('u.firstname','u.lastname'), $search_name);
}
if ($search_supervisor > 0) $filters.=natural_search(array('u.fk_user'), $search_supervisor, 2);
$filters.= ' AND employee = 1'; // Only employee users are visible
$listUsers = $holiday->fetchUsers(false, true, $filters);
if (is_numeric($listUsers) && $listUsers < 0)
@ -356,8 +357,10 @@ else
print '<td>';
if ($canedit) print '<input type="text"'.($canedit?'':' disabled="disabled"').' class="maxwidthonsmartphone" value="" name="note_holiday['.$users['rowid'].']" size="30"/>';
print '</td>';
// Button modify
print '<td>';
if (! empty($user->rights->holiday->define_holiday))
if (! empty($user->rights->holiday->define_holiday)) // Allowed to set the balance of any user
{
print '<input type="submit" name="update_cp['.$users['rowid'].']" value="'.dol_escape_htmltag($langs->trans("Update")).'" class="button"/>';
}

View File

@ -48,7 +48,7 @@ $contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'myobjectl
$backtopage = GETPOST('backtopage','alpha'); // Go back to a dedicated page
$optioncss = GETPOST('optioncss','aZ'); // Option for the css output (always '' except when 'print')
$childis = $user->getAllChildIds(1);
$childids = $user->getAllChildIds(1);
// Security check
$socid=0;
@ -107,7 +107,6 @@ $fieldstosearchall = array(
'uu.firstname'=>'EmployeeFirstname'
);
$childids = $user->getAllChildIds(1);
/*
@ -275,14 +274,16 @@ if ($id > 0)
$search_employee = $user_id;
}
// Récupération des congés payés de l'utilisateur ou de tous les users
// Récupération des congés payés de l'utilisateur ou de tous les users de sa hierarchy
// Load array $holiday->holiday
if (empty($user->rights->holiday->read_all) || $id > 0)
{
$result = $holiday->fetchByUser($user_id,$order,$filter); // Load array $holiday->holiday
if ($id > 0) $result = $holiday->fetchByUser($id, $order, $filter);
else $result = $holiday->fetchByUser(join(',',$childids), $order, $filter);
}
else
{
$result = $holiday->fetchAll($order,$filter); // Load array $holiday->holiday
$result = $holiday->fetchAll($order, $filter);
}
// Si erreur SQL
if ($result == '-1')

View File

@ -20,9 +20,13 @@
-- de l'install et tous les sigles '--' sont supprimés.
--
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'adherent','member','',0,null,null,'(SendAnEMailToMember)',1,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__','__(Hello)__,<br><br>\n\n__(ThisIsContentOfYourCard)__<br>\n__(ID)__ : __ID__<br>\n__(Civiliyty)__ : __MEMBER_CIVILITY__<br>\n__(Firstname)__ : __MEMBER_FIRSTNAME__<br>\n__(Lastname)__ : __MEMBER_LASTNAME__<br>\n__(Fullname)__ : __MEMBER_FULLNAME__<br>\n__(Company)__ : __MEMBER_COMPANY__<br>\n__(Address)__ : __MEMBER_ADDRESS__<br>\n__(Zip)__ : __MEMBER_ZIP__<br>\n__(Town)__ : __MEMBER_TOWN__<br>\n__(Country)__ : __MEMBER_COUNTRY__<br>\n__(Email)__ : __MEMBER_EMAIL__<br>\n__(Birthday)__ : __MEMBER_BIRTH__<br>\n__(Photo)__ : __MEMBER_PHOTO__<br>\n__(Login)__ : __MEMBER_LOGIN__<br>\n__(Password)__ : __MEMBER_PASSWORD__<br>\n__(Phone)__ : __MEMBER_PHONE__<br>\n__(PhonePerso)__ : __MEMBER_PHONEPRO__<br>\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null);
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'adherent','member','',0,null,null,'(SendReminderForExpiredSubscriptionTitle)',1,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionHasExpired)__','__(Hello)__ __MEMBER_FULLNAME__,<br><br>\n\n__(ThisIsContentOfSubscriptionReminderEmail)__<br>\n<br>__ONLINE_PAYMENT_URL__<br>\n<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null);
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'banque','thirdparty','',0,null,null,'(YourSEPAMandate)',1,1,0,'__(YourSEPAMandate)__','__(Hello)__,<br><br>\n\n__(FindYourSEPAMandate)__ :<br>\n__MYCOMPANY_NAME__<br>\n__MYCOMPANY_FULLADDRESS__<br><br>\n__(Sincerely)__<br>\n__USER_SIGNATURE__',null);
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__,<br><br>\n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__<br>\n<br>__ONLINE_PAYMENT_TEXT_AND_URL__<br>\n<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null, 1);
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__,<br><br>\n\n__(ThisIsContentOfYourMembershipWasValidated)__<br>__INFOS__<br>\n<br>__ONLINE_PAYMENT_TEXT_AND_URL__<br>\n<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null, 1);
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__,<br><br>\n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__<br>\n\n<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null, 1);
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__,<br><br>\n\n__(ThisIsContentOfSubscriptionReminderEmail)__<br>\n<br>__ONLINE_PAYMENT_TEXT_AND_URL__<br>\n<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null, 1);
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,<br><br>\n\n__(YourMembershipWasCanceled)__<br>\n<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null, 1);
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,<br><br>\n\n__(ThisIsContentOfYourCard)__<br>\n__(ID)__ : __ID__<br>\n__(Civiliyty)__ : __MEMBER_CIVILITY__<br>\n__(Firstname)__ : __MEMBER_FIRSTNAME__<br>\n__(Lastname)__ : __MEMBER_LASTNAME__<br>\n__(Fullname)__ : __MEMBER_FULLNAME__<br>\n__(Company)__ : __MEMBER_COMPANY__<br>\n__(Address)__ : __MEMBER_ADDRESS__<br>\n__(Zip)__ : __MEMBER_ZIP__<br>\n__(Town)__ : __MEMBER_TOWN__<br>\n__(Country)__ : __MEMBER_COUNTRY__<br>\n__(Email)__ : __MEMBER_EMAIL__<br>\n__(Birthday)__ : __MEMBER_BIRTH__<br>\n__(Photo)__ : __MEMBER_PHOTO__<br>\n__(Login)__ : __MEMBER_LOGIN__<br>\n__(Password)__ : __MEMBER_PASSWORD__<br>\n__(Phone)__ : __MEMBER_PHONE__<br>\n__(PhonePerso)__ : __MEMBER_PHONEPRO__<br>\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null, 1);

View File

@ -197,7 +197,7 @@ ALTER TABLE llx_c_email_templates ADD COLUMN enabled varchar(255) DEFAULT '1';
ALTER TABLE llx_c_email_templates ADD COLUMN joinfiles varchar(255) DEFAULT '1';
ALTER TABLE llx_c_email_templates MODIFY COLUMN content mediumtext;
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'adherent','member','',0,null,null,'(SendAnEMailToMember)',1,1,1,'__(CardContent)__','__(Hello)__,<br><br>\n\n__(ThisIsContentOfYourCard)__<br>\n__(ID)__ : __ID__<br>\n__(Civiliyty)__ : __MEMBER_CIVILITY__<br>\n__(Firstname)__ : __MEMBER_FIRSTNAME__<br>\n__(Lastname)__ : __MEMBER_LASTNAME__<br>\n__(Fullname)__ : __MEMBER_FULLNAME__<br>\n__(Company)__ : __MEMBER_COMPANY__<br>\n__(Address)__ : __MEMBER_ADDRESS__<br>\n__(Zip)__ : __MEMBER_ZIP__<br>\n__(Town)__ : __MEMBER_TOWN__<br>\n__(Country)__ : __MEMBER_COUNTRY__<br>\n__(Email)__ : __MEMBER_EMAIL__<br>\n__(Birthday)__ : __MEMBER_BIRTH__<br>\n__(Photo)__ : __MEMBER_PHOTO__<br>\n__(Login)__ : __MEMBER_LOGIN__<br>\n__(Password)__ : __MEMBER_PASSWORD__<br>\n__(Phone)__ : __MEMBER_PHONE__<br>\n__(PhonePerso)__ : __MEMBER_PHONEPRO__<br>\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null);
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'adherent','member','',0,null,null,'(SendingAnEMailToMember)',1,1,1,'__(CardContent)__','__(Hello)__,<br><br>\n\n__(ThisIsContentOfYourCard)__<br>\n__(ID)__ : __ID__<br>\n__(Civiliyty)__ : __MEMBER_CIVILITY__<br>\n__(Firstname)__ : __MEMBER_FIRSTNAME__<br>\n__(Lastname)__ : __MEMBER_LASTNAME__<br>\n__(Fullname)__ : __MEMBER_FULLNAME__<br>\n__(Company)__ : __MEMBER_COMPANY__<br>\n__(Address)__ : __MEMBER_ADDRESS__<br>\n__(Zip)__ : __MEMBER_ZIP__<br>\n__(Town)__ : __MEMBER_TOWN__<br>\n__(Country)__ : __MEMBER_COUNTRY__<br>\n__(Email)__ : __MEMBER_EMAIL__<br>\n__(Birthday)__ : __MEMBER_BIRTH__<br>\n__(Photo)__ : __MEMBER_PHOTO__<br>\n__(Login)__ : __MEMBER_LOGIN__<br>\n__(Password)__ : __MEMBER_PASSWORD__<br>\n__(Phone)__ : __MEMBER_PHONE__<br>\n__(PhonePerso)__ : __MEMBER_PHONEPRO__<br>\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null);
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'banque','thirdparty','',0,null,null,'(YourSEPAMandate)',1,1,0,'__(YourSEPAMandate)__','__(Hello)__,<br><br>\n\n__(FindYourSEPAMandate)__ :<br>\n__MYCOMPANY_NAME__<br>\n__MYCOMPANY_FULLADDRESS__<br><br>\n__(Sincerely)__<br>\n__USER_SIGNATURE__',null);
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 1, 'VENTES', 'Income of products/services', 'Exemple: 7xxxxx', 0, 0, '', '10', 1, 1);

View File

@ -286,6 +286,16 @@ CREATE TABLE llx_societe_account(
-- VMYSQL4.3 ALTER TABLE llx_societe_account MODIFY COLUMN pass_encoding varchar(24) NULL;
ALTER TABLE llx_const MODIFY type varchar(64) DEFAULT 'string';
UPDATE llx_const set type = 'text' where type = 'texte';
UPDATE llx_const set type = 'html' where name in ('ADHERENT_AUTOREGISTER_NOTIF_MAIL','ADHERENT_AUTOREGISTER_MAIL','ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL');
--UPDATE llx_const SET value = '', type = 'emailtemplate:member' WHERE name = 'ADHERENT_AUTOREGISTER_MAIL' AND type != 'emailtemplate:member';
--UPDATE llx_const SET value = '', type = 'emailtemplate:member' WHERE name = 'ADHERENT_MAIL_VALID' AND type != 'emailtemplate:member';
--UPDATE llx_const SET value = '', type = 'emailtemplate:member' WHERE name = 'ADHERENT_MAIL_COTIS' AND type != 'emailtemplate:member';
--UPDATE llx_const SET value = '', type = 'emailtemplate:member' WHERE name = 'ADHERENT_MAIL_RESIL' AND type != 'emailtemplate:member';
ALTER TABLE llx_societe_account ADD COLUMN key_account varchar(128);
ALTER TABLE llx_societe_account ADD INDEX idx_societe_account_rowid (rowid);
@ -303,10 +313,11 @@ ALTER TABLE llx_societe_account ADD CONSTRAINT llx_societe_account_fk_societe FO
ALTER TABLE llx_societe_rib MODIFY COLUMN max_total_amount_of_all_payments double(24,8);
ALTER TABLE llx_societe_rib MODIFY COLUMN total_amount_of_all_payments double(24,8);
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'adherent','member','',0,null,null,'(SendAnEMailToMember)',1,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__','__(Hello)__,<br><br>\n\n__(ThisIsContentOfYourCard)__<br>\n__(ID)__ : __ID__<br>\n__(Civiliyty)__ : __MEMBER_CIVILITY__<br>\n__(Firstname)__ : __MEMBER_FIRSTNAME__<br>\n__(Lastname)__ : __MEMBER_LASTNAME__<br>\n__(Fullname)__ : __MEMBER_FULLNAME__<br>\n__(Company)__ : __MEMBER_COMPANY__<br>\n__(Address)__ : __MEMBER_ADDRESS__<br>\n__(Zip)__ : __MEMBER_ZIP__<br>\n__(Town)__ : __MEMBER_TOWN__<br>\n__(Country)__ : __MEMBER_COUNTRY__<br>\n__(Email)__ : __MEMBER_EMAIL__<br>\n__(Birthday)__ : __MEMBER_BIRTH__<br>\n__(Photo)__ : __MEMBER_PHOTO__<br>\n__(Login)__ : __MEMBER_LOGIN__<br>\n__(Password)__ : __MEMBER_PASSWORD__<br>\n__(Phone)__ : __MEMBER_PHONE__<br>\n__(PhonePerso)__ : __MEMBER_PHONEPRO__<br>\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null);
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'adherent','member','',0,null,null,'(SendReminderForExpiredSubscriptionTitle)',1,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionHasExpired)__','__(Hello)__ __MEMBER_FULLNAME__,<br><br>\n\n__(ThisIsContentOfSubscriptionReminderEmail)__<br>\n<br>__ONLINE_PAYMENT_URL__<br>\n<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null);
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__,<br><br>\n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__<br>\n<br>__ONLINE_PAYMENT_TEXT_AND_URL__<br>\n<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null, 1);
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__,<br><br>\n\n__(ThisIsContentOfYourMembershipWasValidated)__<br>\n<br>__ONLINE_PAYMENT_TEXT_AND_URL__<br>\n<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null, 1);
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__,<br><br>\n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__<br>\n\n<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null, 1);
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__,<br><br>\n\n__(ThisIsContentOfSubscriptionReminderEmail)__<br>\n<br>__ONLINE_PAYMENT_TEXT_AND_URL__<br>\n<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null, 1);
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,<br><br>\n\n__(YourMembershipWasCanceled)__<br>\n<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null, 1);
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,<br><br>\n\n__(ThisIsContentOfYourCard)__<br>\n__(ID)__ : __ID__<br>\n__(Civiliyty)__ : __MEMBER_CIVILITY__<br>\n__(Firstname)__ : __MEMBER_FIRSTNAME__<br>\n__(Lastname)__ : __MEMBER_LASTNAME__<br>\n__(Fullname)__ : __MEMBER_FULLNAME__<br>\n__(Company)__ : __MEMBER_COMPANY__<br>\n__(Address)__ : __MEMBER_ADDRESS__<br>\n__(Zip)__ : __MEMBER_ZIP__<br>\n__(Town)__ : __MEMBER_TOWN__<br>\n__(Country)__ : __MEMBER_COUNTRY__<br>\n__(Email)__ : __MEMBER_EMAIL__<br>\n__(Birthday)__ : __MEMBER_BIRTH__<br>\n__(Photo)__ : __MEMBER_PHOTO__<br>\n__(Login)__ : __MEMBER_LOGIN__<br>\n__(Password)__ : __MEMBER_PASSWORD__<br>\n__(Phone)__ : __MEMBER_PHONE__<br>\n__(PhonePerso)__ : __MEMBER_PHONEPRO__<br>\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null, 1);

View File

@ -28,8 +28,8 @@ create table llx_const
rowid integer AUTO_INCREMENT PRIMARY KEY,
name varchar(180) NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id
value text NOT NULL, -- max 65535 caracteres
type varchar(6),
value text NOT NULL, -- max 65535 caracteres
type varchar(64) DEFAULT 'string',
visible tinyint DEFAULT 1 NOT NULL,
note text,
tms timestamp

View File

@ -19,6 +19,4 @@ Physical=Physisch
Moral=Rechtlich
MorPhy=Physisch/Rechtlich
Filehtpasswd=htpasswd-Datei
DescADHERENT_MAIL_RESIL_SUBJECT=E-Mail-Betreff für Zurückstellen eines Mitglieds
DescADHERENT_MAIL_RESIL=E-Mail-Text für Zurückstellen eines Mitglieds
HTPasswordExport=htpassword-Dateierstellung

View File

@ -30,7 +30,6 @@ WelcomeEMail=Begrüssungsemail
SubscriptionRequired=Abonnement notwendig
VoteAllowed=Abstimmen erlaubt
ShowSubscription=Abonnement anzeigen
SendAnEMailToMember=Informationsemail dem Mitglied senden
HTPasswordExport=htpassword Datei generieren
MembersAndSubscriptions=Mitglieder und Abonnemente
SubscriptionPayment=Zahlung des Mitgliedsbeitrags

View File

@ -61,14 +61,12 @@ ACCOUNTING_PRODUCT_BUY_ACCOUNT=Default purchases account (used if not defined in
ACCOUNTING_PRODUCT_SOLD_ACCOUNT=Default sales account (used if not defined in the product sheet)
ACCOUNTING_SERVICE_BUY_ACCOUNT=Default services purchase account (used if not defined in the service sheet)
ACCOUNTING_SERVICE_SOLD_ACCOUNT=Default services sales account (used if not defined in the service sheet)
Code_tiers=Third party
LabelAccount=Account name
Sens=Meaning
NumPiece=Item number
GroupByAccountAccounting=Group by finance account
DelBookKeeping=Delete record in the Ledger
FeeAccountNotDefined=Account for fees not defined
ThirdPartyAccount=Third party account
NumMvts=Transaction Number
ErrorDebitCredit=Debit and Credit fields cannot have values at the same time
AddCompteFromBK=Add finance accounts to the group

View File

@ -3,3 +3,6 @@ VATIsUsed=GST is used
VATIsNotUsed=GST is not used
VATIntra=GST number
VATIntraShort=GST number
VATIntraVeryShort=GST
VATIntraSyntaxIsValid=Syntax is valid
VATIntraValueIsValid=Value is valid

View File

@ -9,3 +9,6 @@ VATPaid=GST paid
VATCollected=GST collected
VATPayment=GST Payment
VATPayments=GST Payments
NewVATPayment=New GST payment
TotalToPay=Total to pay
TotalVATReceived=Total GST received

View File

@ -19,11 +19,16 @@ FormatDateHourShort=%d/%m/%Y %H:%M
FormatDateHourSecShort=%m/%d/%Y %I:%M:%S %p
FormatDateHourTextShort=%d %b %Y %H:%M
FormatDateHourText=%d %B %Y %H:%M
UnitPrice=Unit price
UnitPriceHT=Unit price (excl GST)
UnitPriceTTC=Unit price
AmountHT=Amount (excl GST)
AmountTTC=Amount (incl GST)
AmountVAT=Amount GST
PriceQtyHT=Price for this quantity excl GST
PriceQtyMinHT=Price quantity min. excl GST
PriceQtyTTC=Price for this quantity incl GST
PriceQtyMinTTC=Price quantity min. incl GST
TotalHT=Total (excl GST)
TotalTTC=Total (incl GST)
TotalTTCToYourCredit=Total (incl GST) to your credit

View File

@ -0,0 +1,3 @@
# Dolibarr language file - en_NZ - main
# This file contains only line that must differs from en_US file
SendingSheet=Packing Slip

View File

@ -1776,6 +1776,7 @@ MAIN_PDF_MARGIN_TOP=Top margin on PDF
MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF
SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups
EnterCalculationRuleIfPreviousFieldIsYes=Enter calculcation rule if previous field was set to Yes (For example 'CODEGRP1+CODEGRP2')
SeveralLangugeVariatFound=Several language variants found
##### Resource ####
ResourceSetup=Configuration du module Resource
UseSearchToSelectResource=Use a search form to choose a resource (rather than a drop-down list).

View File

@ -938,4 +938,5 @@ Annual=Annual
Local=Local
Remote=Remote
LocalAndRemote=Local and Remote
KeyboardShortcut=Keyboard shortcut
KeyboardShortcut=Keyboard shortcut
AssignedTo=Assigned to

View File

@ -13,8 +13,6 @@ ListOfValidatedPublicMembers=List of validated public members
ErrorThisMemberIsNotPublic=This member is not public
ErrorMemberIsAlreadyLinkedToThisThirdParty=Another member (name: <b>%s</b>, login: <b>%s</b>) is already linked to a third party <b>%s</b>. Remove this link first because a third party can't be linked to only a member (and vice versa).
ErrorUserPermissionAllowsToLinksToItselfOnly=For security reasons, you must be granted permissions to edit all users to be able to link a member to a user that is not yours.
ThisIsContentOfYourCard=Hi.<br><br>This is a remind of the information we get about you. Feel free to contact us if something looks wrong.<br><br>
CardContent=Content of your member card
SetLinkToUser=Link to a Dolibarr user
SetLinkToThirdParty=Link to a Dolibarr third party
MembersCards=Members business cards
@ -108,17 +106,33 @@ PublicMemberCard=Member public card
SubscriptionNotRecorded=Subscription not recorded
AddSubscription=Create subscription
ShowSubscription=Show subscription
SendAnEMailToMember=Send information email to member
# Label of email templates
SendingAnEMailToMember=Sending information email to member
SendingEmailOnAutoSubscription=Sending email on auto registration
SendingEmailOnMemberValidation=Sending email on new member validation
SendingEmailOnNewSubscription=Sending email on new subscription
SendingReminderForExpiredSubscription=Sending reminder for expired subscription
SendingEmailOnCancelation=Sending email on cancelation
# Topic of email templates
YourMembershipRequestWasReceived=Your membership was received.
YourMembershipWasValidated=Your membership was validated
YourSubscriptionWasRecorded=Your new subscription was recorded
SubscriptionReminderEmail=Subscription reminder
YourMembershipWasCanceled=You membership was canceled
CardContent=Content of your member card
# Text of email templates
ThisIsContentOfYourMembershipRequestWasReceived=We want to let you know that your membership request was received.<br><br>
ThisIsContentOfYourMembershipWasValidated=We want to let you know that your membership was validated with the following information:<br><br>
ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded.<br><br>
ThisIsContentOfSubscriptionReminderEmail=We want to let you know thet your subscription is about to expire. We hope you can make a renewal of it.<br><br>
ThisIsContentOfYourCard=This is a remind of the information we get about you. Feel free to contact us if something looks wrong.<br><br>
DescADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT=Subject of the e-mail received in case of auto-inscription of a guest
DescADHERENT_AUTOREGISTER_NOTIF_MAIL=E-mail received in case of auto-inscription of a guest
DescADHERENT_AUTOREGISTER_MAIL_SUBJECT=EMail subject for member autosubscription
DescADHERENT_AUTOREGISTER_MAIL=EMail for member autosubscription
DescADHERENT_MAIL_VALID_SUBJECT=EMail subject for member validation
DescADHERENT_MAIL_VALID=EMail for member validation
DescADHERENT_MAIL_COTIS_SUBJECT=EMail subject for subscription
DescADHERENT_MAIL_COTIS=EMail for subscription
DescADHERENT_MAIL_RESIL_SUBJECT=EMail subject for member resiliation
DescADHERENT_MAIL_RESIL=EMail for member resiliation
DescADHERENT_EMAIL_TEMPLATE_AUTOREGISTER=Template Email to use to send email to a member on member autosubscription
DescADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION=Template EMail to use to send email to a member on member validation
DescADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION=Template Email to use to send email to a member on new subscription recording
DescADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION=Template Email to use to send email remind when subscription is about to expire
DescADHERENT_EMAIL_TEMPLATE_CANCELATION=Template Email to use to send email to a member on member cancelation
DescADHERENT_MAIL_FROM=Sender EMail for automatic emails
DescADHERENT_ETIQUETTE_TYPE=Format of labels page
DescADHERENT_ETIQUETTE_TEXT=Text printed on member address sheets
@ -182,5 +196,3 @@ NoEmailSentToMember=No email sent to member
EmailSentToMember=Email sent to member at %s
SendReminderForExpiredSubscriptionTitle=Send reminder by email for expired subscription
SendReminderForExpiredSubscription=Send reminder by email to members when subscription is about to expire (parameter is number of days before end of subscription to send the remind)
YourSubscriptionHasExpired=Your subscription has expired
ThisIsContentOfSubscriptionReminderEmail=This is an email to remind you that your subscription is about to expire.

View File

@ -14,7 +14,7 @@ PaypalModeOnlyPaypal=PayPal only
ONLINE_PAYMENT_CSS_URL=Optionnal URL of CSS style sheet on online payment page
ThisIsTransactionId=This is id of transaction: <b>%s</b>
PAYPAL_ADD_PAYMENT_URL=Add the url of Paypal payment when you send a document by mail
PredefinedMailContentLink=You can click on the secure link below to make your payment (PayPal) if it is not already done.\n\n%s\n\n
PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.<br><br>%s<br><br>
YouAreCurrentlyInSandboxMode=You are currently in the %s "sandbox" mode
NewOnlinePaymentReceived=New online payment received
NewOnlinePaymentFailed=New online payment tried but failed

View File

@ -140,6 +140,7 @@ ProjectReportDate=Change task dates according to new project start date
ErrorShiftTaskDate=Impossible to shift task date according to new project start date
ProjectsAndTasksLines=Projects and tasks
ProjectCreatedInDolibarr=Project %s created
ProjectValidatedInDolibarr=Project %s validated
ProjectModifiedInDolibarr=Project %s modified
TaskCreatedInDolibarr=Task %s created
TaskModifiedInDolibarr=Task %s modified

View File

@ -33,6 +33,7 @@ PropalStatusSigned=Signed (needs billing)
PropalStatusNotSigned=Not signed (closed)
PropalStatusBilled=Billed
PropalStatusDraftShort=Draft
PropalStatusValidatedShort=Validated
PropalStatusClosedShort=Closed
PropalStatusSignedShort=Signed
PropalStatusNotSignedShort=Not signed

View File

@ -163,7 +163,6 @@ SeeTicket=See ticket
TicketMarkedAsRead=Ticket has been marked as read
TicketReadOn=Read on
TicketCloseOn=Clotured on
UserAssignedTo=User assigned
MarkAsRead=Mark ticket as read
TicketMarkedAsReadButLogActionNotSaved=Ticket marked as closed but no action saved
TicketHistory=Ticket history

View File

@ -110,7 +110,6 @@ ACCOUNTING_PRODUCT_BUY_ACCOUNT=Cuenta de contabilidad por defecto para productos
ACCOUNTING_PRODUCT_SOLD_ACCOUNT=Cuenta de contabilidad por defecto para los productos vendidos (utilizada si no está definida en la hoja del producto)
ACCOUNTING_SERVICE_BUY_ACCOUNT=Cuenta de contabilidad por defecto para los servicios comprados (se usa si no se define en la hoja de servicio)
ACCOUNTING_SERVICE_SOLD_ACCOUNT=Cuenta de contabilidad por defecto para los servicios vendidos (utilizada si no está definida en la hoja de servicio)
Code_tiers=Socio de Negocio
LabelAccount=Cuenta
LabelOperation=Operación de etiqueta
Sens=Significado

View File

@ -318,7 +318,6 @@ ExtrafieldParamHelpsellist=Lista de valores proviene de una tabla <br>Sintaxis:
ExtrafieldParamHelpchkbxlst=La lista de valores proviene de una tabla <br> Sintaxis: table_name: label_field: id_field :: filter <br> Ejemplo: c_typent: libelle: id :: filter <br> <br> el filtro puede ser una prueba simple (por ejemplo, active = 1 ) para mostrar solo el valor activo <br> También puede usar $ ID $ en el filtro bruja es la identificación actual del objeto actual <br> Para hacer un SELECCIONAR en filtro use $ SEL $<br> si desea filtrar el uso de campos extraños sintaxis extra.fieldcode = ... (donde el código de campo es el código de extrafield)<br> <br>Para que la lista dependa de otra lista de atributos complementarios:<br>c_typent: libelle: id: options_ <i>parent_list_code</i>|parent_column: filter <br><br>Para que la lista dependa de otra lista:<br>c_typent: libelle: id:<i> parent_list_code</i>lparent_column: filter
ExtrafieldParamHelplink=Los parámetros deben ser ObjectName: Classpath <br> Sintaxis: ObjectName: Classpath <br> Ejemplo: Societe: societe / class / societe.class.php
LibraryToBuildPDF=Biblioteca utilizada para la generación de PDF
WarningUsingFPDF=Advertencia: su <b>conf.php</b> contiene la directiva <b> dolibarr_pdf_force_fpdf = 1</b>. Esto significa que usa la biblioteca FPDF para generar archivos PDF. Esta biblioteca es antigua y no admite muchas características (Unicode, transparencia de imagen, cirílico, árabe y asiático, ...), por lo que puede experimentar errores durante la generación de PDF. <br> Para solucionar esto y tener un soporte completo de la generación de PDF, descargue la <a href="http://www.tcpdf.org/" target="_blank">librería TCPDF</a>, luego comente o elimine la línea <b>$dolibarr_pdf_force_fpdf = 1</b>, y en su lugar, agregue <b>$dolibarr_lib_TCPDF_PATH = 'path_to_TCPDF_dir'</b>
LocalTaxDesc=Algunos países aplican 2 o 3 impuestos en cada línea de factura. Si este es el caso, elija tipo para el segundo y tercer impuesto y su tasa. El tipo posible es: <br> 1: impuesto local se aplica a productos y servicios sin IVA (el impuesto local se calcula sobre el monto sin impuestos) <br> 2: se aplica el impuesto local sobre productos y servicios, incluido el IVA (el impuesto local se calcula sobre el monto + impuesto principal ) <br> 3: el impuesto local se aplica a los productos sin IVA (el impuesto local se calcula sobre el monto sin impuestos) <br> 4: se aplica el impuesto local sobre los productos, incluido IVA (el impuesto local se calcula sobre el monto + el IVA principal) <br> 5: local se aplica impuesto sobre los servicios sin IVA (el impuesto local se calcula sobre el monto sin impuestos) <br> 6: el impuesto local se aplica a los servicios, incluido el IVA (el impuesto local se calcula sobre el monto + impuestos)
LinkToTestClickToDial=Ingrese un número de teléfono para llamar y mostrar un enlace para probar la URL de ClickToDial para el usuario <strong>%s</strong>
RefreshPhoneLink=Actualizar enlace

View File

@ -79,17 +79,8 @@ PublicMemberCard=Tarjeta pública de miembro
SubscriptionNotRecorded=Suscripción no grabada
AddSubscription=Crear suscripción
ShowSubscription=Mostrar suscripción
SendAnEMailToMember=Enviar información por correo electrónico al miembro
DescADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT=Asunto del correo electrónico recibido en caso de inscripción automática de un invitado
DescADHERENT_AUTOREGISTER_NOTIF_MAIL=E-mail recibido en caso de auto inscripción de un invitado
DescADHERENT_AUTOREGISTER_MAIL_SUBJECT=Asunto de correo electrónico para la suscripción automática de miembros
DescADHERENT_AUTOREGISTER_MAIL=Correo electrónico para la suscripción automática de miembros
DescADHERENT_MAIL_VALID_SUBJECT=Asunto de correo electrónico para la validación de miembros
DescADHERENT_MAIL_VALID=Correo electrónico para la validación de miembro
DescADHERENT_MAIL_COTIS_SUBJECT=Correo electrónico sujeto a suscripción
DescADHERENT_MAIL_COTIS=Correo electrónico para suscripción
DescADHERENT_MAIL_RESIL_SUBJECT=Asunto de correo para la resiliencia de miembros
DescADHERENT_MAIL_RESIL=Correo electrónico para la resiliencia de miembros
DescADHERENT_MAIL_FROM=Remitente Correo electrónico para correos electrónicos automáticos
DescADHERENT_ETIQUETTE_TYPE=Formato de la página de etiquetas
DescADHERENT_ETIQUETTE_TEXT=Texto impreso en las hojas de direcciones de los miembros

View File

@ -325,7 +325,6 @@ ExtrafieldParamHelpsellist=La lista de valores viene de una tabla<br>Sintaxis :
ExtrafieldParamHelpchkbxlst=La lista de valores proviene de un tabla<br>Syntax: nombre_tabla:label_field:id_field::filter<br>Example : c_typent:libelle:id::filter<br><br>filter puede ser una prueba simple (por ejemplo, activa=1) para mostrar sólo el valor activo<br>También puede usar $ID$ en filtro con el id actual del objeto actual<br>Para hacer un SELECT en el filtro use $SEL$<br>si quiere filtrar en extrafields use sintaxis extra.fieldcode=...(donde código de campo es el código de extrafield)<br><br>Para tener la lista dependiendo de otra lista de atributos complementarios: <br>c_typent:libelle:id:options_<i>parent_list_code</i>|parent_column:filter <br><br>Para que la lista dependa de otra lista:<br>c_typent:libelle:id:<i>parent_list_code</i>|parent_column:filter
ExtrafieldParamHelplink=Los parámetros deben ser ObjectName: Classpath<br>Syntax: ObjectName: Classpath<br>Examples: <br> Societe: societe/class/societe.class.php<br>Contacto: contact/class/contact.class.php
LibraryToBuildPDF=Biblioteca utilizado para la generación de PDF
WarningUsingFPDF=Advertencia: Su <b>conf.php</b> contiene una directiva <b>dolibarr_pdf_force_fpdf=1</b>. Esto significa que utiliza la biblioteca FPDF para generar archivos PDF. Esta biblioteca es antigua y no soporta muchas características (Unicode, transparencia de imagen, cyrillic, árabe y idiomas asiáticos, ...), por lo que puede experimentar errores durante la generación de PDF.<br> Para resolver esto y tener un soporte completo de generación de PDF, por favor descargue <a href="http://www.tcpdf.org/" target="_blank">TCPDF library</a>, luego comenta o elimina la línea <b>$dolibarr_pdf_force_fpdf=1</b>, and Agregar en su lugar <b>$dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir'</b>
LocalTaxDesc=Algunos países aplican 2 o 3 impuestos en cada línea de factura. Si este es el caso, elija el tipo de segundo y tercer impuesto y su tasa. El tipo posible es:<br>1 : el impuesto local se aplica sobre los productos y servicios sin IVA (impuesto local se calcula sobre la cantidad sin impuestos)<br>2 : El impuesto local se aplica en los productos y los servicios incluyendo el IVA (el impuesto local se calcula sobre la cantidad + impuesto principal)<br>3 : El impuesto local se aplica en los productos sin IVA (el impuesto local se calcula sobre la cantidad sin impuestos)<br>4 : El impuesto local se aplica a los productos, incluido el IVA (el impuesto local se calcula sobre la cantidad + impuesto principal)<br>5 : Se aplica el impuesto local sobre los servicios sin IVA (el impuesto local se calcula sobre la cantidad sin impuestos)<br>6 : Se aplican impuestos locales sobre los servicios, incluido el IVA (el impuesto local se calcula sobre el importe + impuestos)
LinkToTestClickToDial=Introduzca un número de teléfono para llamar, para mostrar un enlace y probar la URL de ClickToDial para el usuario <strong>%s</strong>
RefreshPhoneLink=Actualizar enlace

View File

@ -89,17 +89,8 @@ PublicMemberCard=Carte publique membre
SubscriptionNotRecorded=L'abonnement n'est pas enregistré
AddSubscription=Créer un abonnement
ShowSubscription=Afficher l'abonnement
SendAnEMailToMember=Envoyer un email d'information au membre
DescADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT=Objet de l'e-mail reçu en cas d'auto-inscription d'un invité
DescADHERENT_AUTOREGISTER_NOTIF_MAIL=E-mail reçu en cas d'auto-inscription d'un invité
DescADHERENT_AUTOREGISTER_MAIL_SUBJECT=Émetteur pour les abonnements aux membres
DescADHERENT_AUTOREGISTER_MAIL=EMail pour les abonnements aux membres
DescADHERENT_MAIL_VALID_SUBJECT=Sujet d'envoi pour la validation des membres
DescADHERENT_MAIL_VALID=EMail pour la validation des membres
DescADHERENT_MAIL_COTIS_SUBJECT=Sujet d'envoi pour souscription
DescADHERENT_MAIL_COTIS=EMail pour souscription
DescADHERENT_MAIL_RESIL_SUBJECT=Sujet d'envoi pour la résiliation des membres
DescADHERENT_MAIL_RESIL=EMail pour la résiliation des membres
DescADHERENT_MAIL_FROM=Expéditeur EMail pour les courriels automatiques
DescADHERENT_ETIQUETTE_TYPE=Format de la page des étiquettes
DescADHERENT_ETIQUETTE_TEXT=Texte imprimé sur les feuilles d'adresses des membres

View File

@ -68,8 +68,8 @@ ErrorCodeCantContainZero=Erreur, le code ne peut contenir la valeur 0
DisableJavascript=Désactive les fonctions Javascript et Ajax (Recommandé pour les personnes aveugles ou navigateurs text).
UseSearchToSelectCompanyTooltip=Si vous avez un nombre important de tiers (>100 000), vous pourrez améliorer les performances en positionnant la constante COMPANY_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limité au début des chaines.
UseSearchToSelectContactTooltip=Si vous avez un nombre important de contacts (>100 000), vous pourrez améliorer les performances en positionnant la constante CONTACT_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limité au début des chaines.
DelaiedFullListToSelectCompany=Attendre que vous ayez appuyé sur une touche avant de charger le contenu de la liste déroulante des tiers (Cela peut augmenter les performances si vous avez un grand nombre de contacts)
DelaiedFullListToSelectContact=Attendre que vous ayez appuyé sur une touche avant de charger le contenu de la liste déroulante des contacts/adresses (Cela peut augmenter les performances si vous avez un grand nombre de contacts)
DelaiedFullListToSelectCompany=Attendre que vous ayez appuyé sur une touche avant de charger le contenu de la liste déroulante des tiers (Cela peut augmenter les performances si vous avez un grand nombre de tiers, mais cela est moins convivial)
DelaiedFullListToSelectContact=Attendre que vous ayez appuyé sur une touche avant de charger le contenu de la liste déroulante des contacts/adresses (Cela peut augmenter les performances si vous avez un grand nombre de contacts, mais cela est moins convivial)
NumberOfKeyToSearch=Nb carac. déclenchant recherche : %s
NotAvailableWhenAjaxDisabled=Non disponible quand Ajax est désactivé
AllowToSelectProjectFromOtherCompany=Sur les éléments d'un tiers, autorise la sélection d'un projet lié à un autre tiers
@ -151,7 +151,7 @@ PurgeDeleteAllFilesInDocumentsDir=Effacer tous les fichiers du répertoire <b>%s
PurgeRunNow=Lancer la purge maintenant
PurgeNothingToDelete=Aucun dossier ou fichier à supprimer.
PurgeNDirectoriesDeleted=<b>%s</b> fichiers ou répertoires supprimés.
PurgeNDirectoriesFailed=Echec de la suppression des fichiers ou du répertoire '<b>%s</b>'.
PurgeNDirectoriesFailed=Echec de la suppression de <b>%s</b> fichier(s) ou du répertoire(s).
PurgeAuditEvents=Purger les événements d'audit de sécurité
ConfirmPurgeAuditEvents=Êtes vous sûr de vouloir purger la liste des événements d'audit de sécurité. Toute la liste sera effacée, mais ceci est sans conséquence sur vos autres données.
GenerateBackup=Générer sauvegarde
@ -278,10 +278,6 @@ MAIN_MAIL_SMTPS_ID=Identifiant d'authentification SMTP si authentification SMTP
MAIN_MAIL_SMTPS_PW=Mot de passe d'authentification SMTP si authentification SMTP requise
MAIN_MAIL_EMAIL_TLS= Utilisation du chiffrement TLS (SSL)
MAIN_MAIL_EMAIL_STARTTLS= Utiliser le cryptage TTS (STARTTLS)
MAIN_MAIL_EMAIL_DKIM_ENABLED= Utiliser la signature DKIM
MAIN_MAIL_EMAIL_DKIM_DOMAIN=Domaine DKIM
MAIN_MAIL_EMAIL_DKIM_SELECTOR=Sélecteur de clé DKIM
MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY=Clé privée RSA DKIM
MAIN_DISABLE_ALL_SMS=Désactiver globalement tout envoi de SMS (pour mode test ou démos)
MAIN_SMS_SENDMODE=Méthode d'envoi des SMS
MAIN_MAIL_SMS_FROM=Numéro de téléphone par défaut pour l'envoi des SMS
@ -346,7 +342,7 @@ ErrorCantUseRazIfNoYearInMask=Erreur, ne peut utiliser l'option @ pour remettre
ErrorCantUseRazInStartedYearIfNoYearMonthInMask=Erreur, ne peut utiliser l'option @ si la séquence {yy}{mm} ou {yyyy}{mm} n'est pas dans le masque.
UMask=Masque des nouveaux fichiers sous Unix/Linux/BSD/Mac.
UMaskExplanation=Ce paramètre permet de définir les droits des fichiers créés sur le serveur par Dolibarr (lors d'envois par exemple).<br>Ce doit être la valeur octale (par exemple 0666 signifie lecture/écriture pour tous).<br>Ce paramètre n'a aucun effet sur un serveur Windows.
SeeWikiForAllTeam=Voir le wiki pour le détail de tous les acteurs et leur organisation
SeeWikiForAllTeam=Take a look at the wiki page for full list of all actors and their organization
UseACacheDelay= Délai de mise en cache de l'export en secondes (0 ou vide pour aucun cache)
DisableLinkToHelpCenter=Cacher le lien «<b>Besoin d'aide ou d'assistance</b>» sur la page de connexion
DisableLinkToHelp=Cacher le lien vers l'aide en ligne <b>%s</b>
@ -396,6 +392,7 @@ PriceBaseTypeToChange=Modifier sur les prix dont la référence de base est le
MassConvert=Convertir en masse
String=Chaîne
TextLong=Texte long
HtmlText=Html text
Int=Numérique entier
Float=Décimal
DateAndTime=Date et heure
@ -415,6 +412,7 @@ ExtrafieldCheckBoxFromList=Cases à cocher issues d'une table
ExtrafieldLink=Lien vers un objet
ComputedFormula=Champ calculé
ComputedFormulaDesc=Vous pouvez entrer ici une formule utilisant les propriétés objet ou tout code PHP pour obtenir des valeurs dynamiques. Vous pouvez utiliser toute formule compatible PHP, incluant l'opérateur conditionnel "?", et les objets globaux : <strong>$db, $conf, $langs, $mysoc, $user, $object</strong>.<br><strong>ATTENTION</strong> : Seulement quelques propriétés de l'objet $object pourraient être disponibles. Si vous avez besoin de propriétés non chargées, créez vous même une instance de l'objet dans votre formule, comme dans le deuxième exemple.<br>Utiliser un champs calculé signifie que vous ne pouvez pas entrer vous même toute valeur à partir de l'interface. Aussi, s'il y a une erreur de syntaxe, la formule pourrait ne rien retourner.<br><br>Exemple de formule:<br> $object->id < 10 ? round($object->id / 2, 2) : ($object->id + 2 * $user->id) * (int) substr($mysoc->zip, 1, 2)<br><br>Exemple pour recharger l'objet: <br>(($reloadedobj = new Societe($db)) && ($reloadedobj->fetch($obj->id ? $obj->id : ($obj->rowid ? $obj->rowid : $object->id)) > 0)) ? $reloadedobj->array_options['options_extrafieldkey'] * $reloadedobj->capital / 5 : '-1'<br><br>Un autre exemple de formule pour forcer le rechargement d'un objet et de son objet parent:<br>(($reloadedobj = new Task($db)) && ($reloadedobj->fetch($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetch($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : 'Objet parent projet non trouvé'
ExtrafieldParamHelpPassword=Keep this field empty means value will be stored without encryption (field must be only hidden with star on screen).<br>Set here value 'auto' to use the default encryption rule to save password into database (then value read will be the hash only, no way to retreive original value)
ExtrafieldParamHelpselect=La liste doit être de la forme clef,valeur (où la clé ne peut être '0')<br><br> par exemple : <br>1,valeur1<br>2,valeur2<br>3,valeur3<br>...<br><br>\nPour afficher une liste dépendant d'une autre liste attribut complémentaire: <br>1, valeur1|options_<i>code_liste_parente</i>:clé_parente<br> 2,valeur2|option_<i>Code_liste_parente</i>:clé_parente<br><br>\nPour que la liste soit dépendante d'une autre liste:<br>1,valeur1|<i>code_liste_parent</i>:clef_parent<br>2,valeur2|<i>code_liste_parent</i>:clef_parent
ExtrafieldParamHelpcheckbox=La liste doit être de la forme clef,valeur (où la clé ne peut être '0')<br><br> par exemple : <br>1,valeur1<br>2,valeur2<br>3,valeur3<br>...
ExtrafieldParamHelpradio=La liste doit être de la forme clef,valeur (où la clé ne peut être '0')<br><br> par exemple : <br>1,valeur1<br>2,valeur2<br>3,valeur3<br>...
@ -422,7 +420,6 @@ ExtrafieldParamHelpsellist=Les paramètres de la liste viennent d'une table<br>S
ExtrafieldParamHelpchkbxlst=Les paramètres de la liste proviennent d'une table<br>:\nSyntaxe : nom_de_la_table:libelle_champ:id_champ::filtre<br>\nExemple : c_typent:libelle:id::filter<br><br>le filtre peut n'est qu'un test (ex : active=1) pour n'afficher que les valeurs actives.<br>Vous pouvez aussi utiliser $ID$ dans les filtres pour indiquer l'ID de l'élément courant.<br>\nPour utiliser un SELECT dans un filtre, utilisez $SEL$<br>\nPour filtrer sur un attribut supplémentaire, utilisez la syntaxe\nextra.fieldcode=... (ou fieldcode est le code de l'attribut supplémentaire)<br><br>Pour afficher une liste dépendant d'un autre attribut supplémentaire : <br>c_typent:libelle:id:options_<i>code_liste_parente</i>|colonne_parente:filtre <br><br>Pour afficher une liste dépendant d'une autre liste : <br>c_typent:libelle:id:<i>code_liste_parente</i>|colonne_parente:filter
ExtrafieldParamHelplink=Parameters must be ObjectName:Classpath<br>Syntax : ObjectName:Classpath<br>Examples :<br>Societe:societe/class/societe.class.php<br>Contact:contact/class/contact.class.php
LibraryToBuildPDF=Bibliothèque utilisée pour la génération des PDF
WarningUsingFPDF=Attention : votre fichier <b>conf.php</b> contient la directive <b>dolibarr_pdf_force_fpdf=1</b>. Cela signifie que vous utilisez la librairie FPDF pour générer vos fichiers PDF. Cette librairie est ancienne et ne couvre pas de nombreuses fonctionnalités (Unicode, transparence des images, langues cyrilliques, arabes ou asiatiques...), aussi vous pouvez rencontrer des problèmes durant la génération des PDF.<br>Pour résoudre cela et avoir une prise en charge complète de PDF, vous pouvez télécharger la <a href="http://www.tcpdf.org/" target="_blank">bibliothèque TCPDF</a> puis commenter ou supprimer la ligne <b>$dolibarr_pdf_force_fpdf=1</b>, et ajouter à la place <b>$dolibarr_lib_TCPDF_PATH='chemin_vers_TCPDF'</b>
LocalTaxDesc=Certains pays appliquent 2 voire 3 taux sur chaque ligne de facture. Si c'est le cas, choisissez le type du deuxième et troisième taux et sa valeur. Les types possibles sont:<br>1 : taxe locale sur les produits et services hors tva (la taxe locale est calculée sur le montant hors taxe)<br>2 : taxe locale sur les produits et services avant tva (la taxe locale est calculée sur le montant + tva)<br>3 : taxe locale uniquement sur les produits hors tva (la taxe locale est calculée sur le montant hors taxe)<br>4 : taxe locale uniquement sur les produits avant tva (la taxe locale est calculée sur le montant + tva)<br>5 : taxe locale uniquement sur les services hors tva (la taxe locale est calculée sur le montant hors taxe)<br>6 : taxe locale uniquement sur les service avant tva (la taxe locale est calculée sur le montant + tva)
SMS=SMS
LinkToTestClickToDial=Entrez un numéro de téléphone à appeler pour tester le lien d'appel « ClickToDial » pour l'utilisateur <strong>%s</strong>
@ -453,7 +450,8 @@ ModuleCompanyCodePanicum=Retourne un code comptable vide
ModuleCompanyCodeDigitaria=Renvoie un code comptable composé suivant le code tiers. Le code est composé du caractère 'C' en première position suivi des 5 premiers caractères du code tiers.
Use3StepsApproval=Par défaut, les commandes fournisseurs nécessitent d'être créées et approuvées en deux étapes/utilisateurs (une étape/utilisateur pour créer et une étape/utilisateur pour approuver. Si un utilisateur à les deux permissions, ces deux actions sont effectuées en une seule fois). Cette option ajoute la nécessité d'une approbation par une troisième étape/utilisateur, si le montant de la commande est supérieur au montant d'une valeur définie (soit 3 étapes nécessaire: 1 =Validation, 2=Première approbation et 3=seconde approbation si le montant l'exige).<br>Laissez le champ vide si une seule approbation (2 étapes) sont suffisantes, placez une valeur très faibe (0.1) si une deuxième approbation (3 étapes) est toujours exigée.
UseDoubleApproval=Activer l'approbation en trois étapes si le montant HT est supérieur à...
WarningPHPMail=Attention : Certains serveurs de messagerie (Yahoo) ne permettent pas l'envoi d'e-mails depuis un autre serveur que le leur si l'adresse d'envoi utilisée est une adresse Yahoo (myemail@yahoo.fr, myemail@yahoo.com...) Votre configuration actuelle utilise le serveur de l'application pour l'envoi d'e-mails. Le serveur de certains destinataires (compatibles avec le protocole restrictif DMARC) demanderont aux serveurs Yahoo l'autorisation de recevoir les e-mails et Yahoo la refusera car le serveur n'est pas un serveur appartenant à Yahoo, aussi une partie de vos e-mails envoyés risquent de ne pas être reçus.\n<br>Si votre fournisseur d'e-mail (comme Yahoo) impose cette restriction, vous devrez modifier votre configuration et opter pour l'autre méthode d'envoi "SMTP server" et saisissez les identifiants SMTP de votre compte fournis par votre fournisseur d'e-mail (à demander à votre fournisseur d'e-mail)
WarningPHPMail=WARNING: It is often better to setup outgoing emails to use the email server of your provider instead of the default setup. Some email providers (like Yahoo) does not allow you to send an email from another server than their own server. Your current setup use the server of the application to send email and not the server of your email provider, so some recipients (the one compatible with the restrictive DMARC protocol), will ask your email provider if they can accept your email and some email providers (like Yahoo) may respond "no" because the server is not a server of them, so few of your sent Emails may not be accepted (be car also to your email provider sending quota).<br>If your Email provider (like Yahoo) has this restriction, you must change Email setup to choose the other method "SMTP server" and enter the SMTP server and credentials provided by your Email provider (ask your EMail provider to get SMTP credentials for your account).
WarningPHPMail2=If your email SMTP provider need to restrict email client to some IP addresses (very rare), this is the IP address of your ERP CRM application: <strong>%s</strong>.
ClickToShowDescription=Cliquer pour afficher la description
DependsOn=Ce module a besoin du(des) module(s)
RequiredBy=Ce module est requis par le ou les module(s)
@ -623,6 +621,8 @@ Module59000Name=Marges
Module59000Desc=Module pour gérer les marges
Module60000Name=Commissions
Module60000Desc=Module pour gérer les commissions
Module62000Name=Incoterm
Module62000Desc=Ajouts de fonctionnalités pour gérer les incoterms
Module63000Name=Ressources
Module63000Desc=Gère les ressources (imprimantes, voitures, salles...). les ressources peuvent être affectées à des événements.
Permission11=Consulter les factures clients
@ -837,11 +837,11 @@ Permission1251=Lancer des importations en masse dans la base (chargement de donn
Permission1321=Exporter les factures clients, attributs et règlements
Permission1322=Rouvrir une facture payée
Permission1421=Exporter les commandes clients et attributs
Permission20001=Lire les demandes de congé (les vôtres et celle de vos subordonnés)
Permission20002=Créer/modifier vos demandes de congé
Permission20001=Read leave requests (your leaves and the one of your subordinates)
Permission20002=Create/modify your leave requests (yours leaves and the one of your subordinates)
Permission20003=Supprimer les demandes de congé
Permission20004=Lire toutes les demandes de congé (même celle des utilisateurs non subordonnés)
Permission20005=Créer/modifier les congés pour tout le monde
Permission20004=Read all leave requests (even of user not subordinates)
Permission20005=Create/modify leave requests for everybody (even of user not subordinates)
Permission20006=Administration des demandes de congés (configuration et mise à jour du solde)
Permission23001=Voir les travaux planifiés
Permission23002=Créer/Modifier des travaux planifiées
@ -888,6 +888,7 @@ DictionaryRevenueStamp=Montants des timbres fiscaux
DictionaryPaymentConditions=Conditions de règlement
DictionaryPaymentModes=Modes de paiements
DictionaryTypeContact=Types de contacts/adresses
DictionaryTypeOfContainer=Type of website pages/containers
DictionaryEcotaxe=Barèmes Eco-participation (DEEE)
DictionaryPaperFormat=Format papiers
DictionaryFormatCards=Formats des cartes
@ -915,8 +916,8 @@ TypeOfRevenueStamp=Type de timbre fiscal
VATManagement=Gestion TVA
VATIsUsedDesc=Le taux de TVA proposé par défaut lors de la création de proposition commerciale, facture, commande, etc... répond à la règle standard suivante :<br>Si vendeur non assujetti à TVA, TVA par défaut=0. Fin de règle.<br>Si le (pays vendeur= pays acheteur) alors TVA par défaut=TVA du produit vendu. Fin de règle.<br>Si vendeur et acheteur dans Communauté européenne et bien vendu= moyen de transport neuf (auto, bateau, avion), TVA par défaut=0 (La TVA doit être payée par acheteur au centre d'impôts de son pays et non au vendeur). Fin de règle.<br>Si vendeur et acheteur dans Communauté européenne et acheteur= particulier alors TVA par défaut=TVA du produit vendu (TVA pays vendeur si < seuil du pays et si avant 01/01/2015, TVA pays acheteur après le 01/01/2015). Fin de règle.<br>Si vendeur et acheteur dans Communauté européenne et acheteur= entreprise alors TVA par défaut=0. Fin de règle.<br>Sinon TVA proposée par défaut=0. Fin de règle.<br>
VATIsNotUsedDesc=Le taux de TVA proposé par défaut est 0. C'est le cas d'associations, particuliers ou certaines petites sociétés.
VATIsUsedExampleFR=En France, il s'agit des sociétés ou organismes ayant choisi un régime fiscale réel (Réel simplifié ou Réel normal), régime dans lequel la TVA est déclarée.
VATIsNotUsedExampleFR=En France, il s'agit des associations ne déclarant pas de TVA ou sociétés, organismes ou professions libérales ayant choisi le régime fiscal micro entreprise (TVA en franchise) et payant une TVA en franchise sans faire de déclaration de TVA. Ce choix fait de plus apparaître la mention "TVA non applicable - art-293B du CGI" sur les factures.
VATIsUsedExampleFR=En France, cela signifie que les entreprises ou les organisations sont assuetis à la tva (réel ou normal).
VATIsNotUsedExampleFR=In France, it means associations that are non VAT declared or companies, organizations or liberal professions that have chosen the micro enterprise fiscal system (VAT in franchise) and paid a franchise VAT without any VAT declaration. This choice will display the reference "Non applicable VAT - art-293B of CGI" on invoices.
##### Local Taxes #####
LTRate=Taux
LocalTax1IsNotUsed=Non assujeti
@ -981,7 +982,7 @@ Host=Serveur
DriverType=Type du pilote
SummarySystem=Résumé des informations systèmes
SummaryConst=Liste de tous les paramètres de configuration Dolibarr
MenuCompanySetup=Société/Organisation
MenuCompanySetup=Company/Organization
DefaultMenuManager= Gestionnaire du menu standard
DefaultMenuSmartphoneManager=Gestionnaire du menu smartphone
Skin=Thème visuel
@ -997,8 +998,8 @@ PermanentLeftSearchForm=Zone de recherche permanente du menu de gauche
DefaultLanguage=Langue à utiliser par défaut (code langue)
EnableMultilangInterface=Activer l'interface multi-langue
EnableShowLogo=Afficher le logo dans le menu gauche
CompanyInfo=Informations sur la société/organisation
CompanyIds=Identifiants règlementaires
CompanyInfo=Company/organization information
CompanyIds=Company/organization identities
CompanyName=Nom/Enseigne/Raison sociale
CompanyAddress=Adresse
CompanyZip=Code postal
@ -1053,6 +1054,7 @@ AreaForAdminOnly=Les paramètres d'installation ne peuvent être remplis que par
SystemInfoDesc=Les informations systèmes sont des informations techniques diverses accessibles en lecture seule aux administrateurs uniquement.
SystemAreaForAdminOnly=Cet espace n'est accessible qu'aux utilisateurs de type administrateur. Aucune permission Dolibarr ne permet d'étendre le cercle des utilisateurs autorisés à cet espace.
CompanyFundationDesc=Éditez sur cette page toutes les informations connues de la société ou de l'association que vous souhaitez gérer (Pour cela, cliquez sur les boutons "Modifier" ou "Sauvegarder" en bas de page)
AccountantDesc=Edit on this page all known information of your accountant/auditor to manage (For this, click on "Modify" or "Save" button at bottom of page)
DisplayDesc=Vous pouvez choisir ici tous les paramètres liés à l'apparence de Dolibarr
AvailableModules=Modules/applications installés
ToActivateModule=Pour activer des modules, aller dans l'espace Configuration (Accueil->Configuration->Modules).
@ -1429,7 +1431,7 @@ ViewProductDescInFormAbility=Visualisation des descriptions produits dans les fo
MergePropalProductCard=Ajoute dans l'onglet Fichiers joints des produits/services, une option pour fusionner le document PDF du produit au PDF des propositions Azur si le produit/services est inclut dans la proposition.
ViewProductDescInThirdpartyLanguageAbility=Visualisation des descriptions de produits dans la langue du tiers
UseSearchToSelectProductTooltip=Si vous avez un nombre important de produits (>100 000), vous pourrez améliorer les performances en positionnant la constante PRODUCT_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limité au début des chaines.
UseSearchToSelectProduct=Attendre que vous ayez appuyé sur une touche avant de charger le contenu de la liste déroulante des produits (Cela peut augmenter les performances si vous avez un grand nombre de contacts)
UseSearchToSelectProduct=Attendre que vous ayez appuyé sur une touche avant de charger le contenu de la liste déroulante des produits (Cela peut augmenter les performances si vous avez un grand nombre de produits, mais cela est moins convivial)
SetDefaultBarcodeTypeProducts=Type de code-barre utilisé par défaut pour les produits
SetDefaultBarcodeTypeThirdParties=Type de code-barre utilisé par défaut pour les tiers
UseUnits=Définir une unité de mesure pour la quantité lors de l'édition de lignes de commande, proposition ou facture
@ -1445,6 +1447,9 @@ SyslogFilename=Nom et chemin du fichier
YouCanUseDOL_DATA_ROOT=Vous pouvez utiliser DOL_DATA_ROOT/dolibarr.log pour un journal dans le répertoire "documents" de Dolibarr. Vous pouvez néanmoins définir un chemin différent pour stocker ce fichier.
ErrorUnknownSyslogConstant=La constante %s n'est pas une constante syslog connue
OnlyWindowsLOG_USER=Windows ne prend en charge que LOG_USER
CompressSyslogs=Syslog files compression and backup
SyslogFileNumberOfSaves=Log backups
ConfigureCleaningCronjobToSetFrequencyOfSaves=Configure cleaning scheduled job to set log backup frequency
##### Donations #####
DonationsSetup=Configuration du module Dons
DonationsReceiptModel=Modèles de reçu de dons
@ -1554,7 +1559,7 @@ SupposedToBeInvoiceDate=Date de facture utilisée
Buy=Achat
Sell=Vente
InvoiceDateUsed=Date de facture utilisée
YourCompanyDoesNotUseVAT=Votre société/institution est définie comme non assujettie à la TVA (voir Accueil > Configuration > Société/Institution), aussi il n'y a pas d'option paramétrage de la TVA.
YourCompanyDoesNotUseVAT=Your company has been defined to not use VAT (Home - Setup - Company/Organization), so there is no VAT options to setup.
AccountancyCode=Code comptable
AccountancyCodeSell=Code comptable vente
AccountancyCodeBuy=Code comptable achat
@ -1636,7 +1641,7 @@ ProjectsSetup=Configuration du module Projets
ProjectsModelModule=Modèles de document de rapport projets
TasksNumberingModules=Modèles de numérotation des références tâches
TaskModelModule=Modèles de document de rapport tâches
UseSearchToSelectProject=Attendre que vous ayez appuyé sur une touche avant de charger le contenu de la liste déroulante des projets (Cela peut augmenter les performances si vous avez un grand nombre de projets)
UseSearchToSelectProject=Attendre que vous ayez appuyé sur une touche avant de charger le contenu de la liste déroulante des projets (Cela peut augmenter les performances si vous avez un grand nombre de projets, mais cela est moins convivial)
##### ECM (GED) #####
##### Fiscal Year #####
AccountingPeriods=Période fiscales
@ -1718,10 +1723,10 @@ MailToSendIntervention=Pour l'envoi de fiche intervention
MailToSendSupplierRequestForQuotation=Pour l'envoi de demande de prix fournisseur
MailToSendSupplierOrder=Pour l'envoi de commande fournisseur
MailToSendSupplierInvoice=Pour l'envoi de facture fournisseur
MailToSendContract=Pour envoyer un contrat
MailToSendContract=Pour l'envoie depuis un contrat
MailToThirdparty=Pour l'envoi depuis la fiche Tiers
MailToMember=Pour envoyer un e-mail depuis la fiche d'un adhérent
MailToUser=Pour envoyer un e-mail depuis la page utilisateur
MailToMember=Pour l'envoi depuis la fiche d'un adhérent
MailToUser=Pour l'envoi depuis la page utilisateur
ByDefaultInList=Afficher par défaut sur les vues listes
YouUseLastStableVersion=Vous utilisez la dernière version stable
TitleExampleForMajorRelease=Exemple de message que vous pouvez utiliser pour annonce une nouvelle version majeure (n'hésitez pas à l'utilisez pour vos propres news)
@ -1768,9 +1773,11 @@ MAIN_PDF_MARGIN_LEFT=Marge gauche sur les PDF
MAIN_PDF_MARGIN_RIGHT=Marge droite sur les PDF
MAIN_PDF_MARGIN_TOP=Marge haute sur les PDF
MAIN_PDF_MARGIN_BOTTOM=Marge bas sur les PDF
SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups
EnterCalculationRuleIfPreviousFieldIsYes=Enter calculcation rule if previous field was set to Yes (For example 'CODEGRP1+CODEGRP2')
##### Resource ####
ResourceSetup=Configuration du module Ressource
UseSearchToSelectResource=Utilisez un champ avec auto-complétion pour choisir les ressources (plutôt qu'une liste déroulante).
DisabledResourceLinkUser=Supprimer le lien entre la ressource et l'utilisateur
DisabledResourceLinkContact=Désactiver le lient entre la ressource et le contact/adresse
DisabledResourceLinkUser=Disable feature to link a resource to users
DisabledResourceLinkContact=Disable feature to link a resource to contacts
ConfirmUnactivation=Confirmer réinitialisation du module

View File

@ -14,7 +14,7 @@ PaypalModeOnlyPaypal=PayPal seul
ONLINE_PAYMENT_CSS_URL=URL optionnelle de la feuille de style CSS sur la page de paiement en ligne
ThisIsTransactionId=Voici l'identifiant de la transaction: <b>%s</b>
PAYPAL_ADD_PAYMENT_URL=Ajouter l'URL de paiement Paypal lors de l'envoi d'un document par email
PredefinedMailContentLink=Vous pouvez cliquer sur le lien sécurisé ci-dessous pour effectuer votre paiement (Paypal) si ce dernier n'a pas encore été fait.\n\n%s\n\n
PredefinedMailContentLink=Vous pouvez cliquer sur le lien sécurisé ci-dessous pour effectuer votre paiement si ce dernier n'a pas encore été fait:<br><br>%s<br><br>
YouAreCurrentlyInSandboxMode=Vous travaillez actuellement dans le mode "bac à sable" de %s
NewOnlinePaymentReceived=Nouveau paiement en ligne reçu
NewOnlinePaymentFailed=Nouvelle tentative de paiement en ligne échouée
@ -30,3 +30,6 @@ ErrorCode=Code erreur
ErrorSeverityCode=Code d'erreur sévérité
OnlinePaymentSystem=Système de paiement en ligne
PaypalLiveEnabled=Paypal live activé (sinon mode test/bac à sable)
PaypalImportPayment=Import Paypal payments
PostActionAfterPayment=Post actions after payments
ARollbackWasPerformedOnPostActions=A rollback was performed on all Post actions. You must complete post actions manually if they are necessary.

View File

@ -0,0 +1,301 @@
# en_US lang file for module ticketsup
# Copyright (C) 2013 Jean-François FERRY <hello@librethic.io>
#
# 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/>.
#
# Generic
#
Module56000Name=Billets
Module56000Desc=Système de ticket pour de l'assistance ou une demande d'accompagnement
Permission56001=Voir tickets
Permission56002=Modifier des billets
Permission56003=Supprimer tickets
Permission56004=Gérer les tickets
Permission56005=Voir les tickets de tous les tiers (sauf pour les utilisateurs externes, toujours limité au tiers dont ils dépendent)
TicketsupDictType=Type de ticket
TicketsupDictCategory=Catégories de tickets
TicketsupDictSeverity=Sévérité des tickets
TicketTypeShortBUGSOFT=Dysfonctionnement logiciel
TicketTypeShortBUGHARD=Dysfonctionnement matériel
TicketTypeShortCOM=Question commerciale
TicketTypeShortINCIDENT=Demande d'assistance
TicketTypeShortPROJET=Projet
TicketTypeShortOTHER=Autre
TicketSeverityShortLOW=Faible
TicketSeverityShortNORMAL=Normal
TicketSeverityShortHIGH=Élevé
TicketSeverityShortBLOCKING=Critique/Bloquant
ErrorBadEmailAddress=Field '%s' incorrect
MenuTicketsupMyAssign=Mes tickets
MenuTicketsupMyAssignNonClosed=Mes tickets ouverts
MenuListNonClosed=Tickets non fermés
TypeContact_ticketsup_internal_CONTRIBUTOR=Contributeur
TypeContact_ticketsup_internal_SUPPORTTEC=Utilisateur assigné
TypeContact_ticketsup_external_SUPPORTCLI=Customer contact / incident tracking
TypeContact_ticketsup_external_CONTRIBUTOR=External contributor
Notify_TICKETMESSAGE_SENTBYMAIL=Envoyée la réponse par email
# Status
NotRead=Non lu
Read=Lu
Answered=Répondu
Assigned=assigné
InProgress=En cours
Waiting=En attente
Closed=Fermé
Deleted=Supprimé
# Dict
Type=Type
Category=Catégorie
Severity=Sévérité
# Email templates
MailToSendTicketsupMessage=To send email from ticket message
#
# Admin page
#
TicketsupSetup=Ticket module setup
TicketSupSettings=Paramètres
TicketsupSetupPage=
TicketsupPublicAccess=A public interface requiring no identification is available at the following url
TicketsupSetupDictionaries=The type of application categories and severity level are configurable from dictionaries
TicketParamModule=Module variable setup
TicketParamMail=Email setup
TicketEmailNotificationFrom=Notification email from
TicketEmailNotificationFromHelp=Used into ticket message answer by example
TicketEmailNotificationTo=Notifications email to
TicketEmailNotificationToHelp=Send email notifications to this address.
TicketNewEmailBodyLabel=Text message sent after creating a ticket (public interface)
TicketNewEmailBodyHelp=The text specified here will be inserted into the email confirming the creation of a new ticket from the public interface. Information on the consultation of the ticket are automatically added.
TicketParamPublicInterface=Configuration de l'interface publique\n
TicketsEmailMustExist=Une adresse mail existante est requise pour créer un ticket
TicketsEmailMustExistHelp=Pour accéder à l'interface publique et créer un nouveau ticket, votre compte doit déjà être existant.
PublicInterface=Interface publique
TicketUrlPublicInterfaceLabelAdmin=URL interface publique
TicketUrlPublicInterfaceHelpAdmin=It is possible to define an alias to the web server and thus make available the public interface to another IP address.
TicketPublicInterfaceTextHomeLabelAdmin=Texte de bienvenu dans l'interface publique
TicketPublicInterfaceTextHome=You can create a support ticket or view existing from its identifier tracking ticket.
TicketPublicInterfaceTextHomeHelpAdmin=The text defined here will appear on the home page of the public interface.
TicketPublicInterfaceTopicLabelAdmin=Titre de l'interface
TicketPublicInterfaceTopicHelp=This text will appear as the title of the public interface.
TicketPublicInterfaceTextHelpMessageLabelAdmin=Help text to the message entry
TicketPublicInterfaceTextHelpMessageHelpAdmin=This text will appear above the message input area of the user.
ExtraFieldsTicketSup=Extra attributes
TicketSupCkEditorEmailNotActivated=HTML editor is not activated. Please put FCKEDITOR_ENABLE_MAIL contant equal to 1
TicketsDisableEmail=Do not send ticket creation or message send emails
TicketsDisableEmailHelp=By default, emails are sent when new tickets or messages created. Enable this option to disable *all* email notifications
TicketsLogEnableEmail=Activer l'alerte par mail
TicketsLogEnableEmailHelp=A chaque changements, un email sera envoyé à chaque contact associé à ce ticket
TicketParams=Params
TicketsShowModuleLogo=Display the logo of the module in the public interface
TicketsShowModuleLogoHelp=Enable this option to hide the logo module in the pages of the public interface
TicketsShowCompanyLogo=Afficher le logo de la société dans l'interface publique
TicketsShowCompanyLogoHelp=Enable this option to hide the logo of the main company in the pages of the public interface
TicketsEmailAlsoSendToMainAddress=Also send notification to main email address
TicketsEmailAlsoSendToMainAddressHelp=Enable this option to send an email to "Notification email from" address (see setup below)
TicketsShowExtrafieldsIntoPublicArea=Show Extras fields in the public interface
TicketsShowExtrafieldsIntoPublicAreaHelp=When this option is enabled, additional attributes defined on the tickets will be shown in the public interface of ticket creation.
TicketsLimitViewAssignedOnly=Restrict the display to tickets assigned to the current user (not effective for external users, always be limited to the thirdparty they depend on)
TicketsLimitViewAssignedOnlyHelp=Seuls les tickets affectés à l'utilisateur actuel seront visibles. Ne s'applique pas à un utilisateur disposant de droits de gestion des tickets.
TicketsActivatePublicInterface=Activer l'interface publique
TicketsActivatePublicInterfaceHelp=Public interface allow any visitors to create tickets.
TicketsAutoAssignTicket=Automatically assign the user who created the ticket
TicketsAutoAssignTicketHelp=When creating a ticket, the user can be automatically assigned to the ticket.
TicketSupNumberingModules=Tickets numbering module
TicketNotNotifyTiersAtCreate=Do not notify the company to the creation
#
# About page
#
About=À propos
TicketSupAbout=À propos du module Ticket
TicketSupAboutModule=The development of this module has been initiated by the company Libr&thic.
TicketSupAboutModuleHelp=You can get help by using the contact form on the website <a href="http://librethic.io">librethic.io</a>
TicketSupAboutModuleImprove=Feel free to suggest improvements! Please visit <a href="https://code.librethic.io/Dolibarr/modules/ticketsup">the project page</a> on Doliforge website to report bugs and add tasks.
TicketSupAboutModuleThanks=Thanks to <a href="http://sayatnowa.com">nwa</a> who creates icons for this module./
#
# Index & list page
#
TicketsIndex=Accueil
TicketList=Liste des tickets
TicketAssignedToMeInfos=Cette page présente la liste des tickets assignés à l'utilisateur actuel
NoTicketsFound=Aucun ticket trouvé
TicketViewAllTickets=Voir tous les tickets
TicketViewNonClosedOnly=Voir seulement les tickets non fermés
TicketStatByStatus=Billets par statut
#
# Ticket card
#
Ticketsup=Incident ticket
TicketCard=Ticket card
CreateTicket=Créez un nouveau billet
EditTicket=Modifier un billet
TicketsManagement=Gestion de billets
CreatedBy=Créé par
NewTicket=Nouveau ticket
SubjectAnswerToTicket=Réponse ticket
TicketTypeRequest=Request type
TicketCategory=Catégorie
SeeTicket=Voir le ticket
TicketMarkedAsRead=Le ticket a été marqué comme lu
TicketReadOn=Read on
TicketCloseOn=Fermé le
UserAssignedTo=Utilisateur assigné
MarkAsRead=Mark ticket as read
TicketMarkedAsReadButLogActionNotSaved=Ticket marked as closed but no action saved
TicketHistory=Historique de billets
AssignUser=Assign to user
TicketAssigned=Le ticket est à présent assigné
TicketChangeType=Change type
TicketChangeCategory=Changer la catégorie
TicketChangeSeverity=Changer la sévérité
TicketAddMessage=Ajouter un message
TicketEditProperties=Éditer les propriétés
AddMessage=Ajouter un message
MessageSuccessfullyAdded=Ticket créé
TicketMessageSuccessfullyAdded=Message ajouté avec succès
TicketMessagesList=Message list
NoMsgForThisTicket=Pas de message pour ce ticket
Properties=Classification
LatestNewTickets=Last %s tickets newest (not read)
TicketSeverity=Sévérité
ShowTicket=Voir le ticket
RelatedTickets=Tickets liés
TicketAddIntervention=Créer intervention
CloseTicket=Fermer le ticket
CloseATicket=Fermer un billet
ConfirmCloseAticket=Confirmer la fermeture du ticket
ConfirmDeleteTicket=Confirmez la suppression du ticket
TicketDeletedSuccess=Ticket supprimé avec succès
TicketMarkedAsClosed=Ticket indiqué fermé
TicketMarkedAsClosedButLogActionNotSaved=Ticket marqué comme fermé mais pas commenté !
TicketDurationAuto=Durée calculée
TicketDurationAutoInfos=Duration calculated automatically from intervention related
TicketUpdated=Ticket mis à jour
SendMessageByEmail=Envoyer ce message par email
TicketNewMessage=Nouveau message
ErrorMailRecipientIsEmptyForSendTicketMessage=Recipient is empty. No email send
TicketGoIntoContactTab=Please go into "Contacts" tab to select them
TicketMessageMailIntro=Introduction
TicketMessageMailIntroHelp=This text is added only at the beginning of the email and will not be saved.
TicketMessageMailIntroLabelAdmin=Introduction to the message when sending email
TicketMessageMailIntroText=<p> Bonjour </ p> Une nouvelle réponse a été ajoutée à un ticket que vous suivez. Voici le message : </ p>
TicketMessageMailIntroHelpAdmin=This text will be inserted before the text of the response to a ticket.
TicketMessageMailSignature=Signature
TicketMessageMailSignatureHelp=This text is added only at the end of the email and will not be saved.
TicketMessageMailSignatureText=<p>Cordialement,</p><p>--</p>
TicketMessageMailSignatureLabelAdmin=Signature of response email
TicketMessageMailSignatureHelpAdmin=This text will be inserted after the response message.
TicketMessageHelp=Only this text will be saved in the message list on ticket card.
TicketMessageSubstitutionReplacedByGenericValues=Substitutions variables are replaced by generic values.
TicketTimeToRead=Time elapsed before ticket read
TicketContacts=Contacts ticket
TicketDocumentsLinked=Documents liés
ConfirmReOpenTicket=Voulez-vous ré-ouvrir ce ticket ?
TicketMessageMailIntroAutoNewPublicMessage=A new message was posted on the ticket with the subject %s :
TicketAssignedToYou=Ticket assigned
TicketAssignedEmailBody=You have been assigned the ticket #%s by %s
MarkMessageAsPrivate=Mark message as private
TicketMessagePrivateHelp=This message will not display to external users
TicketEmailOriginIssuer=Issuer at origin of the tickets
InitialMessage=Message initial
LinkToAContract=Link to a contract
TicketSupPleaseSelectAContract=Sélectionner un contrat
UnableToCreateInterIfNoSocid=Can not create a response file without defining a thirdparty
TicketMailExchanges=Mail exchanges
TicketInitialMessageModified=Message initial modifié
TicketMessageSuccesfullyUpdated=Message successfully updated
TicketChangeStatus=Changer l'état
TicketConfirmChangeStatus=Confirm the status change : %s ?
TicketLogStatusChanged=Status changed : %s to %s
TicketNotNotifyTiersAtCreate=Do not notify the company to the creation
#
# Logs
#
TicketLogMesgReadBy=Ticket read by %s
NoLogForThisTicket=No log for this ticket yet
TicketLogAssignedTo=Ticket assigned to %s
TicketAssignedButLogActionNotSaved=Ticket assigned but no log saved !
TicketLogPropertyChanged=Change classification : from %s to %s
TicketLogClosedBy=Ticket clôt par %s
TicketLogProgressSetTo=Progression de %s pour-cent appliquée
TicketLogReopen=Ticket ré-ouvert
#
# Public pages
#
TicketSystem=Gestionnaire de tickets
ShowListTicketWithTrackId=Display ticket list from track ID
ShowTicketWithTrackId=Display ticket from track ID
TicketPublicDesc=You can create a support ticket or check from an existing ID.
YourTicketSuccessfullySaved=Le billet a été enregistré avec succès
MesgInfosPublicTicketCreatedWithTrackId=A new ticket has been created with ID %s.
PleaseRememberThisId=Merci de conserver le code de suivi du ticket, il vous sera peut-être nécessaire ultérieurement
TicketNewEmailSubject=Ticket creation confirmation
TicketNewEmailSubjectCustomer=New support ticket
TicketNewEmailBody=Ceci est un message automatique pour confirmer l'enregistrement de votre ticket.
TicketNewEmailBodyCustomer=This is an automatic email to confirm a new ticket has just been created into your account.
TicketNewEmailBodyInfosTicket=Information for monitoring the ticket
TicketNewEmailBodyInfosTrackId=Ticket tracking number : %s
TicketNewEmailBodyInfosTrackUrl=You can view the progress of the ticket by clicking the link above.
TicketNewEmailBodyInfosTrackUrlCustomer=You can view the progress of the ticket in the specific interface by clicking the following link
TicketEmailPleaseDoNotReplyToThisEmail=Merci de ne pas répondre directement à ce courriel ! Utilisez le lien pour répondre via l'interface.
TicketPublicInfoCreateTicket=This form allows you to record a trouble ticket in our management system.
TicketPublicPleaseBeAccuratelyDescribe=Veuillez décrire avec précision le problème. Fournissez le plus d'informations possibles pour nous permettre d'identifier correctement votre demande.
TicketPublicMsgViewLogIn=Merci d'entrer le code de suivi du ticket
TicketTrackId=Tracking ID
OneOfTicketTrackId=One of yours tracking ID
ErrorTicketNotFound=Ticket with tracking ID %s not found !
Subject=Sujet
ViewTicket=Voir le ticket
ViewMyTicketList=Voir la liste de mes tickets
ErrorEmailMustExistToCreateTicket=Erreur : Email introuvable dans notre base de données
TicketNewEmailSubjectAdmin=Nouveau ticket créé
TicketNewEmailBodyAdmin=<p>Ticket has just been created with ID #%s, see informations :</p>
SeeThisTicketIntomanagementInterface=See ticket in management interface
TicketPublicInterfaceForbidden=Accès à cette partie : interdit
# notifications
TicketNotificationEmailSubject=Ticket %s updated
TicketNotificationEmailBody=This is an automatic message to notify you that ticket %s has just been updated
TicketNotificationRecipient=Notification recipient
TicketNotificationLogMessage=Log message
TicketNotificationEmailBodyInfosTrackUrlinternal=View ticket into interface
TicketNotificationNumberEmailSent=Email de notification envoyé: %s
#
# Boxes
#
BoxLastTicketsup=Les derniers tickets
BoxLastTicketsupDescription=Last %s tickets saved
BoxLastTicketsupContent=
BoxLastTicketsupNoRecordedTickets=Pas de ticket non lu
BoxLastModifiedTicketsup=Last modified tickets
BoxLastModifiedTicketsupDescription=Last %s tickets modified
BoxLastModifiedTicketsupContent=
BoxLastModifiedTicketsupNoRecordedTickets=Pas de tickets modifiés récemment

View File

@ -109,7 +109,6 @@ ACCOUNTING_PRODUCT_BUY_ACCOUNT=Conta contábil padrão para produtos comprados (
ACCOUNTING_PRODUCT_SOLD_ACCOUNT=Conta contábil padrão para os produtos vendidos (usado se não estiver definido na folha do produto)
ACCOUNTING_SERVICE_BUY_ACCOUNT=Conta contábil padrão para os serviços comprados (se não for definido na listagem de serviços)
ACCOUNTING_SERVICE_SOLD_ACCOUNT=Conta contábil padrão para os serviços vendidos (se não for definido na listagem de serviços)
Code_tiers=Terceiro
LabelAccount=Conta rótulo
LabelOperation=Operação de etiqueta
Sens=Significado

View File

@ -353,7 +353,6 @@ ExtrafieldParamHelpsellist=Lista de valores oriundos de uma tabela<br>Sintaxe :
ExtrafieldParamHelpchkbxlst=A lista de valores oriundos de uma tabela<br>Sintaxe : table_name:label_field:id_field::filter<br>Exemplo : c_typent:libelle:id::filter<br><br>o filtro pode ser um teste simples (ex. ativo=1) para exibir somente valores ativos<br>Você também pode usar $ID$ no filtro que é a id atual do objeto atual<br>Para realizar uma SELEÇÃO no filtro, use $SEL$<br>Se você deseja filtrar nos campos extras, use a sintaxe extra.fieldcode=... (onde o código do campo é o código do campo extra)<br><br>A fim de ter a lista dependendo de uma outra lista de atributos complementares :<br>c_typent:libelle:id:options_<i>parent_list_code</i>|parent_column:filter <br><br>A fim de ter a lista dependendo de uma outra lista :<br>c_typent:libelle:id:<i>parent_list_code</i>|parent_column:filter
ExtrafieldParamHelplink=Os parâmetros devem ser ObjectName:Classpath <br>Sintaxe: ObjectName:Classpath <br> Exemplos: <br> Societe:societe/class/societe.class.php <br> Contact:contact/class/contact.class.php
LibraryToBuildPDF=Biblioteca usada para a geração de PDF
WarningUsingFPDF=Aviso: Sua <b>conf.php</b> Contém diretrize <b>dolibarr_pdf_force_fpdf=1</b>. Isso significa que você usa a biblioteca FPDF para gerar arquivos em PDF. Essa biblioteca é velha e não suporta muitas novas funções (Unicode, imagem transparente, cyrillic, línguas arábicas e asiáticas,...), portanto pode ocorrer alguns erros durante a geração de PDF.<br>Para corrigir esse problema e ter todo o suporte na geração de PDF, baixe <a href="http://www.tcpdf.org/" target="_blank">Biblioteca TCPDF</a>, então comente ou remova essa linha <b>$dolibarr_pdf_force_fpdf=1</b>, e adicione essa <b>$dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir'</b>
LocalTaxDesc=Alguns paises aplicam de 2 a 3 taxas em cada linha de fatura. Se for esse caso, escolha o tipo de segunda e terceira taxa. Os possíveis tipos são:<br>1 : Taxa local aplicam em produtos e serviços sem ICMS (ICMS não é aplicada em taxa local)<br>2 : Taxa local aplicam em produtos e serviços antes do ICMS (ICMS é calculado no montante + taxa local)<br>3 : Taxa local aplicam em produtos sem o ICMS (ICMS não é aplicada na taxa local)<br>4 : Taxa local aplicam nos produtos antes do ICMS (ICMS é calculado no montante + taxa local)<br>5 : Taxa local aplicam no serviço sem o ICMS (ICMS não é aplicado em taxa local)<br>6 : Taxa local aplicam em serviços antes do ICMS (ICMS é calculado no montante + taxa local)
LinkToTestClickToDial=Entre com um número telefônico para chamar e mostrar um link que testar a URL CliqueParaDiscar para usuário <strong>%s</strong>
RefreshPhoneLink=Atualizar link

View File

@ -60,8 +60,6 @@ LastSubscriptionsModified=Últimas %s subscrições modificadas
PublicMemberCard=Ficha pública membro
SubscriptionNotRecorded=Subscrição não registrada
AddSubscription=Criar subscripção
DescADHERENT_AUTOREGISTER_MAIL_SUBJECT=Assunto do email em caso de inscrição automática
DescADHERENT_AUTOREGISTER_MAIL=Email a enviar em caso de convite para inscrição automática
DescADHERENT_ETIQUETTE_TEXT=Texto impresso em folhas de endereço de membros
DescADHERENT_CARD_TYPE=Formato da página fichas
DescADHERENT_CARD_HEADER_TEXT=Texto a imprimir na parte superior do cartão de membro

View File

@ -470,14 +470,23 @@ class MyObject extends CommonObject
{
global $conf, $langs;
//$conf->global->SYSLOG_FILE = 'DOL_DATA_ROOT/dolibarr_mydedicatedlofile.log';
$error = 0;
$this->output = '';
$this->error='';
dol_syslog(__METHOD__, LOG_DEBUG);
$now = dol_now();
$this->db->begin();
// ...
return 0;
$this->db->commit();
return $error;
}
}

View File

@ -284,22 +284,20 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{
$langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->mymodule->creer)
if ($user->rights->mymodule->write)
{
if ($action != 'classify')
{
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref.='<input type="hidden" name="action" value="classin">';
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref.='<input type="hidden" name="action" value="classin">';
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (! empty($object->fk_project)) {

View File

@ -45,7 +45,7 @@ dol_include_once('/mymodule/class/myobject.class.php');
dol_include_once('/mymodule/lib/myobject.lib.php');
// Load traductions files requiredby by page
$langs->loadLangs(array("mymodule@mymodule","companies","other"));
$langs->loadLangs(array("mymodule@mymodule","companies","other","mails"));
$action=GETPOST('action','aZ09');
@ -68,6 +68,7 @@ $pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="name";
//if (! $sortfield) $sortfield="position_name";
// Initialize technical objects
$object=new MyObject($db);
@ -108,7 +109,6 @@ if ($object->id)
/*
* Show tabs
*/
if (! empty($conf->notification->enabled)) $langs->load("mails");
$head = myobjectPrepareHead($object);
dol_fiche_head($head, 'document', $langs->trans("MyObject"), -1, 'myobject@mymodule');

View File

@ -216,7 +216,7 @@ class ActionsCardProduct
$this->tpl['nblignes'] = 4;
if ($this->object->is_photo_available($conf->product->multidir_output[$this->object->entity]))
{
$this->tpl['photos'] = $this->object->show_photos($conf->product->multidir_output[$this->object->entity],1,1,0,0,0,80);
$this->tpl['photos'] = $this->object->show_photos('product', $conf->product->multidir_output[$this->object->entity],1,1,0,0,0,80);
}
// Nature

View File

@ -211,7 +211,7 @@ class ActionsCardService
$this->tpl['nblignes'] = 4;
if ($this->object->is_photo_available($conf->service->multidir_output[$this->object->entity]))
{
$this->tpl['photos'] = $this->object->show_photos($conf->service->multidir_output[$this->object->entity],1,1,0,0,0,80);
$this->tpl['photos'] = $this->object->show_photos('product', $conf->service->multidir_output[$this->object->entity],1,1,0,0,0,80);
}
// Duration

View File

@ -1225,7 +1225,7 @@ class Product extends CommonObject
$sql2.= " SET ";
$sql2.= " label='".$this->db->escape($this->label)."',";
$sql2.= " description='".$this->db->escape($this->description)."'";
if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) $sql2.= ", note='".$this->db->escape($this->note)."'";
if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) $sql2.= ", note='".$this->db->escape($this->other)."'";
$sql2.= " WHERE fk_product=".$this->id." AND lang='".$this->db->escape($key)."'";
}
else
@ -1235,7 +1235,7 @@ class Product extends CommonObject
$sql2.= ")";
$sql2.= " VALUES(".$this->id.",'".$this->db->escape($key)."','". $this->db->escape($this->label)."',";
$sql2.= " '".$this->db->escape($this->description)."'";
if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) $sql2.= ", '".$this->db->escape($this->note)."'";
if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) $sql2.= ", '".$this->db->escape($this->other)."'";
$sql2.= ")";
}
dol_syslog(get_class($this).'::setMultiLangs key = current_lang = '.$key);
@ -1260,7 +1260,7 @@ class Product extends CommonObject
$sql2.= " SET ";
$sql2.= " label='".$this->db->escape($this->multilangs["$key"]["label"])."',";
$sql2.= " description='".$this->db->escape($this->multilangs["$key"]["description"])."'";
if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) $sql2.= ", note='".$this->db->escape($this->multilangs["$key"]["note"])."'";
if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) $sql2.= ", note='".$this->db->escape($this->multilangs["$key"]["other"])."'";
$sql2.= " WHERE fk_product=".$this->id." AND lang='".$this->db->escape($key)."'";
}
else
@ -1270,7 +1270,7 @@ class Product extends CommonObject
$sql2.= ")";
$sql2.= " VALUES(".$this->id.",'".$this->db->escape($key)."','". $this->db->escape($this->multilangs["$key"]["label"])."',";
$sql2.= " '".$this->db->escape($this->multilangs["$key"]["description"])."'";
if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) $sql2.= ", '".$this->db->escape($this->note)."'";
if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) $sql2.= ", '".$this->db->escape($this->multilangs["$key"]["other"])."'";
$sql2.= ")";
}
@ -3303,28 +3303,8 @@ class Product extends CommonObject
}
/**
* fonction recursive uniquement utilisee par get_each_prod, ajoute chaque sousproduits dans le tableau res
*
* @param array $prod Products array
* @return void
*/
function fetch_prods($prod)
{
$this->res;
foreach($prod as $nom_pere => $desc_pere)
{
// on est dans une sous-categorie
if(is_array($desc_pere))
$this->res[]= array($desc_pere[1],$desc_pere[0]);
if(count($desc_pere) >1)
{
$this->fetch_prods($desc_pere);
}
}
}
/**
* reconstruit l'arborescence des produits sous la forme d'un tableau
* Build the tree of subproducts into an array
* this->sousprods is loaded by this->get_sousproduits_arbo()
*
* @param int $multiply Because each sublevel must be multiplicated by parent nb
* @return array $this->res
@ -3343,26 +3323,6 @@ class Product extends CommonObject
return $this->res;
}
/**
* Renvoie tous les sousproduits dans le tableau res, chaque ligne de res contient : id -> qty
*
* @return array $this->res
*/
function get_each_prod()
{
$this->res = array();
if (is_array($this->sousprods))
{
foreach($this->sousprods as $nom_pere => $desc_pere)
{
if (count($desc_pere) >1) $this->fetch_prods($desc_pere);
}
sort($this->res);
}
return $this->res;
}
/**
* Return all parent products for current product (first level only)
*
@ -3559,7 +3519,7 @@ class Product extends CommonObject
}
if (! empty($this->entity))
{
$tmpphoto = $this->show_photos($conf->product->multidir_output[$this->entity],1,1,0,0,0,80);
$tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80);
if ($this->nbphoto > 0) $label .= '<br>' . $tmpphoto;
}
@ -4133,234 +4093,6 @@ class Product extends CommonObject
}
/**
* Show photos of a product (nbmax maximum), into several columns
* TODO Move this into html.formproduct.class.php
*
* @param string $sdir Directory to scan (full absolute path)
* @param int $size 0=original size, 1='small' use thumbnail if possible
* @param int $nbmax Nombre maximum de photos (0=pas de max)
* @param int $nbbyrow Number of image per line or -1 to use div. Used only if size=1.
* @param int $showfilename 1=Show filename
* @param int $showaction 1=Show icon with action links (resize, delete)
* @param int $maxHeight Max height of original image when size='small' (so we can use original even if small requested). If 0, always use 'small' thumb image.
* @param int $maxWidth Max width of original image when size='small'
* @param int $nolink Do not add a href link to view enlarged imaged into a new tab
* @param int $notitle Do not add title tag on image
* @param int $usesharelink Use the public shared link of image (if not available, the 'nophoto' image will be shown instead)
* @return string Html code to show photo. Number of photos shown is saved in this->nbphoto
*/
function show_photos($sdir,$size=0,$nbmax=0,$nbbyrow=5,$showfilename=0,$showaction=0,$maxHeight=120,$maxWidth=160,$nolink=0,$notitle=0,$usesharelink=0)
{
global $conf,$user,$langs;
include_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
include_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php';
$sortfield='position_name';
$sortorder='asc';
$dir = $sdir . '/';
$pdir = '/';
$dir .= get_exdir(0,0,0,0,$this,'product').$this->ref.'/';
$pdir .= get_exdir(0,0,0,0,$this,'product').$this->ref.'/';
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
{
$dir = $sdir . '/'. get_exdir($this->id,2,0,0,$this,'product') . $this->id ."/photos/";
$pdir = '/' . get_exdir($this->id,2,0,0,$this,'product') . $this->id ."/photos/";
}
// Defined relative dir to DOL_DATA_ROOT
$relativedir = '';
if ($dir)
{
$relativedir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $dir);
$relativedir = preg_replace('/^[\\/]/','',$relativedir);
$relativedir = preg_replace('/[\\/]$/','',$relativedir);
}
$dirthumb = $dir.'thumbs/';
$pdirthumb = $pdir.'thumbs/';
$return ='<!-- Photo -->'."\n";
$nbphoto=0;
$filearray=dol_dir_list($dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
/*if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) // For backward compatiblity, we scan also old dirs
{
$filearrayold=dol_dir_list($dirold,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$filearray=array_merge($filearray, $filearrayold);
}*/
completeFileArrayWithDatabaseInfo($filearray, $relativedir);
if (count($filearray))
{
if ($sortfield && $sortorder)
{
$filearray=dol_sort_array($filearray, $sortfield, $sortorder);
}
foreach($filearray as $key => $val)
{
$photo='';
$file = $val['name'];
//if (! utf8_check($file)) $file=utf8_encode($file); // To be sure file is stored in UTF8 in memory
//if (dol_is_file($dir.$file) && image_format_supported($file) >= 0)
if (image_format_supported($file) >= 0)
{
$nbphoto++;
$photo = $file;
$viewfilename = $file;
if ($size == 1 || $size == 'small') { // Format vignette
// Find name of thumb file
$photo_vignette=basename(getImageFileNameForSize($dir.$file, '_small'));
if (! dol_is_file($dirthumb.$photo_vignette)) $photo_vignette='';
// Get filesize of original file
$imgarray=dol_getImageSize($dir.$photo);
if ($nbbyrow > 0)
{
if ($nbphoto == 1) $return.= '<table width="100%" valign="top" align="center" border="0" cellpadding="2" cellspacing="2">';
if ($nbphoto % $nbbyrow == 1) $return.= '<tr align=center valign=middle border=1>';
$return.= '<td width="'.ceil(100/$nbbyrow).'%" class="photo">';
}
else if ($nbbyrow < 0) $return .= '<div class="inline-block">';
$return.= "\n";
$relativefile=preg_replace('/^\//', '', $pdir.$photo);
if (empty($nolink))
{
$urladvanced=getAdvancedPreviewUrl('product', $relativefile, 0, 'entity='.$this->entity);
if ($urladvanced) $return.='<a href="'.$urladvanced.'">';
else $return.= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&entity='.$this->entity.'&file='.urlencode($pdir.$photo).'" class="aphoto" target="_blank">';
}
// Show image (width height=$maxHeight)
// Si fichier vignette disponible et image source trop grande, on utilise la vignette, sinon on utilise photo origine
$alt=$langs->transnoentitiesnoconv('File').': '.$relativefile;
$alt.=' - '.$langs->transnoentitiesnoconv('Size').': '.$imgarray['width'].'x'.$imgarray['height'];
if ($notitle) $alt='';
if ($usesharelink)
{
if ($val['share'])
{
if (empty($maxHeight) || $photo_vignette && $imgarray['height'] > $maxHeight)
{
$return.= '<!-- Show original file (thumb not yet available with shared links) -->';
$return.= '<img class="photo photowithmargin" border="0" height="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?hashp='.urlencode($val['share']).'" title="'.dol_escape_htmltag($alt).'">';
}
else {
$return.= '<!-- Show original file -->';
$return.= '<img class="photo photowithmargin" border="0" height="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?hashp='.urlencode($val['share']).'" title="'.dol_escape_htmltag($alt).'">';
}
}
else
{
$return.= '<!-- Show nophoto file (because file is not shared) -->';
$return.= '<img class="photo photowithmargin" border="0" height="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png" title="'.dol_escape_htmltag($alt).'">';
}
}
else
{
if (empty($maxHeight) || $photo_vignette && $imgarray['height'] > $maxHeight)
{
$return.= '<!-- Show thumb -->';
$return.= '<img class="photo photowithmargin" border="0" height="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&entity='.$this->entity.'&file='.urlencode($pdirthumb.$photo_vignette).'" title="'.dol_escape_htmltag($alt).'">';
}
else {
$return.= '<!-- Show original file -->';
$return.= '<img class="photo photowithmargin" border="0" height="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&entity='.$this->entity.'&file='.urlencode($pdir.$photo).'" title="'.dol_escape_htmltag($alt).'">';
}
}
if (empty($nolink)) $return.= '</a>';
$return.="\n";
if ($showfilename) $return.= '<br>'.$viewfilename;
if ($showaction)
{
$return.= '<br>';
// On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites
if ($photo_vignette && (image_format_supported($photo) > 0) && ($this->imgWidth > $maxWidth || $this->imgHeight > $maxHeight))
{
$return.= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=addthumb&amp;file='.urlencode($pdir.$viewfilename).'">'.img_picto($langs->trans('GenerateThumb'),'refresh').'&nbsp;&nbsp;</a>';
}
if ($user->rights->produit->creer || $user->rights->service->creer)
{
// Link to resize
$return.= '<a href="'.DOL_URL_ROOT.'/core/photos_resize.php?modulepart='.urlencode('produit|service').'&id='.$this->id.'&amp;file='.urlencode($pdir.$viewfilename).'" title="'.dol_escape_htmltag($langs->trans("Resize")).'">'.img_picto($langs->trans("Resize"), 'resize', '').'</a> &nbsp; ';
// Link to delete
$return.= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=delete&amp;file='.urlencode($pdir.$viewfilename).'">';
$return.= img_delete().'</a>';
}
}
$return.= "\n";
if ($nbbyrow > 0)
{
$return.= '</td>';
if (($nbphoto % $nbbyrow) == 0) $return.= '</tr>';
}
else if ($nbbyrow < 0) $return.='</div>';
}
if (empty($size)) { // Format origine
$return.= '<img class="photo photowithmargin" border="0" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&entity='.$this->entity.'&file='.urlencode($pdir.$photo).'">';
if ($showfilename) $return.= '<br>'.$viewfilename;
if ($showaction)
{
if ($user->rights->produit->creer || $user->rights->service->creer)
{
// Link to resize
$return.= '<a href="'.DOL_URL_ROOT.'/core/photos_resize.php?modulepart='.urlencode('produit|service').'&id='.$this->id.'&amp;file='.urlencode($pdir.$viewfilename).'" title="'.dol_escape_htmltag($langs->trans("Resize")).'">'.img_picto($langs->trans("Resize"), 'resize', '').'</a> &nbsp; ';
// Link to delete
$return.= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=delete&amp;file='.urlencode($pdir.$viewfilename).'">';
$return.= img_delete().'</a>';
}
}
}
// On continue ou on arrete de boucler ?
if ($nbmax && $nbphoto >= $nbmax) break;
}
}
if ($size==1 || $size=='small')
{
if ($nbbyrow > 0)
{
// Ferme tableau
while ($nbphoto % $nbbyrow)
{
$return.= '<td width="'.ceil(100/$nbbyrow).'%">&nbsp;</td>';
$nbphoto++;
}
if ($nbphoto) $return.= '</table>';
}
}
}
$this->nbphoto = $nbphoto;
return $return;
}
/**
* Retourne tableau de toutes les photos du produit
*

View File

@ -40,10 +40,10 @@ if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL))
$langs->load("other");
$langs->load("products");
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action=GETPOST('action','alpha');
$confirm=GETPOST('confirm','alpha');
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action','alpha');
$confirm= GETPOST('confirm','alpha');
// Security check
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
@ -93,7 +93,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
if (empty($reshook))
{
//Delete line if product propal merge is linked to a file
// Delete line if product propal merge is linked to a file
if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL))
{
if ($action == 'confirm_deletefile' && $confirm == 'yes')
@ -346,7 +346,6 @@ if ($object->id)
print '</form>';
}
}
}
else
{

View File

@ -251,7 +251,7 @@ if ($action == 'edit')
print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">';
print '<tr><td class="tdtop titlefieldcreate fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle-'.$key.'" size="40" value="'.$object->multilangs[$key]["label"].'"></td></tr>';
print '<tr><td class="tdtop titlefieldcreate fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle-'.$key.'" size="40" value="'.dol_escape_htmltag($object->multilangs[$key]["label"]).'"></td></tr>';
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
$doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
$doleditor->Create();

View File

@ -142,12 +142,17 @@ function llxFooterVierge()
// Action called when page is submitted
if ($action == 'add')
{
$error = 0;
$urlback='';
$db->begin();
// test if login already exists
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
if(! GETPOST('login'))
{
$error+=1;
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Login"))."<br>\n";
}
$sql = "SELECT login FROM ".MAIN_DB_PREFIX."adherent WHERE login='".$db->escape(GETPOST('login'))."'";
@ -158,52 +163,52 @@ if ($action == 'add')
}
if ($num !=0)
{
$error+=1;
$error++;
$langs->load("errors");
$errmsg .= $langs->trans("ErrorLoginAlreadyExists")."<br>\n";
}
if (!isset($_POST["pass1"]) || !isset($_POST["pass2"]) || $_POST["pass1"] == '' || $_POST["pass2"] == '' || $_POST["pass1"]!=$_POST["pass2"])
{
$error+=1;
$error++;
$langs->load("errors");
$errmsg .= $langs->trans("ErrorPasswordsMustMatch")."<br>\n";
}
if (! GETPOST("email"))
{
$error+=1;
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("EMail"))."<br>\n";
}
}
if (GETPOST('type') <= 0)
{
$error+=1;
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type"))."<br>\n";
}
if (! in_array(GETPOST('morphy'),array('mor','phy')))
{
$error+=1;
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv('Nature'))."<br>\n";
}
if (empty($_POST["lastname"]))
{
$error+=1;
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Lastname"))."<br>\n";
}
if (empty($_POST["firstname"]))
{
$error+=1;
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Firstname"))."<br>\n";
}
if (GETPOST("email") && ! isValidEmail(GETPOST("email")))
{
$error+=1;
$error++;
$langs->load("errors");
$errmsg .= $langs->trans("ErrorBadEMail",GETPOST("email"))."<br>\n";
}
$birthday=dol_mktime($_POST["birthhour"],$_POST["birthmin"],$_POST["birthsec"],$_POST["birthmonth"],$_POST["birthday"],$_POST["birthyear"]);
if ($_POST["birthmonth"] && empty($birthday))
{
$error+=1;
$error++;
$langs->load("errors");
$errmsg .= $langs->trans("ErrorBadDateFormat")."<br>\n";
}
@ -211,7 +216,7 @@ if ($action == 'add')
{
if (GETPOST("morphy") == 'mor' && GETPOST('budget') <= 0)
{
$error+=1;
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("TurnoverOrBudget"))."<br>\n";
}
}
@ -256,21 +261,72 @@ if ($action == 'add')
if ($result > 0)
{
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$object = $adh;
// Send email to say it has been created and will be validated soon...
if (! empty($conf->global->ADHERENT_AUTOREGISTER_MAIL) && ! empty($conf->global->ADHERENT_AUTOREGISTER_MAIL_SUBJECT))
$adht = new AdherentType($db);
$adht->fetch($object->typeid);
if ($object->email)
{
$result=$adh->send_an_email($conf->global->ADHERENT_AUTOREGISTER_MAIL,$conf->global->ADHERENT_AUTOREGISTER_MAIL_SUBJECT,array(),array(),array(),"","",0,-1);
$subject = '';
$msg= '';
// Send subscription email
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail=new FormMail($db);
// Set output language
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
$outputlangs->loadLangs(array("main", "members"));
// Get email content fro mtemplae
$arraydefaultmessage=null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER;
if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
{
$subject = $arraydefaultmessage->topic;
$msg = $arraydefaultmessage->content;
}
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs);
if ($subjecttosend && $texttosend)
{
$result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1);
}
/*if ($result < 0)
{
$error++;
setEventMessages($object->error, $object->errors, 'errors');
}*/
}
// Send email to the foundation to say a new member subscribed with autosubscribe form
if (! empty($conf->global->MAIN_INFO_SOCIETE_MAIL) && ! empty($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT) &&
! empty($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL) )
{
// Define link to login card
$appli=constant('DOL_APPLICATION_TITLE');
if (! empty($conf->global->MAIN_APPLICATION_TITLE))
{
$appli=$conf->global->MAIN_APPLICATION_TITLE;
if (preg_match('/\d\.\d/', $appli))
{
if (! preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) $appli.=" (".DOL_VERSION.")"; // If new title contains a version that is different than core
}
else $appli.=" ".DOL_VERSION;
}
else $appli.=" ".DOL_VERSION;
$to=$adh->makeSubstitution($conf->global->MAIN_INFO_SOCIETE_MAIL);
$from=$conf->global->ADHERENT_MAIL_FROM;
$mailfile = new CMailFile(
$conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT,
'['.$appli.'] '.$conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT,
$to,
$from,
$adh->makeSubstitution($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL),
@ -297,7 +353,7 @@ if ($action == 'add')
}
else $urlback=$_SERVER["PHP_SELF"]."?action=added";
if (! empty($conf->global->MEMBER_NEWFORM_PAYONLINE))
if (! empty($conf->global->MEMBER_NEWFORM_PAYONLINE) && $conf->global->MEMBER_NEWFORM_PAYONLINE != '-1')
{
if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'all')
{
@ -308,7 +364,7 @@ if ($action == 'add')
{
if (! empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE))
{
$urlback.='&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . 'membersubscription' . $adh->ref, 2));
$urlback.='&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . 'membersubscription' . $adh->ref, 2));
}
else
{
@ -342,7 +398,7 @@ if ($action == 'add')
{
if (! empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE))
{
$urlback.='&securekey='.urlencode(dol_hash($conf->global->PAYPAL_SECURITY_TOKEN . 'membersubscription' . $adh->ref, 2));
$urlback.='&securekey='.urlencode(dol_hash($conf->global->PAYPAL_SECURITY_TOKEN . 'membersubscription' . $adh->ref, 2));
}
else
{
@ -359,7 +415,7 @@ if ($action == 'add')
{
if (! empty($conf->global->STRIPE_SECURITY_TOKEN_UNIQUE))
{
$urlback.='&securekey='.urlencode(dol_hash($conf->global->STRIPE_SECURITY_TOKEN . 'membersubscription' . $adh->ref, 2));
$urlback.='&securekey='.urlencode(dol_hash($conf->global->STRIPE_SECURITY_TOKEN . 'membersubscription' . $adh->ref, 2));
}
else
{
@ -376,14 +432,25 @@ if ($action == 'add')
if (! empty($entity)) $urlback.='&entity='.$entity;
dol_syslog("member ".$adh->ref." was created, we redirect to ".$urlback);
Header("Location: ".$urlback);
exit;
}
else
{
$error++;
$errmsg .= join('<br>',$adh->errors);
}
}
if (! $error)
{
$db->commit();
Header("Location: ".$urlback);
exit;
}
else
{
$db->rollback();
}
}
// Action called after a submitted was send and member created successfully

View File

@ -397,7 +397,7 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled))
$stripeToken = GETPOST("stripeToken",'alpha');
$email = GETPOST("email",'alpha');
$thirdparty_id=GETPOST('thirdparty_id', 'int');
$thirdparty_id=GETPOST('thirdparty_id', 'int'); // Note that for payment following online registration for members, this is empty because thirdparty is created once payment is confirmed by paymentok.php
$vatnumber = GETPOST('vatnumber','alpha');
dol_syslog("stripeToken = ".$stripeToken, LOG_DEBUG, 0, '_stripe');
@ -419,7 +419,7 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled))
if ($thirdparty_id > 0)
{
dol_syslog("Search existing customer profile for thirdparty_id=".$thirdparty_id, LOG_DEBUG, 0, '_stripe');
dol_syslog("Search existing Stripe customer profile for thirdparty_id=".$thirdparty_id, LOG_DEBUG, 0, '_stripe');
$service = 'StripeTest';
$servicestatus = 0;

View File

@ -281,6 +281,11 @@ if ($ispaymentok)
if (in_array('MEM', array_keys($tmptag)))
{
// Validate member
// Create subscription
// Create complementary actions (this include creation of thirdparty)
// Send confirmation email
$defaultdelay=1;
$defaultdelayunit='y';
@ -312,13 +317,26 @@ if ($ispaymentok)
// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)
if (! empty($FinalPaymentAmt) && $paymentTypeId > 0)
{
$result = $object->validate($user);
if ($result < 0 || empty($object->datevalid))
{
$error++;
$errmsg=$object->error;
$postactionmessages[] = $errmsg;
$postactionmessages = array_merge($postactionmessages, $object->errors);
$ispostactionok = -1;
}
// Subscription informations
$datesubscription=$object->datevalid;
if ($object->datefin > 0)
{
$datesubscription=dol_time_plus_duree($object->datefin,1,'d');
}
$datesubend=dol_time_plus_duree(dol_time_plus_duree($datesubscription,$defaultdelay,$defaultdelayunit),-1,'d');
$datesubend = null;
if ($datesubscription && $defaultdelay && $defaultdelayunit) $datesubend=dol_time_plus_duree(dol_time_plus_duree($datesubscription, $defaultdelay, $defaultdelayunit),-1,'d');
$paymentdate=$now;
$amount = $FinalPaymentAmt;
$label='Online subscription '.dol_print_date($now, 'standard').' using '.$paymentmethod.' from '.$ipaddress.' - Transaction ID = '.$TRANSACTIONID;
@ -328,6 +346,14 @@ if ($ispaymentok)
if ($paymentmethod == 'paybox') $accountid = $conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS;
if ($paymentmethod == 'paypal') $accountid = $conf->global->PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS;
if ($paymentmethod == 'stripe') $accountid = $conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS;
if ($accountid < 0)
{
$error++;
$errmsg='Setup of bank accout to use for payment is not correctly done for payment method '.$paymentmethod;
$postactionmessages[] = $errmsg;
$ispostactionok = -1;
}
$operation=$paymentType; // Payment mode code
$num_chq='';
$emetteur_nom='';
@ -344,23 +370,28 @@ if ($ispaymentok)
$db->begin();
// Create subscription
$crowid=$object->subscription($datesubscription, $amount, $accountid, $operation, $label, $num_chq, $emetteur_nom, $emetteur_banque, $datesubend);
if ($crowid <= 0)
if (! $error)
{
$error++;
$errmsg=$object->error;
$postactionmessages[] = $errmsg;
$ispostactionok = -1;
}
else
{
$postactionmessages[]='Subscription created';
$ispostactionok=1;
$crowid=$object->subscription($datesubscription, $amount, $accountid, $operation, $label, $num_chq, $emetteur_nom, $emetteur_banque, $datesubend);
if ($crowid <= 0)
{
$error++;
$errmsg=$object->error;
$postactionmessages[] = $errmsg;
$ispostactionok = -1;
}
else
{
$postactionmessages[]='Subscription created';
$ispostactionok=1;
}
}
if (! $error)
{
$result = $object->subscriptionComplementaryActions($crowid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom, $emetteur_banque, 1);
$autocreatethirdparty = 1;
$result = $object->subscriptionComplementaryActions($crowid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom, $emetteur_banque, $autocreatethirdparty);
if ($result < 0)
{
$error++;
@ -379,6 +410,49 @@ if ($ispaymentok)
}
}
if (! $error)
{
if ($paymentmethod == 'stripe' && $autocreatethirdparty && $option == 'bankviainvoice')
{
$thirdparty_id = $object->fk_soc;
dol_syslog("Search existing Stripe customer profile for thirdparty_id=".$thirdparty_id, LOG_DEBUG, 0, '_stripe');
$service = 'StripeTest';
$servicestatus = 0;
if (! empty($conf->global->STRIPE_LIVE) && ! GETPOST('forcesandbox','alpha'))
{
$service = 'StripeLive';
$servicestatus = 1;
}
$stripeacc = null; // No Oauth/connect use for public pages
$thirdparty = new Societe($db);
$thirdparty->fetch($thirdparty_id);
include_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php';
$stripe = new Stripe($db);
$customer = $stripe->customerStripe($thirdparty, $stripeacc, $servicestatus, 0);
if (! $customer && $TRANSACTIONID) // Not linked to a stripe customer, we make the link
{
$ch = \Stripe\Charge::retrieve($TRANSACTIONID); // contains the charge id
$stripecu = $ch->customer; // value 'cus_....'
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "societe_account (fk_soc, login, key_account, site, status, entity, date_creation, fk_user_creat)";
$sql .= " VALUES (".$object->fk_soc.", '', '".$db->escape($stripecu)."', 'stripe', " . $servicestatus . ", " . $conf->entity . ", '".$db->idate(dol_now())."', 0)";
$resql = $db->query($sql);
if (! $resql)
{
$error++;
$errmsg='Failed to save customer stripe id in database ; '.$db->lasterror();
$postactionmessages[] = $errmsg;
$ispostactionok = -1;
}
}
}
}
if (! $error)
{
$db->commit();
@ -394,8 +468,32 @@ if ($ispaymentok)
// Send confirmation Email
if ($object->email && $sendalsoemail)
{
$subjecttosend=$object->makeSubstitution($conf->global->ADHERENT_MAIL_COTIS_SUBJECT);
$texttosend=$object->makeSubstitution($adht->getMailOnSubscription());
$subject = '';
$msg= '';
// Send subscription email
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail=new FormMail($db);
// Set output language
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
$outputlangs->loadLangs(array("main", "members"));
// Get email content from templae
$arraydefaultmessage=null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION;
if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
{
$subject = $arraydefaultmessage->topic;
$msg = $arraydefaultmessage->content;
}
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnSubscription()), $substitutionarray, $outputlangs);
// Attach a file ?
$file='';
@ -414,6 +512,7 @@ if ($ispaymentok)
}
$result=$object->send_an_email($texttosend, $subjecttosend, $listofpaths, $listofnames, $listofmimes, "", "", 0, -1);
if ($result < 0)
{
$errmsg=$object->error;
@ -430,7 +529,7 @@ if ($ispaymentok)
}
else
{
$postactionmessages[] = 'Failed to get a valid value for "amount paid" or "payment type" to record the payment of subscription for member '.$tmptag['MEM'];
$postactionmessages[] = 'Failed to get a valid value for "amount paid" or "payment type" to record the payment of subscription for member '.$tmptag['MEM'].'. May be payment was already recorded.';
$ispostactionok = -1;
}
}
@ -547,7 +646,7 @@ if ($ispaymentok)
}
else
{
$postactionmessages[] = 'Failed to get a valid value for "amount paid" ('.$FinalPaymentAmt.') or "payment type" ('.$paymentType.') to record the payment of invoice '.$tmptag['INV'];
$postactionmessages[] = 'Failed to get a valid value for "amount paid" ('.$FinalPaymentAmt.') or "payment type" ('.$paymentType.') to record the payment of invoice '.$tmptag['INV'].'. May be payment was already recorded.';
$ispostactionok = -1;
}
}

View File

@ -539,6 +539,15 @@ if (empty($reshook))
}
}
// Links with users
$salesreps = GETPOST('commercial', 'array');
$result = $object->setSalesRep($salesreps);
if ($result < 0)
{
$error++;
setEventMessages($object->error, $object->errors, 'errors');
}
// Customer categories association
$custcats = GETPOST('custcats', 'array');
$result = $object->setCategories($custcats, 'customer');
@ -668,6 +677,15 @@ if (empty($reshook))
$error++;
}
// Links with users
$salesreps = GETPOST('commercial', 'array');
$result = $object->setSalesRep($salesreps);
if ($result < 0)
{
$error++;
setEventMessages($object->error, $object->errors, 'errors');
}
// Prevent thirdparty's emptying if a user hasn't rights $user->rights->categorie->lire (in such a case, post of 'custcats' is not defined)
if (! $error && !empty($user->rights->categorie->lire))
{
@ -1360,7 +1378,8 @@ else
print '<tr>';
print '<td>'.fieldLabel('AllocateCommercial','commercial_id').'</td>';
print '<td colspan="3" class="maxwidthonsmartphone">';
print $form->select_dolusers((! empty($object->commercial_id)?$object->commercial_id:$user->id),'commercial_id',1); // Add current user by default
$userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', 0, 1);
print $form->multiselectarray('commercial', $userlist, GETPOST('commercial', 'array'), null, null, null, null, "90%");
print '</td></tr>';
}
@ -1931,6 +1950,16 @@ else
print '<tr><td>'.fieldLabel('Capital','capital').'</td>';
print '<td colspan="3"><input type="text" name="capital" id="capital" size="10" value="'.$object->capital.'"> <font class="hideonsmartphone">'.$langs->trans("Currency".$conf->currency).'</font></td></tr>';
// Assign a Name
print '<tr>';
print '<td>'.fieldLabel('AllocateCommercial','commercial_id').'</td>';
print '<td colspan="3" class="maxwidthonsmartphone">';
$userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', 0, 1);
$arrayselected = GETPOST('commercial', 'array');
if (empty($arrayselected)) $arrayselected = $object->getSalesRepresentatives($user, 1);
print $form->multiselectarray('commercial', $userlist, $arrayselected, null, null, null, null, "90%");
print '</td></tr>';
// Default language
if (! empty($conf->global->MAIN_MULTILANGS))
{

View File

@ -1819,9 +1819,10 @@ class Societe extends CommonObject
* Return array of sales representatives
*
* @param User $user Object user
* @param int $mode 0=Array with properties, 1=Array of id.
* @return array Array of sales representatives of third party
*/
function getSalesRepresentatives(User $user)
function getSalesRepresentatives(User $user, $mode=0)
{
global $conf;
@ -1849,14 +1850,22 @@ class Societe extends CommonObject
while ($i < $num)
{
$obj = $this->db->fetch_object($resql);
$reparray[$i]['id']=$obj->rowid;
$reparray[$i]['lastname']=$obj->lastname;
$reparray[$i]['firstname']=$obj->firstname;
$reparray[$i]['email']=$obj->email;
$reparray[$i]['statut']=$obj->statut;
$reparray[$i]['entity']=$obj->entity;
$reparray[$i]['login']=$obj->login;
$reparray[$i]['photo']=$obj->photo;
if (empty($mode))
{
$reparray[$i]['id']=$obj->rowid;
$reparray[$i]['lastname']=$obj->lastname;
$reparray[$i]['firstname']=$obj->firstname;
$reparray[$i]['email']=$obj->email;
$reparray[$i]['statut']=$obj->statut;
$reparray[$i]['entity']=$obj->entity;
$reparray[$i]['login']=$obj->login;
$reparray[$i]['photo']=$obj->photo;
}
else
{
$reparray[]=$obj->rowid;
}
$i++;
}
return $reparray;
@ -3920,6 +3929,53 @@ class Societe extends CommonObject
return $error ? -1 : 1;
}
/**
* Sets sales representatives of the thirdparty
*
* @param int[]|int $salesrep User ID or array of user IDs
* @return int <0 if KO, >0 if OK
*/
public function setSalesRep($salesrep)
{
global $user;
// Handle single user
if (!is_array($salesrep)) {
$salesrep = array($salesrep);
}
// Get current users
$existing = $this->getSalesRepresentatives($user, 1);
// Diff
if (is_array($existing)) {
$to_del = array_diff($existing, $salesrep);
$to_add = array_diff($salesrep, $existing);
} else {
$to_del = array(); // Nothing to delete
$to_add = $salesrep;
}
$error = 0;
// Process
foreach ($to_del as $del) {
$this->del_commercial($user, $del);
}
foreach ($to_add as $add) {
$result = $this->add_commercial($user, $add);
if ($result < 0)
{
$error++;
$this->error = $c->error;
$this->errors = $c->errors;
break;
}
}
return $error ? -1 : 1;
}
/**
* Function used to replace a thirdparty id with another one.

View File

@ -504,40 +504,4 @@ class SocieteAccount extends CommonObject
{
$this->initAsSpecimenCommon();
}
/**
* Action executed by scheduler
* CAN BE A CRON TASK
*
* @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
*/
public function doScheduledJob()
{
global $conf, $langs;
$this->output = '';
$this->error='';
dol_syslog(__METHOD__, LOG_DEBUG);
// ...
return 0;
}
}
/**
* Class societeAccountLine. You can also remove this and generate a CRUD class for lines objects.
*/
/*
class societeAccountLine
{
// @var int ID
public $id;
// @var mixed Sample line property 1
public $prop1;
// @var mixed Sample line property 2
public $prop2;
}
*/

View File

@ -1,300 +0,0 @@
<?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@capnetworks.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* 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/societe/commerciaux.php
* \ingroup societe
* \brief Page of links to sales representatives
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
$langs->load("companies");
$langs->load("commercial");
$langs->load("customers");
$langs->load("suppliers");
$langs->load("banks");
// Security check
$socid = GETPOST('socid', 'int');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'societe','','');
$hookmanager->initHooks(array('salesrepresentativescard','globalcard'));
/*
* Actions
*/
if (! empty($socid) && $_GET["commid"])
{
$action = 'add';
if ($user->rights->societe->creer)
{
$object = new Societe($db);
$object->fetch($socid);
$parameters=array('id'=>$_GET["commid"]);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook)) $object->add_commercial($user, $_GET["commid"]);
header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$object->id);
exit;
}
else
{
header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$socid);
exit;
}
}
if (! empty($socid) && $_GET["delcommid"])
{
$action = 'delete';
if ($user->rights->societe->creer)
{
$object = new Societe($db);
$object->fetch($socid);
$parameters=array('id'=>$_GET["delcommid"]);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook)) $object->del_commercial($user, $_GET["delcommid"]);
header("Location: commerciaux.php?socid=".$object->id);
exit;
}
else
{
header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$socid);
exit;
}
}
/*
* View
*/
$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
llxHeader('',$langs->trans("ThirdParty"),$help_url);
$form = new Form($db);
if (! empty($socid))
{
$object = new Societe($db);
$result=$object->fetch($socid);
$action='view';
$head=societe_prepare_head2($object);
dol_fiche_head($head, 'salesrepresentative', $langs->trans("ThirdParty"), -1, 'company');
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';
print '<tr>';
print '<td class="titlefield">'.$langs->trans('CustomerCode').'</td><td'.(empty($conf->global->SOCIETE_USEPREFIX)?' colspan="3"':'').'>';
print $object->code_client;
if ($object->check_codeclient() <> 0) print ' '.$langs->trans("WrongCustomerCode");
print '</td>';
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<td>'.$langs->trans('Prefix').'</td><td>'.$object->prefix_comm.'</td>';
}
print '</td>';
print '</tr>';
// Liste les commerciaux
print '<tr><td>'.$langs->trans("SalesRepresentatives").'</td>';
print '<td colspan="3">';
$sql = "SELECT DISTINCT u.rowid, u.login, u.fk_soc, u.lastname, u.firstname, u.statut, u.entity, u.photo";
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
$sql .= " , ".MAIN_DB_PREFIX."societe_commerciaux as sc";
if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
{
$sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ug";
}
$sql .= " WHERE sc.fk_soc =".$object->id;
$sql .= " AND sc.fk_user = u.rowid";
if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
{
$sql.= " AND ((ug.fk_user = sc.fk_user";
$sql.= " AND ug.entity = ".$conf->entity.")";
$sql.= " OR u.admin = 1)";
}
else
$sql.= " AND u.entity IN (0,".$conf->entity.")";
$sql .= " ORDER BY u.lastname ASC ";
dol_syslog('societe/commerciaux.php::list salesman sql = '.$sql,LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
$tmpuser = new User($db);
while ($i < $num)
{
$obj = $db->fetch_object($resql);
$parameters=array('socid'=>$object->id);
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$obj,$action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
$tmpuser->id = $obj->rowid;
$tmpuser->firstname = $obj->firstname;
$tmpuser->lastname = $obj->lastname;
$tmpuser->statut = $obj->statut;
$tmpuser->login = $obj->login;
$tmpuser->entity = $obj->entity;
$tmpuser->societe_id = $obj->fk_soc;
$tmpuser->photo = $obj->photo;
print $tmpuser->getNomUrl(-1);
/*print '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->rowid.'">';
print img_object($langs->trans("ShowUser"),"user").' ';
print dolGetFirstLastname($obj->firstname, $obj->lastname)."\n";
print '</a>';*/
print '&nbsp;';
if ($user->rights->societe->creer)
{
print '<a href="'.$_SERVER["PHP_SELF"].'?socid='.$object->id.'&amp;delcommid='.$obj->rowid.'">';
print img_delete();
print '</a>';
}
print '<br>';
$i++;
}
$db->free($resql);
}
else
{
dol_print_error($db);
}
if($i == 0) { print $langs->trans("NoSalesRepresentativeAffected"); }
print "</td></tr>";
print '</table>';
print "</div>\n";
dol_fiche_end();
if ($user->rights->societe->creer && $user->rights->societe->client->voir)
{
/*
* Liste
*
*/
$langs->load("users");
$title=$langs->trans("ListOfUsers");
$sql = "SELECT DISTINCT u.rowid, u.lastname, u.firstname, u.login, u.email, u.statut, u.fk_soc, u.photo";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
{
$sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ug";
$sql.= " WHERE ((ug.fk_user = u.rowid";
$sql.= " AND ug.entity = ".$conf->entity.")";
$sql.= " OR u.admin = 1)";
}
else
$sql.= " WHERE u.entity IN (0,".$conf->entity.")";
if (! empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND u.statut<>0 ";
$sql.= " ORDER BY u.lastname ASC ";
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
print load_fiche_titre($title);
// Lignes des titres
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Login").'</td>';
print '<td>'.$langs->trans("Status").'</td>';
print '<td>&nbsp;</td>';
print "</tr>\n";
$var=True;
$tmpuser=new User($db);
while ($i < $num)
{
$obj = $db->fetch_object($resql);
print "<tr ".$bc[$var]."><td>";
$tmpuser->id=$obj->rowid;
$tmpuser->firstname=$obj->firstname;
$tmpuser->lastname=$obj->lastname;
$tmpuser->statut=$obj->statut;
$tmpuser->login=$obj->login;
$tmpuser->email=$obj->email;
$tmpuser->societe_id=$obj->fk_soc;
$tmpuser->photo=$obj->photo;
print $tmpuser->getNomUrl(-1);
print '</td>';
print '<td>'.$obj->login.'</td>';
print '<td>'.$tmpuser->getLibStatut(2).'</td>';
print '<td><a href="'.$_SERVER["PHP_SELF"].'?socid='.$object->id.'&amp;commid='.$obj->rowid.'">'.$langs->trans("Add").'</a></td>';
print '</tr>'."\n";
$i++;
}
print "</table>";
$db->free($resql);
}
else
{
dol_print_error($db);
}
}
}
llxFooter();
$db->close();

View File

@ -24,18 +24,7 @@ if (empty($conf) || ! is_object($conf))
// Sale representative
print '<tr><td>';
print '<table width="100%" class="nobordernopadding"><tr><td>';
print $langs->trans('SalesRepresentatives');
print '</td><td align="right">';
if ($user->rights->societe->creer && $user->rights->societe->client->voir)
{
print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$object->id.'">'.img_edit('',1).'</a>';
}
else
{
print '&nbsp;';
}
print '</td></tr></table>';
print '</td>';
print '<td colspan="3">';
@ -44,7 +33,6 @@ $nbofsalesrepresentative=count($listsalesrepresentatives);
if ($nbofsalesrepresentative > 0)
{
$userstatic=new User($db);
$i=0;
foreach($listsalesrepresentatives as $val)
{
$userstatic->id=$val['id'];
@ -56,27 +44,7 @@ if ($nbofsalesrepresentative > 0)
$userstatic->email=$val['email'];
$userstatic->entity=$val['entity'];
print $userstatic->getNomUrl(-1);
$i++;
if ($i < $nbofsalesrepresentative)
{
print ' ';
if ($i >= 3) // We print only number
{
$userstatic->id=0;
$userstatic->login='';
$userstatic->lastname='';
$userstatic->firstname='';
$userstatic->statut=0;
$userstatic->photo='';
$userstatic->email='';
$userstatic->entity=0;
print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$object->id.'">';
print $userstatic->getNomUrl(-1, 'nolink', 0, 1);
print '+'.($nbofsalesrepresentative - $i);
print '</a>';
break;
}
}
print ' ';
}
}
else print '<span class="opacitymedium">'.$langs->trans("NoSalesRepresentativeAffected").'</span>';

View File

@ -1345,7 +1345,8 @@ div.nopadding {
vertical-align: text-bottom;
}
.fiche .arearef img.pictoedit, .fiche .arearef span.pictoedit,
.fiche .fichecenter img.pictoedit, .fiche .fichecenter span.pictoedit {
.fiche .fichecenter img.pictoedit, .fiche .fichecenter span.pictoedit,
.tagtdnote span.pictoedit {
opacity: 0.4;
}
.colorthumb {

View File

@ -1350,7 +1350,8 @@ table.noborder tr.liste_titre td {
vertical-align: text-bottom;
}
.fiche .arearef img.pictoedit, .fiche .arearef span.pictoedit,
.fiche .fichecenter img.pictoedit, .fiche .fichecenter span.pictoedit {
.fiche .fichecenter img.pictoedit, .fiche .fichecenter span.pictoedit,
.tagtdnote span.pictoedit {
opacity: 0.9;
}
img.hideonsmartphone.pictoactionview {

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) - 2013-2016 Jean-François FERRY <hello@librethic.io>
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
/* Copyright (C) 2013-2016 Jean-François FERRY <hello@librethic.io>
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -17,9 +17,8 @@
*/
/**
* Card of ticket
*
* @package ticketsup
* \file htdocs/ticketsup/card.php
* \ingroup ticketsup
*/
require '../main.inc.php';
@ -71,7 +70,7 @@ if (GETPOST('modelselected')) {
$url_page_current = DOL_URL_ROOT.'/ticketsup/card.php';
if ($id || $track_id || $ref) {
$res = $object->fetch($id, $track_id, $ref);
$res = $object->fetch($id, $ref, $track_id);
}
// Security check
@ -99,6 +98,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be inc
$userstat = new User($db);
$form = new Form($db);
$formticket = new FormTicketsup($db);
$formproject = new FormProjets($db);
if ($action == 'view' || $action == 'add_message' || $action == 'close' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'reopen' || $action == 'editsubject' || $action == 'edit_extrafields' || $action == 'set_extrafields' || $action == 'classify' || $action == 'sel_contract' || $action == 'edit_message_init' || $action == 'set_status' || $action == 'dellink') {
@ -234,6 +234,40 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
$morehtmlref .= '<br>' . $langs->trans("CreatedBy") . ' ';
$morehtmlref .= $object->origin_email . ' <small>(' . $langs->trans("TicketEmailOriginIssuer") . ')</small>';
}
// Project
if (! empty($conf->projet->enabled))
{
$langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->ticketsup->write)
{
if ($action != 'classify')
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref.='<input type="hidden" name="action" value="classin">';
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (! empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
$morehtmlref.=$proj->ref;
$morehtmlref.='</a>';
} else {
$morehtmlref.='';
}
}
}
$morehtmlref.='</div>';
$linkback = '<a href="' . dol_buildpath('/ticketsup/list.php', 1) . '"><strong>' . $langs->trans("BackToList") . '</strong></a> ';
@ -308,29 +342,8 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
}
print '</td></tr>';
// Project
if (!empty($conf->projet->enabled)) {
$langs->load('projects');
print '<tr><td height="10">';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Project');
print '</td>';
if ($action != 'classify' && $user->rights->ticketsup->write) {
print '<td align="right"><a href="' . $url_page_current . '?action=classify&amp;track_id=' . $object->track_id . '">' . img_edit($langs->trans('SetProject')) . '</a></td>';
}
print '</tr></table>';
print '</td><td colspan="3">';
if ($action == 'classify') {
$form->form_project($url_page_current . '?track_id=' . $object->track_id, $object->socid, $object->fk_project, 'projectid');
} else {
$form->form_project($url_page_current . '?track_id=' . $object->track_id, $object->socid, $object->fk_project, 'none');
}
print '</td></tr>';
}
// User assigned
print '<tr><td>' . $langs->trans("UserAssignedTo") . '</td><td>';
print '<tr><td>' . $langs->trans("AssignedTo") . '</td><td>';
if ($object->fk_user_assign > 0) {
$userstat->fetch($object->fk_user_assign);
print $userstat->getNomUrl(1);
@ -339,17 +352,17 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
}
// Show user list to assignate one if status is "read"
if (GETPOST('set') == "assign_ticket" && $object->fk_statut < 8 && !$user->societe_id && $user->rights->ticketsup->write) {
if (GETPOST('set','alpha') == "assign_ticket" && $object->fk_statut < 8 && !$user->societe_id && $user->rights->ticketsup->write) {
print '<form method="post" name="ticketsup" enctype="multipart/form-data" action="' . $url_page_current . '">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="assign_user">';
print '<input type="hidden" name="track_id" value="' . $object->track_id . '">';
print '<label for="fk_user_assign">' . $langs->trans("AssignUser") . '</label> ';
print $form->select_dolusers($user->id, 'fk_user_assign', 0);
print $form->select_dolusers($user->id, 'fk_user_assign', 1);
print ' <input class="button" type="submit" name="btn_assign_user" value="' . $langs->trans("Validate") . '" />';
print '</form>';
}
if ($object->fk_statut < 8 && GETPOST('set') != "assign_ticket" && $user->rights->ticketsup->manage) {
if ($object->fk_statut < 8 && GETPOST('set','alpha') != "assign_ticket" && $user->rights->ticketsup->manage) {
print '<a href="' . $url_page_current . '?track_id=' . $object->track_id . '&action=view&set=assign_ticket">' . img_picto('', 'edit') . ' ' . $langs->trans('Modify') . '</a>';
}
print '</td></tr>';
@ -425,13 +438,14 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
print '</table>';
// View Original message
$actionobject->viewTicketOriginalMessage($user, $action);
// Fin colonne gauche et début colonne droite
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
// View Original message
$actionobject->viewTicketOriginalMessage($user, $action, $object);
/***************************************************
*
* Classification and actions on ticket
@ -440,7 +454,8 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
/*
* Ticket properties
*/
print '<table class="border" style="width:100%;" >';
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '<table class="border centpercent margintable">';
print '<tr class="liste_titre">';
print '<td colspan="2">';
print $langs->trans('Properties');
@ -496,31 +511,32 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
// Type
print '<tr><td width="40%">' . $langs->trans("Type") . '</td><td>';
print $object->type_label;
if ($user->admin && !$noadmininfo) {
/*if ($user->admin && !$noadmininfo) {
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}
}*/
print '</td></tr>';
// Category
print '<tr><td>' . $langs->trans("Category") . '</td><td>';
print $object->category_label;
if ($user->admin && !$noadmininfo) {
/*if ($user->admin && !$noadmininfo) {
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}
}*/
print '</td></tr>';
// Severity
print '<tr><td>' . $langs->trans("TicketSeverity") . '</td><td>';
print $object->severity_label;
if ($user->admin && !$noadmininfo) {
/*if ($user->admin && !$noadmininfo) {
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}
}*/
print '</td></tr>';
}
print '</table>'; // End table actions
print '</div>';
// Display navbar with links to change ticket status
print '<!-- navbar with status -->';
@ -529,117 +545,120 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
}
print load_fiche_titre($langs->trans('Contacts'), '', 'title_companies.png');
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
print load_fiche_titre($langs->trans('Contacts'), '', 'title_companies.png');
print '<div class="div-table-responsive-no-min">';
print '<div class="tagtable centpercent noborder allwidth">';
print '<div class="tagtr liste_titre">';
print '<div class="div-table-responsive-no-min">';
print '<div class="tagtable centpercent noborder allwidth">';
print '<div class="tagtd ">' . $langs->trans("Source") . '</div>
<div class="tagtd">' . $langs->trans("Company") . '</div>
<div class="tagtd">' . $langs->trans("Contacts") . '</div>
<div class="tagtd">' . $langs->trans("ContactType") . '</div>
<div class="tagtd">' . $langs->trans("Phone") . '</div>
<div class="tagtd" align="center">' . $langs->trans("Status") . '</div>';
print '</div><!-- tagtr -->';
print '<div class="tagtr liste_titre">';
print '<div class="tagtd">' . $langs->trans("Source") . '</div>
<div class="tagtd">' . $langs->trans("Company") . '</div>
<div class="tagtd">' . $langs->trans("Contacts") . '</div>
<div class="tagtd">' . $langs->trans("ContactType") . '</div>
<div class="tagtd">' . $langs->trans("Phone") . '</div>
<div class="tagtd" align="center">' . $langs->trans("Status") . '</div>';
print '</div><!-- tagtr -->';
// Contact list
$companystatic = new Societe($db);
$contactstatic = new Contact($db);
$userstatic = new User($db);
foreach (array('internal', 'external') as $source) {
$tmpobject = $object;
$tab = $tmpobject->listeContact(-1, $source);
$num = count($tab);
$i = 0;
while ($i < $num) {
$var = !$var;
print '<div class="tagtr ' . ($var ? 'pair' : 'impair') . '">';
// Contact list
$companystatic = new Societe($db);
$contactstatic = new Contact($db);
$userstatic = new User($db);
foreach (array('internal', 'external') as $source) {
$tmpobject = $object;
$tab = $tmpobject->listeContact(-1, $source);
$num = count($tab);
$i = 0;
while ($i < $num) {
$var = !$var;
print '<div class="tagtr ' . ($var ? 'pair' : 'impair') . '">';
print '<div class="tagtd" align="left">';
if ($tab[$i]['source'] == 'internal') {
echo $langs->trans("User");
}
print '<div class="tagtd" align="left">';
if ($tab[$i]['source'] == 'internal') {
echo $langs->trans("User");
}
if ($tab[$i]['source'] == 'external') {
echo $langs->trans("ThirdPartyContact");
}
if ($tab[$i]['source'] == 'external') {
echo $langs->trans("ThirdPartyContact");
}
print '</div>';
print '<div class="tagtd" align="left">';
print '</div>';
print '<div class="tagtd" align="left">';
if ($tab[$i]['socid'] > 0) {
$companystatic->fetch($tab[$i]['socid']);
echo $companystatic->getNomUrl(1);
}
if ($tab[$i]['socid'] < 0) {
echo $conf->global->MAIN_INFO_SOCIETE_NOM;
}
if (!$tab[$i]['socid']) {
echo '&nbsp;';
}
print '</div>';
if ($tab[$i]['socid'] > 0) {
$companystatic->fetch($tab[$i]['socid']);
echo $companystatic->getNomUrl(1);
}
if ($tab[$i]['socid'] < 0) {
echo $conf->global->MAIN_INFO_SOCIETE_NOM;
}
if (!$tab[$i]['socid']) {
echo '&nbsp;';
}
print '</div>';
print '<div class="tagtd">';
if ($tab[$i]['source'] == 'internal') {
if ($userstatic->fetch($tab[$i]['id'])) {
print $userstatic->getNomUrl(1);
}
}
if ($tab[$i]['source'] == 'external') {
if ($contactstatic->fetch($tab[$i]['id'])) {
print $contactstatic->getNomUrl(1);
}
}
print ' </div>
<div class="tagtd">' . $tab[$i]['libelle'] . '</div>';
print '<div class="tagtd">';
if ($tab[$i]['source'] == 'internal') {
if ($userstatic->fetch($tab[$i]['id'])) {
print $userstatic->getNomUrl(1);
}
}
if ($tab[$i]['source'] == 'external') {
if ($contactstatic->fetch($tab[$i]['id'])) {
print $contactstatic->getNomUrl(1);
}
}
print ' </div>
<div class="tagtd">' . $tab[$i]['libelle'] . '</div>';
print '<div class="tagtd">';
print '<div class="tagtd">';
print dol_print_phone($tab[$i]['phone'], '', '', '', AC_TEL).'<br>';
print dol_print_phone($tab[$i]['phone'], '', '', '', AC_TEL).'<br>';
if (! empty($tab[$i]['phone_perso'])) {
//print img_picto($langs->trans('PhonePerso'),'object_phoning.png','',0,0,0).' ';
print '<br>'.dol_print_phone($tab[$i]['phone_perso'], '', '', '', AC_TEL).'<br>';
}
if (! empty($tab[$i]['phone_mobile'])) {
//print img_picto($langs->trans('PhoneMobile'),'object_phoning.png','',0,0,0).' ';
print dol_print_phone($tab[$i]['phone_mobile'], '', '', '', AC_TEL).'<br>';
}
print '</div>';
if (! empty($tab[$i]['phone_perso'])) {
//print img_picto($langs->trans('PhonePerso'),'object_phoning.png','',0,0,0).' ';
print '<br>'.dol_print_phone($tab[$i]['phone_perso'], '', '', '', AC_TEL).'<br>';
}
if (! empty($tab[$i]['phone_mobile'])) {
//print img_picto($langs->trans('PhoneMobile'),'object_phoning.png','',0,0,0).' ';
print dol_print_phone($tab[$i]['phone_mobile'], '', '', '', AC_TEL).'<br>';
}
print '</div>';
print '<div class="tagtd" align="center">';
if ($object->statut >= 0) {
echo '<a href="contact.php?track_id=' . $object->track_id . '&amp;action=swapstatut&amp;ligne=' . $tab[$i]['rowid'] . '">';
}
print '<div class="tagtd" align="center">';
if ($object->statut >= 0) {
echo '<a href="contact.php?track_id=' . $object->track_id . '&amp;action=swapstatut&amp;ligne=' . $tab[$i]['rowid'] . '">';
}
if ($tab[$i]['source'] == 'internal') {
$userstatic->id = $tab[$i]['id'];
$userstatic->lastname = $tab[$i]['lastname'];
$userstatic->firstname = $tab[$i]['firstname'];
echo $userstatic->LibStatut($tab[$i]['statuscontact'], 3);
}
if ($tab[$i]['source'] == 'external') {
$contactstatic->id = $tab[$i]['id'];
$contactstatic->lastname = $tab[$i]['lastname'];
$contactstatic->firstname = $tab[$i]['firstname'];
echo $contactstatic->LibStatut($tab[$i]['statuscontact'], 3);
}
if ($object->statut >= 0) {
echo '</a>';
}
if ($tab[$i]['source'] == 'internal') {
$userstatic->id = $tab[$i]['id'];
$userstatic->lastname = $tab[$i]['lastname'];
$userstatic->firstname = $tab[$i]['firstname'];
echo $userstatic->LibStatut($tab[$i]['statuscontact'], 3);
}
if ($tab[$i]['source'] == 'external') {
$contactstatic->id = $tab[$i]['id'];
$contactstatic->lastname = $tab[$i]['lastname'];
$contactstatic->firstname = $tab[$i]['firstname'];
echo $contactstatic->LibStatut($tab[$i]['statuscontact'], 3);
}
if ($object->statut >= 0) {
echo '</a>';
}
print '</div>';
print '</div>';
print '</div><!-- tagtr -->';
print '</div><!-- tagtr -->';
$i++;
}
$i++;
}
}
print '</div><!-- contact list -->';
print '</div>';
}
print '</div><!-- contact list -->';
print '</div>';
// Contract
if ($action == 'sel_contract') {
if (!empty($conf->contrat->enabled)) {
@ -706,8 +725,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
print '</div>';
if ($action == 'view' || $action == 'edit_message_init') {
print '<div class="fichecenter">'
. '<div class="">';
print '<div class="fichecenter"><div class="">';
//print '<div style="float: left; width:49%; margin-right: 1%;">';
// Message list
@ -716,7 +734,6 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
$actionobject->viewTicketTimelineMessages($show_private_message, true, $object);
print '</div><!-- fichehalfleft --> ';
print '</div><!-- fichecenter -->';
print '<br style="clear: both">';
} elseif ($action == 'add_message') {

Some files were not shown because too many files have changed in this diff Show More